sarvam-agents-client 0.4.0 → 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.
Files changed (173) hide show
  1. package/README.md +136 -23
  2. package/dist/apis/AgentConversationsApi.d.ts +8 -2
  3. package/dist/apis/AgentConversationsApi.js +8 -2
  4. package/dist/apis/AgentsApi.d.ts +6 -6
  5. package/dist/apis/AgentsApi.js +6 -6
  6. package/dist/apis/ConversationsApi.d.ts +6 -2
  7. package/dist/apis/ConversationsApi.js +10 -2
  8. package/dist/apis/MessagesApi.d.ts +1 -0
  9. package/dist/apis/MessagesApi.js +3 -0
  10. package/dist/apis/TriggersApi.d.ts +154 -0
  11. package/dist/apis/TriggersApi.js +376 -0
  12. package/dist/apis/index.d.ts +1 -0
  13. package/dist/apis/index.js +1 -0
  14. package/dist/client.d.ts +21 -0
  15. package/dist/client.js +24 -0
  16. package/dist/compose/agent.d.ts +4 -0
  17. package/dist/compose/agent.js +9 -0
  18. package/dist/compose/deploy.d.ts +8 -0
  19. package/dist/compose/deploy.js +32 -6
  20. package/dist/compose/index.d.ts +5 -1
  21. package/dist/compose/index.js +12 -1
  22. package/dist/compose/settingsTransport.d.ts +22 -3
  23. package/dist/compose/settingsTransport.js +180 -15
  24. package/dist/compose/transport.d.ts +19 -3
  25. package/dist/compose/trigger.d.ts +166 -0
  26. package/dist/compose/trigger.js +525 -0
  27. package/dist/compose/triggers.d.ts +96 -0
  28. package/dist/compose/triggers.js +319 -0
  29. package/dist/compose/webhook.d.ts +18 -3
  30. package/dist/compose/webhook.js +59 -10
  31. package/dist/compose/webhookSecrets.d.ts +64 -0
  32. package/dist/compose/webhookSecrets.js +255 -0
  33. package/dist/esm/apis/AgentConversationsApi.d.ts +8 -2
  34. package/dist/esm/apis/AgentConversationsApi.js +8 -2
  35. package/dist/esm/apis/AgentsApi.d.ts +6 -6
  36. package/dist/esm/apis/AgentsApi.js +6 -6
  37. package/dist/esm/apis/ConversationsApi.d.ts +6 -2
  38. package/dist/esm/apis/ConversationsApi.js +10 -2
  39. package/dist/esm/apis/MessagesApi.d.ts +1 -0
  40. package/dist/esm/apis/MessagesApi.js +3 -0
  41. package/dist/esm/apis/TriggersApi.d.ts +154 -0
  42. package/dist/esm/apis/TriggersApi.js +372 -0
  43. package/dist/esm/apis/index.d.ts +1 -0
  44. package/dist/esm/apis/index.js +1 -0
  45. package/dist/esm/client.d.ts +21 -0
  46. package/dist/esm/client.js +20 -0
  47. package/dist/esm/compose/agent.d.ts +4 -0
  48. package/dist/esm/compose/agent.js +9 -0
  49. package/dist/esm/compose/deploy.d.ts +8 -0
  50. package/dist/esm/compose/deploy.js +32 -6
  51. package/dist/esm/compose/index.d.ts +5 -1
  52. package/dist/esm/compose/index.js +2 -0
  53. package/dist/esm/compose/settingsTransport.d.ts +22 -3
  54. package/dist/esm/compose/settingsTransport.js +179 -15
  55. package/dist/esm/compose/transport.d.ts +19 -3
  56. package/dist/esm/compose/trigger.d.ts +166 -0
  57. package/dist/esm/compose/trigger.js +514 -0
  58. package/dist/esm/compose/triggers.d.ts +96 -0
  59. package/dist/esm/compose/triggers.js +315 -0
  60. package/dist/esm/compose/webhook.d.ts +18 -3
  61. package/dist/esm/compose/webhook.js +55 -9
  62. package/dist/esm/compose/webhookSecrets.d.ts +64 -0
  63. package/dist/esm/compose/webhookSecrets.js +250 -0
  64. package/dist/esm/index.d.ts +5 -0
  65. package/dist/esm/index.js +4 -0
  66. package/dist/esm/models/AgentResource.d.ts +7 -0
  67. package/dist/esm/models/AgentResource.js +3 -0
  68. package/dist/esm/models/FireResponse.d.ts +63 -0
  69. package/dist/esm/models/FireResponse.js +63 -0
  70. package/dist/esm/models/MessagePart.d.ts +8 -0
  71. package/dist/esm/models/MessagePart.js +2 -0
  72. package/dist/esm/models/ResponseRotateTriggerSecret.d.ts +50 -0
  73. package/dist/esm/models/ResponseRotateTriggerSecret.js +54 -0
  74. package/dist/esm/models/RotatedSecret.d.ts +44 -0
  75. package/dist/esm/models/RotatedSecret.js +50 -0
  76. package/dist/esm/models/RotatedSigningSecret.d.ts +40 -0
  77. package/dist/esm/models/RotatedSigningSecret.js +46 -0
  78. package/dist/esm/models/TriggerDryRun.d.ts +44 -0
  79. package/dist/esm/models/TriggerDryRun.js +47 -0
  80. package/dist/esm/models/TriggerEventList.d.ts +39 -0
  81. package/dist/esm/models/TriggerEventList.js +46 -0
  82. package/dist/esm/models/TriggerEventView.d.ts +117 -0
  83. package/dist/esm/models/TriggerEventView.js +89 -0
  84. package/dist/esm/models/TriggerList.d.ts +33 -0
  85. package/dist/esm/models/TriggerList.js +44 -0
  86. package/dist/esm/models/TriggerSecretPut.d.ts +38 -0
  87. package/dist/esm/models/TriggerSecretPut.js +45 -0
  88. package/dist/esm/models/TriggerSecretState.d.ts +52 -0
  89. package/dist/esm/models/TriggerSecretState.js +56 -0
  90. package/dist/esm/models/TriggerTestFireRequest.d.ts +38 -0
  91. package/dist/esm/models/TriggerTestFireRequest.js +43 -0
  92. package/dist/esm/models/TriggerToken.d.ts +50 -0
  93. package/dist/esm/models/TriggerToken.js +56 -0
  94. package/dist/esm/models/TriggerView.d.ts +105 -0
  95. package/dist/esm/models/TriggerView.js +92 -0
  96. package/dist/esm/models/index.d.ts +13 -0
  97. package/dist/esm/models/index.js +13 -0
  98. package/dist/esm/runtime.d.ts +5 -0
  99. package/dist/esm/runtime.js +11 -0
  100. package/dist/esm/webhooks.d.ts +5 -1
  101. package/dist/index.d.ts +5 -0
  102. package/dist/index.js +14 -0
  103. package/dist/models/AgentResource.d.ts +7 -0
  104. package/dist/models/AgentResource.js +3 -0
  105. package/dist/models/FireResponse.d.ts +63 -0
  106. package/dist/models/FireResponse.js +71 -0
  107. package/dist/models/MessagePart.d.ts +8 -0
  108. package/dist/models/MessagePart.js +2 -0
  109. package/dist/models/ResponseRotateTriggerSecret.d.ts +50 -0
  110. package/dist/models/ResponseRotateTriggerSecret.js +61 -0
  111. package/dist/models/RotatedSecret.d.ts +44 -0
  112. package/dist/models/RotatedSecret.js +57 -0
  113. package/dist/models/RotatedSigningSecret.d.ts +40 -0
  114. package/dist/models/RotatedSigningSecret.js +53 -0
  115. package/dist/models/TriggerDryRun.d.ts +44 -0
  116. package/dist/models/TriggerDryRun.js +54 -0
  117. package/dist/models/TriggerEventList.d.ts +39 -0
  118. package/dist/models/TriggerEventList.js +53 -0
  119. package/dist/models/TriggerEventView.d.ts +117 -0
  120. package/dist/models/TriggerEventView.js +97 -0
  121. package/dist/models/TriggerList.d.ts +33 -0
  122. package/dist/models/TriggerList.js +51 -0
  123. package/dist/models/TriggerSecretPut.d.ts +38 -0
  124. package/dist/models/TriggerSecretPut.js +52 -0
  125. package/dist/models/TriggerSecretState.d.ts +52 -0
  126. package/dist/models/TriggerSecretState.js +64 -0
  127. package/dist/models/TriggerTestFireRequest.d.ts +38 -0
  128. package/dist/models/TriggerTestFireRequest.js +50 -0
  129. package/dist/models/TriggerToken.d.ts +50 -0
  130. package/dist/models/TriggerToken.js +63 -0
  131. package/dist/models/TriggerView.d.ts +105 -0
  132. package/dist/models/TriggerView.js +100 -0
  133. package/dist/models/index.d.ts +13 -0
  134. package/dist/models/index.js +13 -0
  135. package/dist/runtime.d.ts +5 -0
  136. package/dist/runtime.js +12 -0
  137. package/dist/webhooks.d.ts +5 -1
  138. package/package.json +1 -1
  139. package/src/apis/AgentConversationsApi.ts +8 -2
  140. package/src/apis/AgentsApi.ts +6 -6
  141. package/src/apis/ConversationsApi.ts +14 -2
  142. package/src/apis/MessagesApi.ts +5 -0
  143. package/src/apis/TriggersApi.ts +584 -0
  144. package/src/apis/index.ts +1 -0
  145. package/src/client.ts +27 -0
  146. package/src/compose/agent.ts +11 -0
  147. package/src/compose/deploy.ts +42 -7
  148. package/src/compose/index.ts +8 -1
  149. package/src/compose/settingsTransport.ts +183 -18
  150. package/src/compose/transport.ts +20 -3
  151. package/src/compose/trigger.ts +635 -0
  152. package/src/compose/triggers.ts +337 -0
  153. package/src/compose/webhook.ts +64 -11
  154. package/src/compose/webhookSecrets.ts +257 -0
  155. package/src/index.ts +9 -0
  156. package/src/models/AgentResource.ts +15 -0
  157. package/src/models/FireResponse.ts +107 -0
  158. package/src/models/MessagePart.ts +8 -0
  159. package/src/models/ResponseRotateTriggerSecret.ts +107 -0
  160. package/src/models/RotatedSecret.ts +83 -0
  161. package/src/models/RotatedSigningSecret.ts +76 -0
  162. package/src/models/TriggerDryRun.ts +82 -0
  163. package/src/models/TriggerEventList.ts +82 -0
  164. package/src/models/TriggerEventView.ts +183 -0
  165. package/src/models/TriggerList.ts +74 -0
  166. package/src/models/TriggerSecretPut.ts +74 -0
  167. package/src/models/TriggerSecretState.ts +94 -0
  168. package/src/models/TriggerTestFireRequest.ts +73 -0
  169. package/src/models/TriggerToken.ts +93 -0
  170. package/src/models/TriggerView.ts +168 -0
  171. package/src/models/index.ts +13 -0
  172. package/src/runtime.ts +12 -0
  173. package/src/webhooks.ts +5 -1
package/README.md CHANGED
@@ -144,6 +144,7 @@ one with `ArtifactsApi.downloadUrl`.
144
144
  |---|---|
145
145
  | Instructions | `AgentsApi.getInstructions` / `putInstructions` |
146
146
  | Deploy | `AgentsApi.deployAgent` / `undeployAgent` |
147
+ | Trigger secrets | `new Client(config).triggers`: `setSecret`, `rotateSecret`, `deleteSecret`, `secretStatus` (per trigger, after deploy) |
147
148
  | Skills | `SkillsApi.listAgentSkills`, `bindSkill`, `unbindSkill`, `createSkillForAgent` |
148
149
  | Knowledge bases | `CollectionsApi.listAgentCollections`, `bindAgentToCollection`, then upload files: `initFileUpload` → PUT → `completeFileUpload` → poll `getFile` |
149
150
  | Connectors | `AppsApi.listApps`, `listAgentApps`, `bindApp`, `unbindApp`, `connectApp` |
@@ -169,41 +170,54 @@ See [docs/compose.md](../docs/compose.md#typescript) for the full guide.
169
170
  An agent can POST an event to your server when a turn completes, fails or waits for an answer. The server must have
170
171
  outbound webhooks switched on; until then a deploy keeps the setting and logs the warning `webhooks_disabled`.
171
172
 
172
- **1. Make a secret and store it as a credential.** The secret is `whsec_` plus base64 of 24 to 64 random bytes. Keep
173
- a copy where your receiver runs; Panja never shows it again. Store it as a Custom API whose host is the webhook's
174
- host, with "enabled for chats" off (otherwise the agent's sandbox could be handed it):
173
+ **1. Name the endpoint on the agent** (`agent.json` `webhooks`) and deploy:
175
174
 
176
175
  ```ts
177
- import { CustomAPIsApi } from "sarvam-agents-client";
178
- import { generateSecret } from "sarvam-agents-client/webhooks";
176
+ import { Agent, deploy } from "sarvam-agents-client/compose";
179
177
 
180
- const secret = generateSecret();
181
- const api = new CustomAPIsApi(config);
182
- const created = await api.createCustomApi({ customApiCreate: { name: "acme_webhook", host: "hooks.acme.com",
183
- enabledForChats: false, auth: { type: "bearer", token: secret } } });
178
+ const agent = new Agent({ name: "support-bot", instructions: "...", webhooks: [
179
+ { url: "https://hooks.acme.com/panja", events: ["turn.completed", "turn.failed", "turn.requires_action"] },
180
+ ] });
181
+ const deployment = await deploy(agent, { client: config });
184
182
  ```
185
183
 
186
- The server only accepts a webhook whose credential is bound to the agent. The deploy that creates the agent binds
187
- it for you: it creates the agent without `webhooks`, binds your Custom API named by each `secretCredential`
188
- (`bindCustomApi`), then saves the settings in full. If you have no Custom API of that name, or several, it binds
189
- none and says so in the `UserError` (or, while the server doesn't check credentials, in a logged warning). For an
190
- agent that already exists, bind the credential yourself before adding `webhooks`, with the `agentId` of the
191
- deploy that created it: `await api.bindCustomApi({ agentId, bindCustomApiBody: { customApiId: created.id } })`.
184
+ Leave `secretCredential` out: the deploy fills in the credential that `client.webhooks` manages for that agent and
185
+ host. The first deploy of a webhook with no secret yet stores a random placeholder secret, that nobody holds, so the
186
+ server accepts the webhook, and lists the webhook's URL in `deployment.webhooksMissingSecret`. While the placeholder
187
+ is there, `secretStatus` reads `"missing"`.
192
188
 
193
- **2. Name the endpoint on the agent** (`agent.json` `webhooks`, with `secretCredential` written as
194
- `secret_credential`):
189
+ Call `client.webhooks.setSecret` right after the first deploy, before pointing a provider at the agent. Until then
190
+ deliveries fail verification, and a receiver that answers 4xx makes Panja drop them.
191
+
192
+ **2. Set the signing secret** with `client.webhooks`:
195
193
 
196
194
  ```ts
197
- import { Agent } from "sarvam-agents-client/compose";
195
+ import { Client } from "sarvam-agents-client";
198
196
 
199
- const agent = new Agent({ name: "support-bot", instructions: "...", webhooks: [
200
- { url: "https://hooks.acme.com/panja", events: ["turn.completed", "turn.failed", "turn.requires_action"],
201
- secretCredential: "acme_webhook" },
202
- ] });
197
+ const client = new Client(config); // config: the Configuration from the Quickstart
198
+ const url = "https://hooks.acme.com/panja";
199
+
200
+ const secret = await client.webhooks.setSecret(deployment.agentId, url); // generates a whsec_ secret and returns it
201
+ // or: await client.webhooks.setSecret(agentId, url, "whsec_...") to store one you made
202
+ await client.webhooks.secretStatus(agentId, url); // "set" or "missing" ("missing" while the deploy placeholder is there)
203
+ const newSecret = await client.webhooks.rotateSecret(agentId, url);
204
+ await client.webhooks.deleteSecret(agentId, url);
203
205
  ```
204
206
 
207
+ Keep the returned secret where your receiver runs: Panja never shows it again. A secret that is not `whsec_` plus
208
+ base64 of 24 to 64 bytes throws `SecretFormatError` before anything is sent. It works as in Python (see the
209
+ [Python README](../python/README.md#webhooks)): today the secret is a Custom API the SDK creates and binds, named
210
+ `webhook-secret:<agentId>:<host>`, with "enabled for chats" always **off**; `deleteSecret` only removes that one; a
211
+ later release moves secrets to a dedicated server store with no change to `client.webhooks`. Nothing logs a secret or
212
+ puts one in an error message.
213
+
214
+ `secretCredential: "acme_webhook"` still works, but is `@deprecated`: it names a Custom API you created and bound
215
+ yourself. To migrate, use `client.webhooks.setSecret` instead of creating a Custom API: call
216
+ `setSecret(agentId, url, currentSecret)`, drop `secretCredential` and deploy, then unbind and delete the old Custom
217
+ API (`unbindCustomApi`, `deleteCustomApi`).
218
+
205
219
  The rules are Python's (see the [Python README](../python/README.md#webhooks)), with the same `UserError` messages,
206
- which name the `agent.json` path (`webhooks.0.secret_credential: ...`). Checks that need the server fail the deploy
220
+ which name the `agent.json` path (`webhooks.0.url: ...`). Checks that need the server fail the deploy
207
221
  (and delete an agent the deploy created) with `UserError`, whose `issues` hold the server's `{ code, path, message }` list; a server without webhooks throws
208
222
  `NotSupportedByServerError` with `features` `["webhooks"]`.
209
223
 
@@ -246,6 +260,105 @@ So return a 5xx (or 429) for a failure you want retried, never a 4xx. Dedupe on
246
260
  API. A complete Express receiver is in
247
261
  [docs/examples/webhooks/express_receiver.ts](../docs/examples/webhooks/express_receiver.ts).
248
262
 
263
+ ## Inbound triggers
264
+
265
+ A trigger lets another system start a turn: GitHub, Slack, a payment provider or your own code POSTs an event to the
266
+ trigger's URL, and the agent runs with a message written from it. The rules, `UserError` messages and `agent.json`
267
+ are Python's (see [docs/compose.md](../docs/compose.md#triggers)); the fields are camelCase here (`promptTemplate`,
268
+ `toolPolicy`, `limits.perHour`). The server needs inbound triggers (panja PR #1758, with its per-trigger secrets)
269
+ switched on (`CLAW_TRIGGERS_ENABLED`).
270
+
271
+ **GitHub issues triage**, one conversation per issue:
272
+
273
+ ```ts
274
+ import { Client } from "sarvam-agents-client";
275
+ import { Agent, Trigger, deploy, keyed } from "sarvam-agents-client/compose";
276
+
277
+ const triage = new Agent({ name: "issue-triage", instructions: "Label and prioritise new GitHub issues.", triggers: [
278
+ Trigger.github({
279
+ name: "github_issues",
280
+ filter: [{ path: "action", op: "in", value: ["opened", "reopened"] }],
281
+ promptTemplate: "A GitHub issue was {{ payload.action }}. Triage the issue in the payload below.",
282
+ session: keyed(["repository.full_name", "issue.number"]),
283
+ toolPolicy: ["github_get_issue", "github_add_labels"],
284
+ }),
285
+ ] });
286
+ const { agentId } = await deploy(triage, { client: config });
287
+
288
+ const triggers = new Client(config).triggers;
289
+ const secret = await triggers.setSecret(agentId, "github_issues"); // a whsec_ secret, shown once: paste it into GitHub
290
+ console.log((await triggers.get(agentId, "github_issues")).url); // GitHub's Payload URL
291
+ ```
292
+
293
+ `agent.json` never holds a trigger's secret. Until `setSecret` runs, a provider trigger refuses every request
294
+ (`secretStatus` is `"missing"`). Pass a secret to bring your own: Slack's signing secret (Slack issues it, so a
295
+ `slack` trigger needs it), the secret you set on GitHub, a sender's `whsec_` secret. A plain object of the `Trigger`
296
+ type works too; the helpers check it as soon as it is built.
297
+
298
+ **Tools are read-only by default.** A trigger's payload is untrusted, so a trigger with no `toolPolicy` gets only the
299
+ agent's read-only tools (a name like `get_*`, `list_*`, `*_search`); a tool that sends, posts, writes or deletes is
300
+ left out, and so is one that reaches an address it is given (a `url`, `host`, `domain` or callback argument, a fetch,
301
+ `dns` or `ping` tool). Name the write tools a trigger needs in `toolPolicy` (glob patterns, or `{ allow: [...] }`), or pass
302
+ `["*"]` (`ToolPolicy.all()`) for every tool, `bash`, `run_program`, `delegate_task` and `agent_test_run` included; a
303
+ partial glob never matches those four.
304
+
305
+ **A bearer trigger from your own system.** The deploy that creates it mints the token and returns it once:
306
+
307
+ ```ts
308
+ const orders = new Agent({ name: "order-care", instructions: "Write to customers about late orders.", triggers: [
309
+ Trigger.bearer({ name: "late_orders", session: keyed("order_id"),
310
+ promptTemplate: "An order is late. Draft a short apology email for the order in the payload." }),
311
+ ] });
312
+ const [token] = (await deploy(orders, { client: config })).triggerTokens ?? []; // none if already minted
313
+ const reply = await fetch(token.url, { method: "POST",
314
+ headers: { Authorization: `Bearer ${token.token}`, "Idempotency-Key": "o1042-late", "Content-Type": "application/json" },
315
+ body: JSON.stringify({ order_id: "o1042", days_late: 3 }) });
316
+ if (!reply.ok) throw new Error(`trigger refused: ${reply.status}`); // 202 { eventId, status: "received", statusUrl }
317
+ ```
318
+
319
+ `token` is not enumerable on a `MintedTriggerToken`, so `console.log` and `JSON.stringify` leave it out; read it by
320
+ name. The generated models hide their secrets the same way (`TriggerToken.token`, `RotatedSecret.token`,
321
+ `RotatedSigningSecret.secret`).
322
+
323
+ **Manage them** with `client.triggers` (owner only; each method takes the agent's id and the trigger's name, a
324
+ `Trigger` or a `TriggerView`):
325
+
326
+ ```ts
327
+ const triggers = new Client(config).triggers;
328
+ for (const t of await triggers.list(agentId)) console.log(t.name, t.url, t.enabled, t.secretStatus, t.tokenPrefix);
329
+ await triggers.rotateSecret(agentId, "github_issues"); // the old one verifies for a day
330
+ await triggers.rotateSecret(agentId, "github_issues", { graceSeconds: 0 }); // after a leak
331
+ const newToken = await triggers.rotateSecret(agentId, "late_orders"); // a bearer trigger: a new token
332
+ await triggers.setSecret(agentId, "slack_events", "<Slack signing secret>");
333
+ await triggers.deleteSecret(agentId, "github_issues");
334
+ for await (const e of triggers.iterEvents(agentId, "github_issues")) console.log(e.id, e.status, e.error);
335
+ const page = await triggers.listEvents(agentId, "github_issues", { limit: 50 }); // nextCursor pages on
336
+ ```
337
+
338
+ Every secret method resolves to the secret (or token) once and never logs it or puts it in an error. A refusal
339
+ throws `UserError` with the server's reason; a `slack` trigger's `setSecret` without a secret, or its `rotateSecret`,
340
+ throws `UserError` (Slack issues the secret); a bearer trigger's `setSecret`/`deleteSecret` throws too.
341
+ `NotSupportedByServerError` means the server has triggers off or predates per-trigger secrets. `triggers.api` (the
342
+ generated `TriggersApi`, by trigger id) has the rest: `getTriggerEvent`, `replayTriggerEvent`, `enableTrigger`,
343
+ `disableTrigger` and `sendTestEvent({ triggerId, triggerTestFireRequest: { payload, dryRun: true } })`.
344
+
345
+ Pausing the agent skips the events that arrive meanwhile (`skipped_agent_unavailable`); `resumeAgent` readmits them,
346
+ in the order they arrived. A trigger whose turns failed 5 times in a row is auto-paused (`pausedReason`
347
+ `auto_paused: ...`); `enableTrigger` or a deploy of a changed agent clears it, and `deploy()` of an unchanged agent
348
+ leaves it. A turn that failed on a model-provider outage (`error` `llm_unavailable`, `PROVIDER_OUTAGE_ERROR`) does not
349
+ count: replay it once the provider is back. Events are kept 7 days. A queued trigger turn always runs as its own turn
350
+ ("send now" answers 409 `TRIGGER_TURN`); its reply stays in its conversation and reaches the agent's webhooks.
351
+
352
+ The senders' `POST /v1/triggers/{id}/fire` is not in the client: it takes the trigger's token or the provider's
353
+ signature, never your service token. A sender gets `202` with the `statusUrl` for a new event; for a duplicate, the first
354
+ event's id (`202` while it is still `received`, then `200` with its `status`); `200` with the event's `status` for a
355
+ filtered event, or one skipped because the agent is paused; `429` over a rate limit;
356
+ `413` for a body over the trigger's limit; `503` (`Retry-After: 30`) for a server outage; and `404` for anything
357
+ refused before the token or signature is verified (an unknown or disabled trigger, a bad token or signature, no secret
358
+ set yet), so a stranger cannot tell which trigger ids exist. A bearer sender's `Idempotency-Key` header (1 to 255
359
+ characters) makes a retry the same event for 7 days; without one, only an identical body inside the same 5-minute
360
+ window is merged, so a sender that posts a fixed body fires each time.
361
+
249
362
  ## Errors
250
363
 
251
364
  If an ID passed as a path parameter is empty, `.` or `..`, the SDK throws `InvalidPathParameterError` before
@@ -73,12 +73,12 @@ export declare class AgentConversationsApi extends runtime.BaseAPI {
73
73
  */
74
74
  listAgentConversationMessages(requestParameters: ListAgentConversationMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessagesResponse>;
75
75
  /**
76
- * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first. ``sessionType`` is repeatable (``api``, ``chat``, ``slack``, ``teams``, ``all``) and the values add up.
76
+ * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first. ``sessionType`` is repeatable (``api``, ``chat``, ``playground``, ``trigger``, ``slack``, ``teams``, ``all``) and the values add up; ``trigger`` (included in ``all``) is the conversations an inbound trigger started.
77
77
  * List Agent Conversations Route
78
78
  */
79
79
  listAgentConversationsRaw(requestParameters: ListAgentConversationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PageAgentConversationView>>;
80
80
  /**
81
- * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first. ``sessionType`` is repeatable (``api``, ``chat``, ``slack``, ``teams``, ``all``) and the values add up.
81
+ * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first. ``sessionType`` is repeatable (``api``, ``chat``, ``playground``, ``trigger``, ``slack``, ``teams``, ``all``) and the values add up; ``trigger`` (included in ``all``) is the conversations an inbound trigger started.
82
82
  * List Agent Conversations Route
83
83
  */
84
84
  listAgentConversations(requestParameters: ListAgentConversationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PageAgentConversationView>;
@@ -97,6 +97,8 @@ export type AgentConversationArtifactDownloadUrlDispositionEnum = typeof AgentCo
97
97
  export declare const GetAgentConversationSessionTypeEnum: {
98
98
  readonly Api: "api";
99
99
  readonly Chat: "chat";
100
+ readonly Playground: "playground";
101
+ readonly Trigger: "trigger";
100
102
  readonly Slack: "slack";
101
103
  readonly Teams: "teams";
102
104
  readonly All: "all";
@@ -108,6 +110,8 @@ export type GetAgentConversationSessionTypeEnum = typeof GetAgentConversationSes
108
110
  export declare const ListAgentConversationMessagesSessionTypeEnum: {
109
111
  readonly Api: "api";
110
112
  readonly Chat: "chat";
113
+ readonly Playground: "playground";
114
+ readonly Trigger: "trigger";
111
115
  readonly Slack: "slack";
112
116
  readonly Teams: "teams";
113
117
  readonly All: "all";
@@ -119,6 +123,8 @@ export type ListAgentConversationMessagesSessionTypeEnum = typeof ListAgentConve
119
123
  export declare const ListAgentConversationsSessionTypeEnum: {
120
124
  readonly Api: "api";
121
125
  readonly Chat: "chat";
126
+ readonly Playground: "playground";
127
+ readonly Trigger: "trigger";
122
128
  readonly Slack: "slack";
123
129
  readonly Teams: "teams";
124
130
  readonly All: "all";
@@ -153,7 +153,7 @@ class AgentConversationsApi extends runtime.BaseAPI {
153
153
  return await response.value();
154
154
  }
155
155
  /**
156
- * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first. ``sessionType`` is repeatable (``api``, ``chat``, ``slack``, ``teams``, ``all``) and the values add up.
156
+ * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first. ``sessionType`` is repeatable (``api``, ``chat``, ``playground``, ``trigger``, ``slack``, ``teams``, ``all``) and the values add up; ``trigger`` (included in ``all``) is the conversations an inbound trigger started.
157
157
  * List Agent Conversations Route
158
158
  */
159
159
  async listAgentConversationsRaw(requestParameters, initOverrides) {
@@ -193,7 +193,7 @@ class AgentConversationsApi extends runtime.BaseAPI {
193
193
  return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.PageAgentConversationViewFromJSON)(jsonValue));
194
194
  }
195
195
  /**
196
- * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first. ``sessionType`` is repeatable (``api``, ``chat``, ``slack``, ``teams``, ``all``) and the values add up.
196
+ * The agent owner\'s session log: conversations every user in the tenant has had with this agent on the selected surface, newest-active first. ``sessionType`` is repeatable (``api``, ``chat``, ``playground``, ``trigger``, ``slack``, ``teams``, ``all``) and the values add up; ``trigger`` (included in ``all``) is the conversations an inbound trigger started.
197
197
  * List Agent Conversations Route
198
198
  */
199
199
  async listAgentConversations(requestParameters, initOverrides) {
@@ -215,6 +215,8 @@ exports.AgentConversationArtifactDownloadUrlDispositionEnum = {
215
215
  exports.GetAgentConversationSessionTypeEnum = {
216
216
  Api: 'api',
217
217
  Chat: 'chat',
218
+ Playground: 'playground',
219
+ Trigger: 'trigger',
218
220
  Slack: 'slack',
219
221
  Teams: 'teams',
220
222
  All: 'all'
@@ -225,6 +227,8 @@ exports.GetAgentConversationSessionTypeEnum = {
225
227
  exports.ListAgentConversationMessagesSessionTypeEnum = {
226
228
  Api: 'api',
227
229
  Chat: 'chat',
230
+ Playground: 'playground',
231
+ Trigger: 'trigger',
228
232
  Slack: 'slack',
229
233
  Teams: 'teams',
230
234
  All: 'all'
@@ -235,6 +239,8 @@ exports.ListAgentConversationMessagesSessionTypeEnum = {
235
239
  exports.ListAgentConversationsSessionTypeEnum = {
236
240
  Api: 'api',
237
241
  Chat: 'chat',
242
+ Playground: 'playground',
243
+ Trigger: 'trigger',
238
244
  Slack: 'slack',
239
245
  Teams: 'teams',
240
246
  All: 'all'
@@ -213,12 +213,12 @@ export declare class AgentsApi extends runtime.BaseAPI {
213
213
  */
214
214
  createAgent(requestParameters: CreateAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
215
215
  /**
216
- * Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it.
216
+ * Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it. Once the gateway confirms the delete, the agent\'s inbound triggers are retired (only with ``CLAW_TRIGGERS_ENABLED`` on); that cleanup never fails the delete.
217
217
  * Delete Agent
218
218
  */
219
219
  deleteAgentRaw(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
220
220
  /**
221
- * Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it.
221
+ * Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it. Once the gateway confirms the delete, the agent\'s inbound triggers are retired (only with ``CLAW_TRIGGERS_ENABLED`` on); that cleanup never fails the delete.
222
222
  * Delete Agent
223
223
  */
224
224
  deleteAgent(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -233,12 +233,12 @@ export declare class AgentsApi extends runtime.BaseAPI {
233
233
  */
234
234
  deleteVersion(requestParameters: DeleteVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
235
235
  /**
236
- * Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change.
236
+ * Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change. With inbound triggers on, it then makes the agent\'s ``triggers`` rows match the live version\'s ``agent.json``, and returns the bearer token of each trigger minted by this call in ``triggerTokens`` (once; a repeat deploy returns none for a trigger that already has one). That response carries secrets: it is marked ``Cache-Control: no-store``, this route does no request or response body logging, and the tokens are never logged or put on a span. A reconcile failure leaves the deploy done and answers 502; deploying again finishes the reconcile.
237
237
  * Deploy Agent
238
238
  */
239
239
  deployAgentRaw(requestParameters: DeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>>;
240
240
  /**
241
- * Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change.
241
+ * Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change. With inbound triggers on, it then makes the agent\'s ``triggers`` rows match the live version\'s ``agent.json``, and returns the bearer token of each trigger minted by this call in ``triggerTokens`` (once; a repeat deploy returns none for a trigger that already has one). That response carries secrets: it is marked ``Cache-Control: no-store``, this route does no request or response body logging, and the tokens are never logged or put on a span. A reconcile failure leaves the deploy done and answers 502; deploying again finishes the reconcile.
242
242
  * Deploy Agent
243
243
  */
244
244
  deployAgent(requestParameters: DeployAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
@@ -433,12 +433,12 @@ export declare class AgentsApi extends runtime.BaseAPI {
433
433
  */
434
434
  putInstructions(requestParameters: PutInstructionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InstructionsResponse>;
435
435
  /**
436
- * Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise.
436
+ * Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise. With inbound triggers on, the events its triggers received while it was paused (``skipped_agent_unavailable``, payload kept) go back to the inbox and start in received order. A failure there is logged and leaves the resume done: those events stay replayable one by one.
437
437
  * Resume Agent
438
438
  */
439
439
  resumeAgentRaw(requestParameters: ResumeAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentResource>>;
440
440
  /**
441
- * Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise.
441
+ * Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise. With inbound triggers on, the events its triggers received while it was paused (``skipped_agent_unavailable``, payload kept) go back to the inbox and start in received order. A failure there is logged and leaves the resume done: those events stay replayable one by one.
442
442
  * Resume Agent
443
443
  */
444
444
  resumeAgent(requestParameters: ResumeAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentResource>;
@@ -214,7 +214,7 @@ class AgentsApi extends runtime.BaseAPI {
214
214
  return await response.value();
215
215
  }
216
216
  /**
217
- * Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it.
217
+ * Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it. Once the gateway confirms the delete, the agent\'s inbound triggers are retired (only with ``CLAW_TRIGGERS_ENABLED`` on); that cleanup never fails the delete.
218
218
  * Delete Agent
219
219
  */
220
220
  async deleteAgentRaw(requestParameters, initOverrides) {
@@ -239,7 +239,7 @@ class AgentsApi extends runtime.BaseAPI {
239
239
  return new runtime.VoidApiResponse(response);
240
240
  }
241
241
  /**
242
- * Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it.
242
+ * Owner-only soft delete. The managed state lives on the agent row, so a deleted agent stops being a managed agent with it. Once the gateway confirms the delete, the agent\'s inbound triggers are retired (only with ``CLAW_TRIGGERS_ENABLED`` on); that cleanup never fails the delete.
243
243
  * Delete Agent
244
244
  */
245
245
  async deleteAgent(requestParameters, initOverrides) {
@@ -281,7 +281,7 @@ class AgentsApi extends runtime.BaseAPI {
281
281
  await this.deleteVersionRaw(requestParameters, initOverrides);
282
282
  }
283
283
  /**
284
- * Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change.
284
+ * Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change. With inbound triggers on, it then makes the agent\'s ``triggers`` rows match the live version\'s ``agent.json``, and returns the bearer token of each trigger minted by this call in ``triggerTokens`` (once; a repeat deploy returns none for a trigger that already has one). That response carries secrets: it is marked ``Cache-Control: no-store``, this route does no request or response body logging, and the tokens are never logged or put on a span. A reconcile failure leaves the deploy done and answers 502; deploying again finishes the reconcile.
285
285
  * Deploy Agent
286
286
  */
287
287
  async deployAgentRaw(requestParameters, initOverrides) {
@@ -308,7 +308,7 @@ class AgentsApi extends runtime.BaseAPI {
308
308
  return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentResourceFromJSON)(jsonValue));
309
309
  }
310
310
  /**
311
- * Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change.
311
+ * Make a saved version what end users get, on every surface. With ``version``, that version goes live (newer or older: a rollback is a deploy of an older one); 409 ``MISSING_DEPENDENCIES`` names anything it uses that was deleted. Without a body, the newest saved version goes live (idempotent), as before versions. The UI labels this *Publish*; the API noun is ``deploy`` because ``/publish`` already means widening the agent\'s audience (scope), which deploying does not change. With inbound triggers on, it then makes the agent\'s ``triggers`` rows match the live version\'s ``agent.json``, and returns the bearer token of each trigger minted by this call in ``triggerTokens`` (once; a repeat deploy returns none for a trigger that already has one). That response carries secrets: it is marked ``Cache-Control: no-store``, this route does no request or response body logging, and the tokens are never logged or put on a span. A reconcile failure leaves the deploy done and answers 502; deploying again finishes the reconcile.
312
312
  * Deploy Agent
313
313
  */
314
314
  async deployAgent(requestParameters, initOverrides) {
@@ -1047,7 +1047,7 @@ class AgentsApi extends runtime.BaseAPI {
1047
1047
  return await response.value();
1048
1048
  }
1049
1049
  /**
1050
- * Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise.
1050
+ * Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise. With inbound triggers on, the events its triggers received while it was paused (``skipped_agent_unavailable``, payload kept) go back to the inbox and start in received order. A failure there is logged and leaves the resume done: those events stay replayable one by one.
1051
1051
  * Resume Agent
1052
1052
  */
1053
1053
  async resumeAgentRaw(requestParameters, initOverrides) {
@@ -1072,7 +1072,7 @@ class AgentsApi extends runtime.BaseAPI {
1072
1072
  return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.AgentResourceFromJSON)(jsonValue));
1073
1073
  }
1074
1074
  /**
1075
- * Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise.
1075
+ * Bring the paused version back live; 409 ``NOT_PAUSED`` otherwise. With inbound triggers on, the events its triggers received while it was paused (``skipped_agent_unavailable``, payload kept) go back to the inbox and start in received order. A failure there is logged and leaves the resume done: those events stay replayable one by one.
1076
1076
  * Resume Agent
1077
1077
  */
1078
1078
  async resumeAgent(requestParameters, initOverrides) {
@@ -23,10 +23,12 @@ export interface GetConversationRequest {
23
23
  conversationId: string;
24
24
  xClientPlatform?: string | null;
25
25
  xClientVersion?: string | null;
26
+ xClientFeatures?: string | null;
26
27
  }
27
28
  export interface GetResponseRequest {
28
29
  conversationId: string;
29
30
  responseId: string;
31
+ xClientFeatures?: string | null;
30
32
  }
31
33
  export interface ListConversationsRequest {
32
34
  limit?: number;
@@ -54,12 +56,12 @@ export interface UpdateConversationRequest {
54
56
  */
55
57
  export declare class ConversationsApi extends runtime.BaseAPI {
56
58
  /**
57
- * ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin`` nothing is checked here — the gateway enforces agent visibility at ingest, as it always has.
59
+ * ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin`` nothing is checked here — the gateway enforces agent visibility at ingest, as it always has. A conversation created with ``X-Panja-Surface: playground`` (an agent\'s Playground) is saved as session type ``playground``: hidden from the default inbox and listed apart from real chats in the agent\'s session log. Never gated, so drafts work (``services.session_types``).
58
60
  * Create Conversation Route
59
61
  */
60
62
  createConversationRaw(requestParameters: CreateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ConversationView>>;
61
63
  /**
62
- * ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin`` nothing is checked here — the gateway enforces agent visibility at ingest, as it always has.
64
+ * ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin`` nothing is checked here — the gateway enforces agent visibility at ingest, as it always has. A conversation created with ``X-Panja-Surface: playground`` (an agent\'s Playground) is saved as session type ``playground``: hidden from the default inbox and listed apart from real chats in the agent\'s session log. Never gated, so drafts work (``services.session_types``).
63
65
  * Create Conversation Route
64
66
  */
65
67
  createConversation(requestParameters: CreateConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConversationView>;
@@ -155,6 +157,8 @@ export declare const ListConversationsSessionTypeEnum: {
155
157
  readonly Chat: "chat";
156
158
  readonly Build: "build";
157
159
  readonly Api: "api";
160
+ readonly Playground: "playground";
161
+ readonly Trigger: "trigger";
158
162
  readonly All: "all";
159
163
  };
160
164
  export type ListConversationsSessionTypeEnum = typeof ListConversationsSessionTypeEnum[keyof typeof ListConversationsSessionTypeEnum];
@@ -21,7 +21,7 @@ const index_js_1 = require("../models/index.js");
21
21
  */
22
22
  class ConversationsApi extends runtime.BaseAPI {
23
23
  /**
24
- * ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin`` nothing is checked here — the gateway enforces agent visibility at ingest, as it always has.
24
+ * ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin`` nothing is checked here — the gateway enforces agent visibility at ingest, as it always has. A conversation created with ``X-Panja-Surface: playground`` (an agent\'s Playground) is saved as session type ``playground``: hidden from the default inbox and listed apart from real chats in the agent\'s session log. Never gated, so drafts work (``services.session_types``).
25
25
  * Create Conversation Route
26
26
  */
27
27
  async createConversationRaw(requestParameters, initOverrides) {
@@ -54,7 +54,7 @@ class ConversationsApi extends runtime.BaseAPI {
54
54
  return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_js_1.ConversationViewFromJSON)(jsonValue));
55
55
  }
56
56
  /**
57
- * ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin`` nothing is checked here — the gateway enforces agent visibility at ingest, as it always has.
57
+ * ``origin=managed_agents`` creates the conversation as session type ``api`` (a managed-agent API session, hidden from the default inbox). It requires ``agentId``: a managed-agent session is always about one agent, and the session log lists it by that id. The agent must be visible to the caller (else 404, existence hidden like every other agent read) and a deployed managed agent (else 409 ``AGENT_NOT_DEPLOYED``). Without ``origin`` nothing is checked here — the gateway enforces agent visibility at ingest, as it always has. A conversation created with ``X-Panja-Surface: playground`` (an agent\'s Playground) is saved as session type ``playground``: hidden from the default inbox and listed apart from real chats in the agent\'s session log. Never gated, so drafts work (``services.session_types``).
58
58
  * Create Conversation Route
59
59
  */
60
60
  async createConversation(requestParameters, initOverrides) {
@@ -106,6 +106,9 @@ class ConversationsApi extends runtime.BaseAPI {
106
106
  if (requestParameters['xClientVersion'] != null) {
107
107
  headerParameters['X-Client-Version'] = String(requestParameters['xClientVersion']);
108
108
  }
109
+ if (requestParameters['xClientFeatures'] != null) {
110
+ headerParameters['X-Client-Features'] = String(requestParameters['xClientFeatures']);
111
+ }
109
112
  if (this.configuration && this.configuration.accessToken) {
110
113
  const token = this.configuration.accessToken;
111
114
  const tokenString = await token("bearerAuth", []);
@@ -141,6 +144,9 @@ class ConversationsApi extends runtime.BaseAPI {
141
144
  }
142
145
  const queryParameters = {};
143
146
  const headerParameters = {};
147
+ if (requestParameters['xClientFeatures'] != null) {
148
+ headerParameters['X-Client-Features'] = String(requestParameters['xClientFeatures']);
149
+ }
144
150
  if (this.configuration && this.configuration.accessToken) {
145
151
  const token = this.configuration.accessToken;
146
152
  const tokenString = await token("bearerAuth", []);
@@ -366,5 +372,7 @@ exports.ListConversationsSessionTypeEnum = {
366
372
  Chat: 'chat',
367
373
  Build: 'build',
368
374
  Api: 'api',
375
+ Playground: 'playground',
376
+ Trigger: 'trigger',
369
377
  All: 'all'
370
378
  };
@@ -30,6 +30,7 @@ export interface ListMessagesRequest {
30
30
  delegationId?: string | null;
31
31
  before?: string | null;
32
32
  turnLimit?: number | null;
33
+ xClientFeatures?: string | null;
33
34
  }
34
35
  /**
35
36
  *
@@ -147,6 +147,9 @@ class MessagesApi extends runtime.BaseAPI {
147
147
  queryParameters['turnLimit'] = requestParameters['turnLimit'];
148
148
  }
149
149
  const headerParameters = {};
150
+ if (requestParameters['xClientFeatures'] != null) {
151
+ headerParameters['X-Client-Features'] = String(requestParameters['xClientFeatures']);
152
+ }
150
153
  if (this.configuration && this.configuration.accessToken) {
151
154
  const token = this.configuration.accessToken;
152
155
  const tokenString = await token("bearerAuth", []);