Skip to content

Add registerEvent to the Swift SDK #126

Description

@V3RON

Part of #95. Needs #124. Can run alongside #127.

Why

Swift apps post events that agents can't discover. They need a way to declare them, like registerTool.

Expected outcome

registerEvent(EventDescriptor) throws -> EventRegistration in the Swift core, shaped like registerTool. The SDK sends a snapshot of all declared events after every ack that carries event_registry: true, and a delta for each later declaration or disposal.

Constraints and non-goals

  • With no event_registry flag in the ack (an older CLI), the SDK sends no event frames and the session keeps working.
  • Declared names follow the posted-name rule (any string up to 4096 characters).
  • No development warnings for undeclared names or failing payloads; that's React Native only.

How we know it is done

  1. The Swift suite passes fixtures/event-descriptors.json.
  2. Every ack carrying event_registry: true, including the ack after a resume, is followed by a snapshot of the current declarations.
  3. Calling the returned registration's disposer sends a remove delta.
  4. With no flag in the ack, no event frames are sent.
  5. A frames fixture covers the snapshot and both delta operations, and the Swift suite passes it.

Alternatives considered

none

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:native-corepackages/native Swift and Kotlin coreplatform:iosAffects the iOS SDK or iOS buildsstatus:readySpec and fix direction are clear; an agent can pick it uptype:featureSomething Appduct should do that it does not today

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions