@canonmsg/agent-sdk 12.0.0 → 12.1.0

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.
Files changed (99) hide show
  1. package/README.md +97 -7
  2. package/dist/chunks/{chunk-FPQFTTND.js → chunk-7N6OPPW4.js} +1616 -1085
  3. package/dist/chunks/chunk-N722GWCP.js +4897 -0
  4. package/dist/chunks/{chunk-OLJ7H4E2.js → chunk-QZ4PPRQW.js} +6462 -6920
  5. package/dist/chunks/{mls-crypto-NZDNSPAO.js → mls-crypto-LMNQZOS6.js} +3 -3
  6. package/dist/cli.js +403 -29
  7. package/dist/drivers/claude.d.ts +8 -2
  8. package/dist/drivers/codex.d.ts +11 -2
  9. package/dist/drivers/connector.d.ts +34 -0
  10. package/dist/index.d.ts +10 -2
  11. package/dist/index.js +26 -4
  12. package/dist/internal/backend-contracts/artifactActions.d.ts +0 -151
  13. package/dist/internal/backend-contracts/clientFloor.d.ts +41 -0
  14. package/dist/internal/backend-contracts/communication.d.ts +15 -0
  15. package/dist/internal/backend-contracts/connectorRelay.d.ts +179 -0
  16. package/dist/internal/backend-contracts/endpoint.d.ts +17 -0
  17. package/dist/internal/backend-contracts/endpointContentPolicy.d.ts +15 -4
  18. package/dist/internal/backend-contracts/index.d.ts +7 -1
  19. package/dist/internal/backend-contracts/media-url.d.ts +14 -0
  20. package/dist/internal/backend-contracts/message.d.ts +1 -1
  21. package/dist/internal/backend-contracts/mlsDevApplication.d.ts +90 -2
  22. package/dist/internal/backend-contracts/mlsDevCredential.d.ts +5 -2
  23. package/dist/internal/backend-contracts/mlsDevDeviceCustody.d.ts +2 -1
  24. package/dist/internal/backend-contracts/mlsDevEnrollment.d.ts +3 -2
  25. package/dist/internal/backend-contracts/mlsDevFeedReceipt.d.ts +43 -0
  26. package/dist/internal/backend-contracts/mlsDevGroup.d.ts +129 -5
  27. package/dist/internal/backend-contracts/mlsDevGroupFeed.d.ts +6 -2
  28. package/dist/internal/backend-contracts/mlsDevInteraction.d.ts +159 -0
  29. package/dist/internal/backend-contracts/mlsEnvironment.d.ts +35 -0
  30. package/dist/internal/backend-contracts/mlsPrincipalAlias.d.ts +23 -0
  31. package/dist/internal/backend-contracts/runtimeCardFields.d.ts +2 -2
  32. package/dist/internal/backend-contracts/upload-mime-types.d.ts +17 -0
  33. package/dist/internal/backend-contracts/verbContract.d.ts +15 -7
  34. package/dist/internal/backend-contracts/verbSchemas.d.ts +35 -25
  35. package/dist/internal/core/agent-profiles.d.ts +0 -4
  36. package/dist/internal/core/approval-format.d.ts +1 -5
  37. package/dist/internal/core/approval-types.d.ts +1 -2
  38. package/dist/internal/core/client.d.ts +2 -56
  39. package/dist/internal/core/constants.d.ts +0 -3
  40. package/dist/internal/core/endpoint-client.d.ts +14 -1
  41. package/dist/internal/core/execution-environment-mode.d.ts +0 -2
  42. package/dist/internal/core/gifs.d.ts +0 -6
  43. package/dist/internal/core/host-runtime.d.ts +2 -206
  44. package/dist/internal/core/index.d.ts +21 -60
  45. package/dist/internal/core/registration.d.ts +1 -17
  46. package/dist/internal/core/retry.d.ts +0 -9
  47. package/dist/internal/core/rtdb-rest.d.ts +0 -4
  48. package/dist/internal/core/runtime-cards.d.ts +0 -45
  49. package/dist/internal/core/runtime-descriptor.d.ts +1 -60
  50. package/dist/internal/core/runtime-presentation.d.ts +1 -27
  51. package/dist/internal/core/runtime-request-manager.d.ts +0 -1
  52. package/dist/internal/core/self-context.d.ts +0 -39
  53. package/dist/internal/core/silent-turn.d.ts +1 -38
  54. package/dist/internal/core/stream.d.ts +2 -1
  55. package/dist/internal/core/turn-protocol.d.ts +0 -5
  56. package/dist/internal/core/turn-verbosity.d.ts +0 -12
  57. package/dist/internal/core/types.d.ts +0 -111
  58. package/dist/internal/endpoint/engine.d.ts +31 -1
  59. package/dist/internal/endpoint/index.d.ts +1 -1
  60. package/dist/internal/endpoint/media.d.ts +5 -0
  61. package/dist/internal/endpoint/mls-crypto.d.ts +12 -5
  62. package/dist/internal/endpoint/mls-dev-client.d.ts +9 -1
  63. package/dist/internal/endpoint/mls-dev-device.d.ts +2 -0
  64. package/dist/internal/endpoint/mls-dev-groups.d.ts +65 -5
  65. package/dist/internal/endpoint/mls-dev-interactions.d.ts +99 -0
  66. package/dist/internal/endpoint/mls-dev-key-package-service.d.ts +13 -0
  67. package/dist/internal/endpoint/mls-dev-key-packages.d.ts +23 -3
  68. package/dist/internal/endpoint/mls-dev-text.d.ts +67 -0
  69. package/dist/internal/endpoint/mls-dev-transport.d.ts +2 -1
  70. package/dist/internal/endpoint/node-mls-custody-protocol.d.ts +5 -0
  71. package/dist/internal/endpoint/transport.d.ts +6 -1
  72. package/dist/media.js +2 -2
  73. package/dist/runner/errands.d.ts +118 -0
  74. package/dist/runner/mls.d.ts +97 -0
  75. package/dist/runner/relay.d.ts +87 -0
  76. package/dist/runner/runner.d.ts +61 -0
  77. package/dist/runner/types.d.ts +51 -4
  78. package/package.json +1 -1
  79. package/dist/chunks/chunk-6VK4UZHJ.js +0 -2806
  80. package/dist/internal/backend-contracts/workSessions.d.ts +0 -205
  81. package/dist/internal/core/agent-resolver.d.ts +0 -49
  82. package/dist/internal/core/agent-session.d.ts +0 -12
  83. package/dist/internal/core/artifacts.d.ts +0 -262
  84. package/dist/internal/core/attached-native-session.d.ts +0 -174
  85. package/dist/internal/core/attached-session-file-store.d.ts +0 -3
  86. package/dist/internal/core/control-poller.d.ts +0 -221
  87. package/dist/internal/core/exclusive-json-file-store.d.ts +0 -7
  88. package/dist/internal/core/execution-environment.d.ts +0 -55
  89. package/dist/internal/core/group-context.d.ts +0 -25
  90. package/dist/internal/core/inbound-frame.d.ts +0 -64
  91. package/dist/internal/core/local-runtime-catalog.d.ts +0 -131
  92. package/dist/internal/core/message-format.d.ts +0 -13
  93. package/dist/internal/core/native-session-interaction.d.ts +0 -44
  94. package/dist/internal/core/provenance.d.ts +0 -31
  95. package/dist/internal/core/registration-cli.d.ts +0 -40
  96. package/dist/internal/core/turn-output-controller.d.ts +0 -69
  97. package/dist/internal/core/typing-status-publisher.d.ts +0 -14
  98. package/dist/internal/core/work-session-provider.d.ts +0 -29
  99. package/dist/internal/core/workspace-discovery.d.ts +0 -17
@@ -1,36 +1,5 @@
1
- import { type AgentClientType, type AgentRuntime, type CanonConversation, type CanonGroupContext, type CanonGroupContextMode, type CanonMembershipChange, type CanonMessage, type CanonMessagesPage, type CanonRuntimeProvenance, type MessageCreatedPayload } from './types.js';
2
- import { type ArtifactContext } from '../backend-contracts/index.js';
3
- import { type CanonClient } from './client.js';
4
- import { type ResolvedAgentBehaviorPolicy } from './policy.js';
5
- import type { RTDBClientHandle } from './rtdb-rest.js';
6
- import type { CanonInboundPromptOptions } from './inbound-frame.js';
7
- export interface HostInboundParticipantContext {
8
- conversationType: CanonConversation['type'] | 'unknown';
9
- memberCount: number | null;
10
- senderType: 'human' | 'ai_agent';
11
- senderName: string;
12
- isOwner: boolean;
13
- mentionedAgent: boolean;
14
- groupContext?: CanonGroupContext;
15
- groupContextMode?: CanonGroupContextMode;
16
- recentSenderTypes: Array<'human' | 'ai_agent'>;
17
- recentHumanCount: number;
18
- recentAgentCount: number;
19
- consecutiveAgentTurns: number;
20
- currentAgentStreakStartedByHuman: boolean;
21
- }
22
- export interface AutoReplyDecision {
23
- allow: boolean;
24
- reason: string;
25
- }
26
- /**
27
- * Decide whether a coding host should auto-reply to an inbound message.
28
- * Thin adapter over {@link evaluateParticipationPolicy}; lives here (not in
29
- * @canonmsg/coding-agent-host) because it needs core's participation-policy
30
- * engine and the context type above, and coding-agent-host is deliberately
31
- * dependency-free.
32
- */
33
- export declare function decideAutoReply(context: HostInboundParticipantContext, behavior?: ResolvedAgentBehaviorPolicy | null): AutoReplyDecision;
1
+ import type { CanonMessage } from './types.js';
2
+ import type { ArtifactContext } from '../backend-contracts/index.js';
34
3
  type HostInboundMessage = {
35
4
  id?: string | null;
36
5
  senderId?: string | null;
@@ -61,120 +30,6 @@ export interface CanonReplyContext {
61
30
  replyToPosition?: number | null;
62
31
  found: boolean;
63
32
  }
64
- export declare const CANON_TURN_CONTEXT_SCHEMA_V2: "canon.turn.v2";
65
- export interface CanonTurnContextAttachmentV2 {
66
- index: number;
67
- kind: NonNullable<HostInboundMessage['attachments']>[number]['kind'];
68
- placeholder: string;
69
- fileName: string | null;
70
- mimeType: string | null;
71
- sizeBytes: number | null;
72
- width: number | null;
73
- height: number | null;
74
- durationMs: number | null;
75
- }
76
- export interface CanonTurnContextContactCardV2 {
77
- userId: string;
78
- canonContactId: string | null;
79
- displayName: string;
80
- userType: NonNullable<HostInboundMessage['contactCard']>['userType'];
81
- ownerName: string | null;
82
- about: string | null;
83
- }
84
- export interface CanonTurnContextReplyContextV2 {
85
- artifactContext?: ArtifactContext;
86
- messageId: string;
87
- found: boolean;
88
- senderId: string | null;
89
- senderName: string | null;
90
- senderType: CanonMessage['senderType'] | null;
91
- contentType: CanonMessage['contentType'] | null;
92
- text: string | null;
93
- body: string;
94
- replyToPosition: number | null;
95
- attachments: CanonTurnContextAttachmentV2[];
96
- contactCard: CanonTurnContextContactCardV2 | null;
97
- }
98
- export interface CanonTurnContextProvenanceV2 {
99
- sender: {
100
- id: string | null;
101
- name: string | null;
102
- type: HostInboundParticipantContext['senderType'];
103
- isOwner: boolean;
104
- };
105
- mentionedAgent: boolean;
106
- activeSelfContext: CanonRuntimeProvenance['activeSelfContext'];
107
- }
108
- export interface CanonTurnContextBehaviorV2 {
109
- participationStyle: ResolvedAgentBehaviorPolicy['participation']['style'];
110
- requireMentionForGroupReplies?: boolean;
111
- allowAgentToAgent?: boolean;
112
- allowLongRunningCollaboration?: boolean;
113
- maxConsecutiveAgentTurns?: number;
114
- instructions?: string[];
115
- source?: ResolvedAgentBehaviorPolicy['source'];
116
- }
117
- export interface CanonTurnContextParticipationV2 {
118
- recentRoleSummary?: HostInboundParticipantContext['recentSenderTypes'];
119
- recentHumanCount?: number;
120
- recentAgentCount?: number;
121
- consecutiveAgentTurns?: number;
122
- currentAgentStreakStartedByHuman?: boolean;
123
- }
124
- export interface CanonTurnContextV2 {
125
- schema: typeof CANON_TURN_CONTEXT_SCHEMA_V2;
126
- conversation: {
127
- id: string;
128
- type: HostInboundParticipantContext['conversationType'];
129
- memberCount: number | null;
130
- };
131
- provenance: CanonTurnContextProvenanceV2;
132
- behavior?: CanonTurnContextBehaviorV2;
133
- participation?: CanonTurnContextParticipationV2;
134
- group?: {
135
- context: CanonGroupContext;
136
- mode?: CanonGroupContextMode;
137
- };
138
- selfContext?: {
139
- activeSelfContextId: string | null;
140
- contexts: NonNullable<MessageCreatedPayload['selfContexts']>;
141
- };
142
- replyContext?: CanonTurnContextReplyContextV2;
143
- session?: {
144
- lines: string[];
145
- };
146
- message: {
147
- id: string | null;
148
- contentType: CanonMessage['contentType'] | null;
149
- renderedContent: string;
150
- /** Frozen by the sender; independent of the quoted reply target. */
151
- artifactContext?: ArtifactContext;
152
- /** One-line state of referenced work as of message arrival, keyed by artifact ID. */
153
- artifactSummaries?: Record<string, string>;
154
- attachments?: CanonTurnContextAttachmentV2[];
155
- contactCard?: CanonTurnContextContactCardV2;
156
- mentions?: string[];
157
- replyTo?: string;
158
- replyToPosition?: number;
159
- deleted?: true;
160
- };
161
- }
162
- export declare function buildCanonTurnContextV2(input: {
163
- content: string;
164
- conversationId: string;
165
- participantContext: HostInboundParticipantContext;
166
- behavior?: ResolvedAgentBehaviorPolicy | null;
167
- selfContexts?: MessageCreatedPayload['selfContexts'];
168
- activeSelfContextId?: string | null;
169
- provenance: CanonRuntimeProvenance;
170
- replyContext?: CanonReplyContext | null;
171
- sessionContextLines?: string[];
172
- message?: HostInboundMessage | null;
173
- /** From `summarizeArtifactReferences`; lines for work the message does not reference are dropped. */
174
- artifactSummaries?: Record<string, string>;
175
- }): CanonTurnContextV2;
176
- export declare function renderCanonTurnBriefPrompt(context: CanonTurnContextV2, options?: CanonInboundPromptOptions): string;
177
- export declare function buildCanonReplyContextLines(replyContext: CanonReplyContext | null): string[];
178
33
  /**
179
34
  * Render the **text portion** of an inbound Canon message. Images are
180
35
  * referenced by short placeholders — their actual bytes are delivered to the
@@ -195,63 +50,4 @@ export declare function renderCanonHostInboundContent(message: HostInboundMessag
195
50
  durationMs?: number;
196
51
  index: number;
197
52
  }>): string;
198
- export declare function resolveCanonReplyContext(input: {
199
- message: HostInboundMessage;
200
- messages?: ReadonlyArray<HostInboundMessage> | null;
201
- }): CanonReplyContext | null;
202
- /**
203
- * Hydrate only an explicit reply target missing from the ordinary history page.
204
- * The result stays quoted context: never append it to history or inbound work,
205
- * and never follow the target's own replyTo. The endpoint enforces membership
206
- * and content projection; unavailable references must not block the new input.
207
- */
208
- export declare function hydrateCanonReplyContext(input: {
209
- client: Pick<CanonClient, 'getMessage'>;
210
- conversationId: string;
211
- message: HostInboundMessage;
212
- messages?: ReadonlyArray<HostInboundMessage> | null;
213
- }): Promise<CanonReplyContext | null>;
214
- export declare function buildHydratedInboundContext(input: {
215
- agentId: string;
216
- conversationId: string;
217
- conversation: CanonConversation | null;
218
- /** Coding hosts must verify membership before acquiring or resuming a session. */
219
- requireAgentMembership?: boolean;
220
- page?: CanonMessagesPage | null;
221
- activeSelfContextId?: string | null;
222
- selfContexts?: MessageCreatedPayload['selfContexts'];
223
- provenance?: MessageCreatedPayload['provenance'];
224
- message: HostInboundMessage;
225
- senderName: string;
226
- isOwner: boolean;
227
- ownerId?: string | null;
228
- ownerName?: string | null;
229
- membershipChange?: CanonMembershipChange | null;
230
- groupContextMode?: CanonGroupContextMode;
231
- }): {
232
- participantContext: HostInboundParticipantContext;
233
- behavior?: ResolvedAgentBehaviorPolicy | null;
234
- activeSelfContextId: string | null;
235
- selfContexts: NonNullable<MessageCreatedPayload['selfContexts']>;
236
- provenance: CanonRuntimeProvenance;
237
- replyContext: CanonReplyContext | null;
238
- hydratedFromPage: boolean;
239
- };
240
- export declare function publishHostAgentRuntime(agentId: string, clientType: AgentClientType, runtime: AgentRuntime, rtdb: RTDBClientHandle): Promise<void>;
241
- export declare function publishHostSessionSnapshots(input: {
242
- conversationIds: string[];
243
- agentId: string;
244
- rtdb: RTDBClientHandle;
245
- clientType: AgentClientType;
246
- }): Promise<void>;
247
- export declare function createConversationMetadataLoader(input: {
248
- client: CanonClient;
249
- conversationCache: Map<string, CanonConversation>;
250
- cacheTtlMs?: number;
251
- }): {
252
- refreshConversationCache(force?: boolean): Promise<void>;
253
- getConversationMeta(conversationId: string, options?: {
254
- refreshIfMemberMissing?: string;
255
- }): Promise<CanonConversation | null>;
256
- };
257
53
  export {};
@@ -1,84 +1,59 @@
1
1
  export { createNodeMlsDevCustody, NodeMlsDevCustodyError, type NodeMlsDevCustody, type NodeMlsDevCustodyOptions } from '../endpoint/node.js';
2
2
  export { createPortableNodeMlsDevCustody, type PortableNodeMlsDevCustody, type PortableNodeMlsDevCustodyOptions } from '../endpoint/node.js';
3
3
  export { parseMlsDevClientConfiguration, type MlsDevClientConfiguration } from '../endpoint/mls-crypto.js';
4
- export { createAttachedNativeSession } from './attached-native-session.js';
5
4
  export type { CanonClientEndpointOptions, CanonEndpoint, CanonMlsDevOptions, CanonMlsDevCustody } from './endpoint-client.js';
6
5
  export type { EndpointInboundHandoff, EndpointInboundHandoffPhase, EndpointInboundStartResult, EndpointContentMode, MlsDevVerifiedMessageBinding, MlsDevCurrentAudience } from '../endpoint/index.js';
7
6
  export { createNodeEndpointMediaBytes } from './node-media.js';
8
7
  export { resolveConversationPolicyScope } from '../backend-contracts/index.js';
9
- export { createFileAttachedSessionStore } from './attached-session-file-store.js';
10
- export type { AttachedNativeSession, AttachedNativeSessionAdapter, AttachedNativeSessionOptions, AttachedSessionBinding, AttachedSessionInput, AttachedSessionJournal, AttachedSessionMessagePart, AttachedSessionOrigin, AttachedSessionPublisher, AttachedSessionState, AttachedSessionStore, AttachedSessionSubmitResult, NativeSessionEvent, NativeSessionItem, NativeSessionSnapshot, NativeSubmissionResult, } from './attached-native-session.js';
11
- export { AGENT_CAPABILITIES, CLAUDE_PERMISSION_MODE_OPTIONS, } from './types.js';
12
- export type { AgentOrigin, AgentOriginDeclaration, AddMemberResult, AgentCapabilities, AgentClientType, CanonControlAvailability, CanonControlDescriptor, CanonControlLiveBehavior, CanonControlSelectionPolicy, CanonControlValue, CanonRuntimeCardCapabilities, CanonRuntimeRichCardCapability, CanonRuntimeVoiceCapabilities, CanonRuntimeVoiceMode, CanonContact, CanonGroupContext, CanonGroupContextMode, CanonKnownRecentParticipant, CanonMembershipChange, CanonResolveAdmissionResult, ConversationUpdatedPayload, ContactAddedPayload, ContactCardPayload, ContactRemovedPayload, ContactSource, ResolvedAdmissionState, ResolvedAdmissionTargetSummary, ResolvedTargetAdmissionPayload, ResolveAdmissionTargetInput, CanonMessage, CanonRuntimeProvenance, CanonTurnDispatch, CanonConversation, CanonConversationsPage, CanonConversationsPageOptions, CanonMessagesPage, CanonVoiceSession, CanonVoiceSessionMode, CanonVoiceSessionParticipant, CanonVoiceSessionStatus, CanonVoiceSessionToken, AgentContext, CanonStreamEvent, AgentSessionSnapshot, ResolvedAdmission, MediaAttachment, MediaAttachmentKind, VideoProcessingStatus, VideoProcessingErrorCode, MessageCreatedPayload, MessageUpdatedPayload, TypingPayload, PresencePayload, RuntimeUpdatedPayload, RuntimeControlEventKind, RuntimeControlEventPayload, TurnUpdatedPayload, ParticipationSuppressedPayload, VoiceSessionEventPayload, SendMessageOptions, CreateGroupOptions, CreateGroupResult, CreateVoiceSessionOptions, JoinVoiceSessionOptions, RegistrationInput, RegistrationResult, RegistrationStatus, UpdateAgentProfileOptions, SetRuntimeTurnOptions, StreamingStatus, SetStreamingOptions, SessionState, AgentRuntime, CanonRuntimeDescriptor, CanonRuntimeActionAvailability, CanonRuntimeActionCategory, CanonRuntimeActionDescriptor, CanonRuntimeActionDispatch, CanonRuntimeActionPlacement, CanonRuntimeCommandArgumentChoice, CanonRuntimeCommandArgumentDescriptor, CanonRuntimeCommandArgumentKind, CanonRuntimeCommandDescriptor, CanonRuntimeDetailTier, CanonRuntimeExecutionMetadata, CanonRuntimePresentationField, CanonRuntimePresentationHint, CanonRuntimePresentationPolicy, CanonRuntimePresentationPreset, CanonRuntimeVisibility, CanonRuntimeActivityItem, CanonRuntimeActivityKind, CanonRuntimeActivityStatus, CanonRuntimeFact, CanonRuntimeFactGroup, CanonRuntimeInventory, CanonRuntimeInventoryEntry, CanonRuntimePrimitiveId, CanonRuntimeStreamingMode, CanonRuntimeStatusItem, CanonRuntimeSurfaceMode, CanonRuntimeTurnModeActivation, CanonRuntimeTurnModeDescriptor, CanonRuntimeTurnModeScope, CanonUnifiedDiff, CanonUnifiedDiffFile, CanonUnifiedDiffFileStatus, CanonWorkspaceRootMetadata, ModelOption, PermissionModeOption, RuntimeInfoPayload, RuntimeControlError, RuntimeControlState, RuntimeControlValueSource, TurnOutputBlock, TurnOutputBlockKind, TurnOutputBlockStatus, WorkspaceOption, WorkspaceOptionSource, } from './types.js';
13
- export type { CanonGifMetadata, CanonGifResult, CanonGifSearchOptions, CanonGifSearchResponse, GifProvider, } from './gifs.js';
8
+ export { CLAUDE_PERMISSION_MODE_OPTIONS, } from './types.js';
9
+ export type { AgentOrigin, AgentOriginDeclaration, AddMemberResult, AgentClientType, CanonControlAvailability, CanonControlDescriptor, CanonControlLiveBehavior, CanonControlSelectionPolicy, CanonControlValue, CanonRuntimeCardCapabilities, CanonRuntimeRichCardCapability, CanonRuntimeVoiceCapabilities, CanonRuntimeVoiceMode, CanonContact, CanonMembershipChange, CanonResolveAdmissionResult, ConversationUpdatedPayload, ContactAddedPayload, ContactCardPayload, ContactRemovedPayload, ContactSource, ResolvedAdmissionState, ResolvedAdmissionTargetSummary, ResolvedTargetAdmissionPayload, ResolveAdmissionTargetInput, CanonMessage, CanonRuntimeProvenance, CanonTurnDispatch, CanonConversation, CanonConversationsPage, CanonConversationsPageOptions, CanonMessagesPage, CanonVoiceSession, CanonVoiceSessionMode, CanonVoiceSessionParticipant, CanonVoiceSessionStatus, CanonVoiceSessionToken, AgentContext, AgentSessionSnapshot, MediaAttachment, MediaAttachmentKind, VideoProcessingStatus, VideoProcessingErrorCode, MessageCreatedPayload, MessageUpdatedPayload, TypingPayload, PresencePayload, RuntimeUpdatedPayload, RuntimeControlEventKind, RuntimeControlEventPayload, TurnUpdatedPayload, ParticipationSuppressedPayload, VoiceSessionEventPayload, SendMessageOptions, CreateGroupOptions, CreateGroupResult, CreateVoiceSessionOptions, JoinVoiceSessionOptions, RegistrationInput, RegistrationStatus, SetRuntimeTurnOptions, StreamingStatus, SetStreamingOptions, SessionState, AgentRuntime, CanonRuntimeDescriptor, CanonRuntimeActionAvailability, CanonRuntimeActionCategory, CanonRuntimeActionDescriptor, CanonRuntimeActionDispatch, CanonRuntimeActionPlacement, CanonRuntimeCommandArgumentChoice, CanonRuntimeCommandArgumentDescriptor, CanonRuntimeCommandArgumentKind, CanonRuntimeCommandDescriptor, CanonRuntimeDetailTier, CanonRuntimeExecutionMetadata, CanonRuntimePresentationField, CanonRuntimePresentationHint, CanonRuntimePresentationPolicy, CanonRuntimePresentationPreset, CanonRuntimeVisibility, CanonRuntimeActivityItem, CanonRuntimeActivityKind, CanonRuntimeActivityStatus, CanonRuntimeFact, CanonRuntimeFactGroup, CanonRuntimeInventory, CanonRuntimeInventoryEntry, CanonRuntimePrimitiveId, CanonRuntimeStreamingMode, CanonRuntimeStatusItem, CanonRuntimeSurfaceMode, CanonRuntimeTurnModeActivation, CanonRuntimeTurnModeDescriptor, CanonRuntimeTurnModeScope, CanonUnifiedDiff, CanonUnifiedDiffFile, CanonUnifiedDiffFileStatus, CanonWorkspaceRootMetadata, ModelOption, PermissionModeOption, RuntimeInfoPayload, RuntimeControlError, RuntimeControlState, RuntimeControlValueSource, TurnOutputBlock, TurnOutputBlockKind, TurnOutputBlockStatus, WorkspaceOption, WorkspaceOptionSource, } from './types.js';
10
+ export type { CanonGifMetadata, CanonGifResult, CanonGifSearchResponse, GifProvider, } from './gifs.js';
14
11
  export { buildGifAttachment, buildGifMetadata, } from './gifs.js';
15
- export { DEFAULT_FIRST_PARTY_RUNTIME_PRESENTATION, RUNTIME_PRESENTATION_FIELDS, buildRuntimePresentationPolicy, isRuntimePresentationField, isRuntimePresentationFieldHidden, redactAgentRuntimeForConversation, redactAgentSessionSnapshotForConversation, redactRuntimeActivityItemForConversation, redactRuntimeInfoForConversation, redactSessionStateForConversation, } from './runtime-presentation.js';
16
- export { buildRuntimeProvenance, resolveRuntimeProvenance, } from './provenance.js';
17
- export type { CanonSelfContext, CanonSelfContextType, SelfContextPromptRenderOptions, } from './self-context.js';
18
- export { buildSelfContextPromptLines, normalizeSelfContexts, resolveMessageActiveSelfContextId, selectActiveSelfContexts, selectInboundSelfContexts, } from './self-context.js';
19
- export { buildConfiguredWorkspaceOptionsWithRoots, buildPublicWorkspaceRoots, buildWorkspaceRootId, } from './workspace-discovery.js';
20
- export type { ConfiguredWorkspaceRoot, } from './workspace-discovery.js';
12
+ export { isRuntimePresentationFieldHidden, redactAgentSessionSnapshotForConversation, redactRuntimeActivityItemForConversation, redactRuntimeInfoForConversation, } from './runtime-presentation.js';
13
+ export type { CanonSelfContext, CanonSelfContextType, } from './self-context.js';
21
14
  export { CanonClient, CanonApiError } from './client.js';
22
15
  export type { EndpointOperation as CanonMessageOperation } from '../endpoint/index.js';
23
16
  export type { ResumableMediaUploadResult, ResumableMediaUploadSession, } from './client.js';
24
- export { buildAgentSessionSnapshot } from './agent-session.js';
25
- export { EFFORT_OPTIONS, EXECUTION_MODE_CONTROL_OPTIONS, RUNTIME_NEW_SESSION_ACTION, RUNTIME_STOP_ACTION, RUNTIME_STOP_AND_DROP_ACTION, buildFirstPartyCodingRuntimeDescriptor, buildRuntimeWorkspaceControlOptions, normalizeRuntimeCommandAlias, normalizeRuntimeCommandAliases, normalizeRuntimeCommandDescriptors, } from './runtime-descriptor.js';
17
+ export { EXECUTION_MODE_CONTROL_OPTIONS, RUNTIME_NEW_SESSION_ACTION, RUNTIME_STOP_ACTION, RUNTIME_STOP_AND_DROP_ACTION, normalizeRuntimeCommandAlias, normalizeRuntimeCommandAliases, normalizeRuntimeCommandDescriptors, } from './runtime-descriptor.js';
26
18
  export { CanonStream, CanonStreamError } from './stream.js';
27
19
  export type { CanonStreamErrorPayload, ReplayExpiredPayload, StreamHandler } from './stream.js';
28
20
  export { createRuntimeHeartbeat } from './runtime-heartbeat.js';
29
21
  export type { RuntimeHeartbeat, RuntimeHeartbeatOperation, RuntimeHeartbeatOptions, } from './runtime-heartbeat.js';
30
22
  export type { ParticipationStyle, AgentBehaviorSettings, ParticipationPolicy, ResolvedAgentBehaviorPolicy, ParticipationHistoryMessage, ParticipationHistorySnapshot, ParticipationDecisionInput, ParticipationDecision, } from './policy.js';
31
23
  export { buildParticipationHistorySnapshot, DEFAULT_DIRECT_MAX_CONSECUTIVE_AGENT_TURNS, DEFAULT_GROUP_MAX_CONSECUTIVE_AGENT_TURNS, DEFAULT_PARTICIPATION_HISTORY_FETCH_LIMIT, evaluateParticipationPolicy, getDefaultParticipationPolicy, resolveAgentBehaviorPolicy, } from './policy.js';
32
- export { DEFAULT_RUNTIME_CAPABILITIES, ACTIVE_TURN_STALE_THRESHOLD_MS, HOST_ADMISSION_ACTION_CAPABILITIES, HOST_ADMISSION_ACTIONS_DISABLED, FINAL_MESSAGE_HANDOFF_MS, WAITING_INPUT_STALE_THRESHOLD_MS, getTurnStateStaleThresholdMs, isTurnOpen, isTurnStateStale, normalizeTurnMetadata, normalizeTurnState, resolveTurnMessageSemantics, shouldPromoteConversationMessage, shouldTriggerAgentTurn, } from './turn-protocol.js';
24
+ export { ACTIVE_TURN_STALE_THRESHOLD_MS, WAITING_INPUT_STALE_THRESHOLD_MS, getTurnStateStaleThresholdMs, isTurnOpen, isTurnStateStale, normalizeTurnMetadata, resolveTurnMessageSemantics, shouldPromoteConversationMessage, shouldTriggerAgentTurn, } from './turn-protocol.js';
33
25
  export type { DeliveryIntent, TurnMessageSemantics, InboundDisposition, TurnLifecycleState, RuntimeCapabilities, HostAdmissionActionCapabilities, TurnState, TurnMetadata, TriggerDecision, } from './turn-protocol.js';
34
26
  export { resumeRegistration } from './registration-session.js';
35
27
  export type { RegistrationSession, RegistrationCredentials, RegistrationStore, RegistrationProgress, ResumeRegistrationOptions } from './registration-session.js';
36
28
  export { ensureAgentProfile } from './registration-profile.js';
37
29
  export type { EnsureAgentProfileOptions } from './registration-profile.js';
38
- export { registerRegistrationCli, runRegistrationCli } from './registration-cli.js';
39
- export type { RegistrationCliOptions } from './registration-cli.js';
40
- export { ackRegistrationApproval, registerAndWaitForApproval, submitRegistrationRequest, waitForRegistrationApproval, } from './registration.js';
30
+ export { submitRegistrationRequest, } from './registration.js';
41
31
  export { RuntimeRequestManager, RuntimeRequestCancelledError, runtimeInputDescriptor, runtimeCardDescriptor, runtimePlanDescriptor, } from './runtime-request-manager.js';
42
- export type { RuntimeRequestKind, RuntimeRequestContext, RuntimeRequestOptions, RuntimeResolveReason, RuntimeConsumeOutcome, RuntimeOutcomeMessage, RuntimeRequestCallInput, RuntimeRequestPreflightInput, RuntimeRequestPushInput, RuntimeRequestPushMatch, KindDescriptor, RuntimeInputRequestPayload, RuntimeInputRequestResult, RuntimeCardRequestPayload, RuntimeCardRequestResult, RuntimePlanRequestPayload, RuntimePlanRequestResult, } from './runtime-request-manager.js';
32
+ export type { RuntimeRequestKind, RuntimeRequestContext, RuntimeRequestOptions, RuntimeConsumeOutcome, RuntimeOutcomeMessage, RuntimeRequestCallInput, RuntimeRequestPreflightInput, RuntimeRequestPushInput, RuntimeRequestPushMatch, KindDescriptor, RuntimeInputRequestPayload, RuntimeInputRequestResult, RuntimeCardRequestPayload, RuntimeCardRequestResult, RuntimePlanRequestPayload, RuntimePlanRequestResult, } from './runtime-request-manager.js';
43
33
  export { ApprovalManager } from './approval-manager.js';
44
- export { generateApprovalId, buildApprovalRequest, buildApprovalReply, buildApprovalOutcome, redactSecrets, } from './approval-format.js';
45
- export { DEFAULT_APPROVAL_CONFIG, parseApprovalRequestMetadata, parseApprovalReplyMetadata, parseSessionRule, } from './approval-types.js';
34
+ export { generateApprovalId, buildApprovalRequest, buildApprovalOutcome, redactSecrets, } from './approval-format.js';
35
+ export { DEFAULT_APPROVAL_CONFIG, parseApprovalReplyMetadata, parseSessionRule, } from './approval-types.js';
46
36
  export type { ApprovalRequestCategory, ApprovalRequestDetail, ApprovalRequestMetadata, ApprovalNativeRequestMetadata, ApprovalRisk, ApprovalReplyMetadata, ApprovalOutcomeMetadata, SessionRule, ApprovalResult, ApprovalConfig, } from './approval-types.js';
47
37
  export { UNIFIED_DIFF_MAX_FILE_BYTES, UNIFIED_DIFF_MAX_FILES, UNIFIED_DIFF_MAX_TOTAL_BYTES, isSensitiveDiffPath, normalizeCanonUnifiedDiff, sanitizeUnifiedDiffForSharing, truncateUnifiedDiff, } from './unified-diff.js';
48
38
  export type { TruncateUnifiedDiffOptions } from './unified-diff.js';
49
39
  export { decodeStoredRuntimeCard } from '../backend-contracts/index.js';
50
- export { RUNTIME_CARD_SCHEMA_V1, RUNTIME_CARD_LIMITS, RUNTIME_CARD_FIELD_TYPES, RUNTIME_CARD_LINE_ITEM_COLUMN_TYPES, buildRuntimeCardOutcome, buildRuntimeCardPreview, buildRuntimeCardReply, buildRuntimeCardRequest, buildRuntimeInputOutcome, buildRuntimeInputReply, buildRuntimeInputRequest, parseRuntimeCardOutcomeMetadata, parseRuntimeCardReplyMetadata, parseRuntimeCardRequestMetadata, parseRuntimeCardV1, parseRuntimeInputOutcomeMetadata, parseRuntimeInputReplyMetadata, parseRuntimeInputRequestMetadata, resolveQuestionAllowOther, validateRuntimeCardFieldValues, } from './runtime-cards.js';
40
+ export { RUNTIME_CARD_SCHEMA_V1, RUNTIME_CARD_LIMITS, RUNTIME_CARD_FIELD_TYPES, RUNTIME_CARD_LINE_ITEM_COLUMN_TYPES, buildRuntimeCardOutcome, buildRuntimeCardPreview, buildRuntimeInputOutcome, parseRuntimeCardV1, validateRuntimeCardFieldValues, } from './runtime-cards.js';
51
41
  export type { PlanApprovalDecision, PlanApprovalMetadata, PlanApprovalReplyMetadata, RuntimeCardAction, RuntimeCardActionsBlock, RuntimeCardBlock, RuntimeCardBlockKind, RuntimeCardCalloutBlock, RuntimeCardChartBlock, RuntimeCardChartPoint, RuntimeCardChartSeries, RuntimeCardDetailsBlock, RuntimeCardDetailsRow, RuntimeCardField, RuntimeCardFieldChoice, RuntimeCardFieldType, RuntimeCardKnownBlockKind, RuntimeCardLineItemColumn, RuntimeCardLineItemColumnType, RuntimeCardListBlock, RuntimeCardListItem, RuntimeCardMediaKind, RuntimeCardMediaPreviewBlock, RuntimeCardMediaPreviewMedia, RuntimeCardMetric, RuntimeCardMetricGridBlock, RuntimeCardNativeMetadata, RuntimeCardOutcomeMetadata, RuntimeCardPreview, RuntimeCardReplyMetadata, RuntimeCardReplyStatus, RuntimeCardRequestMetadata, RuntimeCardResolutionStatus, RuntimeCardSchemaV1, RuntimeCardSummaryBlock, RuntimeCardTableBlock, RuntimeCardTone, RuntimeCardUnknownBlock, RuntimeCardV1, RuntimeInputAnswers, RuntimeInputChoice, RuntimeInputKind, RuntimeInputNativeMetadata, RuntimeInputOutcomeMetadata, RuntimeInputQuestion, RuntimeInputReplyMetadata, RuntimeInputReplyStatus, RuntimeInputRequestMetadata, RuntimeInputResolutionStatus, } from './runtime-cards.js';
52
- export { DEFAULT_TURN_TRAIL_MAX_BLOCKS, DEFAULT_TURN_TRAIL_METADATA_BUDGET_BYTES, buildBoundedTurnTrail, createTurnOutputController, } from './turn-output-controller.js';
53
- export type { BuildBoundedTurnTrailOptions, TurnOutputController, TurnOutputBlockInput, TurnOutputControllerOptions, TurnOutputMode, TurnOutputSnapshot, } from './turn-output-controller.js';
54
- export { DEFAULT_SILENT_TURN_PRECEDENCE, NO_REPLY_ACK_NOTE, NO_REPLY_REASON_SENTINEL, isSilentTurnSuppressed, reportNoReplyOutcome, resolveSilentTurnDelivery, } from './silent-turn.js';
55
- export type { NoReplyReportClient, SilentTurnPrecedence } from './silent-turn.js';
56
- export { DEFAULT_TURN_VERBOSITY_BY_CONVERSATION_TYPE, QUIET_SUPPRESSES_TURN_TRAIL, normalizeTurnVerbosityConversationType, parseTurnVerbosityConfig, resolveTurnVerbosity, shouldPublishTurnTrail, } from './turn-verbosity.js';
42
+ export { NO_REPLY_ACK_NOTE, NO_REPLY_REASON_SENTINEL, reportNoReplyOutcome, } from './silent-turn.js';
43
+ export type { NoReplyReportClient } from './silent-turn.js';
44
+ export { DEFAULT_TURN_VERBOSITY_BY_CONVERSATION_TYPE, normalizeTurnVerbosityConversationType, parseTurnVerbosityConfig, resolveTurnVerbosity, } from './turn-verbosity.js';
57
45
  export type { TurnVerbosity, TurnVerbosityConfig, TurnVerbosityConversationType, } from './turn-verbosity.js';
58
- export { clearPendingRegistration, getOrCreatePendingRegistration, loadPendingRegistrations, loadProfiles, savePendingRegistrations, saveProfiles, updatePendingRegistration, upsertAgentProfile, isProfileLocked, acquireLock, releaseLock, isProcessAlive, CANON_DIR, AGENTS_PATH, LOCKS_DIR, } from './agent-profiles.js';
46
+ export { clearPendingRegistration, loadPendingRegistrations, loadProfiles, savePendingRegistrations, saveProfiles, upsertAgentProfile, isProfileLocked, acquireLock, releaseLock, isProcessAlive, CANON_DIR, AGENTS_PATH, LOCKS_DIR, } from './agent-profiles.js';
59
47
  export type { AgentProfile, AgentProfileInput, PendingRegistration, ProfileLockHandle, } from './agent-profiles.js';
60
- export { resolveCanonAgent, resolveCanonProfile, verifyResolvedAgentEnvironment, getActiveProfile, getActiveProfileLock, } from './agent-resolver.js';
61
- export type { ResolvedAgent } from './agent-resolver.js';
62
- export { RUNTIMES_DIR, buildLocalRuntimeId, clearRuntimeSessionState, describeProfileLock, heartbeatLocalRuntimeEntry, listLocalRuntimeEntries, loadRuntimeSessionState, markLocalRuntimeStopped, readLocalRuntimeEntry, resetCodexRuntimeSessionState, resetRuntimeSessionState, resolveLocalRuntimeSessionState, saveRuntimeSessionState, upsertLocalRuntimeEntry, } from './local-runtime-catalog.js';
63
- export type { LocalRuntimeCatalogEntry, LocalRuntimeKind, LocalRuntimeResumeField, LocalRuntimeReviveCapability, LocalRuntimeSessionResolution, LocalRuntimeSessionState, LocalRuntimeStatus, } from './local-runtime-catalog.js';
64
- export { buildConfiguredWorkspaceOptions, buildConversationEnvironmentKey, buildConversationWorktreeSpec, buildPublicWorkspaceOptions, buildWorkspaceOptionId, EXECUTION_ENVIRONMENT_MODES, isEnabledFlag, isExecutionEnvironmentMode, normalizeOptionalString, resolveConfiguredWorkspaceCwd, ExecutionEnvironmentError, prepareConversationEnvironment, releaseConversationEnvironment, } from './execution-environment.js';
65
- export type { ConfiguredWorkspaceOption, ExecutionEnvironmentMode, PreparedExecutionEnvironment, } from './execution-environment.js';
66
48
  export { initRTDBAuth, } from './rtdb-rest.js';
67
49
  export type { AgentSessionSnapshotPatch, RTDBClientHandle, RuntimeActivityPayloadData, RuntimeInfoPayloadData, SessionStatePayload, TurnStatePayload, } from './rtdb-rest.js';
68
- export { CANON_TURN_CONTEXT_SCHEMA_V2, buildCanonReplyContextLines, buildCanonTurnContextV2, buildHydratedInboundContext, hydrateCanonReplyContext, createConversationMetadataLoader, decideAutoReply, publishHostAgentRuntime, publishHostSessionSnapshots, renderCanonHostInboundContent, renderCanonTurnBriefPrompt, resolveCanonReplyContext, } from './host-runtime.js';
69
- export type { CanonTurnContextAttachmentV2, CanonTurnContextBehaviorV2, CanonTurnContextContactCardV2, CanonTurnContextParticipationV2, CanonTurnContextProvenanceV2, CanonTurnContextReplyContextV2, CanonTurnContextV2, } from './host-runtime.js';
70
- export type { CanonReplyContext, AutoReplyDecision, HostInboundParticipantContext, } from './host-runtime.js';
71
- export { CANON_INBOUND_FRAME_SCHEMA_V1, buildCanonInboundFrameV1, renderCodingHostInboundPrompt, renderOpenClawSystemPrompt, } from './inbound-frame.js';
72
- export type { CanonInboundFrameShapeV1, CanonInboundFrameV1, CanonInboundPromptOptions, } from './inbound-frame.js';
73
- export { buildCanonGroupContext, buildCanonKnownRecentParticipants, buildCompactGroupContextLines, diffCanonMemberIds, } from './group-context.js';
50
+ export { renderCanonHostInboundContent, } from './host-runtime.js';
51
+ export type { CanonReplyContext, } from './host-runtime.js';
74
52
  export { createRuntimeStatePublisher, } from './runtime-state-publisher.js';
75
53
  export type { RuntimeStatePublisher, RuntimeStatePublisherOptions, RuntimeStreamingPayload, ClearRuntimeActivityOptions, } from './runtime-state-publisher.js';
76
- export { createTypingStatusPublisher, } from './typing-status-publisher.js';
77
- export type { TypingPresenceStatus, TypingStatusPublisher, TypingStatusPublisherOptions, } from './typing-status-publisher.js';
78
- export { buildChunkedMessagePartMetadata, CANON_MESSAGE_TEXT_MAX_BYTES, ChunkedSendMessageError, DEFAULT_CHUNKED_MESSAGE_TEXT_MAX_BYTES, sendMessageWithRetryChunked, isCanonMessageIdConflict, isPendingCanonOperation, isChunkedSendMessageError, isRetryableCanonDeliveryError, sendMessageWithRetry, splitTextByUtf8Bytes, utf8ByteLength, } from './retry.js';
54
+ export { buildChunkedMessagePartMetadata, CANON_MESSAGE_TEXT_MAX_BYTES, ChunkedSendMessageError, DEFAULT_CHUNKED_MESSAGE_TEXT_MAX_BYTES, sendMessageWithRetryChunked, isPendingCanonOperation, isChunkedSendMessageError, isRetryableCanonDeliveryError, sendMessageWithRetry, splitTextByUtf8Bytes, utf8ByteLength, } from './retry.js';
79
55
  export type { ChunkedMessagePartMetadataInput, ChunkedSendMessageResult, SendMessageChunkingOptions, SendMessageRetryOptions, } from './retry.js';
80
- export { formatCanonMessageAsText } from './message-format.js';
81
- export { DEFAULT_BASE_URL, DEFAULT_STREAM_URL, DEFAULT_RTDB_URL, FIREBASE_WEB_API_KEY } from './constants.js';
56
+ export { DEFAULT_BASE_URL } from './constants.js';
82
57
  export { CANON_RUNTIME_ENDPOINT_DEFAULTS, DEFAULT_CANON_ENVIRONMENT_ID, DEFAULT_CANON_RUNTIME_ENDPOINTS, getCanonRuntimeEndpointDefaults, requireCanonRuntimeEndpointDefaults, resolveCanonRuntimeConnection, verifyCanonRuntimeConnection, } from './runtime-endpoints.js';
83
58
  export type { CanonRuntimeConnection, CanonRuntimeConnectionOptions, CanonRuntimeEndpointDefaults, } from './runtime-endpoints.js';
84
59
  export { CANON_ENVIRONMENT_CONTRACTS, getCanonEnvironmentContract, } from '../backend-contracts/index.js';
@@ -86,22 +61,8 @@ export type { CanonEnvironmentContract, CanonEnvironmentId, CanonEnvironmentName
86
61
  export { resolveCanonBaseUrl } from './base-url.js';
87
62
  export { handleCliMetadataRequest, isDirectExecution, readCliPackageVersion, runCli, } from './cli-metadata.js';
88
63
  export type { CliMetadata, RunCliMetadataOptions, } from './cli-metadata.js';
89
- export { ControlChannelPoller, type ControlChannelKey, type ControlChannelPollerOptions, type ControlChannelRTDB, type ControlHandlerResult, type ControlPollerCadence, type ControlPollerError, type ControlPrimitiveEvent, type ControlPrimitiveHandlerConfig, type ControlSignalEvent, type ControlSignalHandlerConfig, type ControlSignalType } from './control-poller.js';
90
- export { CANON_VERB_NAMES, CANON_VERB_NAMESPACE, CANON_VERBS_SCHEMA_ID, CANON_VERBS_SCHEMA_VERSION, CANON_VERB_WIRE_SCHEMA_ID, CANON_VERB_WIRE_SCHEMA_VERSION, CANON_CARD_SCHEMA_ID, VERB_LIMITS, VERB_RATE_LIMITS, VERB_WIRE_ENVELOPE_FIELDS, canonVerbToolName, findVerbByteLimitViolations, findVerbWireEnvelopeViolations, getVerbInputSchema, getVerbResultSchema, mergeVerbWireToIntent, normalizeVerbNativeMetadata, projectVerbIntentToWire, type CanonVerbName, type CanonVerbWireEnvelope, type CanonVerbWireRequest, type CanonVerbWireResponse, type CanonVerbJsonSchema, type GetVerbSchemaOptions, type SendToInput, type SendToResult, type VerbMessageOptions, type VerbNativeMetadata, type VerbWireAccepted, type VerbWireBody, } from '../backend-contracts/index.js';
64
+ export { CANON_VERB_NAMES, CANON_VERB_NAMESPACE, CANON_VERBS_SCHEMA_ID, CANON_VERBS_SCHEMA_VERSION, CANON_VERB_WIRE_SCHEMA_ID, CANON_VERB_WIRE_SCHEMA_VERSION, CANON_CARD_SCHEMA_ID, VERB_LIMITS, VERB_RATE_LIMITS, VERB_WIRE_ENVELOPE_FIELDS, canonVerbToolName, findVerbByteLimitViolations, findVerbWireEnvelopeViolations, getVerbResultSchema, mergeVerbWireToIntent, normalizeVerbNativeMetadata, projectVerbIntentToWire, type CanonVerbName, type CanonVerbWireEnvelope, type CanonVerbWireRequest, type CanonVerbWireResponse, type CanonVerbJsonSchema, type SendToInput, type SendToResult, type VerbMessageOptions, type VerbNativeMetadata, type VerbWireAccepted, type VerbWireBody, } from '../backend-contracts/index.js';
91
65
  export { DEFAULT_DISCOVER_AGENTS_LIMIT, MAX_DISCOVER_AGENTS_LIMIT, MAX_DISCOVER_AGENTS_QUERY_LENGTH, type CanonAgentDirectoryEntry, type DiscoverAgentsInput, type DiscoverAgentsResult, } from '../backend-contracts/index.js';
92
66
  export { parseDirectConversationSelection, readCommunicationRule, type CommunicateInput, type CommunicateResult, type CommunicationRule, type DirectConversationSelection, type StartDirectInput, type StartDirectResult, } from '../backend-contracts/index.js';
93
67
  export { canonMediaDownloadUrl, sanitizeDownloadFileName, buildMediaContentDisposition, getStoredFileExtension } from '../backend-contracts/index.js';
94
- export type { NativeSessionInteractionBridge, NativeSessionInteractionRequest, NativeSessionInteractionResult } from './native-session-interaction.js';
95
- export { NativeWorkSessionCreateError } from './work-session-provider.js';
96
- export type { NativeWorkSessionProvider, NativeWorkSessionCreated, NativeWorkSessionCreateContext } from './work-session-provider.js';
97
- export * from './exclusive-json-file-store.js';
98
68
  export * from './completed-output-journal.js';
99
- export type { WorkSessionChoice, WorkSessionModelChoice, WorkSessionSettings, WorkSessionSelection, WorkSessionLoadedSession, WorkSessionCatalog, WorkSessionRuntimeIdentity, WorkSessionRuntimeLease, WorkSessionRuntimeRegistration, WorkSessionBinding, WorkSessionRuntimeState, WorkSessionCatalogResult, RequestWorkSessionInput, WorkSessionRequestStatus, WorkSessionRequest, WorkSessionCompletion, WorkSessionRuntimeAuth, WorkSessionClaimInput, WorkSessionClaimResult, CompleteWorkSessionInput, WorkSessionHeartbeatInput, ReleaseWorkSessionBindingInput, GetWorkSessionRequestInput, WorkSessionReportInput, WorkSessionDetailFields, WorkSessionDetailField, } from '../backend-contracts/index.js';
100
- export { ARTIFACT_IMAGE_MIME_TYPES, ArtifactMemory, CanonArtifactError, artifactCommandId, artifactRequestUuid, createConversationArtifacts, sniffArtifactImageType, summarizeArtifactReferences, } from './artifacts.js';
101
- export type { ArtifactAddImageInput, ArtifactAddImageResult, ArtifactConflictView, ArtifactCreateInput, ArtifactGenerateImageInput, ArtifactGenerateImageResult, ArtifactIdDerivation, ArtifactInputValue, ArtifactList, ArtifactListItem, ArtifactRoomHost, ArtifactUpdateAction, ArtifactUpdateResult, ArtifactWriteView, CanonArtifactErrorCode, CanonConversationArtifacts, } from './artifacts.js';
102
- export { ARTIFACT_CONTEXT_PROTOCOL, ARTIFACT_FORM_FIELD_TYPES, ARTIFACT_ID_PATTERN, ARTIFACT_KEY_PATTERN, ARTIFACT_KINDS, ARTIFACT_LIMITS, ARTIFACT_PROTOCOL_VERSION, artifactActivityText, isCanonArtifactEnvironmentEnabled, parseArtifactContext, readArtifactContext, } from '../backend-contracts/index.js';
103
- export { ARTIFACT_ACTION_SEMANTICS, ARTIFACT_TOOL_NAMES, ARTIFACT_UPDATE_ACTION_TYPES, ArtifactValidationError, artifactActionSchemas, artifactToolInputSchemas, parseArtifactAddImageAction, parseArtifactCreateAction, parseArtifactCreateToolInput, parseArtifactGenerateImageAction, parseArtifactImageRegion, parseArtifactImageSource, parseArtifactUpdateAction, } from '../backend-contracts/index.js';
104
- export type { ArtifactActionSchemas, ArtifactActionValue, ArtifactAddImageAction, ArtifactCellAction, ArtifactCreateAction, ArtifactCreateToolInput, ArtifactGenerateImageAction, ArtifactImageSource, ArtifactJsonSchema, ArtifactRowAction, ArtifactToolName, } from '../backend-contracts/index.js';
105
- export type { ArtifactAsset, ArtifactChessPlayers, ArtifactCommand, ArtifactContext, ArtifactDefinition, ArtifactDomainOutcome, ArtifactFormColumn, ArtifactFormField, ArtifactFormFieldRemoval, ArtifactFormFieldType, ArtifactFormRow, ArtifactFormTable, ArtifactFormValue, ArtifactImageVariant, ArtifactJson, ArtifactKind, ArtifactReadResult, ArtifactReference, ArtifactReferenceOrigin, ArtifactSelection, ArtifactSnapshot, } from '../backend-contracts/index.js';
106
- export { ArtifactRejectedError, describeArtifact, summarizeArtifact, isTerminalImageGenerationError } from '../endpoint/index.js';
107
- export type { ArtifactChessMoveView, ArtifactChessView, ArtifactConflict, ArtifactFormChangeView, ArtifactFormFieldView, ArtifactFormView, ArtifactImageRegion, ArtifactImageVariantView, ArtifactImageView, ArtifactLibrary, ArtifactPrincipalView, ArtifactView, } from '../endpoint/index.js';
@@ -1,21 +1,5 @@
1
- import type { RegistrationInput, RegistrationResult, RegistrationStatus } from './types.js';
2
- /**
3
- * Registers a new Canon agent and polls for owner approval.
4
- *
5
- * Flow:
6
- * 1. POST /agents/register -> returns requestId
7
- * 2. Poll GET /agents/status/:requestId until approved/rejected/timeout
8
- * 3. On approval, returns the API key
9
- */
10
- export declare function registerAndWaitForApproval(input: RegistrationInput, callbacks?: {
11
- onSubmitted?: (requestId: string, pollToken?: string) => void | Promise<void>;
12
- onPollUpdate?: (status: RegistrationStatus) => void | Promise<void>;
13
- }): Promise<RegistrationResult>;
1
+ import type { RegistrationInput } from './types.js';
14
2
  export declare function submitRegistrationRequest(input: RegistrationInput): Promise<{
15
3
  requestId: string;
16
4
  pollToken?: string;
17
5
  }>;
18
- export declare function waitForRegistrationApproval(baseUrl: string | undefined, requestId: string, pollToken?: string, callbacks?: {
19
- onPollUpdate?: (status: RegistrationStatus) => void | Promise<void>;
20
- }): Promise<RegistrationResult>;
21
- export declare function ackRegistrationApproval(baseUrl: string | undefined, requestId: string, pollToken?: string): Promise<void>;
@@ -37,15 +37,6 @@ export interface SendMessageChunkingOptions {
37
37
  export interface ChunkedSendMessageResult {
38
38
  messageIds: string[];
39
39
  }
40
- /**
41
- * The server's message-id idempotency guard rejecting a send.
42
- *
43
- * A byte-identical replay of a message succeeds (`created: false`), so a 409
44
- * `MESSAGE_ID_EXISTS` means a message already exists under this id whose stored
45
- * content diverges from what is being sent now. Either way the id is TAKEN:
46
- * that message is durable in Canon and re-sending it is impossible.
47
- */
48
- export declare function isCanonMessageIdConflict(error: unknown): boolean;
49
40
  /** Pending delivery is visible, but cannot truthfully produce a failure notice. */
50
41
  export declare function isPendingCanonOperation(error: unknown): boolean;
51
42
  /**
@@ -116,10 +116,6 @@ interface RTDBAuthOptions {
116
116
  firebaseApiKey?: string;
117
117
  }
118
118
  export interface RTDBClientHandle {
119
- observeControls?(changed: (conversationId?: string) => void, connected: (value: boolean) => void): () => void;
120
- /** Consume only the exact value returned by this handle before dispatch. */
121
- consume(path: string, observed: unknown): Promise<void>;
122
- observedRevision(path: string, observed: unknown): string | undefined;
123
119
  read(path: string): Promise<unknown>;
124
120
  write(path: string, data: unknown): Promise<void>;
125
121
  patch(path: string, data: unknown): Promise<void>;
@@ -96,7 +96,6 @@ export interface RuntimeInputOutcomeMetadata {
96
96
  reason?: 'submitted' | 'cancelled' | 'timeout' | 'expired' | 'interrupted';
97
97
  }
98
98
  export declare const RUNTIME_CARD_SCHEMA_V1: "canon.card.v1";
99
- export declare const RUNTIME_CARD_PUBLIC_REQUEST_TEXT: "Action requested";
100
99
  export type RuntimeCardSchemaV1 = typeof RUNTIME_CARD_SCHEMA_V1;
101
100
  export type RuntimeCardBlockKind = 'summary' | 'metricGrid' | 'chart' | 'table' | 'list' | 'callout' | 'actions' | 'mediaPreview' | 'details';
102
101
  export type RuntimeCardTone = 'neutral' | 'primary' | 'positive' | 'warning' | 'negative' | 'danger' | 'critical' | 'welcome';
@@ -268,29 +267,10 @@ export interface RuntimeCardOutcomeMetadata {
268
267
  turnSemantics: 'control';
269
268
  replyBehavior: 'suppress_auto_reply';
270
269
  }
271
- /**
272
- * Mac-app parity: a choice-bearing question always offers a free-text "Other"
273
- * escape hatch unless the producing agent explicitly opts out. Shared by every
274
- * runtime's question mapper so the fallback is consistent across agents.
275
- */
276
- export declare function resolveQuestionAllowOther(hasChoices: boolean, explicit?: unknown): boolean;
277
270
  /** Block kinds this version of core knows how to fully normalize/render. */
278
271
  export type RuntimeCardKnownBlockKind = 'summary' | 'metricGrid' | 'chart' | 'table' | 'list' | 'callout' | 'actions' | 'mediaPreview' | 'details';
279
272
  export declare function parseRuntimeCardV1(value: unknown): RuntimeCardV1 | null;
280
273
  export declare function buildRuntimeCardPreview(card: RuntimeCardV1): RuntimeCardPreview;
281
- export declare function buildRuntimeInputRequest(inputId: string, input: Omit<RuntimeInputRequestMetadata, 'type' | 'inputId'>): {
282
- text: string;
283
- metadata: RuntimeInputRequestMetadata;
284
- };
285
- export declare function buildRuntimeInputReply(inputId: string, status: RuntimeInputReplyStatus, details?: {
286
- kind?: RuntimeInputKind;
287
- answerSummary?: string;
288
- answersSummary?: string;
289
- sensitive?: boolean;
290
- }): {
291
- text: string;
292
- metadata: RuntimeInputReplyMetadata;
293
- };
294
274
  export declare function buildRuntimeInputOutcome(inputId: string, status: RuntimeInputResolutionStatus, details?: {
295
275
  kind?: RuntimeInputKind;
296
276
  reason?: RuntimeInputOutcomeMetadata['reason'];
@@ -298,34 +278,9 @@ export declare function buildRuntimeInputOutcome(inputId: string, status: Runtim
298
278
  text: string;
299
279
  metadata: RuntimeInputOutcomeMetadata;
300
280
  };
301
- export declare function buildRuntimeCardRequest(card: RuntimeCardV1, input: {
302
- cardId?: string;
303
- responseUserId?: string;
304
- expiresAt: string | number | Date;
305
- runtimeId?: string;
306
- turnId?: string;
307
- native?: RuntimeCardNativeMetadata;
308
- }): {
309
- text: string;
310
- metadata: RuntimeCardRequestMetadata;
311
- };
312
- export declare function buildRuntimeCardReply(cardId: string, status: RuntimeCardReplyStatus, details?: {
313
- actionId?: string;
314
- answerSummary?: string;
315
- sensitive?: boolean;
316
- }): {
317
- text: string;
318
- metadata: RuntimeCardReplyMetadata;
319
- };
320
281
  export declare function buildRuntimeCardOutcome(cardId: string, status: RuntimeCardResolutionStatus, details?: {
321
282
  reason?: RuntimeCardOutcomeMetadata['reason'];
322
283
  }): {
323
284
  text: string;
324
285
  metadata: RuntimeCardOutcomeMetadata;
325
286
  };
326
- export declare function parseRuntimeInputRequestMetadata(value: unknown): RuntimeInputRequestMetadata | null;
327
- export declare function parseRuntimeCardRequestMetadata(value: unknown): RuntimeCardRequestMetadata | null;
328
- export declare function parseRuntimeCardReplyMetadata(value: unknown): RuntimeCardReplyMetadata | null;
329
- export declare function parseRuntimeCardOutcomeMetadata(value: unknown): RuntimeCardOutcomeMetadata | null;
330
- export declare function parseRuntimeInputReplyMetadata(value: unknown): RuntimeInputReplyMetadata | null;
331
- export declare function parseRuntimeInputOutcomeMetadata(value: unknown): RuntimeInputOutcomeMetadata | null;
@@ -1,75 +1,16 @@
1
1
  export { normalizeRuntimeCommandAlias, normalizeRuntimeCommandAliases } from '../backend-contracts/index.js';
2
2
  import type { ExecutionEnvironmentMode } from './execution-environment-mode.js';
3
- import { type AgentCapabilities, type AgentClientType, type CanonControlDescriptor, type CanonControlLiveBehavior, type CanonRuntimeCommandDescriptor, type CanonRuntimeDescriptor, type CanonRuntimeStreamingMode, type CanonRuntimeTurnModeDescriptor, type CanonWorkspaceRootMetadata, type ModelOption, type PermissionModeOption, type WorkspaceOption } from './types.js';
4
- import type { CanonRuntimePresentationPolicy } from './types.js';
5
- import type { HostAdmissionActionCapabilities } from './turn-protocol.js';
3
+ import type { CanonRuntimeCommandDescriptor } from './types.js';
6
4
  export interface NormalizeRuntimeCommandDescriptorsOptions {
7
5
  reservedAliases?: Iterable<string>;
8
6
  maxCommands?: number;
9
7
  }
10
8
  export declare function normalizeRuntimeCommandDescriptors(commands: ReadonlyArray<CanonRuntimeCommandDescriptor>, options?: NormalizeRuntimeCommandDescriptorsOptions): CanonRuntimeCommandDescriptor[];
11
- /**
12
- * Default reasoning/thinking-level options. This is plain data, not Claude
13
- * logic — any coding agent can reuse it or supply its own option set. Each
14
- * agent passes its native effort levels into the shared descriptor builder.
15
- */
16
- export declare const EFFORT_OPTIONS: readonly [{
17
- readonly value: "low";
18
- readonly label: "Low";
19
- }, {
20
- readonly value: "medium";
21
- readonly label: "Medium";
22
- }, {
23
- readonly value: "high";
24
- readonly label: "High";
25
- }, {
26
- readonly value: "xhigh";
27
- readonly label: "Extra high";
28
- }, {
29
- readonly value: "max";
30
- readonly label: "Max";
31
- }];
32
9
  export declare const EXECUTION_MODE_CONTROL_OPTIONS: ReadonlyArray<{
33
10
  value: ExecutionEnvironmentMode;
34
11
  label: string;
35
12
  description: string;
36
13
  }>;
37
- export declare function buildRuntimeWorkspaceControlOptions(workspaces: ReadonlyArray<WorkspaceOption>): ModelOption[];
38
14
  export declare const RUNTIME_STOP_ACTION: CanonRuntimeCommandDescriptor;
39
15
  export declare const RUNTIME_STOP_AND_DROP_ACTION: CanonRuntimeCommandDescriptor;
40
16
  export declare const RUNTIME_NEW_SESSION_ACTION: CanonRuntimeCommandDescriptor;
41
- export declare function buildFirstPartyCodingRuntimeDescriptor(input: {
42
- /**
43
- * Any agent client type may use this builder. Per-agent differences are
44
- * driven by the {@link AGENT_CAPABILITIES} table and the option/behavior
45
- * fields below — not by hard-coded clientType branches — so adding a coding
46
- * agent is a capability-table entry plus its own option lists.
47
- */
48
- clientType: AgentClientType;
49
- models: ReadonlyArray<ModelOption>;
50
- workspaces: ReadonlyArray<WorkspaceOption>;
51
- workspaceRoots?: ReadonlyArray<CanonWorkspaceRootMetadata>;
52
- executionModes: ReadonlyArray<ExecutionEnvironmentMode>;
53
- /** Deployer-owned local default used when a conversation has no override. */
54
- defaultExecutionMode?: ExecutionEnvironmentMode;
55
- permissionModes?: ReadonlyArray<PermissionModeOption>;
56
- defaultPermissionMode?: string | null;
57
- /** Permission-mode control label override (e.g. Codex uses "Execution policy"). */
58
- permissionModeLabel?: string;
59
- /** Effort/thinking-level options. When provided, an effort control is emitted. */
60
- effortOptions?: ReadonlyArray<ModelOption>;
61
- defaultEffort?: string | null;
62
- effortLiveBehavior?: CanonControlLiveBehavior;
63
- /** Model control live behavior. Defaults to immediate; Codex applies next turn. */
64
- modelLiveBehavior?: 'immediate' | 'next_turn';
65
- /** Capability overrides; defaults to the AGENT_CAPABILITIES entry for clientType. */
66
- capabilities?: AgentCapabilities;
67
- commands?: ReadonlyArray<CanonRuntimeCommandDescriptor>;
68
- turnModes?: ReadonlyArray<CanonRuntimeTurnModeDescriptor>;
69
- /** Extra runtime controls appended after the built-in effort control. */
70
- extraRuntimeControls?: ReadonlyArray<CanonControlDescriptor>;
71
- streamingTextMode: CanonRuntimeStreamingMode;
72
- admissionActions?: HostAdmissionActionCapabilities;
73
- presentation?: CanonRuntimePresentationPolicy;
74
- runtimeCards?: CanonRuntimeDescriptor['runtimeCards'];
75
- }): CanonRuntimeDescriptor;
@@ -1,35 +1,9 @@
1
- import type { AgentRuntime, AgentSessionSnapshot, CanonRuntimeActivityItem, CanonRuntimeDescriptor, CanonRuntimePresentationField, CanonRuntimePresentationPolicy, RuntimeInfoPayload } from './types.js';
2
- export declare const RUNTIME_PRESENTATION_FIELDS: readonly ["model", "permissionMode", "effort", "workspace", "executionMode", "contextUsage", "cwd", "branch", "worktreePath", "workspaceRoot", "workspaceRelativePath", "fallbackReason"];
3
- export declare const DEFAULT_FIRST_PARTY_RUNTIME_PRESENTATION: CanonRuntimePresentationPolicy;
4
- export declare function isRuntimePresentationField(value: string): value is CanonRuntimePresentationField;
5
- export declare function buildRuntimePresentationPolicy(input?: {
6
- preset?: CanonRuntimePresentationPolicy['preset'];
7
- show?: ReadonlyArray<string>;
8
- hide?: ReadonlyArray<string>;
9
- base?: CanonRuntimePresentationPolicy;
10
- }): CanonRuntimePresentationPolicy;
1
+ import type { AgentSessionSnapshot, CanonRuntimeActivityItem, CanonRuntimeDescriptor, CanonRuntimePresentationField, RuntimeInfoPayload } from './types.js';
11
2
  export declare function isRuntimePresentationFieldHidden(descriptor: CanonRuntimeDescriptor | null | undefined, field: CanonRuntimePresentationField): boolean;
12
3
  export declare function redactRuntimeActivityItemForConversation(item: CanonRuntimeActivityItem): CanonRuntimeActivityItem | null;
13
4
  export declare function redactRuntimeInfoForConversation<T extends Partial<Omit<RuntimeInfoPayload, 'updatedAt'>> | RuntimeInfoPayload>(payload: T, options?: {
14
5
  descriptor?: CanonRuntimeDescriptor | null;
15
6
  }): T;
16
- export declare function redactAgentRuntimeForConversation(runtime: AgentRuntime): AgentRuntime;
17
- type SessionStatePresentationLike = {
18
- model?: unknown;
19
- permissionMode?: unknown;
20
- effort?: unknown;
21
- cwd?: unknown;
22
- executionMode?: unknown;
23
- executionBranch?: unknown;
24
- worktreePath?: unknown;
25
- executionFallbackReason?: unknown;
26
- contextUsage?: unknown;
27
- availableModels?: unknown;
28
- runtimeControlValues?: Record<string, unknown>;
29
- controlState?: Record<string, unknown>;
30
- };
31
- export declare function redactSessionStateForConversation<T extends SessionStatePresentationLike>(descriptor: CanonRuntimeDescriptor | null | undefined, state: T): T;
32
7
  export declare function redactAgentSessionSnapshotForConversation(descriptor: CanonRuntimeDescriptor | null | undefined, snapshot: Partial<AgentSessionSnapshot> & Record<string, unknown>, options?: {
33
8
  patch?: boolean;
34
9
  }): Partial<AgentSessionSnapshot> & Record<string, unknown>;
35
- export {};