@finalai/agent-provider 0.4.3 → 0.5.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.
@@ -18,7 +18,7 @@ export interface ChannelSendInputIface {
18
18
  source?: ChannelInputSourceIface;
19
19
  }
20
20
  export interface ChannelResponseInputIface {
21
- pendingId: string;
21
+ decisionId: string;
22
22
  outcome: JsonValue;
23
23
  auth: ChannelAuthIface;
24
24
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/channel-context.ts"],
4
- "sourcesContent": ["import type { ContentBlock } from '@agentclientprotocol/sdk/experimental/v2';\nimport * as z from 'zod';\nimport { type ChannelAuthIface, type ChannelPlatformIface, type TurnPolicy } from \"./channel.mjs\";\nimport type { JsonObject, JsonValue } from \"./json.mjs\";\n\nexport { ChannelPrincipalType, channelAuthSchema, type ChannelAuthIface } from \"./channel.mjs\";\n\n// How a Final room captions the agent's reply to the input (\"After the 9:00\n// schedule\", \"From Dana in #support\"); the platform names the principal when absent.\nexport interface ChannelInputSourceIface {\n label: string;\n}\n\nexport interface ChannelSendInputIface {\n content: ContentBlock[];\n idempotencyKey: string;\n // Required: the platform records the principal of every input.\n auth: ChannelAuthIface;\n context?: string[];\n title?: string;\n turnPolicy?: TurnPolicy | `${TurnPolicy}`;\n // The person the input acts for when its principal is a service: who pays and answers.\n actingUserId?: string;\n // The turn whose work produced the input (a relay or handoff), for loop limits.\n originTurnId?: string;\n source?: ChannelInputSourceIface;\n}\n\nexport interface ChannelResponseInputIface {\n pendingId: string;\n outcome: JsonValue;\n // Who answered; the channel decides who may (its audience policy) before responding.\n auth: ChannelAuthIface;\n}\n\n// Exactly one of an address (the channel's own), an attached session, or a\n// Final room (`conversationId`, optionally one agent `participantId` in it).\nexport interface ChannelSessionTargetIface {\n address?: string;\n sessionId?: string;\n conversationId?: string;\n participantId?: string;\n}\n\n// `send` accepts the input before any agent runs: the prompt follows, retried\n// by the platform, and the reply arrives through the channel's events.\nexport interface ChannelInputReceiptIface {\n inputId: string;\n sessionId: string;\n}\n\nexport const channelInputReceiptSchema = z.object({\n inputId: z.string().min(1),\n sessionId: z.string().min(1),\n});\n\n// Where a handoff went: a Final room's input, or another channel's own receive\n// (which names a session or nothing).\nexport interface ChannelHandoffReceiptIface {\n inputId: string | null;\n sessionId: string | null;\n}\n\nexport const channelHandoffReceiptSchema = z.object({\n inputId: z.string().min(1).nullable(),\n sessionId: z.string().min(1).nullable(),\n});\n\nexport interface ChannelSessionSnapshotIface {\n sessionId: string;\n conversationId: string | null;\n}\n\nexport interface ChannelCancelInputIface {\n reason?: string;\n throughMessageSeq?: number;\n}\n\nexport interface ChannelSessionOperationsIface {\n inspect(target: ChannelSessionTargetIface): Promise<ChannelSessionSnapshotIface | null>;\n resolve(target: ChannelSessionTargetIface): Promise<string | null>;\n send(\n target: ChannelSessionTargetIface,\n input: ChannelSendInputIface,\n ): Promise<ChannelInputReceiptIface>;\n respond(\n target: ChannelSessionTargetIface,\n input: ChannelResponseInputIface,\n ): Promise<{ resolved: boolean }>;\n cancel(\n target: ChannelSessionTargetIface,\n input?: ChannelCancelInputIface,\n ): Promise<{ accepted: boolean }>;\n close(target: ChannelSessionTargetIface): Promise<void>;\n observe(\n target: ChannelSessionTargetIface,\n input: { content: ContentBlock[]; idempotencyKey: string },\n ): Promise<void>;\n setConfigOption(\n target: ChannelSessionTargetIface,\n input: { configId: string; value: JsonValue },\n ): Promise<void>;\n park(target: ChannelSessionTargetIface): Promise<void>;\n getState(target: ChannelSessionTargetIface): Promise<JsonObject>;\n setState(target: ChannelSessionTargetIface, state: JsonObject): Promise<void>;\n // Input for another of the agent's channels: `final` targets `{ conversationId, participantId? }`.\n handoff(\n channel: string,\n target: JsonValue,\n input: ChannelSendInputIface,\n ): Promise<ChannelHandoffReceiptIface>;\n}\n\nexport interface ChannelSessionHandleIface {\n inspect(): Promise<ChannelSessionSnapshotIface | null>;\n resolveSession(): Promise<string | null>;\n send(input: ChannelSendInputIface): ReturnType<ChannelSessionOperationsIface['send']>;\n respond(input: ChannelResponseInputIface): ReturnType<ChannelSessionOperationsIface['respond']>;\n cancel(input?: ChannelCancelInputIface): ReturnType<ChannelSessionOperationsIface['cancel']>;\n close(): Promise<void>;\n observe(input: { content: ContentBlock[]; idempotencyKey: string }): Promise<void>;\n setConfigOption(input: { configId: string; value: JsonValue }): Promise<void>;\n park(): Promise<void>;\n getState(): Promise<JsonObject>;\n setState(state: JsonObject): Promise<void>;\n}\n\nexport interface ChannelAddressContextIface {\n from(address: string): ChannelSessionHandleIface;\n resolveSession(address: string): Promise<string | null>;\n attachSession(id: string): ChannelSessionHandleIface;\n to(\n channel: string,\n target: JsonValue,\n ): { send(input: ChannelSendInputIface): Promise<ChannelHandoffReceiptIface> };\n}\n\n// Handles resolve at operation time. Only attachSession captures a session ID.\nexport const channelAccessors = (\n platform: Pick<ChannelPlatformIface, 'channelSessions'>,\n): ChannelAddressContextIface => {\n const operations = () => {\n if (platform.channelSessions == null)\n throw new Error('channel session operations are unavailable');\n return platform.channelSessions;\n };\n const handle = (target: ChannelSessionTargetIface): ChannelSessionHandleIface => ({\n inspect: () => operations().inspect(target),\n resolveSession: () => operations().resolve(target),\n send: (input) => operations().send(target, input),\n respond: (input) => operations().respond(target, input),\n cancel: (input) => operations().cancel(target, input),\n close: () => operations().close(target),\n observe: (input) => operations().observe(target, input),\n setConfigOption: (input) => operations().setConfigOption(target, input),\n park: () => operations().park(target),\n getState: () => operations().getState(target),\n setState: (state) => operations().setState(target, state),\n });\n return {\n from: (address) => handle({ address }),\n resolveSession: (address) => operations().resolve({ address }),\n attachSession: (sessionId) => handle({ sessionId }),\n to: (channel, target) => ({ send: (input) => operations().handoff(channel, target, input) }),\n };\n};\n"],
4
+ "sourcesContent": ["import type { ContentBlock } from '@agentclientprotocol/sdk/experimental/v2';\nimport * as z from 'zod';\nimport { type ChannelAuthIface, type ChannelPlatformIface, type TurnPolicy } from \"./channel.mjs\";\nimport type { JsonObject, JsonValue } from \"./json.mjs\";\n\nexport { ChannelPrincipalType, channelAuthSchema, type ChannelAuthIface } from \"./channel.mjs\";\n\n// How a Final room captions the agent's reply to the input (\"After the 9:00\n// schedule\", \"From Dana in #support\"); the platform names the principal when absent.\nexport interface ChannelInputSourceIface {\n label: string;\n}\n\nexport interface ChannelSendInputIface {\n content: ContentBlock[];\n idempotencyKey: string;\n // Required: the platform records the principal of every input.\n auth: ChannelAuthIface;\n context?: string[];\n title?: string;\n turnPolicy?: TurnPolicy | `${TurnPolicy}`;\n // The person the input acts for when its principal is a service: who pays and answers.\n actingUserId?: string;\n // The turn whose work produced the input (a relay or handoff), for loop limits.\n originTurnId?: string;\n source?: ChannelInputSourceIface;\n}\n\nexport interface ChannelResponseInputIface {\n decisionId: string;\n outcome: JsonValue;\n // Who answered; the channel decides who may (its audience policy) before responding.\n auth: ChannelAuthIface;\n}\n\n// Exactly one of an address (the channel's own), an attached session, or a\n// Final room (`conversationId`, optionally one agent `participantId` in it).\nexport interface ChannelSessionTargetIface {\n address?: string;\n sessionId?: string;\n conversationId?: string;\n participantId?: string;\n}\n\n// `send` accepts the input before any agent runs: the prompt follows, retried\n// by the platform, and the reply arrives through the channel's events.\nexport interface ChannelInputReceiptIface {\n inputId: string;\n sessionId: string;\n}\n\nexport const channelInputReceiptSchema = z.object({\n inputId: z.string().min(1),\n sessionId: z.string().min(1),\n});\n\n// Where a handoff went: a Final room's input, or another channel's own receive\n// (which names a session or nothing).\nexport interface ChannelHandoffReceiptIface {\n inputId: string | null;\n sessionId: string | null;\n}\n\nexport const channelHandoffReceiptSchema = z.object({\n inputId: z.string().min(1).nullable(),\n sessionId: z.string().min(1).nullable(),\n});\n\nexport interface ChannelSessionSnapshotIface {\n sessionId: string;\n conversationId: string | null;\n}\n\nexport interface ChannelCancelInputIface {\n reason?: string;\n throughMessageSeq?: number;\n}\n\nexport interface ChannelSessionOperationsIface {\n inspect(target: ChannelSessionTargetIface): Promise<ChannelSessionSnapshotIface | null>;\n resolve(target: ChannelSessionTargetIface): Promise<string | null>;\n send(\n target: ChannelSessionTargetIface,\n input: ChannelSendInputIface,\n ): Promise<ChannelInputReceiptIface>;\n respond(\n target: ChannelSessionTargetIface,\n input: ChannelResponseInputIface,\n ): Promise<{ resolved: boolean }>;\n cancel(\n target: ChannelSessionTargetIface,\n input?: ChannelCancelInputIface,\n ): Promise<{ accepted: boolean }>;\n close(target: ChannelSessionTargetIface): Promise<void>;\n observe(\n target: ChannelSessionTargetIface,\n input: { content: ContentBlock[]; idempotencyKey: string },\n ): Promise<void>;\n setConfigOption(\n target: ChannelSessionTargetIface,\n input: { configId: string; value: JsonValue },\n ): Promise<void>;\n park(target: ChannelSessionTargetIface): Promise<void>;\n getState(target: ChannelSessionTargetIface): Promise<JsonObject>;\n setState(target: ChannelSessionTargetIface, state: JsonObject): Promise<void>;\n // Input for another of the agent's channels: `final` targets `{ conversationId, participantId? }`.\n handoff(\n channel: string,\n target: JsonValue,\n input: ChannelSendInputIface,\n ): Promise<ChannelHandoffReceiptIface>;\n}\n\nexport interface ChannelSessionHandleIface {\n inspect(): Promise<ChannelSessionSnapshotIface | null>;\n resolveSession(): Promise<string | null>;\n send(input: ChannelSendInputIface): ReturnType<ChannelSessionOperationsIface['send']>;\n respond(input: ChannelResponseInputIface): ReturnType<ChannelSessionOperationsIface['respond']>;\n cancel(input?: ChannelCancelInputIface): ReturnType<ChannelSessionOperationsIface['cancel']>;\n close(): Promise<void>;\n observe(input: { content: ContentBlock[]; idempotencyKey: string }): Promise<void>;\n setConfigOption(input: { configId: string; value: JsonValue }): Promise<void>;\n park(): Promise<void>;\n getState(): Promise<JsonObject>;\n setState(state: JsonObject): Promise<void>;\n}\n\nexport interface ChannelAddressContextIface {\n from(address: string): ChannelSessionHandleIface;\n resolveSession(address: string): Promise<string | null>;\n attachSession(id: string): ChannelSessionHandleIface;\n to(\n channel: string,\n target: JsonValue,\n ): { send(input: ChannelSendInputIface): Promise<ChannelHandoffReceiptIface> };\n}\n\n// Handles resolve at operation time. Only attachSession captures a session ID.\nexport const channelAccessors = (\n platform: Pick<ChannelPlatformIface, 'channelSessions'>,\n): ChannelAddressContextIface => {\n const operations = () => {\n if (platform.channelSessions == null)\n throw new Error('channel session operations are unavailable');\n return platform.channelSessions;\n };\n const handle = (target: ChannelSessionTargetIface): ChannelSessionHandleIface => ({\n inspect: () => operations().inspect(target),\n resolveSession: () => operations().resolve(target),\n send: (input) => operations().send(target, input),\n respond: (input) => operations().respond(target, input),\n cancel: (input) => operations().cancel(target, input),\n close: () => operations().close(target),\n observe: (input) => operations().observe(target, input),\n setConfigOption: (input) => operations().setConfigOption(target, input),\n park: () => operations().park(target),\n getState: () => operations().getState(target),\n setState: (state) => operations().setState(target, state),\n });\n return {\n from: (address) => handle({ address }),\n resolveSession: (address) => operations().resolve({ address }),\n attachSession: (sessionId) => handle({ sessionId }),\n to: (channel, target) => ({ send: (input) => operations().handoff(channel, target, input) }),\n };\n};\n"],
5
5
  "mappings": "AACA,YAAY,OAAO;AACnB,eAAkF;AAGlF,SAAS,sBAAsB,yBAAgD;AA8CxE,MAAM,4BAA4B,EAAE,OAAO;AAAA,EAChD,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACzB,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC;AAC7B,CAAC;AASM,MAAM,8BAA8B,EAAE,OAAO;AAAA,EAClD,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACpC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AACxC,CAAC;AAwEM,MAAM,mBAAmB,CAC9B,aAC+B;AAC/B,QAAM,aAAa,MAAM;AACvB,QAAI,SAAS,mBAAmB;AAC9B,YAAM,IAAI,MAAM,4CAA4C;AAC9D,WAAO,SAAS;AAAA,EAClB;AACA,QAAM,SAAS,CAAC,YAAkE;AAAA,IAChF,SAAS,MAAM,WAAW,EAAE,QAAQ,MAAM;AAAA,IAC1C,gBAAgB,MAAM,WAAW,EAAE,QAAQ,MAAM;AAAA,IACjD,MAAM,CAAC,UAAU,WAAW,EAAE,KAAK,QAAQ,KAAK;AAAA,IAChD,SAAS,CAAC,UAAU,WAAW,EAAE,QAAQ,QAAQ,KAAK;AAAA,IACtD,QAAQ,CAAC,UAAU,WAAW,EAAE,OAAO,QAAQ,KAAK;AAAA,IACpD,OAAO,MAAM,WAAW,EAAE,MAAM,MAAM;AAAA,IACtC,SAAS,CAAC,UAAU,WAAW,EAAE,QAAQ,QAAQ,KAAK;AAAA,IACtD,iBAAiB,CAAC,UAAU,WAAW,EAAE,gBAAgB,QAAQ,KAAK;AAAA,IACtE,MAAM,MAAM,WAAW,EAAE,KAAK,MAAM;AAAA,IACpC,UAAU,MAAM,WAAW,EAAE,SAAS,MAAM;AAAA,IAC5C,UAAU,CAAC,UAAU,WAAW,EAAE,SAAS,QAAQ,KAAK;AAAA,EAC1D;AACA,SAAO;AAAA,IACL,MAAM,CAAC,YAAY,OAAO,EAAE,QAAQ,CAAC;AAAA,IACrC,gBAAgB,CAAC,YAAY,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC;AAAA,IAC7D,eAAe,CAAC,cAAc,OAAO,EAAE,UAAU,CAAC;AAAA,IAClD,IAAI,CAAC,SAAS,YAAY,EAAE,MAAM,CAAC,UAAU,WAAW,EAAE,QAAQ,SAAS,QAAQ,KAAK,EAAE;AAAA,EAC5F;AACF;",
6
6
  "names": []
7
7
  }
@@ -144,7 +144,7 @@ export interface CardArgsIface {
144
144
  conversationId: string;
145
145
  authorParticipantId: string;
146
146
  kind: CardKind;
147
- pendingRequestId: string | null;
147
+ decisionId: string | null;
148
148
  state: JsonObject;
149
149
  entityLinks: {
150
150
  kind: string;
@@ -262,7 +262,7 @@ export interface ChannelInputResponseIface {
262
262
  };
263
263
  auth?: ChannelAuthIface | null;
264
264
  participantId: string;
265
- pendingId: string;
265
+ decisionId: string;
266
266
  outcome: JsonValue;
267
267
  actorParticipantId: string;
268
268
  userId: string | null;
@@ -339,32 +339,32 @@ export interface ProjectionContextIface<State = JsonValue> {
339
339
  seq: number;
340
340
  state: ChannelTurnStateIface<State>;
341
341
  }
342
- export declare enum PendingEventKind {
343
- Created = "pending.created",
344
- Resolved = "pending.resolved"
342
+ export declare enum DecisionEventKind {
343
+ Created = "decision.created",
344
+ Resolved = "decision.resolved"
345
345
  }
346
346
  export type AcpUpdateKind = SessionUpdate['sessionUpdate'];
347
347
  export type KnownAcpUpdateKind = `${SessionUpdateKind}`;
348
- export type ChannelEventKind = AcpUpdateKind | `${PendingEventKind}` | `${SemanticChannelEventKind}`;
348
+ export type ChannelEventKind = AcpUpdateKind | `${DecisionEventKind}` | `${SemanticChannelEventKind}`;
349
349
  export interface ChannelEventIface {
350
350
  type: string;
351
351
  data: JsonValue;
352
352
  seq: number;
353
353
  }
354
354
  export type ChannelEventHandler<State = JsonValue> = (event: ChannelEventIface, ctx: ProjectionContextIface<State>) => Promise<void>;
355
- export declare enum PendingKind {
355
+ export declare enum DecisionKind {
356
356
  Permission = "permission",
357
357
  Elicitation = "elicitation"
358
358
  }
359
- export declare const pendingCreatedDataSchema: z.ZodObject<{
360
- pendingRequestId: z.ZodString;
361
- kind: z.ZodEnum<typeof PendingKind>;
359
+ export declare const decisionCreatedDataSchema: z.ZodObject<{
360
+ decisionId: z.ZodString;
361
+ kind: z.ZodEnum<typeof DecisionKind>;
362
362
  audienceParticipantIds: z.ZodArray<z.ZodString>;
363
363
  request: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
364
364
  }, z.core.$strip>;
365
- export type PendingCreatedDataIface = z.infer<typeof pendingCreatedDataSchema>;
366
- export declare const pendingResolvedDataSchema: z.ZodObject<{
367
- pendingRequestId: z.ZodString;
365
+ export type DecisionCreatedDataIface = z.infer<typeof decisionCreatedDataSchema>;
366
+ export declare const decisionResolvedDataSchema: z.ZodObject<{
367
+ decisionId: z.ZodString;
368
368
  outcome: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
369
369
  respondedBy: z.ZodDefault<z.ZodNullable<z.ZodObject<{
370
370
  principalId: z.ZodString;
@@ -374,7 +374,7 @@ export declare const pendingResolvedDataSchema: z.ZodObject<{
374
374
  attributes: z.ZodDefault<z.ZodType<JsonObject, unknown, z.core.$ZodTypeInternals<JsonObject, unknown>>>;
375
375
  }, z.core.$strip>>>;
376
376
  }, z.core.$strip>;
377
- export type PendingResolvedDataIface = z.infer<typeof pendingResolvedDataSchema>;
377
+ export type DecisionResolvedDataIface = z.infer<typeof decisionResolvedDataSchema>;
378
378
  export declare const PROJECTED_UPDATE_KINDS: ReadonlySet<AcpUpdateKind>;
379
379
  export declare const turnEndOf: (update: SessionUpdate) => {
380
380
  stopReason: string | null;
@@ -70,24 +70,24 @@ const channelMessageInputSchema = z.object({
70
70
  quotedMessageIds: z.array(z.string().min(1)).default([]),
71
71
  mentionedParticipantIds: z.array(z.string().min(1)).default([])
72
72
  });
73
- var PendingEventKind = /* @__PURE__ */ ((PendingEventKind2) => {
74
- PendingEventKind2["Created"] = "pending.created";
75
- PendingEventKind2["Resolved"] = "pending.resolved";
76
- return PendingEventKind2;
77
- })(PendingEventKind || {});
78
- var PendingKind = /* @__PURE__ */ ((PendingKind2) => {
79
- PendingKind2["Permission"] = "permission";
80
- PendingKind2["Elicitation"] = "elicitation";
81
- return PendingKind2;
82
- })(PendingKind || {});
83
- const pendingCreatedDataSchema = z.object({
84
- pendingRequestId: z.string().min(1),
85
- kind: z.nativeEnum(PendingKind),
73
+ var DecisionEventKind = /* @__PURE__ */ ((DecisionEventKind2) => {
74
+ DecisionEventKind2["Created"] = "decision.created";
75
+ DecisionEventKind2["Resolved"] = "decision.resolved";
76
+ return DecisionEventKind2;
77
+ })(DecisionEventKind || {});
78
+ var DecisionKind = /* @__PURE__ */ ((DecisionKind2) => {
79
+ DecisionKind2["Permission"] = "permission";
80
+ DecisionKind2["Elicitation"] = "elicitation";
81
+ return DecisionKind2;
82
+ })(DecisionKind || {});
83
+ const decisionCreatedDataSchema = z.object({
84
+ decisionId: z.string().min(1),
85
+ kind: z.nativeEnum(DecisionKind),
86
86
  audienceParticipantIds: z.array(z.string()),
87
87
  request: jsonValueSchema
88
88
  });
89
- const pendingResolvedDataSchema = z.object({
90
- pendingRequestId: z.string().min(1),
89
+ const decisionResolvedDataSchema = z.object({
90
+ decisionId: z.string().min(1),
91
91
  outcome: jsonValueSchema,
92
92
  respondedBy: channelAuthSchema.nullable().default(null)
93
93
  });
@@ -135,20 +135,20 @@ export {
135
135
  CardKind,
136
136
  ChannelPrincipalType,
137
137
  ConversationKind,
138
+ DecisionEventKind,
139
+ DecisionKind,
138
140
  Delivery,
139
141
  MessageKind,
140
142
  PROJECTED_UPDATE_KINDS,
141
143
  ParticipantKind,
142
- PendingEventKind,
143
- PendingKind,
144
144
  RoutingMode,
145
145
  TurnPolicy,
146
146
  channelAuthSchema,
147
147
  channelMessageInputSchema,
148
148
  channelReceiveResultSchema,
149
+ decisionCreatedDataSchema,
150
+ decisionResolvedDataSchema,
149
151
  defineChannel,
150
- pendingCreatedDataSchema,
151
- pendingResolvedDataSchema,
152
152
  principalDisplayName,
153
153
  turnEndOf,
154
154
  turnEndUpdate
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/channel.ts"],
4
- "sourcesContent": ["import type { HostedBindingsIface } from \"./hosted-bindings.mjs\";\nimport type { ContentBlock, SessionUpdate } from '@agentclientprotocol/sdk/experimental/v2';\nimport type { SessionUpdateKind } from '@finalai/acp-session';\nimport * as z from 'zod';\nimport type { ChannelSessionOperationsIface } from \"./channel-context.mjs\";\nimport { jsonObjectSchema, jsonValueSchema, type JsonObject, type JsonValue } from \"./json.mjs\";\nimport type { ProviderRef } from \"./provider-ref.mjs\";\nimport type { SemanticChannelEventKind } from \"./semantic-events.mjs\";\n\n// Channels. Messaging has no orchestrator: a channel\n// receives input, inserts it into the conversation, routes it to agent\n// participants as ACP prompt or observe, and projects ACP updates back into\n// visible messages and cards. The built-in messaging channels implement this\n// contract with no private hooks into the session service; the session\n// service hands every channel the same ChannelPlatformIface.\n//\n// Members of a conversation are people and agents. Everything else an agent\n// hears (a schedule, a webhook, a Goal, another agent or channel) is channel\n// input from a principal (`ChannelAuthIface`), sent with\n// `channelSessions.send`; it is never a message.\n\nexport enum ChannelPrincipalType {\n User = 'user',\n Service = 'service',\n}\n\n// Who a channel authenticated for an input or a response. Channels vouch for\n// their principals; one principal per authenticator (`slack:<user>`), so\n// the same person on two surfaces is two principals.\nexport interface ChannelAuthIface extends JsonObject {\n principalId: string;\n principalType: ChannelPrincipalType | `${ChannelPrincipalType}`;\n authenticator: string;\n // `displayName` (a string) when the channel names the principal; see principalDisplayName.\n attributes: JsonObject;\n}\n\nexport const channelAuthSchema = z.object({\n principalId: z.string().min(1),\n principalType: z.nativeEnum(ChannelPrincipalType),\n authenticator: z.string().min(1),\n // How the agent and the people reading its reply name the principal.\n displayName: z.string().min(1).max(200).optional(),\n attributes: jsonObjectSchema.default({}),\n});\n\n// How a principal is named to the agent and in captions: its `displayName`, else its id.\nexport const principalDisplayName = (auth: ChannelAuthIface): string => {\n const name = auth['displayName'];\n return typeof name === 'string' && name.length > 0 ? name : auth.principalId;\n};\n\nexport enum ConversationKind {\n Direct = 'direct',\n Group = 'group',\n}\n\nexport enum ParticipantKind {\n User = 'user',\n Agent = 'agent',\n}\n\nexport enum RoutingMode {\n Mention = 'mention',\n All = 'all',\n Default = 'default',\n}\n\nexport enum TurnPolicy {\n Steer = 'steer',\n Queue = 'queue',\n}\n\nexport enum Delivery {\n Prompt = 'prompt',\n Observe = 'observe',\n}\n\nexport enum MessageKind {\n Message = 'message',\n Card = 'card',\n}\n\nexport enum CardKind {\n Elicitation = 'elicitation',\n Permission = 'permission',\n Notice = 'notice',\n}\n\nexport interface ParticipantIface {\n id: string;\n kind: ParticipantKind;\n displayName: string;\n userId: string | null;\n definitionId: string | null;\n routingMode: RoutingMode | null;\n sessionId: string | null;\n // Whether the agent's harness supports _final/session/observe and renders\n // _meta[\"final.ai\"].author; null for non-agents.\n supportsObserve: boolean | null;\n rendersAuthorMeta: boolean | null;\n left: boolean;\n}\n\nexport const channelReceiveResultSchema = z.union([\n z.object({ conversationId: z.string().min(1) }),\n z.object({ sessionId: z.string().min(1) }),\n z.null(),\n]);\nexport type ChannelReceiveResult = z.infer<typeof channelReceiveResultSchema>;\n\nexport interface ConversationRefIface {\n conversationId: string;\n}\n\nexport interface ConversationIface extends ConversationRefIface {\n organizationId: string;\n kind: ConversationKind;\n title: string | null;\n isHome: boolean;\n turnPolicy: TurnPolicy;\n}\n\nexport interface MessageRefIface {\n messageId: string;\n seq: number;\n}\n\nexport interface ConversationMessageIface extends MessageRefIface {\n conversationId: string;\n authorParticipantId: string;\n kind: MessageKind;\n body: string;\n content: ContentBlock[];\n replyToMessageId: string | null;\n threadRootId: string | null;\n // Earlier messages of the conversation the author quoted, in order.\n quotedMessageIds: string[];\n // Agent participant ids explicitly mentioned in the message.\n mentionedParticipantIds: string[];\n // Number of agent-authored hops that led to this message (0 for humans).\n hopDepth: number;\n // The originating agent for a tool-posted message, including linked conversations.\n agentAuthorDefinitionId?: string | null;\n createdAt: string;\n}\n\nexport interface RouteArgsIface {\n conversation: ConversationIface;\n message: ConversationMessageIface;\n participants: ParticipantIface[];\n agentParticipantId?: string;\n}\n\nexport interface RouteDecisionIface {\n participantId: string;\n delivery: Delivery;\n}\n\nexport interface PostMessageArgsIface {\n conversationId: string;\n authorParticipantId: string;\n kind?: MessageKind;\n content: ContentBlock[];\n replyToMessageId?: string | null;\n threadRootId?: string | null;\n quotedMessageIds?: string[];\n clientMessageId?: string | null;\n mentionedParticipantIds?: string[];\n attachmentIds?: string[];\n hopDepth?: number;\n // A tool or linked-conversation event carries the turn that produced it.\n originTurnId?: string | null;\n // Projection provenance for agent replies.\n source?: { turnId: string; fromSeq: number; toSeq: number } | null;\n}\n\nexport const channelMessageInputSchema = z.object({\n conversationId: z.string().min(1),\n authorParticipantId: z.string().min(1),\n kind: z.nativeEnum(MessageKind).default(MessageKind.Message),\n content: z.array(jsonObjectSchema).min(1),\n clientMessageId: z.string().min(1).nullish(),\n replyToMessageId: z.string().min(1).nullish(),\n threadRootId: z.string().min(1).nullish(),\n quotedMessageIds: z.array(z.string().min(1)).default([]),\n mentionedParticipantIds: z.array(z.string().min(1)).default([]),\n});\n\nexport interface CardArgsIface {\n conversationId: string;\n authorParticipantId: string;\n kind: CardKind;\n pendingRequestId: string | null;\n // Generic cards only: a title, body, options, and entity links (a Goal is an\n // entity link, not a card kind).\n state: JsonObject;\n entityLinks: {\n kind: string;\n id: string;\n title?: string;\n url?: string;\n description?: string;\n imageUrl?: string;\n }[];\n}\n\nexport interface PromptArgsIface {\n waitForAcceptance?: boolean;\n channelBinding?: { id: string; revisionId: string };\n auth?: ChannelAuthIface | null;\n title?: string;\n participantId: string;\n content: ContentBlock[];\n turnPolicy: TurnPolicy;\n replyExpected: boolean;\n idempotencyKey: string;\n // Who prompted (for payer resolution and pending-request audience).\n authorParticipantId: string;\n // The person a prompt from no person acts for (payer and audience).\n actingUserId?: string | null;\n audienceParticipantIds: string[];\n sourceMessageId: string;\n}\n\nexport interface ObserveArgsIface {\n participantId: string;\n content: ContentBlock[];\n idempotencyKey: string;\n}\n\n// What the session service lets a channel do. Implemented once, handed to\n// built-in and custom channels alike.\nexport interface ChannelPlatformIface {\n channelSessions?: ChannelSessionOperationsIface;\n conversations: {\n get(conversationId: string): Promise<ConversationIface | null>;\n createAttachmentUpload?(args: {\n conversationId: string;\n name: string;\n contentType: string;\n sizeBytes: number;\n }): Promise<{\n attachmentId: string;\n uploadUrl: string;\n method: string;\n headers: Record<string, string>;\n expiresAt: string;\n }>;\n getAttachmentUrl?(args: {\n conversationId: string;\n attachmentId: string;\n }): Promise<{ attachmentId: string; url: string; expiresAt: string }>;\n // Dispatch a stored reply to each recipient's binding; each channel owns routing.\n dispatchMessage?(args: {\n conversationId: string;\n messageId: string;\n participantId?: string;\n requestedDelivery?: Delivery;\n }): Promise<void>;\n findOrCreateDirect(args: {\n organizationId: string;\n userId: string;\n definitionId: string;\n }): Promise<ConversationIface>;\n // The conversation a channel binding is attached to.\n boundTo(bindingId: string): Promise<ConversationIface | null>;\n participants(conversationId: string): Promise<ParticipantIface[]>;\n postMessage(args: PostMessageArgsIface): Promise<ConversationMessageIface>;\n updateMessage(args: {\n messageId: string;\n content: ContentBlock[];\n final: boolean;\n }): Promise<void>;\n postCard(args: CardArgsIface): Promise<ConversationMessageIface>;\n updateCard(args: { messageId: string; state: JsonObject }): Promise<void>;\n recentMessages(args: {\n conversationId: string;\n limit: number;\n beforeSeq?: number;\n afterSeq?: number;\n }): Promise<ConversationMessageIface[]>;\n // Messages of the conversation by id, however old (reply, thread and quote\n // context outside the recent window); unknown and deleted ones are absent.\n getMessages(args: {\n conversationId: string;\n messageIds: string[];\n }): Promise<ConversationMessageIface[]>;\n };\n sessions: {\n prompt(\n args: PromptArgsIface,\n ): Promise<{ messageId: string; sessionId?: string; turnId?: string }>;\n observe(args: ObserveArgsIface): Promise<void>;\n cancel(args: {\n participantId: string;\n reason?: string;\n throughMessageSeq?: number;\n }): Promise<void>;\n respond?(args: ChannelInputResponseIface): Promise<{ resolved: boolean }>;\n };\n log(message: string, details?: Record<string, JsonValue>): void;\n}\n\nexport interface ChannelInputResponseIface {\n channelBinding?: { id: string; revisionId: string };\n auth?: ChannelAuthIface | null;\n participantId: string;\n pendingId: string;\n outcome: JsonValue;\n actorParticipantId: string;\n userId: string | null;\n}\n\nexport interface ChannelReceiveContextIface {\n bindings?: HostedBindingsIface;\n platform: ChannelPlatformIface;\n organizationId: string;\n definitionId: string | null;\n bindingId: string | null;\n config: JsonObject;\n secrets: { get(name: string): Promise<string | null> };\n // A stored, authenticated delivery to one agent in a shared conversation.\n agentParticipantId?: string;\n message?: ConversationMessageIface;\n conversation?: ConversationIface;\n participants?: readonly ParticipantIface[];\n response?: ChannelInputResponseIface;\n conversationId?: string;\n cancelReason?: string;\n // Preserve this boundary when forwarding a retryable conversation Stop.\n cancelThroughMessageSeq?: number;\n requestedDelivery?: Delivery;\n}\n\n// An HTTP route a channel serves (webhooks), mounted by the front door at\n// /api/events/webhooks/:bindingId<path> and the per-agent aliases.\nexport interface ChannelRouteContextIface {\n bindings?: HostedBindingsIface;\n request: Request;\n secrets: { get(name: string): Promise<string | null> };\n receive: (input: JsonValue) => Promise<ChannelReceiveResult>;\n}\n\nexport interface ChannelSocketIface {\n readonly signal: AbortSignal;\n readonly messages: AsyncIterable<string | Uint8Array>;\n // Authenticate the request before accepting. The selected protocol must have been offered.\n accept(options?: { protocol?: string }): void;\n send(data: string | Uint8Array): void;\n close(code?: number, reason?: string): void;\n}\n\nexport interface HttpChannelRouteDefinitionIface {\n method: 'GET' | 'POST' | 'PUT' | 'DELETE';\n path: string;\n handler: (args: ChannelRouteContextIface) => Promise<Response>;\n}\n\nexport interface WebSocketChannelRouteDefinitionIface {\n method: 'WS';\n path: string;\n // Returning an HTTP response before accept rejects the handshake. The handler lives until close.\n handler: (\n args: ChannelRouteContextIface & { socket: ChannelSocketIface },\n ) => Promise<Response | void>;\n}\n\nexport type RouteDefinitionIface =\n | HttpChannelRouteDefinitionIface\n | WebSocketChannelRouteDefinitionIface;\n\n// The per-turn value a channel keeps between its project and event calls of\n// one turn (the definition's `State`). The platform holds it, so a channel\n// running in a Worker isolate keeps nothing in memory; it starts null each turn\n// and is discarded when the turn's projection finishes.\nexport interface ChannelTurnStateIface<State> {\n get(): State | null;\n set(state: State | null): void;\n}\n\nexport interface ProjectionContextIface<State = JsonValue> {\n bindings?: HostedBindingsIface;\n sessionId?: string;\n platform: ChannelPlatformIface;\n // The binding's config and the agent's secrets (manifest.secrets), as receive gets them:\n // a channel posts its replies back to its own service with them.\n config: JsonObject;\n secrets: { get(name: string): Promise<string | null> };\n conversation: ConversationIface | null;\n agentParticipant: ParticipantIface | null;\n turn: { id: string; promptMessageId: string | null; authorParticipantId: string | null };\n seq: number;\n state: ChannelTurnStateIface<State>;\n}\n\nexport enum PendingEventKind {\n Created = 'pending.created',\n Resolved = 'pending.resolved',\n}\n\nexport type AcpUpdateKind = SessionUpdate['sessionUpdate'];\n// The update kinds ACP v2 names; AcpUpdateKind also admits any other string.\nexport type KnownAcpUpdateKind = `${SessionUpdateKind}`;\n\nexport type ChannelEventKind =\n | AcpUpdateKind\n | `${PendingEventKind}`\n | `${SemanticChannelEventKind}`;\n\nexport interface ChannelEventIface {\n type: string;\n data: JsonValue;\n seq: number;\n}\n\nexport type ChannelEventHandler<State = JsonValue> = (\n event: ChannelEventIface,\n ctx: ProjectionContextIface<State>,\n) => Promise<void>;\n\nexport enum PendingKind {\n Permission = 'permission',\n Elicitation = 'elicitation',\n}\n\n// `data` of a pending.created event: an ACP session/request_permission or\n// elicitation/create request awaiting its audience.\nexport const pendingCreatedDataSchema = z.object({\n pendingRequestId: z.string().min(1),\n kind: z.nativeEnum(PendingKind),\n audienceParticipantIds: z.array(z.string()),\n request: jsonValueSchema,\n});\n\nexport type PendingCreatedDataIface = z.infer<typeof pendingCreatedDataSchema>;\n\n// `data` of a pending.resolved event: the answer (or cancellation) as recorded,\n// and the principal a channel answered as (null for Final rooms and expiries).\nexport const pendingResolvedDataSchema = z.object({\n pendingRequestId: z.string().min(1),\n outcome: jsonValueSchema,\n respondedBy: channelAuthSchema.nullable().default(null),\n});\n\nexport type PendingResolvedDataIface = z.infer<typeof pendingResolvedDataSchema>;\n\n// The visible-output updates `project` receives. After them, the\n// turn's projection ends with one ACP v2 idle `state_update` (turnEndUpdate).\n// Thought, tool, plan and every other update, other state updates included,\n// reach a channel only through an `events` handler for its kind.\nexport const PROJECTED_UPDATE_KINDS: ReadonlySet<AcpUpdateKind> = new Set<AcpUpdateKind>([\n 'agent_message_chunk',\n 'agent_message',\n]);\n\nconst turnEndSchema = z.looseObject({\n sessionUpdate: z.literal('state_update'),\n state: z.literal('idle'),\n stopReason: z.string().nullish(),\n _meta: z\n .looseObject({ 'final.ai': z.looseObject({ stopReason: z.string().nullish() }).nullish() })\n .nullish(),\n});\n\n// The stop reason when the update ends the turn (an idle state_update); null otherwise.\nexport const turnEndOf = (update: SessionUpdate): { stopReason: string | null } | null => {\n const parsed = turnEndSchema.safeParse(update);\n if (!parsed.success) return null;\n return {\n stopReason: parsed.data.stopReason ?? parsed.data._meta?.['final.ai']?.stopReason ?? null,\n };\n};\n\n// The idle state_update that ends a turn, as `project` receives it. A stop\n// reason outside ACP's known set rides in `_meta[\"final.ai\"]` (the SDK types\n// only received values as unknown variants).\nexport const turnEndUpdate = (stopReason: string | null): SessionUpdate => {\n switch (stopReason) {\n case null:\n return { sessionUpdate: 'state_update', state: 'idle' };\n case 'end_turn':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'end_turn' };\n case 'max_tokens':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'max_tokens' };\n case 'max_turn_requests':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'max_turn_requests' };\n case 'refusal':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'refusal' };\n case 'cancelled':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'cancelled' };\n default:\n return {\n sessionUpdate: 'state_update',\n state: 'idle',\n _meta: { 'final.ai': { stopReason } },\n };\n }\n};\n\n// Built-in and custom (bundle) channels implement exactly this; the\n// session service calls nothing else on a channel.\nexport interface ChannelDefinitionIface<Inbound, State = undefined> {\n config?: JsonObject;\n // Installed execution is an optimization for an uncustomized definition.\n installed?: ProviderRef;\n configure?: (config: JsonObject) => ChannelDefinitionIface<Inbound, State>;\n routes?: RouteDefinitionIface[];\n respond?(\n input: ChannelInputResponseIface,\n ctx: ChannelReceiveContextIface,\n ): Promise<{ resolved: boolean }>;\n cancel?(ctx: ChannelReceiveContextIface): Promise<{ accepted: boolean }>;\n // Inserts the input into its conversation and routes it. Returns where it went.\n receive(input: Inbound, ctx: ChannelReceiveContextIface): Promise<ChannelReceiveResult>;\n // Pure: who gets this message, and how. The channel applies it\n // to what it posts, from receive and project.\n route(args: RouteArgsIface): RouteDecisionIface[] | Promise<RouteDecisionIface[]>;\n turnPolicy: TurnPolicy;\n // ACP update \u2192 visible message / card. Called with a turn's\n // PROJECTED_UPDATE_KINDS updates in seq order, then its idle state_update.\n project(update: SessionUpdate, ctx: ProjectionContextIface<State>): Promise<void>;\n events?: Partial<Record<ChannelEventKind, ChannelEventHandler<State>>>;\n}\n\nexport const defineChannel = <Inbound, State = undefined>(\n definition: ChannelDefinitionIface<Inbound, State>,\n): ChannelDefinitionIface<Inbound, State> => definition;\n"],
5
- "mappings": "AAGA,YAAY,OAAO;AAEnB,SAAS,kBAAkB,uBAAwD;AAgB5E,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,UAAO;AACP,EAAAA,sBAAA,aAAU;AAFA,SAAAA;AAAA,GAAA;AAgBL,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC7B,eAAe,EAAE,WAAW,oBAAoB;AAAA,EAChD,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA;AAAA,EAE/B,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EACjD,YAAY,iBAAiB,QAAQ,CAAC,CAAC;AACzC,CAAC;AAGM,MAAM,uBAAuB,CAAC,SAAmC;AACtE,QAAM,OAAO,KAAK,aAAa;AAC/B,SAAO,OAAO,SAAS,YAAY,KAAK,SAAS,IAAI,OAAO,KAAK;AACnE;AAEO,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,YAAS;AACT,EAAAA,kBAAA,WAAQ;AAFE,SAAAA;AAAA,GAAA;AAKL,IAAK,kBAAL,kBAAKC,qBAAL;AACL,EAAAA,iBAAA,UAAO;AACP,EAAAA,iBAAA,WAAQ;AAFE,SAAAA;AAAA,GAAA;AA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AAc,UAAU,MAAM;AAC7C,MAAI,CAAC,OAAO,QAAS,QAAO;AAC5B,SAAO;AAAA,IACL,YAAY,OAAO,KAAK,cAAc,OAAO,KAAK,QAAQ,UAAU,GAAG,cAAc;AAAA,EACvF;AACF;AAKO,MAAM,gBAAgB,CAAC,eAA6C;AACzE,UAAQ,YAAY;AAAA,IAClB,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,OAAO;AAAA,IACxD,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,WAAW;AAAA,IAChF,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,aAAa;AAAA,IAClF,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,oBAAoB;AAAA,IACzF,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,UAAU;AAAA,IAC/E,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,YAAY;AAAA,IACjF;AACE,aAAO;AAAA,QACL,eAAe;AAAA,QACf,OAAO;AAAA,QACP,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE;AAAA,MACtC;AAAA,EACJ;AACF;AA2BO,MAAM,gBAAgB,CAC3B,eAC2C;",
6
- "names": ["ChannelPrincipalType", "ConversationKind", "ParticipantKind", "RoutingMode", "TurnPolicy", "Delivery", "MessageKind", "CardKind", "PendingEventKind", "PendingKind"]
4
+ "sourcesContent": ["import type { HostedBindingsIface } from \"./hosted-bindings.mjs\";\nimport type { ContentBlock, SessionUpdate } from '@agentclientprotocol/sdk/experimental/v2';\nimport type { SessionUpdateKind } from '@finalai/acp-session';\nimport * as z from 'zod';\nimport type { ChannelSessionOperationsIface } from \"./channel-context.mjs\";\nimport { jsonObjectSchema, jsonValueSchema, type JsonObject, type JsonValue } from \"./json.mjs\";\nimport type { ProviderRef } from \"./provider-ref.mjs\";\nimport type { SemanticChannelEventKind } from \"./semantic-events.mjs\";\n\n// Channels. Messaging has no orchestrator: a channel\n// receives input, inserts it into the conversation, routes it to agent\n// participants as ACP prompt or observe, and projects ACP updates back into\n// visible messages and cards. The built-in messaging channels implement this\n// contract with no private hooks into the session service; the session\n// service hands every channel the same ChannelPlatformIface.\n//\n// Members of a conversation are people and agents. Everything else an agent\n// hears (a schedule, a webhook, a Goal, another agent or channel) is channel\n// input from a principal (`ChannelAuthIface`), sent with\n// `channelSessions.send`; it is never a message.\n\nexport enum ChannelPrincipalType {\n User = 'user',\n Service = 'service',\n}\n\n// Who a channel authenticated for an input or a response. Channels vouch for\n// their principals; one principal per authenticator (`slack:<user>`), so\n// the same person on two surfaces is two principals.\nexport interface ChannelAuthIface extends JsonObject {\n principalId: string;\n principalType: ChannelPrincipalType | `${ChannelPrincipalType}`;\n authenticator: string;\n // `displayName` (a string) when the channel names the principal; see principalDisplayName.\n attributes: JsonObject;\n}\n\nexport const channelAuthSchema = z.object({\n principalId: z.string().min(1),\n principalType: z.nativeEnum(ChannelPrincipalType),\n authenticator: z.string().min(1),\n // How the agent and the people reading its reply name the principal.\n displayName: z.string().min(1).max(200).optional(),\n attributes: jsonObjectSchema.default({}),\n});\n\n// How a principal is named to the agent and in captions: its `displayName`, else its id.\nexport const principalDisplayName = (auth: ChannelAuthIface): string => {\n const name = auth['displayName'];\n return typeof name === 'string' && name.length > 0 ? name : auth.principalId;\n};\n\nexport enum ConversationKind {\n Direct = 'direct',\n Group = 'group',\n}\n\nexport enum ParticipantKind {\n User = 'user',\n Agent = 'agent',\n}\n\nexport enum RoutingMode {\n Mention = 'mention',\n All = 'all',\n Default = 'default',\n}\n\nexport enum TurnPolicy {\n Steer = 'steer',\n Queue = 'queue',\n}\n\nexport enum Delivery {\n Prompt = 'prompt',\n Observe = 'observe',\n}\n\nexport enum MessageKind {\n Message = 'message',\n Card = 'card',\n}\n\nexport enum CardKind {\n Elicitation = 'elicitation',\n Permission = 'permission',\n Notice = 'notice',\n}\n\nexport interface ParticipantIface {\n id: string;\n kind: ParticipantKind;\n displayName: string;\n userId: string | null;\n definitionId: string | null;\n routingMode: RoutingMode | null;\n sessionId: string | null;\n // Whether the agent's harness supports _final/session/observe and renders\n // _meta[\"final.ai\"].author; null for non-agents.\n supportsObserve: boolean | null;\n rendersAuthorMeta: boolean | null;\n left: boolean;\n}\n\nexport const channelReceiveResultSchema = z.union([\n z.object({ conversationId: z.string().min(1) }),\n z.object({ sessionId: z.string().min(1) }),\n z.null(),\n]);\nexport type ChannelReceiveResult = z.infer<typeof channelReceiveResultSchema>;\n\nexport interface ConversationRefIface {\n conversationId: string;\n}\n\nexport interface ConversationIface extends ConversationRefIface {\n organizationId: string;\n kind: ConversationKind;\n title: string | null;\n isHome: boolean;\n turnPolicy: TurnPolicy;\n}\n\nexport interface MessageRefIface {\n messageId: string;\n seq: number;\n}\n\nexport interface ConversationMessageIface extends MessageRefIface {\n conversationId: string;\n authorParticipantId: string;\n kind: MessageKind;\n body: string;\n content: ContentBlock[];\n replyToMessageId: string | null;\n threadRootId: string | null;\n // Earlier messages of the conversation the author quoted, in order.\n quotedMessageIds: string[];\n // Agent participant ids explicitly mentioned in the message.\n mentionedParticipantIds: string[];\n // Number of agent-authored hops that led to this message (0 for humans).\n hopDepth: number;\n // The originating agent for a tool-posted message, including linked conversations.\n agentAuthorDefinitionId?: string | null;\n createdAt: string;\n}\n\nexport interface RouteArgsIface {\n conversation: ConversationIface;\n message: ConversationMessageIface;\n participants: ParticipantIface[];\n agentParticipantId?: string;\n}\n\nexport interface RouteDecisionIface {\n participantId: string;\n delivery: Delivery;\n}\n\nexport interface PostMessageArgsIface {\n conversationId: string;\n authorParticipantId: string;\n kind?: MessageKind;\n content: ContentBlock[];\n replyToMessageId?: string | null;\n threadRootId?: string | null;\n quotedMessageIds?: string[];\n clientMessageId?: string | null;\n mentionedParticipantIds?: string[];\n attachmentIds?: string[];\n hopDepth?: number;\n // A tool or linked-conversation event carries the turn that produced it.\n originTurnId?: string | null;\n // Projection provenance for agent replies.\n source?: { turnId: string; fromSeq: number; toSeq: number } | null;\n}\n\nexport const channelMessageInputSchema = z.object({\n conversationId: z.string().min(1),\n authorParticipantId: z.string().min(1),\n kind: z.nativeEnum(MessageKind).default(MessageKind.Message),\n content: z.array(jsonObjectSchema).min(1),\n clientMessageId: z.string().min(1).nullish(),\n replyToMessageId: z.string().min(1).nullish(),\n threadRootId: z.string().min(1).nullish(),\n quotedMessageIds: z.array(z.string().min(1)).default([]),\n mentionedParticipantIds: z.array(z.string().min(1)).default([]),\n});\n\nexport interface CardArgsIface {\n conversationId: string;\n authorParticipantId: string;\n kind: CardKind;\n decisionId: string | null;\n // Generic cards only: a title, body, options, and entity links (a Goal is an\n // entity link, not a card kind).\n state: JsonObject;\n entityLinks: {\n kind: string;\n id: string;\n title?: string;\n url?: string;\n description?: string;\n imageUrl?: string;\n }[];\n}\n\nexport interface PromptArgsIface {\n waitForAcceptance?: boolean;\n channelBinding?: { id: string; revisionId: string };\n auth?: ChannelAuthIface | null;\n title?: string;\n participantId: string;\n content: ContentBlock[];\n turnPolicy: TurnPolicy;\n replyExpected: boolean;\n idempotencyKey: string;\n // Who prompted (for payer resolution and decision audience).\n authorParticipantId: string;\n // The person a prompt from no person acts for (payer and audience).\n actingUserId?: string | null;\n audienceParticipantIds: string[];\n sourceMessageId: string;\n}\n\nexport interface ObserveArgsIface {\n participantId: string;\n content: ContentBlock[];\n idempotencyKey: string;\n}\n\n// What the session service lets a channel do. Implemented once, handed to\n// built-in and custom channels alike.\nexport interface ChannelPlatformIface {\n channelSessions?: ChannelSessionOperationsIface;\n conversations: {\n get(conversationId: string): Promise<ConversationIface | null>;\n createAttachmentUpload?(args: {\n conversationId: string;\n name: string;\n contentType: string;\n sizeBytes: number;\n }): Promise<{\n attachmentId: string;\n uploadUrl: string;\n method: string;\n headers: Record<string, string>;\n expiresAt: string;\n }>;\n getAttachmentUrl?(args: {\n conversationId: string;\n attachmentId: string;\n }): Promise<{ attachmentId: string; url: string; expiresAt: string }>;\n // Dispatch a stored reply to each recipient's binding; each channel owns routing.\n dispatchMessage?(args: {\n conversationId: string;\n messageId: string;\n participantId?: string;\n requestedDelivery?: Delivery;\n }): Promise<void>;\n findOrCreateDirect(args: {\n organizationId: string;\n userId: string;\n definitionId: string;\n }): Promise<ConversationIface>;\n // The conversation a channel binding is attached to.\n boundTo(bindingId: string): Promise<ConversationIface | null>;\n participants(conversationId: string): Promise<ParticipantIface[]>;\n postMessage(args: PostMessageArgsIface): Promise<ConversationMessageIface>;\n updateMessage(args: {\n messageId: string;\n content: ContentBlock[];\n final: boolean;\n }): Promise<void>;\n postCard(args: CardArgsIface): Promise<ConversationMessageIface>;\n updateCard(args: { messageId: string; state: JsonObject }): Promise<void>;\n recentMessages(args: {\n conversationId: string;\n limit: number;\n beforeSeq?: number;\n afterSeq?: number;\n }): Promise<ConversationMessageIface[]>;\n // Messages of the conversation by id, however old (reply, thread and quote\n // context outside the recent window); unknown and deleted ones are absent.\n getMessages(args: {\n conversationId: string;\n messageIds: string[];\n }): Promise<ConversationMessageIface[]>;\n };\n sessions: {\n prompt(\n args: PromptArgsIface,\n ): Promise<{ messageId: string; sessionId?: string; turnId?: string }>;\n observe(args: ObserveArgsIface): Promise<void>;\n cancel(args: {\n participantId: string;\n reason?: string;\n throughMessageSeq?: number;\n }): Promise<void>;\n respond?(args: ChannelInputResponseIface): Promise<{ resolved: boolean }>;\n };\n log(message: string, details?: Record<string, JsonValue>): void;\n}\n\nexport interface ChannelInputResponseIface {\n channelBinding?: { id: string; revisionId: string };\n auth?: ChannelAuthIface | null;\n participantId: string;\n decisionId: string;\n outcome: JsonValue;\n actorParticipantId: string;\n userId: string | null;\n}\n\nexport interface ChannelReceiveContextIface {\n bindings?: HostedBindingsIface;\n platform: ChannelPlatformIface;\n organizationId: string;\n definitionId: string | null;\n bindingId: string | null;\n config: JsonObject;\n secrets: { get(name: string): Promise<string | null> };\n // A stored, authenticated delivery to one agent in a shared conversation.\n agentParticipantId?: string;\n message?: ConversationMessageIface;\n conversation?: ConversationIface;\n participants?: readonly ParticipantIface[];\n response?: ChannelInputResponseIface;\n conversationId?: string;\n cancelReason?: string;\n // Preserve this boundary when forwarding a retryable conversation Stop.\n cancelThroughMessageSeq?: number;\n requestedDelivery?: Delivery;\n}\n\n// An HTTP route a channel serves (webhooks), mounted by the front door at\n// /api/events/webhooks/:bindingId<path> and the per-agent aliases.\nexport interface ChannelRouteContextIface {\n bindings?: HostedBindingsIface;\n request: Request;\n secrets: { get(name: string): Promise<string | null> };\n receive: (input: JsonValue) => Promise<ChannelReceiveResult>;\n}\n\nexport interface ChannelSocketIface {\n readonly signal: AbortSignal;\n readonly messages: AsyncIterable<string | Uint8Array>;\n // Authenticate the request before accepting. The selected protocol must have been offered.\n accept(options?: { protocol?: string }): void;\n send(data: string | Uint8Array): void;\n close(code?: number, reason?: string): void;\n}\n\nexport interface HttpChannelRouteDefinitionIface {\n method: 'GET' | 'POST' | 'PUT' | 'DELETE';\n path: string;\n handler: (args: ChannelRouteContextIface) => Promise<Response>;\n}\n\nexport interface WebSocketChannelRouteDefinitionIface {\n method: 'WS';\n path: string;\n // Returning an HTTP response before accept rejects the handshake. The handler lives until close.\n handler: (\n args: ChannelRouteContextIface & { socket: ChannelSocketIface },\n ) => Promise<Response | void>;\n}\n\nexport type RouteDefinitionIface =\n | HttpChannelRouteDefinitionIface\n | WebSocketChannelRouteDefinitionIface;\n\n// The per-turn value a channel keeps between its project and event calls of\n// one turn (the definition's `State`). The platform holds it, so a channel\n// running in a Worker isolate keeps nothing in memory; it starts null each turn\n// and is discarded when the turn's projection finishes.\nexport interface ChannelTurnStateIface<State> {\n get(): State | null;\n set(state: State | null): void;\n}\n\nexport interface ProjectionContextIface<State = JsonValue> {\n bindings?: HostedBindingsIface;\n sessionId?: string;\n platform: ChannelPlatformIface;\n // The binding's config and the agent's secrets (manifest.secrets), as receive gets them:\n // a channel posts its replies back to its own service with them.\n config: JsonObject;\n secrets: { get(name: string): Promise<string | null> };\n conversation: ConversationIface | null;\n agentParticipant: ParticipantIface | null;\n turn: { id: string; promptMessageId: string | null; authorParticipantId: string | null };\n seq: number;\n state: ChannelTurnStateIface<State>;\n}\n\nexport enum DecisionEventKind {\n Created = 'decision.created',\n Resolved = 'decision.resolved',\n}\n\nexport type AcpUpdateKind = SessionUpdate['sessionUpdate'];\n// The update kinds ACP v2 names; AcpUpdateKind also admits any other string.\nexport type KnownAcpUpdateKind = `${SessionUpdateKind}`;\n\nexport type ChannelEventKind =\n | AcpUpdateKind\n | `${DecisionEventKind}`\n | `${SemanticChannelEventKind}`;\n\nexport interface ChannelEventIface {\n type: string;\n data: JsonValue;\n seq: number;\n}\n\nexport type ChannelEventHandler<State = JsonValue> = (\n event: ChannelEventIface,\n ctx: ProjectionContextIface<State>,\n) => Promise<void>;\n\nexport enum DecisionKind {\n Permission = 'permission',\n Elicitation = 'elicitation',\n}\n\n// `data` of a decision.created event: an ACP session/request_permission or\n// elicitation/create request awaiting its audience.\nexport const decisionCreatedDataSchema = z.object({\n decisionId: z.string().min(1),\n kind: z.nativeEnum(DecisionKind),\n audienceParticipantIds: z.array(z.string()),\n request: jsonValueSchema,\n});\n\nexport type DecisionCreatedDataIface = z.infer<typeof decisionCreatedDataSchema>;\n\n// `data` of a decision.resolved event: the answer (or cancellation) as recorded,\n// and the principal a channel answered as (null for Final rooms and expiries).\nexport const decisionResolvedDataSchema = z.object({\n decisionId: z.string().min(1),\n outcome: jsonValueSchema,\n respondedBy: channelAuthSchema.nullable().default(null),\n});\n\nexport type DecisionResolvedDataIface = z.infer<typeof decisionResolvedDataSchema>;\n\n// The visible-output updates `project` receives. After them, the\n// turn's projection ends with one ACP v2 idle `state_update` (turnEndUpdate).\n// Thought, tool, plan and every other update, other state updates included,\n// reach a channel only through an `events` handler for its kind.\nexport const PROJECTED_UPDATE_KINDS: ReadonlySet<AcpUpdateKind> = new Set<AcpUpdateKind>([\n 'agent_message_chunk',\n 'agent_message',\n]);\n\nconst turnEndSchema = z.looseObject({\n sessionUpdate: z.literal('state_update'),\n state: z.literal('idle'),\n stopReason: z.string().nullish(),\n _meta: z\n .looseObject({ 'final.ai': z.looseObject({ stopReason: z.string().nullish() }).nullish() })\n .nullish(),\n});\n\n// The stop reason when the update ends the turn (an idle state_update); null otherwise.\nexport const turnEndOf = (update: SessionUpdate): { stopReason: string | null } | null => {\n const parsed = turnEndSchema.safeParse(update);\n if (!parsed.success) return null;\n return {\n stopReason: parsed.data.stopReason ?? parsed.data._meta?.['final.ai']?.stopReason ?? null,\n };\n};\n\n// The idle state_update that ends a turn, as `project` receives it. A stop\n// reason outside ACP's known set rides in `_meta[\"final.ai\"]` (the SDK types\n// only received values as unknown variants).\nexport const turnEndUpdate = (stopReason: string | null): SessionUpdate => {\n switch (stopReason) {\n case null:\n return { sessionUpdate: 'state_update', state: 'idle' };\n case 'end_turn':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'end_turn' };\n case 'max_tokens':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'max_tokens' };\n case 'max_turn_requests':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'max_turn_requests' };\n case 'refusal':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'refusal' };\n case 'cancelled':\n return { sessionUpdate: 'state_update', state: 'idle', stopReason: 'cancelled' };\n default:\n return {\n sessionUpdate: 'state_update',\n state: 'idle',\n _meta: { 'final.ai': { stopReason } },\n };\n }\n};\n\n// Built-in and custom (bundle) channels implement exactly this; the\n// session service calls nothing else on a channel.\nexport interface ChannelDefinitionIface<Inbound, State = undefined> {\n config?: JsonObject;\n // Installed execution is an optimization for an uncustomized definition.\n installed?: ProviderRef;\n configure?: (config: JsonObject) => ChannelDefinitionIface<Inbound, State>;\n routes?: RouteDefinitionIface[];\n respond?(\n input: ChannelInputResponseIface,\n ctx: ChannelReceiveContextIface,\n ): Promise<{ resolved: boolean }>;\n cancel?(ctx: ChannelReceiveContextIface): Promise<{ accepted: boolean }>;\n // Inserts the input into its conversation and routes it. Returns where it went.\n receive(input: Inbound, ctx: ChannelReceiveContextIface): Promise<ChannelReceiveResult>;\n // Pure: who gets this message, and how. The channel applies it\n // to what it posts, from receive and project.\n route(args: RouteArgsIface): RouteDecisionIface[] | Promise<RouteDecisionIface[]>;\n turnPolicy: TurnPolicy;\n // ACP update \u2192 visible message / card. Called with a turn's\n // PROJECTED_UPDATE_KINDS updates in seq order, then its idle state_update.\n project(update: SessionUpdate, ctx: ProjectionContextIface<State>): Promise<void>;\n events?: Partial<Record<ChannelEventKind, ChannelEventHandler<State>>>;\n}\n\nexport const defineChannel = <Inbound, State = undefined>(\n definition: ChannelDefinitionIface<Inbound, State>,\n): ChannelDefinitionIface<Inbound, State> => definition;\n"],
5
+ "mappings": "AAGA,YAAY,OAAO;AAEnB,SAAS,kBAAkB,uBAAwD;AAgB5E,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,UAAO;AACP,EAAAA,sBAAA,aAAU;AAFA,SAAAA;AAAA,GAAA;AAgBL,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC7B,eAAe,EAAE,WAAW,oBAAoB;AAAA,EAChD,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA;AAAA,EAE/B,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EACjD,YAAY,iBAAiB,QAAQ,CAAC,CAAC;AACzC,CAAC;AAGM,MAAM,uBAAuB,CAAC,SAAmC;AACtE,QAAM,OAAO,KAAK,aAAa;AAC/B,SAAO,OAAO,SAAS,YAAY,KAAK,SAAS,IAAI,OAAO,KAAK;AACnE;AAEO,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,YAAS;AACT,EAAAA,kBAAA,WAAQ;AAFE,SAAAA;AAAA,GAAA;AAKL,IAAK,kBAAL,kBAAKC,qBAAL;AACL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zF,QAAQ;AACb,CAAC;AAGM,MAAM,YAAY,CAAC,WAAgE;AACxF,QAAM,SAAS,cAAc,UAAU,MAAM;AAC7C,MAAI,CAAC,OAAO,QAAS,QAAO;AAC5B,SAAO;AAAA,IACL,YAAY,OAAO,KAAK,cAAc,OAAO,KAAK,QAAQ,UAAU,GAAG,cAAc;AAAA,EACvF;AACF;AAKO,MAAM,gBAAgB,CAAC,eAA6C;AACzE,UAAQ,YAAY;AAAA,IAClB,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,OAAO;AAAA,IACxD,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,WAAW;AAAA,IAChF,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,aAAa;AAAA,IAClF,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,oBAAoB;AAAA,IACzF,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,UAAU;AAAA,IAC/E,KAAK;AACH,aAAO,EAAE,eAAe,gBAAgB,OAAO,QAAQ,YAAY,YAAY;AAAA,IACjF;AACE,aAAO;AAAA,QACL,eAAe;AAAA,QACf,OAAO;AAAA,QACP,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE;AAAA,MACtC;AAAA,EACJ;AACF;AA2BO,MAAM,gBAAgB,CAC3B,eAC2C;",
6
+ "names": ["ChannelPrincipalType", "ConversationKind", "ParticipantKind", "RoutingMode", "TurnPolicy", "Delivery", "MessageKind", "CardKind", "DecisionEventKind", "DecisionKind"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finalai/agent-provider",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "description": "Provider contracts for the agent stack: harnesses, sandboxes (handle, wire, MCP projection), channels, credential policies, and the conformance kit.",
6
6
  "license": "Apache-2.0",
@@ -184,7 +184,7 @@
184
184
  "dependencies": {
185
185
  "@agentclientprotocol/sdk": "1.8.0",
186
186
  "@finalai/acp-session": "0.1.10",
187
- "@finalai/agent-protocol": "0.4.2",
187
+ "@finalai/agent-protocol": "0.5.0",
188
188
  "@modelcontextprotocol/client": "^2.1.0",
189
189
  "@modelcontextprotocol/core": "^2.1.0",
190
190
  "@modelcontextprotocol/server": "^2.1.0",