primitive-admin 1.2.0-alpha.9 → 1.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +258 -186
- package/assets/skill/skills/primitive-platform/SKILL.md +93 -27
- package/dist/bin/primitive.js +15 -89
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.js +80 -17
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/agent-sessions.d.ts +129 -0
- package/dist/src/commands/agent-sessions.js +532 -20
- package/dist/src/commands/agent-sessions.js.map +1 -1
- package/dist/src/commands/analytics.js +207 -155
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps-children.js +3 -0
- package/dist/src/commands/apps-children.js.map +1 -1
- package/dist/src/commands/apps-transitions.d.ts +39 -0
- package/dist/src/commands/apps-transitions.js +198 -0
- package/dist/src/commands/apps-transitions.js.map +1 -0
- package/dist/src/commands/apps.d.ts +17 -0
- package/dist/src/commands/apps.js +108 -3
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.js +2 -0
- package/dist/src/commands/auth-sessions.js.map +1 -1
- package/dist/src/commands/auth.js +138 -44
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +2 -0
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/collections.js +318 -256
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/comparisons.js +2 -0
- package/dist/src/commands/comparisons.js.map +1 -1
- package/dist/src/commands/config.d.ts +2 -2
- package/dist/src/commands/config.js +59 -33
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/connections.js +2 -0
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +5 -3
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.js +6 -4
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/db3-types.d.ts +15 -0
- package/dist/src/commands/db3-types.js +159 -0
- package/dist/src/commands/db3-types.js.map +1 -0
- package/dist/src/commands/db3.d.ts +24 -0
- package/dist/src/commands/db3.js +1444 -0
- package/dist/src/commands/db3.js.map +1 -0
- package/dist/src/commands/documents.d.ts +110 -10
- package/dist/src/commands/documents.js +1012 -748
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +74 -0
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.js +8 -4
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/function-trigger-commands.d.ts +28 -0
- package/dist/src/commands/function-trigger-commands.js +341 -0
- package/dist/src/commands/function-trigger-commands.js.map +1 -0
- package/dist/src/commands/functions.js +376 -30
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/groups.js +168 -50
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +7 -5
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/hosting.d.ts +8 -0
- package/dist/src/commands/hosting.js +346 -0
- package/dist/src/commands/hosting.js.map +1 -0
- package/dist/src/commands/init.js +129 -38
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +82 -53
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/locks.d.ts +5 -3
- package/dist/src/commands/locks.js +19 -61
- package/dist/src/commands/locks.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.d.ts +2 -2
- package/dist/src/commands/metadata-category-configs.js +4 -2
- package/dist/src/commands/metadata-category-configs.js.map +1 -1
- package/dist/src/commands/metadata.js +41 -0
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +75 -52
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rate-counters.d.ts +19 -0
- package/dist/src/commands/rate-counters.js +104 -0
- package/dist/src/commands/rate-counters.js.map +1 -0
- package/dist/src/commands/rule-sets.d.ts +1 -1
- package/dist/src/commands/rule-sets.js +2 -1
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/schemas.d.ts +15 -0
- package/dist/src/commands/schemas.js +122 -0
- package/dist/src/commands/schemas.js.map +1 -0
- package/dist/src/commands/scripts.d.ts +9 -17
- package/dist/src/commands/scripts.js +24 -479
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/secrets.js +47 -3
- package/dist/src/commands/secrets.js.map +1 -1
- package/dist/src/commands/sessions.js +2 -0
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/skill.js +2 -0
- package/dist/src/commands/skill.js.map +1 -1
- package/dist/src/commands/sync-schemas.d.ts +202 -0
- package/dist/src/commands/sync-schemas.js +629 -0
- package/dist/src/commands/sync-schemas.js.map +1 -0
- package/dist/src/commands/sync-user-properties.d.ts +118 -0
- package/dist/src/commands/sync-user-properties.js +276 -0
- package/dist/src/commands/sync-user-properties.js.map +1 -0
- package/dist/src/commands/sync.d.ts +518 -546
- package/dist/src/commands/sync.js +3010 -4877
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +5 -3
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/transitions.d.ts +54 -0
- package/dist/src/commands/transitions.js +418 -0
- package/dist/src/commands/transitions.js.map +1 -0
- package/dist/src/commands/usage.d.ts +18 -0
- package/dist/src/commands/usage.js +343 -0
- package/dist/src/commands/usage.js.map +1 -0
- package/dist/src/commands/user-properties.d.ts +14 -0
- package/dist/src/commands/user-properties.js +79 -0
- package/dist/src/commands/user-properties.js.map +1 -0
- package/dist/src/commands/users.js +911 -18
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +2 -0
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/waitlist.js +39 -4
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/workflows.d.ts +5 -83
- package/dist/src/commands/workflows.js +57 -2282
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/analytics-query.d.ts +58 -0
- package/dist/src/lib/analytics-query.js +134 -0
- package/dist/src/lib/analytics-query.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +1818 -438
- package/dist/src/lib/api-client.js +965 -544
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +1 -1
- package/dist/src/lib/app-settings-descriptor.js +6 -0
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/auth-fixtures.d.ts +44 -0
- package/dist/src/lib/auth-fixtures.js +61 -0
- package/dist/src/lib/auth-fixtures.js.map +1 -0
- package/dist/src/lib/auth-flow.d.ts +34 -1
- package/dist/src/lib/auth-flow.js +429 -13
- package/dist/src/lib/auth-flow.js.map +1 -1
- package/dist/src/lib/block-layout.d.ts +12 -23
- package/dist/src/lib/block-layout.js +26 -92
- package/dist/src/lib/block-layout.js.map +1 -1
- package/dist/src/lib/block-selector.d.ts +8 -14
- package/dist/src/lib/block-selector.js +8 -19
- package/dist/src/lib/block-selector.js.map +1 -1
- package/dist/src/lib/child-apps-local.d.ts +3 -1
- package/dist/src/lib/child-apps-local.js +9 -1
- package/dist/src/lib/child-apps-local.js.map +1 -1
- package/dist/src/lib/cli-manifest.d.ts +9 -0
- package/dist/src/lib/cli-manifest.js +10 -1
- package/dist/src/lib/cli-manifest.js.map +1 -1
- package/dist/src/lib/cli-version.d.ts +14 -0
- package/dist/src/lib/cli-version.js +38 -0
- package/dist/src/lib/cli-version.js.map +1 -0
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +41 -0
- package/dist/src/lib/codegen-shared/prettierStable.js +146 -24
- package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -1
- package/dist/src/lib/collection-export.d.ts +76 -15
- package/dist/src/lib/collection-export.js +116 -23
- package/dist/src/lib/collection-export.js.map +1 -1
- package/dist/src/lib/collection-principal.d.ts +22 -0
- package/dist/src/lib/collection-principal.js +35 -0
- package/dist/src/lib/collection-principal.js.map +1 -0
- package/dist/src/lib/command-groups.d.ts +30 -0
- package/dist/src/lib/command-groups.js +109 -0
- package/dist/src/lib/command-groups.js.map +1 -0
- package/dist/src/lib/command-status.d.ts +147 -0
- package/dist/src/lib/command-status.js +266 -0
- package/dist/src/lib/command-status.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +9 -22
- package/dist/src/lib/config-object-descriptor.js +107 -276
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +3 -7
- package/dist/src/lib/config-surface.js +9 -13
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/config-toml.d.ts +11 -2
- package/dist/src/lib/config-toml.js +25 -2
- package/dist/src/lib/config-toml.js.map +1 -1
- package/dist/src/lib/credentials-home.d.ts +7 -0
- package/dist/src/lib/credentials-home.js +45 -10
- package/dist/src/lib/credentials-home.js.map +1 -1
- package/dist/src/lib/credentials-lock.d.ts +14 -6
- package/dist/src/lib/credentials-lock.js +90 -10
- package/dist/src/lib/credentials-lock.js.map +1 -1
- package/dist/src/lib/credentials-store.d.ts +123 -70
- package/dist/src/lib/credentials-store.js +358 -113
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/custodian.d.ts +8 -0
- package/dist/src/lib/custodian.js +18 -0
- package/dist/src/lib/custodian.js.map +1 -0
- package/dist/src/lib/data-input.d.ts +1 -1
- package/dist/src/lib/data-input.js +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.js +3 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +38 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js +29 -7
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/db-type-records.d.ts +106 -0
- package/dist/src/lib/db-type-records.js +224 -0
- package/dist/src/lib/db-type-records.js.map +1 -0
- package/dist/src/lib/db3-export.d.ts +287 -0
- package/dist/src/lib/db3-export.js +647 -0
- package/dist/src/lib/db3-export.js.map +1 -0
- package/dist/src/lib/db3-index-output.d.ts +116 -0
- package/dist/src/lib/db3-index-output.js +223 -0
- package/dist/src/lib/db3-index-output.js.map +1 -0
- package/dist/src/lib/db3-type-models.d.ts +134 -0
- package/dist/src/lib/db3-type-models.js +452 -0
- package/dist/src/lib/db3-type-models.js.map +1 -0
- package/dist/src/lib/deprecation.d.ts +2 -2
- package/dist/src/lib/deprecation.js +2 -2
- package/dist/src/lib/document-ingest-artifact.d.ts +13 -0
- package/dist/src/lib/document-ingest-artifact.js +36 -6
- package/dist/src/lib/document-ingest-artifact.js.map +1 -1
- package/dist/src/lib/document-ingest-format2.d.ts +36 -0
- package/dist/src/lib/document-ingest-format2.js +78 -0
- package/dist/src/lib/document-ingest-format2.js.map +1 -0
- package/dist/src/lib/document-ingest-input.d.ts +9 -0
- package/dist/src/lib/document-ingest-input.js +28 -1
- package/dist/src/lib/document-ingest-input.js.map +1 -1
- package/dist/src/lib/document-ingest.d.ts +11 -1
- package/dist/src/lib/document-ingest.js +16 -0
- package/dist/src/lib/document-ingest.js.map +1 -1
- package/dist/src/lib/document-schema-rows.d.ts +42 -0
- package/dist/src/lib/document-schema-rows.js +53 -0
- package/dist/src/lib/document-schema-rows.js.map +1 -0
- package/dist/src/lib/experimental-apis.d.ts +36 -0
- package/dist/src/lib/experimental-apis.js +46 -0
- package/dist/src/lib/experimental-apis.js.map +1 -0
- package/dist/src/lib/file-attachment.d.ts +24 -0
- package/dist/src/lib/file-attachment.js +31 -0
- package/dist/src/lib/file-attachment.js.map +1 -0
- package/dist/src/lib/function-authorize-check.d.ts +142 -0
- package/dist/src/lib/function-authorize-check.js +311 -0
- package/dist/src/lib/function-authorize-check.js.map +1 -0
- package/dist/src/lib/function-authorize-view.d.ts +27 -0
- package/dist/src/lib/function-authorize-view.js +88 -0
- package/dist/src/lib/function-authorize-view.js.map +1 -0
- package/dist/src/lib/function-bundle.d.ts +27 -5
- package/dist/src/lib/function-bundle.js +142 -7
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +90 -12
- package/dist/src/lib/function-collect.js +482 -12
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +65 -11
- package/dist/src/lib/function-db-types.js +297 -157
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-document-types.d.ts +19 -7
- package/dist/src/lib/function-document-types.js +24 -12
- package/dist/src/lib/function-document-types.js.map +1 -1
- package/dist/src/lib/function-lint.d.ts +57 -0
- package/dist/src/lib/function-lint.js +234 -0
- package/dist/src/lib/function-lint.js.map +1 -0
- package/dist/src/lib/function-log-row.js +21 -2
- package/dist/src/lib/function-log-row.js.map +1 -1
- package/dist/src/lib/function-run.d.ts +13 -21
- package/dist/src/lib/function-run.js +14 -27
- package/dist/src/lib/function-run.js.map +1 -1
- package/dist/src/lib/function-schema-codegen.d.ts +86 -22
- package/dist/src/lib/function-schema-codegen.js +194 -88
- package/dist/src/lib/function-schema-codegen.js.map +1 -1
- package/dist/src/lib/function-schema-refs.d.ts +98 -0
- package/dist/src/lib/function-schema-refs.js +177 -0
- package/dist/src/lib/function-schema-refs.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +109 -6
- package/dist/src/lib/function-sync.js +179 -26
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-trigger-listing.d.ts +11 -6
- package/dist/src/lib/function-trigger-listing.js +32 -11
- package/dist/src/lib/function-trigger-listing.js.map +1 -1
- package/dist/src/lib/function-typecheck.d.ts +52 -0
- package/dist/src/lib/function-typecheck.js +174 -54
- package/dist/src/lib/function-typecheck.js.map +1 -1
- package/dist/src/lib/function-versions.d.ts +2 -0
- package/dist/src/lib/function-versions.js +1 -0
- package/dist/src/lib/function-versions.js.map +1 -1
- package/dist/src/lib/generated-build-flags.d.ts +13 -0
- package/dist/src/lib/generated-build-flags.js +14 -0
- package/dist/src/lib/generated-build-flags.js.map +1 -0
- package/dist/src/lib/generated-command-status.d.ts +6 -0
- package/dist/src/lib/generated-command-status.js +469 -0
- package/dist/src/lib/generated-command-status.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +538 -141
- package/dist/src/lib/generated-config-surfaces.js +1772 -1854
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/generated-sdk-types.d.ts +1 -1
- package/dist/src/lib/generated-sdk-types.js +1 -1
- package/dist/src/lib/generated-sdk-types.js.map +1 -1
- package/dist/src/lib/hosting-build.d.ts +97 -0
- package/dist/src/lib/hosting-build.js +204 -0
- package/dist/src/lib/hosting-build.js.map +1 -0
- package/dist/src/lib/hosting-client.d.ts +167 -0
- package/dist/src/lib/hosting-client.js +340 -0
- package/dist/src/lib/hosting-client.js.map +1 -0
- package/dist/src/lib/hosting-environments.d.ts +32 -0
- package/dist/src/lib/hosting-environments.js +74 -0
- package/dist/src/lib/hosting-environments.js.map +1 -0
- package/dist/src/lib/hosting-errors.d.ts +30 -0
- package/dist/src/lib/hosting-errors.js +43 -0
- package/dist/src/lib/hosting-errors.js.map +1 -0
- package/dist/src/lib/hosting-token.d.ts +46 -0
- package/dist/src/lib/hosting-token.js +60 -0
- package/dist/src/lib/hosting-token.js.map +1 -0
- package/dist/src/lib/hosting-wait.d.ts +42 -0
- package/dist/src/lib/hosting-wait.js +84 -0
- package/dist/src/lib/hosting-wait.js.map +1 -0
- package/dist/src/lib/hosting-wfp-upload.d.ts +86 -0
- package/dist/src/lib/hosting-wfp-upload.js +149 -0
- package/dist/src/lib/hosting-wfp-upload.js.map +1 -0
- package/dist/src/lib/init-assets.d.ts +2 -6
- package/dist/src/lib/init-assets.js +11 -27
- package/dist/src/lib/init-assets.js.map +1 -1
- package/dist/src/lib/init-ios-links.d.ts +11 -7
- package/dist/src/lib/init-ios-links.js +28 -22
- package/dist/src/lib/init-ios-links.js.map +1 -1
- package/dist/src/lib/init-login-note.d.ts +13 -0
- package/dist/src/lib/init-login-note.js +22 -0
- package/dist/src/lib/init-login-note.js.map +1 -0
- package/dist/src/lib/init-schema.d.ts +15 -0
- package/dist/src/lib/init-schema.js +54 -0
- package/dist/src/lib/init-schema.js.map +1 -1
- package/dist/src/lib/integration-test-request.d.ts +54 -0
- package/dist/src/lib/integration-test-request.js +207 -0
- package/dist/src/lib/integration-test-request.js.map +1 -0
- package/dist/src/lib/invoker-shared-enums.d.ts +35 -0
- package/dist/src/lib/invoker-shared-enums.js +98 -0
- package/dist/src/lib/invoker-shared-enums.js.map +1 -0
- package/dist/src/lib/json-value.d.ts +6 -0
- package/dist/src/lib/json-value.js +13 -0
- package/dist/src/lib/json-value.js.map +1 -0
- package/dist/src/lib/load-routes.d.ts +33 -0
- package/dist/src/lib/load-routes.js +35 -0
- package/dist/src/lib/load-routes.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +23 -4
- package/dist/src/lib/log-inspection.js +14 -5
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/login-exchange-check.d.ts +18 -0
- package/dist/src/lib/login-exchange-check.js +27 -0
- package/dist/src/lib/login-exchange-check.js.map +1 -0
- package/dist/src/lib/login-scope-lines.d.ts +17 -7
- package/dist/src/lib/login-scope-lines.js +33 -10
- package/dist/src/lib/login-scope-lines.js.map +1 -1
- package/dist/src/lib/metadata-report.d.ts +85 -0
- package/dist/src/lib/metadata-report.js +81 -0
- package/dist/src/lib/metadata-report.js.map +1 -0
- package/dist/src/lib/object-status-filter.d.ts +9 -1
- package/dist/src/lib/object-status-filter.js +9 -1
- package/dist/src/lib/object-status-filter.js.map +1 -1
- package/dist/src/lib/output.d.ts +1 -1
- package/dist/src/lib/output.js +3 -1
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/pin-refusal-hint.d.ts +12 -0
- package/dist/src/lib/pin-refusal-hint.js +35 -0
- package/dist/src/lib/pin-refusal-hint.js.map +1 -0
- package/dist/src/lib/platform-owned.js +5 -0
- package/dist/src/lib/platform-owned.js.map +1 -1
- package/dist/src/lib/primitive-declaration-names.d.ts +21 -0
- package/dist/src/lib/primitive-declaration-names.js +22 -0
- package/dist/src/lib/primitive-declaration-names.js.map +1 -0
- package/dist/src/lib/primitive-declaration.d.ts +174 -0
- package/dist/src/lib/primitive-declaration.js +792 -0
- package/dist/src/lib/primitive-declaration.js.map +1 -0
- package/dist/src/lib/primitive-env-plugin.d.ts +99 -0
- package/dist/src/lib/primitive-env-plugin.js +408 -0
- package/dist/src/lib/primitive-env-plugin.js.map +1 -0
- package/dist/src/lib/project-login-apps.d.ts +8 -0
- package/dist/src/lib/project-login-apps.js +27 -0
- package/dist/src/lib/project-login-apps.js.map +1 -0
- package/dist/src/lib/prompt-schema-codegen.d.ts +36 -12
- package/dist/src/lib/prompt-schema-codegen.js +96 -100
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
- package/dist/src/lib/prompt-schema-document.d.ts +35 -0
- package/dist/src/lib/prompt-schema-document.js +92 -0
- package/dist/src/lib/prompt-schema-document.js.map +1 -0
- package/dist/src/lib/prompt-schema-refs.d.ts +173 -0
- package/dist/src/lib/prompt-schema-refs.js +478 -0
- package/dist/src/lib/prompt-schema-refs.js.map +1 -0
- package/dist/src/lib/records-verbs.d.ts +79 -0
- package/dist/src/lib/records-verbs.js +45 -0
- package/dist/src/lib/records-verbs.js.map +1 -0
- package/dist/src/lib/register-commands.d.ts +36 -0
- package/dist/src/lib/register-commands.js +37 -0
- package/dist/src/lib/register-commands.js.map +1 -0
- package/dist/src/lib/retired-imports.d.ts +53 -0
- package/dist/src/lib/retired-imports.js +120 -0
- package/dist/src/lib/retired-imports.js.map +1 -0
- package/dist/src/lib/run-status.d.ts +1 -1
- package/dist/src/lib/run-status.generated.d.ts +2 -2
- package/dist/src/lib/run-status.generated.js +3 -1
- package/dist/src/lib/run-status.generated.js.map +1 -1
- package/dist/src/lib/run-status.js +1 -1
- package/dist/src/lib/schema-codegen/compiledSpace.d.ts +62 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js +103 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.d.ts +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js +227 -0
- package/dist/src/lib/schema-codegen/generated-db3-bridge.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.d.ts +85 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js +86 -0
- package/dist/src/lib/schema-codegen/generated-db3-query-capabilities.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.d.ts +218 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js +397 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-table.d.ts +80 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js +542 -0
- package/dist/src/lib/schema-codegen/generated-field-table.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.d.ts +195 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js +503 -0
- package/dist/src/lib/schema-codegen/generated-prompt-schemas.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.d.ts +258 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +422 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.d.ts +129 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js +475 -0
- package/dist/src/lib/schema-codegen/generated-schema-file.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.d.ts +115 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js +274 -0
- package/dist/src/lib/schema-codegen/generated-schema-provenance.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.d.ts +366 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js +1789 -0
- package/dist/src/lib/schema-codegen/generated-schema-refs.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.d.ts +27 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js +126 -0
- package/dist/src/lib/schema-codegen/generated-schema-shape.js.map +1 -0
- package/dist/src/lib/schema-codegen/namedRefs.d.ts +56 -0
- package/dist/src/lib/schema-codegen/namedRefs.js +143 -0
- package/dist/src/lib/schema-codegen/namedRefs.js.map +1 -0
- package/dist/src/lib/schema-codegen/naming.d.ts +35 -0
- package/dist/src/lib/schema-codegen/naming.js +83 -0
- package/dist/src/lib/schema-codegen/naming.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaChanges.d.ts +74 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js +277 -0
- package/dist/src/lib/schema-codegen/schemaChanges.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaDocs.d.ts +69 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js +219 -0
- package/dist/src/lib/schema-codegen/schemaDocs.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaIR.d.ts +158 -0
- package/dist/src/lib/schema-codegen/schemaIR.js +279 -0
- package/dist/src/lib/schema-codegen/schemaIR.js.map +1 -0
- package/dist/src/lib/schema-codegen/schemaToTs.d.ts +109 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js +269 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/schema-codegen/valuesLists.d.ts +48 -0
- package/dist/src/lib/schema-codegen/valuesLists.js +144 -0
- package/dist/src/lib/schema-codegen/valuesLists.js.map +1 -0
- package/dist/src/lib/schema-family-index.d.ts +228 -0
- package/dist/src/lib/schema-family-index.js +813 -0
- package/dist/src/lib/schema-family-index.js.map +1 -0
- package/dist/src/lib/schema-pins.d.ts +82 -0
- package/dist/src/lib/schema-pins.js +198 -0
- package/dist/src/lib/schema-pins.js.map +1 -0
- package/dist/src/lib/schema-preview.d.ts +244 -0
- package/dist/src/lib/schema-preview.js +498 -0
- package/dist/src/lib/schema-preview.js.map +1 -0
- package/dist/src/lib/scope-request.d.ts +23 -11
- package/dist/src/lib/scope-request.js +69 -31
- package/dist/src/lib/scope-request.js.map +1 -1
- package/dist/src/lib/session-scope.d.ts +26 -0
- package/dist/src/lib/session-scope.js +58 -0
- package/dist/src/lib/session-scope.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +2 -2
- package/dist/src/lib/skill-installer.js +2 -21
- package/dist/src/lib/skill-installer.js.map +1 -1
- package/dist/src/lib/step-run-table.d.ts +1 -2
- package/dist/src/lib/step-run-table.js +1 -2
- package/dist/src/lib/step-run-table.js.map +1 -1
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +2 -1
- package/dist/src/lib/swift-codegen/agentGenerator.js +25 -23
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/banners.d.ts +12 -0
- package/dist/src/lib/swift-codegen/banners.js +12 -0
- package/dist/src/lib/swift-codegen/banners.js.map +1 -1
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +36 -1
- package/dist/src/lib/swift-codegen/functionGenerator.js +169 -51
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +33 -9
- package/dist/src/lib/swift-codegen/schemaToSwift.js +215 -179
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
- package/dist/src/lib/swift-codegen/sharedGenerator.d.ts +45 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js +165 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/swiftKeys.d.ts +19 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js +31 -0
- package/dist/src/lib/swift-codegen/swiftKeys.js.map +1 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.d.ts +30 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js +69 -0
- package/dist/src/lib/swift-codegen/userPropertiesGenerator.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +117 -31
- package/dist/src/lib/sync-resource-types.js +197 -189
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +7 -0
- package/dist/src/lib/sync-selectors.js +22 -2
- package/dist/src/lib/sync-selectors.js.map +1 -1
- package/dist/src/lib/template.d.ts +39 -3
- package/dist/src/lib/template.js +103 -14
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/lib/test-case-file-names.d.ts +3 -5
- package/dist/src/lib/test-case-file-names.js +3 -5
- package/dist/src/lib/test-case-file-names.js.map +1 -1
- package/dist/src/lib/test-runs.d.ts +45 -0
- package/dist/src/lib/test-runs.js +150 -0
- package/dist/src/lib/test-runs.js.map +1 -0
- package/dist/src/lib/test-users.d.ts +25 -0
- package/dist/src/lib/test-users.js +36 -0
- package/dist/src/lib/test-users.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +4 -2
- package/dist/src/lib/toml-database-config.js +11 -6
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/toml-scalar-edit.js +6 -4
- package/dist/src/lib/toml-scalar-edit.js.map +1 -1
- package/dist/src/lib/transition-warnings.d.ts +21 -0
- package/dist/src/lib/transition-warnings.js +49 -0
- package/dist/src/lib/transition-warnings.js.map +1 -0
- package/dist/src/lib/user-index.d.ts +80 -0
- package/dist/src/lib/user-index.js +166 -0
- package/dist/src/lib/user-index.js.map +1 -0
- package/dist/src/lib/user-properties/generated-properties-schema.d.ts +159 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js +471 -0
- package/dist/src/lib/user-properties/generated-properties-schema.js.map +1 -0
- package/dist/src/lib/user-properties/user-properties-codegen.d.ts +55 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js +129 -0
- package/dist/src/lib/user-properties/user-properties-codegen.js.map +1 -0
- package/dist/src/lib/user-walk.d.ts +31 -0
- package/dist/src/lib/user-walk.js +102 -0
- package/dist/src/lib/user-walk.js.map +1 -0
- package/dist/src/lib/webhook-capture.d.ts +43 -0
- package/dist/src/lib/webhook-capture.js +91 -0
- package/dist/src/lib/webhook-capture.js.map +1 -0
- package/dist/src/lib/webhook-deliver.d.ts +18 -20
- package/dist/src/lib/webhook-deliver.js +34 -89
- package/dist/src/lib/webhook-deliver.js.map +1 -1
- package/dist/src/lib/webhook-test-run.d.ts +32 -0
- package/dist/src/lib/webhook-test-run.js +108 -0
- package/dist/src/lib/webhook-test-run.js.map +1 -0
- package/dist/src/lib/worker-perf-format.d.ts +22 -0
- package/dist/src/lib/worker-perf-format.js +27 -0
- package/dist/src/lib/worker-perf-format.js.map +1 -0
- package/dist/src/types/index.d.ts +20 -65
- package/dist/src/validators.d.ts +7 -55
- package/dist/src/validators.js +7 -53
- package/dist/src/validators.js.map +1 -1
- package/dist/src/vite.d.ts +17 -0
- package/dist/src/vite.js +18 -0
- package/dist/src/vite.js.map +1 -0
- package/package.json +20 -9
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { commandStatus } from "../lib/command-status.js";
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
import { readFileSync, writeFileSync } from "fs";
|
|
4
|
+
import { basename, resolve as resolvePath } from "path";
|
|
5
|
+
import { lookup as mimeLookup } from "mime-types";
|
|
6
|
+
import { ulid } from "ulid";
|
|
1
7
|
import { ApiClient } from "../lib/api-client.js";
|
|
2
8
|
import { resolveAppId } from "../lib/config.js";
|
|
3
|
-
import { error, formatDate, formatTable, info, json, result, success, } from "../lib/output.js";
|
|
9
|
+
import { error, formatDate, formatDuration, formatTable, info, json, keyValue, result, success, } from "../lib/output.js";
|
|
4
10
|
import { confirmPrompt } from "../lib/confirm-prompt.js";
|
|
5
11
|
import { pageCursorOption, pageLimitOption, parsePageLimit, printEmptyPage, printPageHint, } from "../lib/list-options.js";
|
|
6
12
|
import { normalizeCliListEnvelope } from "../lib/paginate.js";
|
|
@@ -9,10 +15,13 @@ import { describeRecordsFailure } from "./documents.js";
|
|
|
9
15
|
* `primitive agent-sessions` — inspect and delete agent sessions (#3809,
|
|
10
16
|
* design-docs/agents.md §D7). A data noun: `list` one user's sessions, `get`
|
|
11
17
|
* one session's binding, status, active turn and — for app owners and admins —
|
|
12
|
-
* the session object's state, and `delete` a session with
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
18
|
+
* the session object's state (`inspect` is `get`), and `delete` a session with
|
|
19
|
+
* everything it holds. `transcript`, `steps` and `artifacts` read the
|
|
20
|
+
* conversation's rows from the session's db3, whose id is the session's
|
|
21
|
+
* (#4883), and `upload` and `download` move a session's files (#4589). The
|
|
22
|
+
* rows never hold the system prompt or a turn's context, so those stay
|
|
23
|
+
* visible only through `get` to app owners and admins. `primitive sessions`
|
|
24
|
+
* is sign-in sessions.
|
|
16
25
|
*/
|
|
17
26
|
/** The `object` keys `get` prints as sections; any other key is printed as JSON. */
|
|
18
27
|
const OBJECT_SECTIONS = new Set([
|
|
@@ -27,12 +36,19 @@ const OBJECT_SECTIONS = new Set([
|
|
|
27
36
|
"calls",
|
|
28
37
|
]);
|
|
29
38
|
const ROWS_NOTE = `
|
|
30
|
-
The conversation itself (messages, parts, steps) lives in
|
|
31
|
-
|
|
32
|
-
$ primitive
|
|
33
|
-
$ primitive
|
|
34
|
-
$ primitive
|
|
35
|
-
|
|
39
|
+
The conversation itself (messages, parts, tool calls, steps, turns) lives in
|
|
40
|
+
the session's db3, whose id is the session's. Read it with:
|
|
41
|
+
$ primitive agent-sessions transcript <session-id>
|
|
42
|
+
$ primitive agent-sessions steps <session-id>
|
|
43
|
+
$ primitive agent-sessions artifacts <session-id>
|
|
44
|
+
or as raw rows of its models (Session, Member, Turn, Message, Part, ToolCall,
|
|
45
|
+
Step):
|
|
46
|
+
$ primitive db3 records query <session-id> Message
|
|
47
|
+
$ primitive db3 records query <session-id> ToolCall
|
|
48
|
+
`;
|
|
49
|
+
/** Who `transcript`, `steps` and `artifacts` answer: the session db3's readers. */
|
|
50
|
+
const READERS_NOTE = `The rows are read from the session's db3: every member of the session reads
|
|
51
|
+
them, and so do the app's owners and admins and a console admin of the app.
|
|
36
52
|
`;
|
|
37
53
|
const list = (values) => Array.isArray(values) && values.length > 0 ? values.map(String).join(", ") : "-";
|
|
38
54
|
/**
|
|
@@ -42,7 +58,7 @@ const list = (values) => Array.isArray(values) && values.length > 0 ? values.map
|
|
|
42
58
|
*/
|
|
43
59
|
export async function deleteAgentSessionAction(options, deps) {
|
|
44
60
|
if (!options.yes) {
|
|
45
|
-
const ok = await deps.confirm(`Delete agent session ${options.sessionId}
|
|
61
|
+
const ok = await deps.confirm(`Delete agent session ${options.sessionId} with its conversation and files? This cannot be undone.`);
|
|
46
62
|
if (!ok)
|
|
47
63
|
return "cancelled";
|
|
48
64
|
}
|
|
@@ -132,24 +148,309 @@ function printObject(object) {
|
|
|
132
148
|
console.log(JSON.stringify(value, null, 2));
|
|
133
149
|
}
|
|
134
150
|
}
|
|
151
|
+
/** A part's and a tool call's JSON columns: stored as text, printed as the values they hold. */
|
|
152
|
+
const PART_JSON_COLUMNS = ["input", "output", "artifact", "providerMetadata", "data"];
|
|
153
|
+
/** A step's JSON columns. */
|
|
154
|
+
const STEP_JSON_COLUMNS = ["historySelection"];
|
|
155
|
+
/** At most this many message ids in one parts filter: the records route's `$in` cap. */
|
|
156
|
+
export const PARTS_BATCH_SIZE = 1000;
|
|
157
|
+
/**
|
|
158
|
+
* At most this many bytes of encoded filter in one parts request. The filter
|
|
159
|
+
* rides in the query string and Cloudflare refuses a URL over 16 KB, so this
|
|
160
|
+
* leaves room for the path, the sort, the limit and a continuation cursor.
|
|
161
|
+
*/
|
|
162
|
+
export const PARTS_FILTER_MAX_BYTES = 8 * 1024;
|
|
163
|
+
/** Parts asked for per request: the records route's maximum `limit`. */
|
|
164
|
+
const PARTS_PAGE_LIMIT = 10_000;
|
|
165
|
+
/** The most parts requests one transcript page makes before it fails. */
|
|
166
|
+
export const MAX_PARTS_REQUESTS = 64;
|
|
167
|
+
/**
|
|
168
|
+
* A session row with its JSON columns decoded from their stored text. A
|
|
169
|
+
* column whose text is not JSON is left as that text.
|
|
170
|
+
*/
|
|
171
|
+
export function decodeSessionRow(row, columns = PART_JSON_COLUMNS) {
|
|
172
|
+
const decoded = { ...row };
|
|
173
|
+
for (const column of columns) {
|
|
174
|
+
const text = decoded[column];
|
|
175
|
+
if (typeof text !== "string")
|
|
176
|
+
continue;
|
|
177
|
+
try {
|
|
178
|
+
decoded[column] = JSON.parse(text);
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
// Not JSON: kept as it came.
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return decoded;
|
|
185
|
+
}
|
|
186
|
+
/** A text's length once encoded into the query string, as the api client sends it. */
|
|
187
|
+
const queryBytes = (text) => new URLSearchParams({ q: text }).toString().length - "q=".length;
|
|
188
|
+
/** The parts filter around its ids, `{"messageId":{"$in":[]}}`, encoded. */
|
|
189
|
+
const PARTS_FILTER_FRAME_BYTES = queryBytes(JSON.stringify({ messageId: { $in: [] } }));
|
|
190
|
+
const ID_SEPARATOR_BYTES = queryBytes(",");
|
|
191
|
+
/**
|
|
192
|
+
* Message ids in order, in batches one parts filter can carry: at most
|
|
193
|
+
* `maxIds` ids (the `$in` cap) and at most `maxFilterBytes` of encoded filter
|
|
194
|
+
* (the URL budget). An id too long for the budget alone gets a batch of its own.
|
|
195
|
+
*/
|
|
196
|
+
export function batchMessageIds(ids, { maxIds = PARTS_BATCH_SIZE, maxFilterBytes = PARTS_FILTER_MAX_BYTES } = {}) {
|
|
197
|
+
const batches = [];
|
|
198
|
+
let batch = [];
|
|
199
|
+
let bytes = PARTS_FILTER_FRAME_BYTES;
|
|
200
|
+
for (const id of ids) {
|
|
201
|
+
const idBytes = queryBytes(JSON.stringify(id));
|
|
202
|
+
if (batch.length > 0 && (batch.length >= maxIds || bytes + ID_SEPARATOR_BYTES + idBytes > maxFilterBytes)) {
|
|
203
|
+
batches.push(batch);
|
|
204
|
+
batch = [];
|
|
205
|
+
bytes = PARTS_FILTER_FRAME_BYTES;
|
|
206
|
+
}
|
|
207
|
+
bytes += (batch.length > 0 ? ID_SEPARATOR_BYTES : 0) + idBytes;
|
|
208
|
+
batch.push(id);
|
|
209
|
+
}
|
|
210
|
+
if (batch.length > 0)
|
|
211
|
+
batches.push(batch);
|
|
212
|
+
return batches;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The page's messages in their order, each with a `parts` array of its parts
|
|
216
|
+
* — its `Part` rows and its `ToolCall` rows, a call as `kind: "tool_call"` —
|
|
217
|
+
* by `seq`, whatever order they arrived in.
|
|
218
|
+
*/
|
|
219
|
+
export function joinTranscriptPage(messages, parts) {
|
|
220
|
+
const byMessage = new Map();
|
|
221
|
+
for (const part of parts) {
|
|
222
|
+
const own = byMessage.get(part.messageId);
|
|
223
|
+
if (own)
|
|
224
|
+
own.push(part);
|
|
225
|
+
else
|
|
226
|
+
byMessage.set(part.messageId, [part]);
|
|
227
|
+
}
|
|
228
|
+
return messages.map((message) => ({
|
|
229
|
+
...message,
|
|
230
|
+
parts: [...(byMessage.get(message.id) ?? [])].sort((a, b) => Number(a.seq) - Number(b.seq)),
|
|
231
|
+
}));
|
|
232
|
+
}
|
|
233
|
+
/** Where a tool call's artifact lives: on a blob, inline on the row, or nowhere. */
|
|
234
|
+
export function artifactOf(part) {
|
|
235
|
+
if (typeof part.artifactBlobId === "string" && part.artifactBlobId) {
|
|
236
|
+
return { kind: "blob", blobId: part.artifactBlobId };
|
|
237
|
+
}
|
|
238
|
+
if (part.artifact !== undefined && part.artifact !== null)
|
|
239
|
+
return { kind: "inline", value: part.artifact };
|
|
240
|
+
return { kind: "none" };
|
|
241
|
+
}
|
|
242
|
+
function artifactLabel(part) {
|
|
243
|
+
const artifact = artifactOf(part);
|
|
244
|
+
return artifact.kind === "blob" ? `blob ${artifact.blobId}` : artifact.kind === "inline" ? "inline" : "-";
|
|
245
|
+
}
|
|
246
|
+
/** A decoded value on one line: text as it is, anything else as compact JSON. */
|
|
247
|
+
const compact = (value) => (typeof value === "string" ? value : JSON.stringify(value));
|
|
248
|
+
const present = (value) => value !== undefined && value !== null && value !== "";
|
|
249
|
+
function formatPart(part) {
|
|
250
|
+
switch (part.kind) {
|
|
251
|
+
case "text":
|
|
252
|
+
case "reasoning":
|
|
253
|
+
return [` [${part.kind}] ${String(part.text ?? "").replace(/\n/g, "\n ")}`];
|
|
254
|
+
case "tool_call": {
|
|
255
|
+
const lines = [` [tool_call] ${part.toolName} (${part.id}) ${part.state}`];
|
|
256
|
+
if (present(part.input))
|
|
257
|
+
lines.push(` input: ${compact(part.input)}`);
|
|
258
|
+
if (present(part.output))
|
|
259
|
+
lines.push(` output: ${compact(part.output)}`);
|
|
260
|
+
if (artifactOf(part).kind !== "none")
|
|
261
|
+
lines.push(` artifact: ${artifactLabel(part)}`);
|
|
262
|
+
if (present(part.errorCode) || present(part.errorText)) {
|
|
263
|
+
lines.push(` error: ${[part.errorCode, part.errorText].filter(present).join(" ")}`);
|
|
264
|
+
}
|
|
265
|
+
return lines;
|
|
266
|
+
}
|
|
267
|
+
case "file":
|
|
268
|
+
return [` [file] ${part.filename} ${part.mediaType} ${part.sizeBytes} bytes blob ${part.blobId}`];
|
|
269
|
+
case "event":
|
|
270
|
+
return [` [event] ${part.eventKind}${present(part.data) ? ` ${compact(part.data)}` : ""}`];
|
|
271
|
+
default:
|
|
272
|
+
// A kind this CLI does not know yet, as it came.
|
|
273
|
+
return [` [${part.kind}] ${JSON.stringify(part)}`];
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/** One transcript message as `transcript` prints it: a header, then a line per part. */
|
|
277
|
+
export function formatTranscriptMessage(message) {
|
|
278
|
+
const header = [
|
|
279
|
+
`#${message.seq}`,
|
|
280
|
+
message.authorKind,
|
|
281
|
+
message.authorUserId,
|
|
282
|
+
formatDate(message.createdAt),
|
|
283
|
+
message.turnId ? `turn ${message.turnId}` : undefined,
|
|
284
|
+
]
|
|
285
|
+
.filter(present)
|
|
286
|
+
.join(" ");
|
|
287
|
+
return [header, ...(Array.isArray(message.parts) ? message.parts : []).flatMap(formatPart)];
|
|
288
|
+
}
|
|
289
|
+
/** A `ToolCall` row as one of its message's parts: `kind: "tool_call"`, its JSON columns decoded. */
|
|
290
|
+
const callPart = (row) => ({ ...decodeSessionRow(row), kind: "tool_call" });
|
|
291
|
+
function envelopeOf(page, items) {
|
|
292
|
+
return { items, hasMore: page.hasMore, ...(page.nextCursor ? { nextCursor: page.nextCursor } : {}) };
|
|
293
|
+
}
|
|
294
|
+
/** Every row of `model` whose `messageId` is one of `ids`, in batches each followed through its cursor. */
|
|
295
|
+
async function rowsOfMessages(client, options, model, ids, budget) {
|
|
296
|
+
const rows = [];
|
|
297
|
+
for (const batch of batchMessageIds(ids)) {
|
|
298
|
+
let cursor;
|
|
299
|
+
do {
|
|
300
|
+
if (budget.requests >= MAX_PARTS_REQUESTS) {
|
|
301
|
+
throw new Error(`Transcript page too large to assemble (${ids.length} messages, more than ${MAX_PARTS_REQUESTS} parts requests); use a smaller --limit.`);
|
|
302
|
+
}
|
|
303
|
+
budget.requests++;
|
|
304
|
+
const answer = await client.queryDb3Records(options.appId, options.sessionId, model, {
|
|
305
|
+
filter: { messageId: { $in: batch } },
|
|
306
|
+
sort: { seq: 1 },
|
|
307
|
+
limit: PARTS_PAGE_LIMIT,
|
|
308
|
+
cursor,
|
|
309
|
+
});
|
|
310
|
+
rows.push(...answer.items);
|
|
311
|
+
cursor = answer.hasMore ? answer.nextCursor : undefined;
|
|
312
|
+
} while (cursor);
|
|
313
|
+
}
|
|
314
|
+
return rows;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* One page of a session's conversation, oldest first: the `Message` rows of
|
|
318
|
+
* the session's db3 by `seq`, each with every one of its `Part` and
|
|
319
|
+
* `ToolCall` rows. Those are read in batches of message ids, each followed
|
|
320
|
+
* through its cursor, so a printed message is never missing a part; a page
|
|
321
|
+
* that needs more than `MAX_PARTS_REQUESTS` requests fails instead.
|
|
322
|
+
*/
|
|
323
|
+
export async function transcriptAction(options, client) {
|
|
324
|
+
const page = await client.queryDb3Records(options.appId, options.sessionId, "Message", {
|
|
325
|
+
...(options.turnId ? { filter: { turnId: options.turnId } } : {}),
|
|
326
|
+
sort: { seq: 1 },
|
|
327
|
+
limit: options.limit,
|
|
328
|
+
cursor: options.cursor,
|
|
329
|
+
});
|
|
330
|
+
const ids = page.items.map((message) => message.id);
|
|
331
|
+
const budget = { requests: 0 };
|
|
332
|
+
const parts = (await rowsOfMessages(client, options, "Part", ids, budget)).map((part) => decodeSessionRow(part));
|
|
333
|
+
const calls = (await rowsOfMessages(client, options, "ToolCall", ids, budget)).map(callPart);
|
|
334
|
+
return envelopeOf(page, joinTranscriptPage(page.items, [...parts, ...calls]));
|
|
335
|
+
}
|
|
336
|
+
/** One page of a session's steps, oldest first: the `Step` rows of its db3. */
|
|
337
|
+
export async function stepsAction(options, client) {
|
|
338
|
+
const page = await client.queryDb3Records(options.appId, options.sessionId, "Step", {
|
|
339
|
+
...(options.turnId ? { filter: { turnId: options.turnId } } : {}),
|
|
340
|
+
sort: { startedAt: 1 },
|
|
341
|
+
limit: options.limit,
|
|
342
|
+
cursor: options.cursor,
|
|
343
|
+
});
|
|
344
|
+
return envelopeOf(page, page.items.map((step) => decodeSessionRow(step, STEP_JSON_COLUMNS)));
|
|
345
|
+
}
|
|
346
|
+
/** One page of a session's tool calls, oldest first: the `ToolCall` rows of its db3. */
|
|
347
|
+
export async function toolCallsAction(options, client) {
|
|
348
|
+
const page = await client.queryDb3Records(options.appId, options.sessionId, "ToolCall", {
|
|
349
|
+
sort: { createdAt: 1 },
|
|
350
|
+
limit: options.limit,
|
|
351
|
+
cursor: options.cursor,
|
|
352
|
+
});
|
|
353
|
+
return envelopeOf(page, page.items.map(callPart));
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* One tool call's artifact: `found: false` when the session has no tool call
|
|
357
|
+
* by that id, else its value — read from the session's attachment when the
|
|
358
|
+
* artifact is a blob, `null` when the call has none.
|
|
359
|
+
*/
|
|
360
|
+
export async function readArtifactAction(options, client) {
|
|
361
|
+
const page = await client.queryDb3Records(options.appId, options.sessionId, "ToolCall", {
|
|
362
|
+
filter: { id: options.callId },
|
|
363
|
+
limit: 1,
|
|
364
|
+
});
|
|
365
|
+
const [call] = page.items;
|
|
366
|
+
if (!call)
|
|
367
|
+
return { found: false };
|
|
368
|
+
const artifact = artifactOf(decodeSessionRow(call));
|
|
369
|
+
if (artifact.kind === "none")
|
|
370
|
+
return { found: true, value: null };
|
|
371
|
+
if (artifact.kind === "inline")
|
|
372
|
+
return { found: true, value: artifact.value };
|
|
373
|
+
const bytes = await client.downloadAgentSessionAttachment(options.appId, options.sessionId, artifact.blobId);
|
|
374
|
+
return { found: true, value: JSON.parse(bytes.toString("utf8")) };
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Upload one file to a session: read it, then one `PUT` on the session's
|
|
378
|
+
* attachment route with the size and base64 SHA-256 the route checks. The
|
|
379
|
+
* blob ID defaults to a fresh ULID, the filename to the file's basename and
|
|
380
|
+
* the content type to the filename's MIME type. An unreadable file fails
|
|
381
|
+
* before any request.
|
|
382
|
+
*/
|
|
383
|
+
export async function uploadAttachmentAction(options, client) {
|
|
384
|
+
let data;
|
|
385
|
+
try {
|
|
386
|
+
data = readFileSync(resolvePath(options.filePath));
|
|
387
|
+
}
|
|
388
|
+
catch (err) {
|
|
389
|
+
throw new Error(`Failed to read file: ${err?.message ?? String(err)}`);
|
|
390
|
+
}
|
|
391
|
+
const blobId = options.blobId || ulid();
|
|
392
|
+
const filename = options.filename || basename(options.filePath) || "upload";
|
|
393
|
+
const contentType = options.contentType || mimeLookup(filename) || "application/octet-stream";
|
|
394
|
+
const sha256 = createHash("sha256").update(data).digest("base64");
|
|
395
|
+
const answer = await client.uploadAgentSessionAttachment(options.appId, options.sessionId, blobId, data, {
|
|
396
|
+
filename,
|
|
397
|
+
contentType,
|
|
398
|
+
sha256,
|
|
399
|
+
});
|
|
400
|
+
return { answer, blobId, filename, contentType, numBytes: data.length };
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Download one of a session's files: the bytes go to `output` with a success
|
|
404
|
+
* line, or to stdout alone. A refusal throws with nothing written.
|
|
405
|
+
*/
|
|
406
|
+
export async function downloadAttachmentAction(options, deps) {
|
|
407
|
+
const data = await deps.client.downloadAgentSessionAttachment(options.appId, options.sessionId, options.blobId);
|
|
408
|
+
if (options.output) {
|
|
409
|
+
deps.writeFile(resolvePath(options.output), data);
|
|
410
|
+
deps.print(`Downloaded to ${options.output} (${data.length} bytes)`);
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
deps.writeStdout(data);
|
|
414
|
+
}
|
|
415
|
+
return data;
|
|
416
|
+
}
|
|
417
|
+
/** The step table's display row. */
|
|
418
|
+
function stepCells(step) {
|
|
419
|
+
const providerModel = [step.provider, step.model].filter(present).join("/");
|
|
420
|
+
return {
|
|
421
|
+
...step,
|
|
422
|
+
providerModel: providerModel || step.toolName || step.functionName || "-",
|
|
423
|
+
tokens: present(step.totalTokens) ? step.totalTokens : "-",
|
|
424
|
+
costCell: present(step.cost) ? step.cost : "-",
|
|
425
|
+
errorCell: step.errorCode || "-",
|
|
426
|
+
};
|
|
427
|
+
}
|
|
135
428
|
export function registerAgentSessionsCommands(program) {
|
|
136
429
|
const agentSessions = program
|
|
137
430
|
.command("agent-sessions")
|
|
138
|
-
.description("Inspect and delete
|
|
431
|
+
.description("Inspect agent sessions, read their conversations, move their files, and delete them")
|
|
139
432
|
.addHelpText("after", `
|
|
140
433
|
An agent session is one conversation with an agent, created by a server
|
|
141
434
|
function (ctx.agents.createSession). App owners and admins list any user's
|
|
142
435
|
sessions, get any session — including the session object's state: each
|
|
143
436
|
turn's pinned system prompt and tools, the queue and the call ledger — and
|
|
144
|
-
delete any session.
|
|
145
|
-
|
|
437
|
+
delete any session. Members read their own sessions' transcript, steps and
|
|
438
|
+
artifacts, and the owner and participants upload files to them. This is not
|
|
439
|
+
\`primitive sessions\`, which lists sign-in sessions.
|
|
146
440
|
${ROWS_NOTE}
|
|
147
441
|
Examples:
|
|
148
442
|
$ primitive agent-sessions list --user-id 01HXY...
|
|
149
443
|
$ primitive agent-sessions list --user-id 01HXY... --agent advisor --json
|
|
150
444
|
$ primitive agent-sessions get 01HXZ...
|
|
445
|
+
$ primitive agent-sessions transcript 01HXZ... --limit 20
|
|
446
|
+
$ primitive agent-sessions steps 01HXZ... --turn 01HXT...
|
|
447
|
+
$ primitive agent-sessions artifacts 01HXZ...
|
|
448
|
+
$ primitive agent-sessions artifacts 01HXZ... call_01HXP... --json
|
|
449
|
+
$ primitive agent-sessions upload 01HXZ... ./receipt.png
|
|
450
|
+
$ primitive agent-sessions download 01HXZ... 01HXB... --output ./receipt.png
|
|
151
451
|
$ primitive agent-sessions delete 01HXZ... --yes
|
|
152
452
|
`);
|
|
453
|
+
commandStatus(agentSessions, { stability: "beta" });
|
|
153
454
|
agentSessions
|
|
154
455
|
.command("list")
|
|
155
456
|
.description("List one user's agent sessions, newest first")
|
|
@@ -195,7 +496,6 @@ Examples:
|
|
|
195
496
|
// The listed user's unread dot (#4256): activity they have not marked read.
|
|
196
497
|
{ header: "UNREAD", key: "hasUnread", format: (value) => (value === true ? "•" : "-") },
|
|
197
498
|
{ header: "LAST ACTIVITY", key: "lastActivityAt", format: formatDate },
|
|
198
|
-
{ header: "DOCUMENT", key: "documentId" },
|
|
199
499
|
]));
|
|
200
500
|
printPageHint(page);
|
|
201
501
|
}
|
|
@@ -206,6 +506,7 @@ Examples:
|
|
|
206
506
|
});
|
|
207
507
|
agentSessions
|
|
208
508
|
.command("get")
|
|
509
|
+
.alias("inspect")
|
|
209
510
|
.description("Show an agent session: its binding, status, members, active turn and object state")
|
|
210
511
|
.argument("<session-id>", "Session ID")
|
|
211
512
|
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
@@ -227,7 +528,6 @@ ${ROWS_NOTE}`)
|
|
|
227
528
|
}
|
|
228
529
|
result("Session ID", session.sessionId);
|
|
229
530
|
result("Agent", session.agentKey);
|
|
230
|
-
result("Document ID", session.documentId);
|
|
231
531
|
result("Owner", session.ownerUserId);
|
|
232
532
|
result("Created", formatDate(session.createdAt));
|
|
233
533
|
result("Status", session.status);
|
|
@@ -248,16 +548,228 @@ ${ROWS_NOTE}`)
|
|
|
248
548
|
process.exit(1);
|
|
249
549
|
}
|
|
250
550
|
});
|
|
551
|
+
agentSessions
|
|
552
|
+
.command("transcript")
|
|
553
|
+
.description("Show one page of a session's conversation: its messages, oldest first, with their parts")
|
|
554
|
+
.argument("<session-id>", "Session ID")
|
|
555
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
556
|
+
.option("--turn <turn-id>", "Only this turn's messages")
|
|
557
|
+
.addOption(pageLimitOption())
|
|
558
|
+
.addOption(pageCursorOption())
|
|
559
|
+
.option("--json", "Output as JSON")
|
|
560
|
+
.addHelpText("after", `
|
|
561
|
+
Each message prints with its parts: text, reasoning, tool calls (input, output
|
|
562
|
+
and where the artifact lives), files and events. --json prints the one list
|
|
563
|
+
envelope, each message with a \`parts\` array and the JSON columns decoded.
|
|
564
|
+
|
|
565
|
+
${READERS_NOTE}`)
|
|
566
|
+
.action(async (sessionId, options) => {
|
|
567
|
+
const limit = parsePageLimit(options.limit);
|
|
568
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
569
|
+
try {
|
|
570
|
+
const page = await transcriptAction({ appId: resolvedAppId, sessionId, limit, cursor: options.cursor, turnId: options.turn }, new ApiClient());
|
|
571
|
+
if (options.json) {
|
|
572
|
+
json(page);
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
if (page.items.length === 0) {
|
|
576
|
+
printEmptyPage(page, "messages");
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
for (const message of page.items)
|
|
580
|
+
console.log(formatTranscriptMessage(message).join("\n"));
|
|
581
|
+
printPageHint(page);
|
|
582
|
+
}
|
|
583
|
+
catch (err) {
|
|
584
|
+
error(describeRecordsFailure(err));
|
|
585
|
+
process.exit(1);
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
agentSessions
|
|
589
|
+
.command("steps")
|
|
590
|
+
.description("Show one page of a session's turn steps, oldest first: model, tool, context and history calls")
|
|
591
|
+
.argument("<session-id>", "Session ID")
|
|
592
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
593
|
+
.option("--turn <turn-id>", "Only this turn's steps")
|
|
594
|
+
.addOption(pageLimitOption())
|
|
595
|
+
.addOption(pageCursorOption())
|
|
596
|
+
.option("--json", "Output as JSON")
|
|
597
|
+
.addHelpText("after", `\n${READERS_NOTE}`)
|
|
598
|
+
.action(async (sessionId, options) => {
|
|
599
|
+
const limit = parsePageLimit(options.limit);
|
|
600
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
601
|
+
try {
|
|
602
|
+
const page = await stepsAction({ appId: resolvedAppId, sessionId, limit, cursor: options.cursor, turnId: options.turn }, new ApiClient());
|
|
603
|
+
if (options.json) {
|
|
604
|
+
json(page);
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
if (page.items.length === 0) {
|
|
608
|
+
printEmptyPage(page, "steps");
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
console.log(formatTable(page.items.map(stepCells), [
|
|
612
|
+
{ header: "TURN", key: "turnId" },
|
|
613
|
+
{ header: "SEQ", key: "seq" },
|
|
614
|
+
{ header: "KIND", key: "kind" },
|
|
615
|
+
{ header: "STATUS", key: "status" },
|
|
616
|
+
{ header: "STARTED", key: "startedAt", format: formatDate },
|
|
617
|
+
{ header: "DURATION", key: "durationMs", format: formatDuration },
|
|
618
|
+
{ header: "PROVIDER/MODEL", key: "providerModel" },
|
|
619
|
+
{ header: "TOKENS", key: "tokens" },
|
|
620
|
+
{ header: "COST", key: "costCell" },
|
|
621
|
+
{ header: "ERROR", key: "errorCell" },
|
|
622
|
+
]));
|
|
623
|
+
printPageHint(page);
|
|
624
|
+
}
|
|
625
|
+
catch (err) {
|
|
626
|
+
error(describeRecordsFailure(err));
|
|
627
|
+
process.exit(1);
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
agentSessions
|
|
631
|
+
.command("artifacts")
|
|
632
|
+
.description("List a session's tool calls and where their artifacts live, or print one call's artifact")
|
|
633
|
+
.argument("<session-id>", "Session ID")
|
|
634
|
+
.argument("[call-id]", "A tool call's ID: print its artifact")
|
|
635
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
636
|
+
.addOption(pageLimitOption())
|
|
637
|
+
.addOption(pageCursorOption())
|
|
638
|
+
.option("--json", "Output as JSON")
|
|
639
|
+
.addHelpText("after", `
|
|
640
|
+
Without a call ID, one page of the session's tool calls, oldest first; the
|
|
641
|
+
ARTIFACT column says whether each artifact is inline, on a blob, or absent.
|
|
642
|
+
With a call ID (the CALL column), the artifact's value as JSON, read from the
|
|
643
|
+
session's attachments when it is a blob.
|
|
644
|
+
|
|
645
|
+
${READERS_NOTE}`)
|
|
646
|
+
.action(async (sessionId, callId, options) => {
|
|
647
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
648
|
+
if (callId !== undefined) {
|
|
649
|
+
try {
|
|
650
|
+
const read = await readArtifactAction({ appId: resolvedAppId, sessionId, callId }, new ApiClient());
|
|
651
|
+
if (!read.found) {
|
|
652
|
+
error(`No tool call ${callId} in session ${sessionId}`);
|
|
653
|
+
process.exit(1);
|
|
654
|
+
}
|
|
655
|
+
if (read.value === null && !options.json) {
|
|
656
|
+
info("This call has no artifact.");
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
json(read.value);
|
|
660
|
+
}
|
|
661
|
+
catch (err) {
|
|
662
|
+
error(describeRecordsFailure(err));
|
|
663
|
+
process.exit(1);
|
|
664
|
+
}
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
const limit = parsePageLimit(options.limit);
|
|
668
|
+
try {
|
|
669
|
+
const page = await toolCallsAction({ appId: resolvedAppId, sessionId, limit, cursor: options.cursor }, new ApiClient());
|
|
670
|
+
if (options.json) {
|
|
671
|
+
json(page);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
if (page.items.length === 0) {
|
|
675
|
+
printEmptyPage(page, "tool calls");
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
console.log(formatTable(page.items.map((call) => ({ ...call, artifactCell: artifactLabel(call) })), [
|
|
679
|
+
{ header: "CALL", key: "id" },
|
|
680
|
+
{ header: "TOOL", key: "toolName" },
|
|
681
|
+
{ header: "STATE", key: "state" },
|
|
682
|
+
{ header: "MESSAGE", key: "messageId" },
|
|
683
|
+
{ header: "ARTIFACT", key: "artifactCell" },
|
|
684
|
+
]));
|
|
685
|
+
printPageHint(page);
|
|
686
|
+
}
|
|
687
|
+
catch (err) {
|
|
688
|
+
error(describeRecordsFailure(err));
|
|
689
|
+
process.exit(1);
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
agentSessions
|
|
693
|
+
.command("upload")
|
|
694
|
+
.description("Upload a file to a session, for a message to reference")
|
|
695
|
+
.argument("<session-id>", "Session ID")
|
|
696
|
+
.argument("<file-path>", "Path to the file to upload")
|
|
697
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
698
|
+
.option("--blob-id <id>", "Blob ID to upload under (a new ULID if not specified)")
|
|
699
|
+
.option("--filename <name>", "Filename to store (the file's own name if not specified)")
|
|
700
|
+
.option("--content-type <type>", "Content type (from the filename's extension if not specified)")
|
|
701
|
+
.option("--json", "Output the server's answer as JSON")
|
|
702
|
+
.addHelpText("after", `
|
|
703
|
+
The session's owner and participants upload. Uploading the same bytes under
|
|
704
|
+
the same blob ID again succeeds without sending them; different bytes under
|
|
705
|
+
an existing ID are refused. A message carries the file by its blob ID.
|
|
706
|
+
`)
|
|
707
|
+
.action(async (sessionId, filePath, options) => {
|
|
708
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
709
|
+
try {
|
|
710
|
+
const done = await uploadAttachmentAction({
|
|
711
|
+
appId: resolvedAppId,
|
|
712
|
+
sessionId,
|
|
713
|
+
filePath,
|
|
714
|
+
blobId: options.blobId,
|
|
715
|
+
filename: options.filename,
|
|
716
|
+
contentType: options.contentType,
|
|
717
|
+
}, new ApiClient());
|
|
718
|
+
if (options.json) {
|
|
719
|
+
json(done.answer);
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
const blobId = done.answer?.blobId ?? done.blobId;
|
|
723
|
+
const filename = done.answer?.filename ?? done.filename;
|
|
724
|
+
success(`${done.answer?.bytesTransferred === 0 ? "Already uploaded" : "Uploaded"} ${filename} to session ${sessionId}.`);
|
|
725
|
+
keyValue("Blob ID", blobId);
|
|
726
|
+
keyValue("Filename", filename);
|
|
727
|
+
keyValue("Content Type", done.answer?.contentType ?? done.contentType);
|
|
728
|
+
keyValue("Size", `${done.answer?.numBytes ?? done.numBytes} bytes`);
|
|
729
|
+
info(`Reference it in a message as files: [{ blobId: "${blobId}" }].`);
|
|
730
|
+
}
|
|
731
|
+
catch (err) {
|
|
732
|
+
error(describeRecordsFailure(err));
|
|
733
|
+
process.exit(1);
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
agentSessions
|
|
737
|
+
.command("download")
|
|
738
|
+
.description("Download one of a session's files: an upload or a tool call's artifact blob")
|
|
739
|
+
.argument("<session-id>", "Session ID")
|
|
740
|
+
.argument("<blob-id>", "Blob ID")
|
|
741
|
+
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
742
|
+
.option("--output <path>", "Output file path (defaults to stdout)")
|
|
743
|
+
.addHelpText("after", `
|
|
744
|
+
Every member of the session and every app owner and admin downloads. Without
|
|
745
|
+
--output the bytes are written to stdout unchanged.
|
|
746
|
+
`)
|
|
747
|
+
.action(async (sessionId, blobId, options) => {
|
|
748
|
+
const resolvedAppId = resolveAppId(undefined, options);
|
|
749
|
+
try {
|
|
750
|
+
await downloadAttachmentAction({ appId: resolvedAppId, sessionId, blobId, output: options.output }, {
|
|
751
|
+
client: new ApiClient(),
|
|
752
|
+
writeFile: (path, data) => writeFileSync(path, data),
|
|
753
|
+
writeStdout: (data) => process.stdout.write(data),
|
|
754
|
+
print: success,
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
catch (err) {
|
|
758
|
+
error(describeRecordsFailure(err));
|
|
759
|
+
process.exit(1);
|
|
760
|
+
}
|
|
761
|
+
});
|
|
251
762
|
agentSessions
|
|
252
763
|
.command("delete")
|
|
253
|
-
.description("Delete an agent session
|
|
764
|
+
.description("Delete an agent session with its conversation and files")
|
|
254
765
|
.argument("<session-id>", "Session ID")
|
|
255
766
|
.option("--app <app-id>", "App ID (uses current app if not specified)")
|
|
256
767
|
.option("-y, --yes", "Skip confirmation prompt")
|
|
257
768
|
.option("--json", "Output as JSON")
|
|
258
769
|
.addHelpText("after", `
|
|
259
|
-
The session's owner, app owners and admins delete;
|
|
260
|
-
go with it.
|
|
770
|
+
The session's owner, app owners and admins delete; its db3, its rows and its
|
|
771
|
+
files go with it. A delete that stopped part-way finishes when run again; once
|
|
772
|
+
it is done the session is not found.
|
|
261
773
|
`)
|
|
262
774
|
.action(async (sessionId, options) => {
|
|
263
775
|
const resolvedAppId = resolveAppId(undefined, options);
|