@aionixone/client-agent 0.0.0-stage → 0.3.0-beta.3

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 (44) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +11 -0
  3. package/README.md +42 -2
  4. package/dist/generated/catalog.d.ts +859 -0
  5. package/dist/generated/catalog.d.ts.map +1 -0
  6. package/dist/generated/catalog.js +855 -0
  7. package/dist/generated/catalog.js.map +1 -0
  8. package/dist/generated/index.d.ts +6 -0
  9. package/dist/generated/index.d.ts.map +1 -0
  10. package/dist/generated/index.js +7 -0
  11. package/dist/generated/index.js.map +1 -0
  12. package/dist/generated/schema_types.d.ts +133 -0
  13. package/dist/generated/schema_types.d.ts.map +1 -0
  14. package/dist/generated/schema_types.js +3 -0
  15. package/dist/generated/schema_types.js.map +1 -0
  16. package/dist/generated/service.d.ts +916 -0
  17. package/dist/generated/service.d.ts.map +1 -0
  18. package/dist/generated/service.js +1170 -0
  19. package/dist/generated/service.js.map +1 -0
  20. package/dist/generated/trn.d.ts +98 -0
  21. package/dist/generated/trn.d.ts.map +1 -0
  22. package/dist/generated/trn.js +359 -0
  23. package/dist/generated/trn.js.map +1 -0
  24. package/dist/generated/types.d.ts +427 -0
  25. package/dist/generated/types.d.ts.map +1 -0
  26. package/dist/generated/types.js +3 -0
  27. package/dist/generated/types.js.map +1 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +2 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/session.d.ts +25 -0
  33. package/dist/session.d.ts.map +1 -0
  34. package/dist/session.js +67 -0
  35. package/dist/session.js.map +1 -0
  36. package/package.json +34 -4
  37. package/src/generated/catalog.ts +858 -0
  38. package/src/generated/index.ts +7 -0
  39. package/src/generated/schema_types.ts +134 -0
  40. package/src/generated/service.ts +1240 -0
  41. package/src/generated/trn.ts +517 -0
  42. package/src/generated/types.ts +500 -0
  43. package/src/index.ts +1 -0
  44. package/src/session.ts +124 -0
@@ -0,0 +1,1170 @@
1
+ // @generated by xtask ts-client-export; DO NOT EDIT
2
+ import { encodePathParam, withQuery } from '@aionixone/client-core';
3
+ import { OPERATIONS } from './catalog.js';
4
+ /** The `agent` service. */
5
+ export class AgentService {
6
+ mcpEndpoint;
7
+ profile;
8
+ prompt;
9
+ session;
10
+ skill;
11
+ thread;
12
+ turn;
13
+ /** Not part of the public API: `AionixOne` constructs every service. */
14
+ constructor(engine) {
15
+ this.mcpEndpoint = new AgentMcpEndpointResource(engine);
16
+ this.profile = new AgentProfileResource(engine);
17
+ this.prompt = new AgentPromptResource(engine);
18
+ this.session = new AgentSessionResource(engine);
19
+ this.skill = new AgentSkillResource(engine);
20
+ this.thread = new AgentThreadResource(engine);
21
+ this.turn = new AgentTurnResource(engine);
22
+ }
23
+ }
24
+ /** The `mcpEndpoint` operations of the `agent` service. */
25
+ export class AgentMcpEndpointResource {
26
+ #engine;
27
+ /** Not part of the public API. */
28
+ constructor(engine) {
29
+ this.#engine = engine;
30
+ }
31
+ /**
32
+ * List MCP endpoint access requirements
33
+ *
34
+ * List the permissions an MCP endpoint's runtime identity needs
35
+ *
36
+ * List the permissions an MCP endpoint's runtime identity needs, calculated from the saved endpoint or unsaved content.
37
+ *
38
+ * Replay: has no effect; retried after an attempt with an unknown result.
39
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_McpEndpointNotFound`.
40
+ *
41
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
42
+ * @param body The request body.
43
+ * @param options Call options.
44
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
45
+ */
46
+ accessRequirementList(trn, body, options) {
47
+ return this.#engine.call(OPERATIONS.agent_mcp_endpoint_access_requirement_list, { path: `/mcp-endpoints/${encodePathParam(trn)}/access-requirements`, body, primaryResourceTrn: trn }, options);
48
+ }
49
+ /**
50
+ * List MCP endpoints
51
+ *
52
+ * List declarative agent MCP endpoints with optional tag filters and pagination.
53
+ *
54
+ * Replay: has no effect; retried after an attempt with an unknown result.
55
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`.
56
+ *
57
+ * @param query The query, by wire names.
58
+ * @param options Call options.
59
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
60
+ */
61
+ list(query, options) {
62
+ return this.#engine.call(OPERATIONS.agent_mcp_endpoint_list, { path: withQuery(`/mcp-endpoints`, query) }, options);
63
+ }
64
+ /**
65
+ * Every item of `agent.mcp-endpoint.list`, page after page, starting from `query`.
66
+ * Each page is one call with its own time budget and retries.
67
+ *
68
+ * @param query The query of the first page; `limit` is the size of every page.
69
+ * @param options Call options of every page.
70
+ */
71
+ async *listIter(query, options) {
72
+ let offset = query?.offset ?? 0;
73
+ for (;;) {
74
+ const response = await this.list({ ...query, offset }, options);
75
+ const page = response;
76
+ yield* page.items;
77
+ if (!page.hasMore)
78
+ return;
79
+ offset += page.items.length;
80
+ }
81
+ }
82
+ /**
83
+ * Read MCP endpoint
84
+ *
85
+ * Get MCP endpoint
86
+ *
87
+ * Read one declarative MCP endpoint by TRN, including its tools and runtime ServiceAccount.
88
+ *
89
+ * Replay: has no effect; retried after an attempt with an unknown result.
90
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_McpEndpointNotFound`.
91
+ *
92
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
93
+ * @param options Call options.
94
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
95
+ */
96
+ read(trn, options) {
97
+ return this.#engine.call(OPERATIONS.agent_mcp_endpoint_read, { path: `/mcp-endpoints/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
98
+ }
99
+ }
100
+ /** The `profile` operations of the `agent` service. */
101
+ export class AgentProfileResource {
102
+ #engine;
103
+ /** Not part of the public API. */
104
+ constructor(engine) {
105
+ this.#engine = engine;
106
+ }
107
+ /**
108
+ * List agent profile access requirements
109
+ *
110
+ * List the permissions an agent profile's runtime identity needs
111
+ *
112
+ * List the permissions an agent profile's runtime identity needs, calculated from the saved profile or unsaved content.
113
+ *
114
+ * Replay: has no effect; retried after an attempt with an unknown result.
115
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_ProfileNotFound`.
116
+ *
117
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
118
+ * @param body The request body.
119
+ * @param options Call options.
120
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
121
+ */
122
+ accessRequirementList(trn, body, options) {
123
+ return this.#engine.call(OPERATIONS.agent_profile_access_requirement_list, { path: `/profiles/${encodePathParam(trn)}/access-requirements`, body, primaryResourceTrn: trn }, options);
124
+ }
125
+ /**
126
+ * Resolve Profile context budgets
127
+ *
128
+ * Resolve context budgets for a Profile draft
129
+ *
130
+ * Replay: has no effect; retried after an attempt with an unknown result.
131
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`.
132
+ *
133
+ * @param body The request body.
134
+ * @param options Call options.
135
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
136
+ */
137
+ contextBudgetResolve(body, options) {
138
+ return this.#engine.call(OPERATIONS.agent_profile_context_budget_resolve, { path: `/profiles:context-budget-resolve`, body }, options);
139
+ }
140
+ /**
141
+ * Invoke Profile
142
+ *
143
+ * Invoke an Agent Profile
144
+ *
145
+ * Submit a Turn to a Profile, optionally continuing an existing Thread.
146
+ *
147
+ * Replay: the idempotency key replays the accepted execution for 604800 seconds.
148
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_ThreadNotFound`, `Agent_ProfileNotFound`, `Agent_PromptNotFound`, `Agent_SkillNotFound`, `Agent_VersionNotFound`, `Internal_IdempotencyKeyReused`, `Internal_Conflict`.
149
+ *
150
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
151
+ * @param body The request body.
152
+ * @param options Call options.
153
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
154
+ */
155
+ invoke(trn, body, options) {
156
+ return this.#engine.call(OPERATIONS.agent_profile_invoke, { path: `/profiles/${encodePathParam(trn)}/invoke`, body, primaryResourceTrn: trn }, options);
157
+ }
158
+ /**
159
+ * List agent profiles
160
+ *
161
+ * List runtime-ready agent profiles with optional tag filters and pagination.
162
+ *
163
+ * Replay: has no effect; retried after an attempt with an unknown result.
164
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`.
165
+ *
166
+ * @param query The query, by wire names.
167
+ * @param options Call options.
168
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
169
+ */
170
+ list(query, options) {
171
+ return this.#engine.call(OPERATIONS.agent_profile_list, { path: withQuery(`/profiles`, query) }, options);
172
+ }
173
+ /**
174
+ * Every item of `agent.profile.list`, page after page, starting from `query`.
175
+ * Each page is one call with its own time budget and retries.
176
+ *
177
+ * @param query The query of the first page; `limit` is the size of every page.
178
+ * @param options Call options of every page.
179
+ */
180
+ async *listIter(query, options) {
181
+ let offset = query?.offset ?? 0;
182
+ for (;;) {
183
+ const response = await this.list({ ...query, offset }, options);
184
+ const page = response;
185
+ yield* page.items;
186
+ if (!page.hasMore)
187
+ return;
188
+ offset += page.items.length;
189
+ }
190
+ }
191
+ /**
192
+ * Read agent profile
193
+ *
194
+ * Get agent profile
195
+ *
196
+ * Read one agent profile resource by TRN, including language model, prompt, skills, tools, and runtime policy.
197
+ *
198
+ * Replay: has no effect; retried after an attempt with an unknown result.
199
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`.
200
+ *
201
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
202
+ * @param options Call options.
203
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
204
+ */
205
+ read(trn, options) {
206
+ return this.#engine.call(OPERATIONS.agent_profile_read, { path: `/profiles/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
207
+ }
208
+ /**
209
+ * List per-Agent statistics
210
+ *
211
+ * One row per Agent Profile with a Turn that ended in the window: outcomes, tokens and estimated cost.
212
+ *
213
+ * Replay: has no effect; retried after an attempt with an unknown result.
214
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`, `Agent_StatisticsWindowRejected`, `Agent_QueryDeadlineExceeded`.
215
+ *
216
+ * @param query The query, by wire names.
217
+ * @param options Call options.
218
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
219
+ */
220
+ statisticsList(query, options) {
221
+ return this.#engine.call(OPERATIONS.agent_profile_statistics_list, { path: withQuery(`/profiles:statistics`, query) }, options);
222
+ }
223
+ /**
224
+ * Every item of `agent.profile.statistics_list`, page after page, starting from `query`.
225
+ * Each page is one call with its own time budget and retries.
226
+ *
227
+ * @param query The query of the first page; `limit` is the size of every page.
228
+ * @param options Call options of every page.
229
+ */
230
+ async *statisticsListIter(query, options) {
231
+ let offset = query?.offset ?? 0;
232
+ for (;;) {
233
+ const response = await this.statisticsList({ ...query, offset }, options);
234
+ const page = response;
235
+ yield* page.items;
236
+ if (!page.hasMore)
237
+ return;
238
+ offset += page.items.length;
239
+ }
240
+ }
241
+ /**
242
+ * Summarize one Agent over a window
243
+ *
244
+ * The figures of one Agent Profile, with a comparison of its Profile versions.
245
+ *
246
+ * Replay: has no effect; retried after an attempt with an unknown result.
247
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`, `Agent_StatisticsWindowRejected`, `Agent_QueryDeadlineExceeded`.
248
+ *
249
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
250
+ * @param query The query, by wire names.
251
+ * @param options Call options.
252
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
253
+ */
254
+ statisticsRead(trn, query, options) {
255
+ return this.#engine.call(OPERATIONS.agent_profile_statistics_read, { path: withQuery(`/profiles/${encodePathParam(trn)}/statistics`, query), primaryResourceTrn: trn }, options);
256
+ }
257
+ /**
258
+ * Read Thread creation requirements
259
+ *
260
+ * Get new Thread creation requirements for an Agent Profile
261
+ *
262
+ * Read the workspace requirements for creating a new Thread under one Agent Profile.
263
+ *
264
+ * Replay: has no effect; retried after an attempt with an unknown result.
265
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`.
266
+ *
267
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
268
+ * @param options Call options.
269
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
270
+ */
271
+ threadCreationRequirementRead(trn, options) {
272
+ return this.#engine.call(OPERATIONS.agent_profile_thread_creation_requirement_read, { path: `/profiles/${encodePathParam(trn)}/thread-creation-requirements`, primaryResourceTrn: trn }, options);
273
+ }
274
+ /**
275
+ * Summarize tool calls for one Agent
276
+ *
277
+ * Tool outcomes in the selected window, queried on demand. At most 50 groups, by tool, operation and resource; a truncated list cannot provide a global failure rate.
278
+ *
279
+ * Replay: has no effect; retried after an attempt with an unknown result.
280
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`, `Agent_StatisticsWindowRejected`, `Agent_QueryDeadlineExceeded`.
281
+ *
282
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
283
+ * @param query The query, by wire names.
284
+ * @param options Call options.
285
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
286
+ */
287
+ toolStatisticsRead(trn, query, options) {
288
+ return this.#engine.call(OPERATIONS.agent_profile_tool_statistics_read, { path: withQuery(`/profiles/${encodePathParam(trn)}/tool-statistics`, query), primaryResourceTrn: trn }, options);
289
+ }
290
+ /**
291
+ * Delete agent profile version
292
+ *
293
+ * Delete one Agent profile version that is not current; make another version current first to delete the current one.
294
+ *
295
+ * Replay: not declared; an attempt with an unknown result is not retried.
296
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`, `Agent_VersionNotFound`, `Declarative_RemovalBlocked`, `Internal_Conflict`.
297
+ *
298
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
299
+ * @param options Call options.
300
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
301
+ */
302
+ versionDelete(trn, options) {
303
+ return this.#engine.call(OPERATIONS.agent_profile_version_delete, { path: `/profiles/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
304
+ }
305
+ /**
306
+ * List agent profile versions
307
+ *
308
+ * List the versions of one Agent profile.
309
+ *
310
+ * Replay: has no effect; retried after an attempt with an unknown result.
311
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`.
312
+ *
313
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
314
+ * @param query The query, by wire names.
315
+ * @param options Call options.
316
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
317
+ */
318
+ versionList(trn, query, options) {
319
+ return this.#engine.call(OPERATIONS.agent_profile_version_list, { path: withQuery(`/profiles/${encodePathParam(trn)}/versions`, query), primaryResourceTrn: trn }, options);
320
+ }
321
+ /**
322
+ * Every item of `agent.profile.version_list`, page after page, starting from `query`.
323
+ * Each page is one call with its own time budget and retries.
324
+ *
325
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
326
+ * @param query The query of the first page; `limit` is the size of every page.
327
+ * @param options Call options of every page.
328
+ */
329
+ async *versionListIter(trn, query, options) {
330
+ let offset = query?.offset ?? 0;
331
+ for (;;) {
332
+ const response = await this.versionList(trn, { ...query, offset }, options);
333
+ const page = response;
334
+ yield* page.items;
335
+ if (!page.hasMore)
336
+ return;
337
+ offset += page.items.length;
338
+ }
339
+ }
340
+ /**
341
+ * Read agent profile version
342
+ *
343
+ * Get agent profile version
344
+ *
345
+ * Read one Agent profile version and its spec by exact version TRN.
346
+ *
347
+ * Replay: has no effect; retried after an attempt with an unknown result.
348
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`, `Agent_VersionNotFound`.
349
+ *
350
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
351
+ * @param options Call options.
352
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
353
+ */
354
+ versionRead(trn, options) {
355
+ return this.#engine.call(OPERATIONS.agent_profile_version_read, { path: `/profiles/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
356
+ }
357
+ /**
358
+ * Set the current agent profile version
359
+ *
360
+ * Point a Agent profile at one of its versions; new operations use it from now on.
361
+ *
362
+ * Replay: not idempotent; an attempt answered with `Agent_ProfileNotFound`, `Agent_VersionNotFound` did not run.
363
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`, `Agent_VersionNotFound`, `Internal_Conflict`.
364
+ *
365
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
366
+ * @param options Call options.
367
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
368
+ */
369
+ versionSetCurrent(trn, options) {
370
+ return this.#engine.call(OPERATIONS.agent_profile_version_set_current, { path: `/profiles/${encodePathParam(trn)}/version/set-current`, primaryResourceTrn: trn }, options);
371
+ }
372
+ }
373
+ /** The `prompt` operations of the `agent` service. */
374
+ export class AgentPromptResource {
375
+ #engine;
376
+ /** Not part of the public API. */
377
+ constructor(engine) {
378
+ this.#engine = engine;
379
+ }
380
+ /**
381
+ * List prompts
382
+ *
383
+ * List declarative prompt resources with optional tag filters and pagination.
384
+ *
385
+ * Replay: has no effect; retried after an attempt with an unknown result.
386
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`.
387
+ *
388
+ * @param query The query, by wire names.
389
+ * @param options Call options.
390
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
391
+ */
392
+ list(query, options) {
393
+ return this.#engine.call(OPERATIONS.agent_prompt_list, { path: withQuery(`/prompts`, query) }, options);
394
+ }
395
+ /**
396
+ * Every item of `agent.prompt.list`, page after page, starting from `query`.
397
+ * Each page is one call with its own time budget and retries.
398
+ *
399
+ * @param query The query of the first page; `limit` is the size of every page.
400
+ * @param options Call options of every page.
401
+ */
402
+ async *listIter(query, options) {
403
+ let offset = query?.offset ?? 0;
404
+ for (;;) {
405
+ const response = await this.list({ ...query, offset }, options);
406
+ const page = response;
407
+ yield* page.items;
408
+ if (!page.hasMore)
409
+ return;
410
+ offset += page.items.length;
411
+ }
412
+ }
413
+ /**
414
+ * Get prompt
415
+ *
416
+ * Read one Prompt occurrence by TRN, including its metadata and current immutable Version pointer.
417
+ *
418
+ * Replay: has no effect; retried after an attempt with an unknown result.
419
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_PromptNotFound`.
420
+ *
421
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
422
+ * @param options Call options.
423
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
424
+ */
425
+ read(trn, options) {
426
+ return this.#engine.call(OPERATIONS.agent_prompt_read, { path: `/prompts/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
427
+ }
428
+ /**
429
+ * Read prompt runtime
430
+ *
431
+ * Read resolved prompt runtime view
432
+ *
433
+ * Render and read the resolved prompt runtime view, including selected prompt identity, request messages, and trace details.
434
+ *
435
+ * Replay: has no effect; retried after an attempt with an unknown result.
436
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_PromptNotFound`, `Agent_VersionNotFound`, `Agent_ThreadNotFound`, `Agent_TurnNotFound`, `Agent_InvalidState`, `Agent_RequestTemplateInvalid`, `Internal_NotFound`.
437
+ *
438
+ * @param body The request body.
439
+ * @param options Call options.
440
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
441
+ */
442
+ runtimeRead(body, options) {
443
+ return this.#engine.call(OPERATIONS.agent_prompt_runtime_read, { path: `/prompts:read`, body }, options);
444
+ }
445
+ /**
446
+ * Resolve prompt runtime
447
+ *
448
+ * Resolve prompt runtime identity
449
+ *
450
+ * Resolve prompt runtime identity from a prepared turn, prompt, or prompt version reference without rendering the final request body.
451
+ *
452
+ * Replay: has no effect; retried after an attempt with an unknown result.
453
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_PromptNotFound`, `Agent_VersionNotFound`, `Agent_ThreadNotFound`, `Agent_TurnNotFound`, `Agent_InvalidState`, `Internal_NotFound`.
454
+ *
455
+ * @param body The request body.
456
+ * @param options Call options.
457
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
458
+ */
459
+ runtimeResolve(body, options) {
460
+ return this.#engine.call(OPERATIONS.agent_prompt_runtime_resolve, { path: `/prompts:resolve`, body }, options);
461
+ }
462
+ /**
463
+ * Delete prompt version
464
+ *
465
+ * Delete Prompt version
466
+ *
467
+ * Delete one Prompt version that is not current; make another version current first to delete the current one.
468
+ *
469
+ * Replay: not declared; an attempt with an unknown result is not retried.
470
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_PromptNotFound`, `Agent_VersionNotFound`, `Declarative_RemovalBlocked`, `Internal_Conflict`.
471
+ *
472
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
473
+ * @param options Call options.
474
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
475
+ */
476
+ versionDelete(trn, options) {
477
+ return this.#engine.call(OPERATIONS.agent_prompt_version_delete, { path: `/prompts/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
478
+ }
479
+ /**
480
+ * List prompt versions
481
+ *
482
+ * List published, undeleted versions for one Prompt occurrence.
483
+ *
484
+ * Replay: has no effect; retried after an attempt with an unknown result.
485
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_PromptNotFound`.
486
+ *
487
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
488
+ * @param query The query, by wire names.
489
+ * @param options Call options.
490
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
491
+ */
492
+ versionList(trn, query, options) {
493
+ return this.#engine.call(OPERATIONS.agent_prompt_version_list, { path: withQuery(`/prompts/${encodePathParam(trn)}/versions`, query), primaryResourceTrn: trn }, options);
494
+ }
495
+ /**
496
+ * Every item of `agent.prompt.version_list`, page after page, starting from `query`.
497
+ * Each page is one call with its own time budget and retries.
498
+ *
499
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
500
+ * @param query The query of the first page; `limit` is the size of every page.
501
+ * @param options Call options of every page.
502
+ */
503
+ async *versionListIter(trn, query, options) {
504
+ let offset = query?.offset ?? 0;
505
+ for (;;) {
506
+ const response = await this.versionList(trn, { ...query, offset }, options);
507
+ const page = response;
508
+ yield* page.items;
509
+ if (!page.hasMore)
510
+ return;
511
+ offset += page.items.length;
512
+ }
513
+ }
514
+ /**
515
+ * Read prompt version
516
+ *
517
+ * Get prompt version
518
+ *
519
+ * Read one published Prompt version by exact parent qualifier TRN.
520
+ *
521
+ * Replay: has no effect; retried after an attempt with an unknown result.
522
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_PromptNotFound`, `Agent_VersionNotFound`, `Internal_NotFound`.
523
+ *
524
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
525
+ * @param options Call options.
526
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
527
+ */
528
+ versionRead(trn, options) {
529
+ return this.#engine.call(OPERATIONS.agent_prompt_version_read, { path: `/prompts/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
530
+ }
531
+ /**
532
+ * Set the current prompt version
533
+ *
534
+ * Point a Prompt at one of its versions; new Turns use it from now on.
535
+ *
536
+ * Replay: not idempotent; an attempt answered with `Agent_PromptNotFound`, `Agent_VersionNotFound` did not run.
537
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_PromptNotFound`, `Agent_VersionNotFound`, `Internal_Conflict`.
538
+ *
539
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
540
+ * @param options Call options.
541
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
542
+ */
543
+ versionSetCurrent(trn, options) {
544
+ return this.#engine.call(OPERATIONS.agent_prompt_version_set_current, { path: `/prompts/${encodePathParam(trn)}/version/set-current`, primaryResourceTrn: trn }, options);
545
+ }
546
+ }
547
+ /** The `session` operations of the `agent` service. */
548
+ export class AgentSessionResource {
549
+ #engine;
550
+ /** Not part of the public API. */
551
+ constructor(engine) {
552
+ this.#engine = engine;
553
+ }
554
+ /**
555
+ * Connect agent session
556
+ *
557
+ * Issue a short-lived bootstrap for a live Agent session attached to one existing Thread.
558
+ *
559
+ * Replay: not declared; an attempt with an unknown result is not retried.
560
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_ThreadNotFound`, `Internal_Conflict`.
561
+ *
562
+ * @param body The request body.
563
+ * @param options Call options.
564
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
565
+ */
566
+ connect(body, options) {
567
+ return this.#engine.call(OPERATIONS.agent_session_connect, { path: `/session/connect`, body }, options);
568
+ }
569
+ }
570
+ /** The `skill` operations of the `agent` service. */
571
+ export class AgentSkillResource {
572
+ #engine;
573
+ /** Not part of the public API. */
574
+ constructor(engine) {
575
+ this.#engine = engine;
576
+ }
577
+ /**
578
+ * List skills
579
+ *
580
+ * List registered agent skill packages with optional tag filters and pagination.
581
+ *
582
+ * Replay: has no effect; retried after an attempt with an unknown result.
583
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`.
584
+ *
585
+ * @param query The query, by wire names.
586
+ * @param options Call options.
587
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
588
+ */
589
+ list(query, options) {
590
+ return this.#engine.call(OPERATIONS.agent_skill_list, { path: withQuery(`/skills`, query) }, options);
591
+ }
592
+ /**
593
+ * Every item of `agent.skill.list`, page after page, starting from `query`.
594
+ * Each page is one call with its own time budget and retries.
595
+ *
596
+ * @param query The query of the first page; `limit` is the size of every page.
597
+ * @param options Call options of every page.
598
+ */
599
+ async *listIter(query, options) {
600
+ let offset = query?.offset ?? 0;
601
+ for (;;) {
602
+ const response = await this.list({ ...query, offset }, options);
603
+ const page = response;
604
+ yield* page.items;
605
+ if (!page.hasMore)
606
+ return;
607
+ offset += page.items.length;
608
+ }
609
+ }
610
+ /**
611
+ * Read skill
612
+ *
613
+ * Get skill
614
+ *
615
+ * Read one registered skill package resource by TRN, including package artifact metadata.
616
+ *
617
+ * Replay: has no effect; retried after an attempt with an unknown result.
618
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_SkillNotFound`.
619
+ *
620
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
621
+ * @param options Call options.
622
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
623
+ */
624
+ read(trn, options) {
625
+ return this.#engine.call(OPERATIONS.agent_skill_read, { path: `/skills/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
626
+ }
627
+ /**
628
+ * Delete skill version
629
+ *
630
+ * Delete Skill version
631
+ *
632
+ * Delete one Skill version that is not current; make another version current first to delete the current one.
633
+ *
634
+ * Replay: not declared; an attempt with an unknown result is not retried.
635
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_SkillNotFound`, `Agent_VersionNotFound`, `Declarative_RemovalBlocked`, `Internal_Conflict`.
636
+ *
637
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
638
+ * @param options Call options.
639
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
640
+ */
641
+ versionDelete(trn, options) {
642
+ return this.#engine.call(OPERATIONS.agent_skill_version_delete, { path: `/skills/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
643
+ }
644
+ /**
645
+ * Read skill version file
646
+ *
647
+ * Read one verified file from an immutable Agent Skill package version
648
+ *
649
+ * Read the verified bytes of one file from an exact Skill version.
650
+ *
651
+ * Replay: has no effect; retried after an attempt with an unknown result.
652
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_SkillNotFound`, `Agent_VersionNotFound`, `Internal_NotFound`.
653
+ *
654
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
655
+ * @param query The query, by wire names.
656
+ * @param options Call options.
657
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
658
+ */
659
+ versionFileRead(trn, query, options) {
660
+ return this.#engine.call(OPERATIONS.agent_skill_version_file_read, { path: withQuery(`/skills/${encodePathParam(trn)}/version/file`, query), primaryResourceTrn: trn }, options);
661
+ }
662
+ /**
663
+ * List skill versions
664
+ *
665
+ * List immutable package versions for one Agent Skill
666
+ *
667
+ * List immutable package versions for one Agent Skill occurrence.
668
+ *
669
+ * Replay: has no effect; retried after an attempt with an unknown result.
670
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_SkillNotFound`.
671
+ *
672
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
673
+ * @param query The query, by wire names.
674
+ * @param options Call options.
675
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
676
+ */
677
+ versionList(trn, query, options) {
678
+ return this.#engine.call(OPERATIONS.agent_skill_version_list, { path: withQuery(`/skills/${encodePathParam(trn)}/versions`, query), primaryResourceTrn: trn }, options);
679
+ }
680
+ /**
681
+ * Every item of `agent.skill.version_list`, page after page, starting from `query`.
682
+ * Each page is one call with its own time budget and retries.
683
+ *
684
+ * @param trn Stable TRN of the versioned resource, without a version qualifier
685
+ * @param query The query of the first page; `limit` is the size of every page.
686
+ * @param options Call options of every page.
687
+ */
688
+ async *versionListIter(trn, query, options) {
689
+ let offset = query?.offset ?? 0;
690
+ for (;;) {
691
+ const response = await this.versionList(trn, { ...query, offset }, options);
692
+ const page = response;
693
+ yield* page.items;
694
+ if (!page.hasMore)
695
+ return;
696
+ offset += page.items.length;
697
+ }
698
+ }
699
+ /**
700
+ * Download Skill version package
701
+ *
702
+ * Read the exact immutable Agent Skill package bytes
703
+ *
704
+ * Replay: has no effect; retried after an attempt with an unknown result.
705
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_SkillNotFound`, `Agent_VersionNotFound`, `Internal_NotFound`.
706
+ *
707
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
708
+ * @param options Call options.
709
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
710
+ */
711
+ versionPackageRead(trn, options) {
712
+ return this.#engine.call(OPERATIONS.agent_skill_version_package_read, { path: `/skills/${encodePathParam(trn)}/version/package`, primaryResourceTrn: trn }, options);
713
+ }
714
+ /**
715
+ * Read skill version
716
+ *
717
+ * Get one immutable Agent Skill package version
718
+ *
719
+ * Read one immutable Agent Skill package version and its validated manifest.
720
+ *
721
+ * Replay: has no effect; retried after an attempt with an unknown result.
722
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_SkillNotFound`, `Agent_VersionNotFound`, `Internal_NotFound`.
723
+ *
724
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
725
+ * @param options Call options.
726
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
727
+ */
728
+ versionRead(trn, options) {
729
+ return this.#engine.call(OPERATIONS.agent_skill_version_read, { path: `/skills/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
730
+ }
731
+ /**
732
+ * Set the current skill version
733
+ *
734
+ * Point a Skill at one of its versions; new Turns use it from now on.
735
+ *
736
+ * Replay: not idempotent; an attempt answered with `Agent_SkillNotFound`, `Agent_VersionNotFound` did not run.
737
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_SkillNotFound`, `Agent_VersionNotFound`, `Internal_Conflict`.
738
+ *
739
+ * @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
740
+ * @param options Call options.
741
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
742
+ */
743
+ versionSetCurrent(trn, options) {
744
+ return this.#engine.call(OPERATIONS.agent_skill_version_set_current, { path: `/skills/${encodePathParam(trn)}/version/set-current`, primaryResourceTrn: trn }, options);
745
+ }
746
+ }
747
+ /** The `thread` operations of the `agent` service. */
748
+ export class AgentThreadResource {
749
+ #engine;
750
+ /** Not part of the public API. */
751
+ constructor(engine) {
752
+ this.#engine = engine;
753
+ }
754
+ /**
755
+ * Archive thread
756
+ *
757
+ * Archive one thread so it is hidden from the default active thread list.
758
+ *
759
+ * Replay: not declared; an attempt with an unknown result is not retried.
760
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_ThreadNotFound`, `Agent_InvalidState`.
761
+ *
762
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
763
+ * @param body The request body.
764
+ * @param options Call options.
765
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
766
+ */
767
+ archive(trn, body, options) {
768
+ return this.#engine.call(OPERATIONS.agent_thread_archive, { path: `/threads/${encodePathParam(trn)}/archive`, body, primaryResourceTrn: trn }, options);
769
+ }
770
+ /**
771
+ * Delete thread
772
+ *
773
+ * Permanently delete one archived idle thread and its thread-owned state.
774
+ *
775
+ * Replay: not declared; an attempt with an unknown result is not retried.
776
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`, `Agent_InvalidState`.
777
+ *
778
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
779
+ * @param options Call options.
780
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
781
+ */
782
+ delete(trn, options) {
783
+ return this.#engine.call(OPERATIONS.agent_thread_delete, { path: `/threads/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
784
+ }
785
+ /**
786
+ * Interrupt thread turn
787
+ *
788
+ * Submit durable thread interrupt command
789
+ *
790
+ * Submit a durable interrupt command for one thread. Execution is handled by the agent worker command plane.
791
+ *
792
+ * Replay: not declared; an attempt with an unknown result is not retried.
793
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_ThreadNotFound`, `Internal_IdempotencyKeyReused`, `Internal_Conflict`.
794
+ *
795
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
796
+ * @param body The request body.
797
+ * @param options Call options.
798
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
799
+ */
800
+ interrupt(trn, body, options) {
801
+ return this.#engine.call(OPERATIONS.agent_thread_interrupt, { path: `/threads/${encodePathParam(trn)}/interrupt`, body, primaryResourceTrn: trn }, options);
802
+ }
803
+ /**
804
+ * List thread items
805
+ *
806
+ * Page through projected thread items, optionally scoped to one turn.
807
+ *
808
+ * Replay: has no effect; retried after an attempt with an unknown result.
809
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`, `Agent_TurnNotFound`, `Agent_InvalidState`.
810
+ *
811
+ * @param trn Thread TRN such as trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id>
812
+ * @param query The query, by wire names.
813
+ * @param options Call options.
814
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
815
+ */
816
+ itemList(trn, query, options) {
817
+ return this.#engine.call(OPERATIONS.agent_thread_item_list, { path: withQuery(`/threads/${encodePathParam(trn)}/items`, query), primaryResourceTrn: trn }, options);
818
+ }
819
+ /**
820
+ * Every item of `agent.thread.item_list`, page after page, starting from `query`.
821
+ * Each page is one call with its own time budget and retries.
822
+ *
823
+ * @param trn Thread TRN such as trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id>
824
+ * @param query The query of the first page; `limit` is the size of every page.
825
+ * @param options Call options of every page.
826
+ */
827
+ async *itemListIter(trn, query, options) {
828
+ const backward = query?.direction === 'backward';
829
+ let cursor = query?.cursor;
830
+ for (;;) {
831
+ const response = await this.itemList(trn, { ...query, cursor }, options);
832
+ const page = response;
833
+ yield* page.items;
834
+ if (!(backward ? page.pageInfo.hasPrevious : page.pageInfo.hasNext))
835
+ return;
836
+ cursor = backward ? page.pageInfo.firstCursor : page.pageInfo.lastCursor;
837
+ if (cursor == null)
838
+ throw new Error('agent.thread.item_list reported more items without a cursor to them');
839
+ }
840
+ }
841
+ /**
842
+ * List threads
843
+ *
844
+ * List agent threads with pagination, archived filtering, free-text search, and sort controls.
845
+ *
846
+ * Replay: has no effect; retried after an attempt with an unknown result.
847
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`.
848
+ *
849
+ * @param query The query, by wire names.
850
+ * @param options Call options.
851
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
852
+ */
853
+ list(query, options) {
854
+ return this.#engine.call(OPERATIONS.agent_thread_list, { path: withQuery(`/threads`, query) }, options);
855
+ }
856
+ /**
857
+ * Every item of `agent.thread.list`, page after page, starting from `query`.
858
+ * Each page is one call with its own time budget and retries.
859
+ *
860
+ * @param query The query of the first page; `limit` is the size of every page.
861
+ * @param options Call options of every page.
862
+ */
863
+ async *listIter(query, options) {
864
+ let offset = query?.offset ?? 0;
865
+ for (;;) {
866
+ const response = await this.list({ ...query, offset }, options);
867
+ const page = response;
868
+ yield* page.items;
869
+ if (!page.hasMore)
870
+ return;
871
+ offset += page.items.length;
872
+ }
873
+ }
874
+ /**
875
+ * Stream thread notifications
876
+ *
877
+ * Stream durable thread notifications
878
+ *
879
+ * Stream durable notification events for one thread from the session fanout projection.
880
+ *
881
+ * Replay: has no effect; retried after an attempt with an unknown result.
882
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`.
883
+ *
884
+ * @param trn Agent thread TRN whose durable rollout stream is observed
885
+ * @param query The query, by wire names.
886
+ * @param options Call options.
887
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
888
+ */
889
+ notificationStream(trn, query, options) {
890
+ return this.#engine.stream(OPERATIONS.agent_thread_notification_stream, { path: withQuery(`/threads/${encodePathParam(trn)}/notifications/stream`, query), primaryResourceTrn: trn }, options);
891
+ }
892
+ /**
893
+ * Resolve thread interaction
894
+ *
895
+ * Resolve one pending approval or user-input request through the resource/admin surface. Websocket-attached live session clients must answer live callback requests on the websocket session path instead of using this operation.
896
+ *
897
+ * Replay: not declared; an attempt with an unknown result is not retried.
898
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_ThreadNotFound`, `Agent_TurnNotFound`, `Agent_InteractionNotFound`, `Agent_InvalidState`, `Internal_Conflict`.
899
+ *
900
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
901
+ * @param body The request body.
902
+ * @param options Call options.
903
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
904
+ */
905
+ pendingInteractionAnswer(trn, body, options) {
906
+ return this.#engine.call(OPERATIONS.agent_thread_pending_interaction_answer, { path: `/threads/${encodePathParam(trn)}/interactions/answer`, body, primaryResourceTrn: trn }, options);
907
+ }
908
+ /**
909
+ * Read thread pending interactions
910
+ *
911
+ * Get thread pending interactions
912
+ *
913
+ * Read unresolved approvals or user-input requests for one thread as a resource/admin surface. Websocket-attached live session clients must complete live callback flows on the websocket session path instead.
914
+ *
915
+ * Replay: has no effect; retried after an attempt with an unknown result.
916
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`.
917
+ *
918
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
919
+ * @param options Call options.
920
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
921
+ */
922
+ pendingInteractionList(trn, options) {
923
+ return this.#engine.call(OPERATIONS.agent_thread_pending_interaction_list, { path: `/threads/${encodePathParam(trn)}/interactions/pending`, primaryResourceTrn: trn }, options);
924
+ }
925
+ /**
926
+ * Read thread
927
+ *
928
+ * Get thread
929
+ *
930
+ * Read one thread by TRN without loading historical turns.
931
+ *
932
+ * Replay: has no effect; retried after an attempt with an unknown result.
933
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`.
934
+ *
935
+ * @param trn Thread TRN such as trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id>
936
+ * @param options Call options.
937
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
938
+ */
939
+ read(trn, options) {
940
+ return this.#engine.call(OPERATIONS.agent_thread_read, { path: `/threads/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
941
+ }
942
+ /**
943
+ * Rename thread
944
+ *
945
+ * Rename one thread so list and read surfaces show a clearer human title.
946
+ *
947
+ * Replay: not declared; an attempt with an unknown result is not retried.
948
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_ThreadNotFound`.
949
+ *
950
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
951
+ * @param body The request body.
952
+ * @param options Call options.
953
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
954
+ */
955
+ rename(trn, body, options) {
956
+ return this.#engine.call(OPERATIONS.agent_thread_rename, { path: `/threads/${encodePathParam(trn)}/rename`, body, primaryResourceTrn: trn }, options);
957
+ }
958
+ /**
959
+ * Shutdown thread
960
+ *
961
+ * Submit durable thread shutdown command
962
+ *
963
+ * Submit a durable shutdown command for one thread and prevent future turn claims for that thread.
964
+ *
965
+ * Replay: not declared; an attempt with an unknown result is not retried.
966
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_ThreadNotFound`, `Internal_IdempotencyKeyReused`, `Internal_Conflict`.
967
+ *
968
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
969
+ * @param body The request body.
970
+ * @param options Call options.
971
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
972
+ */
973
+ shutdown(trn, body, options) {
974
+ return this.#engine.call(OPERATIONS.agent_thread_shutdown, { path: `/threads/${encodePathParam(trn)}/shutdown`, body, primaryResourceTrn: trn }, options);
975
+ }
976
+ /**
977
+ * Summarize Agent Turns over a window
978
+ *
979
+ * Turn outcomes, failures, estimated cost, model usage, current waits for people and a trend by bucket across the tenant. Completion means a Turn ended normally, not that its task was achieved.
980
+ *
981
+ * Replay: has no effect; retried after an attempt with an unknown result.
982
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`, `Agent_StatisticsWindowRejected`, `Agent_QueryDeadlineExceeded`.
983
+ *
984
+ * @param query The query, by wire names.
985
+ * @param options Call options.
986
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
987
+ */
988
+ statisticsRead(query, options) {
989
+ return this.#engine.call(OPERATIONS.agent_thread_statistics_read, { path: withQuery(`/threads:statistics`, query) }, options);
990
+ }
991
+ /**
992
+ * Get thread status
993
+ *
994
+ * Read the current projected runtime status for one thread without loading the full thread detail.
995
+ *
996
+ * Replay: has no effect; retried after an attempt with an unknown result.
997
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`.
998
+ *
999
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
1000
+ * @param options Call options.
1001
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
1002
+ */
1003
+ statusRead(trn, options) {
1004
+ return this.#engine.call(OPERATIONS.agent_thread_status_read, { path: `/threads/${encodePathParam(trn)}/status`, primaryResourceTrn: trn }, options);
1005
+ }
1006
+ /**
1007
+ * Stream thread status
1008
+ *
1009
+ * Stream durable thread status events
1010
+ *
1011
+ * Stream durable status events for one thread from the session fanout projection.
1012
+ *
1013
+ * Replay: has no effect; retried after an attempt with an unknown result.
1014
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`.
1015
+ *
1016
+ * @param trn Agent thread TRN whose durable rollout stream is observed
1017
+ * @param query The query, by wire names.
1018
+ * @param options Call options.
1019
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
1020
+ */
1021
+ statusStream(trn, query, options) {
1022
+ return this.#engine.stream(OPERATIONS.agent_thread_status_stream, { path: withQuery(`/threads/${encodePathParam(trn)}/status/stream`, query), primaryResourceTrn: trn }, options);
1023
+ }
1024
+ /**
1025
+ * Summarize tool calls across the tenant
1026
+ *
1027
+ * Tool outcomes in the selected window, queried on demand. At most 50 groups, by tool, operation and resource; a truncated list cannot provide a global failure rate.
1028
+ *
1029
+ * Replay: has no effect; retried after an attempt with an unknown result.
1030
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ProfileNotFound`, `Agent_StatisticsWindowRejected`, `Agent_QueryDeadlineExceeded`.
1031
+ *
1032
+ * @param query The query, by wire names.
1033
+ * @param options Call options.
1034
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
1035
+ */
1036
+ toolStatisticsRead(query, options) {
1037
+ return this.#engine.call(OPERATIONS.agent_thread_tool_statistics_read, { path: withQuery(`/threads:tool-statistics`, query) }, options);
1038
+ }
1039
+ /**
1040
+ * List thread turns
1041
+ *
1042
+ * Page through one thread's turn history with an item detail view.
1043
+ *
1044
+ * Replay: has no effect; retried after an attempt with an unknown result.
1045
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`, `Agent_InvalidState`.
1046
+ *
1047
+ * @param trn Thread TRN such as trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id>
1048
+ * @param query The query, by wire names.
1049
+ * @param options Call options.
1050
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
1051
+ */
1052
+ turnList(trn, query, options) {
1053
+ return this.#engine.call(OPERATIONS.agent_thread_turn_list, { path: withQuery(`/threads/${encodePathParam(trn)}/turns`, query), primaryResourceTrn: trn }, options);
1054
+ }
1055
+ /**
1056
+ * Every item of `agent.thread.turn_list`, page after page, starting from `query`.
1057
+ * Each page is one call with its own time budget and retries.
1058
+ *
1059
+ * @param trn Thread TRN such as trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id>
1060
+ * @param query The query of the first page; `limit` is the size of every page.
1061
+ * @param options Call options of every page.
1062
+ */
1063
+ async *turnListIter(trn, query, options) {
1064
+ const backward = query?.direction === 'backward';
1065
+ let cursor = query?.cursor;
1066
+ for (;;) {
1067
+ const response = await this.turnList(trn, { ...query, cursor }, options);
1068
+ const page = response;
1069
+ yield* page.items;
1070
+ if (!(backward ? page.pageInfo.hasPrevious : page.pageInfo.hasNext))
1071
+ return;
1072
+ cursor = backward ? page.pageInfo.firstCursor : page.pageInfo.lastCursor;
1073
+ if (cursor == null)
1074
+ throw new Error('agent.thread.turn_list reported more items without a cursor to them');
1075
+ }
1076
+ }
1077
+ /**
1078
+ * Unarchive thread
1079
+ *
1080
+ * Restore one archived thread back into the active thread list.
1081
+ *
1082
+ * Replay: not declared; an attempt with an unknown result is not retried.
1083
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_PayloadTooLarge`, `Internal_UnsupportedMediaType`, `Agent_ThreadNotFound`, `Agent_InvalidState`.
1084
+ *
1085
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
1086
+ * @param body The request body.
1087
+ * @param options Call options.
1088
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
1089
+ */
1090
+ unarchive(trn, body, options) {
1091
+ return this.#engine.call(OPERATIONS.agent_thread_unarchive, { path: `/threads/${encodePathParam(trn)}/unarchive`, body, primaryResourceTrn: trn }, options);
1092
+ }
1093
+ /**
1094
+ * List thread usage
1095
+ *
1096
+ * List bounded per-Turn usage facts
1097
+ *
1098
+ * List bounded per-Turn token usage facts with an exact total.
1099
+ *
1100
+ * Replay: has no effect; retried after an attempt with an unknown result.
1101
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`.
1102
+ *
1103
+ * @param trn Thread TRN whose bounded Turn usage facts should be listed
1104
+ * @param query The query, by wire names.
1105
+ * @param options Call options.
1106
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
1107
+ */
1108
+ usageList(trn, query, options) {
1109
+ return this.#engine.call(OPERATIONS.agent_thread_usage_list, { path: withQuery(`/threads/${encodePathParam(trn)}/usage`, query), primaryResourceTrn: trn }, options);
1110
+ }
1111
+ /**
1112
+ * Every item of `agent.thread.usage_list`, page after page, starting from `query`.
1113
+ * Each page is one call with its own time budget and retries.
1114
+ *
1115
+ * @param trn Thread TRN whose bounded Turn usage facts should be listed
1116
+ * @param query The query of the first page; `limit` is the size of every page.
1117
+ * @param options Call options of every page.
1118
+ */
1119
+ async *usageListIter(trn, query, options) {
1120
+ let offset = query?.offset ?? 0;
1121
+ for (;;) {
1122
+ const response = await this.usageList(trn, { ...query, offset }, options);
1123
+ const page = response;
1124
+ yield* page.items;
1125
+ if (!page.hasMore)
1126
+ return;
1127
+ offset += page.items.length;
1128
+ }
1129
+ }
1130
+ }
1131
+ /** The `turn` operations of the `agent` service. */
1132
+ export class AgentTurnResource {
1133
+ #engine;
1134
+ /** Not part of the public API. */
1135
+ constructor(engine) {
1136
+ this.#engine = engine;
1137
+ }
1138
+ /**
1139
+ * Download Turn attachment
1140
+ *
1141
+ * Read the exact admitted bytes of one Turn attachment
1142
+ *
1143
+ * Replay: has no effect; retried after an attempt with an unknown result.
1144
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`, `Agent_TurnNotFound`, `Agent_AttachmentNotFound`, `Internal_NotFound`.
1145
+ *
1146
+ * @param trn Agent turn TRN whose admitted attachment is read
1147
+ * @param index Zero-based position of the attachment in the Turn's input
1148
+ * @param options Call options.
1149
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
1150
+ */
1151
+ attachmentRead(trn, index, options) {
1152
+ return this.#engine.call(OPERATIONS.agent_turn_attachment_read, { path: `/turns/${encodePathParam(trn)}/attachments/${encodePathParam(index)}`, primaryResourceTrn: trn }, options);
1153
+ }
1154
+ /**
1155
+ * Read Turn status
1156
+ *
1157
+ * Read durable agent turn invocation status
1158
+ *
1159
+ * Replay: has no effect; retried after an attempt with an unknown result.
1160
+ * Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Agent_ThreadNotFound`, `Agent_TurnNotFound`.
1161
+ *
1162
+ * @param trn Agent TRN in the route path, for example trn:agent:tenant:test0001:profile/runtime-assistant, trn:agent:tenant:test0001:prompt/support-core, trn:agent:tenant:test0001:skill/support-docs, or trn:agent:tenant:test0001:thread/runtime-assistant/<thread_id> depending on the command
1163
+ * @param options Call options.
1164
+ * @throws {AionixCallError} when the call fails, summarized over its attempts.
1165
+ */
1166
+ read(trn, options) {
1167
+ return this.#engine.call(OPERATIONS.agent_turn_read, { path: `/turns/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
1168
+ }
1169
+ }
1170
+ //# sourceMappingURL=service.js.map