Skip to content

Add sys_presence system object to service-realtime package - #1020

Merged
hotlong merged 4 commits into
mainfrom
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 into
mainfrom
copilot/add-sys-presence-to-service-realtime

Conversation

CopilotAI commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

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 constantconstrecords=awaitengine.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

vercelBot commented Mar 31, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
objectstack-playReadyReadyPreview, CommentMar 31, 2026 10:20am
specReadyReadyPreview, CommentMar 31, 2026 10:20am

Request Review

CopilotAIand 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>
CopilotAI changed the title [WIP] Add sys_presence system object to service-realtime packageAdd sys_presence system object to service-realtime packageMar 31, 2026
CopilotAI requested a review from hotlongMarch 31, 2026 09:50
@hotlong
hotlong marked this pull request as ready for review March 31, 2026 09:51
CopilotAI review requested due to automatic review settings March 31, 2026 09:51

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 SysPresenceObjectSchema (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
FileDescription
ROADMAP.mdAdds SystemObjectName.PRESENCEsys_presence to the system object naming table.
packages/spec/src/system/constants/system-names.tsIntroduces the PRESENCE system object name constant.
packages/spec/src/system/constants/system-names.test.tsExtends constant coverage to include PRESENCE.
packages/services/service-realtime/src/realtime-service-plugin.tsRegisters realtime system objects under the app.* service convention for ObjectQL discovery.
packages/services/service-realtime/src/objects/sys-presence.object.tsDefines the SysPresence object schema, fields, and indexes.
packages/services/service-realtime/src/objects/sys-presence.object.test.tsAdds unit tests validating the SysPresence schema shape and defaults.
packages/services/service-realtime/src/objects/index.tsBarrel export for realtime-owned system objects.
packages/services/service-realtime/src/index.tsExposes SysPresence from @objectstack/service-realtime root.
CHANGELOG.mdDocuments the addition of sys_presence and the new spec constant.

Comment threadpackages/services/service-realtime/src/objects/sys-presence.object.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:systemsize/mtests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants

@hotlong