@canonmsg/core 0.17.1 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { AGENT_CAPABILITIES, CLAUDE_PERMISSION_MODE_OPTIONS, } from './types.js';
2
2
  export { resolveCanonBaseUrl } from './base-url.js';
3
3
  export { DEFAULT_BASE_URL, DEFAULT_STREAM_URL, DEFAULT_RTDB_URL, FIREBASE_WEB_API_KEY } from './constants.js';
4
- export type { AddMemberResult, AgentCapabilities, AgentClientType, AgentSessionSnapshot, AgentRuntime, CanonControlAvailability, CanonControlDescriptor, CanonControlLiveBehavior, CanonControlSelectionPolicy, CanonControlValue, CanonContact, CanonContactRequest, CanonContactRequestStatus, CanonResolveAdmissionResult, ContactAddedPayload, ContactApprovedPayload, ContactRemovedPayload, ContactRequestPayload, ContactSource, ResolvedAdmissionState, ResolvedAdmissionTargetSummary, ResolvedTargetAdmissionPayload, CanonStreamEvent, CreateContactRequestResult, MediaAttachment, MediaAttachmentKind, ModelOption, PermissionModeOption, CanonRuntimeDescriptor, CanonRuntimeActionAvailability, CanonRuntimeActionCategory, CanonRuntimeActionDescriptor, CanonRuntimeActionDispatch, CanonRuntimeActionPlacement, CanonRuntimeDetailTier, CanonRuntimeExecutionMetadata, CanonRuntimeInventory, CanonRuntimeInventoryEntry, CanonRuntimeStreamingMode, CanonRuntimeStatusItem, CanonRuntimeSurfaceMode, CanonWorkspaceRootMetadata, RuntimeUpdatedPayload, RuntimeInfoPayload, RuntimeControlError, RuntimeControlState, RuntimeControlValueSource, ResolvedAdmission, SessionConfig, TurnUpdatedPayload, WorkspaceOption, WorkspaceOptionSource, } from './types.js';
4
+ export type { AddMemberResult, AgentCapabilities, AgentClientType, AgentSessionSnapshot, AgentRuntime, CanonControlAvailability, CanonControlDescriptor, CanonControlLiveBehavior, CanonControlSelectionPolicy, CanonControlValue, CanonContact, CanonContactRequest, CanonContactRequestStatus, CanonResolveAdmissionResult, ContactAddedPayload, ContactApprovedPayload, ContactRemovedPayload, ContactRequestPayload, ContactSource, ResolvedAdmissionState, ResolvedAdmissionTargetSummary, ResolvedTargetAdmissionPayload, CanonStreamEvent, CreateContactRequestResult, MediaAttachment, MediaAttachmentKind, ModelOption, PermissionModeOption, CanonRuntimeDescriptor, CanonRuntimeActionAvailability, CanonRuntimeActionCategory, CanonRuntimeActionDescriptor, CanonRuntimeActionDispatch, CanonRuntimeActionPlacement, CanonRuntimeCommandArgumentChoice, CanonRuntimeCommandArgumentDescriptor, CanonRuntimeCommandArgumentKind, CanonRuntimeCommandDescriptor, CanonRuntimeDetailTier, CanonRuntimeExecutionMetadata, CanonRuntimeInventory, CanonRuntimeInventoryEntry, CanonRuntimePrimitiveId, CanonRuntimeStreamingMode, CanonRuntimeStatusItem, CanonRuntimeSurfaceMode, CanonWorkspaceRootMetadata, RuntimeUpdatedPayload, RuntimeInfoPayload, RuntimeControlError, RuntimeControlState, RuntimeControlValueSource, ResolvedAdmission, SessionConfig, TurnUpdatedPayload, WorkspaceOption, WorkspaceOptionSource, } from './types.js';
5
5
  export { EXECUTION_ENVIRONMENT_MODES, isExecutionEnvironmentMode, } from './execution-environment-mode.js';
6
6
  export type { ExecutionEnvironmentMode } from './execution-environment-mode.js';
7
7
  export type { CanonSelfContext, CanonSelfContextType, SelfContextPromptRenderOptions, SendContextualMessageOptions, SendContextualMessageResult, SendContextualSelfContextInput, } from './self-context.js';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { AGENT_CAPABILITIES, CLAUDE_PERMISSION_MODE_OPTIONS, } from './types.js';
2
- export type { AddMemberResult, AgentCapabilities, AgentClientType, CanonControlAvailability, CanonControlDescriptor, CanonControlLiveBehavior, CanonControlSelectionPolicy, CanonControlValue, CanonContact, CanonContactRequest, CanonContactRequestStatus, CanonGroupContext, CanonGroupContextMode, CanonKnownRecentParticipant, CanonMembershipChange, CanonResolveAdmissionResult, ConversationUpdatedPayload, ContactAddedPayload, ContactApprovedPayload, ContactCardPayload, ContactRemovedPayload, ContactRequestPayload, ContactSource, ResolvedAdmissionState, ResolvedAdmissionTargetSummary, ResolvedTargetAdmissionPayload, CanonMessage, CanonConversation, CanonMessagesPage, CreateContactRequestResult, AgentContext, CanonStreamEvent, AgentSessionSnapshot, ResolvedAdmission, MediaAttachment, MediaAttachmentKind, MessageCreatedPayload, TypingPayload, PresencePayload, RuntimeUpdatedPayload, TurnUpdatedPayload, SendMessageOptions, CreateConversationOptions, RegistrationInput, RegistrationResult, RegistrationStatus, StreamingStatus, SetStreamingOptions, SessionControl, SessionState, SessionConfig, AgentRuntime, CanonRuntimeDescriptor, CanonRuntimeActionAvailability, CanonRuntimeActionCategory, CanonRuntimeActionDescriptor, CanonRuntimeActionDispatch, CanonRuntimeActionPlacement, CanonRuntimeDetailTier, CanonRuntimeExecutionMetadata, CanonRuntimeInventory, CanonRuntimeInventoryEntry, CanonRuntimeStreamingMode, CanonRuntimeStatusItem, CanonRuntimeSurfaceMode, CanonWorkspaceRootMetadata, ModelOption, PermissionModeOption, RuntimeInfoPayload, RuntimeControlError, RuntimeControlState, RuntimeControlValueSource, WorkspaceOption, WorkspaceOptionSource, } from './types.js';
2
+ export type { AddMemberResult, AgentCapabilities, AgentClientType, CanonControlAvailability, CanonControlDescriptor, CanonControlLiveBehavior, CanonControlSelectionPolicy, CanonControlValue, CanonContact, CanonContactRequest, CanonContactRequestStatus, CanonGroupContext, CanonGroupContextMode, CanonKnownRecentParticipant, CanonMembershipChange, CanonResolveAdmissionResult, ConversationUpdatedPayload, ContactAddedPayload, ContactApprovedPayload, ContactCardPayload, ContactRemovedPayload, ContactRequestPayload, ContactSource, ResolvedAdmissionState, ResolvedAdmissionTargetSummary, ResolvedTargetAdmissionPayload, CanonMessage, CanonConversation, CanonMessagesPage, CreateContactRequestResult, AgentContext, CanonStreamEvent, AgentSessionSnapshot, ResolvedAdmission, MediaAttachment, MediaAttachmentKind, MessageCreatedPayload, TypingPayload, PresencePayload, RuntimeUpdatedPayload, TurnUpdatedPayload, SendMessageOptions, CreateConversationOptions, RegistrationInput, RegistrationResult, RegistrationStatus, StreamingStatus, SetStreamingOptions, SessionControl, SessionState, SessionConfig, AgentRuntime, CanonRuntimeDescriptor, CanonRuntimeActionAvailability, CanonRuntimeActionCategory, CanonRuntimeActionDescriptor, CanonRuntimeActionDispatch, CanonRuntimeActionPlacement, CanonRuntimeCommandArgumentChoice, CanonRuntimeCommandArgumentDescriptor, CanonRuntimeCommandArgumentKind, CanonRuntimeCommandDescriptor, CanonRuntimeDetailTier, CanonRuntimeExecutionMetadata, CanonRuntimeInventory, CanonRuntimeInventoryEntry, CanonRuntimePrimitiveId, CanonRuntimeStreamingMode, CanonRuntimeStatusItem, CanonRuntimeSurfaceMode, CanonWorkspaceRootMetadata, ModelOption, PermissionModeOption, RuntimeInfoPayload, RuntimeControlError, RuntimeControlState, RuntimeControlValueSource, WorkspaceOption, WorkspaceOptionSource, } from './types.js';
3
3
  export type { CanonSelfContext, CanonSelfContextType, SelfContextPromptRenderOptions, SendContextualMessageOptions, SendContextualMessageResult, SendContextualSelfContextInput, } from './self-context.js';
4
4
  export { buildSelfContextPromptLines, normalizeSelfContexts, resolveMessageActiveSelfContextId, selectActiveSelfContexts, } from './self-context.js';
5
5
  export { buildConfiguredWorkspaceOptionsWithRoots, buildPublicWorkspaceRoots, buildWorkspaceRootId, discoverWorkspaceProjects, } from './workspace-discovery.js';
@@ -1,5 +1,5 @@
1
1
  import type { ExecutionEnvironmentMode } from './execution-environment-mode.js';
2
- import { type AgentClientType, type CanonControlDescriptor, type CanonRuntimeActionDescriptor, type CanonRuntimeDescriptor, type CanonRuntimeStreamingMode, type CanonWorkspaceRootMetadata, type ModelOption, type PermissionModeOption, type WorkspaceOption } from './types.js';
2
+ import { type AgentClientType, type CanonControlDescriptor, type CanonRuntimeActionDescriptor, type CanonRuntimeCommandDescriptor, type CanonRuntimeDescriptor, type CanonRuntimeStreamingMode, type CanonWorkspaceRootMetadata, type ModelOption, type PermissionModeOption, type WorkspaceOption } from './types.js';
3
3
  import type { HostAdmissionActionCapabilities } from './turn-protocol.js';
4
4
  export declare const CLAUDE_EFFORT_OPTIONS: readonly [{
5
5
  readonly value: "low";
@@ -48,6 +48,7 @@ export declare function buildFirstPartyCodingRuntimeDescriptor(input: {
48
48
  permissionModes?: ReadonlyArray<PermissionModeOption>;
49
49
  defaultPermissionMode?: string | null;
50
50
  actions?: ReadonlyArray<CanonRuntimeActionDescriptor>;
51
+ commands?: ReadonlyArray<CanonRuntimeCommandDescriptor>;
51
52
  streamingTextMode: CanonRuntimeStreamingMode;
52
53
  admissionActions?: HostAdmissionActionCapabilities;
53
54
  }): CanonRuntimeDescriptor;
@@ -149,6 +149,7 @@ export function buildFirstPartyCodingRuntimeDescriptor(input) {
149
149
  : []),
150
150
  ...(input.clientType === 'claude-code' ? [buildRuntimeEffortControl()] : []),
151
151
  ],
152
+ commands: input.commands,
152
153
  actions: input.actions,
153
154
  workspaceRoots: input.workspaceRoots,
154
155
  supportsInterrupt: true,
package/dist/types.d.ts CHANGED
@@ -230,14 +230,35 @@ export type CanonRuntimeInventoryStatus = 'ready' | 'auth_needed' | 'unknown' |
230
230
  export type CanonRuntimeStatusTone = 'default' | 'success' | 'warning' | 'danger';
231
231
  export type CanonRuntimeActionAvailability = 'idle' | 'busy' | 'busy_with_queue' | 'waiting_input' | 'always';
232
232
  export type CanonRuntimeActionPlacement = 'composer_slash' | 'command_palette' | 'session_strip';
233
- export type CanonRuntimeActionCategory = 'plan' | 'turn' | 'session' | 'details' | 'custom';
233
+ export type CanonRuntimeActionCategory = 'plan' | 'turn' | 'session' | 'runtime' | 'details' | 'custom';
234
+ export type CanonRuntimePrimitiveId = 'runtime.status' | 'runtime.reasoning.set' | 'runtime.verbosity.set' | 'runtime.usage' | 'context.compact' | 'session.new' | 'session.reset';
235
+ export type CanonRuntimeCommandArgumentKind = 'string' | 'enum' | 'boolean';
236
+ export interface CanonRuntimeCommandArgumentChoice {
237
+ value: string;
238
+ label: string;
239
+ description?: string;
240
+ }
241
+ export interface CanonRuntimeCommandArgumentDescriptor {
242
+ id: string;
243
+ label: string;
244
+ kind: CanonRuntimeCommandArgumentKind;
245
+ required?: boolean;
246
+ captureRemaining?: boolean;
247
+ choices?: ReadonlyArray<CanonRuntimeCommandArgumentChoice>;
248
+ }
234
249
  export type CanonRuntimeActionDispatch = {
235
250
  kind: 'control';
236
251
  controlId: string;
237
- value: CanonControlValue;
252
+ value?: CanonControlValue;
238
253
  } | {
239
254
  kind: 'signal';
240
255
  signal: 'interrupt' | 'stop_and_drop' | 'new_session';
256
+ } | {
257
+ kind: 'primitive';
258
+ primitive: CanonRuntimePrimitiveId;
259
+ } | {
260
+ kind: 'text_passthrough';
261
+ template: string;
241
262
  } | {
242
263
  kind: 'compose';
243
264
  text: string;
@@ -249,6 +270,7 @@ export interface CanonRuntimeActionDescriptor {
249
270
  id: string;
250
271
  label: string;
251
272
  description?: string;
273
+ primitive?: CanonRuntimePrimitiveId;
252
274
  aliases?: ReadonlyArray<string>;
253
275
  category?: CanonRuntimeActionCategory;
254
276
  placements?: ReadonlyArray<CanonRuntimeActionPlacement>;
@@ -256,8 +278,13 @@ export interface CanonRuntimeActionDescriptor {
256
278
  ownerOnly?: boolean;
257
279
  disabledReason?: string | null;
258
280
  trailingTextBehavior?: 'ignore' | 'send_as_prompt';
281
+ args?: ReadonlyArray<CanonRuntimeCommandArgumentDescriptor>;
259
282
  dispatch: CanonRuntimeActionDispatch;
260
283
  }
284
+ export interface CanonRuntimeCommandDescriptor extends CanonRuntimeActionDescriptor {
285
+ primitive?: CanonRuntimePrimitiveId;
286
+ args?: ReadonlyArray<CanonRuntimeCommandArgumentDescriptor>;
287
+ }
261
288
  export interface CanonControlDescriptor {
262
289
  id: string;
263
290
  label: string;
@@ -271,6 +298,7 @@ export interface CanonControlDescriptor {
271
298
  export interface CanonRuntimeDescriptor {
272
299
  coreControls: ReadonlyArray<CanonControlDescriptor>;
273
300
  runtimeControls?: ReadonlyArray<CanonControlDescriptor>;
301
+ commands?: ReadonlyArray<CanonRuntimeCommandDescriptor>;
274
302
  actions?: ReadonlyArray<CanonRuntimeActionDescriptor>;
275
303
  /**
276
304
  * Optional setup-time local roots advertised by a runtime. These are
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/core",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "description": "Canon core — shared types, REST client, SSE stream, and registration for Canon messaging",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",