@deepraxis/cli 0.3.0-dev.08152d4 → 0.3.0-dev.12045a7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMMANDS.md +12 -2
- package/dist/praxis.js +801 -35
- package/package.json +1 -1
package/COMMANDS.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Generated by `bun run commands`. DO NOT EDIT.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
698 HTTP operations; 700 commands including aliases.
|
|
6
6
|
|
|
7
7
|
Environment: `PRAXIS_ENV=develop|production` (dev package defaults to `develop`; stable package defaults to `production`). No `--env` option.
|
|
8
8
|
|
|
@@ -332,6 +332,7 @@ Handwritten commands: `login`, `logout`, `whoami`, `org list`, `org switch <orga
|
|
|
332
332
|
| `praxis api devops change get <id>` | `devops.changes.retrieve` | GET `/devops/v1/changes/{id}` | |
|
|
333
333
|
| `praxis api devops change mark-last-slice <id>` | `devops.changes.markLastSlice` | POST `/devops/v1/changes/{id}:markLastSlice` | `--last-slice` |
|
|
334
334
|
| `praxis api devops environment checkpoint list` | `devops.environments.checkpoints.list` | GET `/devops/v1/environments/{id}/checkpoints` | `--environment` |
|
|
335
|
+
| `praxis api devops environment update <id>` | `devops.environments.update` | PATCH `/devops/v1/environments/{id}` | `--update-mask` |
|
|
335
336
|
| `praxis api devops flag archive <id>` | `devops.flags.archive` | POST `/devops/v1/flags/{id}:archive` | |
|
|
336
337
|
| `praxis api devops flag conclude <id>` | `devops.flags.conclude` | POST `/devops/v1/flags/{id}:conclude` | `--action`, `--observe-until`, `--reason` |
|
|
337
338
|
| `praxis api devops flag environment update <environment>` | `devops.flags.environments.update` | PATCH `/devops/v1/flags/{id}/environments/{environment}` | `--flag`, `--param-version`, `--comment` |
|
|
@@ -367,6 +368,7 @@ Handwritten commands: `login`, `logout`, `whoami`, `org list`, `org switch <orga
|
|
|
367
368
|
| `praxis api devops project test-run create` | `devops.projects.testRuns.create` | POST `/devops/v1/projects/{project}/test-runs` | `--project`, `--plan`, `--environment`, `--repeat`, `--wait-until`, `--executor`, `--request-id` |
|
|
368
369
|
| `praxis api devops project test-run list` | `devops.projects.testRuns.list` | GET `/devops/v1/projects/{project}/test-runs` | `--project`, `--page-size`, `--page-token`, `--filter`, `--order-by` |
|
|
369
370
|
| `praxis api devops project test-suite list` | `devops.projects.testSuites.list` | GET `/devops/v1/projects/{project}/test-suites` | `--project`, `--page-size`, `--page-token`, `--order-by` |
|
|
371
|
+
| `praxis api devops project update <id>` | `devops.projects.update` | PATCH `/devops/v1/projects/{id}` | `--update-mask` |
|
|
370
372
|
| `praxis api devops promotion approve <id>` | `devops.promotions.approve` | POST `/devops/v1/promotions/{id}:approve` | `--approved`, `--comment` |
|
|
371
373
|
| `praxis api devops promotion cancel <id>` | `devops.promotions.cancel` | POST `/devops/v1/promotions/{id}:cancel` | `--reason` |
|
|
372
374
|
| `praxis api devops promotion conclude <id>` | `devops.promotions.conclude` | POST `/devops/v1/promotions/{id}:conclude` | `--action`, `--reason` |
|
|
@@ -448,7 +450,7 @@ Handwritten commands: `login`, `logout`, `whoami`, `org list`, `org switch <orga
|
|
|
448
450
|
| `praxis api media library get-default` | `media.libraries.retrieveDefault` | GET `/media/v1/libraries/default` | |
|
|
449
451
|
| `praxis api media library job cancel <job_id>` | `media.libraries.jobs.cancel` | POST `/media/v1/libraries/{library_id}/jobs/{job_id}/cancel` | `--library` |
|
|
450
452
|
| `praxis api media library job get <job_id>` | `media.libraries.jobs.retrieve` | GET `/media/v1/libraries/{library_id}/jobs/{job_id}` | `--library` |
|
|
451
|
-
| `praxis api media library job list` | `media.libraries.jobs.list` | GET `/media/v1/libraries/{library_id}/jobs` | `--library`, `--status`, `--param-limit`, `--param-cursor` |
|
|
453
|
+
| `praxis api media library job list` | `media.libraries.jobs.list` | GET `/media/v1/libraries/{library_id}/jobs` | `--library`, `--status`, `--pipeline-run-id`, `--param-limit`, `--param-cursor` |
|
|
452
454
|
| `praxis api media library list` | `media.libraries.list` | GET `/media/v1/libraries` | `--param-cursor`, `--param-limit`, `--labels`, `--status` |
|
|
453
455
|
| `praxis api media library purge <library_id>` | `media.libraries.purge.create` | POST `/media/v1/libraries/{library_id}/purge` | |
|
|
454
456
|
| `praxis api media library restore <library_id>` | `media.libraries.restore` | POST `/media/v1/libraries/{library_id}/restore` | |
|
|
@@ -551,6 +553,8 @@ Handwritten commands: `login`, `logout`, `whoami`, `org list`, `org switch <orga
|
|
|
551
553
|
| `praxis api sandbox snapshot create` | `sandbox.sandboxes.snapshots.create` | POST `/sandbox/v1/sandboxes/{sandboxID}/snapshots` | `--sandbox`, `--name` |
|
|
552
554
|
| `praxis api sandbox snapshot delete <snapshotID>` | `sandbox.snapshots.delete` | DELETE `/sandbox/v1/snapshots/{snapshotID}` | |
|
|
553
555
|
| `praxis api sandbox snapshot list` | `sandbox.snapshots.list` | GET `/sandbox/v1/snapshots` | `--sandbox-id`, `--name`, `--param-limit`, `--next-token` |
|
|
556
|
+
| `praxis api sandbox task create` | `sandbox.sandboxes.tasks.create` | POST `/sandbox/v1/sandboxes/{sandboxID}/tasks` | `--sandbox`, `--command`, `--cwd`, `--max-lifetime-secs` |
|
|
557
|
+
| `praxis api sandbox task get-log <taskID>` | `sandbox.sandboxes.tasks.retrieveLog` | GET `/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log` | `--sandbox`, `--name`, `--offset`, `--param-limit` |
|
|
554
558
|
| `praxis api sandbox template alias get <alias>` | `sandbox.templates.aliases.retrieve` | GET `/sandbox/v1/templates/aliases/{alias}` | |
|
|
555
559
|
| `praxis api sandbox template build status list` | `sandbox.templates.builds.status.list` | GET `/sandbox/v1/templates/{templateID}/builds/{buildID}/status` | `--template`, `--build`, `--logs-offset`, `--param-limit`, `--level` |
|
|
556
560
|
| `praxis api sandbox template build update <buildID>` | `sandbox.templates.builds.update` | POST `/sandbox/v1/templates/{templateID}/builds/{buildID}` | `--template`, `--from-image`, `--from-template`, `--force`, `--start-cmd`, `--ready-cmd`, `--dockerfile` |
|
|
@@ -603,6 +607,9 @@ Handwritten commands: `login`, `logout`, `whoami`, `org list`, `org switch <orga
|
|
|
603
607
|
| `praxis api studio theme update <theme>` | `studio.themes.update` | PATCH `/studio/v1/themes/{theme}` | `--update-mask`, `--name`, `--html`, `--css`, `--reference-docx`, `--header`, `--footer` |
|
|
604
608
|
| `praxis api studio work create` | `studio.works.create` | POST `/studio/v1/works` | `--title`, `--slug`, `--codexes`, `--style`, `--cover`, `--based-on`, `--request-id` |
|
|
605
609
|
| `praxis api studio work draft create` | `studio.works.drafts.create` | POST `/studio/v1/works/{work}/drafts` | `--work`, `--genre`, `--key`, `--title`, `--mode`, `--template`, `--request-id` |
|
|
610
|
+
| `praxis api studio work draft foreshadow delete <key>` | `studio.works.drafts.foreshadows.delete` | DELETE `/studio/v1/works/{work}/drafts/{draft}/foreshadows/{key}` | `--work`, `--draft` |
|
|
611
|
+
| `praxis api studio work draft foreshadow list` | `studio.works.drafts.foreshadows.list` | GET `/studio/v1/works/{work}/drafts/{draft}/foreshadows` | `--work`, `--draft` |
|
|
612
|
+
| `praxis api studio work draft foreshadow update <key>` | `studio.works.drafts.foreshadows.update` | PUT `/studio/v1/works/{work}/drafts/{draft}/foreshadows/{key}` | `--work`, `--draft`, `--setup`, `--payoff`, `--note` |
|
|
606
613
|
| `praxis api studio work draft get <draft>` | `studio.works.drafts.retrieve` | GET `/studio/v1/works/{work}/drafts/{draft}` | `--work`, `--expand` |
|
|
607
614
|
| `praxis api studio work draft get-export <draft>` | `studio.works.drafts.retrieveExport` | GET `/studio/v1/works/{work}/drafts/{draft}/export` | `--work`, `--param-format` |
|
|
608
615
|
| `praxis api studio work draft get-outline <draft>` | `studio.works.drafts.retrieveOutline` | GET `/studio/v1/works/{work}/drafts/{draft}/outline` | `--work` |
|
|
@@ -618,6 +625,9 @@ Handwritten commands: `login`, `logout`, `whoami`, `org list`, `org switch <orga
|
|
|
618
625
|
| `praxis api studio work draft update-brief <draft>` | `studio.works.drafts.updateBrief` | PATCH `/studio/v1/works/{work}/drafts/{draft}/brief` | `--work`, `--expected-revision`, `--text`, `--constraints`, `--attachments`, `--remove-points` |
|
|
619
626
|
| `praxis api studio work get <work>` | `studio.works.retrieve` | GET `/studio/v1/works/{work}` | `--draft`, `--unit`, `--expand` |
|
|
620
627
|
| `praxis api studio work list` | `studio.works.list` | GET `/studio/v1/works` | `--page-size`, `--page-token`, `--archived` |
|
|
628
|
+
| `praxis api studio work progression create` | `studio.works.progressions.create` | POST `/studio/v1/works/{work}/progressions` | `--work`, `--entry`, `--unit`, `--change` |
|
|
629
|
+
| `praxis api studio work progression delete <id>` | `studio.works.progressions.delete` | DELETE `/studio/v1/works/{work}/progressions/{id}` | `--work` |
|
|
630
|
+
| `praxis api studio work progression list` | `studio.works.progressions.list` | GET `/studio/v1/works/{work}/progressions` | `--work`, `--entry` |
|
|
621
631
|
| `praxis api studio work rendition delete <rendition>` | `studio.works.renditions.delete` | DELETE `/studio/v1/works/{work}/renditions/{rendition}` | `--work` |
|
|
622
632
|
| `praxis api studio work rendition get <rendition>` | `studio.works.renditions.retrieve` | GET `/studio/v1/works/{work}/renditions/{rendition}` | `--work` |
|
|
623
633
|
| `praxis api studio work rendition get-content <rendition>` | `studio.works.renditions.retrieveContent` | GET `/studio/v1/works/{work}/renditions/{rendition}/content` | `--work`, `--part` |
|
package/dist/praxis.js
CHANGED
|
@@ -14059,7 +14059,7 @@ across all toolsets allowed.`
|
|
|
14059
14059
|
name: "image_model",
|
|
14060
14060
|
type: "string",
|
|
14061
14061
|
required: false,
|
|
14062
|
-
description: "
|
|
14062
|
+
description: "Retired (the imagine tool no longer exists): accepted and ignored, never stored. Image generation goes through the media library and the manage-media skill. /agent/v1 only."
|
|
14063
14063
|
},
|
|
14064
14064
|
{
|
|
14065
14065
|
name: "subagents",
|
|
@@ -14286,7 +14286,7 @@ toolsets allowed.`
|
|
|
14286
14286
|
name: "image_model",
|
|
14287
14287
|
type: "string",
|
|
14288
14288
|
required: false,
|
|
14289
|
-
description: "
|
|
14289
|
+
description: "Retired (the imagine tool no longer exists): accepted and ignored, never stored. Image generation goes through the media library and the manage-media skill. /agent/v1 only."
|
|
14290
14290
|
},
|
|
14291
14291
|
{
|
|
14292
14292
|
name: "subagents",
|
|
@@ -25756,6 +25756,42 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
25756
25756
|
]
|
|
25757
25757
|
}
|
|
25758
25758
|
},
|
|
25759
|
+
{
|
|
25760
|
+
resource: "devops.environments",
|
|
25761
|
+
method: "update",
|
|
25762
|
+
summary: "Update an environment",
|
|
25763
|
+
description: "Change an environment's name, position, approval requirement, observation time, blocking behaviour or domain suffix. Send the new values inside environment and name the fields to write in updateMask (name, order, requireApproval, observeMinutes, blocksLater, domainSuffix); a field not named is left alone. requireApproval true makes every later promotion into this environment stop in awaiting_approval until promotions.approve lets it proceed; promotions already running are not stopped. order moves the environment within the promotion sequence and renumbers its neighbours, and a value that would break the 1..n sequence is refused with ENVIRONMENT_ORDER_INVALID. Read the environment list first to know what you are leaving unchanged.",
|
|
25764
|
+
http: "PATCH",
|
|
25765
|
+
path: "/devops/v1/environments/{id}",
|
|
25766
|
+
streaming: "no",
|
|
25767
|
+
pagination: false,
|
|
25768
|
+
pathParams: [
|
|
25769
|
+
{
|
|
25770
|
+
name: "id",
|
|
25771
|
+
sdkName: "id",
|
|
25772
|
+
description: "The environment identifier from a project's environment list; the tier or the display name is not an address."
|
|
25773
|
+
}
|
|
25774
|
+
],
|
|
25775
|
+
query: [],
|
|
25776
|
+
body: {
|
|
25777
|
+
required: true,
|
|
25778
|
+
fields: [
|
|
25779
|
+
{
|
|
25780
|
+
name: "environment",
|
|
25781
|
+
type: "object",
|
|
25782
|
+
required: true,
|
|
25783
|
+
description: "The new values for the environment fields to change."
|
|
25784
|
+
},
|
|
25785
|
+
{
|
|
25786
|
+
name: "updateMask",
|
|
25787
|
+
type: "array",
|
|
25788
|
+
itemType: "string",
|
|
25789
|
+
required: false,
|
|
25790
|
+
description: "Which environment fields to write, by name: name, order, requireApproval, observeMinutes, blocksLater, domainSuffix. Omit it to write every field the environment object carries."
|
|
25791
|
+
}
|
|
25792
|
+
]
|
|
25793
|
+
}
|
|
25794
|
+
},
|
|
25759
25795
|
{
|
|
25760
25796
|
resource: "devops.environments.checkpoints",
|
|
25761
25797
|
method: "list",
|
|
@@ -26129,6 +26165,42 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
26129
26165
|
],
|
|
26130
26166
|
query: []
|
|
26131
26167
|
},
|
|
26168
|
+
{
|
|
26169
|
+
resource: "devops.projects",
|
|
26170
|
+
method: "update",
|
|
26171
|
+
summary: "Update a project",
|
|
26172
|
+
description: "Change a project's name, description, labels or delivery settings. Send the new values inside project and name the fields to write in updateMask (name, description, labels, settings); a field not named is left alone, and a mask naming a field this operation cannot change is refused. settings is merged into the current settings rather than replacing them, so a body naming one setting leaves the others as they were. settings.executor decides who publishes the project: absent or mise reads as the Mise pipeline, and devops means that, once the merge is done, the DevOps pipeline releases it. Changing executor changes which pipeline the next release uses, not what already ran. A new name must be kebab-case and unused in the organization, otherwise PROJECT_NAME_TAKEN. Read the project first to know what you are leaving unchanged.",
|
|
26173
|
+
http: "PATCH",
|
|
26174
|
+
path: "/devops/v1/projects/{id}",
|
|
26175
|
+
streaming: "no",
|
|
26176
|
+
pagination: false,
|
|
26177
|
+
pathParams: [
|
|
26178
|
+
{
|
|
26179
|
+
name: "id",
|
|
26180
|
+
sdkName: "id",
|
|
26181
|
+
description: "The project identifier returned by the project list, not the project's display name or its repository name."
|
|
26182
|
+
}
|
|
26183
|
+
],
|
|
26184
|
+
query: [],
|
|
26185
|
+
body: {
|
|
26186
|
+
required: true,
|
|
26187
|
+
fields: [
|
|
26188
|
+
{
|
|
26189
|
+
name: "project",
|
|
26190
|
+
type: "object",
|
|
26191
|
+
required: true,
|
|
26192
|
+
description: "The new values. settings is merged into the current settings, so name only the settings to change."
|
|
26193
|
+
},
|
|
26194
|
+
{
|
|
26195
|
+
name: "updateMask",
|
|
26196
|
+
type: "array",
|
|
26197
|
+
itemType: "string",
|
|
26198
|
+
required: false,
|
|
26199
|
+
description: "Which project fields to write, by name: name, description, labels, settings. Omit it to write every field the project object carries."
|
|
26200
|
+
}
|
|
26201
|
+
]
|
|
26202
|
+
}
|
|
26203
|
+
},
|
|
26132
26204
|
{
|
|
26133
26205
|
resource: "devops.projects.changes",
|
|
26134
26206
|
method: "list",
|
|
@@ -28114,7 +28186,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
28114
28186
|
resource: "file.uploads",
|
|
28115
28187
|
method: "createSigned",
|
|
28116
28188
|
summary: "Create a one-time upload URL",
|
|
28117
|
-
description: "Upload a local file of up to 20 GiB from a coding agent without sending bytes through the model. Provide basename, exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes) and PUT each chunk to its numbered parts[].url in any order; an interrupted client GETs status_url to see the received parts and resends only what is missing, then POSTs complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid, wrong-action or cross-organization URLs return 404. URL lifetime defaults to 900 seconds for single PUT or 604800 (7 days) for multipart, at most 604800; all multipart URLs, including status_url, share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {\"filename\":\"photo.png\",\"bytes\":2048,\"content_type\":\"image/png\"}.",
|
|
28189
|
+
description: "Upload a local file of up to 20 GiB from a coding agent without sending bytes through the model. Provide filename (the stored basename), exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes) and PUT each chunk to its numbered parts[].url in any order; an interrupted client GETs status_url to see the received parts and resends only what is missing, then POSTs complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid, wrong-action or cross-organization URLs return 404. URL lifetime defaults to 900 seconds for single PUT or 604800 (7 days) for multipart, at most 604800; all multipart URLs, including status_url, share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {\"filename\":\"photo.png\",\"bytes\":2048,\"content_type\":\"image/png\"}.",
|
|
28118
28190
|
http: "POST",
|
|
28119
28191
|
path: "/file/v1/uploads/signed",
|
|
28120
28192
|
streaming: "no",
|
|
@@ -29659,7 +29731,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
29659
29731
|
resource: "media.assets",
|
|
29660
29732
|
method: "edit",
|
|
29661
29733
|
summary: "Edit asset",
|
|
29662
|
-
description: "Edit an existing asset and store the result as a new asset. Use library_id from creation or listing and asset_id from asset creation or listing; library_id also accepts the literal default, which resolves to the organization’s default library before the credential check. The source asset is never overwritten: the new asset hangs under it in the edit chain, records it in derived_from, and reads back with assets.lineage, so earlier steps stay reachable. The body is operation plus the optional model, asset_folder, understanding and idempotency_key; operation.type selects the edit and carries that operation’s own fields. This release performs variations, inpaint, erase, replace_object, recolor, remove_background and replace_background on images; every other type in the operation vocabulary — the video and audio edits — is refused with OPERATION_NOT_SUPPORTED. inpaint takes mask, a PNG File identifier beginning with file- whose transparent area marks the region to replace, plus the prompt describing what belongs there. Aspects beyond the source asset’s material type return REFERENCE_TYPE_MISMATCH. Editing is billed by the model usage it consumes, at the same prices as the model API, and the job
|
|
29734
|
+
description: "Edit an existing asset and store the result as a new asset. Use library_id from creation or listing and asset_id from asset creation or listing; library_id also accepts the literal default, which resolves to the organization’s default library before the credential check. The source asset is never overwritten: the new asset hangs under it in the edit chain, records it in derived_from, and reads back with assets.lineage, so earlier steps stay reachable. The body is operation plus the optional model, asset_folder, understanding and idempotency_key; operation.type selects the edit and carries that operation’s own fields. This release performs variations, inpaint, erase, replace_object, recolor, remove_background and replace_background on images; every other type in the operation vocabulary — the video and audio edits — is refused with OPERATION_NOT_SUPPORTED. inpaint takes mask, a PNG File identifier beginning with file- whose transparent area marks the region to replace, plus the prompt describing what belongs there. Aspects beyond the source asset’s material type return REFERENCE_TYPE_MISMATCH. Editing is billed by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals) and the new asset carries it in provenance.cost; when the job is done, tell the person the usage amount and give them the output’s viewer_url. The response is 202 with a queued Job whose type is image, whose operation is the edit applied, and whose source_asset_id is the asset edited; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until it is completed or failed, then read the produced asset. Example: POST /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/edits with {\"operation\":{\"type\":\"variations\",\"strength\":\"subtle\"}}.",
|
|
29663
29735
|
http: "POST",
|
|
29664
29736
|
path: "/media/v1/libraries/{library_id}/assets/{asset_id}/edits",
|
|
29665
29737
|
streaming: "no",
|
|
@@ -29927,7 +29999,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
29927
29999
|
resource: "media.speech",
|
|
29928
30000
|
method: "create",
|
|
29929
30001
|
summary: "Create speech",
|
|
29930
|
-
description: "Synthesise speech from text and store the recording straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still synthesise. input is the text to speak. voice is optional and may be omitted, in which case the model’s default voice is used; when it is given it must be one of the voices of the model being used — read them from the types.speech list of GET /media/v1/generation/capabilities, which gives each voice an id, a name, a gender, a language and a style, or pass a voice material id of this same library — and a voice that is neither is refused with INVALID_PARAMS in the voice field before any job exists, so a wrong name is free to try but reading the capabilities first is free without trying. Do not use OpenAI voice names such as alloy or aura: they are not valid here. speed is passed to the provider unchanged, and instructions and language are refused with OPERATION_NOT_SUPPORTED in this release. Cloning a voice from recordings is not available yet. The provider caps one request at a short stretch of text, so a long input is cut into segments at paragraph and sentence boundaries and synthesised in order, then joined into the single recording the library receives: nothing is spoken twice and nothing is dropped. Because the segments are joined byte for byte, a multi-segment input accepts only response_format mp3 (the default) or pcm; opus is available for a single-segment input. A speech job has one result however many segments it took. Synthesis is billed by the model usage it consumes, at the same prices as the model API, and the job
|
|
30002
|
+
description: "Synthesise speech from text and store the recording straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still synthesise. input is the text to speak. voice is optional and may be omitted, in which case the model’s default voice is used; when it is given it must be one of the voices of the model being used — read them from the types.speech list of GET /media/v1/generation/capabilities, which gives each voice an id, a name, a gender, a language and a style, or pass a voice material id of this same library — and a voice that is neither is refused with INVALID_PARAMS in the voice field before any job exists, so a wrong name is free to try but reading the capabilities first is free without trying. Do not use OpenAI voice names such as alloy or aura: they are not valid here. speed is passed to the provider unchanged, and instructions and language are refused with OPERATION_NOT_SUPPORTED in this release. Cloning a voice from recordings is not available yet. The provider caps one request at a short stretch of text, so a long input is cut into segments at paragraph and sentence boundaries and synthesised in order, then joined into the single recording the library receives: nothing is spoken twice and nothing is dropped. Because the segments are joined byte for byte, a multi-segment input accepts only response_format mp3 (the default) or pcm; opus is available for a single-segment input. A speech job has one result however many segments it took. Synthesis is billed by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals, the sum over every segment) and the recording carries it in provenance.cost; a request refused before it starts costs nothing. When the job is done, tell the person the usage amount and give them the output’s viewer_url. The response is 202 with a queued Job whose type is speech and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced asset from the library — the recording carries material_type audio, audio_role voice, ai_generated true, and provenance naming this job, the text spoken and the model. Send Idempotency-Key, or idempotency_key in the body, to retry without synthesising and charging twice. Example: POST /media/v1/libraries/default/audio/speech with {\"input\":\"A red kite above a calm sea at sunrise.\"}, or with {\"input\":\"A red kite above a calm sea at sunrise.\",\"voice\":\"zh_female_wenroumama_uranus_bigtts\"} for a gentle female voice.",
|
|
29931
30003
|
http: "POST",
|
|
29932
30004
|
path: "/media/v1/libraries/{library_id}/audio/speech",
|
|
29933
30005
|
streaming: "no",
|
|
@@ -30159,7 +30231,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
30159
30231
|
resource: "media.images",
|
|
30160
30232
|
method: "generate",
|
|
30161
30233
|
summary: "Generate image",
|
|
30162
|
-
description: "Generate one or more images from a text prompt and store them straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still generate. The request body is the image request itself: prompt is required, and n, size, background, output_format, output, references, seed, model, asset_folder and understanding are optional. Set output to sticker for a cut-out with a transparent background. references attach existing assets with a role — edit_target, style, structure or subject — and a model that cannot honour a role returns REFERENCE_TYPE_MISMATCH. Aspect ratio is not accepted for images; name size instead. Generation is billed by the model usage it consumes, at the same prices as the model API, and the job
|
|
30234
|
+
description: "Generate one or more images from a text prompt and store them straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still generate. The request body is the image request itself: prompt is required, and n, size, background, output_format, output, references, seed, model, asset_folder and understanding are optional. Set output to sticker for a cut-out with a transparent background. references attach existing assets with a role — edit_target, style, structure or subject — and a model that cannot honour a role returns REFERENCE_TYPE_MISMATCH. Aspect ratio is not accepted for images; name size instead. Generation is billed by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals, final once the job is completed or failed) and each produced asset carries its own part in provenance.cost; nothing is charged for a request refused before it starts. When the job is done, tell the person the usage amount and give them each output’s viewer_url, which opens the asset in the Console. The response is 202 with a queued Job whose type is image and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced assets from the library. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice. Example: POST /media/v1/libraries/default/images/generations with {\"prompt\":\"A red kite above a calm sea at sunrise\",\"n\":1,\"output\":\"sticker\"}.",
|
|
30163
30235
|
http: "POST",
|
|
30164
30236
|
path: "/media/v1/libraries/{library_id}/images/generations",
|
|
30165
30237
|
streaming: "no",
|
|
@@ -30196,8 +30268,13 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
30196
30268
|
{
|
|
30197
30269
|
name: "size",
|
|
30198
30270
|
type: "string",
|
|
30271
|
+
enum: [
|
|
30272
|
+
"1024x1024",
|
|
30273
|
+
"1024x1536",
|
|
30274
|
+
"1536x1024"
|
|
30275
|
+
],
|
|
30199
30276
|
required: false,
|
|
30200
|
-
description: "Requested pixel size written as width x height. The
|
|
30277
|
+
description: "Requested pixel size written as width x height. The platform image models accept 1024x1024 (square, the default), 1024x1536 (portrait) and 1536x1024 (landscape); any other size is rejected with INVALID_PARAMS before anything is charged."
|
|
30201
30278
|
},
|
|
30202
30279
|
{
|
|
30203
30280
|
name: "background",
|
|
@@ -30279,7 +30356,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
30279
30356
|
resource: "media.libraries.jobs",
|
|
30280
30357
|
method: "list",
|
|
30281
30358
|
summary: "List jobs",
|
|
30282
|
-
description: "List batch and generation jobs in a library. Filter by status and continue with next_cursor. Poll a generation Job until terminal; every produced output is already a library asset.",
|
|
30359
|
+
description: "List batch and generation jobs in a library. Filter by status or by pipeline_run_id (the jobs one automation run started) and continue with next_cursor. Poll a generation Job until terminal; every produced output is already a library asset.",
|
|
30283
30360
|
http: "GET",
|
|
30284
30361
|
path: "/media/v1/libraries/{library_id}/jobs",
|
|
30285
30362
|
streaming: "no",
|
|
@@ -30308,6 +30385,12 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
30308
30385
|
required: false,
|
|
30309
30386
|
description: "Filter jobs by their current status."
|
|
30310
30387
|
},
|
|
30388
|
+
{
|
|
30389
|
+
name: "pipeline_run_id",
|
|
30390
|
+
type: "string",
|
|
30391
|
+
required: false,
|
|
30392
|
+
description: "Return only the jobs started by this automation run (its root run), so one pipeline run reads as one batch."
|
|
30393
|
+
},
|
|
30311
30394
|
{
|
|
30312
30395
|
name: "limit",
|
|
30313
30396
|
type: "integer",
|
|
@@ -30730,7 +30813,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
30730
30813
|
resource: "media.videos",
|
|
30731
30814
|
method: "generate",
|
|
30732
30815
|
summary: "Generate video",
|
|
30733
|
-
description: "Generate one or more videos from a text prompt and store them straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still generate. mode says what the video is anchored to: text needs only a prompt, image animates the existing image named by first_frame, and first_last interpolates between first_frame and last_frame. The frames must be image or sticker assets of the same library; a fetchable URL for each is sent to the model and recorded in the produced asset’s provenance. mode reference and output gif are refused with OPERATION_NOT_SUPPORTED in this release, and negative_prompt, references and an unknown mode are refused before anything is charged. Every output lands in the library as a video asset as soon as it is ready — there is no candidate state and nothing expires, so outputs.save is not part of this lane. Generation is billed per second by the model usage it consumes, at the same prices as the model API, and the job
|
|
30816
|
+
description: "Generate one or more videos from a text prompt and store them straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still generate. mode says what the video is anchored to: text needs only a prompt, image animates the existing image named by first_frame, and first_last interpolates between first_frame and last_frame. The frames must be image or sticker assets of the same library; a fetchable URL for each is sent to the model and recorded in the produced asset’s provenance. mode reference and output gif are refused with OPERATION_NOT_SUPPORTED in this release, and negative_prompt, references and an unknown mode are refused before anything is charged. Every output lands in the library as a video asset as soon as it is ready — there is no candidate state and nothing expires, so outputs.save is not part of this lane. Generation is billed per second by the model usage it consumes, at the same prices as the model API, and the job reports the charge in usage (US dollars, six decimals) and each produced asset carries its own part in provenance.cost; a refused request costs nothing. When the job is done, tell the person the usage amount and give them each output’s viewer_url. The response is 202 with a queued Job whose type is video and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced assets from the library. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice. Example: POST /media/v1/libraries/default/videos/generations with {\"prompt\":\"A red kite above a calm sea at sunrise\",\"mode\":\"text\",\"n\":1}.",
|
|
30734
30817
|
http: "POST",
|
|
30735
30818
|
path: "/media/v1/libraries/{library_id}/videos/generations",
|
|
30736
30819
|
streaming: "no",
|
|
@@ -35029,6 +35112,96 @@ for more details.`
|
|
|
35029
35112
|
]
|
|
35030
35113
|
}
|
|
35031
35114
|
},
|
|
35115
|
+
{
|
|
35116
|
+
resource: "sandbox.sandboxes.tasks",
|
|
35117
|
+
method: "create",
|
|
35118
|
+
summary: "Start a task whose output is pushed off the machine while it runs",
|
|
35119
|
+
description: "Run a long command whose output you will read back afterwards, including after the sandbox is deleted, instead of holding one connection open. Use this for builds, test runs and batch jobs; use commands.run for a short command whose output you want inline. The machine's resident daemon pushes the task's stdout/stderr to Praxis storage as it is produced, so the log survives the sandbox (seven days) and can be read in ranges with sandboxes.tasks.log; no vendor exec channel is involved. The command and the shipping credential travel to the daemon in its process environment, never in argv, so neither appears in the machine's process list. Only a full sandbox whose daemon advertises log-ship can run a task; any other machine returns PROVIDER_UNSUPPORTED with the reason. Returns 201 with the task id; starting is not waiting — poll the log to follow the task, and the final marker's exitCode for how it ended.",
|
|
35120
|
+
http: "POST",
|
|
35121
|
+
path: "/sandbox/v1/sandboxes/{sandboxID}/tasks",
|
|
35122
|
+
streaming: "no",
|
|
35123
|
+
pagination: false,
|
|
35124
|
+
pathParams: [
|
|
35125
|
+
{
|
|
35126
|
+
name: "sandboxID",
|
|
35127
|
+
sdkName: "sandboxID",
|
|
35128
|
+
description: "Id of the sandbox, the `sandboxID` returned by the create call (or listed by listSandboxes). Another team's sandbox and an unknown id both answer 404."
|
|
35129
|
+
}
|
|
35130
|
+
],
|
|
35131
|
+
query: [],
|
|
35132
|
+
body: {
|
|
35133
|
+
required: true,
|
|
35134
|
+
fields: [
|
|
35135
|
+
{
|
|
35136
|
+
name: "command",
|
|
35137
|
+
type: "string",
|
|
35138
|
+
required: true,
|
|
35139
|
+
description: "The shell command to run. It is handed to the sandbox's daemon in an environment variable, never in argv, so it stays out of the machine's process list; at most 64 KiB of UTF-8."
|
|
35140
|
+
},
|
|
35141
|
+
{
|
|
35142
|
+
name: "cwd",
|
|
35143
|
+
type: "string",
|
|
35144
|
+
required: false,
|
|
35145
|
+
description: "Absolute working directory inside the sandbox. Omit to run where the daemon starts; a relative path is rejected rather than resolved against a home directory you did not choose."
|
|
35146
|
+
},
|
|
35147
|
+
{
|
|
35148
|
+
name: "maxLifetimeSecs",
|
|
35149
|
+
type: "integer",
|
|
35150
|
+
required: false,
|
|
35151
|
+
description: "How long the task may run, in seconds; omit for 7200, the ceiling is 86400 (a day). The pushing credential lives 30 minutes past this, so the daemon can still deliver a task that ran to its limit."
|
|
35152
|
+
},
|
|
35153
|
+
{
|
|
35154
|
+
name: "files",
|
|
35155
|
+
type: "array",
|
|
35156
|
+
itemType: "object",
|
|
35157
|
+
required: false,
|
|
35158
|
+
description: "Up to eight extra files to ship alongside the task's own output, for example a structured events log the task appends to. Each gets its own stream, read with name on sandboxes.tasks.log."
|
|
35159
|
+
}
|
|
35160
|
+
]
|
|
35161
|
+
}
|
|
35162
|
+
},
|
|
35163
|
+
{
|
|
35164
|
+
resource: "sandbox.sandboxes.tasks",
|
|
35165
|
+
method: "retrieveLog",
|
|
35166
|
+
summary: "Read a range of a task's pushed output",
|
|
35167
|
+
description: "Follow a task started with sandboxes.tasks.start, or read it long after its sandbox is gone. This reads Praxis storage and never the machine, so the answer is the same whether the sandbox is running, paused or deleted; the log is kept for seven days. Read in ranges: pass the previous answer's nextOffset as offset to continue, and stop when done is true. done means the final marker exists and the whole stream has been read, and only then do exitCode and size carry the task's outcome. text is UTF-8 decoded by bytes and backs up to a whole character when a cut would split one, so a page never ends mid-character; size, offset and nextOffset all count bytes. Ownership comes from the sandbox's index row while it exists and from the record written when the task started once it does not, so a sandbox id you own keeps answering after the sandbox is deleted. A task that was never started, or one belonging to another organization, returns NOT_FOUND.",
|
|
35168
|
+
http: "GET",
|
|
35169
|
+
path: "/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log",
|
|
35170
|
+
streaming: "no",
|
|
35171
|
+
pagination: false,
|
|
35172
|
+
pathParams: [
|
|
35173
|
+
{
|
|
35174
|
+
name: "sandboxID",
|
|
35175
|
+
sdkName: "sandboxID",
|
|
35176
|
+
description: "Id of the sandbox, the `sandboxID` returned by the create call (or listed by listSandboxes). Another team's sandbox and an unknown id both answer 404."
|
|
35177
|
+
},
|
|
35178
|
+
{
|
|
35179
|
+
name: "taskID",
|
|
35180
|
+
sdkName: "taskID",
|
|
35181
|
+
description: "Task id returned by sandboxes.tasks.start; a task id is opaque and is not the sandbox id."
|
|
35182
|
+
}
|
|
35183
|
+
],
|
|
35184
|
+
query: [
|
|
35185
|
+
{
|
|
35186
|
+
name: "name",
|
|
35187
|
+
type: "string",
|
|
35188
|
+
required: false,
|
|
35189
|
+
description: "Which stream to read: output is the task's own stdout and stderr and is the default; any other value must be one of the file names passed to sandboxes.tasks.start. 1 to 32 characters of a-z, 0-9 or a hyphen."
|
|
35190
|
+
},
|
|
35191
|
+
{
|
|
35192
|
+
name: "offset",
|
|
35193
|
+
type: "integer",
|
|
35194
|
+
required: false,
|
|
35195
|
+
description: "First byte of the range, counted from the start of the stream. Omit to start at 0; resume with the previous answer's nextOffset."
|
|
35196
|
+
},
|
|
35197
|
+
{
|
|
35198
|
+
name: "limit",
|
|
35199
|
+
type: "integer",
|
|
35200
|
+
required: false,
|
|
35201
|
+
description: "How many bytes to return, at most 4 MiB; omit for 1 MiB. A smaller limit follows a running task with less data per call."
|
|
35202
|
+
}
|
|
35203
|
+
]
|
|
35204
|
+
},
|
|
35032
35205
|
{
|
|
35033
35206
|
resource: "sandbox.sandboxes",
|
|
35034
35207
|
method: "timeout",
|
|
@@ -36715,7 +36888,7 @@ for more details.`
|
|
|
36715
36888
|
name: "time",
|
|
36716
36889
|
type: "string",
|
|
36717
36890
|
required: false,
|
|
36718
|
-
description: "When this entry happens in the story, such as 2037 or
|
|
36891
|
+
description: "When this entry happens in the story, such as 2037, 1931 年 4 月 or 第 3 天; at most 40 characters, and an empty string records no time. The 脉络 timeline orders entries by the first and last number in it, so a time without a digit (民国二十四年冬) sits in 未定时间. It is shown beside the entry and reaches the writer with it."
|
|
36719
36892
|
},
|
|
36720
36893
|
{
|
|
36721
36894
|
name: "tracking",
|
|
@@ -36733,7 +36906,7 @@ for more details.`
|
|
|
36733
36906
|
type: "array",
|
|
36734
36907
|
itemType: "object",
|
|
36735
36908
|
required: false,
|
|
36736
|
-
description: "Entries this one relates to at creation, each naming the target and the label that reads from this entry to it."
|
|
36909
|
+
description: "Entries this one relates to at creation, each naming the target and the label that reads from this entry to it. Between two events the cause holds the relation to its effect (label such as 导致); 参与 marks a participant."
|
|
36737
36910
|
},
|
|
36738
36911
|
{
|
|
36739
36912
|
name: "images",
|
|
@@ -38083,6 +38256,108 @@ for more details.`
|
|
|
38083
38256
|
}
|
|
38084
38257
|
]
|
|
38085
38258
|
},
|
|
38259
|
+
{
|
|
38260
|
+
resource: "studio.works.drafts.foreshadows",
|
|
38261
|
+
method: "list",
|
|
38262
|
+
summary: "List the foreshadows of a draft",
|
|
38263
|
+
description: "List the threads this draft sets up and pays off: each foreshadow names the unit that plants it, the unit that pays it off (or null while it is still open) and a note on what was planted. The foreshadow_paid check reports every open one in the draft's status and review, so a mystery or serial that plants a clue in chapter 2 is reminded until a later chapter answers it.",
|
|
38264
|
+
http: "GET",
|
|
38265
|
+
path: "/studio/v1/works/{work}/drafts/{draft}/foreshadows",
|
|
38266
|
+
streaming: "no",
|
|
38267
|
+
pagination: false,
|
|
38268
|
+
pathParams: [
|
|
38269
|
+
{
|
|
38270
|
+
name: "work",
|
|
38271
|
+
sdkName: "work",
|
|
38272
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
38273
|
+
},
|
|
38274
|
+
{
|
|
38275
|
+
name: "draft",
|
|
38276
|
+
sdkName: "draft",
|
|
38277
|
+
description: "Draft being addressed, either its in-work key such as novel or its drf_ identifier; a key renamed earlier still resolves through its previous value."
|
|
38278
|
+
}
|
|
38279
|
+
],
|
|
38280
|
+
query: []
|
|
38281
|
+
},
|
|
38282
|
+
{
|
|
38283
|
+
resource: "studio.works.drafts.foreshadows",
|
|
38284
|
+
method: "delete",
|
|
38285
|
+
summary: "Drop a foreshadow",
|
|
38286
|
+
description: "Remove a thread that is no longer in the story. Deleting a key that does not exist answers the same as deleting one that did.",
|
|
38287
|
+
http: "DELETE",
|
|
38288
|
+
path: "/studio/v1/works/{work}/drafts/{draft}/foreshadows/{key}",
|
|
38289
|
+
streaming: "no",
|
|
38290
|
+
pagination: false,
|
|
38291
|
+
pathParams: [
|
|
38292
|
+
{
|
|
38293
|
+
name: "work",
|
|
38294
|
+
sdkName: "work",
|
|
38295
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
38296
|
+
},
|
|
38297
|
+
{
|
|
38298
|
+
name: "draft",
|
|
38299
|
+
sdkName: "draft",
|
|
38300
|
+
description: "Draft being addressed, either its in-work key such as novel or its drf_ identifier; a key renamed earlier still resolves through its previous value."
|
|
38301
|
+
},
|
|
38302
|
+
{
|
|
38303
|
+
name: "key",
|
|
38304
|
+
sdkName: "key",
|
|
38305
|
+
description: "Your name for the thread inside this work, such as 改造告示 or the-photo; the same key updates the same foreshadow."
|
|
38306
|
+
}
|
|
38307
|
+
],
|
|
38308
|
+
query: []
|
|
38309
|
+
},
|
|
38310
|
+
{
|
|
38311
|
+
resource: "studio.works.drafts.foreshadows",
|
|
38312
|
+
method: "update",
|
|
38313
|
+
summary: "Plant or pay off a foreshadow",
|
|
38314
|
+
description: "Record a thread under a key of your choice: the unit that plants it and, once written, the unit that pays it off. Call it when you write the setup (payoff left out or null) and again with the same key when a later unit answers it. Both units must belong to this draft. An open foreshadow is reported by the foreshadow_paid check until it has a payoff, and a unit's context pack does not need to be asked for it.",
|
|
38315
|
+
http: "PUT",
|
|
38316
|
+
path: "/studio/v1/works/{work}/drafts/{draft}/foreshadows/{key}",
|
|
38317
|
+
streaming: "no",
|
|
38318
|
+
pagination: false,
|
|
38319
|
+
pathParams: [
|
|
38320
|
+
{
|
|
38321
|
+
name: "work",
|
|
38322
|
+
sdkName: "work",
|
|
38323
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
38324
|
+
},
|
|
38325
|
+
{
|
|
38326
|
+
name: "draft",
|
|
38327
|
+
sdkName: "draft",
|
|
38328
|
+
description: "Draft being addressed, either its in-work key such as novel or its drf_ identifier; a key renamed earlier still resolves through its previous value."
|
|
38329
|
+
},
|
|
38330
|
+
{
|
|
38331
|
+
name: "key",
|
|
38332
|
+
sdkName: "key",
|
|
38333
|
+
description: "Your name for the thread inside this work, such as 改造告示 or the-photo; the same key updates the same foreshadow."
|
|
38334
|
+
}
|
|
38335
|
+
],
|
|
38336
|
+
query: [],
|
|
38337
|
+
body: {
|
|
38338
|
+
required: true,
|
|
38339
|
+
fields: [
|
|
38340
|
+
{
|
|
38341
|
+
name: "setup",
|
|
38342
|
+
type: "string",
|
|
38343
|
+
required: true,
|
|
38344
|
+
description: "Unit that plants the thread, by number such as 1 or by unt_ identifier; it must belong to this draft."
|
|
38345
|
+
},
|
|
38346
|
+
{
|
|
38347
|
+
name: "payoff",
|
|
38348
|
+
type: "string",
|
|
38349
|
+
required: false,
|
|
38350
|
+
description: "Unit that pays it off, by number or identifier, in this draft; leave it out or null while it is still open."
|
|
38351
|
+
},
|
|
38352
|
+
{
|
|
38353
|
+
name: "note",
|
|
38354
|
+
type: "string",
|
|
38355
|
+
required: false,
|
|
38356
|
+
description: "What was planted, in a sentence."
|
|
38357
|
+
}
|
|
38358
|
+
]
|
|
38359
|
+
}
|
|
38360
|
+
},
|
|
38086
38361
|
{
|
|
38087
38362
|
resource: "studio.works.drafts",
|
|
38088
38363
|
method: "retrieveOutline",
|
|
@@ -38417,6 +38692,95 @@ for more details.`
|
|
|
38417
38692
|
]
|
|
38418
38693
|
}
|
|
38419
38694
|
},
|
|
38695
|
+
{
|
|
38696
|
+
resource: "studio.works.progressions",
|
|
38697
|
+
method: "list",
|
|
38698
|
+
summary: "List the setting changes of a work",
|
|
38699
|
+
description: "List the recorded changes, all of them or those of one entry. Use it to check what a character has been through before writing the next unit, or to find a progression to delete.",
|
|
38700
|
+
http: "GET",
|
|
38701
|
+
path: "/studio/v1/works/{work}/progressions",
|
|
38702
|
+
streaming: "no",
|
|
38703
|
+
pagination: false,
|
|
38704
|
+
pathParams: [
|
|
38705
|
+
{
|
|
38706
|
+
name: "work",
|
|
38707
|
+
sdkName: "work",
|
|
38708
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
38709
|
+
}
|
|
38710
|
+
],
|
|
38711
|
+
query: [
|
|
38712
|
+
{
|
|
38713
|
+
name: "entry",
|
|
38714
|
+
type: "string",
|
|
38715
|
+
required: false,
|
|
38716
|
+
description: "Only the changes of this entry, by name, alias or ent_ identifier."
|
|
38717
|
+
}
|
|
38718
|
+
]
|
|
38719
|
+
},
|
|
38720
|
+
{
|
|
38721
|
+
resource: "studio.works.progressions",
|
|
38722
|
+
method: "create",
|
|
38723
|
+
summary: "Record how a setting entry changes at a unit",
|
|
38724
|
+
description: "Record that an entry changes as of one unit: a character is injured in chapter 6, a shop moves in chapter 9, a secret becomes known. The library keeps what an entry is from the start; a progression keeps what becomes true later. A unit's context pack shows an entry's changes up to and including that unit (截至本单元的设定变化) and withholds the later ones, so chapter 3 is not written with chapter 6's injury. Name the entry by its name, an alias or its ent_ identifier, and the unit by its number.",
|
|
38725
|
+
http: "POST",
|
|
38726
|
+
path: "/studio/v1/works/{work}/progressions",
|
|
38727
|
+
streaming: "no",
|
|
38728
|
+
pagination: false,
|
|
38729
|
+
pathParams: [
|
|
38730
|
+
{
|
|
38731
|
+
name: "work",
|
|
38732
|
+
sdkName: "work",
|
|
38733
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
38734
|
+
}
|
|
38735
|
+
],
|
|
38736
|
+
query: [],
|
|
38737
|
+
body: {
|
|
38738
|
+
required: true,
|
|
38739
|
+
fields: [
|
|
38740
|
+
{
|
|
38741
|
+
name: "entry",
|
|
38742
|
+
type: "string",
|
|
38743
|
+
required: true,
|
|
38744
|
+
description: "Entry that changes, by name, alias or ent_ identifier; it must be in a library this work mounts."
|
|
38745
|
+
},
|
|
38746
|
+
{
|
|
38747
|
+
name: "unit",
|
|
38748
|
+
type: "string",
|
|
38749
|
+
required: true,
|
|
38750
|
+
description: "Unit from which the change is true, by number such as 3 or by unt_ identifier."
|
|
38751
|
+
},
|
|
38752
|
+
{
|
|
38753
|
+
name: "change",
|
|
38754
|
+
type: "string",
|
|
38755
|
+
required: true,
|
|
38756
|
+
description: "What changes, in a sentence a writer can respect."
|
|
38757
|
+
}
|
|
38758
|
+
]
|
|
38759
|
+
}
|
|
38760
|
+
},
|
|
38761
|
+
{
|
|
38762
|
+
resource: "studio.works.progressions",
|
|
38763
|
+
method: "delete",
|
|
38764
|
+
summary: "Delete a setting change",
|
|
38765
|
+
description: "Remove one recorded change, by the prg_ identifier the list returns; to correct a change, delete it and record the new one.",
|
|
38766
|
+
http: "DELETE",
|
|
38767
|
+
path: "/studio/v1/works/{work}/progressions/{id}",
|
|
38768
|
+
streaming: "no",
|
|
38769
|
+
pagination: false,
|
|
38770
|
+
pathParams: [
|
|
38771
|
+
{
|
|
38772
|
+
name: "work",
|
|
38773
|
+
sdkName: "work",
|
|
38774
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
38775
|
+
},
|
|
38776
|
+
{
|
|
38777
|
+
name: "id",
|
|
38778
|
+
sdkName: "id",
|
|
38779
|
+
description: "The progression to delete, by its identifier from the list."
|
|
38780
|
+
}
|
|
38781
|
+
],
|
|
38782
|
+
query: []
|
|
38783
|
+
},
|
|
38420
38784
|
{
|
|
38421
38785
|
resource: "studio.works.renditions",
|
|
38422
38786
|
method: "list",
|
|
@@ -39170,7 +39534,7 @@ for more details.`
|
|
|
39170
39534
|
name: "budget_tokens",
|
|
39171
39535
|
type: "integer",
|
|
39172
39536
|
required: false,
|
|
39173
|
-
description: "Token budget the pack must fit into; the reference and previous sections are cut to fit it while the genre, brief and unit sections always arrive whole. Omit it to use the service default."
|
|
39537
|
+
description: "Token budget the pack must fit into; the reference, timeline and previous sections are cut to fit it while the genre, brief and unit sections always arrive whole. Omit it to use the service default."
|
|
39174
39538
|
}
|
|
39175
39539
|
]
|
|
39176
39540
|
},
|
|
@@ -44284,6 +44648,36 @@ var getObservedProcessOutput = (options) => (options.client ?? client).get({
|
|
|
44284
44648
|
url: "/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output",
|
|
44285
44649
|
...options
|
|
44286
44650
|
});
|
|
44651
|
+
var startSandboxTask = (options) => (options.client ?? client).post({
|
|
44652
|
+
security: [{
|
|
44653
|
+
key: "BearerAuth",
|
|
44654
|
+
scheme: "bearer",
|
|
44655
|
+
type: "http"
|
|
44656
|
+
}, {
|
|
44657
|
+
key: "ApiKeyAuth",
|
|
44658
|
+
name: "X-API-Key",
|
|
44659
|
+
type: "apiKey"
|
|
44660
|
+
}],
|
|
44661
|
+
url: "/sandbox/v1/sandboxes/{sandboxID}/tasks",
|
|
44662
|
+
...options,
|
|
44663
|
+
headers: {
|
|
44664
|
+
"Content-Type": "application/json",
|
|
44665
|
+
...options.headers
|
|
44666
|
+
}
|
|
44667
|
+
});
|
|
44668
|
+
var getSandboxTaskLog = (options) => (options.client ?? client).get({
|
|
44669
|
+
security: [{
|
|
44670
|
+
key: "BearerAuth",
|
|
44671
|
+
scheme: "bearer",
|
|
44672
|
+
type: "http"
|
|
44673
|
+
}, {
|
|
44674
|
+
key: "ApiKeyAuth",
|
|
44675
|
+
name: "X-API-Key",
|
|
44676
|
+
type: "apiKey"
|
|
44677
|
+
}],
|
|
44678
|
+
url: "/sandbox/v1/sandboxes/{sandboxID}/tasks/{taskID}/log",
|
|
44679
|
+
...options
|
|
44680
|
+
});
|
|
44287
44681
|
var deleteSandboxV1SandboxesBySandboxId = (options) => (options.client ?? client).delete({
|
|
44288
44682
|
security: [
|
|
44289
44683
|
{
|
|
@@ -47942,6 +48336,19 @@ var devopsProjectsGet = (options) => (options.client ?? client).get({
|
|
|
47942
48336
|
url: "/devops/v1/projects/{id}",
|
|
47943
48337
|
...options
|
|
47944
48338
|
});
|
|
48339
|
+
var devopsProjectsUpdate = (options) => (options.client ?? client).patch({
|
|
48340
|
+
security: [{
|
|
48341
|
+
key: "devops-bearerAuth",
|
|
48342
|
+
scheme: "bearer",
|
|
48343
|
+
type: "http"
|
|
48344
|
+
}],
|
|
48345
|
+
url: "/devops/v1/projects/{id}",
|
|
48346
|
+
...options,
|
|
48347
|
+
headers: {
|
|
48348
|
+
"Content-Type": "application/json",
|
|
48349
|
+
...options.headers
|
|
48350
|
+
}
|
|
48351
|
+
});
|
|
47945
48352
|
var devopsReleasesList = (options) => (options.client ?? client).get({
|
|
47946
48353
|
security: [{
|
|
47947
48354
|
key: "devops-bearerAuth",
|
|
@@ -48092,6 +48499,19 @@ var devopsEnvironmentsList = (options) => (options.client ?? client).get({
|
|
|
48092
48499
|
url: "/devops/v1/projects/{project}/environments",
|
|
48093
48500
|
...options
|
|
48094
48501
|
});
|
|
48502
|
+
var devopsEnvironmentsUpdate = (options) => (options.client ?? client).patch({
|
|
48503
|
+
security: [{
|
|
48504
|
+
key: "devops-bearerAuth",
|
|
48505
|
+
scheme: "bearer",
|
|
48506
|
+
type: "http"
|
|
48507
|
+
}],
|
|
48508
|
+
url: "/devops/v1/environments/{id}",
|
|
48509
|
+
...options,
|
|
48510
|
+
headers: {
|
|
48511
|
+
"Content-Type": "application/json",
|
|
48512
|
+
...options.headers
|
|
48513
|
+
}
|
|
48514
|
+
});
|
|
48095
48515
|
var devopsEnvironmentsCheckpointsList = (options) => (options.client ?? client).get({
|
|
48096
48516
|
security: [{
|
|
48097
48517
|
key: "devops-bearerAuth",
|
|
@@ -50369,6 +50789,92 @@ var studioDraftsOutline = (options) => (options.client ?? client).get({
|
|
|
50369
50789
|
url: "/studio/v1/works/{work}/drafts/{draft}/outline",
|
|
50370
50790
|
...options
|
|
50371
50791
|
});
|
|
50792
|
+
var studioForeshadowsList = (options) => (options.client ?? client).get({
|
|
50793
|
+
security: [{
|
|
50794
|
+
key: "BearerAuth",
|
|
50795
|
+
scheme: "bearer",
|
|
50796
|
+
type: "http"
|
|
50797
|
+
}, {
|
|
50798
|
+
key: "ApiKeyAuth",
|
|
50799
|
+
name: "X-API-Key",
|
|
50800
|
+
type: "apiKey"
|
|
50801
|
+
}],
|
|
50802
|
+
url: "/studio/v1/works/{work}/drafts/{draft}/foreshadows",
|
|
50803
|
+
...options
|
|
50804
|
+
});
|
|
50805
|
+
var studioForeshadowsDelete = (options) => (options.client ?? client).delete({
|
|
50806
|
+
security: [{
|
|
50807
|
+
key: "BearerAuth",
|
|
50808
|
+
scheme: "bearer",
|
|
50809
|
+
type: "http"
|
|
50810
|
+
}, {
|
|
50811
|
+
key: "ApiKeyAuth",
|
|
50812
|
+
name: "X-API-Key",
|
|
50813
|
+
type: "apiKey"
|
|
50814
|
+
}],
|
|
50815
|
+
url: "/studio/v1/works/{work}/drafts/{draft}/foreshadows/{key}",
|
|
50816
|
+
...options
|
|
50817
|
+
});
|
|
50818
|
+
var studioForeshadowsUpsert = (options) => (options.client ?? client).put({
|
|
50819
|
+
security: [{
|
|
50820
|
+
key: "BearerAuth",
|
|
50821
|
+
scheme: "bearer",
|
|
50822
|
+
type: "http"
|
|
50823
|
+
}, {
|
|
50824
|
+
key: "ApiKeyAuth",
|
|
50825
|
+
name: "X-API-Key",
|
|
50826
|
+
type: "apiKey"
|
|
50827
|
+
}],
|
|
50828
|
+
url: "/studio/v1/works/{work}/drafts/{draft}/foreshadows/{key}",
|
|
50829
|
+
...options,
|
|
50830
|
+
headers: {
|
|
50831
|
+
"Content-Type": "application/json",
|
|
50832
|
+
...options.headers
|
|
50833
|
+
}
|
|
50834
|
+
});
|
|
50835
|
+
var studioProgressionsList = (options) => (options.client ?? client).get({
|
|
50836
|
+
security: [{
|
|
50837
|
+
key: "BearerAuth",
|
|
50838
|
+
scheme: "bearer",
|
|
50839
|
+
type: "http"
|
|
50840
|
+
}, {
|
|
50841
|
+
key: "ApiKeyAuth",
|
|
50842
|
+
name: "X-API-Key",
|
|
50843
|
+
type: "apiKey"
|
|
50844
|
+
}],
|
|
50845
|
+
url: "/studio/v1/works/{work}/progressions",
|
|
50846
|
+
...options
|
|
50847
|
+
});
|
|
50848
|
+
var studioProgressionsCreate = (options) => (options.client ?? client).post({
|
|
50849
|
+
security: [{
|
|
50850
|
+
key: "BearerAuth",
|
|
50851
|
+
scheme: "bearer",
|
|
50852
|
+
type: "http"
|
|
50853
|
+
}, {
|
|
50854
|
+
key: "ApiKeyAuth",
|
|
50855
|
+
name: "X-API-Key",
|
|
50856
|
+
type: "apiKey"
|
|
50857
|
+
}],
|
|
50858
|
+
url: "/studio/v1/works/{work}/progressions",
|
|
50859
|
+
...options,
|
|
50860
|
+
headers: {
|
|
50861
|
+
"Content-Type": "application/json",
|
|
50862
|
+
...options.headers
|
|
50863
|
+
}
|
|
50864
|
+
});
|
|
50865
|
+
var studioProgressionsDelete = (options) => (options.client ?? client).delete({
|
|
50866
|
+
security: [{
|
|
50867
|
+
key: "BearerAuth",
|
|
50868
|
+
scheme: "bearer",
|
|
50869
|
+
type: "http"
|
|
50870
|
+
}, {
|
|
50871
|
+
key: "ApiKeyAuth",
|
|
50872
|
+
name: "X-API-Key",
|
|
50873
|
+
type: "apiKey"
|
|
50874
|
+
}],
|
|
50875
|
+
url: "/studio/v1/works/{work}/progressions/{id}",
|
|
50876
|
+
...options
|
|
50877
|
+
});
|
|
50372
50878
|
var studioDraftsStatus = (options) => (options.client ?? client).get({
|
|
50373
50879
|
security: [{
|
|
50374
50880
|
key: "BearerAuth",
|
|
@@ -52639,7 +53145,8 @@ function createDevops(transport) {
|
|
|
52639
53145
|
environments: {
|
|
52640
53146
|
checkpoints: {
|
|
52641
53147
|
list: bind(transport, devopsEnvironmentsCheckpointsList)
|
|
52642
|
-
}
|
|
53148
|
+
},
|
|
53149
|
+
update: bind(transport, devopsEnvironmentsUpdate)
|
|
52643
53150
|
},
|
|
52644
53151
|
flags: {
|
|
52645
53152
|
archive: bind(transport, devopsFlagsArchive),
|
|
@@ -52710,7 +53217,8 @@ function createDevops(transport) {
|
|
|
52710
53217
|
},
|
|
52711
53218
|
testSuites: {
|
|
52712
53219
|
list: bind(transport, devopsTestSuitesList)
|
|
52713
|
-
}
|
|
53220
|
+
},
|
|
53221
|
+
update: bind(transport, devopsProjectsUpdate)
|
|
52714
53222
|
},
|
|
52715
53223
|
promotions: {
|
|
52716
53224
|
approve: bind(transport, devopsPromotionsApprove),
|
|
@@ -53115,6 +53623,10 @@ function createSandbox(transport) {
|
|
|
53115
53623
|
snapshots: {
|
|
53116
53624
|
create: bind(transport, postSandboxV1SandboxesBySandboxIdSnapshots)
|
|
53117
53625
|
},
|
|
53626
|
+
tasks: {
|
|
53627
|
+
create: bind(transport, startSandboxTask),
|
|
53628
|
+
retrieveLog: bind(transport, getSandboxTaskLog)
|
|
53629
|
+
},
|
|
53118
53630
|
timeout: bind(transport, postSandboxV1SandboxesBySandboxIdTimeout),
|
|
53119
53631
|
update: bind(transport, renameSandbox),
|
|
53120
53632
|
updateNetwork: bind(transport, putSandboxV1SandboxesBySandboxIdNetwork),
|
|
@@ -53218,6 +53730,11 @@ function createStudio(transport) {
|
|
|
53218
53730
|
create: bind(transport, studioWorksCreate),
|
|
53219
53731
|
drafts: {
|
|
53220
53732
|
create: bind(transport, studioDraftsCreate),
|
|
53733
|
+
foreshadows: {
|
|
53734
|
+
delete: bind(transport, studioForeshadowsDelete),
|
|
53735
|
+
list: bind(transport, studioForeshadowsList),
|
|
53736
|
+
update: bind(transport, studioForeshadowsUpsert)
|
|
53737
|
+
},
|
|
53221
53738
|
list: bind(transport, studioDraftsList),
|
|
53222
53739
|
rebase: bind(transport, studioDraftsRebase),
|
|
53223
53740
|
renditions: {
|
|
@@ -53239,6 +53756,11 @@ function createStudio(transport) {
|
|
|
53239
53756
|
updateBrief: bind(transport, studioDraftsUpdateBrief)
|
|
53240
53757
|
},
|
|
53241
53758
|
list: bind(transport, studioWorksList),
|
|
53759
|
+
progressions: {
|
|
53760
|
+
create: bind(transport, studioProgressionsCreate),
|
|
53761
|
+
delete: bind(transport, studioProgressionsDelete),
|
|
53762
|
+
list: bind(transport, studioProgressionsList)
|
|
53763
|
+
},
|
|
53242
53764
|
renditions: {
|
|
53243
53765
|
delete: bind(transport, studioRenditionsDelete),
|
|
53244
53766
|
list: bind(transport, studioRenditionsList),
|
|
@@ -57477,6 +57999,7 @@ function nodeToolchainPorts(env, fetchImpl = fetch, home = homedir2()) {
|
|
|
57477
57999
|
}
|
|
57478
58000
|
|
|
57479
58001
|
// src/devops/tofu/pure.ts
|
|
58002
|
+
import { isAbsolute, relative } from "node:path";
|
|
57480
58003
|
var ENVIRONMENT_ID = /^dve_[A-Za-z0-9]+$/;
|
|
57481
58004
|
function parseEnvironmentId(value) {
|
|
57482
58005
|
const id = value?.trim();
|
|
@@ -57519,21 +58042,48 @@ function parseTofuDeployArgs(flags) {
|
|
|
57519
58042
|
...flags.workdir ? { workdir: flags.workdir } : {}
|
|
57520
58043
|
};
|
|
57521
58044
|
}
|
|
57522
|
-
function
|
|
58045
|
+
function isExcludedPath(path, exclude) {
|
|
58046
|
+
return exclude.some((pattern) => matchesPattern(pattern, path));
|
|
58047
|
+
}
|
|
58048
|
+
function excludedTargets(plan, environment2, adapters, exclude) {
|
|
58049
|
+
if (exclude.length === 0)
|
|
58050
|
+
return [];
|
|
58051
|
+
return targetsFor(plan, environment2).filter((t) => adapters.has(t.destination) && deploysTo(t, environment2, { named: false }) && isExcludedPath(t.path, exclude)).map((t) => t.path).sort();
|
|
58052
|
+
}
|
|
58053
|
+
function excludedDependencies(targets, excluded) {
|
|
58054
|
+
const dropped = new Set(excluded);
|
|
58055
|
+
const found = [];
|
|
58056
|
+
for (const t of targets)
|
|
58057
|
+
for (const dependency of t.dependsOn) {
|
|
58058
|
+
if (dropped.has(dependency))
|
|
58059
|
+
found.push({ target: t.path, dependency });
|
|
58060
|
+
}
|
|
58061
|
+
return found;
|
|
58062
|
+
}
|
|
58063
|
+
function selectTargets(plan, environment2, requested, adapters, exclude = []) {
|
|
57523
58064
|
const named = requested !== undefined;
|
|
57524
|
-
|
|
58065
|
+
const dropped = excludedTargets(plan, environment2, adapters, exclude);
|
|
58066
|
+
let targets = targetsFor(plan, environment2).filter((t) => adapters.has(t.destination) && deploysTo(t, environment2, { named }) && !isExcludedPath(t.path, exclude));
|
|
57525
58067
|
if (requested !== undefined) {
|
|
57526
58068
|
const known = new Set(plan.targets.map((t) => t.path));
|
|
57527
58069
|
const missing = requested.filter((r) => !known.has(r));
|
|
57528
58070
|
if (missing.length > 0)
|
|
57529
58071
|
throw new UsageError(`unknown target(s): ${missing.join(", ")}`, "Run `praxis devops deploy plan` to list the targets.");
|
|
58072
|
+
const excludedNamed = requested.filter((r) => isExcludedPath(r, exclude));
|
|
58073
|
+
if (excludedNamed.length > 0) {
|
|
58074
|
+
throw new UsageError(`${excludedNamed.join(", ")} is excluded by praxis.yaml`, "devops.deploy.exclude in praxis.yaml removes it from every run: it is not a delivery target. Name another target, or take its path out of that list.");
|
|
58075
|
+
}
|
|
57530
58076
|
const refused = requested.filter((r) => !targets.some((t) => t.path === r));
|
|
57531
58077
|
if (refused.length > 0)
|
|
57532
58078
|
throw new UsageError(`${refused.join(", ")} does not deploy to ${environment2}, or praxis.yaml names no adapter for its destination`, "Check the target's environments, and devops.deploy.adapters in praxis.yaml.");
|
|
57533
58079
|
targets = targets.filter((t) => requested.includes(t.path));
|
|
57534
58080
|
}
|
|
58081
|
+
const orphaned = excludedDependencies(targets, dropped);
|
|
58082
|
+
if (orphaned.length > 0) {
|
|
58083
|
+
throw new UsageError(`excluded target(s) still depended on: ${orphaned.map((o) => `${o.target} depends on ${o.dependency}`).join("; ")}`, "devops.deploy.exclude in praxis.yaml must not cover a directory another target binds: remove that path from the exclude list, or keep the dependent out of this run.");
|
|
58084
|
+
}
|
|
57535
58085
|
const selected = { commit: plan.commit, targets };
|
|
57536
|
-
return { targets, layers: layersOf(selected).map((layer) => [...layer]) };
|
|
58086
|
+
return { targets, layers: layersOf(selected).map((layer) => [...layer]), excluded: dropped };
|
|
57537
58087
|
}
|
|
57538
58088
|
function blockedBy(targets, broken) {
|
|
57539
58089
|
const blocked = new Set;
|
|
@@ -57568,6 +58118,7 @@ var DEPLOY_SHAPE = `devops:
|
|
|
57568
58118
|
deploy:
|
|
57569
58119
|
adapters:
|
|
57570
58120
|
cloudflare: bun tofu/adapter.ts
|
|
58121
|
+
exclude: ["**/spec/features/*"] # optional
|
|
57571
58122
|
policy:
|
|
57572
58123
|
forbiddenNames: <path> # optional`;
|
|
57573
58124
|
function parseDeployProject(file) {
|
|
@@ -57597,7 +58148,43 @@ ${DEPLOY_SHAPE}`);
|
|
|
57597
58148
|
const forbiddenNames = object(policy) ? policy.forbiddenNames : undefined;
|
|
57598
58149
|
if (forbiddenNames !== undefined && (typeof forbiddenNames !== "string" || forbiddenNames.trim() === ""))
|
|
57599
58150
|
refuse("devops.deploy.policy.forbiddenNames must be a repository path");
|
|
57600
|
-
|
|
58151
|
+
const declaredExclude = deploy.exclude;
|
|
58152
|
+
if (declaredExclude !== undefined && (!Array.isArray(declaredExclude) || declaredExclude.some((e) => typeof e !== "string" || e.trim() === ""))) {
|
|
58153
|
+
refuse("devops.deploy.exclude must be a list of non-empty workspace globs");
|
|
58154
|
+
}
|
|
58155
|
+
const declaredAllow = object(policy) ? policy.allowDeletes : undefined;
|
|
58156
|
+
if (declaredAllow !== undefined && (!Array.isArray(declaredAllow) || declaredAllow.some((e) => typeof e !== "string" || e.trim() === ""))) {
|
|
58157
|
+
refuse("devops.deploy.policy.allowDeletes must be a list of resource-address prefixes");
|
|
58158
|
+
}
|
|
58159
|
+
const allowDeletes = Array.isArray(declaredAllow) ? declaredAllow.map((e) => e.trim()) : [];
|
|
58160
|
+
const exclude = Array.isArray(declaredExclude) ? declaredExclude.map((e) => e.trim().replace(/^\.\//, "").replace(/\/+$/, "")) : [];
|
|
58161
|
+
return {
|
|
58162
|
+
adapters,
|
|
58163
|
+
...typeof forbiddenNames === "string" ? { forbiddenNames: forbiddenNames.trim() } : {},
|
|
58164
|
+
...exclude.length > 0 ? { exclude } : {},
|
|
58165
|
+
...allowDeletes.length > 0 ? { allowDeletes } : {}
|
|
58166
|
+
};
|
|
58167
|
+
}
|
|
58168
|
+
function forbiddenDeletes(showJson, allow = []) {
|
|
58169
|
+
let doc;
|
|
58170
|
+
try {
|
|
58171
|
+
doc = JSON.parse(showJson);
|
|
58172
|
+
} catch {
|
|
58173
|
+
return { ok: false, reason: "tofu show -json did not answer a JSON plan" };
|
|
58174
|
+
}
|
|
58175
|
+
const changes = doc.resource_changes;
|
|
58176
|
+
if (changes === undefined)
|
|
58177
|
+
return { ok: true, deletes: [] };
|
|
58178
|
+
if (!Array.isArray(changes))
|
|
58179
|
+
return { ok: false, reason: "the plan document has no resource_changes list" };
|
|
58180
|
+
const deletes = [];
|
|
58181
|
+
for (const change of changes) {
|
|
58182
|
+
const actions = Array.isArray(change.change?.actions) ? change.change.actions : [];
|
|
58183
|
+
const address = typeof change.address === "string" ? change.address : "?";
|
|
58184
|
+
if (actions.includes("delete") && !allow.some((prefix) => address.startsWith(prefix)))
|
|
58185
|
+
deletes.push(address);
|
|
58186
|
+
}
|
|
58187
|
+
return { ok: true, deletes };
|
|
57601
58188
|
}
|
|
57602
58189
|
function adapterEnv(input) {
|
|
57603
58190
|
return {
|
|
@@ -57645,6 +58232,66 @@ function forbiddenHits(names, entries) {
|
|
|
57645
58232
|
}
|
|
57646
58233
|
var targetDir = (workdir, target) => `${workdir}/${target}`;
|
|
57647
58234
|
var planFileOf = (planDir, target) => `${planDir}/${target.replaceAll("/", "__")}.bin`;
|
|
58235
|
+
var renderArchiveOf = (planDir, target) => `${planDir}/${target.replaceAll("/", "__")}.render.tar.gz`;
|
|
58236
|
+
var RENDER_ASSETS_DIR = "__render_assets";
|
|
58237
|
+
var RENDER_EXCLUDES = [".terraform", ".terraform.lock.hcl", "*.tfstate*", "praxis_backend.tf.json"];
|
|
58238
|
+
function underReservedDir(rel) {
|
|
58239
|
+
const d = [",", "|", "#", "%"].find((c) => !rel.includes(c)) ?? ",";
|
|
58240
|
+
return `s${d}^${rel}${d}${RENDER_ASSETS_DIR}/${rel}${d}`;
|
|
58241
|
+
}
|
|
58242
|
+
function renderArchiveArgs(input) {
|
|
58243
|
+
const { archive, targetDir: dir, repoRoot, assetsRel } = input;
|
|
58244
|
+
return [
|
|
58245
|
+
"-czf",
|
|
58246
|
+
archive,
|
|
58247
|
+
"-C",
|
|
58248
|
+
dir,
|
|
58249
|
+
...RENDER_EXCLUDES.map((name) => `--exclude=./${name}`),
|
|
58250
|
+
".",
|
|
58251
|
+
...assetsRel === null ? [] : ["-C", repoRoot, `--transform=${underReservedDir(assetsRel)}`, assetsRel]
|
|
58252
|
+
];
|
|
58253
|
+
}
|
|
58254
|
+
var renderExtractWorkdirArgs = (archive) => ["-xzf", archive, `--exclude=${RENDER_ASSETS_DIR}`];
|
|
58255
|
+
function renderExtractAssetsArgs(archive) {
|
|
58256
|
+
return ["-xzf", archive, "--wildcards", `--transform=s,^${RENDER_ASSETS_DIR}/,,`, `${RENDER_ASSETS_DIR}/*`];
|
|
58257
|
+
}
|
|
58258
|
+
function renderArchiveAssetsRel(listing) {
|
|
58259
|
+
for (const line of listing) {
|
|
58260
|
+
const rel = line.trim().replace(/^\.\//, "");
|
|
58261
|
+
if (!rel.startsWith(`${RENDER_ASSETS_DIR}/`))
|
|
58262
|
+
continue;
|
|
58263
|
+
const rest = rel.slice(RENDER_ASSETS_DIR.length + 1).replace(/\/+$/, "");
|
|
58264
|
+
if (rest !== "")
|
|
58265
|
+
return rest;
|
|
58266
|
+
}
|
|
58267
|
+
return null;
|
|
58268
|
+
}
|
|
58269
|
+
function clientDirOf(text) {
|
|
58270
|
+
if (text === null)
|
|
58271
|
+
return null;
|
|
58272
|
+
try {
|
|
58273
|
+
const value = JSON.parse(text);
|
|
58274
|
+
return typeof value?.clientDir === "string" && value.clientDir !== "" ? value.clientDir : null;
|
|
58275
|
+
} catch {
|
|
58276
|
+
return null;
|
|
58277
|
+
}
|
|
58278
|
+
}
|
|
58279
|
+
function renderAssetsRel(repoRoot, clientDir) {
|
|
58280
|
+
if (clientDir === null)
|
|
58281
|
+
return null;
|
|
58282
|
+
const rel = relative(repoRoot, clientDir);
|
|
58283
|
+
return rel === "" || rel === ".." || rel.startsWith("../") || isAbsolute(rel) ? null : rel;
|
|
58284
|
+
}
|
|
58285
|
+
function withClientDir(text, clientDir) {
|
|
58286
|
+
let value;
|
|
58287
|
+
try {
|
|
58288
|
+
value = JSON.parse(text);
|
|
58289
|
+
} catch {
|
|
58290
|
+
return null;
|
|
58291
|
+
}
|
|
58292
|
+
return `${JSON.stringify({ ...value, clientDir }, null, 2)}
|
|
58293
|
+
`;
|
|
58294
|
+
}
|
|
57648
58295
|
var STATE_USERNAME = "praxis";
|
|
57649
58296
|
var STATE_PASSWORD_ENV = "TF_HTTP_PASSWORD";
|
|
57650
58297
|
function stateAddress(backend, target) {
|
|
@@ -57669,21 +58316,56 @@ function backendDocument(backend, target) {
|
|
|
57669
58316
|
}
|
|
57670
58317
|
|
|
57671
58318
|
// src/devops/tofu/run.ts
|
|
57672
|
-
import { dirname as dirname4, isAbsolute, resolve as resolve3 } from "node:path";
|
|
58319
|
+
import { dirname as dirname4, isAbsolute as isAbsolute2, resolve as resolve3 } from "node:path";
|
|
58320
|
+
function plannedTargetsOf(summaryText) {
|
|
58321
|
+
if (summaryText === null)
|
|
58322
|
+
return;
|
|
58323
|
+
try {
|
|
58324
|
+
const summary = JSON.parse(summaryText);
|
|
58325
|
+
if (!Array.isArray(summary.targets))
|
|
58326
|
+
return;
|
|
58327
|
+
return summary.targets.filter((t) => t.status === "planned" && typeof t.target === "string").map((t) => t.target);
|
|
58328
|
+
} catch {
|
|
58329
|
+
return;
|
|
58330
|
+
}
|
|
58331
|
+
}
|
|
58332
|
+
function planReadyLine(summary) {
|
|
58333
|
+
const planned = new Set(summary.targets.filter((t) => t.status === "planned").map((t) => t.target));
|
|
58334
|
+
const layers = summary.layers.map((layer) => layer.filter((path) => planned.has(path))).filter((layer) => layer.length > 0);
|
|
58335
|
+
const migrations = summary.targets.flatMap((t) => {
|
|
58336
|
+
const files = t.status === "planned" ? t.pending.filter((line) => line.startsWith("d1 migrations ")) : [];
|
|
58337
|
+
return files.length === 0 ? [] : [{ targetPath: t.target, files }];
|
|
58338
|
+
});
|
|
58339
|
+
return { type: "plan.ready", layers, migrations };
|
|
58340
|
+
}
|
|
58341
|
+
function failureDigest(summary) {
|
|
58342
|
+
const count2 = (status) => summary.targets.filter((t) => t.status === status).length;
|
|
58343
|
+
const lines = [`RESULT ${summary.finished} planned=${count2("planned")} succeeded=${count2("succeeded")} failed=${count2("failed")} blocked=${count2("blocked")}`];
|
|
58344
|
+
for (const t of summary.targets) {
|
|
58345
|
+
if (t.status === "failed" || t.status === "blocked" && t.message !== "a target it depends on did not finish")
|
|
58346
|
+
lines.push(`FAILED ${t.target}: ${t.message ?? t.status}`);
|
|
58347
|
+
}
|
|
58348
|
+
return lines;
|
|
58349
|
+
}
|
|
57673
58350
|
var BACKEND_FILE = "praxis_backend.tf.json";
|
|
58351
|
+
var NATIVE_PLAN = `praxis-native-target: deployed by wrangler after approval; no OpenTofu plan
|
|
58352
|
+
`;
|
|
57674
58353
|
async function runTofuDeploy(args, plan, ports) {
|
|
57675
58354
|
const { fs, exec, out } = ports;
|
|
57676
58355
|
const startedAt = ports.clock.iso();
|
|
57677
58356
|
const root = resolve3(ports.repoRoot);
|
|
57678
|
-
const absolute = (p) =>
|
|
58357
|
+
const absolute = (p) => isAbsolute2(p) ? p : resolve3(p);
|
|
57679
58358
|
const workdir = absolute(args.workdir ?? `${root}/.tofu-work`);
|
|
57680
58359
|
const planDir = absolute(args.planDir ?? `${workdir}/plans`);
|
|
57681
58360
|
const applying = args.mode !== "plan-only";
|
|
57682
58361
|
const events = applying && args.eventsFile !== undefined ? ports.openEvents(args.eventsFile, startedAt) : undefined;
|
|
57683
58362
|
const reports = new Map;
|
|
57684
|
-
const
|
|
58363
|
+
const targets = args.targets ?? (args.mode === "apply-plans" ? plannedTargetsOf(await fs.read(`${planDir}/summary.json`)) : undefined);
|
|
58364
|
+
const selection = selectTargets(plan, args.environment, targets, new Set(Object.keys(ports.project.adapters)), ports.project.exclude ?? []);
|
|
57685
58365
|
const byPath = new Map(selection.targets.map((t) => [t.path, t]));
|
|
57686
58366
|
const redact = (line) => ports.state.password === "" ? line : line.split(ports.state.password).join("***");
|
|
58367
|
+
for (const path of selection.excluded)
|
|
58368
|
+
out(`excluded by praxis.yaml: ${path}`);
|
|
57687
58369
|
const finish = (finished2, message2) => {
|
|
57688
58370
|
if (events)
|
|
57689
58371
|
events.finish(message2 === undefined ? {} : { message: message2 });
|
|
@@ -57699,6 +58381,9 @@ async function runTofuDeploy(args, plan, ports) {
|
|
|
57699
58381
|
};
|
|
57700
58382
|
const writeSummary = async (summary) => {
|
|
57701
58383
|
await fs.write(`${planDir}/summary.json`, `${JSON.stringify(summary, null, 2)}
|
|
58384
|
+
`);
|
|
58385
|
+
if (args.mode === "plan-only")
|
|
58386
|
+
await fs.write(`${planDir}/plan-ready.json`, `${JSON.stringify(planReadyLine(summary))}
|
|
57702
58387
|
`);
|
|
57703
58388
|
out(`SUMMARY ${JSON.stringify(summary)}`);
|
|
57704
58389
|
};
|
|
@@ -57734,7 +58419,55 @@ async function runTofuDeploy(args, plan, ports) {
|
|
|
57734
58419
|
if (code !== 0)
|
|
57735
58420
|
throw new StepFailed(kind === "engine" ? `rollout step ${cmdArgs[0]} exited ${code}` : `adapter ${cmdArgs[0]} exited ${code}`);
|
|
57736
58421
|
};
|
|
58422
|
+
const deletesOf = async (t, planFile, cwd, env) => {
|
|
58423
|
+
const resolved = await ports.toolchain.ensure();
|
|
58424
|
+
const lines = [];
|
|
58425
|
+
const code = await exec.run(resolved.binary, ["show", "-json", "-no-color", planFile], { cwd, env: { ...resolved.env, ...env }, onLine: (line) => {
|
|
58426
|
+
lines.push(line);
|
|
58427
|
+
} });
|
|
58428
|
+
if (code !== 0)
|
|
58429
|
+
throw new StepFailed(`rollout step show exited ${code}`);
|
|
58430
|
+
const verdict = forbiddenDeletes(lines.join(`
|
|
58431
|
+
`), ports.project.allowDeletes ?? []);
|
|
58432
|
+
if (!verdict.ok)
|
|
58433
|
+
throw new StepFailed(verdict.reason);
|
|
58434
|
+
if (verdict.deletes.length > 0) {
|
|
58435
|
+
throw new StepFailed(`the plan deletes or replaces ${verdict.deletes.join(", ")}; refused (praxis.yaml devops.deploy.policy.allowDeletes allows none of them)`);
|
|
58436
|
+
}
|
|
58437
|
+
};
|
|
57737
58438
|
const adapter = (t, phase) => step(t, "adapter", [phase], root, adapterEnv({ target: t.path, environment: args.environment, mode: args.mode, commit: args.commit, dir: targetDir(workdir, t.path) }));
|
|
58439
|
+
const tarStep = async (t, cmdArgs, cwd, lines) => {
|
|
58440
|
+
const say = (line) => {
|
|
58441
|
+
out(`[${t.path}] ${redact(line)}`);
|
|
58442
|
+
lines?.push(line);
|
|
58443
|
+
};
|
|
58444
|
+
const code = await exec.run("tar", cmdArgs, { cwd, onLine: say });
|
|
58445
|
+
if (code !== 0)
|
|
58446
|
+
throw new StepFailed(`render archive tar ${cmdArgs[0]} exited ${code}`);
|
|
58447
|
+
};
|
|
58448
|
+
const packRender = async (t, dir) => {
|
|
58449
|
+
const archive = renderArchiveOf(planDir, t.path);
|
|
58450
|
+
const assetsRel = renderAssetsRel(root, clientDirOf(await fs.read(`${dir}/frontend.json`)));
|
|
58451
|
+
await tarStep(t, renderArchiveArgs({ archive, targetDir: dir, repoRoot: root, assetsRel }), root);
|
|
58452
|
+
out(`[${t.path}] render archive ${archive}${assetsRel === null ? "" : ` (+ ${assetsRel})`}`);
|
|
58453
|
+
};
|
|
58454
|
+
const unpackRender = async (t, dir) => {
|
|
58455
|
+
const archive = renderArchiveOf(planDir, t.path);
|
|
58456
|
+
await fs.mkdirp(dir);
|
|
58457
|
+
await tarStep(t, renderExtractWorkdirArgs(archive), dir);
|
|
58458
|
+
const listing = [];
|
|
58459
|
+
await tarStep(t, ["-tzf", archive], root, listing);
|
|
58460
|
+
const assetsRel = renderArchiveAssetsRel(listing);
|
|
58461
|
+
if (assetsRel === null)
|
|
58462
|
+
return;
|
|
58463
|
+
await tarStep(t, renderExtractAssetsArgs(archive), root);
|
|
58464
|
+
const frontend = await fs.read(`${dir}/frontend.json`);
|
|
58465
|
+
const rewritten = frontend === null ? null : withClientDir(frontend, `${root}/${assetsRel}`);
|
|
58466
|
+
if (rewritten === null)
|
|
58467
|
+
throw new StepFailed(`render archive ${archive} carries ${assetsRel} but ${dir}/frontend.json is missing or not JSON`);
|
|
58468
|
+
await fs.write(`${dir}/frontend.json`, rewritten);
|
|
58469
|
+
out(`[${t.path}] static assets restored to ${root}/${assetsRel}`);
|
|
58470
|
+
};
|
|
57738
58471
|
const broken = new Set;
|
|
57739
58472
|
const manifests = new Map;
|
|
57740
58473
|
const fail = (t, message2, began, extra = {}) => {
|
|
@@ -57753,15 +58486,26 @@ async function runTofuDeploy(args, plan, ports) {
|
|
|
57753
58486
|
return await refuseAll(`policy.forbiddenNames ${ports.project.forbiddenNames} is missing; the policy check cannot run`);
|
|
57754
58487
|
forbidden = parseNameList(text);
|
|
57755
58488
|
}
|
|
58489
|
+
const rendered = new Set;
|
|
57756
58490
|
await pool(selection.targets, LAYER_CONCURRENCY, async (t) => {
|
|
57757
58491
|
const began = ports.clock.now();
|
|
57758
58492
|
const dir = targetDir(workdir, t.path);
|
|
57759
58493
|
try {
|
|
57760
|
-
|
|
57761
|
-
|
|
58494
|
+
const planFile = planFileOf(planDir, t.path);
|
|
58495
|
+
if (args.mode === "apply-plans" && !await fs.exists(planFile)) {
|
|
58496
|
+
throw new StepFailed(`plan file ${planFile} is missing; refusing to apply without it`);
|
|
58497
|
+
}
|
|
58498
|
+
const nativeApply = args.mode === "apply-plans" && await fs.read(planFile) === NATIVE_PLAN;
|
|
58499
|
+
const archive = renderArchiveOf(planDir, t.path);
|
|
58500
|
+
if (args.mode === "apply-plans" && !nativeApply && await fs.exists(archive)) {
|
|
58501
|
+
await unpackRender(t, dir);
|
|
58502
|
+
rendered.add(t.path);
|
|
58503
|
+
} else {
|
|
58504
|
+
if (args.mode === "apply-plans" && !nativeApply)
|
|
58505
|
+
out(`[${t.path}] no render archive in the plan; rebuilding`);
|
|
58506
|
+
await fs.mkdirp(dir);
|
|
58507
|
+
await adapter(t, "generate");
|
|
57762
58508
|
}
|
|
57763
|
-
await fs.mkdirp(dir);
|
|
57764
|
-
await adapter(t, "generate");
|
|
57765
58509
|
const manifest = parseTargetManifest(await fs.read(`${dir}/target.json`));
|
|
57766
58510
|
if (typeof manifest === "string")
|
|
57767
58511
|
throw new StepFailed(`adapter generate: ${manifest}`);
|
|
@@ -57802,6 +58546,23 @@ async function runTofuDeploy(args, plan, ports) {
|
|
|
57802
58546
|
out(`[${target}] pending until an approved apply: ${p}`);
|
|
57803
58547
|
const engineEnv = { [STATE_PASSWORD_ENV]: ports.state.password };
|
|
57804
58548
|
try {
|
|
58549
|
+
if (await fs.exists(`${dir}/native.json`)) {
|
|
58550
|
+
if (args.mode !== "apply-plans") {
|
|
58551
|
+
await adapter(t, "before-plan");
|
|
58552
|
+
await fs.mkdirp(dirname4(planFile));
|
|
58553
|
+
await fs.write(planFile, NATIVE_PLAN);
|
|
58554
|
+
out(`[${target}] native: no OpenTofu plan; wrangler deploys it after approval`);
|
|
58555
|
+
}
|
|
58556
|
+
if (applying) {
|
|
58557
|
+
if (await fs.read(planFile) !== NATIVE_PLAN)
|
|
58558
|
+
throw new StepFailed(`plan file ${planFile} is not the native marker this target's plan wrote`);
|
|
58559
|
+
await adapter(t, "before-apply");
|
|
58560
|
+
}
|
|
58561
|
+
reports.set(target, { target, status: applying ? "succeeded" : "planned", planFile, pending: manifest.pending, warnings: manifest.warnings, ...rendered.has(target) ? { rendered: true } : {} });
|
|
58562
|
+
if (events)
|
|
58563
|
+
events.end(target, "deploy", { kind: "succeeded", durationMs: ports.clock.now() - began });
|
|
58564
|
+
return;
|
|
58565
|
+
}
|
|
57805
58566
|
if (args.mode !== "apply-plans")
|
|
57806
58567
|
await adapter(t, "before-plan");
|
|
57807
58568
|
await step(t, "engine", ["init", "-input=false"], dir, engineEnv);
|
|
@@ -57809,12 +58570,15 @@ async function runTofuDeploy(args, plan, ports) {
|
|
|
57809
58570
|
await fs.mkdirp(dirname4(planFile));
|
|
57810
58571
|
await step(t, "engine", ["plan", "-input=false", "-no-color", `-out=${planFile}`], dir, engineEnv);
|
|
57811
58572
|
}
|
|
58573
|
+
await deletesOf(t, planFile, dir, engineEnv);
|
|
58574
|
+
if (args.mode === "plan-only")
|
|
58575
|
+
await packRender(t, dir);
|
|
57812
58576
|
if (applying) {
|
|
57813
58577
|
await adapter(t, "before-apply");
|
|
57814
58578
|
await step(t, "engine", ["apply", "-input=false", "-no-color", planFile], dir, engineEnv);
|
|
57815
58579
|
await adapter(t, "after-apply");
|
|
57816
58580
|
}
|
|
57817
|
-
reports.set(target, { target, status: applying ? "succeeded" : "planned", planFile, pending: manifest.pending, warnings: manifest.warnings });
|
|
58581
|
+
reports.set(target, { target, status: applying ? "succeeded" : "planned", planFile, pending: manifest.pending, warnings: manifest.warnings, ...rendered.has(target) ? { rendered: true } : {} });
|
|
57818
58582
|
if (events)
|
|
57819
58583
|
events.end(target, "deploy", { kind: "succeeded", durationMs: ports.clock.now() - began });
|
|
57820
58584
|
} catch (error) {
|
|
@@ -58183,6 +58947,8 @@ async function devopsDeployTofu(flags, ports) {
|
|
|
58183
58947
|
out: ports.stdout
|
|
58184
58948
|
});
|
|
58185
58949
|
ports.emit({ kind: "object", data: result.summary });
|
|
58950
|
+
for (const line of failureDigest(result.summary))
|
|
58951
|
+
ports.stdout(line);
|
|
58186
58952
|
return result.exitCode;
|
|
58187
58953
|
}
|
|
58188
58954
|
|
|
@@ -58919,7 +59685,7 @@ function pathLineBounds(geometry) {
|
|
|
58919
59685
|
}
|
|
58920
59686
|
if (command === null)
|
|
58921
59687
|
return null;
|
|
58922
|
-
const
|
|
59688
|
+
const relative2 = command === command.toLowerCase();
|
|
58923
59689
|
const upper = command.toUpperCase();
|
|
58924
59690
|
if (upper === "H" || upper === "V") {
|
|
58925
59691
|
const value = tokens[i];
|
|
@@ -58927,9 +59693,9 @@ function pathLineBounds(geometry) {
|
|
|
58927
59693
|
return null;
|
|
58928
59694
|
i++;
|
|
58929
59695
|
if (upper === "H")
|
|
58930
|
-
x =
|
|
59696
|
+
x = relative2 ? x + value : value;
|
|
58931
59697
|
else
|
|
58932
|
-
y =
|
|
59698
|
+
y = relative2 ? y + value : value;
|
|
58933
59699
|
add(x, y);
|
|
58934
59700
|
continue;
|
|
58935
59701
|
}
|
|
@@ -58937,8 +59703,8 @@ function pathLineBounds(geometry) {
|
|
|
58937
59703
|
if (typeof nx !== "number" || typeof ny !== "number")
|
|
58938
59704
|
return null;
|
|
58939
59705
|
i += 2;
|
|
58940
|
-
x =
|
|
58941
|
-
y =
|
|
59706
|
+
x = relative2 ? x + nx : nx;
|
|
59707
|
+
y = relative2 ? y + ny : ny;
|
|
58942
59708
|
if (upper === "M") {
|
|
58943
59709
|
startX = x;
|
|
58944
59710
|
startY = y;
|
|
@@ -60848,7 +61614,7 @@ function timestamp(key, value) {
|
|
|
60848
61614
|
const time = typeof value === "number" ? Math.abs(value) < 100000000000 ? value * 1000 : value : typeof value === "string" && /^\d{4}-\d\d-\d\d[T ]/.test(value) ? Date.parse(value) : NaN;
|
|
60849
61615
|
return Number.isFinite(time) ? new Date(time).toISOString() : undefined;
|
|
60850
61616
|
}
|
|
60851
|
-
function
|
|
61617
|
+
function relative2(iso, now) {
|
|
60852
61618
|
const delta = now - Date.parse(iso), seconds = Math.floor(Math.abs(delta) / 1000);
|
|
60853
61619
|
if (Math.abs(delta) < 60000)
|
|
60854
61620
|
return "just now";
|
|
@@ -60987,7 +61753,7 @@ function table(items, ctx, paint) {
|
|
|
60987
61753
|
const now = ctx.now ?? Date.now();
|
|
60988
61754
|
let rows = items.map((item) => columns.map((key) => {
|
|
60989
61755
|
const v = record(item)[key], iso = timestamp(key, v);
|
|
60990
|
-
return plain(iso ?
|
|
61756
|
+
return plain(iso ? relative2(iso, now) : scalar(v));
|
|
60991
61757
|
}));
|
|
60992
61758
|
let headers = columns.map((key) => key.toUpperCase());
|
|
60993
61759
|
let sizes = columns.map((_, i) => Math.max(width(headers[i]), ...rows.map((row) => width(row[i]))));
|
|
@@ -61027,7 +61793,7 @@ function objectView(data, resource, id, ctx, paint) {
|
|
|
61027
61793
|
function value(key, v, depth) {
|
|
61028
61794
|
const iso = timestamp(key, v);
|
|
61029
61795
|
if (iso)
|
|
61030
|
-
return `${iso} (${
|
|
61796
|
+
return `${iso} (${relative2(iso, now)})`;
|
|
61031
61797
|
if (Array.isArray(v)) {
|
|
61032
61798
|
if (v.every((x) => x === null || typeof x !== "object"))
|
|
61033
61799
|
return v.map(scalar).map(plain).join(", ");
|
|
@@ -61407,7 +62173,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
|
|
|
61407
62173
|
}
|
|
61408
62174
|
|
|
61409
62175
|
// src/main.ts
|
|
61410
|
-
var version = "0.3.0-dev.
|
|
62176
|
+
var version = "0.3.0-dev.12045a7";
|
|
61411
62177
|
var commands = commandTree(operations);
|
|
61412
62178
|
var manual = [...workflows.map((w) => w.words), [API_WORD]];
|
|
61413
62179
|
function route(argv) {
|