Skip to content

Add sys_presence system object to service-realtime package#1020

Merged
hotlong merged 4 commits intomainfrom
copilot/add-sys-presence-to-service-realtime
Mar 31, 2026
Merged

Add sys_presence system object to service-realtime package#1020
hotlong merged 4 commits intomainfrom
copilot/add-sys-presence-to-service-realtime

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Runtime hits no such table: sys_presence because the object was never defined or registered. Per system architecture, sys_-prefixed objects belong to their domain package — presence belongs to service-realtime.

Changes

  • SystemObjectName.PRESENCE — New 'sys_presence' constant in @objectstack/spec/system
  • SysPresence object definitionpackages/services/service-realtime/src/objects/sys-presence.object.ts with fields aligned to PresenceStateSchema protocol (user_id, session_id, status, last_seen, current_location, device, custom_status, metadata)
  • Plugin registrationRealtimeServicePlugin.init() registers via app.com.objectstack.service.realtime convention (same pattern as MetadataPlugin, AIServicePlugin)
  • ExportsSysPresence exported from @objectstack/service-realtime root
  • ROADMAP.md / CHANGELOG.md — Updated system object naming table and changelog
import { SystemObjectName } from '@objectstack/spec/system';
import { SysPresence } from '@objectstack/service-realtime';

// Protocol constant
const records = await engine.find(SystemObjectName.PRESENCE, { filters: ['status', '=', 'online'] });

// Object definition: namespace='sys', name='presence' → tableName auto-derived as 'sys_presence'
console.log(SysPresence.tableName); // 'sys_presence'

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectstack-play Ready Ready Preview, Comment Mar 31, 2026 10:20am
spec Ready Ready Preview, Comment Mar 31, 2026 10:20am

Request Review

Copilot AI and others added 2 commits March 31, 2026 09:45
- Add PRESENCE constant to SystemObjectName in @objectstack/spec
- Create sys-presence.object.ts with fields matching PresenceStateSchema
- Register sys_presence in RealtimeServicePlugin via app convention
- Export SysPresence from @objectstack/service-realtime
- Add tests for object definition and SystemObjectName constant
- Update ROADMAP.md system object naming table
- Update CHANGELOG.md with architecture change

Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/8eb9f944-6c43-4378-b0a8-b84aaf261524

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Add sys_presence system object to service-realtime package Add sys_presence system object to service-realtime package Mar 31, 2026
Copilot AI requested a review from hotlong March 31, 2026 09:50
@hotlong hotlong marked this pull request as ready for review March 31, 2026 09:51
Copilot AI review requested due to automatic review settings March 31, 2026 09:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing sys_presence system object to the realtime domain so the runtime can discover/register it and avoid no such table: sys_presence errors, while also exposing a protocol constant for consistent references.

Changes:

  • Added SystemObjectName.PRESENCE = 'sys_presence' (plus tests) in @objectstack/spec/system.
  • Introduced SysPresence ObjectSchema (and tests) in @objectstack/service-realtime.
  • Registered SysPresence for ObjectQL auto-discovery via the app.com.objectstack.service.realtime convention and exported it from the package root; updated ROADMAP/CHANGELOG entries.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ROADMAP.md Adds SystemObjectName.PRESENCEsys_presence to the system object naming table.
packages/spec/src/system/constants/system-names.ts Introduces the PRESENCE system object name constant.
packages/spec/src/system/constants/system-names.test.ts Extends constant coverage to include PRESENCE.
packages/services/service-realtime/src/realtime-service-plugin.ts Registers realtime system objects under the app.* service convention for ObjectQL discovery.
packages/services/service-realtime/src/objects/sys-presence.object.ts Defines the SysPresence object schema, fields, and indexes.
packages/services/service-realtime/src/objects/sys-presence.object.test.ts Adds unit tests validating the SysPresence schema shape and defaults.
packages/services/service-realtime/src/objects/index.ts Barrel export for realtime-owned system objects.
packages/services/service-realtime/src/index.ts Exposes SysPresence from @objectstack/service-realtime root.
CHANGELOG.md Documents the addition of sys_presence and the new spec constant.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions github-actions bot added documentation Improvements or additions to documentation protocol:system tests size/m labels Mar 31, 2026
@hotlong hotlong merged commit 63d9c43 into main Mar 31, 2026
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/m tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

将 sys_presence 系统对象定义纳入 service-realtime 软件包,完善 Presence 架构归属

3 participants