@finalai/agents 0.11.0 → 0.13.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 (188) hide show
  1. package/HOSTING.md +334 -245
  2. package/README.md +214 -29
  3. package/dist/modules/agent-client/agent-input.d.mts +24 -0
  4. package/dist/modules/agent-client/agent-input.mjs +46 -0
  5. package/dist/modules/agent-client/agent-input.mjs.map +7 -0
  6. package/dist/modules/agent-client/channels.d.mts +128 -16
  7. package/dist/modules/agent-client/channels.mjs +216 -33
  8. package/dist/modules/agent-client/channels.mjs.map +2 -2
  9. package/dist/modules/agent-client/client.d.mts +91 -21
  10. package/dist/modules/agent-client/client.mjs +79 -24
  11. package/dist/modules/agent-client/client.mjs.map +2 -2
  12. package/dist/modules/agent-client/config-options.mjs +1 -2
  13. package/dist/modules/agent-client/config-options.mjs.map +2 -2
  14. package/dist/modules/agent-client/conversation-resources.d.mts +102 -0
  15. package/dist/modules/agent-client/conversation-resources.mjs +178 -0
  16. package/dist/modules/agent-client/conversation-resources.mjs.map +7 -0
  17. package/dist/modules/agent-client/conversations.d.mts +120 -38
  18. package/dist/modules/agent-client/conversations.mjs +386 -71
  19. package/dist/modules/agent-client/conversations.mjs.map +2 -2
  20. package/dist/modules/agent-client/defaults.d.mts +8 -0
  21. package/dist/modules/agent-client/defaults.mjs +77 -0
  22. package/dist/modules/agent-client/defaults.mjs.map +7 -0
  23. package/dist/modules/agent-client/errors.d.mts +22 -2
  24. package/dist/modules/agent-client/errors.mjs +19 -0
  25. package/dist/modules/agent-client/errors.mjs.map +2 -2
  26. package/dist/modules/agent-client/events.d.mts +62 -0
  27. package/dist/modules/agent-client/events.mjs +107 -0
  28. package/dist/modules/agent-client/events.mjs.map +7 -0
  29. package/dist/modules/agent-client/harnesses.d.mts +66 -0
  30. package/dist/modules/agent-client/harnesses.mjs +156 -0
  31. package/dist/modules/agent-client/harnesses.mjs.map +7 -0
  32. package/dist/modules/agent-client/http.d.mts +2 -1
  33. package/dist/modules/agent-client/http.mjs +21 -2
  34. package/dist/modules/agent-client/http.mjs.map +2 -2
  35. package/dist/modules/agent-client/index.d.mts +21 -6
  36. package/dist/modules/agent-client/index.mjs +26 -0
  37. package/dist/modules/agent-client/index.mjs.map +2 -2
  38. package/dist/modules/agent-client/integrations.d.mts +40 -0
  39. package/dist/modules/agent-client/integrations.mjs +92 -0
  40. package/dist/modules/agent-client/integrations.mjs.map +7 -0
  41. package/dist/modules/agent-client/local-host-protocol.d.mts +156 -0
  42. package/dist/modules/agent-client/local-host-protocol.mjs +258 -0
  43. package/dist/modules/agent-client/local-host-protocol.mjs.map +7 -0
  44. package/dist/modules/agent-client/local-host.d.mts +56 -0
  45. package/dist/modules/agent-client/local-host.mjs +200 -0
  46. package/dist/modules/agent-client/local-host.mjs.map +7 -0
  47. package/dist/modules/agent-client/oauth-clients.d.mts +36 -0
  48. package/dist/modules/agent-client/oauth-clients.mjs +67 -0
  49. package/dist/modules/agent-client/oauth-clients.mjs.map +7 -0
  50. package/dist/modules/agent-client/project-agents.d.mts +54 -0
  51. package/dist/modules/agent-client/project-agents.mjs +111 -0
  52. package/dist/modules/agent-client/project-agents.mjs.map +7 -0
  53. package/dist/modules/agent-client/project.d.mts +48 -0
  54. package/dist/modules/agent-client/project.mjs +66 -0
  55. package/dist/modules/agent-client/project.mjs.map +7 -0
  56. package/dist/modules/agent-client/projects.d.mts +61 -0
  57. package/dist/modules/agent-client/projects.mjs +145 -0
  58. package/dist/modules/agent-client/projects.mjs.map +7 -0
  59. package/dist/modules/agent-client/provide.d.mts +41 -0
  60. package/dist/modules/agent-client/provide.mjs +90 -0
  61. package/dist/modules/agent-client/provide.mjs.map +7 -0
  62. package/dist/modules/agent-client/publishers.d.mts +57 -0
  63. package/dist/modules/agent-client/publishers.mjs +109 -0
  64. package/dist/modules/agent-client/publishers.mjs.map +7 -0
  65. package/dist/modules/agent-client/requirements.d.mts +60 -0
  66. package/dist/modules/agent-client/requirements.mjs +83 -0
  67. package/dist/modules/agent-client/requirements.mjs.map +7 -0
  68. package/dist/modules/agent-client/sandbox-providers.d.mts +34 -0
  69. package/dist/modules/agent-client/sandbox-providers.mjs +75 -0
  70. package/dist/modules/agent-client/sandbox-providers.mjs.map +7 -0
  71. package/dist/modules/agent-client/sandbox-uri.d.mts +1 -1
  72. package/dist/modules/agent-client/sandbox-uri.mjs +4 -4
  73. package/dist/modules/agent-client/sandbox-uri.mjs.map +1 -1
  74. package/dist/modules/agent-client/sandboxes.d.mts +72 -0
  75. package/dist/modules/agent-client/sandboxes.mjs +138 -0
  76. package/dist/modules/agent-client/sandboxes.mjs.map +7 -0
  77. package/dist/modules/agent-client/schedules.d.mts +9 -0
  78. package/dist/modules/agent-client/schedules.mjs +17 -0
  79. package/dist/modules/agent-client/schedules.mjs.map +7 -0
  80. package/dist/modules/agent-client/sessions.d.mts +46 -8
  81. package/dist/modules/agent-client/sessions.mjs +91 -29
  82. package/dist/modules/agent-client/sessions.mjs.map +2 -2
  83. package/dist/modules/agent-client/start.d.mts +101 -0
  84. package/dist/modules/agent-client/start.mjs +260 -0
  85. package/dist/modules/agent-client/start.mjs.map +7 -0
  86. package/dist/modules/agent-client/test-fakes.d.mts +1 -0
  87. package/dist/modules/agent-client/test-fakes.mjs +3 -1
  88. package/dist/modules/agent-client/test-fakes.mjs.map +2 -2
  89. package/dist/modules/cli/agent-module.d.mts +39 -0
  90. package/dist/modules/cli/agent-module.mjs +89 -0
  91. package/dist/modules/cli/agent-module.mjs.map +7 -0
  92. package/dist/modules/cli/cli.d.mts +6 -6
  93. package/dist/modules/cli/cli.mjs +94 -120
  94. package/dist/modules/cli/cli.mjs.map +2 -2
  95. package/dist/modules/cli/conformance.d.mts +2 -6
  96. package/dist/modules/cli/conformance.mjs +5 -8
  97. package/dist/modules/cli/conformance.mjs.map +2 -2
  98. package/dist/modules/cli/main.mjs.map +1 -1
  99. package/dist/modules/cli/output.d.mts +0 -9
  100. package/dist/modules/cli/output.mjs +7 -85
  101. package/dist/modules/cli/output.mjs.map +2 -2
  102. package/dist/modules/harnesses.mjs.map +2 -2
  103. package/dist/modules/index.d.mts +0 -2
  104. package/dist/modules/index.mjs +0 -4
  105. package/dist/modules/index.mjs.map +2 -2
  106. package/dist/modules/integrations.d.mts +24 -0
  107. package/dist/modules/integrations.mjs +30 -0
  108. package/dist/modules/integrations.mjs.map +7 -0
  109. package/dist/modules/public.d.mts +10 -10
  110. package/dist/modules/public.mjs +29 -78
  111. package/dist/modules/public.mjs.map +2 -2
  112. package/dist/modules/sandboxes.d.mts +2 -0
  113. package/dist/modules/sandboxes.mjs +4 -0
  114. package/dist/modules/sandboxes.mjs.map +2 -2
  115. package/dist/modules/verify.d.mts +1 -0
  116. package/dist/modules/verify.mjs +2 -0
  117. package/dist/modules/verify.mjs.map +7 -0
  118. package/dist/modules/webhooks.d.mts +37 -0
  119. package/dist/modules/webhooks.mjs +100 -0
  120. package/dist/modules/webhooks.mjs.map +7 -0
  121. package/examples/release-scout/README.md +18 -10
  122. package/examples/release-scout/agent.ts +41 -0
  123. package/examples/release-scout/by-name.ts +43 -0
  124. package/examples/release-scout/db.ts +6 -0
  125. package/examples/release-scout/instructions.md +5 -0
  126. package/examples/release-scout/run-on-a-computer.ts +49 -0
  127. package/examples/release-scout/run.ts +38 -0
  128. package/package.json +37 -28
  129. package/dist/modules/agent-client/build.d.mts +0 -110
  130. package/dist/modules/agent-client/build.mjs +0 -213
  131. package/dist/modules/agent-client/build.mjs.map +0 -7
  132. package/dist/modules/authoring/final-channel.d.mts +0 -1
  133. package/dist/modules/authoring/final-channel.mjs +0 -2
  134. package/dist/modules/authoring/final-channel.mjs.map +0 -7
  135. package/dist/modules/authoring/index.d.mts +0 -1
  136. package/dist/modules/authoring/index.mjs +0 -2
  137. package/dist/modules/authoring/index.mjs.map +0 -7
  138. package/dist/modules/authoring/instructions.d.mts +0 -1
  139. package/dist/modules/authoring/instructions.mjs +0 -2
  140. package/dist/modules/authoring/instructions.mjs.map +0 -7
  141. package/dist/modules/authoring/providers.d.mts +0 -2
  142. package/dist/modules/authoring/providers.mjs +0 -1
  143. package/dist/modules/authoring/providers.mjs.map +0 -7
  144. package/dist/modules/cli/build.d.mts +0 -22
  145. package/dist/modules/cli/build.mjs +0 -77
  146. package/dist/modules/cli/build.mjs.map +0 -7
  147. package/dist/modules/cli/channel-install.d.mts +0 -12
  148. package/dist/modules/cli/channel-install.mjs +0 -25
  149. package/dist/modules/cli/channel-install.mjs.map +0 -7
  150. package/dist/modules/cli/channel-socket.d.mts +0 -9
  151. package/dist/modules/cli/channel-socket.mjs +0 -114
  152. package/dist/modules/cli/channel-socket.mjs.map +0 -7
  153. package/dist/modules/cli/dev.d.mts +0 -26
  154. package/dist/modules/cli/dev.mjs +0 -311
  155. package/dist/modules/cli/dev.mjs.map +0 -7
  156. package/dist/modules/cli/files.d.mts +0 -18
  157. package/dist/modules/cli/files.mjs +0 -66
  158. package/dist/modules/cli/files.mjs.map +0 -7
  159. package/dist/modules/cli/harness-descriptions.d.mts +0 -20
  160. package/dist/modules/cli/harness-descriptions.mjs +0 -70
  161. package/dist/modules/cli/harness-descriptions.mjs.map +0 -7
  162. package/dist/modules/cli/publish.d.mts +0 -15
  163. package/dist/modules/cli/publish.mjs +0 -92
  164. package/dist/modules/cli/publish.mjs.map +0 -7
  165. package/dist/modules/compile.d.mts +0 -3
  166. package/dist/modules/compile.mjs +0 -58
  167. package/dist/modules/compile.mjs.map +0 -7
  168. package/dist/modules/index.browser.d.mts +0 -4
  169. package/dist/modules/index.browser.mjs +0 -8
  170. package/dist/modules/index.browser.mjs.map +0 -7
  171. package/examples/custom-harness/README.md +0 -16
  172. package/examples/custom-harness/agent.ts +0 -154
  173. package/examples/custom-sandbox/README.md +0 -12
  174. package/examples/custom-sandbox/agent.ts +0 -14
  175. package/examples/custom-sandbox/sandbox.ts +0 -24
  176. package/examples/release-scout/agent/agent.ts +0 -22
  177. package/examples/release-scout/agent/channels/github-signature.ts +0 -27
  178. package/examples/release-scout/agent/channels/github.ts +0 -32
  179. package/examples/release-scout/agent/connections/linear.ts +0 -9
  180. package/examples/release-scout/agent/hooks/audit.ts +0 -24
  181. package/examples/release-scout/agent/instructions/org-context.ts +0 -26
  182. package/examples/release-scout/agent/instructions.md +0 -2
  183. package/examples/release-scout/agent/sandbox.ts +0 -20
  184. package/examples/release-scout/agent/schedules/daily-digest.md +0 -7
  185. package/examples/release-scout/agent/skills/triage/SKILL.md +0 -8
  186. package/examples/release-scout/agent/skills/triage/checklist.md +0 -3
  187. package/examples/release-scout/agent/tools/lookup_release_notes.ts +0 -24
  188. package/examples/release-scout/client.ts +0 -122
@@ -1,11 +1,15 @@
1
1
  import { type ProcessInspectionRequestIface, type ProcessInspectionResultIface } from '@finalai/agent-protocol';
2
- import { AgentSessionState, type PostConversationEventResponseIface, type AgentRealtimeEvent, type AgentTurnPolicy, type AttachmentDownloadIface, type AttachmentUploadIface, type ContentInput, type ConversationIface, type ConversationKind, type ConversationLinkIface, type ConversationListIface, type ConversationMessageIface, type ConversationMessagesPageIface, type ConversationSandboxIface, type ConversationScheduleIface, type CreateConversationScheduleRequestIface, type DecisionsPageIface, type MessageDeliveryIface, type ParticipantIface, type ParticipantInput, type PostConversationEventRequestIface, type ReactionIface, type ReadStateIface, type RespondDecisionResponseIface, type SandboxDirectoryIface, type SandboxEditorSessionIface, type SandboxFileIface, type SandboxPathIface, type SandboxPreviewType, type SandboxSearchIface, type SearchMessagesPageIface, type UpdateConversationRequestIface, type UpdateConversationScheduleRequestIface, type UpdateParticipantRequestIface, type WireFallback } from '@finalai/agent-protocol/agent-platform';
2
+ import { AgentSessionState, type PostConversationEventResponseIface, type AgentRealtimeEvent, type AgentTurnPolicy, type AttachmentDownloadIface, type AttachmentUploadIface, type ContentInput, type ConversationIface, type ConversationKind, type ConversationLinkIface, type ConversationListIface, type ConversationMessageIface, type ConversationMessagesPageIface, type ConversationSandboxIface, type ConversationScheduleIface, type CreateConversationScheduleRequestIface, type DecisionsPageIface, type MessageDeliveryIface, type ParticipantIface, type ActorInputIface, type ParticipantInput, type ParticipantProvideResponseIface, type PostConversationEventRequestIface, type ReactionIface, type ReadStateIface, type RespondDecisionResponseIface, type SandboxDirectoryIface, type SandboxEditorSessionIface, type SandboxFileIface, type SandboxPathIface, type SandboxPreviewType, type SandboxSearchIface, type SearchMessagesPageIface, type UpdateConversationRequestIface, type UpdateConversationScheduleRequestIface, type ScheduleRunResultIface, type UpdateParticipantRequestIface, type WireFallback } from '@finalai/agent-protocol/agent-platform';
3
+ import type { AgentInput } from "./agent-input.mjs";
4
+ import { type ConversationResourcesIface } from "./conversation-resources.mjs";
3
5
  import { type CollectionEvent, type CollectionEventsOptionsIface } from "./collection-events.mjs";
4
6
  import { type ClientContextIface, type EnumInput, type SignalOptionsIface } from "./context.mjs";
7
+ import { type ProvideIface, type ProvidePatchIface } from "./provide.mjs";
5
8
  import { type RespondArgs } from "./sessions.mjs";
9
+ import { type AgentStartDepsIface } from "./start.mjs";
6
10
  export interface SandboxFileContentArgsIface {
7
11
  snapshotId?: string;
8
- bindingId: string;
12
+ sandboxId: string;
9
13
  path: string;
10
14
  download?: boolean;
11
15
  /** One HTTP byte range, for example `bytes=1024-2047`. */
@@ -70,15 +74,37 @@ export interface SendMessageOptionsIface extends SignalOptionsIface {
70
74
  attachmentIds?: string[];
71
75
  /** When the person submitted, for the prompt-to-inference trace; defaults to now. */
72
76
  clientSubmittedAtMs?: number;
77
+ /** The caller's own end user posting it; API keys and app tokens only. */
78
+ actor?: ActorInputIface;
73
79
  }
80
+ type RoutingModeInput = EnumInput<NonNullable<Extract<ParticipantInput, {
81
+ routingMode?: unknown;
82
+ }>['routingMode']>>;
83
+ /**
84
+ * A person by id, the caller's own end user (API keys and app tokens only), or
85
+ * an agent with what it is provided in this conversation.
86
+ */
74
87
  export type ParticipantCreateInput = {
75
88
  user: string;
76
89
  } | {
77
- agent: string;
78
- routingMode?: EnumInput<NonNullable<Extract<ParticipantInput, {
79
- agent: string;
80
- }>['routingMode']>>;
90
+ actor: ActorInputIface;
91
+ } | {
92
+ /** The agent you defined, or one fetched with `project.agents.get`; never a string. */
93
+ agent: AgentInput;
94
+ routingMode?: RoutingModeInput;
95
+ provide: ProvideIface;
81
96
  };
97
+ export interface ParticipantsApiIface {
98
+ (options?: SignalOptionsIface): Promise<ParticipantIface[]>;
99
+ /** An agent participant's settings: its provide document and per-chat overrides. */
100
+ settings: (participantId: string, options?: SignalOptionsIface) => Promise<ParticipantProvideResponseIface>;
101
+ /**
102
+ * Changes an agent participant's settings. Fails with `requirements_unmet` if
103
+ * the result no longer meets the agent's requirements, or
104
+ * `harness_unsuitable` for harness settings it cannot run on.
105
+ */
106
+ provide: (participantId: string, patch: ProvidePatchIface, options?: SignalOptionsIface) => Promise<ParticipantProvideResponseIface>;
107
+ }
82
108
  export interface SentMessageIface {
83
109
  message: ConversationMessageIface;
84
110
  messageId: string;
@@ -102,7 +128,7 @@ export interface UploadAttachmentArgsIface extends SignalOptionsIface {
102
128
  contentType: string;
103
129
  data: Blob | ArrayBuffer;
104
130
  }
105
- export interface ConversationHandleIface {
131
+ export interface ConversationHandleIface extends ConversationResourcesIface {
106
132
  /** Durable accepted prompt receipts for a message, including queued deliveries once admitted. */
107
133
  deliveries: (args: {
108
134
  messageId: string;
@@ -162,7 +188,7 @@ export interface ConversationHandleIface {
162
188
  reason?: string;
163
189
  throughMessageSeq?: number;
164
190
  }) => Promise<void>;
165
- participants: (options?: SignalOptionsIface) => Promise<ParticipantIface[]>;
191
+ participants: ParticipantsApiIface;
166
192
  /**
167
193
  * Each agent participant's session state, read now: whether a turn is
168
194
  * running in it. What a client re-reads when it may have missed a
@@ -202,48 +228,48 @@ export interface ConversationHandleIface {
202
228
  * Never starts a parked sandbox.
203
229
  */
204
230
  sandboxes: (options?: SignalOptionsIface) => Promise<ConversationSandboxIface[]>;
205
- /** One directory of a running sandbox, confined to its workspace (`…/sandboxes/:bindingId/files`). */
231
+ /** One directory of a running sandbox, confined to its workspace (`…/sandboxes/:sandboxId/files`). */
206
232
  sandboxFiles: (args: {
207
- bindingId: string;
233
+ sandboxId: string;
208
234
  path?: string;
209
235
  snapshotId?: string;
210
236
  }, options?: SignalOptionsIface) => Promise<SandboxDirectoryIface>;
211
237
  /** Resolves a file or directory without waking its sandbox. */
212
238
  sandboxPath: (args: {
213
- bindingId: string;
239
+ sandboxId: string;
214
240
  path?: string;
215
241
  snapshotId?: string;
216
242
  }, options?: SignalOptionsIface) => Promise<SandboxPathIface>;
217
243
  /** Bounded recursive path search; truncated signals incomplete traversal. */
218
244
  searchSandboxFiles: (args: {
219
- bindingId: string;
245
+ sandboxId: string;
220
246
  path?: string;
221
247
  query: string;
222
248
  limit?: number;
223
249
  }, options?: SignalOptionsIface) => Promise<SandboxSearchIface>;
224
- /** A byte range of a file in a running sandbox, at most 1 MiB (`…/sandboxes/:bindingId/file`). */
250
+ /** A byte range of a file in a running sandbox, at most 1 MiB (`…/sandboxes/:sandboxId/file`). */
225
251
  sandboxFile: (args: {
226
- bindingId: string;
252
+ sandboxId: string;
227
253
  path: string;
228
254
  offset?: number;
229
255
  length?: number;
230
256
  snapshotId?: string;
231
257
  }, options?: SignalOptionsIface) => Promise<SandboxFileIface>;
232
258
  inspectSandboxProcesses(args: {
233
- bindingId: string;
259
+ sandboxId: string;
234
260
  request: ProcessInspectionRequestIface;
235
261
  }, options?: SignalOptionsIface): Promise<ProcessInspectionResultIface>;
236
262
  /** Opens a provider editor for an existing workspace, with write authorization. */
237
263
  openSandboxEditor(args: {
238
- bindingId: string;
264
+ sandboxId: string;
239
265
  }, options?: SignalOptionsIface): Promise<SandboxEditorSessionIface>;
240
266
  refreshSandboxEditor(args: {
241
- bindingId: string;
267
+ sandboxId: string;
242
268
  editorId: string;
243
269
  authorizationId: string;
244
270
  }, options?: SignalOptionsIface): Promise<SandboxEditorSessionIface>;
245
271
  closeSandboxEditor(args: {
246
- bindingId: string;
272
+ sandboxId: string;
247
273
  editorId: string;
248
274
  authorizationId: string;
249
275
  }, options?: SignalOptionsIface & {
@@ -259,12 +285,12 @@ export interface ConversationHandleIface {
259
285
  sandboxFileContentRequest: (args: SandboxFileContentArgsIface) => Promise<SandboxFileContentRequestIface>;
260
286
  /** A short-lived screen preview of a running sandbox; 404 when it serves none (`…/preview`). */
261
287
  sandboxPreview: (args: {
262
- bindingId: string;
288
+ sandboxId: string;
263
289
  viewOnly?: boolean;
264
290
  }, options?: SignalOptionsIface) => Promise<SandboxPreviewType>;
265
291
  /** Starts a parked sandbox (conversation owners and admins; `POST …/wake`). */
266
292
  wakeSandbox: (args: {
267
- bindingId: string;
293
+ sandboxId: string;
268
294
  }, options?: SignalOptionsIface) => Promise<ConversationSandboxIface>;
269
295
  /** The conversation's runtime schedules: reminders and recurring checks (`GET …/schedules`). */
270
296
  schedules: (options?: SignalOptionsIface) => Promise<ConversationScheduleIface[]>;
@@ -281,6 +307,10 @@ export interface ConversationHandleIface {
281
307
  deleteSchedule: (args: {
282
308
  scheduleId: string;
283
309
  }, options?: SignalOptionsIface) => Promise<void>;
310
+ /** Fires a schedule now (`POST …/schedules/:id/run-now`, needs `agents:execute`). */
311
+ runSchedule: (args: {
312
+ scheduleId: string;
313
+ }, options?: SignalOptionsIface) => Promise<ScheduleRunResultIface>;
284
314
  /**
285
315
  * The conversations this one handed work to, with what their agents are
286
316
  * doing (`GET …/links`). Their replies and waits arrive here as messages.
@@ -314,15 +344,63 @@ export interface OpenedConversationIface extends ConversationHandleIface {
314
344
  }
315
345
  export interface CreateConversationArgsIface extends SignalOptionsIface {
316
346
  /**
317
- * The project (`prj_...`) a signed-in person creates a group chat in (editors only).
318
- * Omitted: their personal project. Project API keys cannot create person-owned chats.
319
- * A direct chat is the caller's own and lives in their personal project.
347
+ * A conversation id you chose, so whatever you create for it first (a sandbox
348
+ * it owns) can name it. Creating with an id that exists returns that conversation.
320
349
  */
321
- projectId?: string;
350
+ id?: string;
322
351
  kind: EnumInput<ConversationKind>;
323
352
  title?: string;
324
353
  participants: ParticipantCreateInput[];
325
354
  turnPolicy?: EnumInput<AgentTurnPolicy>;
355
+ /** Shared by the conversation's agents; each participant's own `provide` wins per key. */
356
+ provide?: ProvideIface;
357
+ /**
358
+ * Direct only. True (the default): the person's one direct conversation with
359
+ * the agent in this project, found or created. False: another private 1:1
360
+ * thread, created on every call (a retry with the same `id` returns it).
361
+ */
362
+ primary?: boolean;
363
+ /** Written with the conversation in the caller's namespace; needs `labels:write`. */
364
+ labels?: Record<string, string>;
365
+ /** The caller's own end user creating it; API keys and app tokens only. */
366
+ actor?: ActorInputIface;
367
+ }
368
+ export interface ProjectConversationsApiIface extends ConversationsApiIface {
369
+ /**
370
+ * Creates a conversation in this project. Fails with `requirements_unmet`,
371
+ * creating nothing, unless each agent's requirements are met.
372
+ */
373
+ create: (args: CreateConversationArgsIface) => Promise<OpenedConversationIface>;
374
+ /**
375
+ * The caller's own Home thread with the project's agent, found or created.
376
+ * `provide` is stored only when the agent has no settings there yet.
377
+ */
378
+ home: (args: {
379
+ id?: string;
380
+ provide: ProvideIface;
381
+ } & SignalOptionsIface) => Promise<OpenedConversationIface>;
382
+ /** The caller's Home thread, if there is one. Creates nothing. */
383
+ findHome: (options?: SignalOptionsIface) => Promise<ConversationIface | null>;
384
+ /**
385
+ * The caller's direct conversation with an agent, found or created.
386
+ * `provide` is stored only when the agent has no settings there yet.
387
+ */
388
+ direct: (args: {
389
+ id?: string;
390
+ agent: AgentInput;
391
+ provide: ProvideIface;
392
+ /** The caller's own end user whose direct conversation it is; API keys and app tokens only. */
393
+ actor?: ActorInputIface;
394
+ } & SignalOptionsIface) => Promise<OpenedConversationIface>;
395
+ /**
396
+ * The caller's primary direct conversation with an agent (by its id), if
397
+ * there is one. Creates nothing. `actorExternalId` names the caller's own end
398
+ * user (API keys and app tokens only).
399
+ */
400
+ findDirect: (args: {
401
+ agent: string;
402
+ actorExternalId?: string;
403
+ } & SignalOptionsIface) => Promise<ConversationIface | null>;
326
404
  }
327
405
  export interface ConversationsApiIface {
328
406
  /**
@@ -335,19 +413,11 @@ export interface ConversationsApiIface {
335
413
  limit?: number;
336
414
  includeArchived?: boolean;
337
415
  projectId?: string;
416
+ /** With `projectId`: false leaves out the projects below it. */
417
+ includeSubprojects?: boolean;
418
+ /** Only conversations carrying every one of these labels in the caller's namespace. */
419
+ labels?: Record<string, string>;
338
420
  }) => Promise<ConversationListIface>;
339
- /** Finds or creates the caller's direct conversation with an agent. */
340
- direct: (args: {
341
- agent: string;
342
- } & SignalOptionsIface) => Promise<OpenedConversationIface>;
343
- /**
344
- * Finds or creates the caller's own Project Agent thread in `projectId`, which
345
- * omitted, is the signed-in person's personal project. Requires person authority.
346
- */
347
- home: (options?: SignalOptionsIface & {
348
- projectId?: string;
349
- }) => Promise<OpenedConversationIface>;
350
- create: (args: CreateConversationArgsIface) => Promise<OpenedConversationIface>;
351
421
  /** I/O-free handle. */
352
422
  get: (conversationId: string) => ConversationHandleIface;
353
423
  /** Full-text search over the caller's conversations (or one), newest first. */
@@ -403,5 +473,17 @@ export declare const messageVersionOf: (message: ConversationMessageIface) => Me
403
473
  * time, and equal times fall back to content.
404
474
  */
405
475
  export declare const isNewerMessageVersion: (incoming: MessageVersionIface, current: MessageVersionIface | undefined) => boolean;
406
- export declare const createConversationHandle: (context: ClientContextIface, conversationId: string) => ConversationHandleIface;
407
- export declare const createConversationsApi: (context: ClientContextIface) => ConversationsApiIface;
476
+ /** How a conversation handle starts the agents added to it. */
477
+ export interface ConversationStarterIface {
478
+ deps: AgentStartDepsIface;
479
+ /** Null for handles made outside a project, which cannot serve local compute. */
480
+ projectId: string | null;
481
+ }
482
+ export declare const createConversationHandle: (context: ClientContextIface, conversationId: string, starter: ConversationStarterIface) => ConversationHandleIface;
483
+ export declare const createConversationsApi: (context: ClientContextIface, starter: ConversationStarterIface) => ConversationsApiIface;
484
+ export declare const createProjectConversationsApi: (args: {
485
+ context: ClientContextIface;
486
+ projectId: string;
487
+ start: AgentStartDepsIface;
488
+ }) => ProjectConversationsApiIface;
489
+ export {};