@deepraxis/cli 0.1.0-dev.98b03cc → 0.1.0-dev.a3beed2
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.
- package/COMMANDS.md +394 -0
- package/LICENSE +202 -67
- package/README.md +200 -36
- package/dist/praxis.js +1833 -368
- package/package.json +22 -13
package/dist/praxis.js
CHANGED
|
@@ -10,7 +10,7 @@ var operations = [
|
|
|
10
10
|
{
|
|
11
11
|
resource: "agent.agents",
|
|
12
12
|
method: "list",
|
|
13
|
-
summary: "",
|
|
13
|
+
summary: "List agents",
|
|
14
14
|
description: "List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=personal for durable-computer agents or kind=service for per-session environments. Pass next_page from the response as page to read the next page; a null next_page means the end.",
|
|
15
15
|
http: "GET",
|
|
16
16
|
path: "/agent/v1/agents",
|
|
@@ -67,8 +67,8 @@ var operations = [
|
|
|
67
67
|
{
|
|
68
68
|
resource: "agent.agents",
|
|
69
69
|
method: "create",
|
|
70
|
-
summary: "",
|
|
71
|
-
description: 'Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. Unlike Anthropic Managed Agents, nonempty skills attachments
|
|
70
|
+
summary: "Create agent",
|
|
71
|
+
description: 'Create a reusable agent definition, then pass its returned id to sessions.create to start a conversation. The definition includes model, system prompt, tools, MCP servers and an optional multiagent roster. It is saved as version 1; real updates create new versions. Unlike Anthropic Managed Agents, nonempty skills attachments return 400; the native skill tool is separate from the skills field. Use tools: [{type: "agent_toolset_20260401"}] for built-in tools including codemode, skill and agent; inspect toolsets.list for names and schemas, and keep bash enabled for native additions. To offer only some tools, set default_config: {enabled: false} and list the tools to keep in configs, e.g. tools: [{type: "agent_toolset_20260401", default_config: {enabled: false}, configs: [{name: "codemode", enabled: true}, {name: "bash", enabled: true, permission_policy: {type: "always_ask"}}]}]; every tool not listed, including todo_write, enter_plan_mode, ask_user_question and goal_read, follows default_config, and the response echoes it. codemode runs through bash, so enabling codemode while bash is disabled returns 400. Optional mcp_toolset entries pair with mcp_servers. model accepts platform model IDs such as deepseek-flash, not only the Claude IDs in the protocol examples. model.settings.reasoning sets default thinking; other extra model controls return 400. Example: {"name":"helper","model":{"id":"deepseek-flash"},"tools":[{"type":"agent_toolset_20260401"}]}.',
|
|
72
72
|
http: "POST",
|
|
73
73
|
path: "/agent/v1/agents",
|
|
74
74
|
streaming: "no",
|
|
@@ -101,7 +101,7 @@ var operations = [
|
|
|
101
101
|
type: "array",
|
|
102
102
|
itemType: "object",
|
|
103
103
|
required: false,
|
|
104
|
-
description: "
|
|
104
|
+
description: "Praxis extension: HTTP, SSE or trusted stdio MCP servers paired with mcp_toolset entries and saved with the agent version."
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
name: "metadata",
|
|
@@ -136,6 +136,27 @@ var operations = [
|
|
|
136
136
|
description: `Tool configurations available to the agent. Maximum of 128 tools
|
|
137
137
|
across all toolsets allowed.`
|
|
138
138
|
},
|
|
139
|
+
{
|
|
140
|
+
name: "databases",
|
|
141
|
+
type: "array",
|
|
142
|
+
itemType: "object",
|
|
143
|
+
required: false,
|
|
144
|
+
description: "Database allowlist for platform resources accessible through service-agent codemode. Only kind=service accepts nonempty bindings; personal agents return 400. At most 20 bindings per resource type, with no duplicate ids. Newly added bindings apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Unbound resources return 404; writes to read_only resources are refused. Other platform APIs return 403, except public API discovery. Invalid bindings and unknown item fields return 400. Omit on create for no bindings."
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "vector_stores",
|
|
148
|
+
type: "array",
|
|
149
|
+
itemType: "object",
|
|
150
|
+
required: false,
|
|
151
|
+
description: "Knowledge vector store allowlist for platform resources accessible through service-agent codemode. Only kind=service accepts nonempty bindings; personal agents return 400. At most 20 bindings per resource type, with no duplicate ids. Newly added bindings apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Unbound resources return 404; writes to read_only resources are refused. Other platform APIs return 403, except public API discovery. Invalid bindings and unknown item fields return 400. Omit on create for no bindings."
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "files",
|
|
155
|
+
type: "array",
|
|
156
|
+
itemType: "object",
|
|
157
|
+
required: false,
|
|
158
|
+
description: "File allowlist for platform resources accessible through service-agent codemode. Only kind=service accepts nonempty bindings; personal agents return 400. At most 20 bindings per resource type, with no duplicate ids. Newly added bindings apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Unbound resources return 404; writes to read_only resources are refused. Other platform APIs return 403, except public API discovery. Invalid bindings and unknown item fields return 400. Omit on create for no bindings."
|
|
159
|
+
},
|
|
139
160
|
{
|
|
140
161
|
name: "kind",
|
|
141
162
|
type: "string",
|
|
@@ -183,6 +204,17 @@ across all toolsets allowed.`
|
|
|
183
204
|
type: "object",
|
|
184
205
|
required: false,
|
|
185
206
|
description: "Praxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable."
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "preset",
|
|
210
|
+
type: "string",
|
|
211
|
+
enum: [
|
|
212
|
+
"minimal",
|
|
213
|
+
"data-editor",
|
|
214
|
+
"full"
|
|
215
|
+
],
|
|
216
|
+
required: false,
|
|
217
|
+
description: "Optional tool preset. minimal enables read, glob, grep and ask_user_question; data-editor also enables write and edit; full uses the default toolset with always_allow. Explicit tools override matching preset entries. codemode requires bash and is absent from data-editor."
|
|
186
218
|
}
|
|
187
219
|
]
|
|
188
220
|
}
|
|
@@ -190,7 +222,7 @@ across all toolsets allowed.`
|
|
|
190
222
|
{
|
|
191
223
|
resource: "agent.agents",
|
|
192
224
|
method: "retrieve",
|
|
193
|
-
summary: "",
|
|
225
|
+
summary: "Get agent",
|
|
194
226
|
description: "Read one agent by id, at its latest version or, with version, at a specific earlier version. The response lists every native tool with its resolved configuration in one agent_toolset_20260401 entry, so it can be sent back unchanged to agents.update. Use agents.versions.list to enumerate versions.",
|
|
195
227
|
http: "GET",
|
|
196
228
|
path: "/agent/v1/agents/{agent_id}",
|
|
@@ -214,8 +246,8 @@ across all toolsets allowed.`
|
|
|
214
246
|
{
|
|
215
247
|
resource: "agent.agents",
|
|
216
248
|
method: "update",
|
|
217
|
-
summary: "",
|
|
218
|
-
description: "Update an agent. Send the current version in the body for optimistic concurrency: a stale version returns 409, and an update that changes nothing keeps the version number. Any real change saves a new version; existing sessions keep the version they were created with. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. Unlike Anthropic Managed Agents, nonempty skills attachments
|
|
249
|
+
summary: "Update agent",
|
|
250
|
+
description: "Update an agent. Send the current version in the body for optimistic concurrency: a stale version returns 409, and an update that changes nothing keeps the version number. Any real change saves a new version; existing sessions keep the version they were created with. Omitted fields keep their value. multiagent takes null or a coordinator roster; subagent_model keeps its value when omitted and is cleared by null. Archived agents cannot be updated. Unlike Anthropic Managed Agents, nonempty skills attachments return 400; use the native skill tool for available runtime skills.",
|
|
219
251
|
http: "POST",
|
|
220
252
|
path: "/agent/v1/agents/{agent_id}",
|
|
221
253
|
streaming: "no",
|
|
@@ -241,7 +273,7 @@ across all toolsets allowed.`
|
|
|
241
273
|
type: "array",
|
|
242
274
|
itemType: "object",
|
|
243
275
|
required: false,
|
|
244
|
-
description: "
|
|
276
|
+
description: "Praxis extension: HTTP, SSE or trusted stdio MCP servers paired with mcp_toolset entries and saved with the agent version."
|
|
245
277
|
},
|
|
246
278
|
{
|
|
247
279
|
name: "metadata",
|
|
@@ -301,6 +333,27 @@ Obtain this value from a create or retrieve response. Must be at least 1 if
|
|
|
301
333
|
specified. When supplied, the request fails if it does not match the server's
|
|
302
334
|
current version; omit to apply the update unconditionally.`
|
|
303
335
|
},
|
|
336
|
+
{
|
|
337
|
+
name: "databases",
|
|
338
|
+
type: "array",
|
|
339
|
+
itemType: "object",
|
|
340
|
+
required: false,
|
|
341
|
+
description: "Replace this resource allowlist; omission preserves it, and null or [] clears it. Additions apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Only service agents accept nonempty bindings."
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: "vector_stores",
|
|
345
|
+
type: "array",
|
|
346
|
+
itemType: "object",
|
|
347
|
+
required: false,
|
|
348
|
+
description: "Replace this resource allowlist; omission preserves it, and null or [] clears it. Additions apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Only service agents accept nonempty bindings."
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: "files",
|
|
352
|
+
type: "array",
|
|
353
|
+
itemType: "object",
|
|
354
|
+
required: false,
|
|
355
|
+
description: "Replace this resource allowlist; omission preserves it, and null or [] clears it. Additions apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Only service agents accept nonempty bindings."
|
|
356
|
+
},
|
|
304
357
|
{
|
|
305
358
|
name: "kind",
|
|
306
359
|
type: "string",
|
|
@@ -348,6 +401,17 @@ current version; omit to apply the update unconditionally.`
|
|
|
348
401
|
type: "object",
|
|
349
402
|
required: false,
|
|
350
403
|
description: "Praxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable."
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
name: "preset",
|
|
407
|
+
type: "string",
|
|
408
|
+
enum: [
|
|
409
|
+
"minimal",
|
|
410
|
+
"data-editor",
|
|
411
|
+
"full"
|
|
412
|
+
],
|
|
413
|
+
required: false,
|
|
414
|
+
description: "Optional tool preset. minimal enables read, glob, grep and ask_user_question; data-editor also enables write and edit; full uses the default toolset with always_allow. Explicit tools override matching preset entries. codemode requires bash and is absent from data-editor."
|
|
351
415
|
}
|
|
352
416
|
]
|
|
353
417
|
}
|
|
@@ -355,7 +419,7 @@ current version; omit to apply the update unconditionally.`
|
|
|
355
419
|
{
|
|
356
420
|
resource: "agent.agents",
|
|
357
421
|
method: "archive",
|
|
358
|
-
summary: "",
|
|
422
|
+
summary: "Archive agent",
|
|
359
423
|
description: "Archive an agent so it can no longer be updated and no new session can be created from it (AGENT_ARCHIVED). The agent and all of its versions stay readable. Use it to retire an agent you no longer want to run; it does not delete anything.",
|
|
360
424
|
http: "POST",
|
|
361
425
|
path: "/agent/v1/agents/{agent_id}/archive",
|
|
@@ -369,10 +433,210 @@ current version; omit to apply the update unconditionally.`
|
|
|
369
433
|
],
|
|
370
434
|
query: []
|
|
371
435
|
},
|
|
436
|
+
{
|
|
437
|
+
resource: "agent.agents.endUsers",
|
|
438
|
+
method: "list",
|
|
439
|
+
summary: "List End Users",
|
|
440
|
+
description: `List users who have sessions or token issuance history on a service agent.
|
|
441
|
+
|
|
442
|
+
Ordered by last_active_at and external_user_id descending. q is a case-sensitive literal prefix, including underscores. limit is 1–100, default 20. Reuse next_page with the same organization, agent, q and limit. Preemptively blocked users without history do not appear. End-user credentials and inaccessible or personal agents return 404.`,
|
|
443
|
+
http: "GET",
|
|
444
|
+
path: "/agent/v1/agents/{agent_id}/end_users",
|
|
445
|
+
streaming: "no",
|
|
446
|
+
pagination: false,
|
|
447
|
+
pathParams: [
|
|
448
|
+
{
|
|
449
|
+
name: "agent_id",
|
|
450
|
+
sdkName: "agent_id"
|
|
451
|
+
}
|
|
452
|
+
],
|
|
453
|
+
query: [
|
|
454
|
+
{
|
|
455
|
+
name: "limit",
|
|
456
|
+
type: "integer",
|
|
457
|
+
required: false,
|
|
458
|
+
description: "Maximum users per page; defaults to 20."
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
name: "page",
|
|
462
|
+
type: "string",
|
|
463
|
+
required: false,
|
|
464
|
+
description: "next_page from the previous response with the same agent, q and limit."
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: "q",
|
|
468
|
+
type: "string",
|
|
469
|
+
required: false,
|
|
470
|
+
description: "Case-sensitive literal prefix of external_user_id; omit or use an empty string for all users."
|
|
471
|
+
}
|
|
472
|
+
]
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
resource: "agent.agents.endUsers",
|
|
476
|
+
method: "delete",
|
|
477
|
+
summary: "Delete end-user data",
|
|
478
|
+
description: `Delete a host application's end-user data from one service agent after explicit confirmation.
|
|
479
|
+
|
|
480
|
+
Develop only. Set confirm to the exact external_user_id; missing or mismatched confirmation returns 400. Returns 202 with a pending task id, not completion. Poll the deletion endpoint. Concurrent requests reuse the unfinished task; retry DELETE after failure to resume it. Tokens are revoked and the user is blocked before a seven-day recovery snapshot is verified. Sessions including child sessions, conversation data, grants and feedback are then removed. A pre-existing block remains; a temporary block is removed on success. Attachment metadata is recorded and File attachments are retained. No charge is introduced by this operation. Example: DELETE /agent/v1/agents/agent_example/end_users/customer_123?confirm=customer_123.`,
|
|
481
|
+
http: "DELETE",
|
|
482
|
+
path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}",
|
|
483
|
+
streaming: "no",
|
|
484
|
+
pagination: false,
|
|
485
|
+
pathParams: [
|
|
486
|
+
{
|
|
487
|
+
name: "agent_id",
|
|
488
|
+
sdkName: "agent_id"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
name: "external_user_id",
|
|
492
|
+
sdkName: "external_user_id"
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
query: [
|
|
496
|
+
{
|
|
497
|
+
name: "confirm",
|
|
498
|
+
type: "string",
|
|
499
|
+
required: true,
|
|
500
|
+
description: "Must exactly equal the external_user_id path parameter to confirm destructive deletion."
|
|
501
|
+
}
|
|
502
|
+
]
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
resource: "agent.agents.endUsers",
|
|
506
|
+
method: "retrieve",
|
|
507
|
+
summary: "Get End User",
|
|
508
|
+
description: `Inspect one end user and their twenty most recently updated sessions.
|
|
509
|
+
|
|
510
|
+
Use external_user_id from listing or your host application. Users without session or issuance history return 404, including preemptively blocked users. End-user credentials and inaccessible or personal agents return 404.`,
|
|
511
|
+
http: "GET",
|
|
512
|
+
path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}",
|
|
513
|
+
streaming: "no",
|
|
514
|
+
pagination: false,
|
|
515
|
+
pathParams: [
|
|
516
|
+
{
|
|
517
|
+
name: "agent_id",
|
|
518
|
+
sdkName: "agent_id"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
name: "external_user_id",
|
|
522
|
+
sdkName: "external_user_id"
|
|
523
|
+
}
|
|
524
|
+
],
|
|
525
|
+
query: []
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
resource: "agent.agents.endUsers.block",
|
|
529
|
+
method: "create",
|
|
530
|
+
summary: "Block End User",
|
|
531
|
+
description: `Block token issuance and session creation, then revoke existing tokens for an end user.
|
|
532
|
+
|
|
533
|
+
May block a user before any history exists; timestamps are then null and counts and cost are zero. Requires an embed policy, otherwise returns 409 with setup guidance. Deduplicates the policy blocklist and retains its 1000-user maximum. If revocation returns 502, the user remains blocked; retry to finish revocation. Repeats keep the user blocked and revoke any remaining grants. End-user credentials and inaccessible or personal agents return 404.`,
|
|
534
|
+
http: "POST",
|
|
535
|
+
path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/block",
|
|
536
|
+
streaming: "no",
|
|
537
|
+
pagination: false,
|
|
538
|
+
pathParams: [
|
|
539
|
+
{
|
|
540
|
+
name: "agent_id",
|
|
541
|
+
sdkName: "agent_id"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
name: "external_user_id",
|
|
545
|
+
sdkName: "external_user_id"
|
|
546
|
+
}
|
|
547
|
+
],
|
|
548
|
+
query: []
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
resource: "agent.agents.endUsers",
|
|
552
|
+
method: "retrieveDeletion",
|
|
553
|
+
summary: "Get end-user deletion",
|
|
554
|
+
description: `Poll the latest deletion task for an end user, including after the user data has been removed.
|
|
555
|
+
|
|
556
|
+
Use the same agent_id and external_user_id as the confirmed DELETE. Status is pending, snapshotting, deleting, done or failed. Counts are empty until a verified snapshot exists. A failed task remains blocked and resumes when DELETE is retried with matching confirmation. snapshot_key is an operator recovery reference retained for seven days, not a public download URL. End-user credentials, inaccessible or personal agents, and missing tasks return 404. This read does not create a task or charge usage.`,
|
|
557
|
+
http: "GET",
|
|
558
|
+
path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/deletion",
|
|
559
|
+
streaming: "no",
|
|
560
|
+
pagination: false,
|
|
561
|
+
pathParams: [
|
|
562
|
+
{
|
|
563
|
+
name: "agent_id",
|
|
564
|
+
sdkName: "agent_id"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
name: "external_user_id",
|
|
568
|
+
sdkName: "external_user_id"
|
|
569
|
+
}
|
|
570
|
+
],
|
|
571
|
+
query: []
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
resource: "agent.agents.endUsers.revokeTokens",
|
|
575
|
+
method: "create",
|
|
576
|
+
summary: "Revoke End User Tokens",
|
|
577
|
+
description: `Revoke all issued tokens for an end user and terminate their open embed streams.
|
|
578
|
+
|
|
579
|
+
Revokes credentials before marking grants revoked. Upstream failure returns 502 without changing grant revocation timestamps. Returns the count of newly revoked grants; a repeat without new grants returns zero. Does not block future issuance. End-user credentials and inaccessible or personal agents return 404.`,
|
|
580
|
+
http: "POST",
|
|
581
|
+
path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/revoke_tokens",
|
|
582
|
+
streaming: "no",
|
|
583
|
+
pagination: false,
|
|
584
|
+
pathParams: [
|
|
585
|
+
{
|
|
586
|
+
name: "agent_id",
|
|
587
|
+
sdkName: "agent_id"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: "external_user_id",
|
|
591
|
+
sdkName: "external_user_id"
|
|
592
|
+
}
|
|
593
|
+
],
|
|
594
|
+
query: []
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
resource: "agent.agents.endUsers.unblock",
|
|
598
|
+
method: "create",
|
|
599
|
+
summary: "Unblock End User",
|
|
600
|
+
description: `Allow an end user to receive new tokens and create new sessions again.
|
|
601
|
+
|
|
602
|
+
Removes the user from the blocklist; previously revoked tokens stay revoked. Idempotent. Requires an embed policy, otherwise returns 409 with setup guidance. Returns null timestamps and zero counts and cost when no session or issuance history exists. End-user credentials and inaccessible or personal agents return 404.`,
|
|
603
|
+
http: "POST",
|
|
604
|
+
path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock",
|
|
605
|
+
streaming: "no",
|
|
606
|
+
pagination: false,
|
|
607
|
+
pathParams: [
|
|
608
|
+
{
|
|
609
|
+
name: "agent_id",
|
|
610
|
+
sdkName: "agent_id"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
name: "external_user_id",
|
|
614
|
+
sdkName: "external_user_id"
|
|
615
|
+
}
|
|
616
|
+
],
|
|
617
|
+
query: []
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
resource: "agent.agents.unarchive",
|
|
621
|
+
method: "create",
|
|
622
|
+
summary: "Unarchive Agent",
|
|
623
|
+
description: "Restore an archived agent without creating a configuration version. Already active agents are unchanged. Missing or inaccessible agents return 404. Use the returned agent id to create new sessions.",
|
|
624
|
+
http: "POST",
|
|
625
|
+
path: "/agent/v1/agents/{agent_id}/unarchive",
|
|
626
|
+
streaming: "no",
|
|
627
|
+
pagination: false,
|
|
628
|
+
pathParams: [
|
|
629
|
+
{
|
|
630
|
+
name: "agent_id",
|
|
631
|
+
sdkName: "agent_id"
|
|
632
|
+
}
|
|
633
|
+
],
|
|
634
|
+
query: []
|
|
635
|
+
},
|
|
372
636
|
{
|
|
373
637
|
resource: "agent.agents.versions",
|
|
374
638
|
method: "list",
|
|
375
|
-
summary: "",
|
|
639
|
+
summary: "List agent versions",
|
|
376
640
|
description: "List the saved versions of one agent, in pages of at most 100 (default 20). Each item is the full agent definition at that version, so you can compare what changed between versions. Use agents.retrieve with version to read a single one; agent_id comes from agents.list or agents.create.",
|
|
377
641
|
http: "GET",
|
|
378
642
|
path: "/agent/v1/agents/{agent_id}/versions",
|
|
@@ -580,7 +844,9 @@ Own-face superset: Managed Agents has no persistent Computer attachment director
|
|
|
580
844
|
summary: "Connect computer",
|
|
581
845
|
description: `Resume the computer and issue a sandbox connection.
|
|
582
846
|
|
|
583
|
-
Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials
|
|
847
|
+
Own-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id, plus the machine tier the computer is on now (light or heavy) and the lease that keeps it there (lease_id, lease_expires_at; lease_id is null when no lease exists). Keep the lease while the connection stays open: renew it about every 20 seconds (POST .../leases/{lease_id}/renew) and release it on close (DELETE .../leases/{lease_id}). An unrenewed lease simply expires, and the full machine is reclaimed only after that. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.
|
|
848
|
+
|
|
849
|
+
Connect to a computer with a caller-held lease. Omit the body or send {} to request light: the lightweight shell, or the heavy instance while it is running. Send {"need":"heavy"} to request full Linux for interactive programs; files are synchronized before the heavy connection is returned with tier heavy. Renew the lease while using the connection and release it with DELETE when finished.`,
|
|
584
850
|
http: "POST",
|
|
585
851
|
path: "/agent/v1/computers/{computer_id}/connect",
|
|
586
852
|
streaming: "no",
|
|
@@ -591,7 +857,22 @@ Own-face extension: Managed Agents has no persistent Computer connection. Return
|
|
|
591
857
|
sdkName: "computer_id"
|
|
592
858
|
}
|
|
593
859
|
],
|
|
594
|
-
query: []
|
|
860
|
+
query: [],
|
|
861
|
+
body: {
|
|
862
|
+
required: false,
|
|
863
|
+
fields: [
|
|
864
|
+
{
|
|
865
|
+
name: "need",
|
|
866
|
+
type: "string",
|
|
867
|
+
enum: [
|
|
868
|
+
"light",
|
|
869
|
+
"heavy"
|
|
870
|
+
],
|
|
871
|
+
required: false,
|
|
872
|
+
description: "Defaults to light. light uses the lightweight shell, or the heavy instance while it is running. heavy requests a full Linux computer for interactive programs; heavy running time counts toward the daily budget in seconds."
|
|
873
|
+
}
|
|
874
|
+
]
|
|
875
|
+
}
|
|
595
876
|
},
|
|
596
877
|
{
|
|
597
878
|
resource: "agent.computers.files",
|
|
@@ -645,10 +926,56 @@ Praxis extension: MA only has session-scoped temporary containers and memory_sto
|
|
|
645
926
|
}
|
|
646
927
|
]
|
|
647
928
|
},
|
|
929
|
+
{
|
|
930
|
+
resource: "agent.computers.leases",
|
|
931
|
+
method: "delete",
|
|
932
|
+
summary: "Release computer lease",
|
|
933
|
+
description: `Give the lease back when a connection closes so the full machine can be reclaimed without waiting for it to expire.
|
|
934
|
+
|
|
935
|
+
Own-face extension. Idempotent: an unknown or already released lease succeeds as well. Foreign or absent computers return 404.`,
|
|
936
|
+
http: "DELETE",
|
|
937
|
+
path: "/agent/v1/computers/{computer_id}/leases/{lease_id}",
|
|
938
|
+
streaming: "no",
|
|
939
|
+
pagination: false,
|
|
940
|
+
pathParams: [
|
|
941
|
+
{
|
|
942
|
+
name: "computer_id",
|
|
943
|
+
sdkName: "computer_id"
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
name: "lease_id",
|
|
947
|
+
sdkName: "lease_id"
|
|
948
|
+
}
|
|
949
|
+
],
|
|
950
|
+
query: []
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
resource: "agent.computers.leases.renew",
|
|
954
|
+
method: "create",
|
|
955
|
+
summary: "Renew computer lease",
|
|
956
|
+
description: `Extend the lease a connection holds so the full machine stays in service while the connection is open.
|
|
957
|
+
|
|
958
|
+
Own-face extension. A lease that is no longer valid (released, expired, or the computer moved to another machine) returns 409 LEASE_STALE; call connect again for a new connection and lease. Foreign or absent computers return 404.`,
|
|
959
|
+
http: "POST",
|
|
960
|
+
path: "/agent/v1/computers/{computer_id}/leases/{lease_id}/renew",
|
|
961
|
+
streaming: "no",
|
|
962
|
+
pagination: false,
|
|
963
|
+
pathParams: [
|
|
964
|
+
{
|
|
965
|
+
name: "computer_id",
|
|
966
|
+
sdkName: "computer_id"
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
name: "lease_id",
|
|
970
|
+
sdkName: "lease_id"
|
|
971
|
+
}
|
|
972
|
+
],
|
|
973
|
+
query: []
|
|
974
|
+
},
|
|
648
975
|
{
|
|
649
976
|
resource: "agent.deploymentRuns",
|
|
650
977
|
method: "list",
|
|
651
|
-
summary: "",
|
|
978
|
+
summary: "List deployment runs",
|
|
652
979
|
description: "List deployment runs newest first. Filter by deployment_id, has_error, trigger_type (manual or schedule) and created_at[gt|gte|lt|lte]. The default limit is 20, maximum 100; pass next_page as page with the same filters to continue. Each record identifies the resolved agent version and either its session or creation error.",
|
|
653
980
|
http: "GET",
|
|
654
981
|
path: "/agent/v1/deployment_runs",
|
|
@@ -723,7 +1050,7 @@ Praxis extension: MA only has session-scoped temporary containers and memory_sto
|
|
|
723
1050
|
{
|
|
724
1051
|
resource: "agent.deploymentRuns",
|
|
725
1052
|
method: "retrieve",
|
|
726
|
-
summary: "",
|
|
1053
|
+
summary: "Get deployment run",
|
|
727
1054
|
description: "Read a deployment run by the drun_ id returned by deployments.run or deployment_runs.list. Exactly one of session_id and error is non-null. Scheduled runs include scheduled_at in trigger_context. Foreign or absent ids return 404.",
|
|
728
1055
|
http: "GET",
|
|
729
1056
|
path: "/agent/v1/deployment_runs/{deployment_run_id}",
|
|
@@ -740,7 +1067,7 @@ Praxis extension: MA only has session-scoped temporary containers and memory_sto
|
|
|
740
1067
|
{
|
|
741
1068
|
resource: "agent.deployments",
|
|
742
1069
|
method: "list",
|
|
743
|
-
summary: "",
|
|
1070
|
+
summary: "List deployments",
|
|
744
1071
|
description: "List stored deployments newest first. Filter by agent_id, status, or inclusive created_at bounds; status and include_archived cannot be combined, even when include_archived is false. The default limit is 20, maximum 100; pass next_page as page to continue. Archived deployments are hidden by default. Schedules show up to five future wall-clock occurrences, also while paused; archived schedules show none.",
|
|
745
1072
|
http: "GET",
|
|
746
1073
|
path: "/agent/v1/deployments",
|
|
@@ -804,8 +1131,8 @@ archived).`
|
|
|
804
1131
|
{
|
|
805
1132
|
resource: "agent.deployments",
|
|
806
1133
|
method: "create",
|
|
807
|
-
summary: "",
|
|
808
|
-
description: "Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for personal agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources
|
|
1134
|
+
summary: "Create deployment",
|
|
1135
|
+
description: "Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for personal agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.",
|
|
809
1136
|
http: "POST",
|
|
810
1137
|
path: "/agent/v1/deployments",
|
|
811
1138
|
streaming: "no",
|
|
@@ -894,7 +1221,7 @@ created from this deployment. Maximum 50.`
|
|
|
894
1221
|
{
|
|
895
1222
|
resource: "agent.deployments",
|
|
896
1223
|
method: "retrieve",
|
|
897
|
-
summary: "",
|
|
1224
|
+
summary: "Get deployment",
|
|
898
1225
|
description: "Read a stored deployment by its depl_ id from deployments.create or deployments.list. The agent reference has a concrete version; own-face overrides are echoed unchanged. This read recomputes upcoming schedule times and does not execute the deployment. Foreign or absent ids return 404.",
|
|
899
1226
|
http: "GET",
|
|
900
1227
|
path: "/agent/v1/deployments/{deployment_id}",
|
|
@@ -911,7 +1238,7 @@ created from this deployment. Maximum 50.`
|
|
|
911
1238
|
{
|
|
912
1239
|
resource: "agent.deployments",
|
|
913
1240
|
method: "update",
|
|
914
|
-
summary: "",
|
|
1241
|
+
summary: "Update deployment",
|
|
915
1242
|
description: "Partially update a deployment. Omitted fields keep their values; a supplied agent id re-pins the latest version, or supply a versioned reference. Metadata merges string values and deletes keys set to null. Null clears schedule, resources and description; name, environment_id and initial_events cannot be cleared. Archived deployments return 409. Overrides apply to new sessions; updating a schedule recalculates its next occurrence.",
|
|
916
1243
|
http: "POST",
|
|
917
1244
|
path: "/agent/v1/deployments/{deployment_id}",
|
|
@@ -1009,7 +1336,7 @@ null to clear. Maximum 50.`
|
|
|
1009
1336
|
{
|
|
1010
1337
|
resource: "agent.deployments",
|
|
1011
1338
|
method: "archive",
|
|
1012
|
-
summary: "",
|
|
1339
|
+
summary: "Archive deployment",
|
|
1013
1340
|
description: "Archive a deployment by its depl_ id. Repeated calls are idempotent; archived deployments remain readable and have no upcoming schedule times. Subsequent update, pause and unpause calls return 409. This operation does not create a deployment run.",
|
|
1014
1341
|
http: "POST",
|
|
1015
1342
|
path: "/agent/v1/deployments/{deployment_id}/archive",
|
|
@@ -1026,7 +1353,7 @@ null to clear. Maximum 50.`
|
|
|
1026
1353
|
{
|
|
1027
1354
|
resource: "agent.deployments",
|
|
1028
1355
|
method: "pause",
|
|
1029
|
-
summary: "",
|
|
1356
|
+
summary: "Pause deployment",
|
|
1030
1357
|
description: "Pause an active deployment and set paused_reason to {type: manual}. Repeated pause calls are idempotent; archived deployments return 409. Upcoming schedule times remain visible while paused; no run is executed.",
|
|
1031
1358
|
http: "POST",
|
|
1032
1359
|
path: "/agent/v1/deployments/{deployment_id}/pause",
|
|
@@ -1043,7 +1370,7 @@ null to clear. Maximum 50.`
|
|
|
1043
1370
|
{
|
|
1044
1371
|
resource: "agent.deployments.run",
|
|
1045
1372
|
method: "create",
|
|
1046
|
-
summary: "",
|
|
1373
|
+
summary: "Run deployment",
|
|
1047
1374
|
description: "Create one session from an active deployment using its pinned agent version and stored parameters. Pass the depl_ id from deployments.create or deployments.list; no request body is needed. Returns a drun_ record with exactly one of session_id or error populated. Creation errors automatically pause the deployment; paused or archived deployments return 409 without a run. Unlike the own face, the compatible face rejects computer targets with 400.",
|
|
1048
1375
|
http: "POST",
|
|
1049
1376
|
path: "/agent/v1/deployments/{deployment_id}/run",
|
|
@@ -1058,21 +1385,97 @@ null to clear. Maximum 50.`
|
|
|
1058
1385
|
query: []
|
|
1059
1386
|
},
|
|
1060
1387
|
{
|
|
1061
|
-
resource: "agent.deployments.unpause",
|
|
1062
|
-
method: "create",
|
|
1063
|
-
summary: "",
|
|
1064
|
-
description: "Resume a paused deployment and clear paused_reason. Repeated unpause calls on an active deployment are idempotent; archived deployments return 409. This operation changes resource state only and does not execute a run.",
|
|
1065
|
-
http: "POST",
|
|
1066
|
-
path: "/agent/v1/deployments/{deployment_id}/unpause",
|
|
1388
|
+
resource: "agent.deployments.unpause",
|
|
1389
|
+
method: "create",
|
|
1390
|
+
summary: "Unpause deployment",
|
|
1391
|
+
description: "Resume a paused deployment and clear paused_reason. Repeated unpause calls on an active deployment are idempotent; archived deployments return 409. This operation changes resource state only and does not execute a run.",
|
|
1392
|
+
http: "POST",
|
|
1393
|
+
path: "/agent/v1/deployments/{deployment_id}/unpause",
|
|
1394
|
+
streaming: "no",
|
|
1395
|
+
pagination: false,
|
|
1396
|
+
pathParams: [
|
|
1397
|
+
{
|
|
1398
|
+
name: "deployment_id",
|
|
1399
|
+
sdkName: "deployment_id"
|
|
1400
|
+
}
|
|
1401
|
+
],
|
|
1402
|
+
query: []
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
resource: "agent.embed",
|
|
1406
|
+
method: "retrieveAppearance",
|
|
1407
|
+
summary: "Read chat appearance",
|
|
1408
|
+
description: "Load saved appearance for an iframe or Hosted chat page. Supply an end-user embed token as Bearer authorization, or a console-issued publishable key in Praxis-Publishable-Key before anonymous token issuance. The credential selects the agent; identity_number and agent_id query parameters are rejected with 400. Missing appearance returns an empty object. Kit option names retain camelCase. Responses are private and cacheable for 60 seconds. Component hosts configure Kit in their own code instead.",
|
|
1409
|
+
http: "GET",
|
|
1410
|
+
path: "/agent/v1/embed/appearance",
|
|
1411
|
+
streaming: "no",
|
|
1412
|
+
pagination: false,
|
|
1413
|
+
pathParams: [],
|
|
1414
|
+
query: []
|
|
1415
|
+
},
|
|
1416
|
+
{
|
|
1417
|
+
resource: "agent.embed.exchange",
|
|
1418
|
+
method: "create",
|
|
1419
|
+
summary: "Exchange Hosted Code",
|
|
1420
|
+
description: `Redeem a single-use hosted link credential for an end-user token.
|
|
1421
|
+
|
|
1422
|
+
Read code from the c fragment parameter of hosted_url returned by embed token creation with hosted true, then remove the fragment before exchanging. No Authorization header is required; the code authenticates this request. The code expires after 60 seconds and is consumed atomically on exchange, so concurrent attempts have only one winner. Expired, used and unknown codes return the same 404 body. Keep the token in memory and return to the host website for a fresh link when it expires; exchange cannot refresh it. Requests are IP limited per minute using the anonymous entrypoint budget (default 20). Example body is {"code":"<code from hosted_url>"}.`,
|
|
1423
|
+
http: "POST",
|
|
1424
|
+
path: "/agent/v1/embed/exchange",
|
|
1425
|
+
streaming: "no",
|
|
1426
|
+
pagination: false,
|
|
1427
|
+
pathParams: [],
|
|
1428
|
+
query: [],
|
|
1429
|
+
body: {
|
|
1430
|
+
required: true,
|
|
1431
|
+
fields: [
|
|
1432
|
+
{
|
|
1433
|
+
name: "code",
|
|
1434
|
+
type: "string",
|
|
1435
|
+
required: true,
|
|
1436
|
+
description: "Single-use credential from the c fragment parameter of hosted_url returned by embed token creation. Valid for 60 seconds."
|
|
1437
|
+
}
|
|
1438
|
+
]
|
|
1439
|
+
}
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
resource: "agent.embedTokens",
|
|
1443
|
+
method: "list",
|
|
1444
|
+
summary: "List Embed Tokens",
|
|
1445
|
+
description: `List embed token issuance records in your organization.
|
|
1446
|
+
|
|
1447
|
+
Includes expired and revoked grants; returns neither token nor token_id. Sorts by created_at, then grant id, both descending. agent_id accepts agent_ or agt_; external_user_id matches exactly. limit is 1–100 (default 20). Reuse next_page as page with the same filters and organization; a mismatch returns 400. End-user credentials return 404.`,
|
|
1448
|
+
http: "GET",
|
|
1449
|
+
path: "/agent/v1/embed_tokens",
|
|
1067
1450
|
streaming: "no",
|
|
1068
1451
|
pagination: false,
|
|
1069
|
-
pathParams: [
|
|
1452
|
+
pathParams: [],
|
|
1453
|
+
query: [
|
|
1070
1454
|
{
|
|
1071
|
-
name: "
|
|
1072
|
-
|
|
1455
|
+
name: "agent_id",
|
|
1456
|
+
type: "string",
|
|
1457
|
+
required: false,
|
|
1458
|
+
description: "Filter by service agent identifier (agent_ or agt_ prefix)."
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
name: "external_user_id",
|
|
1462
|
+
type: "string",
|
|
1463
|
+
required: false,
|
|
1464
|
+
description: "Exact host user identifier supplied at issuance."
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
name: "limit",
|
|
1468
|
+
type: "integer",
|
|
1469
|
+
required: false,
|
|
1470
|
+
description: "Maximum records per page; defaults to 20."
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
name: "page",
|
|
1474
|
+
type: "string",
|
|
1475
|
+
required: false,
|
|
1476
|
+
description: "next_page from a previous response with the same filters."
|
|
1073
1477
|
}
|
|
1074
|
-
]
|
|
1075
|
-
query: []
|
|
1478
|
+
]
|
|
1076
1479
|
},
|
|
1077
1480
|
{
|
|
1078
1481
|
resource: "agent.embedTokens",
|
|
@@ -1080,7 +1483,7 @@ null to clear. Maximum 50.`
|
|
|
1080
1483
|
summary: "Create Embed Token",
|
|
1081
1484
|
description: `Issue a short-lived credential on your backend for an end user of a service agent.
|
|
1082
1485
|
|
|
1083
|
-
Requires an active service agent in your organization with an embed policy. Pins the requested version or the latest version and snapshots the policy environment, vaults and resources; metadata comes from the request. Blocked users cannot receive tokens. Keep your API key on the backend and pass only the returned token to the frontend. Every call creates a new grant; issuance is not idempotent.
|
|
1486
|
+
Requires an active service agent in your organization with an embed policy. Pins the requested version or the latest version and snapshots the policy environment, vaults and resources; metadata comes from the request. Blocked users cannot receive tokens. Keep your API key on the backend and pass only the returned token to the frontend. Every call creates a new grant; issuance is not idempotent. Set hosted to true to also receive hosted_url; redirect the user there within 60 seconds. The agent must have an identity_number. The URL fragment contains a single-use exchange credential, not the token. Omit hosted or set false for ordinary token issuance.`,
|
|
1084
1487
|
http: "POST",
|
|
1085
1488
|
path: "/agent/v1/embed_tokens",
|
|
1086
1489
|
streaming: "no",
|
|
@@ -1090,6 +1493,12 @@ Requires an active service agent in your organization with an embed policy. Pins
|
|
|
1090
1493
|
body: {
|
|
1091
1494
|
required: true,
|
|
1092
1495
|
fields: [
|
|
1496
|
+
{
|
|
1497
|
+
name: "hosted",
|
|
1498
|
+
type: "boolean",
|
|
1499
|
+
required: false,
|
|
1500
|
+
description: "Set true to also return a hosted chat URL with a single-use credential valid for 60 seconds. Defaults to false; the agent must have an identity_number."
|
|
1501
|
+
},
|
|
1093
1502
|
{
|
|
1094
1503
|
name: "agent",
|
|
1095
1504
|
type: "string",
|
|
@@ -1149,10 +1558,60 @@ Requires an active service agent in your organization with an embed policy. Pins
|
|
|
1149
1558
|
]
|
|
1150
1559
|
}
|
|
1151
1560
|
},
|
|
1561
|
+
{
|
|
1562
|
+
resource: "agent.embedTokens.anonymous",
|
|
1563
|
+
method: "create",
|
|
1564
|
+
summary: "Issue anonymous visitor token",
|
|
1565
|
+
description: `Obtain a short-lived embedding token for a visitor without an account using the agent owner's publishable key.
|
|
1566
|
+
|
|
1567
|
+
No Authorization header is required. Send the browser Origin allowed by the agent policy. Save a returned visitor_secret and reuse it for refreshes; only new visitors receive one. Unknown secrets create new visitors, and extra fields including visitor_id return 400. Issuance uses the key creator's organization membership, the key session budget and the smaller of the policy TTL maximum and 3600 seconds. IP requests are limited per minute (default 20); UTC daily session and spending caps are checked across the key's primary sessions created that day. Token issuance itself does not create a session or charge usage; subsequent sessions bill the host organization. Example body: {"publishable_key":"pk_praxis_example"}.`,
|
|
1568
|
+
http: "POST",
|
|
1569
|
+
path: "/agent/v1/embed_tokens/anonymous",
|
|
1570
|
+
streaming: "no",
|
|
1571
|
+
pagination: false,
|
|
1572
|
+
pathParams: [],
|
|
1573
|
+
query: [],
|
|
1574
|
+
body: {
|
|
1575
|
+
required: true,
|
|
1576
|
+
fields: [
|
|
1577
|
+
{
|
|
1578
|
+
name: "publishable_key",
|
|
1579
|
+
type: "string",
|
|
1580
|
+
required: true,
|
|
1581
|
+
description: "Public key created by the service agent owner; safe to include in browser code."
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
name: "visitor_secret",
|
|
1585
|
+
type: "string",
|
|
1586
|
+
required: false,
|
|
1587
|
+
description: "Secret returned by a previous anonymous issuance for this key. Omit for a new visitor; an unknown secret creates a new visitor."
|
|
1588
|
+
}
|
|
1589
|
+
]
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
resource: "agent.embedTokens.revoke",
|
|
1594
|
+
method: "create",
|
|
1595
|
+
summary: "Revoke Embed Token",
|
|
1596
|
+
description: `Revoke an embed token and close its open event streams.
|
|
1597
|
+
|
|
1598
|
+
Use an id from issuance or listing. Revokes the credential before setting revoked_at; upstream failure leaves it unset. Streams receive session.error (EMBED_TOKEN_REVOKED), then close immediately; other credentials are unaffected. Idempotent; repeats return the original revoked record without another revocation or audit. Missing or foreign grants and end-user credentials return 404.`,
|
|
1599
|
+
http: "POST",
|
|
1600
|
+
path: "/agent/v1/embed_tokens/{id}/revoke",
|
|
1601
|
+
streaming: "no",
|
|
1602
|
+
pagination: false,
|
|
1603
|
+
pathParams: [
|
|
1604
|
+
{
|
|
1605
|
+
name: "id",
|
|
1606
|
+
sdkName: "id"
|
|
1607
|
+
}
|
|
1608
|
+
],
|
|
1609
|
+
query: []
|
|
1610
|
+
},
|
|
1152
1611
|
{
|
|
1153
1612
|
resource: "agent.environments",
|
|
1154
1613
|
method: "list",
|
|
1155
|
-
summary: "",
|
|
1614
|
+
summary: "List environments",
|
|
1156
1615
|
description: "List execution environments: the built-in recipes and the tenant-owned cloud environments that a session can run in. Archived environments are hidden unless include_archived is true. Pages hold at most 100 items (default 20); pass next_page as page to continue. Use the returned id as environment_id when creating a session.",
|
|
1157
1616
|
http: "GET",
|
|
1158
1617
|
path: "/agent/v1/environments",
|
|
@@ -1187,7 +1646,7 @@ Requires an active service agent in your organization with an embed policy. Pins
|
|
|
1187
1646
|
{
|
|
1188
1647
|
resource: "agent.environments",
|
|
1189
1648
|
method: "create",
|
|
1190
|
-
summary: "",
|
|
1649
|
+
summary: "Create environment",
|
|
1191
1650
|
description: "Create a tenant-owned cloud environment: a sandbox recipe (packages to install and networking policy) that sessions can select through environment_id. Package installation happens when the session's sandbox is created; a failed install terminates that session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. Limited networking is applied at sandbox creation. Unlike Anthropic Managed Agents, self_hosted environments, scope and cross-session package caching are not supported.",
|
|
1192
1651
|
http: "POST",
|
|
1193
1652
|
path: "/agent/v1/environments",
|
|
@@ -1241,7 +1700,7 @@ rejected. If not specified, defaults based on organization type.`
|
|
|
1241
1700
|
{
|
|
1242
1701
|
resource: "agent.environments",
|
|
1243
1702
|
method: "retrieve",
|
|
1244
|
-
summary: "",
|
|
1703
|
+
summary: "Get environment",
|
|
1245
1704
|
description: "Read one environment's configuration and status by id. Built-in environments are readable but never editable; tenant-owned ones can be updated or archived. environment_id comes from environments.list or environments.create.",
|
|
1246
1705
|
http: "GET",
|
|
1247
1706
|
path: "/agent/v1/environments/{environment_id}",
|
|
@@ -1258,7 +1717,7 @@ rejected. If not specified, defaults based on organization type.`
|
|
|
1258
1717
|
{
|
|
1259
1718
|
resource: "agent.environments",
|
|
1260
1719
|
method: "update",
|
|
1261
|
-
summary: "",
|
|
1720
|
+
summary: "Update environment",
|
|
1262
1721
|
description: "Update the configuration of a tenant-owned cloud environment. Built-in environments are read-only. Package installation and limited networking are applied when a session's sandbox is created. Omitted fields keep their value.",
|
|
1263
1722
|
http: "POST",
|
|
1264
1723
|
path: "/agent/v1/environments/{environment_id}",
|
|
@@ -1317,7 +1776,7 @@ owning account only.`
|
|
|
1317
1776
|
{
|
|
1318
1777
|
resource: "agent.environments",
|
|
1319
1778
|
method: "archive",
|
|
1320
|
-
summary: "",
|
|
1779
|
+
summary: "Archive environment",
|
|
1321
1780
|
description: "Soft-archive a tenant-owned cloud environment so it can no longer be used to create new sessions. Built-in environments are read-only and cannot be archived.",
|
|
1322
1781
|
http: "POST",
|
|
1323
1782
|
path: "/agent/v1/environments/{environment_id}/archive",
|
|
@@ -1334,7 +1793,7 @@ owning account only.`
|
|
|
1334
1793
|
{
|
|
1335
1794
|
resource: "agent.sessions",
|
|
1336
1795
|
method: "list",
|
|
1337
|
-
summary: "",
|
|
1796
|
+
summary: "List sessions",
|
|
1338
1797
|
description: "List sessions of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Unlike Anthropic Managed Agents, only limit, page, agent_id and deployment_id are honored; the other filters declared here (agent_version, created_at ranges, memory_store_id, include_archived, order, statuses) are not supported and return 400. Use the returned id with sessions.retrieve or sessions.events.list; pass next_page as page for the next page.",
|
|
1339
1798
|
http: "GET",
|
|
1340
1799
|
path: "/agent/v1/sessions",
|
|
@@ -1434,14 +1893,33 @@ owning account only.`
|
|
|
1434
1893
|
type: "string",
|
|
1435
1894
|
required: false,
|
|
1436
1895
|
description: "Opaque pagination cursor: pass the next_page value of the previous response unchanged. Omit it for the first page. A cursor from a different query or a malformed one returns 400."
|
|
1896
|
+
},
|
|
1897
|
+
{
|
|
1898
|
+
name: "external_user_id",
|
|
1899
|
+
type: "string",
|
|
1900
|
+
required: false,
|
|
1901
|
+
description: "Filter by an exact end-user identifier (1–128 characters: A-Z, a-z, 0-9, underscore, dot, colon, at sign or hyphen). Keep this filter unchanged when following page."
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
name: "source",
|
|
1905
|
+
type: "string",
|
|
1906
|
+
enum: [
|
|
1907
|
+
"kit",
|
|
1908
|
+
"iframe",
|
|
1909
|
+
"hosted",
|
|
1910
|
+
"api",
|
|
1911
|
+
"automation"
|
|
1912
|
+
],
|
|
1913
|
+
required: false,
|
|
1914
|
+
description: "Filter by session origin: kit, iframe, hosted, api or automation. Keep this filter unchanged when following page."
|
|
1437
1915
|
}
|
|
1438
1916
|
]
|
|
1439
1917
|
},
|
|
1440
1918
|
{
|
|
1441
1919
|
resource: "agent.sessions",
|
|
1442
1920
|
method: "create",
|
|
1443
|
-
summary: "",
|
|
1444
|
-
description: `Create a session: one conversation with an agent
|
|
1921
|
+
summary: "Create session",
|
|
1922
|
+
description: `Create a session: one conversation with an agent. Pass agent as an agent id (latest version) or {id, version, type:"agent"}. Unlike Anthropic Managed Agents, omit environment_id to get a light machine, unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, omission returns environment_id=light; explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Inline agent overrides are not supported. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Omitted budget defaults to USD 20; null removes the limit, and a limit object uses a positive integer string of USD cents. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.`,
|
|
1445
1923
|
http: "POST",
|
|
1446
1924
|
path: "/agent/v1/sessions",
|
|
1447
1925
|
streaming: "no",
|
|
@@ -1461,7 +1939,7 @@ owning account only.`
|
|
|
1461
1939
|
name: "environment_id",
|
|
1462
1940
|
type: "string",
|
|
1463
1941
|
required: false,
|
|
1464
|
-
description: "
|
|
1942
|
+
description: "Execution environment id from agent.environments.list or agent.environments.create. For a service agent, omission selects the built-in light environment and returns session.environment_id=light; explicit null allocates no machine and makes machine tools, including codemode and bash, unavailable. Personal agents use their selected Computer."
|
|
1465
1943
|
},
|
|
1466
1944
|
{
|
|
1467
1945
|
name: "budget",
|
|
@@ -1541,10 +2019,27 @@ offsets ("+08:00") and unknown names return 400. Never stored in
|
|
|
1541
2019
|
]
|
|
1542
2020
|
}
|
|
1543
2021
|
},
|
|
2022
|
+
{
|
|
2023
|
+
resource: "agent.sessions",
|
|
2024
|
+
method: "delete",
|
|
2025
|
+
summary: "Delete session",
|
|
2026
|
+
description: "Delete an idle or terminated session and its event history after saving a deletion snapshot. Supply the session id from creation or listing. Running sessions return 409 INVALID_STATE: interrupt first or wait until idle or terminated. Afterwards retrieval and event listing return 404 and lists omit the session. Example: DELETE /agent/v1/sessions/sesn_example.",
|
|
2027
|
+
http: "DELETE",
|
|
2028
|
+
path: "/agent/v1/sessions/{session_id}",
|
|
2029
|
+
streaming: "no",
|
|
2030
|
+
pagination: false,
|
|
2031
|
+
pathParams: [
|
|
2032
|
+
{
|
|
2033
|
+
name: "session_id",
|
|
2034
|
+
sdkName: "session_id"
|
|
2035
|
+
}
|
|
2036
|
+
],
|
|
2037
|
+
query: []
|
|
2038
|
+
},
|
|
1544
2039
|
{
|
|
1545
2040
|
resource: "agent.sessions",
|
|
1546
2041
|
method: "retrieve",
|
|
1547
|
-
summary: "",
|
|
2042
|
+
summary: "Get session",
|
|
1548
2043
|
description: "Read one session by id: its agent snapshot, status, model and thinking selection, resources, title, metadata and, for a fork, forked_from. Use it to poll status; to read what happened use sessions.events.list. This response does not include a machine object or sandbox id. With no environment_id or Computer selected at creation, the session starts on a light machine; no environment lookup or provisioning is needed for a codemode calculation.",
|
|
1549
2044
|
http: "GET",
|
|
1550
2045
|
path: "/agent/v1/sessions/{session_id}",
|
|
@@ -1561,8 +2056,8 @@ offsets ("+08:00") and unknown names return 400. Never stored in
|
|
|
1561
2056
|
{
|
|
1562
2057
|
resource: "agent.sessions",
|
|
1563
2058
|
method: "update",
|
|
1564
|
-
summary: "",
|
|
1565
|
-
description: "Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides
|
|
2059
|
+
summary: "Update session",
|
|
2060
|
+
description: "Update a session's title, metadata, model or thinking selection. metadata follows patch semantics: a string value sets the key, null deletes it, a null metadata clears all keys, untouched keys stay. model must be allowed by the session's agent version; thinking is {effort} or null (null restores inheritance); a model-only change clears a session thinking that the new model does not support, and combined changes are validated against the new model, with the previous selection kept on a 400. Changes apply from the next turn, not to a turn already running. Agent overrides are not supported (400 naming the field). Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.",
|
|
1566
2061
|
http: "POST",
|
|
1567
2062
|
path: "/agent/v1/sessions/{session_id}",
|
|
1568
2063
|
streaming: "no",
|
|
@@ -1627,7 +2122,7 @@ delete it. Omit the field to preserve.`
|
|
|
1627
2122
|
{
|
|
1628
2123
|
resource: "agent.sessions",
|
|
1629
2124
|
method: "archive",
|
|
1630
|
-
summary: "",
|
|
2125
|
+
summary: "Archive session",
|
|
1631
2126
|
description: "Archive a session. An archived session refuses new messages with 400 invalid_request_error, while its details and event history stay readable. Archiving again is idempotent and archived_at keeps the first archive time. Use it when a conversation is finished; it does not delete anything.",
|
|
1632
2127
|
http: "POST",
|
|
1633
2128
|
path: "/agent/v1/sessions/{session_id}/archive",
|
|
@@ -1813,8 +2308,8 @@ Praxis extension available only on /agent/v1, following Claude Agent SDK getCont
|
|
|
1813
2308
|
{
|
|
1814
2309
|
resource: "agent.sessions.events",
|
|
1815
2310
|
method: "list",
|
|
1816
|
-
summary: "",
|
|
1817
|
-
description: "Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval (session.status_idle with stop_reason requires_action lists their event_ids), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter.",
|
|
2311
|
+
summary: "List session events",
|
|
2312
|
+
description: "Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter.",
|
|
1818
2313
|
http: "GET",
|
|
1819
2314
|
path: "/agent/v1/sessions/{session_id}/events",
|
|
1820
2315
|
streaming: "no",
|
|
@@ -1884,8 +2379,8 @@ Praxis extension available only on /agent/v1, following Claude Agent SDK getCont
|
|
|
1884
2379
|
{
|
|
1885
2380
|
resource: "agent.sessions.events",
|
|
1886
2381
|
method: "send",
|
|
1887
|
-
summary: "",
|
|
1888
|
-
description: 'Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects.',
|
|
2382
|
+
summary: "Send session events",
|
|
2383
|
+
description: 'Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409.',
|
|
1889
2384
|
http: "POST",
|
|
1890
2385
|
path: "/agent/v1/sessions/{session_id}/events",
|
|
1891
2386
|
streaming: "no",
|
|
@@ -1913,7 +2408,7 @@ Praxis extension available only on /agent/v1, following Claude Agent SDK getCont
|
|
|
1913
2408
|
{
|
|
1914
2409
|
resource: "agent.sessions.events",
|
|
1915
2410
|
method: "stream",
|
|
1916
|
-
summary: "",
|
|
2411
|
+
summary: "Stream session events",
|
|
1917
2412
|
description: "Open a Server-Sent Events stream of a session's events in real time. Use it to show a reply as it is produced; to read past events use sessions.events.list. Send a message through sessions.events.send in another request while the stream is open. Closing the stream only drops your subscription and does not stop the agent. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use to also receive event_start / event_delta previews before the final event.",
|
|
1918
2413
|
http: "GET",
|
|
1919
2414
|
path: "/agent/v1/sessions/{session_id}/events/stream",
|
|
@@ -1972,7 +2467,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
1972
2467
|
{
|
|
1973
2468
|
resource: "agent.sessions.resources",
|
|
1974
2469
|
method: "list",
|
|
1975
|
-
summary: "",
|
|
2470
|
+
summary: "List session resources",
|
|
1976
2471
|
description: "List the extra resources (file references) attached to a session, oldest first, at most 1000 per page (default 1000). Use the returned id with sessions.resources.retrieve or sessions.resources.delete; next_page continues a truncated list.",
|
|
1977
2472
|
http: "GET",
|
|
1978
2473
|
path: "/agent/v1/sessions/{session_id}/resources",
|
|
@@ -2002,7 +2497,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
2002
2497
|
{
|
|
2003
2498
|
resource: "agent.sessions.resources",
|
|
2004
2499
|
method: "create",
|
|
2005
|
-
summary: "",
|
|
2500
|
+
summary: "Add session resource",
|
|
2006
2501
|
description: "Attach a file resource to a session by file_id, up to 500 per session. The file must exist and belong to your tenant. It is mounted under /mnt/session/uploads/<file_id> unless mount_path is given; custom paths are rooted there and parent traversal is rejected. File content is immutable through this API, and synchronizing it into a running sandbox is not implemented in this version.",
|
|
2007
2502
|
http: "POST",
|
|
2008
2503
|
path: "/agent/v1/sessions/{session_id}/resources",
|
|
@@ -2046,7 +2541,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
2046
2541
|
{
|
|
2047
2542
|
resource: "agent.sessions.resources",
|
|
2048
2543
|
method: "delete",
|
|
2049
|
-
summary: "",
|
|
2544
|
+
summary: "Delete session resource",
|
|
2050
2545
|
description: "Detach a resource from a session. Only the reference is removed; the underlying file is not deleted. The response is {id, type: session_resource_deleted}. resource_id comes from sessions.resources.list or the add call.",
|
|
2051
2546
|
http: "DELETE",
|
|
2052
2547
|
path: "/agent/v1/sessions/{session_id}/resources/{resource_id}",
|
|
@@ -2075,7 +2570,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
2075
2570
|
{
|
|
2076
2571
|
resource: "agent.sessions.resources",
|
|
2077
2572
|
method: "retrieve",
|
|
2078
|
-
summary: "",
|
|
2573
|
+
summary: "Get session resource",
|
|
2079
2574
|
description: "Read one resource attached to a session: its type, file_id, mount_path and timestamps. resource_id comes from sessions.resources.list or sessions.resources.add.",
|
|
2080
2575
|
http: "GET",
|
|
2081
2576
|
path: "/agent/v1/sessions/{session_id}/resources/{resource_id}",
|
|
@@ -2101,10 +2596,77 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
2101
2596
|
}
|
|
2102
2597
|
]
|
|
2103
2598
|
},
|
|
2599
|
+
{
|
|
2600
|
+
resource: "agent.sessions.runs",
|
|
2601
|
+
method: "deleteFeedback",
|
|
2602
|
+
summary: "Delete Run Feedback",
|
|
2603
|
+
description: `Remove the rating and comment for a run.
|
|
2604
|
+
|
|
2605
|
+
Own-face extension. Use the session id from session creation or listing and the run_id from its events. Requires a readable session and a run belonging to it. Idempotent; returns 204 even when no feedback exists. End users can delete feedback only for their own sessions. Does not delete the run or messages, enter model context, or start another run.`,
|
|
2606
|
+
http: "DELETE",
|
|
2607
|
+
path: "/agent/v1/sessions/{session_id}/runs/{run_id}/feedback",
|
|
2608
|
+
streaming: "no",
|
|
2609
|
+
pagination: false,
|
|
2610
|
+
pathParams: [
|
|
2611
|
+
{
|
|
2612
|
+
name: "session_id",
|
|
2613
|
+
sdkName: "session_id"
|
|
2614
|
+
},
|
|
2615
|
+
{
|
|
2616
|
+
name: "run_id",
|
|
2617
|
+
sdkName: "run_id"
|
|
2618
|
+
}
|
|
2619
|
+
],
|
|
2620
|
+
query: []
|
|
2621
|
+
},
|
|
2622
|
+
{
|
|
2623
|
+
resource: "agent.sessions.runs.feedback",
|
|
2624
|
+
method: "create",
|
|
2625
|
+
summary: "Set Run Feedback",
|
|
2626
|
+
description: `Submit thumbs up or thumbs down for a run, with an optional comment.
|
|
2627
|
+
|
|
2628
|
+
Own-face extension. Use a readable session and a run_id from its events. Each submission replaces the previous rating and comment; omitted or null comment clears it, while created_at is preserved. Comments allow at most 2000 Unicode characters. End users can submit only for their own sessions. Feedback never enters model context or starts a run. For example, submit {"rating":"positive","comment":"Helpful"}. POST follows Managed Agents resource update conventions; the resource remains unique per session and run.`,
|
|
2629
|
+
http: "POST",
|
|
2630
|
+
path: "/agent/v1/sessions/{session_id}/runs/{run_id}/feedback",
|
|
2631
|
+
streaming: "no",
|
|
2632
|
+
pagination: false,
|
|
2633
|
+
pathParams: [
|
|
2634
|
+
{
|
|
2635
|
+
name: "session_id",
|
|
2636
|
+
sdkName: "session_id"
|
|
2637
|
+
},
|
|
2638
|
+
{
|
|
2639
|
+
name: "run_id",
|
|
2640
|
+
sdkName: "run_id"
|
|
2641
|
+
}
|
|
2642
|
+
],
|
|
2643
|
+
query: [],
|
|
2644
|
+
body: {
|
|
2645
|
+
required: true,
|
|
2646
|
+
fields: [
|
|
2647
|
+
{
|
|
2648
|
+
name: "rating",
|
|
2649
|
+
type: "string",
|
|
2650
|
+
enum: [
|
|
2651
|
+
"positive",
|
|
2652
|
+
"negative"
|
|
2653
|
+
],
|
|
2654
|
+
required: true,
|
|
2655
|
+
description: "positive means thumbs up; negative means thumbs down for this run."
|
|
2656
|
+
},
|
|
2657
|
+
{
|
|
2658
|
+
name: "comment",
|
|
2659
|
+
type: "string",
|
|
2660
|
+
required: false,
|
|
2661
|
+
description: "Optional comment, at most 2000 Unicode characters. Omit or send null to clear the previous comment."
|
|
2662
|
+
}
|
|
2663
|
+
]
|
|
2664
|
+
}
|
|
2665
|
+
},
|
|
2104
2666
|
{
|
|
2105
2667
|
resource: "agent.sessions.threads",
|
|
2106
2668
|
method: "list",
|
|
2107
|
-
summary: "",
|
|
2669
|
+
summary: "List session threads",
|
|
2108
2670
|
description: "List the execution threads of a session: the primary thread plus every child thread started by subagents or advisors, in created_at order. Child threads reference the primary through parent_thread_id. Pages hold at most 100 threads (default 20). Use a thread id with sessions.threads.retrieve, sessions.threads.events.list or sessions.threads.events.stream.",
|
|
2109
2671
|
http: "GET",
|
|
2110
2672
|
path: "/agent/v1/sessions/{session_id}/threads",
|
|
@@ -2134,7 +2696,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
2134
2696
|
{
|
|
2135
2697
|
resource: "agent.sessions.threads",
|
|
2136
2698
|
method: "retrieve",
|
|
2137
|
-
summary: "",
|
|
2699
|
+
summary: "Get session thread",
|
|
2138
2700
|
description: "Read one execution thread of a session, field for field the same as its list item. Thread ids that are unknown, malformed or belong to another session all return 404, so existence is not revealed. thread_id comes from sessions.threads.list or from the session_thread_id of a session.thread_created event.",
|
|
2139
2701
|
http: "GET",
|
|
2140
2702
|
path: "/agent/v1/sessions/{session_id}/threads/{thread_id}",
|
|
@@ -2163,7 +2725,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
2163
2725
|
{
|
|
2164
2726
|
resource: "agent.sessions.threads",
|
|
2165
2727
|
method: "archive",
|
|
2166
|
-
summary: "",
|
|
2728
|
+
summary: "Archive session thread",
|
|
2167
2729
|
description: "Archive one execution thread. Archiving the primary thread archives the session; archiving a child archives only that child, leaving the parent and its siblings untouched. An archived child has status terminated and archived_at set, receives no new events and keeps its history readable.",
|
|
2168
2730
|
http: "POST",
|
|
2169
2731
|
path: "/agent/v1/sessions/{session_id}/threads/{thread_id}/archive",
|
|
@@ -2192,7 +2754,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
2192
2754
|
{
|
|
2193
2755
|
resource: "agent.sessions.threads.events",
|
|
2194
2756
|
method: "list",
|
|
2195
|
-
summary: "",
|
|
2757
|
+
summary: "List session thread events",
|
|
2196
2758
|
description: "Read the event history of one execution thread: the session itself for the primary thread, or the child session for a child thread. It accepts the same filters, ordering and paging as sessions.events.list and returns the same data + next_page envelope. Child approvals carry session_thread_id so you can route a confirmation to the owning thread.",
|
|
2197
2759
|
http: "GET",
|
|
2198
2760
|
path: "/agent/v1/sessions/{session_id}/threads/{thread_id}/events",
|
|
@@ -2233,7 +2795,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
2233
2795
|
{
|
|
2234
2796
|
resource: "agent.sessions.threads",
|
|
2235
2797
|
method: "stream",
|
|
2236
|
-
summary: "",
|
|
2798
|
+
summary: "Stream session thread events",
|
|
2237
2799
|
description: "Open a Server-Sent Events stream of one execution thread's live events, using the same implementation as sessions.events.stream; a read-only WebSocket is also available on this path. The parent session stream additionally carries child creation, status and message events. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use for incremental previews.",
|
|
2238
2800
|
http: "GET",
|
|
2239
2801
|
path: "/agent/v1/sessions/{session_id}/threads/{thread_id}/stream",
|
|
@@ -2988,6 +3550,27 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
2988
3550
|
],
|
|
2989
3551
|
query: []
|
|
2990
3552
|
},
|
|
3553
|
+
{
|
|
3554
|
+
resource: "application.workers.versions.assets",
|
|
3555
|
+
method: "retrieveManifest",
|
|
3556
|
+
summary: "Get version asset manifest",
|
|
3557
|
+
description: "Read the retained asset paths, content hashes and byte sizes of a version for publication planning. This read creates no session or version. A version without assets returns an empty manifest; unavailable artifacts and foreign resources return 404.",
|
|
3558
|
+
http: "GET",
|
|
3559
|
+
path: "/application/v1/workers/{worker_id}/versions/{version_id}/assets/manifest",
|
|
3560
|
+
streaming: "no",
|
|
3561
|
+
pagination: false,
|
|
3562
|
+
pathParams: [
|
|
3563
|
+
{
|
|
3564
|
+
name: "worker_id",
|
|
3565
|
+
sdkName: "worker_id"
|
|
3566
|
+
},
|
|
3567
|
+
{
|
|
3568
|
+
name: "version_id",
|
|
3569
|
+
sdkName: "version_id"
|
|
3570
|
+
}
|
|
3571
|
+
],
|
|
3572
|
+
query: []
|
|
3573
|
+
},
|
|
2991
3574
|
{
|
|
2992
3575
|
resource: "automation.actions",
|
|
2993
3576
|
method: "list",
|
|
@@ -6411,7 +6994,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6411
6994
|
name: "{column}",
|
|
6412
6995
|
type: "string",
|
|
6413
6996
|
required: false,
|
|
6414
|
-
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
6997
|
+
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported."
|
|
6415
6998
|
},
|
|
6416
6999
|
{
|
|
6417
7000
|
name: "and",
|
|
@@ -6459,7 +7042,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6459
7042
|
name: "on_conflict",
|
|
6460
7043
|
type: "string",
|
|
6461
7044
|
required: false,
|
|
6462
|
-
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
7045
|
+
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
6463
7046
|
},
|
|
6464
7047
|
{
|
|
6465
7048
|
name: "columns",
|
|
@@ -6473,7 +7056,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6473
7056
|
resource: "database.databases.rest",
|
|
6474
7057
|
method: "retrieve",
|
|
6475
7058
|
summary: "Select rows",
|
|
6476
|
-
description: "Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24/*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property.
|
|
7059
|
+
description: "Read matching rows with filters, selected columns and ordering. Returns at most 1000 rows per request, including when limit is omitted. Content-Range reports the actual returned interval and the total when count is requested. PATCH and DELETE are not subject to this read cap. Unlike Supabase, casts, aggregates, spread and join modifiers are unsupported. Each table supports up to 1,000,000 rows. Query budget: 8,000 ms with a shared 3,000,000-row safety ceiling. Create indexes on filtered or sorted fields, or narrow the request when it exceeds its budget. Synchronous SQLite aggregates use candidate-row throughput estimates before execution; deployed Workers freeze clocks during synchronous CPU work, so the timer is not a guaranteed server-side interrupt. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24/*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Error table: QUERY_CANCELED / PostgREST 57014 is HTTP 500, retryable=false: Query timed out: index filtered or sorted fields, or narrow the range. DATABASE_INVALID_STATE is HTTP 409 for operations on a deleting database. Cleared or nonexistent databases return DATABASE_NOT_FOUND / HTTP 404. The count is an HTTP Content-Range response header, not a JSON property. Use praxis.database.count in the SDK or codemode to return { count: number | null }; a page length is not a total unless you know all matches fit in that page.",
|
|
6477
7060
|
http: "GET",
|
|
6478
7061
|
path: "/database/v1/databases/{database_id}/rest/{table}",
|
|
6479
7062
|
streaming: "no",
|
|
@@ -6499,7 +7082,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6499
7082
|
name: "{column}",
|
|
6500
7083
|
type: "string",
|
|
6501
7084
|
required: false,
|
|
6502
|
-
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
7085
|
+
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported."
|
|
6503
7086
|
},
|
|
6504
7087
|
{
|
|
6505
7088
|
name: "and",
|
|
@@ -6547,7 +7130,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6547
7130
|
name: "on_conflict",
|
|
6548
7131
|
type: "string",
|
|
6549
7132
|
required: false,
|
|
6550
|
-
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
7133
|
+
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
6551
7134
|
},
|
|
6552
7135
|
{
|
|
6553
7136
|
name: "columns",
|
|
@@ -6561,7 +7144,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6561
7144
|
resource: "database.databases.rest",
|
|
6562
7145
|
method: "head",
|
|
6563
7146
|
summary: "Count rows",
|
|
6564
|
-
description: "Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is */*. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24/*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode.
|
|
7147
|
+
description: "Inspect the HTTP row count and range without retrieving row data; send Prefer: count=exact for a filtered count. Returns no body and does not fetch or serialize row data. A known count determines the interval using limit/offset or Range with a default and maximum page size of 1000. Without a count preference, or when the selected count mode cannot supply a total, Content-Range is */*. Singular Accept still validates page cardinality. Unlike Supabase, planned and estimated counts do not use PostgreSQL planner estimates. Count preferences: without filters, exact, planned and estimated all use SQLite's exact b-tree count. With filters, exact counts within budget; planned skips counting and reports an unknown total (Content-Range: 0-24/*); estimated attempts exact counting only when the preflight budget allows it, otherwise reports an unknown total. Preference-Applied echoes the requested count mode. Use praxis.database.count in the SDK or codemode to return { count: number | null } from this header without retrieving rows.",
|
|
6565
7148
|
http: "HEAD",
|
|
6566
7149
|
path: "/database/v1/databases/{database_id}/rest/{table}",
|
|
6567
7150
|
streaming: "no",
|
|
@@ -6587,7 +7170,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6587
7170
|
name: "{column}",
|
|
6588
7171
|
type: "string",
|
|
6589
7172
|
required: false,
|
|
6590
|
-
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
7173
|
+
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported."
|
|
6591
7174
|
},
|
|
6592
7175
|
{
|
|
6593
7176
|
name: "and",
|
|
@@ -6635,7 +7218,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6635
7218
|
name: "on_conflict",
|
|
6636
7219
|
type: "string",
|
|
6637
7220
|
required: false,
|
|
6638
|
-
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
7221
|
+
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
6639
7222
|
},
|
|
6640
7223
|
{
|
|
6641
7224
|
name: "columns",
|
|
@@ -6675,7 +7258,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6675
7258
|
name: "{column}",
|
|
6676
7259
|
type: "string",
|
|
6677
7260
|
required: false,
|
|
6678
|
-
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
7261
|
+
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported."
|
|
6679
7262
|
},
|
|
6680
7263
|
{
|
|
6681
7264
|
name: "and",
|
|
@@ -6723,7 +7306,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6723
7306
|
name: "on_conflict",
|
|
6724
7307
|
type: "string",
|
|
6725
7308
|
required: false,
|
|
6726
|
-
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
7309
|
+
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
6727
7310
|
},
|
|
6728
7311
|
{
|
|
6729
7312
|
name: "columns",
|
|
@@ -6743,7 +7326,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
|
|
|
6743
7326
|
summary: "Insert rows",
|
|
6744
7327
|
description: `Insert rows into an existing table after defining its fields; at most 500 rows per request. Each request is atomic: any failure rolls back the entire batch. There are no transactions across requests.
|
|
6745
7328
|
Rows are filled to the union of their keys with null; send Prefer: missing=default to use field defaults for missing keys.
|
|
6746
|
-
The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.`,
|
|
7329
|
+
The default is return=minimal: success returns HTTP 201 with an empty body. Send Prefer: return=representation to return the inserted rows. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. Unlike Supabase, upsert conflicts can target only id or one unique field, not a composite key. Each table supports up to 1,000,000 rows.`,
|
|
6747
7330
|
http: "POST",
|
|
6748
7331
|
path: "/database/v1/databases/{database_id}/rest/{table}",
|
|
6749
7332
|
streaming: "no",
|
|
@@ -6769,7 +7352,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
6769
7352
|
name: "{column}",
|
|
6770
7353
|
type: "string",
|
|
6771
7354
|
required: false,
|
|
6772
|
-
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns.
|
|
7355
|
+
description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. Supported operators: eq (equal), neq (not equal; ne is not supported), gt/gte/lt/lte (comparisons), like (case-sensitive text pattern), ilike (case-insensitive text pattern), in (membership), is (null/boolean test), cs (contains), cd (contained by), and ov (array overlap). For like/ilike, * or % matches any sequence and _ matches one character, e.g. title=ilike.*spring*; URL-encode a literal % as %25. Use days=in.(1,2,3), title=is.null, active=is.true or active=is.false; is.not_null and is.unknown are also accepted (unknown means null). Negate a condition with not., e.g. title=not.eq.draft. Multiple filters are ANDed; use or=(title.eq.a,title.eq.b), and=(days.gte.1,days.lte.3), not.or=(...) or not.and=(...), with nested and(...) and or(...) groups as needed. cs/cd accept JSON objects or arrays on JSON fields; cs also accepts a JSON scalar. For array values or multi-link fields, use cs.{a,b}, cd.{a,b} or ov.{a,b}. JSON paths use -> for JSON and ->> for text, e.g. attributes->>has_onsen=eq.true or attributes->tags=cs.[1,2]; chain -> segments and end with ->> for text. Dot paths such as attributes.has_onsen are unsupported. Full-text, regex, range operators and any/all modifiers are unsupported."
|
|
6773
7356
|
},
|
|
6774
7357
|
{
|
|
6775
7358
|
name: "and",
|
|
@@ -6817,7 +7400,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
6817
7400
|
name: "on_conflict",
|
|
6818
7401
|
type: "string",
|
|
6819
7402
|
required: false,
|
|
6820
|
-
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
7403
|
+
description: "POST upsert: id or one unique field with resolution=merge-duplicates|ignore-duplicates. With resolution=merge-duplicates, a conflicting row keeps columns omitted from the request; supplied values replace the whole field value (including JSON objects), and explicit null clears a nullable field. With resolution=ignore-duplicates, a conflicting row is left unchanged. Without a conflict, both modes insert a new row using field defaults for omitted fields. In a batch, a key present in another row is filled with null when omitted in this row unless missing=default is set; that null can overwrite a value during merge. With missing=default, omitted keys stay omitted for conflict merges (existing values are preserved); new rows use defaults, or null when no default exists. Explicit null never invokes a default. POST accepts an optional client id matching [A-Za-z0-9_-]{1,64}; omitted ids are generated. PATCH cannot change id."
|
|
6821
7404
|
},
|
|
6822
7405
|
{
|
|
6823
7406
|
name: "columns",
|
|
@@ -6869,7 +7452,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
6869
7452
|
resource: "database.databases.tables",
|
|
6870
7453
|
method: "create",
|
|
6871
7454
|
summary: "Create table",
|
|
6872
|
-
description:
|
|
7455
|
+
description: 'Creates a table together with its initial fields in one call and returns it (HTTP 201) with generated tbl_ and fld_ ids. name must match ^[a-z_][a-z0-9_]{0,62}$ and be unused in this database (duplicate: 409 UNIQUE_VIOLATION). fields is required and may be an empty array; fields can also be added later with databaseAddField. Limits: 50 tables per database, 64 fields per table, and 16 indexed or unique fields per table; exceeding one returns 400 LIMIT_EXCEEDED. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. Every row also has a system id column, which is not declared as a field. Insert data afterwards with databaseInsert. Unlike Supabase, define schema with this table API and the field APIs; PostgreSQL DDL and SQL migration files cannot be submitted. Each table supports up to 1,000,000 rows.',
|
|
6873
7456
|
http: "POST",
|
|
6874
7457
|
path: "/database/v1/databases/{database_id}/tables",
|
|
6875
7458
|
streaming: "no",
|
|
@@ -6990,7 +7573,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
6990
7573
|
resource: "database.databases.tables.fields",
|
|
6991
7574
|
method: "create",
|
|
6992
7575
|
summary: "Add field",
|
|
6993
|
-
description:
|
|
7576
|
+
description: 'Adds one field to an existing table and returns the updated table (HTTP 201). Required inputs are name (lowercase letters, digits and underscores; id and names starting with _ are reserved) and type (string, integer, number, boolean, datetime, json or link); json needs options.schema and link needs options.linked_table_id and options.multiple. Adding a required field to a table that already has rows needs a default, otherwise the call fails with 400 VALIDATION_FAILED; a default is written into every existing row. Fields default to indexed:false. Set indexed:true explicitly for fields used in filters or ordering. Only indexed:true or unique:true consumes one of the 16 indexed-or-unique field slots; a field with both consumes one slot. Unique fields still consume a slot even with indexed:false. Existing fields are unchanged. Minimal field example: {"name":"notes","type":"string","indexed":false}. JSON and link fields cannot be indexed. Limits: 64 fields and 16 indexed or unique fields per table (400 LIMIT_EXCEEDED). Unlike Supabase, schema evolution uses field definitions rather than ALTER TABLE statements or SQL migrations.',
|
|
6994
7577
|
http: "POST",
|
|
6995
7578
|
path: "/database/v1/databases/{database_id}/tables/{table}/fields",
|
|
6996
7579
|
streaming: "no",
|
|
@@ -7154,28 +7737,137 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
7154
7737
|
required: false,
|
|
7155
7738
|
description: "File ID cursor for the preceding page; mutually exclusive with after. Use an ID from the current listing."
|
|
7156
7739
|
}
|
|
7157
|
-
]
|
|
7740
|
+
]
|
|
7741
|
+
},
|
|
7742
|
+
{
|
|
7743
|
+
resource: "file.files",
|
|
7744
|
+
method: "create",
|
|
7745
|
+
summary: "Upload file",
|
|
7746
|
+
description: 'Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most 100000000 bytes, and only user_data, assistants and vision purposes are accepted. Send file bytes as a multipart file part, not a filename or file ID; in the SDK use a File or Blob, for example new File(["Return within 23 days."], "policy.txt", { type: "text/plain" }). Content determines the MIME type. Supported uploads include PDF, DOCX/XLSX/PPTX, PNG/JPEG/GIF/WebP, MP3/WAV/FLAC/OGG/M4A, MP4/WebM, and UTF-8 JSON/NDJSON/CSV/Markdown/plain text; empty, unsupported, oversized files and unsupported purposes return 400. Use Uploads for larger files. The purpose vision accepts only PNG, JPEG, GIF and WebP, while conversation images require user_data. The returned ID belongs to your tenant; upload alone does not ingest the file into Knowledge. Knowledge attachment has a lower limit of 100000000 bytes. Optionally set expires_after[anchor]=created_at with expires_after[seconds] (3600–2592000), or praxis[expires_in_seconds] (3600–7776000), never both. Without expiry, the file persists until deleted.',
|
|
7747
|
+
http: "POST",
|
|
7748
|
+
path: "/file/v1/files",
|
|
7749
|
+
streaming: "no",
|
|
7750
|
+
pagination: false,
|
|
7751
|
+
multipart: true,
|
|
7752
|
+
pathParams: [],
|
|
7753
|
+
query: [],
|
|
7754
|
+
body: {
|
|
7755
|
+
required: true,
|
|
7756
|
+
fields: [
|
|
7757
|
+
{
|
|
7758
|
+
name: "file",
|
|
7759
|
+
type: "string",
|
|
7760
|
+
required: true,
|
|
7761
|
+
description: "File bytes in one multipart file part, not a filename or file ID. The file must be nonempty and at most 100000000 bytes; its content determines the MIME type."
|
|
7762
|
+
},
|
|
7763
|
+
{
|
|
7764
|
+
name: "purpose",
|
|
7765
|
+
type: "string",
|
|
7766
|
+
enum: [
|
|
7767
|
+
"user_data",
|
|
7768
|
+
"assistants",
|
|
7769
|
+
"vision"
|
|
7770
|
+
],
|
|
7771
|
+
required: true,
|
|
7772
|
+
description: "Purpose label stored with the file: user_data, assistants or vision. The vision purpose accepts only PNG, JPEG, GIF and WebP images. Conversation image references require user_data."
|
|
7773
|
+
},
|
|
7774
|
+
{
|
|
7775
|
+
name: "expires_after",
|
|
7776
|
+
type: "object",
|
|
7777
|
+
required: false,
|
|
7778
|
+
description: "Optional expiry relative to created_at. Files without an expiry persist until deleted."
|
|
7779
|
+
},
|
|
7780
|
+
{
|
|
7781
|
+
name: "praxis",
|
|
7782
|
+
type: "object",
|
|
7783
|
+
required: false,
|
|
7784
|
+
description: "Own-face extensions. Use at most one expiry setting."
|
|
7785
|
+
}
|
|
7786
|
+
]
|
|
7787
|
+
}
|
|
7788
|
+
},
|
|
7789
|
+
{
|
|
7790
|
+
resource: "file.files",
|
|
7791
|
+
method: "delete",
|
|
7792
|
+
summary: "Delete file",
|
|
7793
|
+
description: "Delete a tenant-owned file. New metadata/content reads return not found. Already-authorized downloads may finish.",
|
|
7794
|
+
http: "DELETE",
|
|
7795
|
+
path: "/file/v1/files/{file_id}",
|
|
7796
|
+
streaming: "no",
|
|
7797
|
+
pagination: false,
|
|
7798
|
+
pathParams: [
|
|
7799
|
+
{
|
|
7800
|
+
name: "file_id",
|
|
7801
|
+
sdkName: "file_id"
|
|
7802
|
+
}
|
|
7803
|
+
],
|
|
7804
|
+
query: []
|
|
7805
|
+
},
|
|
7806
|
+
{
|
|
7807
|
+
resource: "file.files",
|
|
7808
|
+
method: "retrieve",
|
|
7809
|
+
summary: "Retrieve file",
|
|
7810
|
+
description: "Retrieve metadata for a live file owned by your tenant. Use its file- ID from upload or list. Missing, deleted, expired and other-tenant files return 404; use the content endpoint to download the bytes.",
|
|
7811
|
+
http: "GET",
|
|
7812
|
+
path: "/file/v1/files/{file_id}",
|
|
7813
|
+
streaming: "no",
|
|
7814
|
+
pagination: false,
|
|
7815
|
+
pathParams: [
|
|
7816
|
+
{
|
|
7817
|
+
name: "file_id",
|
|
7818
|
+
sdkName: "file_id"
|
|
7819
|
+
}
|
|
7820
|
+
],
|
|
7821
|
+
query: []
|
|
7822
|
+
},
|
|
7823
|
+
{
|
|
7824
|
+
resource: "file.files",
|
|
7825
|
+
method: "retrieveContent",
|
|
7826
|
+
summary: "Retrieve file content",
|
|
7827
|
+
description: "Download the original bytes of a live file owned by your tenant. Supply its file- ID from upload or list. A single byte Range can return a partial response; a range outside the file returns 416. Missing, deleted, expired and other-tenant files return 404.",
|
|
7828
|
+
http: "GET",
|
|
7829
|
+
path: "/file/v1/files/{file_id}/content",
|
|
7830
|
+
streaming: "no",
|
|
7831
|
+
pagination: false,
|
|
7832
|
+
pathParams: [
|
|
7833
|
+
{
|
|
7834
|
+
name: "file_id",
|
|
7835
|
+
sdkName: "file_id"
|
|
7836
|
+
}
|
|
7837
|
+
],
|
|
7838
|
+
query: []
|
|
7158
7839
|
},
|
|
7159
7840
|
{
|
|
7160
|
-
resource: "file.
|
|
7841
|
+
resource: "file.uploads",
|
|
7161
7842
|
method: "create",
|
|
7162
|
-
summary: "
|
|
7163
|
-
description:
|
|
7843
|
+
summary: "Create an upload",
|
|
7844
|
+
description: "Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 2 GiB (2147483648 bytes) and only user_data, assistants and vision purposes. Add parts of at most 64000000 bytes and complete within one hour. Optional part_size enables fixed-size, retryable parts. expires_after applies to the resulting file (3600–7776000 seconds on this own face); without it the file persists until deleted.",
|
|
7164
7845
|
http: "POST",
|
|
7165
|
-
path: "/file/v1/
|
|
7846
|
+
path: "/file/v1/uploads",
|
|
7166
7847
|
streaming: "no",
|
|
7167
7848
|
pagination: false,
|
|
7168
|
-
multipart: true,
|
|
7169
7849
|
pathParams: [],
|
|
7170
7850
|
query: [],
|
|
7171
7851
|
body: {
|
|
7172
7852
|
required: true,
|
|
7173
7853
|
fields: [
|
|
7174
7854
|
{
|
|
7175
|
-
name: "
|
|
7855
|
+
name: "bytes",
|
|
7856
|
+
type: "integer",
|
|
7857
|
+
required: true,
|
|
7858
|
+
description: "Exact complete file length in bytes, from 1 through 2147483648 (2 GiB); the sum of completed parts must match."
|
|
7859
|
+
},
|
|
7860
|
+
{
|
|
7861
|
+
name: "filename",
|
|
7862
|
+
type: "string",
|
|
7863
|
+
required: true,
|
|
7864
|
+
description: "Filename for the resulting file, at most 255 UTF-8 bytes."
|
|
7865
|
+
},
|
|
7866
|
+
{
|
|
7867
|
+
name: "mime_type",
|
|
7176
7868
|
type: "string",
|
|
7177
7869
|
required: true,
|
|
7178
|
-
description: "
|
|
7870
|
+
description: "Declared MIME type; validated against the assembled content."
|
|
7179
7871
|
},
|
|
7180
7872
|
{
|
|
7181
7873
|
name: "purpose",
|
|
@@ -7186,73 +7878,110 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
7186
7878
|
"vision"
|
|
7187
7879
|
],
|
|
7188
7880
|
required: true,
|
|
7189
|
-
description: "
|
|
7881
|
+
description: "Use user_data for conversation attachments, assistants for assistant files, or vision for PNG, JPEG, GIF and WebP images."
|
|
7190
7882
|
},
|
|
7191
7883
|
{
|
|
7192
7884
|
name: "expires_after",
|
|
7193
7885
|
type: "object",
|
|
7194
7886
|
required: false,
|
|
7195
|
-
description: "Optional expiry
|
|
7887
|
+
description: "Optional expiry policy for the resulting file; omission retains the file until deletion."
|
|
7196
7888
|
},
|
|
7197
7889
|
{
|
|
7198
|
-
name: "
|
|
7199
|
-
type: "
|
|
7890
|
+
name: "part_size",
|
|
7891
|
+
type: "integer",
|
|
7200
7892
|
required: false,
|
|
7201
|
-
description: "
|
|
7893
|
+
description: "Optional fixed part size in bytes, 5242880–64000000. Requires part_number on every part; retries of identical bytes at the same number return the same part. Omit to use arbitrary-sized parts."
|
|
7202
7894
|
}
|
|
7203
7895
|
]
|
|
7204
7896
|
}
|
|
7205
7897
|
},
|
|
7206
7898
|
{
|
|
7207
|
-
resource: "file.
|
|
7208
|
-
method: "
|
|
7209
|
-
summary: "
|
|
7210
|
-
description: "
|
|
7211
|
-
http: "
|
|
7212
|
-
path: "/file/v1/
|
|
7899
|
+
resource: "file.uploads",
|
|
7900
|
+
method: "cancel",
|
|
7901
|
+
summary: "Cancel an upload",
|
|
7902
|
+
description: "Cancel an unfinished upload using upload_id from create and release its reserved storage. Further parts and completion are rejected. Cancelling an already cancelled upload returns the same terminal result; a completed upload cannot be cancelled. Delete its resulting file instead.",
|
|
7903
|
+
http: "POST",
|
|
7904
|
+
path: "/file/v1/uploads/{upload_id}/cancel",
|
|
7213
7905
|
streaming: "no",
|
|
7214
7906
|
pagination: false,
|
|
7215
7907
|
pathParams: [
|
|
7216
7908
|
{
|
|
7217
|
-
name: "
|
|
7218
|
-
sdkName: "
|
|
7909
|
+
name: "upload_id",
|
|
7910
|
+
sdkName: "upload_id"
|
|
7219
7911
|
}
|
|
7220
7912
|
],
|
|
7221
7913
|
query: []
|
|
7222
7914
|
},
|
|
7223
7915
|
{
|
|
7224
|
-
resource: "file.
|
|
7225
|
-
method: "
|
|
7226
|
-
summary: "
|
|
7227
|
-
description: "
|
|
7228
|
-
http: "
|
|
7229
|
-
path: "/file/v1/
|
|
7916
|
+
resource: "file.uploads",
|
|
7917
|
+
method: "complete",
|
|
7918
|
+
summary: "Complete an upload",
|
|
7919
|
+
description: "Assemble the uploaded parts into a file. Supply upload_id from create and part_ids from addPart in file byte order; their sizes must total the declared bytes. Optional md5 verifies the assembled content. Retrying identical part_ids and normalized md5 returns the same result; different inputs return 409. Unlike OpenAI, completed can contain a file still processing (status uploaded). Poll files.retrieve using file.id until status processed (own face state active); error, expiry or 404 means processing failed and the file cannot be used.",
|
|
7920
|
+
http: "POST",
|
|
7921
|
+
path: "/file/v1/uploads/{upload_id}/complete",
|
|
7230
7922
|
streaming: "no",
|
|
7231
7923
|
pagination: false,
|
|
7232
7924
|
pathParams: [
|
|
7233
7925
|
{
|
|
7234
|
-
name: "
|
|
7235
|
-
sdkName: "
|
|
7926
|
+
name: "upload_id",
|
|
7927
|
+
sdkName: "upload_id"
|
|
7236
7928
|
}
|
|
7237
7929
|
],
|
|
7238
|
-
query: []
|
|
7930
|
+
query: [],
|
|
7931
|
+
body: {
|
|
7932
|
+
required: true,
|
|
7933
|
+
fields: [
|
|
7934
|
+
{
|
|
7935
|
+
name: "part_ids",
|
|
7936
|
+
type: "array",
|
|
7937
|
+
itemType: "string",
|
|
7938
|
+
required: true,
|
|
7939
|
+
description: "All part IDs in concatenation order, without duplicates. Fixed-size uploads require increasing part_number order."
|
|
7940
|
+
},
|
|
7941
|
+
{
|
|
7942
|
+
name: "md5",
|
|
7943
|
+
type: "string",
|
|
7944
|
+
required: false,
|
|
7945
|
+
description: "Optional whole-file MD5 as 32 hexadecimal characters; verified after assembly."
|
|
7946
|
+
}
|
|
7947
|
+
]
|
|
7948
|
+
}
|
|
7239
7949
|
},
|
|
7240
7950
|
{
|
|
7241
|
-
resource: "file.
|
|
7242
|
-
method: "
|
|
7243
|
-
summary: "
|
|
7244
|
-
description: "
|
|
7245
|
-
http: "
|
|
7246
|
-
path: "/file/v1/
|
|
7951
|
+
resource: "file.uploads.parts",
|
|
7952
|
+
method: "create",
|
|
7953
|
+
summary: "Add an upload part",
|
|
7954
|
+
description: "Send one nonempty part as the multipart data field, at most 64000000 bytes. Parts may arrive concurrently in any order. Use upload_id from create. For a fixed-size upload, supply part_number starting at 1 and exactly part_size bytes except for the final remainder; retry the same number with identical bytes to recover its part ID. Without part_size, each request creates a new part and part_number is ignored. Save the returned part IDs for complete.",
|
|
7955
|
+
http: "POST",
|
|
7956
|
+
path: "/file/v1/uploads/{upload_id}/parts",
|
|
7247
7957
|
streaming: "no",
|
|
7248
7958
|
pagination: false,
|
|
7959
|
+
multipart: true,
|
|
7249
7960
|
pathParams: [
|
|
7250
7961
|
{
|
|
7251
|
-
name: "
|
|
7252
|
-
sdkName: "
|
|
7962
|
+
name: "upload_id",
|
|
7963
|
+
sdkName: "upload_id"
|
|
7253
7964
|
}
|
|
7254
7965
|
],
|
|
7255
|
-
query: [
|
|
7966
|
+
query: [
|
|
7967
|
+
{
|
|
7968
|
+
name: "part_number",
|
|
7969
|
+
type: "integer",
|
|
7970
|
+
required: false,
|
|
7971
|
+
description: "Required when create set part_size; 1 through ceil(bytes / part_size). Ignored for general uploads."
|
|
7972
|
+
}
|
|
7973
|
+
],
|
|
7974
|
+
body: {
|
|
7975
|
+
required: true,
|
|
7976
|
+
fields: [
|
|
7977
|
+
{
|
|
7978
|
+
name: "data",
|
|
7979
|
+
type: "string",
|
|
7980
|
+
required: true,
|
|
7981
|
+
description: "Raw bytes of this part, nonempty and at most 64000000 bytes."
|
|
7982
|
+
}
|
|
7983
|
+
]
|
|
7984
|
+
}
|
|
7256
7985
|
},
|
|
7257
7986
|
{
|
|
7258
7987
|
resource: "knowledge.vectorStores",
|
|
@@ -11539,80 +12268,223 @@ for more details.`
|
|
|
11539
12268
|
sdkName: "id"
|
|
11540
12269
|
}
|
|
11541
12270
|
],
|
|
11542
|
-
query: []
|
|
11543
|
-
},
|
|
11544
|
-
{
|
|
11545
|
-
resource: "organization.feedback",
|
|
11546
|
-
method: "
|
|
11547
|
-
summary: "
|
|
11548
|
-
description:
|
|
11549
|
-
http: "
|
|
11550
|
-
path: "/organization/v1/feedback",
|
|
11551
|
-
streaming: "no",
|
|
11552
|
-
pagination: false,
|
|
11553
|
-
pathParams: [],
|
|
12271
|
+
query: []
|
|
12272
|
+
},
|
|
12273
|
+
{
|
|
12274
|
+
resource: "organization.feedback",
|
|
12275
|
+
method: "list",
|
|
12276
|
+
summary: "List your organization's feedback",
|
|
12277
|
+
description: "Feedback submitted by your organization, newest first, with phase and unread state. Filter by phase and search titles and message text (case-insensitive). Page with next_page. Requires a valid API key, Console session, or machine token of the organization.",
|
|
12278
|
+
http: "GET",
|
|
12279
|
+
path: "/organization/v1/feedback",
|
|
12280
|
+
streaming: "no",
|
|
12281
|
+
pagination: false,
|
|
12282
|
+
pathParams: [],
|
|
12283
|
+
query: [
|
|
12284
|
+
{
|
|
12285
|
+
name: "phase",
|
|
12286
|
+
type: "string",
|
|
12287
|
+
required: false,
|
|
12288
|
+
description: "Only feedback in these phases: a comma-separated list of open, awaiting_customer, in_progress, resolved or closed, for example open,in_progress; see the phase field of a feedback for what each means."
|
|
12289
|
+
},
|
|
12290
|
+
{
|
|
12291
|
+
name: "query",
|
|
12292
|
+
type: "string",
|
|
12293
|
+
required: false,
|
|
12294
|
+
description: "Case-insensitive text matched against titles and message bodies."
|
|
12295
|
+
},
|
|
12296
|
+
{
|
|
12297
|
+
name: "limit",
|
|
12298
|
+
type: "integer",
|
|
12299
|
+
required: false,
|
|
12300
|
+
description: "Items per page, 1 to 100."
|
|
12301
|
+
},
|
|
12302
|
+
{
|
|
12303
|
+
name: "page",
|
|
12304
|
+
type: "string",
|
|
12305
|
+
required: false,
|
|
12306
|
+
description: "Opaque cursor from next_page of the previous response."
|
|
12307
|
+
}
|
|
12308
|
+
]
|
|
12309
|
+
},
|
|
12310
|
+
{
|
|
12311
|
+
resource: "organization.feedback",
|
|
12312
|
+
method: "create",
|
|
12313
|
+
summary: "Report a problem with the Praxis platform",
|
|
12314
|
+
description: `Report a problem with the Praxis platform when an API fails, documentation is unclear, or a capability is missing. AI callers in codemode should include the original error text in message, the X-Request-Id or error event ID in associated_event_id, and relevant session, agent, model, or request IDs in contexts. Continue the user's task after reporting. Each successful call stores feedback and returns its id; repeated calls create separate reports. The authenticated principal determines the reporter; any reporter supplied in the body is ignored. Machine tokens force source to codemode. Requires a valid API key, Console session, or machine token. Minimal body: {"message":"The API documentation does not explain this error."}.`,
|
|
12315
|
+
http: "POST",
|
|
12316
|
+
path: "/organization/v1/feedback",
|
|
12317
|
+
streaming: "no",
|
|
12318
|
+
pagination: false,
|
|
12319
|
+
pathParams: [],
|
|
12320
|
+
query: [],
|
|
12321
|
+
body: {
|
|
12322
|
+
required: true,
|
|
12323
|
+
fields: [
|
|
12324
|
+
{
|
|
12325
|
+
name: "message",
|
|
12326
|
+
type: "string",
|
|
12327
|
+
required: true,
|
|
12328
|
+
description: "Problem description, at most 4096 Unicode code points; may be empty only when contexts.praxis.error.message is a non-empty string."
|
|
12329
|
+
},
|
|
12330
|
+
{
|
|
12331
|
+
name: "contact_email",
|
|
12332
|
+
type: "string",
|
|
12333
|
+
required: false,
|
|
12334
|
+
description: "Optional email address for follow-up about this report."
|
|
12335
|
+
},
|
|
12336
|
+
{
|
|
12337
|
+
name: "name",
|
|
12338
|
+
type: "string",
|
|
12339
|
+
required: false,
|
|
12340
|
+
description: "Optional display name of the person submitting feedback."
|
|
12341
|
+
},
|
|
12342
|
+
{
|
|
12343
|
+
name: "url",
|
|
12344
|
+
type: "string",
|
|
12345
|
+
required: false,
|
|
12346
|
+
description: "Page or API URL where the problem occurred."
|
|
12347
|
+
},
|
|
12348
|
+
{
|
|
12349
|
+
name: "associated_event_id",
|
|
12350
|
+
type: "string",
|
|
12351
|
+
required: false,
|
|
12352
|
+
description: "X-Request-Id from the failed response or the related error event ID."
|
|
12353
|
+
},
|
|
12354
|
+
{
|
|
12355
|
+
name: "title",
|
|
12356
|
+
type: "string",
|
|
12357
|
+
required: false,
|
|
12358
|
+
description: "Short summary shown in the feedback list; at most 200 Unicode code points."
|
|
12359
|
+
},
|
|
12360
|
+
{
|
|
12361
|
+
name: "type",
|
|
12362
|
+
type: "string",
|
|
12363
|
+
required: false,
|
|
12364
|
+
description: "Feedback type key enabled in the help settings, such as issue, suggestion, billing or other. Unknown or disabled keys are rejected with INVALID_PARAMS."
|
|
12365
|
+
},
|
|
12366
|
+
{
|
|
12367
|
+
name: "tags",
|
|
12368
|
+
type: "object",
|
|
12369
|
+
required: false,
|
|
12370
|
+
description: "Optional string labels for grouping the reported problem."
|
|
12371
|
+
},
|
|
12372
|
+
{
|
|
12373
|
+
name: "contexts",
|
|
12374
|
+
type: "object",
|
|
12375
|
+
required: false,
|
|
12376
|
+
description: "Structured diagnostic context; contexts.praxis can contain session_id, agent_id, model, and request_ids."
|
|
12377
|
+
},
|
|
12378
|
+
{
|
|
12379
|
+
name: "source",
|
|
12380
|
+
type: "string",
|
|
12381
|
+
enum: [
|
|
12382
|
+
"console",
|
|
12383
|
+
"api"
|
|
12384
|
+
],
|
|
12385
|
+
required: false,
|
|
12386
|
+
description: "Use console for Console reports or api for API callers (default); machine tokens always store codemode regardless of this value."
|
|
12387
|
+
},
|
|
12388
|
+
{
|
|
12389
|
+
name: "attachments",
|
|
12390
|
+
type: "array",
|
|
12391
|
+
itemType: "object",
|
|
12392
|
+
required: false,
|
|
12393
|
+
description: "Up to five attachments; decoded bytes must not exceed 10 MiB per attachment or 20 MiB in total."
|
|
12394
|
+
}
|
|
12395
|
+
]
|
|
12396
|
+
}
|
|
12397
|
+
},
|
|
12398
|
+
{
|
|
12399
|
+
resource: "organization.feedback.counts",
|
|
12400
|
+
method: "list",
|
|
12401
|
+
summary: "Count your organization's feedback by phase",
|
|
12402
|
+
description: "How many of your organization's feedback are in each phase, for status tabs. Counts never include another organization's feedback.",
|
|
12403
|
+
http: "GET",
|
|
12404
|
+
path: "/organization/v1/feedback/counts",
|
|
12405
|
+
streaming: "no",
|
|
12406
|
+
pagination: false,
|
|
12407
|
+
pathParams: [],
|
|
12408
|
+
query: []
|
|
12409
|
+
},
|
|
12410
|
+
{
|
|
12411
|
+
resource: "organization.feedback",
|
|
12412
|
+
method: "retrieve",
|
|
12413
|
+
summary: "Get one of your organization's feedback",
|
|
12414
|
+
description: "Read one feedback submitted by your organization with its current phase and first-response timing. Another organization's feedback answers 404 FEEDBACK_NOT_FOUND exactly like a missing one.",
|
|
12415
|
+
http: "GET",
|
|
12416
|
+
path: "/organization/v1/feedback/{id}",
|
|
12417
|
+
streaming: "no",
|
|
12418
|
+
pagination: false,
|
|
12419
|
+
pathParams: [
|
|
12420
|
+
{
|
|
12421
|
+
name: "id",
|
|
12422
|
+
sdkName: "id"
|
|
12423
|
+
}
|
|
12424
|
+
],
|
|
12425
|
+
query: []
|
|
12426
|
+
},
|
|
12427
|
+
{
|
|
12428
|
+
resource: "organization.feedback.messages",
|
|
12429
|
+
method: "list",
|
|
12430
|
+
summary: "List the messages of a feedback",
|
|
12431
|
+
description: "The conversation of one feedback in time order: your messages, support replies and system events. Internal support notes are never returned. Page with next_page.",
|
|
12432
|
+
http: "GET",
|
|
12433
|
+
path: "/organization/v1/feedback/{id}/messages",
|
|
12434
|
+
streaming: "no",
|
|
12435
|
+
pagination: false,
|
|
12436
|
+
pathParams: [
|
|
12437
|
+
{
|
|
12438
|
+
name: "id",
|
|
12439
|
+
sdkName: "id"
|
|
12440
|
+
}
|
|
12441
|
+
],
|
|
12442
|
+
query: [
|
|
12443
|
+
{
|
|
12444
|
+
name: "limit",
|
|
12445
|
+
type: "integer",
|
|
12446
|
+
required: false,
|
|
12447
|
+
description: "Items per page, 1 to 100."
|
|
12448
|
+
},
|
|
12449
|
+
{
|
|
12450
|
+
name: "page",
|
|
12451
|
+
type: "string",
|
|
12452
|
+
required: false,
|
|
12453
|
+
description: "Opaque cursor from next_page of the previous response."
|
|
12454
|
+
}
|
|
12455
|
+
]
|
|
12456
|
+
},
|
|
12457
|
+
{
|
|
12458
|
+
resource: "organization.feedback.messages",
|
|
12459
|
+
method: "create",
|
|
12460
|
+
summary: "Reply on a feedback",
|
|
12461
|
+
description: "Add your message to a feedback conversation, for example to answer a question from support. A reply while the phase is awaiting_customer moves it to in_progress and notifies support.",
|
|
12462
|
+
http: "POST",
|
|
12463
|
+
path: "/organization/v1/feedback/{id}/messages",
|
|
12464
|
+
streaming: "no",
|
|
12465
|
+
pagination: false,
|
|
12466
|
+
pathParams: [
|
|
12467
|
+
{
|
|
12468
|
+
name: "id",
|
|
12469
|
+
sdkName: "id"
|
|
12470
|
+
}
|
|
12471
|
+
],
|
|
11554
12472
|
query: [],
|
|
11555
12473
|
body: {
|
|
11556
12474
|
required: true,
|
|
11557
12475
|
fields: [
|
|
11558
12476
|
{
|
|
11559
|
-
name: "
|
|
12477
|
+
name: "body",
|
|
11560
12478
|
type: "string",
|
|
11561
12479
|
required: true,
|
|
11562
|
-
description: "
|
|
11563
|
-
},
|
|
11564
|
-
{
|
|
11565
|
-
name: "contact_email",
|
|
11566
|
-
type: "string",
|
|
11567
|
-
required: false,
|
|
11568
|
-
description: "Optional email address for follow-up about this report."
|
|
11569
|
-
},
|
|
11570
|
-
{
|
|
11571
|
-
name: "name",
|
|
11572
|
-
type: "string",
|
|
11573
|
-
required: false,
|
|
11574
|
-
description: "Optional display name of the person submitting feedback."
|
|
11575
|
-
},
|
|
11576
|
-
{
|
|
11577
|
-
name: "url",
|
|
11578
|
-
type: "string",
|
|
11579
|
-
required: false,
|
|
11580
|
-
description: "Page or API URL where the problem occurred."
|
|
11581
|
-
},
|
|
11582
|
-
{
|
|
11583
|
-
name: "associated_event_id",
|
|
11584
|
-
type: "string",
|
|
11585
|
-
required: false,
|
|
11586
|
-
description: "X-Request-Id from the failed response or the related error event ID."
|
|
11587
|
-
},
|
|
11588
|
-
{
|
|
11589
|
-
name: "tags",
|
|
11590
|
-
type: "object",
|
|
11591
|
-
required: false,
|
|
11592
|
-
description: "Optional string labels for grouping the reported problem."
|
|
11593
|
-
},
|
|
11594
|
-
{
|
|
11595
|
-
name: "contexts",
|
|
11596
|
-
type: "object",
|
|
11597
|
-
required: false,
|
|
11598
|
-
description: "Structured diagnostic context; contexts.praxis can contain session_id, agent_id, model, and request_ids."
|
|
11599
|
-
},
|
|
11600
|
-
{
|
|
11601
|
-
name: "source",
|
|
11602
|
-
type: "string",
|
|
11603
|
-
enum: [
|
|
11604
|
-
"console",
|
|
11605
|
-
"api"
|
|
11606
|
-
],
|
|
11607
|
-
required: false,
|
|
11608
|
-
description: "Use console for Console reports or api for API callers (default); machine tokens always store codemode regardless of this value."
|
|
12480
|
+
description: "Markdown text; at most 4096 Unicode code points."
|
|
11609
12481
|
},
|
|
11610
12482
|
{
|
|
11611
12483
|
name: "attachments",
|
|
11612
12484
|
type: "array",
|
|
11613
12485
|
itemType: "object",
|
|
11614
12486
|
required: false,
|
|
11615
|
-
description: "Up to five attachments; decoded bytes must not exceed 10 MiB
|
|
12487
|
+
description: "Up to five attachments; decoded bytes must not exceed 10 MiB each or 20 MiB in total."
|
|
11616
12488
|
}
|
|
11617
12489
|
]
|
|
11618
12490
|
}
|
|
@@ -14017,6 +14889,232 @@ for more details.`
|
|
|
14017
14889
|
}
|
|
14018
14890
|
];
|
|
14019
14891
|
|
|
14892
|
+
// ../../packages/sdk/typescript/src/core/errors.ts
|
|
14893
|
+
function problemFrom(status, headers, body, statusText) {
|
|
14894
|
+
const value = body && typeof body === "object" ? body : {};
|
|
14895
|
+
const nested = value.error && typeof value.error === "object" ? value.error : {};
|
|
14896
|
+
const string = (v) => typeof v === "string" && v.trim() ? v : undefined;
|
|
14897
|
+
const fallback = statusText || { 400: "Bad Request", 401: "Unauthorized", 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", 408: "Request Timeout", 409: "Conflict", 413: "Payload Too Large", 415: "Unsupported Media Type", 422: "Unprocessable Entity", 429: "Too Many Requests", 500: "Internal Server Error", 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout" }[status] || `HTTP ${status}`;
|
|
14898
|
+
const detail = string(value.detail) ?? string(nested.message) ?? string(value.message) ?? string(body);
|
|
14899
|
+
const title = string(value.title) ?? fallback;
|
|
14900
|
+
const param = nested.param ?? value.param;
|
|
14901
|
+
return {
|
|
14902
|
+
status,
|
|
14903
|
+
message: detail ?? title,
|
|
14904
|
+
title,
|
|
14905
|
+
detail,
|
|
14906
|
+
code: string(value.code) ?? string(nested.code) ?? string(nested.type) ?? string(value.error_code),
|
|
14907
|
+
type: string(nested.type) ?? string(value.type),
|
|
14908
|
+
param: typeof param === "string" ? param : param === null || nested.param === null ? null : undefined,
|
|
14909
|
+
errors: Array.isArray(value.errors) ? value.errors : [],
|
|
14910
|
+
requestId: headers.get("x-request-id") ?? string(value.requestId) ?? string(value.request_id),
|
|
14911
|
+
raw: body
|
|
14912
|
+
};
|
|
14913
|
+
}
|
|
14914
|
+
|
|
14915
|
+
class PraxisError extends Error {
|
|
14916
|
+
status;
|
|
14917
|
+
code;
|
|
14918
|
+
type;
|
|
14919
|
+
title;
|
|
14920
|
+
detail;
|
|
14921
|
+
errors;
|
|
14922
|
+
requestId;
|
|
14923
|
+
param;
|
|
14924
|
+
raw;
|
|
14925
|
+
constructor(problem = {}, options) {
|
|
14926
|
+
super(problem.message ?? problem.detail ?? problem.title ?? `Praxis request failed${problem.status ? ` (${problem.status})` : ""}`, options);
|
|
14927
|
+
this.name = "PraxisError";
|
|
14928
|
+
this.status = problem.status;
|
|
14929
|
+
this.code = problem.code;
|
|
14930
|
+
this.type = problem.type;
|
|
14931
|
+
this.title = problem.title;
|
|
14932
|
+
this.detail = problem.detail;
|
|
14933
|
+
this.errors = problem.errors ?? [];
|
|
14934
|
+
this.requestId = problem.requestId;
|
|
14935
|
+
this.param = problem.param;
|
|
14936
|
+
this.raw = problem.raw;
|
|
14937
|
+
}
|
|
14938
|
+
static fromResponse(response, body) {
|
|
14939
|
+
return new PraxisError(problemFrom(response.status, response.headers, body, response.statusText));
|
|
14940
|
+
}
|
|
14941
|
+
}
|
|
14942
|
+
|
|
14943
|
+
class PraxisConnectionError extends PraxisError {
|
|
14944
|
+
constructor(cause) {
|
|
14945
|
+
super({ code: "CONNECTION_ERROR", title: "Unable to connect to Praxis" }, { cause });
|
|
14946
|
+
this.name = "PraxisConnectionError";
|
|
14947
|
+
}
|
|
14948
|
+
}
|
|
14949
|
+
|
|
14950
|
+
class PraxisTimeoutError extends PraxisError {
|
|
14951
|
+
constructor(timeoutMs) {
|
|
14952
|
+
super({ code: "TIMEOUT", title: `Praxis request exceeded ${timeoutMs} ms` });
|
|
14953
|
+
this.name = "PraxisTimeoutError";
|
|
14954
|
+
}
|
|
14955
|
+
}
|
|
14956
|
+
|
|
14957
|
+
// ../../packages/sdk/typescript/src/core/retry.ts
|
|
14958
|
+
function canRetry(request) {
|
|
14959
|
+
return request.method !== "POST" || Boolean(request.headers.get("Idempotency-Key")?.trim());
|
|
14960
|
+
}
|
|
14961
|
+
function retryAfterMs(value, now = Date.now()) {
|
|
14962
|
+
if (!value)
|
|
14963
|
+
return;
|
|
14964
|
+
if (/^\d+(?:\.\d+)?$/.test(value.trim()))
|
|
14965
|
+
return Number(value) * 1000;
|
|
14966
|
+
const date = Date.parse(value);
|
|
14967
|
+
return Number.isFinite(date) ? Math.max(0, date - now) : undefined;
|
|
14968
|
+
}
|
|
14969
|
+
function retryDelay(attempt, retryAfter, random = Math.random) {
|
|
14970
|
+
return retryAfterMs(retryAfter) ?? Math.min(30000, 500 * 2 ** attempt) * (0.5 + random() * 0.5);
|
|
14971
|
+
}
|
|
14972
|
+
function abortable(promise, signal) {
|
|
14973
|
+
signal.throwIfAborted();
|
|
14974
|
+
return new Promise((resolve, reject) => {
|
|
14975
|
+
const abort = () => reject(signal.reason);
|
|
14976
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
14977
|
+
promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
14978
|
+
});
|
|
14979
|
+
}
|
|
14980
|
+
function sleep(ms, signal) {
|
|
14981
|
+
signal.throwIfAborted();
|
|
14982
|
+
return new Promise((resolve, reject) => {
|
|
14983
|
+
const abort = () => {
|
|
14984
|
+
clearTimeout(timer);
|
|
14985
|
+
reject(signal.reason);
|
|
14986
|
+
};
|
|
14987
|
+
const timer = setTimeout(() => {
|
|
14988
|
+
signal.removeEventListener("abort", abort);
|
|
14989
|
+
resolve();
|
|
14990
|
+
}, ms);
|
|
14991
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
14992
|
+
});
|
|
14993
|
+
}
|
|
14994
|
+
async function fetchWithRetry(request, fetcher, options) {
|
|
14995
|
+
const eligible = canRetry(request);
|
|
14996
|
+
const wait = options.wait ?? sleep;
|
|
14997
|
+
for (let attempt = 0;; attempt++) {
|
|
14998
|
+
options.signal.throwIfAborted();
|
|
14999
|
+
let response;
|
|
15000
|
+
try {
|
|
15001
|
+
response = await abortable(fetcher(request.clone()), options.signal);
|
|
15002
|
+
} catch (cause) {
|
|
15003
|
+
options.signal.throwIfAborted();
|
|
15004
|
+
if (!eligible || attempt >= options.maxRetries)
|
|
15005
|
+
throw new PraxisConnectionError(cause);
|
|
15006
|
+
await wait(retryDelay(attempt, null, options.random), options.signal);
|
|
15007
|
+
continue;
|
|
15008
|
+
}
|
|
15009
|
+
const retriable = response.status === 408 || response.status === 429 || response.status >= 500 && response.status <= 599;
|
|
15010
|
+
if (!eligible || !retriable || attempt >= options.maxRetries)
|
|
15011
|
+
return response;
|
|
15012
|
+
const delay = retryDelay(attempt, response.headers.get("Retry-After"), options.random);
|
|
15013
|
+
await response.body?.cancel();
|
|
15014
|
+
await wait(delay, options.signal);
|
|
15015
|
+
}
|
|
15016
|
+
}
|
|
15017
|
+
|
|
15018
|
+
// ../../packages/sdk/typescript/src/helpers/file-upload.ts
|
|
15019
|
+
var MAX_RETRIES = 5;
|
|
15020
|
+
function retryable(error) {
|
|
15021
|
+
return error instanceof PraxisConnectionError || error instanceof PraxisTimeoutError || error instanceof SyntaxError || error instanceof PraxisError && (error.status === 408 || error.status === 429 || error.status !== undefined && error.status >= 500 && error.status <= 599);
|
|
15022
|
+
}
|
|
15023
|
+
async function retry(signal, operation) {
|
|
15024
|
+
for (let used = 0;; used++) {
|
|
15025
|
+
signal.throwIfAborted();
|
|
15026
|
+
try {
|
|
15027
|
+
return await operation();
|
|
15028
|
+
} catch (error) {
|
|
15029
|
+
signal.throwIfAborted();
|
|
15030
|
+
if (used >= MAX_RETRIES || !retryable(error))
|
|
15031
|
+
throw error;
|
|
15032
|
+
await sleep(500 * 2 ** used, signal);
|
|
15033
|
+
}
|
|
15034
|
+
}
|
|
15035
|
+
}
|
|
15036
|
+
async function uploadFile(client, file, options) {
|
|
15037
|
+
options.signal?.throwIfAborted();
|
|
15038
|
+
if (file.size < 1 || file.size > 2 * 1024 ** 3)
|
|
15039
|
+
throw new RangeError("File size must be 1 byte through 2 GiB");
|
|
15040
|
+
const partSize = options.partSize ?? 50 * 1024 ** 2;
|
|
15041
|
+
const concurrency = options.concurrency ?? 3;
|
|
15042
|
+
if (!Number.isSafeInteger(partSize) || partSize < 5 * 1024 ** 2 || partSize > 64000000)
|
|
15043
|
+
throw new RangeError("partSize must be an integer from 5242880 through 64000000");
|
|
15044
|
+
if (!Number.isSafeInteger(concurrency) || concurrency < 1)
|
|
15045
|
+
throw new RangeError("concurrency must be a positive integer");
|
|
15046
|
+
const filename = options.filename ?? (typeof File !== "undefined" && file instanceof File ? file.name : "upload");
|
|
15047
|
+
const work = new AbortController;
|
|
15048
|
+
const abort = () => work.abort(options.signal?.reason);
|
|
15049
|
+
options.signal?.addEventListener("abort", abort, { once: true });
|
|
15050
|
+
const signal = work.signal;
|
|
15051
|
+
const request = { signal, maxRetries: 0, timeoutMs: 120000 };
|
|
15052
|
+
let uploadId;
|
|
15053
|
+
const active = async (initial) => {
|
|
15054
|
+
let result = initial;
|
|
15055
|
+
for (let polls = 0;; polls++) {
|
|
15056
|
+
signal.throwIfAborted();
|
|
15057
|
+
if (result.state === "active")
|
|
15058
|
+
return result;
|
|
15059
|
+
if (result.state !== "processing")
|
|
15060
|
+
throw new PraxisError({ code: "FILE_PROCESSING_FAILED", message: `File ${result.id} is not active (${result.state})` });
|
|
15061
|
+
await sleep(Math.min(5000, 1000 * 2 ** polls), signal);
|
|
15062
|
+
result = await retry(signal, () => client.file.files.retrieve({ path: { file_id: result.id }, ...request }));
|
|
15063
|
+
}
|
|
15064
|
+
};
|
|
15065
|
+
try {
|
|
15066
|
+
signal.throwIfAborted();
|
|
15067
|
+
options.onProgress?.(0);
|
|
15068
|
+
if (file.size <= 32 * 1024 ** 2) {
|
|
15069
|
+
const result2 = await client.file.files.create({ body: { file: new File([file], filename, { type: file.type }), purpose: options.purpose }, ...request });
|
|
15070
|
+
options.onProgress?.(1);
|
|
15071
|
+
return await active(result2);
|
|
15072
|
+
}
|
|
15073
|
+
const upload = await client.file.uploads.create({ body: { bytes: file.size, filename, mime_type: file.type || "application/octet-stream", purpose: options.purpose, part_size: partSize }, ...request });
|
|
15074
|
+
uploadId = upload.id;
|
|
15075
|
+
signal.throwIfAborted();
|
|
15076
|
+
const path = { upload_id: uploadId };
|
|
15077
|
+
const count = Math.ceil(file.size / partSize);
|
|
15078
|
+
const ids = new Array(count);
|
|
15079
|
+
let cursor = 0, confirmed = 0;
|
|
15080
|
+
const worker = async () => {
|
|
15081
|
+
while (cursor < count) {
|
|
15082
|
+
signal.throwIfAborted();
|
|
15083
|
+
const index = cursor++;
|
|
15084
|
+
const chunk = file.slice(index * partSize, Math.min(file.size, (index + 1) * partSize));
|
|
15085
|
+
const part = await retry(signal, () => client.file.uploads.parts.create({ path, query: { part_number: index + 1 }, body: { data: new File([chunk], filename) }, ...request }));
|
|
15086
|
+
ids[index] = part.id;
|
|
15087
|
+
confirmed += chunk.size;
|
|
15088
|
+
options.onProgress?.(confirmed / file.size);
|
|
15089
|
+
}
|
|
15090
|
+
};
|
|
15091
|
+
const workers = Array.from({ length: Math.min(concurrency, count) }, worker);
|
|
15092
|
+
try {
|
|
15093
|
+
await Promise.all(workers);
|
|
15094
|
+
} catch (error) {
|
|
15095
|
+
work.abort();
|
|
15096
|
+
await Promise.allSettled(workers);
|
|
15097
|
+
throw error;
|
|
15098
|
+
}
|
|
15099
|
+
const result = await retry(signal, () => client.file.uploads.complete({ path, body: { part_ids: ids }, ...request }));
|
|
15100
|
+
if (result.error)
|
|
15101
|
+
throw new PraxisError({ code: result.error.code, message: result.error.message });
|
|
15102
|
+
if (result.status !== "completed" || !result.file)
|
|
15103
|
+
throw new PraxisError({ code: "INVALID_RESPONSE", message: "Complete did not return a completed Upload with a file" });
|
|
15104
|
+
return await active(result.file);
|
|
15105
|
+
} catch (error) {
|
|
15106
|
+
work.abort();
|
|
15107
|
+
if (uploadId) {
|
|
15108
|
+
await client.file.uploads.cancel({ path: { upload_id: uploadId }, maxRetries: 0, timeoutMs: 1e4 }).catch(() => {});
|
|
15109
|
+
}
|
|
15110
|
+
if (options.signal?.aborted)
|
|
15111
|
+
throw options.signal.reason;
|
|
15112
|
+
throw error;
|
|
15113
|
+
} finally {
|
|
15114
|
+
options.signal?.removeEventListener("abort", abort);
|
|
15115
|
+
}
|
|
15116
|
+
}
|
|
15117
|
+
|
|
14020
15118
|
// ../../packages/sdk/typescript/src/core/multipart.ts
|
|
14021
15119
|
function multipartBodySerializer(body) {
|
|
14022
15120
|
const data = new FormData;
|
|
@@ -14084,9 +15182,9 @@ function createSseClient({
|
|
|
14084
15182
|
...options
|
|
14085
15183
|
}) {
|
|
14086
15184
|
let lastEventId;
|
|
14087
|
-
const
|
|
15185
|
+
const sleep2 = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
14088
15186
|
const createStream = async function* () {
|
|
14089
|
-
let
|
|
15187
|
+
let retryDelay2 = sseDefaultRetryDelay ?? 3000;
|
|
14090
15188
|
let attempt = 0;
|
|
14091
15189
|
const signal = options.signal ?? new AbortController().signal;
|
|
14092
15190
|
while (true) {
|
|
@@ -14150,7 +15248,7 @@ function createSseClient({
|
|
|
14150
15248
|
} else if (line.startsWith("retry:")) {
|
|
14151
15249
|
const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
|
|
14152
15250
|
if (!Number.isNaN(parsed)) {
|
|
14153
|
-
|
|
15251
|
+
retryDelay2 = parsed;
|
|
14154
15252
|
}
|
|
14155
15253
|
}
|
|
14156
15254
|
}
|
|
@@ -14178,7 +15276,7 @@ function createSseClient({
|
|
|
14178
15276
|
data,
|
|
14179
15277
|
event: eventName,
|
|
14180
15278
|
id: lastEventId,
|
|
14181
|
-
retry:
|
|
15279
|
+
retry: retryDelay2
|
|
14182
15280
|
});
|
|
14183
15281
|
if (dataLines.length) {
|
|
14184
15282
|
yield data;
|
|
@@ -14195,8 +15293,8 @@ function createSseClient({
|
|
|
14195
15293
|
if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) {
|
|
14196
15294
|
break;
|
|
14197
15295
|
}
|
|
14198
|
-
const backoff = Math.min(
|
|
14199
|
-
await
|
|
15296
|
+
const backoff = Math.min(retryDelay2 * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000);
|
|
15297
|
+
await sleep2(backoff);
|
|
14200
15298
|
}
|
|
14201
15299
|
}
|
|
14202
15300
|
};
|
|
@@ -14839,6 +15937,169 @@ var createClient = (config = {}) => {
|
|
|
14839
15937
|
var client = createClient(createConfig({ baseUrl: "https://api.deepraxis.com" }));
|
|
14840
15938
|
|
|
14841
15939
|
// ../../packages/sdk/typescript/src/generated/sdk.gen.ts
|
|
15940
|
+
var unarchiveAgent = (options) => (options.client ?? client).post({
|
|
15941
|
+
security: [{
|
|
15942
|
+
key: "BearerAuth",
|
|
15943
|
+
scheme: "bearer",
|
|
15944
|
+
type: "http"
|
|
15945
|
+
}, {
|
|
15946
|
+
key: "ApiKeyAuth",
|
|
15947
|
+
name: "X-API-Key",
|
|
15948
|
+
type: "apiKey"
|
|
15949
|
+
}],
|
|
15950
|
+
url: "/agent/v1/agents/{agent_id}/unarchive",
|
|
15951
|
+
...options
|
|
15952
|
+
});
|
|
15953
|
+
var deleteRunFeedback = (options) => (options.client ?? client).delete({
|
|
15954
|
+
security: [{
|
|
15955
|
+
key: "BearerAuth",
|
|
15956
|
+
scheme: "bearer",
|
|
15957
|
+
type: "http"
|
|
15958
|
+
}, {
|
|
15959
|
+
key: "ApiKeyAuth",
|
|
15960
|
+
name: "X-API-Key",
|
|
15961
|
+
type: "apiKey"
|
|
15962
|
+
}],
|
|
15963
|
+
url: "/agent/v1/sessions/{session_id}/runs/{run_id}/feedback",
|
|
15964
|
+
...options
|
|
15965
|
+
});
|
|
15966
|
+
var setRunFeedback = (options) => (options.client ?? client).post({
|
|
15967
|
+
security: [{
|
|
15968
|
+
key: "BearerAuth",
|
|
15969
|
+
scheme: "bearer",
|
|
15970
|
+
type: "http"
|
|
15971
|
+
}, {
|
|
15972
|
+
key: "ApiKeyAuth",
|
|
15973
|
+
name: "X-API-Key",
|
|
15974
|
+
type: "apiKey"
|
|
15975
|
+
}],
|
|
15976
|
+
url: "/agent/v1/sessions/{session_id}/runs/{run_id}/feedback",
|
|
15977
|
+
...options,
|
|
15978
|
+
headers: {
|
|
15979
|
+
"Content-Type": "application/json",
|
|
15980
|
+
...options.headers
|
|
15981
|
+
}
|
|
15982
|
+
});
|
|
15983
|
+
var listEndUsers = (options) => (options.client ?? client).get({
|
|
15984
|
+
security: [{
|
|
15985
|
+
key: "BearerAuth",
|
|
15986
|
+
scheme: "bearer",
|
|
15987
|
+
type: "http"
|
|
15988
|
+
}, {
|
|
15989
|
+
key: "ApiKeyAuth",
|
|
15990
|
+
name: "X-API-Key",
|
|
15991
|
+
type: "apiKey"
|
|
15992
|
+
}],
|
|
15993
|
+
url: "/agent/v1/agents/{agent_id}/end_users",
|
|
15994
|
+
...options
|
|
15995
|
+
});
|
|
15996
|
+
var deleteEndUser = (options) => (options.client ?? client).delete({
|
|
15997
|
+
security: [{
|
|
15998
|
+
key: "BearerAuth",
|
|
15999
|
+
scheme: "bearer",
|
|
16000
|
+
type: "http"
|
|
16001
|
+
}, {
|
|
16002
|
+
key: "ApiKeyAuth",
|
|
16003
|
+
name: "X-API-Key",
|
|
16004
|
+
type: "apiKey"
|
|
16005
|
+
}],
|
|
16006
|
+
url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}",
|
|
16007
|
+
...options
|
|
16008
|
+
});
|
|
16009
|
+
var getEndUser = (options) => (options.client ?? client).get({
|
|
16010
|
+
security: [{
|
|
16011
|
+
key: "BearerAuth",
|
|
16012
|
+
scheme: "bearer",
|
|
16013
|
+
type: "http"
|
|
16014
|
+
}, {
|
|
16015
|
+
key: "ApiKeyAuth",
|
|
16016
|
+
name: "X-API-Key",
|
|
16017
|
+
type: "apiKey"
|
|
16018
|
+
}],
|
|
16019
|
+
url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}",
|
|
16020
|
+
...options
|
|
16021
|
+
});
|
|
16022
|
+
var getEndUserDeletion = (options) => (options.client ?? client).get({
|
|
16023
|
+
security: [{
|
|
16024
|
+
key: "BearerAuth",
|
|
16025
|
+
scheme: "bearer",
|
|
16026
|
+
type: "http"
|
|
16027
|
+
}, {
|
|
16028
|
+
key: "ApiKeyAuth",
|
|
16029
|
+
name: "X-API-Key",
|
|
16030
|
+
type: "apiKey"
|
|
16031
|
+
}],
|
|
16032
|
+
url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/deletion",
|
|
16033
|
+
...options
|
|
16034
|
+
});
|
|
16035
|
+
var revokeEndUserTokens = (options) => (options.client ?? client).post({
|
|
16036
|
+
security: [{
|
|
16037
|
+
key: "BearerAuth",
|
|
16038
|
+
scheme: "bearer",
|
|
16039
|
+
type: "http"
|
|
16040
|
+
}, {
|
|
16041
|
+
key: "ApiKeyAuth",
|
|
16042
|
+
name: "X-API-Key",
|
|
16043
|
+
type: "apiKey"
|
|
16044
|
+
}],
|
|
16045
|
+
url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/revoke_tokens",
|
|
16046
|
+
...options
|
|
16047
|
+
});
|
|
16048
|
+
var blockEndUser = (options) => (options.client ?? client).post({
|
|
16049
|
+
security: [{
|
|
16050
|
+
key: "BearerAuth",
|
|
16051
|
+
scheme: "bearer",
|
|
16052
|
+
type: "http"
|
|
16053
|
+
}, {
|
|
16054
|
+
key: "ApiKeyAuth",
|
|
16055
|
+
name: "X-API-Key",
|
|
16056
|
+
type: "apiKey"
|
|
16057
|
+
}],
|
|
16058
|
+
url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/block",
|
|
16059
|
+
...options
|
|
16060
|
+
});
|
|
16061
|
+
var unblockEndUser = (options) => (options.client ?? client).post({
|
|
16062
|
+
security: [{
|
|
16063
|
+
key: "BearerAuth",
|
|
16064
|
+
scheme: "bearer",
|
|
16065
|
+
type: "http"
|
|
16066
|
+
}, {
|
|
16067
|
+
key: "ApiKeyAuth",
|
|
16068
|
+
name: "X-API-Key",
|
|
16069
|
+
type: "apiKey"
|
|
16070
|
+
}],
|
|
16071
|
+
url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock",
|
|
16072
|
+
...options
|
|
16073
|
+
});
|
|
16074
|
+
var exchangeEmbedCode = (options) => (options.client ?? client).post({
|
|
16075
|
+
url: "/agent/v1/embed/exchange",
|
|
16076
|
+
...options,
|
|
16077
|
+
headers: {
|
|
16078
|
+
"Content-Type": "application/json",
|
|
16079
|
+
...options.headers
|
|
16080
|
+
}
|
|
16081
|
+
});
|
|
16082
|
+
var createAnonymousEmbedToken = (options) => (options.client ?? client).post({
|
|
16083
|
+
url: "/agent/v1/embed_tokens/anonymous",
|
|
16084
|
+
...options,
|
|
16085
|
+
headers: {
|
|
16086
|
+
"Content-Type": "application/json",
|
|
16087
|
+
...options.headers
|
|
16088
|
+
}
|
|
16089
|
+
});
|
|
16090
|
+
var listEmbedTokens = (options) => (options?.client ?? client).get({
|
|
16091
|
+
security: [{
|
|
16092
|
+
key: "BearerAuth",
|
|
16093
|
+
scheme: "bearer",
|
|
16094
|
+
type: "http"
|
|
16095
|
+
}, {
|
|
16096
|
+
key: "ApiKeyAuth",
|
|
16097
|
+
name: "X-API-Key",
|
|
16098
|
+
type: "apiKey"
|
|
16099
|
+
}],
|
|
16100
|
+
url: "/agent/v1/embed_tokens",
|
|
16101
|
+
...options
|
|
16102
|
+
});
|
|
14842
16103
|
var createEmbedToken = (options) => (options.client ?? client).post({
|
|
14843
16104
|
security: [{
|
|
14844
16105
|
key: "BearerAuth",
|
|
@@ -14856,6 +16117,19 @@ var createEmbedToken = (options) => (options.client ?? client).post({
|
|
|
14856
16117
|
...options.headers
|
|
14857
16118
|
}
|
|
14858
16119
|
});
|
|
16120
|
+
var revokeEmbedToken = (options) => (options.client ?? client).post({
|
|
16121
|
+
security: [{
|
|
16122
|
+
key: "BearerAuth",
|
|
16123
|
+
scheme: "bearer",
|
|
16124
|
+
type: "http"
|
|
16125
|
+
}, {
|
|
16126
|
+
key: "ApiKeyAuth",
|
|
16127
|
+
name: "X-API-Key",
|
|
16128
|
+
type: "apiKey"
|
|
16129
|
+
}],
|
|
16130
|
+
url: "/agent/v1/embed_tokens/{id}/revoke",
|
|
16131
|
+
...options
|
|
16132
|
+
});
|
|
14859
16133
|
var computersList = (options) => (options?.client ?? client).get({
|
|
14860
16134
|
security: [{
|
|
14861
16135
|
key: "BearerAuth",
|
|
@@ -14997,6 +16271,36 @@ var connectComputer = (options) => (options.client ?? client).post({
|
|
|
14997
16271
|
type: "apiKey"
|
|
14998
16272
|
}],
|
|
14999
16273
|
url: "/agent/v1/computers/{computer_id}/connect",
|
|
16274
|
+
...options,
|
|
16275
|
+
headers: {
|
|
16276
|
+
"Content-Type": "application/json",
|
|
16277
|
+
...options.headers
|
|
16278
|
+
}
|
|
16279
|
+
});
|
|
16280
|
+
var renewComputerLease = (options) => (options.client ?? client).post({
|
|
16281
|
+
security: [{
|
|
16282
|
+
key: "BearerAuth",
|
|
16283
|
+
scheme: "bearer",
|
|
16284
|
+
type: "http"
|
|
16285
|
+
}, {
|
|
16286
|
+
key: "ApiKeyAuth",
|
|
16287
|
+
name: "X-API-Key",
|
|
16288
|
+
type: "apiKey"
|
|
16289
|
+
}],
|
|
16290
|
+
url: "/agent/v1/computers/{computer_id}/leases/{lease_id}/renew",
|
|
16291
|
+
...options
|
|
16292
|
+
});
|
|
16293
|
+
var releaseComputerLease = (options) => (options.client ?? client).delete({
|
|
16294
|
+
security: [{
|
|
16295
|
+
key: "BearerAuth",
|
|
16296
|
+
scheme: "bearer",
|
|
16297
|
+
type: "http"
|
|
16298
|
+
}, {
|
|
16299
|
+
key: "ApiKeyAuth",
|
|
16300
|
+
name: "X-API-Key",
|
|
16301
|
+
type: "apiKey"
|
|
16302
|
+
}],
|
|
16303
|
+
url: "/agent/v1/computers/{computer_id}/leases/{lease_id}",
|
|
15000
16304
|
...options
|
|
15001
16305
|
});
|
|
15002
16306
|
var listToolsets = (options) => (options?.client ?? client).get({
|
|
@@ -15124,6 +16428,15 @@ var listSessionCompactions = (options) => (options.client ?? client).get({
|
|
|
15124
16428
|
url: "/agent/v1/sessions/{session_id}/compactions",
|
|
15125
16429
|
...options
|
|
15126
16430
|
});
|
|
16431
|
+
var getEmbedAppearance = (options) => (options?.client ?? client).get({
|
|
16432
|
+
security: [{
|
|
16433
|
+
key: "BearerAuth",
|
|
16434
|
+
scheme: "bearer",
|
|
16435
|
+
type: "http"
|
|
16436
|
+
}, { name: "Praxis-Publishable-Key", type: "apiKey" }],
|
|
16437
|
+
url: "/agent/v1/embed/appearance",
|
|
16438
|
+
...options
|
|
16439
|
+
});
|
|
15127
16440
|
var createAudioSpeech = (options) => (options.client ?? client).post({
|
|
15128
16441
|
security: [{
|
|
15129
16442
|
key: "BearerAuth",
|
|
@@ -15405,6 +16718,55 @@ var fileRetrieveFileContent = (options) => (options.client ?? client).get({
|
|
|
15405
16718
|
url: "/file/v1/files/{file_id}/content",
|
|
15406
16719
|
...options
|
|
15407
16720
|
});
|
|
16721
|
+
var fileCreateUpload = (options) => (options.client ?? client).post({
|
|
16722
|
+
security: [{
|
|
16723
|
+
key: "BearerAuth",
|
|
16724
|
+
scheme: "bearer",
|
|
16725
|
+
type: "http"
|
|
16726
|
+
}],
|
|
16727
|
+
url: "/file/v1/uploads",
|
|
16728
|
+
...options,
|
|
16729
|
+
headers: {
|
|
16730
|
+
"Content-Type": "application/json",
|
|
16731
|
+
...options.headers
|
|
16732
|
+
}
|
|
16733
|
+
});
|
|
16734
|
+
var fileAddUploadPart = (options) => (options.client ?? client).post({
|
|
16735
|
+
...formDataBodySerializer,
|
|
16736
|
+
security: [{
|
|
16737
|
+
key: "BearerAuth",
|
|
16738
|
+
scheme: "bearer",
|
|
16739
|
+
type: "http"
|
|
16740
|
+
}],
|
|
16741
|
+
url: "/file/v1/uploads/{upload_id}/parts",
|
|
16742
|
+
...options,
|
|
16743
|
+
headers: {
|
|
16744
|
+
"Content-Type": null,
|
|
16745
|
+
...options.headers
|
|
16746
|
+
}
|
|
16747
|
+
});
|
|
16748
|
+
var fileCompleteUpload = (options) => (options.client ?? client).post({
|
|
16749
|
+
security: [{
|
|
16750
|
+
key: "BearerAuth",
|
|
16751
|
+
scheme: "bearer",
|
|
16752
|
+
type: "http"
|
|
16753
|
+
}],
|
|
16754
|
+
url: "/file/v1/uploads/{upload_id}/complete",
|
|
16755
|
+
...options,
|
|
16756
|
+
headers: {
|
|
16757
|
+
"Content-Type": "application/json",
|
|
16758
|
+
...options.headers
|
|
16759
|
+
}
|
|
16760
|
+
});
|
|
16761
|
+
var fileCancelUpload = (options) => (options.client ?? client).post({
|
|
16762
|
+
security: [{
|
|
16763
|
+
key: "BearerAuth",
|
|
16764
|
+
scheme: "bearer",
|
|
16765
|
+
type: "http"
|
|
16766
|
+
}],
|
|
16767
|
+
url: "/file/v1/uploads/{upload_id}/cancel",
|
|
16768
|
+
...options
|
|
16769
|
+
});
|
|
15408
16770
|
var healthCheck = (options) => (options?.client ?? client).get({ url: "/meta/v1/health", ...options });
|
|
15409
16771
|
var metaMethodsSearch = (options) => (options?.client ?? client).get({ url: "/meta/v1/methods", ...options });
|
|
15410
16772
|
var metaMethodsRetrieve = (options) => (options.client ?? client).get({ url: "/meta/v1/methods/{name}", ...options });
|
|
@@ -15811,7 +17173,88 @@ var createMessage = (options) => (options.client ?? client).post({
|
|
|
15811
17173
|
...options.headers
|
|
15812
17174
|
}
|
|
15813
17175
|
});
|
|
15814
|
-
var countTokens = (options) => (options.client ?? client).post({
|
|
17176
|
+
var countTokens = (options) => (options.client ?? client).post({
|
|
17177
|
+
security: [{
|
|
17178
|
+
key: "BearerAuth",
|
|
17179
|
+
scheme: "bearer",
|
|
17180
|
+
type: "http"
|
|
17181
|
+
}, {
|
|
17182
|
+
key: "ApiKeyAuth",
|
|
17183
|
+
name: "X-API-Key",
|
|
17184
|
+
type: "apiKey"
|
|
17185
|
+
}],
|
|
17186
|
+
url: "/model/v1/messages/count_tokens",
|
|
17187
|
+
...options,
|
|
17188
|
+
headers: {
|
|
17189
|
+
"Content-Type": "application/json",
|
|
17190
|
+
...options.headers
|
|
17191
|
+
}
|
|
17192
|
+
});
|
|
17193
|
+
var compactResponse = (options) => (options.client ?? client).post({
|
|
17194
|
+
security: [{
|
|
17195
|
+
key: "BearerAuth",
|
|
17196
|
+
scheme: "bearer",
|
|
17197
|
+
type: "http"
|
|
17198
|
+
}, {
|
|
17199
|
+
key: "ApiKeyAuth",
|
|
17200
|
+
name: "X-API-Key",
|
|
17201
|
+
type: "apiKey"
|
|
17202
|
+
}],
|
|
17203
|
+
url: "/model/v1/responses/compact",
|
|
17204
|
+
...options,
|
|
17205
|
+
headers: {
|
|
17206
|
+
"Content-Type": "application/json",
|
|
17207
|
+
...options.headers
|
|
17208
|
+
}
|
|
17209
|
+
});
|
|
17210
|
+
var countResponseInputTokens = (options) => (options.client ?? client).post({
|
|
17211
|
+
security: [{
|
|
17212
|
+
key: "BearerAuth",
|
|
17213
|
+
scheme: "bearer",
|
|
17214
|
+
type: "http"
|
|
17215
|
+
}, {
|
|
17216
|
+
key: "ApiKeyAuth",
|
|
17217
|
+
name: "X-API-Key",
|
|
17218
|
+
type: "apiKey"
|
|
17219
|
+
}],
|
|
17220
|
+
url: "/model/v1/responses/input_tokens",
|
|
17221
|
+
...options,
|
|
17222
|
+
headers: {
|
|
17223
|
+
"Content-Type": "application/json",
|
|
17224
|
+
...options.headers
|
|
17225
|
+
}
|
|
17226
|
+
});
|
|
17227
|
+
var listOrganizationFeedback = (options) => (options?.client ?? client).get({
|
|
17228
|
+
security: [{
|
|
17229
|
+
key: "BearerAuth",
|
|
17230
|
+
scheme: "bearer",
|
|
17231
|
+
type: "http"
|
|
17232
|
+
}, {
|
|
17233
|
+
key: "ApiKeyAuth",
|
|
17234
|
+
name: "X-API-Key",
|
|
17235
|
+
type: "apiKey"
|
|
17236
|
+
}],
|
|
17237
|
+
url: "/organization/v1/feedback",
|
|
17238
|
+
...options
|
|
17239
|
+
});
|
|
17240
|
+
var createOrganizationFeedback = (options) => (options.client ?? client).post({
|
|
17241
|
+
security: [{
|
|
17242
|
+
key: "BearerAuth",
|
|
17243
|
+
scheme: "bearer",
|
|
17244
|
+
type: "http"
|
|
17245
|
+
}, {
|
|
17246
|
+
key: "ApiKeyAuth",
|
|
17247
|
+
name: "X-API-Key",
|
|
17248
|
+
type: "apiKey"
|
|
17249
|
+
}],
|
|
17250
|
+
url: "/organization/v1/feedback",
|
|
17251
|
+
...options,
|
|
17252
|
+
headers: {
|
|
17253
|
+
"Content-Type": "application/json",
|
|
17254
|
+
...options.headers
|
|
17255
|
+
}
|
|
17256
|
+
});
|
|
17257
|
+
var getOrganizationFeedbackCounts = (options) => (options?.client ?? client).get({
|
|
15815
17258
|
security: [{
|
|
15816
17259
|
key: "BearerAuth",
|
|
15817
17260
|
scheme: "bearer",
|
|
@@ -15821,14 +17264,10 @@ var countTokens = (options) => (options.client ?? client).post({
|
|
|
15821
17264
|
name: "X-API-Key",
|
|
15822
17265
|
type: "apiKey"
|
|
15823
17266
|
}],
|
|
15824
|
-
url: "/
|
|
15825
|
-
...options
|
|
15826
|
-
headers: {
|
|
15827
|
-
"Content-Type": "application/json",
|
|
15828
|
-
...options.headers
|
|
15829
|
-
}
|
|
17267
|
+
url: "/organization/v1/feedback/counts",
|
|
17268
|
+
...options
|
|
15830
17269
|
});
|
|
15831
|
-
var
|
|
17270
|
+
var getOrganizationFeedback = (options) => (options.client ?? client).get({
|
|
15832
17271
|
security: [{
|
|
15833
17272
|
key: "BearerAuth",
|
|
15834
17273
|
scheme: "bearer",
|
|
@@ -15838,14 +17277,10 @@ var compactResponse = (options) => (options.client ?? client).post({
|
|
|
15838
17277
|
name: "X-API-Key",
|
|
15839
17278
|
type: "apiKey"
|
|
15840
17279
|
}],
|
|
15841
|
-
url: "/
|
|
15842
|
-
...options
|
|
15843
|
-
headers: {
|
|
15844
|
-
"Content-Type": "application/json",
|
|
15845
|
-
...options.headers
|
|
15846
|
-
}
|
|
17280
|
+
url: "/organization/v1/feedback/{id}",
|
|
17281
|
+
...options
|
|
15847
17282
|
});
|
|
15848
|
-
var
|
|
17283
|
+
var listOrganizationFeedbackMessages = (options) => (options.client ?? client).get({
|
|
15849
17284
|
security: [{
|
|
15850
17285
|
key: "BearerAuth",
|
|
15851
17286
|
scheme: "bearer",
|
|
@@ -15855,14 +17290,10 @@ var countResponseInputTokens = (options) => (options.client ?? client).post({
|
|
|
15855
17290
|
name: "X-API-Key",
|
|
15856
17291
|
type: "apiKey"
|
|
15857
17292
|
}],
|
|
15858
|
-
url: "/
|
|
15859
|
-
...options
|
|
15860
|
-
headers: {
|
|
15861
|
-
"Content-Type": "application/json",
|
|
15862
|
-
...options.headers
|
|
15863
|
-
}
|
|
17293
|
+
url: "/organization/v1/feedback/{id}/messages",
|
|
17294
|
+
...options
|
|
15864
17295
|
});
|
|
15865
|
-
var
|
|
17296
|
+
var createOrganizationFeedbackMessage = (options) => (options.client ?? client).post({
|
|
15866
17297
|
security: [{
|
|
15867
17298
|
key: "BearerAuth",
|
|
15868
17299
|
scheme: "bearer",
|
|
@@ -15872,7 +17303,7 @@ var createOrganizationFeedback = (options) => (options.client ?? client).post({
|
|
|
15872
17303
|
name: "X-API-Key",
|
|
15873
17304
|
type: "apiKey"
|
|
15874
17305
|
}],
|
|
15875
|
-
url: "/organization/v1/feedback",
|
|
17306
|
+
url: "/organization/v1/feedback/{id}/messages",
|
|
15876
17307
|
...options,
|
|
15877
17308
|
headers: {
|
|
15878
17309
|
"Content-Type": "application/json",
|
|
@@ -16171,7 +17602,7 @@ var runSandboxCommand = (options) => (options.client ?? client).post({
|
|
|
16171
17602
|
...options.headers
|
|
16172
17603
|
}
|
|
16173
17604
|
});
|
|
16174
|
-
var
|
|
17605
|
+
var sessionsDelete = (options) => (options.client ?? client).delete({
|
|
16175
17606
|
security: [{
|
|
16176
17607
|
key: "BearerAuth",
|
|
16177
17608
|
scheme: "bearer",
|
|
@@ -16181,10 +17612,10 @@ var agentsList = (options) => (options?.client ?? client).get({
|
|
|
16181
17612
|
name: "X-API-Key",
|
|
16182
17613
|
type: "apiKey"
|
|
16183
17614
|
}],
|
|
16184
|
-
url: "/agent/v1/
|
|
17615
|
+
url: "/agent/v1/sessions/{session_id}",
|
|
16185
17616
|
...options
|
|
16186
17617
|
});
|
|
16187
|
-
var
|
|
17618
|
+
var sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
16188
17619
|
security: [{
|
|
16189
17620
|
key: "BearerAuth",
|
|
16190
17621
|
scheme: "bearer",
|
|
@@ -16194,14 +17625,27 @@ var agentsCreate = (options) => (options.client ?? client).post({
|
|
|
16194
17625
|
name: "X-API-Key",
|
|
16195
17626
|
type: "apiKey"
|
|
16196
17627
|
}],
|
|
16197
|
-
url: "/agent/v1/
|
|
17628
|
+
url: "/agent/v1/sessions/{session_id}",
|
|
17629
|
+
...options
|
|
17630
|
+
});
|
|
17631
|
+
var sessionsUpdate = (options) => (options.client ?? client).post({
|
|
17632
|
+
security: [{
|
|
17633
|
+
key: "BearerAuth",
|
|
17634
|
+
scheme: "bearer",
|
|
17635
|
+
type: "http"
|
|
17636
|
+
}, {
|
|
17637
|
+
key: "ApiKeyAuth",
|
|
17638
|
+
name: "X-API-Key",
|
|
17639
|
+
type: "apiKey"
|
|
17640
|
+
}],
|
|
17641
|
+
url: "/agent/v1/sessions/{session_id}",
|
|
16198
17642
|
...options,
|
|
16199
17643
|
headers: {
|
|
16200
17644
|
"Content-Type": "application/json",
|
|
16201
17645
|
...options.headers
|
|
16202
17646
|
}
|
|
16203
17647
|
});
|
|
16204
|
-
var
|
|
17648
|
+
var agentsList = (options) => (options?.client ?? client).get({
|
|
16205
17649
|
security: [{
|
|
16206
17650
|
key: "BearerAuth",
|
|
16207
17651
|
scheme: "bearer",
|
|
@@ -16211,10 +17655,10 @@ var agentsRetrieve = (options) => (options.client ?? client).get({
|
|
|
16211
17655
|
name: "X-API-Key",
|
|
16212
17656
|
type: "apiKey"
|
|
16213
17657
|
}],
|
|
16214
|
-
url: "/agent/v1/agents
|
|
17658
|
+
url: "/agent/v1/agents",
|
|
16215
17659
|
...options
|
|
16216
17660
|
});
|
|
16217
|
-
var
|
|
17661
|
+
var agentsCreate = (options) => (options.client ?? client).post({
|
|
16218
17662
|
security: [{
|
|
16219
17663
|
key: "BearerAuth",
|
|
16220
17664
|
scheme: "bearer",
|
|
@@ -16224,14 +17668,14 @@ var agentsUpdate = (options) => (options.client ?? client).post({
|
|
|
16224
17668
|
name: "X-API-Key",
|
|
16225
17669
|
type: "apiKey"
|
|
16226
17670
|
}],
|
|
16227
|
-
url: "/agent/v1/agents
|
|
17671
|
+
url: "/agent/v1/agents",
|
|
16228
17672
|
...options,
|
|
16229
17673
|
headers: {
|
|
16230
17674
|
"Content-Type": "application/json",
|
|
16231
17675
|
...options.headers
|
|
16232
17676
|
}
|
|
16233
17677
|
});
|
|
16234
|
-
var
|
|
17678
|
+
var agentsRetrieve = (options) => (options.client ?? client).get({
|
|
16235
17679
|
security: [{
|
|
16236
17680
|
key: "BearerAuth",
|
|
16237
17681
|
scheme: "bearer",
|
|
@@ -16241,10 +17685,10 @@ var agentsArchive = (options) => (options.client ?? client).post({
|
|
|
16241
17685
|
name: "X-API-Key",
|
|
16242
17686
|
type: "apiKey"
|
|
16243
17687
|
}],
|
|
16244
|
-
url: "/agent/v1/agents/{agent_id}
|
|
17688
|
+
url: "/agent/v1/agents/{agent_id}",
|
|
16245
17689
|
...options
|
|
16246
17690
|
});
|
|
16247
|
-
var
|
|
17691
|
+
var agentsUpdate = (options) => (options.client ?? client).post({
|
|
16248
17692
|
security: [{
|
|
16249
17693
|
key: "BearerAuth",
|
|
16250
17694
|
scheme: "bearer",
|
|
@@ -16254,10 +17698,14 @@ var agentsVersionsList = (options) => (options.client ?? client).get({
|
|
|
16254
17698
|
name: "X-API-Key",
|
|
16255
17699
|
type: "apiKey"
|
|
16256
17700
|
}],
|
|
16257
|
-
url: "/agent/v1/agents/{agent_id}
|
|
16258
|
-
...options
|
|
17701
|
+
url: "/agent/v1/agents/{agent_id}",
|
|
17702
|
+
...options,
|
|
17703
|
+
headers: {
|
|
17704
|
+
"Content-Type": "application/json",
|
|
17705
|
+
...options.headers
|
|
17706
|
+
}
|
|
16259
17707
|
});
|
|
16260
|
-
var
|
|
17708
|
+
var agentsArchive = (options) => (options.client ?? client).post({
|
|
16261
17709
|
security: [{
|
|
16262
17710
|
key: "BearerAuth",
|
|
16263
17711
|
scheme: "bearer",
|
|
@@ -16267,10 +17715,10 @@ var sessionsList = (options) => (options?.client ?? client).get({
|
|
|
16267
17715
|
name: "X-API-Key",
|
|
16268
17716
|
type: "apiKey"
|
|
16269
17717
|
}],
|
|
16270
|
-
url: "/agent/v1/
|
|
17718
|
+
url: "/agent/v1/agents/{agent_id}/archive",
|
|
16271
17719
|
...options
|
|
16272
17720
|
});
|
|
16273
|
-
var
|
|
17721
|
+
var agentsVersionsList = (options) => (options.client ?? client).get({
|
|
16274
17722
|
security: [{
|
|
16275
17723
|
key: "BearerAuth",
|
|
16276
17724
|
scheme: "bearer",
|
|
@@ -16280,14 +17728,10 @@ var sessionsCreate = (options) => (options.client ?? client).post({
|
|
|
16280
17728
|
name: "X-API-Key",
|
|
16281
17729
|
type: "apiKey"
|
|
16282
17730
|
}],
|
|
16283
|
-
url: "/agent/v1/
|
|
16284
|
-
...options
|
|
16285
|
-
headers: {
|
|
16286
|
-
"Content-Type": "application/json",
|
|
16287
|
-
...options.headers
|
|
16288
|
-
}
|
|
17731
|
+
url: "/agent/v1/agents/{agent_id}/versions",
|
|
17732
|
+
...options
|
|
16289
17733
|
});
|
|
16290
|
-
var
|
|
17734
|
+
var sessionsList = (options) => (options?.client ?? client).get({
|
|
16291
17735
|
security: [{
|
|
16292
17736
|
key: "BearerAuth",
|
|
16293
17737
|
scheme: "bearer",
|
|
@@ -16297,10 +17741,10 @@ var sessionsRetrieve = (options) => (options.client ?? client).get({
|
|
|
16297
17741
|
name: "X-API-Key",
|
|
16298
17742
|
type: "apiKey"
|
|
16299
17743
|
}],
|
|
16300
|
-
url: "/agent/v1/sessions
|
|
17744
|
+
url: "/agent/v1/sessions",
|
|
16301
17745
|
...options
|
|
16302
17746
|
});
|
|
16303
|
-
var
|
|
17747
|
+
var sessionsCreate = (options) => (options.client ?? client).post({
|
|
16304
17748
|
security: [{
|
|
16305
17749
|
key: "BearerAuth",
|
|
16306
17750
|
scheme: "bearer",
|
|
@@ -16310,7 +17754,7 @@ var sessionsUpdate = (options) => (options.client ?? client).post({
|
|
|
16310
17754
|
name: "X-API-Key",
|
|
16311
17755
|
type: "apiKey"
|
|
16312
17756
|
}],
|
|
16313
|
-
url: "/agent/v1/sessions
|
|
17757
|
+
url: "/agent/v1/sessions",
|
|
16314
17758
|
...options,
|
|
16315
17759
|
headers: {
|
|
16316
17760
|
"Content-Type": "application/json",
|
|
@@ -16811,6 +18255,15 @@ var applicationCreateVersion = (options) => (options.client ?? client).post({
|
|
|
16811
18255
|
...options.headers
|
|
16812
18256
|
}
|
|
16813
18257
|
});
|
|
18258
|
+
var applicationGetVersionAssetManifest = (options) => (options.client ?? client).get({
|
|
18259
|
+
security: [{
|
|
18260
|
+
key: "application-bearerAuth",
|
|
18261
|
+
scheme: "bearer",
|
|
18262
|
+
type: "http"
|
|
18263
|
+
}],
|
|
18264
|
+
url: "/application/v1/workers/{worker_id}/versions/{version_id}/assets/manifest",
|
|
18265
|
+
...options
|
|
18266
|
+
});
|
|
16814
18267
|
var applicationGetVersion = (options) => (options.client ?? client).get({
|
|
16815
18268
|
security: [{
|
|
16816
18269
|
key: "application-bearerAuth",
|
|
@@ -19631,8 +21084,26 @@ function createAgent(transport) {
|
|
|
19631
21084
|
agents: {
|
|
19632
21085
|
archive: bind(transport, agentsArchive),
|
|
19633
21086
|
create: bind(transport, agentsCreate),
|
|
21087
|
+
endUsers: {
|
|
21088
|
+
block: {
|
|
21089
|
+
create: bind(transport, blockEndUser)
|
|
21090
|
+
},
|
|
21091
|
+
delete: bind(transport, deleteEndUser),
|
|
21092
|
+
list: bind(transport, listEndUsers),
|
|
21093
|
+
retrieve: bind(transport, getEndUser),
|
|
21094
|
+
retrieveDeletion: bind(transport, getEndUserDeletion),
|
|
21095
|
+
revokeTokens: {
|
|
21096
|
+
create: bind(transport, revokeEndUserTokens)
|
|
21097
|
+
},
|
|
21098
|
+
unblock: {
|
|
21099
|
+
create: bind(transport, unblockEndUser)
|
|
21100
|
+
}
|
|
21101
|
+
},
|
|
19634
21102
|
list: bind(transport, agentsList),
|
|
19635
21103
|
retrieve: bind(transport, agentsRetrieve),
|
|
21104
|
+
unarchive: {
|
|
21105
|
+
create: bind(transport, unarchiveAgent)
|
|
21106
|
+
},
|
|
19636
21107
|
update: bind(transport, agentsUpdate),
|
|
19637
21108
|
versions: {
|
|
19638
21109
|
list: bind(transport, agentsVersionsList)
|
|
@@ -19650,6 +21121,12 @@ function createAgent(transport) {
|
|
|
19650
21121
|
list: bind(transport, computersFilesList),
|
|
19651
21122
|
retrieveContent: bind(transport, computersFilesContent)
|
|
19652
21123
|
},
|
|
21124
|
+
leases: {
|
|
21125
|
+
delete: bind(transport, releaseComputerLease),
|
|
21126
|
+
renew: {
|
|
21127
|
+
create: bind(transport, renewComputerLease)
|
|
21128
|
+
}
|
|
21129
|
+
},
|
|
19653
21130
|
list: bind(transport, computersList),
|
|
19654
21131
|
retrieve: bind(transport, computersRetrieve),
|
|
19655
21132
|
update: bind(transport, computersUpdate)
|
|
@@ -19672,8 +21149,21 @@ function createAgent(transport) {
|
|
|
19672
21149
|
},
|
|
19673
21150
|
update: bind(transport, deploymentsUpdate)
|
|
19674
21151
|
},
|
|
21152
|
+
embed: {
|
|
21153
|
+
exchange: {
|
|
21154
|
+
create: bind(transport, exchangeEmbedCode)
|
|
21155
|
+
},
|
|
21156
|
+
retrieveAppearance: bind(transport, getEmbedAppearance)
|
|
21157
|
+
},
|
|
19675
21158
|
embedTokens: {
|
|
19676
|
-
|
|
21159
|
+
anonymous: {
|
|
21160
|
+
create: bind(transport, createAnonymousEmbedToken)
|
|
21161
|
+
},
|
|
21162
|
+
create: bind(transport, createEmbedToken),
|
|
21163
|
+
list: bind(transport, listEmbedTokens),
|
|
21164
|
+
revoke: {
|
|
21165
|
+
create: bind(transport, revokeEmbedToken)
|
|
21166
|
+
}
|
|
19677
21167
|
},
|
|
19678
21168
|
environments: {
|
|
19679
21169
|
archive: bind(transport, environmentsArchive),
|
|
@@ -19694,6 +21184,7 @@ function createAgent(transport) {
|
|
|
19694
21184
|
list: bind(transport, listSessionCompactions)
|
|
19695
21185
|
},
|
|
19696
21186
|
create: bind(transport, sessionsCreate),
|
|
21187
|
+
delete: bind(transport, sessionsDelete),
|
|
19697
21188
|
events: {
|
|
19698
21189
|
list: bind(transport, sessionsEventsList),
|
|
19699
21190
|
send: bind(transport, sessionsEventsSend),
|
|
@@ -19710,6 +21201,12 @@ function createAgent(transport) {
|
|
|
19710
21201
|
retrieve: bind(transport, sessionsRetrieve),
|
|
19711
21202
|
retrieveCompact: bind(transport, getSessionCompaction),
|
|
19712
21203
|
retrieveContext: bind(transport, getSessionContext),
|
|
21204
|
+
runs: {
|
|
21205
|
+
deleteFeedback: bind(transport, deleteRunFeedback),
|
|
21206
|
+
feedback: {
|
|
21207
|
+
create: bind(transport, setRunFeedback)
|
|
21208
|
+
}
|
|
21209
|
+
},
|
|
19713
21210
|
threads: {
|
|
19714
21211
|
archive: bind(transport, aliasOperation(sessionsThreadsArchive, { query: { session_id: "query_session_id" } })),
|
|
19715
21212
|
events: {
|
|
@@ -19769,6 +21266,9 @@ function createApplication(transport) {
|
|
|
19769
21266
|
},
|
|
19770
21267
|
update: bind(transport, applicationUpdateWorker),
|
|
19771
21268
|
versions: {
|
|
21269
|
+
assets: {
|
|
21270
|
+
retrieveManifest: bind(transport, applicationGetVersionAssetManifest)
|
|
21271
|
+
},
|
|
19772
21272
|
create: bind(transport, applicationCreateVersion),
|
|
19773
21273
|
list: bindPage(transport, applicationListVersions),
|
|
19774
21274
|
retrieve: bind(transport, applicationGetVersion)
|
|
@@ -19976,6 +21476,14 @@ function createFile(transport) {
|
|
|
19976
21476
|
list: bind(transport, fileListFiles),
|
|
19977
21477
|
retrieve: bind(transport, fileRetrieveFile),
|
|
19978
21478
|
retrieveContent: bind(transport, fileRetrieveFileContent)
|
|
21479
|
+
},
|
|
21480
|
+
uploads: {
|
|
21481
|
+
cancel: bind(transport, fileCancelUpload),
|
|
21482
|
+
complete: bind(transport, fileCompleteUpload),
|
|
21483
|
+
create: bind(transport, fileCreateUpload),
|
|
21484
|
+
parts: {
|
|
21485
|
+
create: bind(transport, (options) => fileAddUploadPart({ ...options, bodySerializer: multipartBodySerializer, headers: { "Content-Type": null, ...options.headers } }))
|
|
21486
|
+
}
|
|
19979
21487
|
}
|
|
19980
21488
|
};
|
|
19981
21489
|
}
|
|
@@ -20184,7 +21692,16 @@ function createOrganization(transport) {
|
|
|
20184
21692
|
retrieve: bind(transport, getOrganizationEvent)
|
|
20185
21693
|
},
|
|
20186
21694
|
feedback: {
|
|
20187
|
-
|
|
21695
|
+
counts: {
|
|
21696
|
+
list: bind(transport, getOrganizationFeedbackCounts)
|
|
21697
|
+
},
|
|
21698
|
+
create: bind(transport, createOrganizationFeedback),
|
|
21699
|
+
list: bind(transport, listOrganizationFeedback),
|
|
21700
|
+
messages: {
|
|
21701
|
+
create: bind(transport, createOrganizationFeedbackMessage),
|
|
21702
|
+
list: bind(transport, listOrganizationFeedbackMessages)
|
|
21703
|
+
},
|
|
21704
|
+
retrieve: bind(transport, getOrganizationFeedback)
|
|
20188
21705
|
},
|
|
20189
21706
|
usage: {
|
|
20190
21707
|
list: bind(transport, listOrganizationUsage)
|
|
@@ -20337,132 +21854,6 @@ var resourceFactories = {
|
|
|
20337
21854
|
vault: createVault
|
|
20338
21855
|
};
|
|
20339
21856
|
|
|
20340
|
-
// ../../packages/sdk/typescript/src/core/errors.ts
|
|
20341
|
-
function problemFrom(status, headers, body, statusText) {
|
|
20342
|
-
const value = body && typeof body === "object" ? body : {};
|
|
20343
|
-
const nested = value.error && typeof value.error === "object" ? value.error : {};
|
|
20344
|
-
const string = (v) => typeof v === "string" && v.trim() ? v : undefined;
|
|
20345
|
-
const fallback = statusText || { 400: "Bad Request", 401: "Unauthorized", 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", 408: "Request Timeout", 409: "Conflict", 413: "Payload Too Large", 415: "Unsupported Media Type", 422: "Unprocessable Entity", 429: "Too Many Requests", 500: "Internal Server Error", 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout" }[status] || `HTTP ${status}`;
|
|
20346
|
-
const detail = string(value.detail) ?? string(nested.message) ?? string(value.message) ?? string(body);
|
|
20347
|
-
const title = string(value.title) ?? fallback;
|
|
20348
|
-
const param = nested.param ?? value.param;
|
|
20349
|
-
return {
|
|
20350
|
-
status,
|
|
20351
|
-
message: detail ?? title,
|
|
20352
|
-
title,
|
|
20353
|
-
detail,
|
|
20354
|
-
code: string(value.code) ?? string(nested.code) ?? string(nested.type) ?? string(value.error_code),
|
|
20355
|
-
type: string(nested.type) ?? string(value.type),
|
|
20356
|
-
param: typeof param === "string" ? param : param === null || nested.param === null ? null : undefined,
|
|
20357
|
-
errors: Array.isArray(value.errors) ? value.errors : [],
|
|
20358
|
-
requestId: headers.get("x-request-id") ?? string(value.requestId) ?? string(value.request_id),
|
|
20359
|
-
raw: body
|
|
20360
|
-
};
|
|
20361
|
-
}
|
|
20362
|
-
|
|
20363
|
-
class PraxisError extends Error {
|
|
20364
|
-
status;
|
|
20365
|
-
code;
|
|
20366
|
-
type;
|
|
20367
|
-
title;
|
|
20368
|
-
detail;
|
|
20369
|
-
errors;
|
|
20370
|
-
requestId;
|
|
20371
|
-
param;
|
|
20372
|
-
raw;
|
|
20373
|
-
constructor(problem = {}, options) {
|
|
20374
|
-
super(problem.message ?? problem.detail ?? problem.title ?? `Praxis request failed${problem.status ? ` (${problem.status})` : ""}`, options);
|
|
20375
|
-
this.name = "PraxisError";
|
|
20376
|
-
this.status = problem.status;
|
|
20377
|
-
this.code = problem.code;
|
|
20378
|
-
this.type = problem.type;
|
|
20379
|
-
this.title = problem.title;
|
|
20380
|
-
this.detail = problem.detail;
|
|
20381
|
-
this.errors = problem.errors ?? [];
|
|
20382
|
-
this.requestId = problem.requestId;
|
|
20383
|
-
this.param = problem.param;
|
|
20384
|
-
this.raw = problem.raw;
|
|
20385
|
-
}
|
|
20386
|
-
static fromResponse(response, body) {
|
|
20387
|
-
return new PraxisError(problemFrom(response.status, response.headers, body, response.statusText));
|
|
20388
|
-
}
|
|
20389
|
-
}
|
|
20390
|
-
|
|
20391
|
-
class PraxisConnectionError extends PraxisError {
|
|
20392
|
-
constructor(cause) {
|
|
20393
|
-
super({ code: "CONNECTION_ERROR", title: "Unable to connect to Praxis" }, { cause });
|
|
20394
|
-
this.name = "PraxisConnectionError";
|
|
20395
|
-
}
|
|
20396
|
-
}
|
|
20397
|
-
|
|
20398
|
-
class PraxisTimeoutError extends PraxisError {
|
|
20399
|
-
constructor(timeoutMs) {
|
|
20400
|
-
super({ code: "TIMEOUT", title: `Praxis request exceeded ${timeoutMs} ms` });
|
|
20401
|
-
this.name = "PraxisTimeoutError";
|
|
20402
|
-
}
|
|
20403
|
-
}
|
|
20404
|
-
|
|
20405
|
-
// ../../packages/sdk/typescript/src/core/retry.ts
|
|
20406
|
-
function canRetry(request) {
|
|
20407
|
-
return request.method !== "POST" || Boolean(request.headers.get("Idempotency-Key")?.trim());
|
|
20408
|
-
}
|
|
20409
|
-
function retryAfterMs(value, now = Date.now()) {
|
|
20410
|
-
if (!value)
|
|
20411
|
-
return;
|
|
20412
|
-
if (/^\d+(?:\.\d+)?$/.test(value.trim()))
|
|
20413
|
-
return Number(value) * 1000;
|
|
20414
|
-
const date = Date.parse(value);
|
|
20415
|
-
return Number.isFinite(date) ? Math.max(0, date - now) : undefined;
|
|
20416
|
-
}
|
|
20417
|
-
function retryDelay(attempt, retryAfter, random = Math.random) {
|
|
20418
|
-
return retryAfterMs(retryAfter) ?? Math.min(30000, 500 * 2 ** attempt) * (0.5 + random() * 0.5);
|
|
20419
|
-
}
|
|
20420
|
-
function abortable(promise, signal) {
|
|
20421
|
-
signal.throwIfAborted();
|
|
20422
|
-
return new Promise((resolve, reject) => {
|
|
20423
|
-
const abort = () => reject(signal.reason);
|
|
20424
|
-
signal.addEventListener("abort", abort, { once: true });
|
|
20425
|
-
promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
20426
|
-
});
|
|
20427
|
-
}
|
|
20428
|
-
function sleep(ms, signal) {
|
|
20429
|
-
signal.throwIfAborted();
|
|
20430
|
-
return new Promise((resolve, reject) => {
|
|
20431
|
-
const abort = () => {
|
|
20432
|
-
clearTimeout(timer);
|
|
20433
|
-
reject(signal.reason);
|
|
20434
|
-
};
|
|
20435
|
-
const timer = setTimeout(() => {
|
|
20436
|
-
signal.removeEventListener("abort", abort);
|
|
20437
|
-
resolve();
|
|
20438
|
-
}, ms);
|
|
20439
|
-
signal.addEventListener("abort", abort, { once: true });
|
|
20440
|
-
});
|
|
20441
|
-
}
|
|
20442
|
-
async function fetchWithRetry(request, fetcher, options) {
|
|
20443
|
-
const eligible = canRetry(request);
|
|
20444
|
-
const wait = options.wait ?? sleep;
|
|
20445
|
-
for (let attempt = 0;; attempt++) {
|
|
20446
|
-
options.signal.throwIfAborted();
|
|
20447
|
-
let response;
|
|
20448
|
-
try {
|
|
20449
|
-
response = await abortable(fetcher(request.clone()), options.signal);
|
|
20450
|
-
} catch (cause) {
|
|
20451
|
-
options.signal.throwIfAborted();
|
|
20452
|
-
if (!eligible || attempt >= options.maxRetries)
|
|
20453
|
-
throw new PraxisConnectionError(cause);
|
|
20454
|
-
await wait(retryDelay(attempt, null, options.random), options.signal);
|
|
20455
|
-
continue;
|
|
20456
|
-
}
|
|
20457
|
-
const retriable = response.status === 408 || response.status === 429 || response.status >= 500 && response.status <= 599;
|
|
20458
|
-
if (!eligible || !retriable || attempt >= options.maxRetries)
|
|
20459
|
-
return response;
|
|
20460
|
-
const delay = retryDelay(attempt, response.headers.get("Retry-After"), options.random);
|
|
20461
|
-
await response.body?.cancel();
|
|
20462
|
-
await wait(delay, options.signal);
|
|
20463
|
-
}
|
|
20464
|
-
}
|
|
20465
|
-
|
|
20466
21857
|
// ../../packages/sdk/typescript/src/core/sse.ts
|
|
20467
21858
|
async function* parseSSE(body, options = {}) {
|
|
20468
21859
|
const reader = body.getReader();
|
|
@@ -20676,9 +22067,13 @@ class Transport {
|
|
|
20676
22067
|
};
|
|
20677
22068
|
}
|
|
20678
22069
|
async request(operation, options = {}) {
|
|
22070
|
+
return (await this.requestWithResponse(operation, options)).data;
|
|
22071
|
+
}
|
|
22072
|
+
async requestWithResponse(operation, options = {}) {
|
|
20679
22073
|
const scope = this.scope(options, false);
|
|
20680
22074
|
try {
|
|
20681
|
-
|
|
22075
|
+
const result = await abortable(operation(scope.options), scope.signal);
|
|
22076
|
+
return { data: result.data, response: result.response };
|
|
20682
22077
|
} finally {
|
|
20683
22078
|
scope.close();
|
|
20684
22079
|
}
|
|
@@ -20710,6 +22105,10 @@ function base64(bytes) {
|
|
|
20710
22105
|
return btoa(chunks.join(""));
|
|
20711
22106
|
}
|
|
20712
22107
|
async function publish(client2, input) {
|
|
22108
|
+
const rolloutFields = ["gradual", "gradualRollout", "gradual_rollout", "canary", "rollout", "percentage", "percent", "traffic", "traffic_percentage", "strategy", "versions"];
|
|
22109
|
+
if (Object.keys(input).some((key) => rolloutFields.includes(key) || /percentage|percent|canary|gradual|rollout|灰度/i.test(key))) {
|
|
22110
|
+
throw new PraxisError({ code: "INVALID_PARAMS", message: '平台不支持灰度 (gradual rollout is not supported). Roll back with praxis.application.workers.deployments.create({ path: { worker_id }, body: { strategy: "percentage", versions: [{ version_id: previousVersionId, percentage: 100 }] } }); the previous version artifacts must still be retained.' });
|
|
22111
|
+
}
|
|
20713
22112
|
const timeout = input.timeout_ms ?? 120000;
|
|
20714
22113
|
if (!Number.isFinite(timeout) || timeout < 0)
|
|
20715
22114
|
throw new RangeError("timeout_ms must be non-negative and finite");
|
|
@@ -20728,7 +22127,7 @@ async function publish(client2, input) {
|
|
|
20728
22127
|
const files = Object.entries(input.files);
|
|
20729
22128
|
if (files.length > 1e5)
|
|
20730
22129
|
throw new PraxisError({ code: "LIMIT_EXCEEDED", message: "At most 100000 asset paths can be published" });
|
|
20731
|
-
|
|
22130
|
+
let manifest = {};
|
|
20732
22131
|
const contents = new Map;
|
|
20733
22132
|
for (const [path2, content] of files) {
|
|
20734
22133
|
const normalized = path2.startsWith("/") ? path2 : `/${path2}`;
|
|
@@ -20737,8 +22136,8 @@ async function publish(client2, input) {
|
|
|
20737
22136
|
const bytes = typeof content === "string" ? new TextEncoder().encode(content) : new Uint8Array(content);
|
|
20738
22137
|
if (bytes.length > FILE_BYTES)
|
|
20739
22138
|
throw new PraxisError({ code: "LIMIT_EXCEEDED", message: `Asset ${normalized} exceeds 25 MiB` });
|
|
20740
|
-
const
|
|
20741
|
-
const hash = Array.from(
|
|
22139
|
+
const digest2 = new Uint8Array(await crypto.subtle.digest("SHA-256", bytes));
|
|
22140
|
+
const hash = Array.from(digest2.subarray(0, 16), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
20742
22141
|
manifest[normalized] = { hash, size: bytes.length };
|
|
20743
22142
|
contents.set(hash, bytes);
|
|
20744
22143
|
}
|
|
@@ -20751,9 +22150,60 @@ async function publish(client2, input) {
|
|
|
20751
22150
|
}
|
|
20752
22151
|
}
|
|
20753
22152
|
const created = !worker;
|
|
22153
|
+
if (!worker && input.dryRun)
|
|
22154
|
+
throw new PraxisError({ code: "NOT_FOUND", message: "请先创建应用 (create the application before dryRun)" });
|
|
20754
22155
|
worker ??= await workers.create({ body: { name: input.name, subdomain: { enabled: true } } });
|
|
20755
22156
|
const path = { worker_id: worker.id };
|
|
22157
|
+
let currentVersion;
|
|
22158
|
+
let currentDeployment;
|
|
22159
|
+
let previous = {};
|
|
22160
|
+
if (worker.praxis?.current_deployment_id) {
|
|
22161
|
+
currentDeployment = await workers.deployments.retrieve({ path: { ...path, deployment_id: worker.praxis.current_deployment_id } });
|
|
22162
|
+
const active = currentDeployment.versions[0];
|
|
22163
|
+
if (!active)
|
|
22164
|
+
throw new PraxisError({ code: "INVALID_RESPONSE", message: "Current deployment has no version" });
|
|
22165
|
+
currentVersion = await workers.versions.retrieve({ path: { ...path, version_id: active.version_id } });
|
|
22166
|
+
previous = (await workers.versions.assets.retrieveManifest({ path: { ...path, version_id: active.version_id } })).manifest;
|
|
22167
|
+
}
|
|
22168
|
+
manifest = {
|
|
22169
|
+
...Object.fromEntries(Object.entries(previous).filter(([key]) => input.keepExisting || Object.hasOwn(manifest, key))),
|
|
22170
|
+
...manifest
|
|
22171
|
+
};
|
|
22172
|
+
if (Object.keys(manifest).length > 1e5)
|
|
22173
|
+
throw new PraxisError({ code: "LIMIT_EXCEEDED", message: "At most 100000 asset paths can be published" });
|
|
22174
|
+
const added = Object.keys(manifest).filter((key) => !Object.hasOwn(previous, key));
|
|
22175
|
+
const changed = Object.keys(manifest).filter((key) => previous[key] && (previous[key].hash !== manifest[key].hash || previous[key].size !== manifest[key].size));
|
|
22176
|
+
const removed = Object.keys(previous).filter((key) => !Object.hasOwn(manifest, key));
|
|
22177
|
+
const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(manifest))));
|
|
22178
|
+
const manifestHash = Array.from(digest, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
22179
|
+
const staticOnly = !["main", "bindings", "compatibility_date", "compatibility_flags", "assets_config"].some((key) => Object.hasOwn(input, key));
|
|
22180
|
+
const unchanged = staticOnly && !!currentVersion && manifestHash === currentVersion.praxis.assets_manifest?.manifest_hash;
|
|
22181
|
+
const hashes = new Set(Object.values(manifest).map((entry) => entry.hash));
|
|
22182
|
+
const currentResult = {
|
|
22183
|
+
url: worker.subdomain.url,
|
|
22184
|
+
worker_id: worker.id,
|
|
22185
|
+
version_id: currentVersion?.id ?? null,
|
|
22186
|
+
deployment_id: currentDeployment?.id ?? null,
|
|
22187
|
+
status: currentDeployment?.praxis.status ?? "draft",
|
|
22188
|
+
created,
|
|
22189
|
+
...currentVersion ? { version: currentVersion } : {},
|
|
22190
|
+
unchanged,
|
|
22191
|
+
uploaded: 0,
|
|
22192
|
+
reused: hashes.size
|
|
22193
|
+
};
|
|
22194
|
+
if (unchanged && !input.dryRun)
|
|
22195
|
+
return currentResult;
|
|
20756
22196
|
const session = await workers.assetsUploadSession.create({ path, body: { manifest } });
|
|
22197
|
+
if (input.dryRun) {
|
|
22198
|
+
const missing = new Set(session.buckets.flat());
|
|
22199
|
+
if ([...missing].some((hash) => !hashes.has(hash)))
|
|
22200
|
+
throw new PraxisError({ code: "INVALID_RESPONSE", message: "Upload session requested an unknown hash" });
|
|
22201
|
+
return {
|
|
22202
|
+
...currentResult,
|
|
22203
|
+
reused: hashes.size - missing.size,
|
|
22204
|
+
plan: { added, changed, removed, upload_hashes: missing.size, existing_hashes: hashes.size - missing.size }
|
|
22205
|
+
};
|
|
22206
|
+
}
|
|
20757
22207
|
let jwt = session.buckets.length ? null : session.jwt;
|
|
20758
22208
|
const uploaded = new Set;
|
|
20759
22209
|
for (const bucket of session.buckets) {
|
|
@@ -20824,16 +22274,31 @@ async function publish(client2, input) {
|
|
|
20824
22274
|
status: deployment.praxis.status,
|
|
20825
22275
|
created,
|
|
20826
22276
|
uploaded: uploaded.size,
|
|
20827
|
-
reused:
|
|
22277
|
+
reused: hashes.size - uploaded.size
|
|
20828
22278
|
};
|
|
20829
22279
|
}
|
|
20830
22280
|
|
|
22281
|
+
// ../../packages/sdk/typescript/src/helpers/database-count.ts
|
|
22282
|
+
async function count(transport, input) {
|
|
22283
|
+
const { response } = await transport.requestWithResponse(databaseHead, {
|
|
22284
|
+
path: { database_id: input.database_id, table: input.table },
|
|
22285
|
+
query: input.filters,
|
|
22286
|
+
headers: { Prefer: `count=${input.count ?? "exact"}` }
|
|
22287
|
+
});
|
|
22288
|
+
const total = response.headers.get("Content-Range")?.split("/")[1];
|
|
22289
|
+
return { count: total === undefined || total === "*" ? null : Number(total) };
|
|
22290
|
+
}
|
|
22291
|
+
|
|
20831
22292
|
// ../../packages/sdk/typescript/src/core/client.ts
|
|
20832
22293
|
class Praxis {
|
|
20833
22294
|
constructor(options) {
|
|
20834
22295
|
const transport = new Transport(options);
|
|
20835
22296
|
for (const [name, create] of Object.entries(resourceFactories)) {
|
|
20836
22297
|
const resource = create(transport);
|
|
22298
|
+
if (name === "file")
|
|
22299
|
+
Object.assign(resource, { uploadFile: (file, options2) => uploadFile(this, file, options2) });
|
|
22300
|
+
if (name === "database")
|
|
22301
|
+
Object.assign(resource, { count: (input) => count(transport, input) });
|
|
20837
22302
|
if (name === "application")
|
|
20838
22303
|
Object.assign(resource, { publish: (input) => publish(this, input) });
|
|
20839
22304
|
Object.defineProperty(this, name, { value: resource, enumerable: true });
|
|
@@ -21965,7 +23430,7 @@ function plain(value) {
|
|
|
21965
23430
|
}
|
|
21966
23431
|
|
|
21967
23432
|
// src/output/human.ts
|
|
21968
|
-
var
|
|
23433
|
+
var count3 = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
|
|
21969
23434
|
function identity(result, ctx) {
|
|
21970
23435
|
const op = "op" in result ? result.op : undefined;
|
|
21971
23436
|
const split = op?.lastIndexOf(".") ?? -1;
|
|
@@ -22053,7 +23518,7 @@ function objectView(data, resource, id, ctx, paint) {
|
|
|
22053
23518
|
return v.map(scalar).map(plain).join(", ");
|
|
22054
23519
|
folded = true;
|
|
22055
23520
|
const preview = v.slice(0, 3).map((item) => record(item).id ?? record(item).name).filter((x) => x !== undefined).map((x) => plain(scalar(x)));
|
|
22056
|
-
return `${
|
|
23521
|
+
return `${count3(v.length, "item")}${preview.length ? ` (${preview.join(", ")})` : ""}`;
|
|
22057
23522
|
}
|
|
22058
23523
|
if (v !== null && typeof v === "object") {
|
|
22059
23524
|
if (depth >= 1) {
|
|
@@ -22094,7 +23559,7 @@ function renderHuman(result, ctx) {
|
|
|
22094
23559
|
return {
|
|
22095
23560
|
stdout: result.items.length ? table(result.items, ctx, out) : out.dim(`No ${plain(resource)}${/(s|x|ch|sh)$/.test(resource) ? "es" : "s"}.`) + `
|
|
22096
23561
|
`,
|
|
22097
|
-
stderr: err.dim(`${result.total !== undefined ? `${result.items.length} of ${result.total} items` :
|
|
23562
|
+
stderr: err.dim(`${result.total !== undefined ? `${result.items.length} of ${result.total} items` : count3(result.items.length, "item")}${result.nextCursor ? ` · next: ${ctx.nextCommand ?? "praxis --help"}` : ""}`) + `
|
|
22098
23563
|
`
|
|
22099
23564
|
};
|
|
22100
23565
|
case "object": {
|
|
@@ -22374,7 +23839,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
|
|
|
22374
23839
|
}
|
|
22375
23840
|
|
|
22376
23841
|
// src/main.ts
|
|
22377
|
-
var version = "0.1.0-dev.
|
|
23842
|
+
var version = "0.1.0-dev.a3beed2";
|
|
22378
23843
|
var commands = commandTree(operations);
|
|
22379
23844
|
var manual = [["login"], ["logout"], ["whoami"], ["org", "list"], ["org", "switch"], ["api"], ["skill"]];
|
|
22380
23845
|
function route(argv) {
|