Skip to content

agent-event-service Specification

Scope

@robota-sdk/agent-event-service is a private, thin re-export layer that surfaces all event service types and implementations owned by @robota-sdk/agent-core. It exists so that consumers that previously depended on this package by name can continue to import from @robota-sdk/agent-event-service without requiring a migration to @robota-sdk/agent-core import paths.

This package owns no types, no implementations, and no business logic. Every symbol re-exported here is defined and maintained as SSOT in @robota-sdk/agent-core.

Boundaries

  • Does not own any type definitions. All interfaces, type aliases, and classes are defined in @robota-sdk/agent-core.
  • Does not own any runtime logic. Implementations (DefaultEventService, StructuredEventService, ObservableEventService, AbstractEventService) live in @robota-sdk/agent-core.
  • Does not own event name constants (TASK_EVENTS, TASK_EVENT_PREFIX, USER_EVENTS, USER_EVENT_PREFIX). These are defined in @robota-sdk/agent-core.
  • Not published to npm ("private": true). It is a workspace-internal package only.
  • Consumers should prefer importing from @robota-sdk/agent-core directly for new code. This package is maintained for existing dependency paths only.

Architecture Overview

@robota-sdk/agent-event-service
└── src/index.ts   ← single file, 100% re-exports from @robota-sdk/agent-core

         └──► @robota-sdk/agent-core   ← SSOT for all event types and implementations

The package contains exactly one source file (src/index.ts) with no logic. All export type { ... } and export { ... } statements forward symbols from @robota-sdk/agent-core. No transformations, wrappers, or additional logic are introduced.

Type Ownership

This package owns zero SSOT types. All types below are defined in @robota-sdk/agent-core and re-exported here for compatibility.

TypeSSOT LocationPurpose
IEventService@robota-sdk/agent-coreContract for event emission and subscription
IBaseEventData@robota-sdk/agent-coreBase shape for all event payloads
IAgentEventData@robota-sdk/agent-coreAgent-scoped event payload shape
IExecutionEventData@robota-sdk/agent-coreExecution-scoped event payload shape
IToolEventData@robota-sdk/agent-coreTool-scoped event payload shape
IEventContext@robota-sdk/agent-coreContext attached to each emitted event
IEventServiceOwnerBinding@robota-sdk/agent-coreBinding contract between an owner and its event service
IOwnerPathSegment@robota-sdk/agent-coreSingle segment of the owner path hierarchy
TEventListener@robota-sdk/agent-coreListener callback type for event subscriptions
TEventLoggerData@robota-sdk/agent-coreData shape passed to event loggers
TEventUniversalValue@robota-sdk/agent-coreScalar value type used in event payloads
IEventObjectValue@robota-sdk/agent-coreObject value type used in event payloads
TEventExtensionValue@robota-sdk/agent-coreExtension value type for custom event fields
TUserEvent@robota-sdk/agent-coreUnion type of all user-defined event names

Public API Surface

All exports are re-exports from @robota-sdk/agent-core. The table below lists every symbol currently exported by src/index.ts.

Type Exports

ExportKindDescription
IEventServiceinterfacePrimary contract for event services
IBaseEventDatainterfaceBase event payload structure
IAgentEventDatainterfaceAgent-level event payload
IExecutionEventDatainterfaceExecution-level event payload
IToolEventDatainterfaceTool-level event payload
IEventContextinterfaceEvent emission context
IEventServiceOwnerBindinginterfaceOwner–service binding contract
IOwnerPathSegmentinterfaceOwner path hierarchy segment
TEventListenertype aliasEvent listener callback signature
TEventLoggerDatatype aliasLogger data shape
TEventUniversalValuetype aliasScalar value union for event fields
IEventObjectValueinterfaceObject value shape for event fields
TEventExtensionValuetype aliasExtension value union for event fields
TUserEventtype aliasUser-defined event name union

Value Exports

ExportKindDescription
AbstractEventServiceabstract classBase class for all event service implementations
DefaultEventServiceclassNull-object implementation (no-op event service)
StructuredEventServiceclassFull implementation with structured event emission
ObservableEventServiceclassObservable-pattern event service implementation
DEFAULT_ABSTRACT_EVENT_SERVICEconstShared singleton of the default (no-op) service
isDefaultEventServicefunctionType guard to check if a service is the default no-op
bindEventServiceOwnerfunctionBinds an owner object to an event service
bindWithOwnerPathfunctionBinds a service with an explicit owner path
composeEventNamefunctionComposes a namespaced event name string
TASK_EVENTSconstMap of task event name constants
TASK_EVENT_PREFIXconstPrefix string for all task event names
USER_EVENTSconstMap of user event name constants
USER_EVENT_PREFIXconstPrefix string for all user event names

Extension Points

This package exposes no extension points of its own. Extension is performed through @robota-sdk/agent-core:

  • Extend AbstractEventService (from @robota-sdk/agent-core) to implement a custom event service.
  • Implement IEventService (from @robota-sdk/agent-core) directly for a fully custom implementation.

Error Taxonomy

This package defines no error types. It contains no runtime logic and cannot throw package-specific errors. Any errors originate in @robota-sdk/agent-core implementations.

Test Strategy

No tests are required or maintained in this package. The package contains a single file with pure re-exports and no logic to test.

The vitest devDependency and test script are present for workspace consistency. The script runs with --passWithNoTests.

Logic correctness is validated by tests in @robota-sdk/agent-core, which owns all implementations.

Class Contract Registry

This package contains no classes, no implements clauses, and no extends clauses. All class definitions are in @robota-sdk/agent-core.

Export re-exportedDefined inContract
AbstractEventService@robota-sdk/agent-coreImplements IEventService
DefaultEventService@robota-sdk/agent-coreExtends AbstractEventService (null-object)
StructuredEventService@robota-sdk/agent-coreExtends AbstractEventService
ObservableEventService@robota-sdk/agent-coreExtends AbstractEventService

Dependencies

DependencyTypePurpose
@robota-sdk/agent-coreproduction (workspace:*)SSOT for all re-exported types and implementations

No other production dependencies. Build tooling (tsup, typescript, vitest, rimraf) are devDependencies only.

Known Consumers

ConsumerImport pattern
agent-playgroundImports event types and services by name from this package
agent-teamImports event types and services by name from this package

Released under the MIT License.