@deepraxis/cli 0.1.0-dev.98b03cc → 0.1.0-dev.a5cf3ce

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/COMMANDS.md +390 -0
  2. package/LICENSE +202 -67
  3. package/README.md +200 -36
  4. package/dist/praxis.js +1228 -110
  5. 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 and custom tool entries 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"}]}.',
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: "MCP servers this agent connects to. Maximum 20. Names must be unique\nwithin the array. Every server must be referenced by an `mcp_toolset` in\n`tools`; unreferenced servers are rejected. See the\n[MCP connector guide](https://platform.claude.com/docs/en/managed-agents/mcp-connector)."
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",
@@ -183,6 +183,17 @@ across all toolsets allowed.`
183
183
  type: "object",
184
184
  required: false,
185
185
  description: "Praxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable."
186
+ },
187
+ {
188
+ name: "preset",
189
+ type: "string",
190
+ enum: [
191
+ "minimal",
192
+ "data-editor",
193
+ "full"
194
+ ],
195
+ required: false,
196
+ 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
197
  }
187
198
  ]
188
199
  }
@@ -190,7 +201,7 @@ across all toolsets allowed.`
190
201
  {
191
202
  resource: "agent.agents",
192
203
  method: "retrieve",
193
- summary: "",
204
+ summary: "Get agent",
194
205
  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
206
  http: "GET",
196
207
  path: "/agent/v1/agents/{agent_id}",
@@ -214,8 +225,8 @@ across all toolsets allowed.`
214
225
  {
215
226
  resource: "agent.agents",
216
227
  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 and custom tools return 400; use the native skill tool for available runtime skills.",
228
+ summary: "Update agent",
229
+ 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
230
  http: "POST",
220
231
  path: "/agent/v1/agents/{agent_id}",
221
232
  streaming: "no",
@@ -241,7 +252,7 @@ across all toolsets allowed.`
241
252
  type: "array",
242
253
  itemType: "object",
243
254
  required: false,
244
- description: "MCP servers. Full replacement. Omit to preserve; send empty array or\n`null` to clear. Names must be unique. Maximum 20. Every server must be\nreferenced by an `mcp_toolset` in the agent's resulting `tools`; unreferenced\nservers are rejected. See the\n[MCP connector guide](https://platform.claude.com/docs/en/managed-agents/mcp-connector)."
255
+ description: "Praxis extension: HTTP, SSE or trusted stdio MCP servers paired with mcp_toolset entries and saved with the agent version."
245
256
  },
246
257
  {
247
258
  name: "metadata",
@@ -348,6 +359,17 @@ current version; omit to apply the update unconditionally.`
348
359
  type: "object",
349
360
  required: false,
350
361
  description: "Praxis extension: switchable model ids on /agent/v1 only. The default model must be included. When omitted, only the default model is selectable."
362
+ },
363
+ {
364
+ name: "preset",
365
+ type: "string",
366
+ enum: [
367
+ "minimal",
368
+ "data-editor",
369
+ "full"
370
+ ],
371
+ required: false,
372
+ 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
373
  }
352
374
  ]
353
375
  }
@@ -355,7 +377,7 @@ current version; omit to apply the update unconditionally.`
355
377
  {
356
378
  resource: "agent.agents",
357
379
  method: "archive",
358
- summary: "",
380
+ summary: "Archive agent",
359
381
  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
382
  http: "POST",
361
383
  path: "/agent/v1/agents/{agent_id}/archive",
@@ -369,10 +391,210 @@ current version; omit to apply the update unconditionally.`
369
391
  ],
370
392
  query: []
371
393
  },
394
+ {
395
+ resource: "agent.agents.endUsers",
396
+ method: "list",
397
+ summary: "List End Users",
398
+ description: `List users who have sessions or token issuance history on a service agent.
399
+
400
+ 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.`,
401
+ http: "GET",
402
+ path: "/agent/v1/agents/{agent_id}/end_users",
403
+ streaming: "no",
404
+ pagination: false,
405
+ pathParams: [
406
+ {
407
+ name: "agent_id",
408
+ sdkName: "agent_id"
409
+ }
410
+ ],
411
+ query: [
412
+ {
413
+ name: "limit",
414
+ type: "integer",
415
+ required: false,
416
+ description: "Maximum users per page; defaults to 20."
417
+ },
418
+ {
419
+ name: "page",
420
+ type: "string",
421
+ required: false,
422
+ description: "next_page from the previous response with the same agent, q and limit."
423
+ },
424
+ {
425
+ name: "q",
426
+ type: "string",
427
+ required: false,
428
+ description: "Case-sensitive literal prefix of external_user_id; omit or use an empty string for all users."
429
+ }
430
+ ]
431
+ },
432
+ {
433
+ resource: "agent.agents.endUsers",
434
+ method: "delete",
435
+ summary: "Delete end-user data",
436
+ description: `Delete a host application's end-user data from one service agent after explicit confirmation.
437
+
438
+ 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.`,
439
+ http: "DELETE",
440
+ path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}",
441
+ streaming: "no",
442
+ pagination: false,
443
+ pathParams: [
444
+ {
445
+ name: "agent_id",
446
+ sdkName: "agent_id"
447
+ },
448
+ {
449
+ name: "external_user_id",
450
+ sdkName: "external_user_id"
451
+ }
452
+ ],
453
+ query: [
454
+ {
455
+ name: "confirm",
456
+ type: "string",
457
+ required: true,
458
+ description: "Must exactly equal the external_user_id path parameter to confirm destructive deletion."
459
+ }
460
+ ]
461
+ },
462
+ {
463
+ resource: "agent.agents.endUsers",
464
+ method: "retrieve",
465
+ summary: "Get End User",
466
+ description: `Inspect one end user and their twenty most recently updated sessions.
467
+
468
+ 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.`,
469
+ http: "GET",
470
+ path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}",
471
+ streaming: "no",
472
+ pagination: false,
473
+ pathParams: [
474
+ {
475
+ name: "agent_id",
476
+ sdkName: "agent_id"
477
+ },
478
+ {
479
+ name: "external_user_id",
480
+ sdkName: "external_user_id"
481
+ }
482
+ ],
483
+ query: []
484
+ },
485
+ {
486
+ resource: "agent.agents.endUsers.block",
487
+ method: "create",
488
+ summary: "Block End User",
489
+ description: `Block token issuance and session creation, then revoke existing tokens for an end user.
490
+
491
+ 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.`,
492
+ http: "POST",
493
+ path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/block",
494
+ streaming: "no",
495
+ pagination: false,
496
+ pathParams: [
497
+ {
498
+ name: "agent_id",
499
+ sdkName: "agent_id"
500
+ },
501
+ {
502
+ name: "external_user_id",
503
+ sdkName: "external_user_id"
504
+ }
505
+ ],
506
+ query: []
507
+ },
508
+ {
509
+ resource: "agent.agents.endUsers",
510
+ method: "retrieveDeletion",
511
+ summary: "Get end-user deletion",
512
+ description: `Poll the latest deletion task for an end user, including after the user data has been removed.
513
+
514
+ 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.`,
515
+ http: "GET",
516
+ path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/deletion",
517
+ streaming: "no",
518
+ pagination: false,
519
+ pathParams: [
520
+ {
521
+ name: "agent_id",
522
+ sdkName: "agent_id"
523
+ },
524
+ {
525
+ name: "external_user_id",
526
+ sdkName: "external_user_id"
527
+ }
528
+ ],
529
+ query: []
530
+ },
531
+ {
532
+ resource: "agent.agents.endUsers.revokeTokens",
533
+ method: "create",
534
+ summary: "Revoke End User Tokens",
535
+ description: `Revoke all issued tokens for an end user and terminate their open embed streams.
536
+
537
+ 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.`,
538
+ http: "POST",
539
+ path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/revoke_tokens",
540
+ streaming: "no",
541
+ pagination: false,
542
+ pathParams: [
543
+ {
544
+ name: "agent_id",
545
+ sdkName: "agent_id"
546
+ },
547
+ {
548
+ name: "external_user_id",
549
+ sdkName: "external_user_id"
550
+ }
551
+ ],
552
+ query: []
553
+ },
554
+ {
555
+ resource: "agent.agents.endUsers.unblock",
556
+ method: "create",
557
+ summary: "Unblock End User",
558
+ description: `Allow an end user to receive new tokens and create new sessions again.
559
+
560
+ 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.`,
561
+ http: "POST",
562
+ path: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock",
563
+ streaming: "no",
564
+ pagination: false,
565
+ pathParams: [
566
+ {
567
+ name: "agent_id",
568
+ sdkName: "agent_id"
569
+ },
570
+ {
571
+ name: "external_user_id",
572
+ sdkName: "external_user_id"
573
+ }
574
+ ],
575
+ query: []
576
+ },
577
+ {
578
+ resource: "agent.agents.unarchive",
579
+ method: "create",
580
+ summary: "Unarchive Agent",
581
+ 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.",
582
+ http: "POST",
583
+ path: "/agent/v1/agents/{agent_id}/unarchive",
584
+ streaming: "no",
585
+ pagination: false,
586
+ pathParams: [
587
+ {
588
+ name: "agent_id",
589
+ sdkName: "agent_id"
590
+ }
591
+ ],
592
+ query: []
593
+ },
372
594
  {
373
595
  resource: "agent.agents.versions",
374
596
  method: "list",
375
- summary: "",
597
+ summary: "List agent versions",
376
598
  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
599
  http: "GET",
378
600
  path: "/agent/v1/agents/{agent_id}/versions",
@@ -580,7 +802,9 @@ Own-face superset: Managed Agents has no persistent Computer attachment director
580
802
  summary: "Connect computer",
581
803
  description: `Resume the computer and issue a sandbox connection.
582
804
 
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.`,
805
+ 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.
806
+
807
+ 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. Heavy running time counts toward the daily budget in seconds. Renew the lease while using the connection and release it with DELETE when finished. If the daily budget is exhausted, 429 COMPUTER_BUDGET_EXHAUSTED allows you to continue with need light.`,
584
808
  http: "POST",
585
809
  path: "/agent/v1/computers/{computer_id}/connect",
586
810
  streaming: "no",
@@ -591,7 +815,22 @@ Own-face extension: Managed Agents has no persistent Computer connection. Return
591
815
  sdkName: "computer_id"
592
816
  }
593
817
  ],
594
- query: []
818
+ query: [],
819
+ body: {
820
+ required: false,
821
+ fields: [
822
+ {
823
+ name: "need",
824
+ type: "string",
825
+ enum: [
826
+ "light",
827
+ "heavy"
828
+ ],
829
+ required: false,
830
+ 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."
831
+ }
832
+ ]
833
+ }
595
834
  },
596
835
  {
597
836
  resource: "agent.computers.files",
@@ -645,10 +884,56 @@ Praxis extension: MA only has session-scoped temporary containers and memory_sto
645
884
  }
646
885
  ]
647
886
  },
887
+ {
888
+ resource: "agent.computers.leases",
889
+ method: "delete",
890
+ summary: "Release computer lease",
891
+ description: `Give the lease back when a connection closes so the full machine can be reclaimed without waiting for it to expire.
892
+
893
+ Own-face extension. Idempotent: an unknown or already released lease succeeds as well. Foreign or absent computers return 404.`,
894
+ http: "DELETE",
895
+ path: "/agent/v1/computers/{computer_id}/leases/{lease_id}",
896
+ streaming: "no",
897
+ pagination: false,
898
+ pathParams: [
899
+ {
900
+ name: "computer_id",
901
+ sdkName: "computer_id"
902
+ },
903
+ {
904
+ name: "lease_id",
905
+ sdkName: "lease_id"
906
+ }
907
+ ],
908
+ query: []
909
+ },
910
+ {
911
+ resource: "agent.computers.leases.renew",
912
+ method: "create",
913
+ summary: "Renew computer lease",
914
+ description: `Extend the lease a connection holds so the full machine stays in service while the connection is open.
915
+
916
+ 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.`,
917
+ http: "POST",
918
+ path: "/agent/v1/computers/{computer_id}/leases/{lease_id}/renew",
919
+ streaming: "no",
920
+ pagination: false,
921
+ pathParams: [
922
+ {
923
+ name: "computer_id",
924
+ sdkName: "computer_id"
925
+ },
926
+ {
927
+ name: "lease_id",
928
+ sdkName: "lease_id"
929
+ }
930
+ ],
931
+ query: []
932
+ },
648
933
  {
649
934
  resource: "agent.deploymentRuns",
650
935
  method: "list",
651
- summary: "",
936
+ summary: "List deployment runs",
652
937
  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
938
  http: "GET",
654
939
  path: "/agent/v1/deployment_runs",
@@ -723,7 +1008,7 @@ Praxis extension: MA only has session-scoped temporary containers and memory_sto
723
1008
  {
724
1009
  resource: "agent.deploymentRuns",
725
1010
  method: "retrieve",
726
- summary: "",
1011
+ summary: "Get deployment run",
727
1012
  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
1013
  http: "GET",
729
1014
  path: "/agent/v1/deployment_runs/{deployment_run_id}",
@@ -740,7 +1025,7 @@ Praxis extension: MA only has session-scoped temporary containers and memory_sto
740
1025
  {
741
1026
  resource: "agent.deployments",
742
1027
  method: "list",
743
- summary: "",
1028
+ summary: "List deployments",
744
1029
  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
1030
  http: "GET",
746
1031
  path: "/agent/v1/deployments",
@@ -804,8 +1089,8 @@ archived).`
804
1089
  {
805
1090
  resource: "agent.deployments",
806
1091
  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 and empty vault_ids are accepted. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.",
1092
+ summary: "Create deployment",
1093
+ 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
1094
  http: "POST",
810
1095
  path: "/agent/v1/deployments",
811
1096
  streaming: "no",
@@ -894,7 +1179,7 @@ created from this deployment. Maximum 50.`
894
1179
  {
895
1180
  resource: "agent.deployments",
896
1181
  method: "retrieve",
897
- summary: "",
1182
+ summary: "Get deployment",
898
1183
  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
1184
  http: "GET",
900
1185
  path: "/agent/v1/deployments/{deployment_id}",
@@ -911,7 +1196,7 @@ created from this deployment. Maximum 50.`
911
1196
  {
912
1197
  resource: "agent.deployments",
913
1198
  method: "update",
914
- summary: "",
1199
+ summary: "Update deployment",
915
1200
  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
1201
  http: "POST",
917
1202
  path: "/agent/v1/deployments/{deployment_id}",
@@ -1009,7 +1294,7 @@ null to clear. Maximum 50.`
1009
1294
  {
1010
1295
  resource: "agent.deployments",
1011
1296
  method: "archive",
1012
- summary: "",
1297
+ summary: "Archive deployment",
1013
1298
  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
1299
  http: "POST",
1015
1300
  path: "/agent/v1/deployments/{deployment_id}/archive",
@@ -1026,7 +1311,7 @@ null to clear. Maximum 50.`
1026
1311
  {
1027
1312
  resource: "agent.deployments",
1028
1313
  method: "pause",
1029
- summary: "",
1314
+ summary: "Pause deployment",
1030
1315
  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
1316
  http: "POST",
1032
1317
  path: "/agent/v1/deployments/{deployment_id}/pause",
@@ -1043,7 +1328,7 @@ null to clear. Maximum 50.`
1043
1328
  {
1044
1329
  resource: "agent.deployments.run",
1045
1330
  method: "create",
1046
- summary: "",
1331
+ summary: "Run deployment",
1047
1332
  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
1333
  http: "POST",
1049
1334
  path: "/agent/v1/deployments/{deployment_id}/run",
@@ -1060,7 +1345,7 @@ null to clear. Maximum 50.`
1060
1345
  {
1061
1346
  resource: "agent.deployments.unpause",
1062
1347
  method: "create",
1063
- summary: "",
1348
+ summary: "Unpause deployment",
1064
1349
  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
1350
  http: "POST",
1066
1351
  path: "/agent/v1/deployments/{deployment_id}/unpause",
@@ -1074,13 +1359,89 @@ null to clear. Maximum 50.`
1074
1359
  ],
1075
1360
  query: []
1076
1361
  },
1362
+ {
1363
+ resource: "agent.embed",
1364
+ method: "retrieveAppearance",
1365
+ summary: "Read chat appearance",
1366
+ 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.",
1367
+ http: "GET",
1368
+ path: "/agent/v1/embed/appearance",
1369
+ streaming: "no",
1370
+ pagination: false,
1371
+ pathParams: [],
1372
+ query: []
1373
+ },
1374
+ {
1375
+ resource: "agent.embed.exchange",
1376
+ method: "create",
1377
+ summary: "Exchange Hosted Code",
1378
+ description: `Redeem a single-use hosted link credential for an end-user token.
1379
+
1380
+ 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>"}.`,
1381
+ http: "POST",
1382
+ path: "/agent/v1/embed/exchange",
1383
+ streaming: "no",
1384
+ pagination: false,
1385
+ pathParams: [],
1386
+ query: [],
1387
+ body: {
1388
+ required: true,
1389
+ fields: [
1390
+ {
1391
+ name: "code",
1392
+ type: "string",
1393
+ required: true,
1394
+ description: "Single-use credential from the c fragment parameter of hosted_url returned by embed token creation. Valid for 60 seconds."
1395
+ }
1396
+ ]
1397
+ }
1398
+ },
1399
+ {
1400
+ resource: "agent.embedTokens",
1401
+ method: "list",
1402
+ summary: "List Embed Tokens",
1403
+ description: `List embed token issuance records in your organization.
1404
+
1405
+ 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.`,
1406
+ http: "GET",
1407
+ path: "/agent/v1/embed_tokens",
1408
+ streaming: "no",
1409
+ pagination: false,
1410
+ pathParams: [],
1411
+ query: [
1412
+ {
1413
+ name: "agent_id",
1414
+ type: "string",
1415
+ required: false,
1416
+ description: "Filter by service agent identifier (agent_ or agt_ prefix)."
1417
+ },
1418
+ {
1419
+ name: "external_user_id",
1420
+ type: "string",
1421
+ required: false,
1422
+ description: "Exact host user identifier supplied at issuance."
1423
+ },
1424
+ {
1425
+ name: "limit",
1426
+ type: "integer",
1427
+ required: false,
1428
+ description: "Maximum records per page; defaults to 20."
1429
+ },
1430
+ {
1431
+ name: "page",
1432
+ type: "string",
1433
+ required: false,
1434
+ description: "next_page from a previous response with the same filters."
1435
+ }
1436
+ ]
1437
+ },
1077
1438
  {
1078
1439
  resource: "agent.embedTokens",
1079
1440
  method: "create",
1080
1441
  summary: "Create Embed Token",
1081
1442
  description: `Issue a short-lived credential on your backend for an end user of a service agent.
1082
1443
 
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. The hosted field is not supported.`,
1444
+ 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
1445
  http: "POST",
1085
1446
  path: "/agent/v1/embed_tokens",
1086
1447
  streaming: "no",
@@ -1090,6 +1451,12 @@ Requires an active service agent in your organization with an embed policy. Pins
1090
1451
  body: {
1091
1452
  required: true,
1092
1453
  fields: [
1454
+ {
1455
+ name: "hosted",
1456
+ type: "boolean",
1457
+ required: false,
1458
+ 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."
1459
+ },
1093
1460
  {
1094
1461
  name: "agent",
1095
1462
  type: "string",
@@ -1149,10 +1516,60 @@ Requires an active service agent in your organization with an embed policy. Pins
1149
1516
  ]
1150
1517
  }
1151
1518
  },
1519
+ {
1520
+ resource: "agent.embedTokens.anonymous",
1521
+ method: "create",
1522
+ summary: "Issue anonymous visitor token",
1523
+ description: `Obtain a short-lived embedding token for a visitor without an account using the agent owner's publishable key.
1524
+
1525
+ 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"}.`,
1526
+ http: "POST",
1527
+ path: "/agent/v1/embed_tokens/anonymous",
1528
+ streaming: "no",
1529
+ pagination: false,
1530
+ pathParams: [],
1531
+ query: [],
1532
+ body: {
1533
+ required: true,
1534
+ fields: [
1535
+ {
1536
+ name: "publishable_key",
1537
+ type: "string",
1538
+ required: true,
1539
+ description: "Public key created by the service agent owner; safe to include in browser code."
1540
+ },
1541
+ {
1542
+ name: "visitor_secret",
1543
+ type: "string",
1544
+ required: false,
1545
+ description: "Secret returned by a previous anonymous issuance for this key. Omit for a new visitor; an unknown secret creates a new visitor."
1546
+ }
1547
+ ]
1548
+ }
1549
+ },
1550
+ {
1551
+ resource: "agent.embedTokens.revoke",
1552
+ method: "create",
1553
+ summary: "Revoke Embed Token",
1554
+ description: `Revoke an embed token and close its open event streams.
1555
+
1556
+ 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.`,
1557
+ http: "POST",
1558
+ path: "/agent/v1/embed_tokens/{id}/revoke",
1559
+ streaming: "no",
1560
+ pagination: false,
1561
+ pathParams: [
1562
+ {
1563
+ name: "id",
1564
+ sdkName: "id"
1565
+ }
1566
+ ],
1567
+ query: []
1568
+ },
1152
1569
  {
1153
1570
  resource: "agent.environments",
1154
1571
  method: "list",
1155
- summary: "",
1572
+ summary: "List environments",
1156
1573
  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
1574
  http: "GET",
1158
1575
  path: "/agent/v1/environments",
@@ -1187,7 +1604,7 @@ Requires an active service agent in your organization with an embed policy. Pins
1187
1604
  {
1188
1605
  resource: "agent.environments",
1189
1606
  method: "create",
1190
- summary: "",
1607
+ summary: "Create environment",
1191
1608
  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
1609
  http: "POST",
1193
1610
  path: "/agent/v1/environments",
@@ -1241,7 +1658,7 @@ rejected. If not specified, defaults based on organization type.`
1241
1658
  {
1242
1659
  resource: "agent.environments",
1243
1660
  method: "retrieve",
1244
- summary: "",
1661
+ summary: "Get environment",
1245
1662
  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
1663
  http: "GET",
1247
1664
  path: "/agent/v1/environments/{environment_id}",
@@ -1258,7 +1675,7 @@ rejected. If not specified, defaults based on organization type.`
1258
1675
  {
1259
1676
  resource: "agent.environments",
1260
1677
  method: "update",
1261
- summary: "",
1678
+ summary: "Update environment",
1262
1679
  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
1680
  http: "POST",
1264
1681
  path: "/agent/v1/environments/{environment_id}",
@@ -1317,7 +1734,7 @@ owning account only.`
1317
1734
  {
1318
1735
  resource: "agent.environments",
1319
1736
  method: "archive",
1320
- summary: "",
1737
+ summary: "Archive environment",
1321
1738
  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
1739
  http: "POST",
1323
1740
  path: "/agent/v1/environments/{environment_id}/archive",
@@ -1334,7 +1751,7 @@ owning account only.`
1334
1751
  {
1335
1752
  resource: "agent.sessions",
1336
1753
  method: "list",
1337
- summary: "",
1754
+ summary: "List sessions",
1338
1755
  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
1756
  http: "GET",
1340
1757
  path: "/agent/v1/sessions",
@@ -1434,14 +1851,33 @@ owning account only.`
1434
1851
  type: "string",
1435
1852
  required: false,
1436
1853
  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."
1854
+ },
1855
+ {
1856
+ name: "external_user_id",
1857
+ type: "string",
1858
+ required: false,
1859
+ 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."
1860
+ },
1861
+ {
1862
+ name: "source",
1863
+ type: "string",
1864
+ enum: [
1865
+ "kit",
1866
+ "iframe",
1867
+ "hosted",
1868
+ "api",
1869
+ "automation"
1870
+ ],
1871
+ required: false,
1872
+ description: "Filter by session origin: kit, iframe, hosted, api or automation. Keep this filter unchanged when following page."
1437
1873
  }
1438
1874
  ]
1439
1875
  },
1440
1876
  {
1441
1877
  resource: "agent.sessions",
1442
1878
  method: "create",
1443
- summary: "",
1444
- description: `Create a session: one conversation with an agent, running on a machine. 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 environment_id for a sandbox recipe. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|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 and nonempty vault_ids are not supported. 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.`,
1879
+ summary: "Create session",
1880
+ description: `Create a session: one conversation with an agent, running on a machine. 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 environment_id for a sandbox recipe. 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
1881
  http: "POST",
1446
1882
  path: "/agent/v1/sessions",
1447
1883
  streaming: "no",
@@ -1541,10 +1977,27 @@ offsets ("+08:00") and unknown names return 400. Never stored in
1541
1977
  ]
1542
1978
  }
1543
1979
  },
1980
+ {
1981
+ resource: "agent.sessions",
1982
+ method: "delete",
1983
+ summary: "Delete session",
1984
+ 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.",
1985
+ http: "DELETE",
1986
+ path: "/agent/v1/sessions/{session_id}",
1987
+ streaming: "no",
1988
+ pagination: false,
1989
+ pathParams: [
1990
+ {
1991
+ name: "session_id",
1992
+ sdkName: "session_id"
1993
+ }
1994
+ ],
1995
+ query: []
1996
+ },
1544
1997
  {
1545
1998
  resource: "agent.sessions",
1546
1999
  method: "retrieve",
1547
- summary: "",
2000
+ summary: "Get session",
1548
2001
  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
2002
  http: "GET",
1550
2003
  path: "/agent/v1/sessions/{session_id}",
@@ -1561,8 +2014,8 @@ offsets ("+08:00") and unknown names return 400. Never stored in
1561
2014
  {
1562
2015
  resource: "agent.sessions",
1563
2016
  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 and nonempty vault_ids are not supported (400 naming the field). A budget limit must exceed consumed cost; null removes it permanently for this session. Updating an archived session returns 409.",
2017
+ summary: "Update session",
2018
+ 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
2019
  http: "POST",
1567
2020
  path: "/agent/v1/sessions/{session_id}",
1568
2021
  streaming: "no",
@@ -1627,7 +2080,7 @@ delete it. Omit the field to preserve.`
1627
2080
  {
1628
2081
  resource: "agent.sessions",
1629
2082
  method: "archive",
1630
- summary: "",
2083
+ summary: "Archive session",
1631
2084
  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
2085
  http: "POST",
1633
2086
  path: "/agent/v1/sessions/{session_id}/archive",
@@ -1813,8 +2266,8 @@ Praxis extension available only on /agent/v1, following Claude Agent SDK getCont
1813
2266
  {
1814
2267
  resource: "agent.sessions.events",
1815
2268
  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.",
2269
+ summary: "List session events",
2270
+ 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
2271
  http: "GET",
1819
2272
  path: "/agent/v1/sessions/{session_id}/events",
1820
2273
  streaming: "no",
@@ -1884,8 +2337,8 @@ Praxis extension available only on /agent/v1, following Claude Agent SDK getCont
1884
2337
  {
1885
2338
  resource: "agent.sessions.events",
1886
2339
  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.',
2340
+ summary: "Send session events",
2341
+ 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
2342
  http: "POST",
1890
2343
  path: "/agent/v1/sessions/{session_id}/events",
1891
2344
  streaming: "no",
@@ -1913,7 +2366,7 @@ Praxis extension available only on /agent/v1, following Claude Agent SDK getCont
1913
2366
  {
1914
2367
  resource: "agent.sessions.events",
1915
2368
  method: "stream",
1916
- summary: "",
2369
+ summary: "Stream session events",
1917
2370
  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
2371
  http: "GET",
1919
2372
  path: "/agent/v1/sessions/{session_id}/events/stream",
@@ -1972,7 +2425,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
1972
2425
  {
1973
2426
  resource: "agent.sessions.resources",
1974
2427
  method: "list",
1975
- summary: "",
2428
+ summary: "List session resources",
1976
2429
  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
2430
  http: "GET",
1978
2431
  path: "/agent/v1/sessions/{session_id}/resources",
@@ -2002,7 +2455,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
2002
2455
  {
2003
2456
  resource: "agent.sessions.resources",
2004
2457
  method: "create",
2005
- summary: "",
2458
+ summary: "Add session resource",
2006
2459
  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
2460
  http: "POST",
2008
2461
  path: "/agent/v1/sessions/{session_id}/resources",
@@ -2046,7 +2499,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
2046
2499
  {
2047
2500
  resource: "agent.sessions.resources",
2048
2501
  method: "delete",
2049
- summary: "",
2502
+ summary: "Delete session resource",
2050
2503
  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
2504
  http: "DELETE",
2052
2505
  path: "/agent/v1/sessions/{session_id}/resources/{resource_id}",
@@ -2075,7 +2528,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
2075
2528
  {
2076
2529
  resource: "agent.sessions.resources",
2077
2530
  method: "retrieve",
2078
- summary: "",
2531
+ summary: "Get session resource",
2079
2532
  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
2533
  http: "GET",
2081
2534
  path: "/agent/v1/sessions/{session_id}/resources/{resource_id}",
@@ -2087,24 +2540,91 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
2087
2540
  sdkName: "session_id"
2088
2541
  },
2089
2542
  {
2090
- name: "resource_id",
2091
- sdkName: "resource_id"
2543
+ name: "resource_id",
2544
+ sdkName: "resource_id"
2545
+ }
2546
+ ],
2547
+ query: [
2548
+ {
2549
+ name: "session_id",
2550
+ sdkName: "query_session_id",
2551
+ type: "string",
2552
+ required: true,
2553
+ description: "Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value."
2554
+ }
2555
+ ]
2556
+ },
2557
+ {
2558
+ resource: "agent.sessions.runs",
2559
+ method: "deleteFeedback",
2560
+ summary: "Delete Run Feedback",
2561
+ description: `Remove the rating and comment for a run.
2562
+
2563
+ 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.`,
2564
+ http: "DELETE",
2565
+ path: "/agent/v1/sessions/{session_id}/runs/{run_id}/feedback",
2566
+ streaming: "no",
2567
+ pagination: false,
2568
+ pathParams: [
2569
+ {
2570
+ name: "session_id",
2571
+ sdkName: "session_id"
2572
+ },
2573
+ {
2574
+ name: "run_id",
2575
+ sdkName: "run_id"
2092
2576
  }
2093
2577
  ],
2094
- query: [
2578
+ query: []
2579
+ },
2580
+ {
2581
+ resource: "agent.sessions.runs.feedback",
2582
+ method: "create",
2583
+ summary: "Set Run Feedback",
2584
+ description: `Submit thumbs up or thumbs down for a run, with an optional comment.
2585
+
2586
+ 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.`,
2587
+ http: "POST",
2588
+ path: "/agent/v1/sessions/{session_id}/runs/{run_id}/feedback",
2589
+ streaming: "no",
2590
+ pagination: false,
2591
+ pathParams: [
2095
2592
  {
2096
2593
  name: "session_id",
2097
- sdkName: "query_session_id",
2098
- type: "string",
2099
- required: true,
2100
- description: "Session id (sesn_...), as returned by sessions.create or sessions.list. The same id is also accepted as the session_id query parameter on resource and thread calls, where it must equal the path value."
2594
+ sdkName: "session_id"
2595
+ },
2596
+ {
2597
+ name: "run_id",
2598
+ sdkName: "run_id"
2101
2599
  }
2102
- ]
2600
+ ],
2601
+ query: [],
2602
+ body: {
2603
+ required: true,
2604
+ fields: [
2605
+ {
2606
+ name: "rating",
2607
+ type: "string",
2608
+ enum: [
2609
+ "positive",
2610
+ "negative"
2611
+ ],
2612
+ required: true,
2613
+ description: "positive means thumbs up; negative means thumbs down for this run."
2614
+ },
2615
+ {
2616
+ name: "comment",
2617
+ type: "string",
2618
+ required: false,
2619
+ description: "Optional comment, at most 2000 Unicode characters. Omit or send null to clear the previous comment."
2620
+ }
2621
+ ]
2622
+ }
2103
2623
  },
2104
2624
  {
2105
2625
  resource: "agent.sessions.threads",
2106
2626
  method: "list",
2107
- summary: "",
2627
+ summary: "List session threads",
2108
2628
  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
2629
  http: "GET",
2110
2630
  path: "/agent/v1/sessions/{session_id}/threads",
@@ -2134,7 +2654,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
2134
2654
  {
2135
2655
  resource: "agent.sessions.threads",
2136
2656
  method: "retrieve",
2137
- summary: "",
2657
+ summary: "Get session thread",
2138
2658
  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
2659
  http: "GET",
2140
2660
  path: "/agent/v1/sessions/{session_id}/threads/{thread_id}",
@@ -2163,7 +2683,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
2163
2683
  {
2164
2684
  resource: "agent.sessions.threads",
2165
2685
  method: "archive",
2166
- summary: "",
2686
+ summary: "Archive session thread",
2167
2687
  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
2688
  http: "POST",
2169
2689
  path: "/agent/v1/sessions/{session_id}/threads/{thread_id}/archive",
@@ -2192,7 +2712,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
2192
2712
  {
2193
2713
  resource: "agent.sessions.threads.events",
2194
2714
  method: "list",
2195
- summary: "",
2715
+ summary: "List session thread events",
2196
2716
  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
2717
  http: "GET",
2198
2718
  path: "/agent/v1/sessions/{session_id}/threads/{thread_id}/events",
@@ -2233,7 +2753,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
2233
2753
  {
2234
2754
  resource: "agent.sessions.threads",
2235
2755
  method: "stream",
2236
- summary: "",
2756
+ summary: "Stream session thread events",
2237
2757
  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
2758
  http: "GET",
2239
2759
  path: "/agent/v1/sessions/{session_id}/threads/{thread_id}/stream",
@@ -2988,6 +3508,27 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
2988
3508
  ],
2989
3509
  query: []
2990
3510
  },
3511
+ {
3512
+ resource: "application.workers.versions.assets",
3513
+ method: "retrieveManifest",
3514
+ summary: "Get version asset manifest",
3515
+ 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.",
3516
+ http: "GET",
3517
+ path: "/application/v1/workers/{worker_id}/versions/{version_id}/assets/manifest",
3518
+ streaming: "no",
3519
+ pagination: false,
3520
+ pathParams: [
3521
+ {
3522
+ name: "worker_id",
3523
+ sdkName: "worker_id"
3524
+ },
3525
+ {
3526
+ name: "version_id",
3527
+ sdkName: "version_id"
3528
+ }
3529
+ ],
3530
+ query: []
3531
+ },
2991
3532
  {
2992
3533
  resource: "automation.actions",
2993
3534
  method: "list",
@@ -6411,7 +6952,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6411
6952
  name: "{column}",
6412
6953
  type: "string",
6413
6954
  required: false,
6414
- description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. See the filter operator matrix."
6955
+ 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
6956
  },
6416
6957
  {
6417
6958
  name: "and",
@@ -6459,7 +7000,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6459
7000
  name: "on_conflict",
6460
7001
  type: "string",
6461
7002
  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."
7003
+ 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
7004
  },
6464
7005
  {
6465
7006
  name: "columns",
@@ -6473,7 +7014,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6473
7014
  resource: "database.databases.rest",
6474
7015
  method: "retrieve",
6475
7016
  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. Praxis SDK/codemode methods return the body only; a page length is not a total unless you know all matches fit in that page.",
7017
+ 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
7018
  http: "GET",
6478
7019
  path: "/database/v1/databases/{database_id}/rest/{table}",
6479
7020
  streaming: "no",
@@ -6499,7 +7040,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6499
7040
  name: "{column}",
6500
7041
  type: "string",
6501
7042
  required: false,
6502
- description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. See the filter operator matrix."
7043
+ 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
7044
  },
6504
7045
  {
6505
7046
  name: "and",
@@ -6547,7 +7088,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6547
7088
  name: "on_conflict",
6548
7089
  type: "string",
6549
7090
  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."
7091
+ 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
7092
  },
6552
7093
  {
6553
7094
  name: "columns",
@@ -6561,7 +7102,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6561
7102
  resource: "database.databases.rest",
6562
7103
  method: "head",
6563
7104
  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. Praxis SDK/codemode methods return only the empty body, not the Content-Range response header; use an HTTP client when you need that header.",
7105
+ 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
7106
  http: "HEAD",
6566
7107
  path: "/database/v1/databases/{database_id}/rest/{table}",
6567
7108
  streaming: "no",
@@ -6587,7 +7128,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6587
7128
  name: "{column}",
6588
7129
  type: "string",
6589
7130
  required: false,
6590
- description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. See the filter operator matrix."
7131
+ 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
7132
  },
6592
7133
  {
6593
7134
  name: "and",
@@ -6635,7 +7176,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6635
7176
  name: "on_conflict",
6636
7177
  type: "string",
6637
7178
  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."
7179
+ 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
7180
  },
6640
7181
  {
6641
7182
  name: "columns",
@@ -6675,7 +7216,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6675
7216
  name: "{column}",
6676
7217
  type: "string",
6677
7218
  required: false,
6678
- description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. See the filter operator matrix."
7219
+ 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
7220
  },
6680
7221
  {
6681
7222
  name: "and",
@@ -6723,7 +7264,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6723
7264
  name: "on_conflict",
6724
7265
  type: "string",
6725
7266
  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."
7267
+ 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
7268
  },
6728
7269
  {
6729
7270
  name: "columns",
@@ -6743,7 +7284,7 @@ Available only on /agent/v1. Use the message_id field from own-face events, not
6743
7284
  summary: "Insert rows",
6744
7285
  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
7286
  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.`,
7287
+ 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
7288
  http: "POST",
6748
7289
  path: "/database/v1/databases/{database_id}/rest/{table}",
6749
7290
  streaming: "no",
@@ -6769,7 +7310,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
6769
7310
  name: "{column}",
6770
7311
  type: "string",
6771
7312
  required: false,
6772
- description: "Horizontal filter: replace {column} with a field name or JSON path, e.g. title=eq.summary. Repeat for more columns. See the filter operator matrix."
7313
+ 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
7314
  },
6774
7315
  {
6775
7316
  name: "and",
@@ -6817,7 +7358,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
6817
7358
  name: "on_conflict",
6818
7359
  type: "string",
6819
7360
  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."
7361
+ 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
7362
  },
6822
7363
  {
6823
7364
  name: "columns",
@@ -6869,7 +7410,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
6869
7410
  resource: "database.databases.tables",
6870
7411
  method: "create",
6871
7412
  summary: "Create table",
6872
- 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. 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.",
7413
+ 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
7414
  http: "POST",
6874
7415
  path: "/database/v1/databases/{database_id}/tables",
6875
7416
  streaming: "no",
@@ -6990,7 +7531,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
6990
7531
  resource: "database.databases.tables.fields",
6991
7532
  method: "create",
6992
7533
  summary: "Add field",
6993
- 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. Scalar fields are indexed by default, while 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.",
7534
+ 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
7535
  http: "POST",
6995
7536
  path: "/database/v1/databases/{database_id}/tables/{table}/fields",
6996
7537
  streaming: "no",
@@ -11541,6 +12082,43 @@ for more details.`
11541
12082
  ],
11542
12083
  query: []
11543
12084
  },
12085
+ {
12086
+ resource: "organization.feedback",
12087
+ method: "list",
12088
+ summary: "List your organization's feedback",
12089
+ 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.",
12090
+ http: "GET",
12091
+ path: "/organization/v1/feedback",
12092
+ streaming: "no",
12093
+ pagination: false,
12094
+ pathParams: [],
12095
+ query: [
12096
+ {
12097
+ name: "phase",
12098
+ type: "string",
12099
+ required: false,
12100
+ 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."
12101
+ },
12102
+ {
12103
+ name: "query",
12104
+ type: "string",
12105
+ required: false,
12106
+ description: "Case-insensitive text matched against titles and message bodies."
12107
+ },
12108
+ {
12109
+ name: "limit",
12110
+ type: "integer",
12111
+ required: false,
12112
+ description: "Items per page, 1 to 100."
12113
+ },
12114
+ {
12115
+ name: "page",
12116
+ type: "string",
12117
+ required: false,
12118
+ description: "Opaque cursor from next_page of the previous response."
12119
+ }
12120
+ ]
12121
+ },
11544
12122
  {
11545
12123
  resource: "organization.feedback",
11546
12124
  method: "create",
@@ -11585,6 +12163,18 @@ for more details.`
11585
12163
  required: false,
11586
12164
  description: "X-Request-Id from the failed response or the related error event ID."
11587
12165
  },
12166
+ {
12167
+ name: "title",
12168
+ type: "string",
12169
+ required: false,
12170
+ description: "Short summary shown in the feedback list; at most 200 Unicode code points."
12171
+ },
12172
+ {
12173
+ name: "type",
12174
+ type: "string",
12175
+ required: false,
12176
+ 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."
12177
+ },
11588
12178
  {
11589
12179
  name: "tags",
11590
12180
  type: "object",
@@ -11617,6 +12207,100 @@ for more details.`
11617
12207
  ]
11618
12208
  }
11619
12209
  },
12210
+ {
12211
+ resource: "organization.feedback.counts",
12212
+ method: "list",
12213
+ summary: "Count your organization's feedback by phase",
12214
+ description: "How many of your organization's feedback are in each phase, for status tabs. Counts never include another organization's feedback.",
12215
+ http: "GET",
12216
+ path: "/organization/v1/feedback/counts",
12217
+ streaming: "no",
12218
+ pagination: false,
12219
+ pathParams: [],
12220
+ query: []
12221
+ },
12222
+ {
12223
+ resource: "organization.feedback",
12224
+ method: "retrieve",
12225
+ summary: "Get one of your organization's feedback",
12226
+ 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.",
12227
+ http: "GET",
12228
+ path: "/organization/v1/feedback/{id}",
12229
+ streaming: "no",
12230
+ pagination: false,
12231
+ pathParams: [
12232
+ {
12233
+ name: "id",
12234
+ sdkName: "id"
12235
+ }
12236
+ ],
12237
+ query: []
12238
+ },
12239
+ {
12240
+ resource: "organization.feedback.messages",
12241
+ method: "list",
12242
+ summary: "List the messages of a feedback",
12243
+ 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.",
12244
+ http: "GET",
12245
+ path: "/organization/v1/feedback/{id}/messages",
12246
+ streaming: "no",
12247
+ pagination: false,
12248
+ pathParams: [
12249
+ {
12250
+ name: "id",
12251
+ sdkName: "id"
12252
+ }
12253
+ ],
12254
+ query: [
12255
+ {
12256
+ name: "limit",
12257
+ type: "integer",
12258
+ required: false,
12259
+ description: "Items per page, 1 to 100."
12260
+ },
12261
+ {
12262
+ name: "page",
12263
+ type: "string",
12264
+ required: false,
12265
+ description: "Opaque cursor from next_page of the previous response."
12266
+ }
12267
+ ]
12268
+ },
12269
+ {
12270
+ resource: "organization.feedback.messages",
12271
+ method: "create",
12272
+ summary: "Reply on a feedback",
12273
+ 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.",
12274
+ http: "POST",
12275
+ path: "/organization/v1/feedback/{id}/messages",
12276
+ streaming: "no",
12277
+ pagination: false,
12278
+ pathParams: [
12279
+ {
12280
+ name: "id",
12281
+ sdkName: "id"
12282
+ }
12283
+ ],
12284
+ query: [],
12285
+ body: {
12286
+ required: true,
12287
+ fields: [
12288
+ {
12289
+ name: "body",
12290
+ type: "string",
12291
+ required: true,
12292
+ description: "Markdown text; at most 4096 Unicode code points."
12293
+ },
12294
+ {
12295
+ name: "attachments",
12296
+ type: "array",
12297
+ itemType: "object",
12298
+ required: false,
12299
+ description: "Up to five attachments; decoded bytes must not exceed 10 MiB each or 20 MiB in total."
12300
+ }
12301
+ ]
12302
+ }
12303
+ },
11620
12304
  {
11621
12305
  resource: "organization.usage",
11622
12306
  method: "list",
@@ -14839,6 +15523,169 @@ var createClient = (config = {}) => {
14839
15523
  var client = createClient(createConfig({ baseUrl: "https://api.deepraxis.com" }));
14840
15524
 
14841
15525
  // ../../packages/sdk/typescript/src/generated/sdk.gen.ts
15526
+ var unarchiveAgent = (options) => (options.client ?? client).post({
15527
+ security: [{
15528
+ key: "BearerAuth",
15529
+ scheme: "bearer",
15530
+ type: "http"
15531
+ }, {
15532
+ key: "ApiKeyAuth",
15533
+ name: "X-API-Key",
15534
+ type: "apiKey"
15535
+ }],
15536
+ url: "/agent/v1/agents/{agent_id}/unarchive",
15537
+ ...options
15538
+ });
15539
+ var deleteRunFeedback = (options) => (options.client ?? client).delete({
15540
+ security: [{
15541
+ key: "BearerAuth",
15542
+ scheme: "bearer",
15543
+ type: "http"
15544
+ }, {
15545
+ key: "ApiKeyAuth",
15546
+ name: "X-API-Key",
15547
+ type: "apiKey"
15548
+ }],
15549
+ url: "/agent/v1/sessions/{session_id}/runs/{run_id}/feedback",
15550
+ ...options
15551
+ });
15552
+ var setRunFeedback = (options) => (options.client ?? client).post({
15553
+ security: [{
15554
+ key: "BearerAuth",
15555
+ scheme: "bearer",
15556
+ type: "http"
15557
+ }, {
15558
+ key: "ApiKeyAuth",
15559
+ name: "X-API-Key",
15560
+ type: "apiKey"
15561
+ }],
15562
+ url: "/agent/v1/sessions/{session_id}/runs/{run_id}/feedback",
15563
+ ...options,
15564
+ headers: {
15565
+ "Content-Type": "application/json",
15566
+ ...options.headers
15567
+ }
15568
+ });
15569
+ var listEndUsers = (options) => (options.client ?? client).get({
15570
+ security: [{
15571
+ key: "BearerAuth",
15572
+ scheme: "bearer",
15573
+ type: "http"
15574
+ }, {
15575
+ key: "ApiKeyAuth",
15576
+ name: "X-API-Key",
15577
+ type: "apiKey"
15578
+ }],
15579
+ url: "/agent/v1/agents/{agent_id}/end_users",
15580
+ ...options
15581
+ });
15582
+ var deleteEndUser = (options) => (options.client ?? client).delete({
15583
+ security: [{
15584
+ key: "BearerAuth",
15585
+ scheme: "bearer",
15586
+ type: "http"
15587
+ }, {
15588
+ key: "ApiKeyAuth",
15589
+ name: "X-API-Key",
15590
+ type: "apiKey"
15591
+ }],
15592
+ url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}",
15593
+ ...options
15594
+ });
15595
+ var getEndUser = (options) => (options.client ?? client).get({
15596
+ security: [{
15597
+ key: "BearerAuth",
15598
+ scheme: "bearer",
15599
+ type: "http"
15600
+ }, {
15601
+ key: "ApiKeyAuth",
15602
+ name: "X-API-Key",
15603
+ type: "apiKey"
15604
+ }],
15605
+ url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}",
15606
+ ...options
15607
+ });
15608
+ var getEndUserDeletion = (options) => (options.client ?? client).get({
15609
+ security: [{
15610
+ key: "BearerAuth",
15611
+ scheme: "bearer",
15612
+ type: "http"
15613
+ }, {
15614
+ key: "ApiKeyAuth",
15615
+ name: "X-API-Key",
15616
+ type: "apiKey"
15617
+ }],
15618
+ url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/deletion",
15619
+ ...options
15620
+ });
15621
+ var revokeEndUserTokens = (options) => (options.client ?? client).post({
15622
+ security: [{
15623
+ key: "BearerAuth",
15624
+ scheme: "bearer",
15625
+ type: "http"
15626
+ }, {
15627
+ key: "ApiKeyAuth",
15628
+ name: "X-API-Key",
15629
+ type: "apiKey"
15630
+ }],
15631
+ url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/revoke_tokens",
15632
+ ...options
15633
+ });
15634
+ var blockEndUser = (options) => (options.client ?? client).post({
15635
+ security: [{
15636
+ key: "BearerAuth",
15637
+ scheme: "bearer",
15638
+ type: "http"
15639
+ }, {
15640
+ key: "ApiKeyAuth",
15641
+ name: "X-API-Key",
15642
+ type: "apiKey"
15643
+ }],
15644
+ url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/block",
15645
+ ...options
15646
+ });
15647
+ var unblockEndUser = (options) => (options.client ?? client).post({
15648
+ security: [{
15649
+ key: "BearerAuth",
15650
+ scheme: "bearer",
15651
+ type: "http"
15652
+ }, {
15653
+ key: "ApiKeyAuth",
15654
+ name: "X-API-Key",
15655
+ type: "apiKey"
15656
+ }],
15657
+ url: "/agent/v1/agents/{agent_id}/end_users/{external_user_id}/unblock",
15658
+ ...options
15659
+ });
15660
+ var exchangeEmbedCode = (options) => (options.client ?? client).post({
15661
+ url: "/agent/v1/embed/exchange",
15662
+ ...options,
15663
+ headers: {
15664
+ "Content-Type": "application/json",
15665
+ ...options.headers
15666
+ }
15667
+ });
15668
+ var createAnonymousEmbedToken = (options) => (options.client ?? client).post({
15669
+ url: "/agent/v1/embed_tokens/anonymous",
15670
+ ...options,
15671
+ headers: {
15672
+ "Content-Type": "application/json",
15673
+ ...options.headers
15674
+ }
15675
+ });
15676
+ var listEmbedTokens = (options) => (options?.client ?? client).get({
15677
+ security: [{
15678
+ key: "BearerAuth",
15679
+ scheme: "bearer",
15680
+ type: "http"
15681
+ }, {
15682
+ key: "ApiKeyAuth",
15683
+ name: "X-API-Key",
15684
+ type: "apiKey"
15685
+ }],
15686
+ url: "/agent/v1/embed_tokens",
15687
+ ...options
15688
+ });
14842
15689
  var createEmbedToken = (options) => (options.client ?? client).post({
14843
15690
  security: [{
14844
15691
  key: "BearerAuth",
@@ -14856,6 +15703,19 @@ var createEmbedToken = (options) => (options.client ?? client).post({
14856
15703
  ...options.headers
14857
15704
  }
14858
15705
  });
15706
+ var revokeEmbedToken = (options) => (options.client ?? client).post({
15707
+ security: [{
15708
+ key: "BearerAuth",
15709
+ scheme: "bearer",
15710
+ type: "http"
15711
+ }, {
15712
+ key: "ApiKeyAuth",
15713
+ name: "X-API-Key",
15714
+ type: "apiKey"
15715
+ }],
15716
+ url: "/agent/v1/embed_tokens/{id}/revoke",
15717
+ ...options
15718
+ });
14859
15719
  var computersList = (options) => (options?.client ?? client).get({
14860
15720
  security: [{
14861
15721
  key: "BearerAuth",
@@ -14997,6 +15857,36 @@ var connectComputer = (options) => (options.client ?? client).post({
14997
15857
  type: "apiKey"
14998
15858
  }],
14999
15859
  url: "/agent/v1/computers/{computer_id}/connect",
15860
+ ...options,
15861
+ headers: {
15862
+ "Content-Type": "application/json",
15863
+ ...options.headers
15864
+ }
15865
+ });
15866
+ var renewComputerLease = (options) => (options.client ?? client).post({
15867
+ security: [{
15868
+ key: "BearerAuth",
15869
+ scheme: "bearer",
15870
+ type: "http"
15871
+ }, {
15872
+ key: "ApiKeyAuth",
15873
+ name: "X-API-Key",
15874
+ type: "apiKey"
15875
+ }],
15876
+ url: "/agent/v1/computers/{computer_id}/leases/{lease_id}/renew",
15877
+ ...options
15878
+ });
15879
+ var releaseComputerLease = (options) => (options.client ?? client).delete({
15880
+ security: [{
15881
+ key: "BearerAuth",
15882
+ scheme: "bearer",
15883
+ type: "http"
15884
+ }, {
15885
+ key: "ApiKeyAuth",
15886
+ name: "X-API-Key",
15887
+ type: "apiKey"
15888
+ }],
15889
+ url: "/agent/v1/computers/{computer_id}/leases/{lease_id}",
15000
15890
  ...options
15001
15891
  });
15002
15892
  var listToolsets = (options) => (options?.client ?? client).get({
@@ -15124,6 +16014,15 @@ var listSessionCompactions = (options) => (options.client ?? client).get({
15124
16014
  url: "/agent/v1/sessions/{session_id}/compactions",
15125
16015
  ...options
15126
16016
  });
16017
+ var getEmbedAppearance = (options) => (options?.client ?? client).get({
16018
+ security: [{
16019
+ key: "BearerAuth",
16020
+ scheme: "bearer",
16021
+ type: "http"
16022
+ }, { name: "Praxis-Publishable-Key", type: "apiKey" }],
16023
+ url: "/agent/v1/embed/appearance",
16024
+ ...options
16025
+ });
15127
16026
  var createAudioSpeech = (options) => (options.client ?? client).post({
15128
16027
  security: [{
15129
16028
  key: "BearerAuth",
@@ -15862,6 +16761,19 @@ var countResponseInputTokens = (options) => (options.client ?? client).post({
15862
16761
  ...options.headers
15863
16762
  }
15864
16763
  });
16764
+ var listOrganizationFeedback = (options) => (options?.client ?? client).get({
16765
+ security: [{
16766
+ key: "BearerAuth",
16767
+ scheme: "bearer",
16768
+ type: "http"
16769
+ }, {
16770
+ key: "ApiKeyAuth",
16771
+ name: "X-API-Key",
16772
+ type: "apiKey"
16773
+ }],
16774
+ url: "/organization/v1/feedback",
16775
+ ...options
16776
+ });
15865
16777
  var createOrganizationFeedback = (options) => (options.client ?? client).post({
15866
16778
  security: [{
15867
16779
  key: "BearerAuth",
@@ -15879,6 +16791,62 @@ var createOrganizationFeedback = (options) => (options.client ?? client).post({
15879
16791
  ...options.headers
15880
16792
  }
15881
16793
  });
16794
+ var getOrganizationFeedbackCounts = (options) => (options?.client ?? client).get({
16795
+ security: [{
16796
+ key: "BearerAuth",
16797
+ scheme: "bearer",
16798
+ type: "http"
16799
+ }, {
16800
+ key: "ApiKeyAuth",
16801
+ name: "X-API-Key",
16802
+ type: "apiKey"
16803
+ }],
16804
+ url: "/organization/v1/feedback/counts",
16805
+ ...options
16806
+ });
16807
+ var getOrganizationFeedback = (options) => (options.client ?? client).get({
16808
+ security: [{
16809
+ key: "BearerAuth",
16810
+ scheme: "bearer",
16811
+ type: "http"
16812
+ }, {
16813
+ key: "ApiKeyAuth",
16814
+ name: "X-API-Key",
16815
+ type: "apiKey"
16816
+ }],
16817
+ url: "/organization/v1/feedback/{id}",
16818
+ ...options
16819
+ });
16820
+ var listOrganizationFeedbackMessages = (options) => (options.client ?? client).get({
16821
+ security: [{
16822
+ key: "BearerAuth",
16823
+ scheme: "bearer",
16824
+ type: "http"
16825
+ }, {
16826
+ key: "ApiKeyAuth",
16827
+ name: "X-API-Key",
16828
+ type: "apiKey"
16829
+ }],
16830
+ url: "/organization/v1/feedback/{id}/messages",
16831
+ ...options
16832
+ });
16833
+ var createOrganizationFeedbackMessage = (options) => (options.client ?? client).post({
16834
+ security: [{
16835
+ key: "BearerAuth",
16836
+ scheme: "bearer",
16837
+ type: "http"
16838
+ }, {
16839
+ key: "ApiKeyAuth",
16840
+ name: "X-API-Key",
16841
+ type: "apiKey"
16842
+ }],
16843
+ url: "/organization/v1/feedback/{id}/messages",
16844
+ ...options,
16845
+ headers: {
16846
+ "Content-Type": "application/json",
16847
+ ...options.headers
16848
+ }
16849
+ });
15882
16850
  var listOrganizationCosts = (options) => (options.client ?? client).get({
15883
16851
  security: [{
15884
16852
  key: "BearerAuth",
@@ -16171,7 +17139,7 @@ var runSandboxCommand = (options) => (options.client ?? client).post({
16171
17139
  ...options.headers
16172
17140
  }
16173
17141
  });
16174
- var agentsList = (options) => (options?.client ?? client).get({
17142
+ var sessionsDelete = (options) => (options.client ?? client).delete({
16175
17143
  security: [{
16176
17144
  key: "BearerAuth",
16177
17145
  scheme: "bearer",
@@ -16181,10 +17149,10 @@ var agentsList = (options) => (options?.client ?? client).get({
16181
17149
  name: "X-API-Key",
16182
17150
  type: "apiKey"
16183
17151
  }],
16184
- url: "/agent/v1/agents",
17152
+ url: "/agent/v1/sessions/{session_id}",
16185
17153
  ...options
16186
17154
  });
16187
- var agentsCreate = (options) => (options.client ?? client).post({
17155
+ var sessionsRetrieve = (options) => (options.client ?? client).get({
16188
17156
  security: [{
16189
17157
  key: "BearerAuth",
16190
17158
  scheme: "bearer",
@@ -16194,14 +17162,27 @@ var agentsCreate = (options) => (options.client ?? client).post({
16194
17162
  name: "X-API-Key",
16195
17163
  type: "apiKey"
16196
17164
  }],
16197
- url: "/agent/v1/agents",
17165
+ url: "/agent/v1/sessions/{session_id}",
17166
+ ...options
17167
+ });
17168
+ var sessionsUpdate = (options) => (options.client ?? client).post({
17169
+ security: [{
17170
+ key: "BearerAuth",
17171
+ scheme: "bearer",
17172
+ type: "http"
17173
+ }, {
17174
+ key: "ApiKeyAuth",
17175
+ name: "X-API-Key",
17176
+ type: "apiKey"
17177
+ }],
17178
+ url: "/agent/v1/sessions/{session_id}",
16198
17179
  ...options,
16199
17180
  headers: {
16200
17181
  "Content-Type": "application/json",
16201
17182
  ...options.headers
16202
17183
  }
16203
17184
  });
16204
- var agentsRetrieve = (options) => (options.client ?? client).get({
17185
+ var agentsList = (options) => (options?.client ?? client).get({
16205
17186
  security: [{
16206
17187
  key: "BearerAuth",
16207
17188
  scheme: "bearer",
@@ -16211,10 +17192,10 @@ var agentsRetrieve = (options) => (options.client ?? client).get({
16211
17192
  name: "X-API-Key",
16212
17193
  type: "apiKey"
16213
17194
  }],
16214
- url: "/agent/v1/agents/{agent_id}",
17195
+ url: "/agent/v1/agents",
16215
17196
  ...options
16216
17197
  });
16217
- var agentsUpdate = (options) => (options.client ?? client).post({
17198
+ var agentsCreate = (options) => (options.client ?? client).post({
16218
17199
  security: [{
16219
17200
  key: "BearerAuth",
16220
17201
  scheme: "bearer",
@@ -16224,14 +17205,14 @@ var agentsUpdate = (options) => (options.client ?? client).post({
16224
17205
  name: "X-API-Key",
16225
17206
  type: "apiKey"
16226
17207
  }],
16227
- url: "/agent/v1/agents/{agent_id}",
17208
+ url: "/agent/v1/agents",
16228
17209
  ...options,
16229
17210
  headers: {
16230
17211
  "Content-Type": "application/json",
16231
17212
  ...options.headers
16232
17213
  }
16233
17214
  });
16234
- var agentsArchive = (options) => (options.client ?? client).post({
17215
+ var agentsRetrieve = (options) => (options.client ?? client).get({
16235
17216
  security: [{
16236
17217
  key: "BearerAuth",
16237
17218
  scheme: "bearer",
@@ -16241,10 +17222,10 @@ var agentsArchive = (options) => (options.client ?? client).post({
16241
17222
  name: "X-API-Key",
16242
17223
  type: "apiKey"
16243
17224
  }],
16244
- url: "/agent/v1/agents/{agent_id}/archive",
17225
+ url: "/agent/v1/agents/{agent_id}",
16245
17226
  ...options
16246
17227
  });
16247
- var agentsVersionsList = (options) => (options.client ?? client).get({
17228
+ var agentsUpdate = (options) => (options.client ?? client).post({
16248
17229
  security: [{
16249
17230
  key: "BearerAuth",
16250
17231
  scheme: "bearer",
@@ -16254,10 +17235,14 @@ var agentsVersionsList = (options) => (options.client ?? client).get({
16254
17235
  name: "X-API-Key",
16255
17236
  type: "apiKey"
16256
17237
  }],
16257
- url: "/agent/v1/agents/{agent_id}/versions",
16258
- ...options
17238
+ url: "/agent/v1/agents/{agent_id}",
17239
+ ...options,
17240
+ headers: {
17241
+ "Content-Type": "application/json",
17242
+ ...options.headers
17243
+ }
16259
17244
  });
16260
- var sessionsList = (options) => (options?.client ?? client).get({
17245
+ var agentsArchive = (options) => (options.client ?? client).post({
16261
17246
  security: [{
16262
17247
  key: "BearerAuth",
16263
17248
  scheme: "bearer",
@@ -16267,10 +17252,10 @@ var sessionsList = (options) => (options?.client ?? client).get({
16267
17252
  name: "X-API-Key",
16268
17253
  type: "apiKey"
16269
17254
  }],
16270
- url: "/agent/v1/sessions",
17255
+ url: "/agent/v1/agents/{agent_id}/archive",
16271
17256
  ...options
16272
17257
  });
16273
- var sessionsCreate = (options) => (options.client ?? client).post({
17258
+ var agentsVersionsList = (options) => (options.client ?? client).get({
16274
17259
  security: [{
16275
17260
  key: "BearerAuth",
16276
17261
  scheme: "bearer",
@@ -16280,14 +17265,10 @@ var sessionsCreate = (options) => (options.client ?? client).post({
16280
17265
  name: "X-API-Key",
16281
17266
  type: "apiKey"
16282
17267
  }],
16283
- url: "/agent/v1/sessions",
16284
- ...options,
16285
- headers: {
16286
- "Content-Type": "application/json",
16287
- ...options.headers
16288
- }
17268
+ url: "/agent/v1/agents/{agent_id}/versions",
17269
+ ...options
16289
17270
  });
16290
- var sessionsRetrieve = (options) => (options.client ?? client).get({
17271
+ var sessionsList = (options) => (options?.client ?? client).get({
16291
17272
  security: [{
16292
17273
  key: "BearerAuth",
16293
17274
  scheme: "bearer",
@@ -16297,10 +17278,10 @@ var sessionsRetrieve = (options) => (options.client ?? client).get({
16297
17278
  name: "X-API-Key",
16298
17279
  type: "apiKey"
16299
17280
  }],
16300
- url: "/agent/v1/sessions/{session_id}",
17281
+ url: "/agent/v1/sessions",
16301
17282
  ...options
16302
17283
  });
16303
- var sessionsUpdate = (options) => (options.client ?? client).post({
17284
+ var sessionsCreate = (options) => (options.client ?? client).post({
16304
17285
  security: [{
16305
17286
  key: "BearerAuth",
16306
17287
  scheme: "bearer",
@@ -16310,7 +17291,7 @@ var sessionsUpdate = (options) => (options.client ?? client).post({
16310
17291
  name: "X-API-Key",
16311
17292
  type: "apiKey"
16312
17293
  }],
16313
- url: "/agent/v1/sessions/{session_id}",
17294
+ url: "/agent/v1/sessions",
16314
17295
  ...options,
16315
17296
  headers: {
16316
17297
  "Content-Type": "application/json",
@@ -16811,6 +17792,15 @@ var applicationCreateVersion = (options) => (options.client ?? client).post({
16811
17792
  ...options.headers
16812
17793
  }
16813
17794
  });
17795
+ var applicationGetVersionAssetManifest = (options) => (options.client ?? client).get({
17796
+ security: [{
17797
+ key: "application-bearerAuth",
17798
+ scheme: "bearer",
17799
+ type: "http"
17800
+ }],
17801
+ url: "/application/v1/workers/{worker_id}/versions/{version_id}/assets/manifest",
17802
+ ...options
17803
+ });
16814
17804
  var applicationGetVersion = (options) => (options.client ?? client).get({
16815
17805
  security: [{
16816
17806
  key: "application-bearerAuth",
@@ -19631,8 +20621,26 @@ function createAgent(transport) {
19631
20621
  agents: {
19632
20622
  archive: bind(transport, agentsArchive),
19633
20623
  create: bind(transport, agentsCreate),
20624
+ endUsers: {
20625
+ block: {
20626
+ create: bind(transport, blockEndUser)
20627
+ },
20628
+ delete: bind(transport, deleteEndUser),
20629
+ list: bind(transport, listEndUsers),
20630
+ retrieve: bind(transport, getEndUser),
20631
+ retrieveDeletion: bind(transport, getEndUserDeletion),
20632
+ revokeTokens: {
20633
+ create: bind(transport, revokeEndUserTokens)
20634
+ },
20635
+ unblock: {
20636
+ create: bind(transport, unblockEndUser)
20637
+ }
20638
+ },
19634
20639
  list: bind(transport, agentsList),
19635
20640
  retrieve: bind(transport, agentsRetrieve),
20641
+ unarchive: {
20642
+ create: bind(transport, unarchiveAgent)
20643
+ },
19636
20644
  update: bind(transport, agentsUpdate),
19637
20645
  versions: {
19638
20646
  list: bind(transport, agentsVersionsList)
@@ -19650,6 +20658,12 @@ function createAgent(transport) {
19650
20658
  list: bind(transport, computersFilesList),
19651
20659
  retrieveContent: bind(transport, computersFilesContent)
19652
20660
  },
20661
+ leases: {
20662
+ delete: bind(transport, releaseComputerLease),
20663
+ renew: {
20664
+ create: bind(transport, renewComputerLease)
20665
+ }
20666
+ },
19653
20667
  list: bind(transport, computersList),
19654
20668
  retrieve: bind(transport, computersRetrieve),
19655
20669
  update: bind(transport, computersUpdate)
@@ -19672,8 +20686,21 @@ function createAgent(transport) {
19672
20686
  },
19673
20687
  update: bind(transport, deploymentsUpdate)
19674
20688
  },
20689
+ embed: {
20690
+ exchange: {
20691
+ create: bind(transport, exchangeEmbedCode)
20692
+ },
20693
+ retrieveAppearance: bind(transport, getEmbedAppearance)
20694
+ },
19675
20695
  embedTokens: {
19676
- create: bind(transport, createEmbedToken)
20696
+ anonymous: {
20697
+ create: bind(transport, createAnonymousEmbedToken)
20698
+ },
20699
+ create: bind(transport, createEmbedToken),
20700
+ list: bind(transport, listEmbedTokens),
20701
+ revoke: {
20702
+ create: bind(transport, revokeEmbedToken)
20703
+ }
19677
20704
  },
19678
20705
  environments: {
19679
20706
  archive: bind(transport, environmentsArchive),
@@ -19694,6 +20721,7 @@ function createAgent(transport) {
19694
20721
  list: bind(transport, listSessionCompactions)
19695
20722
  },
19696
20723
  create: bind(transport, sessionsCreate),
20724
+ delete: bind(transport, sessionsDelete),
19697
20725
  events: {
19698
20726
  list: bind(transport, sessionsEventsList),
19699
20727
  send: bind(transport, sessionsEventsSend),
@@ -19710,6 +20738,12 @@ function createAgent(transport) {
19710
20738
  retrieve: bind(transport, sessionsRetrieve),
19711
20739
  retrieveCompact: bind(transport, getSessionCompaction),
19712
20740
  retrieveContext: bind(transport, getSessionContext),
20741
+ runs: {
20742
+ deleteFeedback: bind(transport, deleteRunFeedback),
20743
+ feedback: {
20744
+ create: bind(transport, setRunFeedback)
20745
+ }
20746
+ },
19713
20747
  threads: {
19714
20748
  archive: bind(transport, aliasOperation(sessionsThreadsArchive, { query: { session_id: "query_session_id" } })),
19715
20749
  events: {
@@ -19769,6 +20803,9 @@ function createApplication(transport) {
19769
20803
  },
19770
20804
  update: bind(transport, applicationUpdateWorker),
19771
20805
  versions: {
20806
+ assets: {
20807
+ retrieveManifest: bind(transport, applicationGetVersionAssetManifest)
20808
+ },
19772
20809
  create: bind(transport, applicationCreateVersion),
19773
20810
  list: bindPage(transport, applicationListVersions),
19774
20811
  retrieve: bind(transport, applicationGetVersion)
@@ -20184,7 +21221,16 @@ function createOrganization(transport) {
20184
21221
  retrieve: bind(transport, getOrganizationEvent)
20185
21222
  },
20186
21223
  feedback: {
20187
- create: bind(transport, createOrganizationFeedback)
21224
+ counts: {
21225
+ list: bind(transport, getOrganizationFeedbackCounts)
21226
+ },
21227
+ create: bind(transport, createOrganizationFeedback),
21228
+ list: bind(transport, listOrganizationFeedback),
21229
+ messages: {
21230
+ create: bind(transport, createOrganizationFeedbackMessage),
21231
+ list: bind(transport, listOrganizationFeedbackMessages)
21232
+ },
21233
+ retrieve: bind(transport, getOrganizationFeedback)
20188
21234
  },
20189
21235
  usage: {
20190
21236
  list: bind(transport, listOrganizationUsage)
@@ -20676,9 +21722,13 @@ class Transport {
20676
21722
  };
20677
21723
  }
20678
21724
  async request(operation, options = {}) {
21725
+ return (await this.requestWithResponse(operation, options)).data;
21726
+ }
21727
+ async requestWithResponse(operation, options = {}) {
20679
21728
  const scope = this.scope(options, false);
20680
21729
  try {
20681
- return (await abortable(operation(scope.options), scope.signal)).data;
21730
+ const result = await abortable(operation(scope.options), scope.signal);
21731
+ return { data: result.data, response: result.response };
20682
21732
  } finally {
20683
21733
  scope.close();
20684
21734
  }
@@ -20710,6 +21760,10 @@ function base64(bytes) {
20710
21760
  return btoa(chunks.join(""));
20711
21761
  }
20712
21762
  async function publish(client2, input) {
21763
+ const rolloutFields = ["gradual", "gradualRollout", "gradual_rollout", "canary", "rollout", "percentage", "percent", "traffic", "traffic_percentage", "strategy", "versions"];
21764
+ if (Object.keys(input).some((key) => rolloutFields.includes(key) || /percentage|percent|canary|gradual|rollout|灰度/i.test(key))) {
21765
+ 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.' });
21766
+ }
20713
21767
  const timeout = input.timeout_ms ?? 120000;
20714
21768
  if (!Number.isFinite(timeout) || timeout < 0)
20715
21769
  throw new RangeError("timeout_ms must be non-negative and finite");
@@ -20728,7 +21782,7 @@ async function publish(client2, input) {
20728
21782
  const files = Object.entries(input.files);
20729
21783
  if (files.length > 1e5)
20730
21784
  throw new PraxisError({ code: "LIMIT_EXCEEDED", message: "At most 100000 asset paths can be published" });
20731
- const manifest = {};
21785
+ let manifest = {};
20732
21786
  const contents = new Map;
20733
21787
  for (const [path2, content] of files) {
20734
21788
  const normalized = path2.startsWith("/") ? path2 : `/${path2}`;
@@ -20737,8 +21791,8 @@ async function publish(client2, input) {
20737
21791
  const bytes = typeof content === "string" ? new TextEncoder().encode(content) : new Uint8Array(content);
20738
21792
  if (bytes.length > FILE_BYTES)
20739
21793
  throw new PraxisError({ code: "LIMIT_EXCEEDED", message: `Asset ${normalized} exceeds 25 MiB` });
20740
- const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", bytes));
20741
- const hash = Array.from(digest.subarray(0, 16), (byte) => byte.toString(16).padStart(2, "0")).join("");
21794
+ const digest2 = new Uint8Array(await crypto.subtle.digest("SHA-256", bytes));
21795
+ const hash = Array.from(digest2.subarray(0, 16), (byte) => byte.toString(16).padStart(2, "0")).join("");
20742
21796
  manifest[normalized] = { hash, size: bytes.length };
20743
21797
  contents.set(hash, bytes);
20744
21798
  }
@@ -20751,9 +21805,60 @@ async function publish(client2, input) {
20751
21805
  }
20752
21806
  }
20753
21807
  const created = !worker;
21808
+ if (!worker && input.dryRun)
21809
+ throw new PraxisError({ code: "NOT_FOUND", message: "请先创建应用 (create the application before dryRun)" });
20754
21810
  worker ??= await workers.create({ body: { name: input.name, subdomain: { enabled: true } } });
20755
21811
  const path = { worker_id: worker.id };
21812
+ let currentVersion;
21813
+ let currentDeployment;
21814
+ let previous = {};
21815
+ if (worker.praxis?.current_deployment_id) {
21816
+ currentDeployment = await workers.deployments.retrieve({ path: { ...path, deployment_id: worker.praxis.current_deployment_id } });
21817
+ const active = currentDeployment.versions[0];
21818
+ if (!active)
21819
+ throw new PraxisError({ code: "INVALID_RESPONSE", message: "Current deployment has no version" });
21820
+ currentVersion = await workers.versions.retrieve({ path: { ...path, version_id: active.version_id } });
21821
+ previous = (await workers.versions.assets.retrieveManifest({ path: { ...path, version_id: active.version_id } })).manifest;
21822
+ }
21823
+ manifest = {
21824
+ ...Object.fromEntries(Object.entries(previous).filter(([key]) => input.keepExisting || Object.hasOwn(manifest, key))),
21825
+ ...manifest
21826
+ };
21827
+ if (Object.keys(manifest).length > 1e5)
21828
+ throw new PraxisError({ code: "LIMIT_EXCEEDED", message: "At most 100000 asset paths can be published" });
21829
+ const added = Object.keys(manifest).filter((key) => !Object.hasOwn(previous, key));
21830
+ const changed = Object.keys(manifest).filter((key) => previous[key] && (previous[key].hash !== manifest[key].hash || previous[key].size !== manifest[key].size));
21831
+ const removed = Object.keys(previous).filter((key) => !Object.hasOwn(manifest, key));
21832
+ const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(manifest))));
21833
+ const manifestHash = Array.from(digest, (byte) => byte.toString(16).padStart(2, "0")).join("");
21834
+ const staticOnly = !["main", "bindings", "compatibility_date", "compatibility_flags", "assets_config"].some((key) => Object.hasOwn(input, key));
21835
+ const unchanged = staticOnly && !!currentVersion && manifestHash === currentVersion.praxis.assets_manifest?.manifest_hash;
21836
+ const hashes = new Set(Object.values(manifest).map((entry) => entry.hash));
21837
+ const currentResult = {
21838
+ url: worker.subdomain.url,
21839
+ worker_id: worker.id,
21840
+ version_id: currentVersion?.id ?? null,
21841
+ deployment_id: currentDeployment?.id ?? null,
21842
+ status: currentDeployment?.praxis.status ?? "draft",
21843
+ created,
21844
+ ...currentVersion ? { version: currentVersion } : {},
21845
+ unchanged,
21846
+ uploaded: 0,
21847
+ reused: hashes.size
21848
+ };
21849
+ if (unchanged && !input.dryRun)
21850
+ return currentResult;
20756
21851
  const session = await workers.assetsUploadSession.create({ path, body: { manifest } });
21852
+ if (input.dryRun) {
21853
+ const missing = new Set(session.buckets.flat());
21854
+ if ([...missing].some((hash) => !hashes.has(hash)))
21855
+ throw new PraxisError({ code: "INVALID_RESPONSE", message: "Upload session requested an unknown hash" });
21856
+ return {
21857
+ ...currentResult,
21858
+ reused: hashes.size - missing.size,
21859
+ plan: { added, changed, removed, upload_hashes: missing.size, existing_hashes: hashes.size - missing.size }
21860
+ };
21861
+ }
20757
21862
  let jwt = session.buckets.length ? null : session.jwt;
20758
21863
  const uploaded = new Set;
20759
21864
  for (const bucket of session.buckets) {
@@ -20824,16 +21929,29 @@ async function publish(client2, input) {
20824
21929
  status: deployment.praxis.status,
20825
21930
  created,
20826
21931
  uploaded: uploaded.size,
20827
- reused: contents.size - uploaded.size
21932
+ reused: hashes.size - uploaded.size
20828
21933
  };
20829
21934
  }
20830
21935
 
21936
+ // ../../packages/sdk/typescript/src/helpers/database-count.ts
21937
+ async function count(transport, input) {
21938
+ const { response } = await transport.requestWithResponse(databaseHead, {
21939
+ path: { database_id: input.database_id, table: input.table },
21940
+ query: input.filters,
21941
+ headers: { Prefer: `count=${input.count ?? "exact"}` }
21942
+ });
21943
+ const total = response.headers.get("Content-Range")?.split("/")[1];
21944
+ return { count: total === undefined || total === "*" ? null : Number(total) };
21945
+ }
21946
+
20831
21947
  // ../../packages/sdk/typescript/src/core/client.ts
20832
21948
  class Praxis {
20833
21949
  constructor(options) {
20834
21950
  const transport = new Transport(options);
20835
21951
  for (const [name, create] of Object.entries(resourceFactories)) {
20836
21952
  const resource = create(transport);
21953
+ if (name === "database")
21954
+ Object.assign(resource, { count: (input) => count(transport, input) });
20837
21955
  if (name === "application")
20838
21956
  Object.assign(resource, { publish: (input) => publish(this, input) });
20839
21957
  Object.defineProperty(this, name, { value: resource, enumerable: true });
@@ -21965,7 +23083,7 @@ function plain(value) {
21965
23083
  }
21966
23084
 
21967
23085
  // src/output/human.ts
21968
- var count = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
23086
+ var count3 = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
21969
23087
  function identity(result, ctx) {
21970
23088
  const op = "op" in result ? result.op : undefined;
21971
23089
  const split = op?.lastIndexOf(".") ?? -1;
@@ -22053,7 +23171,7 @@ function objectView(data, resource, id, ctx, paint) {
22053
23171
  return v.map(scalar).map(plain).join(", ");
22054
23172
  folded = true;
22055
23173
  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 `${count(v.length, "item")}${preview.length ? ` (${preview.join(", ")})` : ""}`;
23174
+ return `${count3(v.length, "item")}${preview.length ? ` (${preview.join(", ")})` : ""}`;
22057
23175
  }
22058
23176
  if (v !== null && typeof v === "object") {
22059
23177
  if (depth >= 1) {
@@ -22094,7 +23212,7 @@ function renderHuman(result, ctx) {
22094
23212
  return {
22095
23213
  stdout: result.items.length ? table(result.items, ctx, out) : out.dim(`No ${plain(resource)}${/(s|x|ch|sh)$/.test(resource) ? "es" : "s"}.`) + `
22096
23214
  `,
22097
- stderr: err.dim(`${result.total !== undefined ? `${result.items.length} of ${result.total} items` : count(result.items.length, "item")}${result.nextCursor ? ` · next: ${ctx.nextCommand ?? "praxis --help"}` : ""}`) + `
23215
+ 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
23216
  `
22099
23217
  };
22100
23218
  case "object": {
@@ -22374,7 +23492,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
22374
23492
  }
22375
23493
 
22376
23494
  // src/main.ts
22377
- var version = "0.1.0-dev.98b03cc";
23495
+ var version = "0.1.0-dev.a5cf3ce";
22378
23496
  var commands = commandTree(operations);
22379
23497
  var manual = [["login"], ["logout"], ["whoami"], ["org", "list"], ["org", "switch"], ["api"], ["skill"]];
22380
23498
  function route(argv) {