primitive-admin 1.2.0-alpha.8 → 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 +103 -29
- 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.d.ts +1 -1
- package/dist/src/commands/apps-children.js +56 -145
- 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/database-types.js +13 -313
- package/dist/src/commands/database-types.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/llm.js +9 -6
- package/dist/src/commands/llm.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/settings.d.ts +12 -9
- package/dist/src/commands/settings.js +31 -79
- package/dist/src/commands/settings.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 +519 -554
- package/dist/src/commands/sync.js +3010 -4909
- 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 +1830 -429
- package/dist/src/lib/api-client.js +1025 -546
- 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 -47
- package/dist/src/lib/child-apps-local.js +11 -73
- 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-triggers.d.ts +15 -3
- package/dist/src/lib/function-triggers.js +72 -10
- package/dist/src/lib/function-triggers.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 +586 -152
- package/dist/src/lib/generated-config-surfaces.js +1919 -1883
- 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/generated-workflow-model-fields.d.ts +20 -0
- package/dist/src/lib/generated-workflow-model-fields.js +53 -0
- package/dist/src/lib/generated-workflow-model-fields.js.map +1 -0
- 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 +46 -15
- package/dist/src/lib/prompt-schema-codegen.js +142 -108
- 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 +8 -3
- package/dist/src/lib/swift-codegen/agentGenerator.js +76 -22
- 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/lib/workflow-field-descriptor.d.ts +91 -0
- package/dist/src/lib/workflow-field-descriptor.js +153 -0
- package/dist/src/lib/workflow-field-descriptor.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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `primitive` CLI's command tree, as the bin runs it.
|
|
3
|
+
*
|
|
4
|
+
* `cli/bin/primitive.ts` builds its tree through `registerAllCommands`, and so
|
|
5
|
+
* does anything that needs the whole tree without running the bin. It
|
|
6
|
+
* registers every group (`registerCommandGroups`, command-groups.ts), gives
|
|
7
|
+
* every command its row of the generated status table
|
|
8
|
+
* (`generated-command-status.ts`, written by `pnpm api-status --write`), and
|
|
9
|
+
* on a production build prunes the experimental commands. Registering a
|
|
10
|
+
* group in command-groups.ts, rather than in the bin, is what keeps the two
|
|
11
|
+
* trees the same.
|
|
12
|
+
*/
|
|
13
|
+
import type { Command } from "commander";
|
|
14
|
+
/** What {@link registerAllCommands} accepts. */
|
|
15
|
+
export interface RegisterAllCommandsOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the tree includes experimental commands. Defaults to this build's
|
|
18
|
+
* flag (`EXPERIMENTAL_APIS`, false only in a `PRIMITIVE_EXPERIMENTAL_APIS=0`
|
|
19
|
+
* build). When false, every command whose status is experimental is pruned
|
|
20
|
+
* and `config pull|diff|push` leave the experimental families alone.
|
|
21
|
+
*/
|
|
22
|
+
experimental?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Register every command group on `program` and give each command its status
|
|
26
|
+
* from the generated table. A production build (`experimental` false) throws
|
|
27
|
+
* when a registered command has no row, then prunes the experimental
|
|
28
|
+
* commands; a full build leaves a command with no row on its declared status.
|
|
29
|
+
*
|
|
30
|
+
* @param program The root commander `Command`.
|
|
31
|
+
* @param options Whether to include experimental commands.
|
|
32
|
+
* @returns The same `program`, with every group registered.
|
|
33
|
+
* @throws On a production build, when the status table has no row for a
|
|
34
|
+
* registered command (run `pnpm api-status --write`).
|
|
35
|
+
*/
|
|
36
|
+
export declare function registerAllCommands(program: Command, options?: RegisterAllCommandsOptions): Command;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `primitive` CLI's command tree, as the bin runs it.
|
|
3
|
+
*
|
|
4
|
+
* `cli/bin/primitive.ts` builds its tree through `registerAllCommands`, and so
|
|
5
|
+
* does anything that needs the whole tree without running the bin. It
|
|
6
|
+
* registers every group (`registerCommandGroups`, command-groups.ts), gives
|
|
7
|
+
* every command its row of the generated status table
|
|
8
|
+
* (`generated-command-status.ts`, written by `pnpm api-status --write`), and
|
|
9
|
+
* on a production build prunes the experimental commands. Registering a
|
|
10
|
+
* group in command-groups.ts, rather than in the bin, is what keeps the two
|
|
11
|
+
* trees the same.
|
|
12
|
+
*/
|
|
13
|
+
import { applyCommandStatusTable, pruneExperimentalCommands } from "./command-status.js";
|
|
14
|
+
import { registerCommandGroups } from "./command-groups.js";
|
|
15
|
+
import { COMMAND_STATUS } from "./generated-command-status.js";
|
|
16
|
+
import { EXPERIMENTAL_APIS } from "./generated-build-flags.js";
|
|
17
|
+
/**
|
|
18
|
+
* Register every command group on `program` and give each command its status
|
|
19
|
+
* from the generated table. A production build (`experimental` false) throws
|
|
20
|
+
* when a registered command has no row, then prunes the experimental
|
|
21
|
+
* commands; a full build leaves a command with no row on its declared status.
|
|
22
|
+
*
|
|
23
|
+
* @param program The root commander `Command`.
|
|
24
|
+
* @param options Whether to include experimental commands.
|
|
25
|
+
* @returns The same `program`, with every group registered.
|
|
26
|
+
* @throws On a production build, when the status table has no row for a
|
|
27
|
+
* registered command (run `pnpm api-status --write`).
|
|
28
|
+
*/
|
|
29
|
+
export function registerAllCommands(program, options = {}) {
|
|
30
|
+
const experimental = options.experimental ?? EXPERIMENTAL_APIS;
|
|
31
|
+
registerCommandGroups(program, { experimental });
|
|
32
|
+
applyCommandStatusTable(program, COMMAND_STATUS, { strict: !experimental });
|
|
33
|
+
if (!experimental)
|
|
34
|
+
pruneExperimentalCommands(program);
|
|
35
|
+
return program;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=register-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-commands.js","sourceRoot":"","sources":["../../../src/lib/register-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAa/D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,UAAsC,EAAE;IAC5F,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,iBAAiB,CAAC;IAC/D,qBAAqB,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;IACjD,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,MAAM,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC;IAC5E,IAAI,CAAC,YAAY;QAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Imports of the declarations `functions/primitive.d.ts` replaced (#5544,
|
|
3
|
+
* project `unified-schemas` phase 10).
|
|
4
|
+
*
|
|
5
|
+
* Codegen no longer writes `primitive-function-types.d.ts`,
|
|
6
|
+
* `primitive-prompt-types.d.ts`, `primitive-db3-types.d.ts` or
|
|
7
|
+
* `primitive-user-properties.d.ts`, and removes the copies an earlier push
|
|
8
|
+
* left. A function source still importing one would fail at its first
|
|
9
|
+
* typecheck with a generic "Cannot find module", or not at all under
|
|
10
|
+
* `--no-typecheck` (a type-only import is erased). So `buildFunctionBundle`
|
|
11
|
+
* refuses it by name, the way it refuses the retired SDK specifier: this
|
|
12
|
+
* module says which specifiers are retired, finds them in an authored source,
|
|
13
|
+
* and words the refusal.
|
|
14
|
+
*
|
|
15
|
+
* A specifier is retired when it is relative and its base name, with any
|
|
16
|
+
* `.js`, `.ts` or `.d.ts` suffix removed, is a retired declaration's stem —
|
|
17
|
+
* `./primitive-function-types`, `../functions/primitive-prompt-types.js`.
|
|
18
|
+
* `./primitive`, `primitive-functions` and a tree file that merely shares a
|
|
19
|
+
* prefix (`./primitive-function-types-extra.ts`) are not.
|
|
20
|
+
*
|
|
21
|
+
* The scan is anchored at the start of a line, as the SDK one is, so prose
|
|
22
|
+
* naming a retired file — a comment, a doc line, a string — refuses nothing.
|
|
23
|
+
* `import("…")` is the one form read mid-line: a type position spells it
|
|
24
|
+
* there (`type T = import("./x").Y`).
|
|
25
|
+
*/
|
|
26
|
+
import { type RetiredDeclaration } from "./primitive-declaration-names.js";
|
|
27
|
+
/** One retired import an authored source makes. */
|
|
28
|
+
export interface RetiredImport {
|
|
29
|
+
/** The specifier as written. */
|
|
30
|
+
specifier: string;
|
|
31
|
+
retired: RetiredDeclaration;
|
|
32
|
+
/** The names its import or export clause lists, in order; empty when it lists none. */
|
|
33
|
+
names: string[];
|
|
34
|
+
}
|
|
35
|
+
/** The retired declaration a specifier names, or null; see the module note. */
|
|
36
|
+
export declare function retiredDeclarationStem(specifier: string): RetiredDeclaration | null;
|
|
37
|
+
/** Every module specifier a source names, with the names its clause lists, in source order. */
|
|
38
|
+
export declare function scanImportSpecifiers(source: string): Array<{
|
|
39
|
+
specifier: string;
|
|
40
|
+
names: string[];
|
|
41
|
+
index: number;
|
|
42
|
+
typeOnly: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
/** Every retired import a source makes, in source order. */
|
|
45
|
+
export declare function scanRetiredImports(source: string): RetiredImport[];
|
|
46
|
+
/**
|
|
47
|
+
* The refusal for one retired import of `file` (tree-relative), in the
|
|
48
|
+
* function `functionKey`'s build: the replacement specifier, the namespace and
|
|
49
|
+
* an example name — the name the import listed, or one the namespace holds. A
|
|
50
|
+
* top-level `Primitive*` name keeps its spelling in `primitive.d.ts`, so only
|
|
51
|
+
* the specifier changes.
|
|
52
|
+
*/
|
|
53
|
+
export declare function retiredImportRefusal(functionKey: string, file: string, found: RetiredImport): string;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Imports of the declarations `functions/primitive.d.ts` replaced (#5544,
|
|
3
|
+
* project `unified-schemas` phase 10).
|
|
4
|
+
*
|
|
5
|
+
* Codegen no longer writes `primitive-function-types.d.ts`,
|
|
6
|
+
* `primitive-prompt-types.d.ts`, `primitive-db3-types.d.ts` or
|
|
7
|
+
* `primitive-user-properties.d.ts`, and removes the copies an earlier push
|
|
8
|
+
* left. A function source still importing one would fail at its first
|
|
9
|
+
* typecheck with a generic "Cannot find module", or not at all under
|
|
10
|
+
* `--no-typecheck` (a type-only import is erased). So `buildFunctionBundle`
|
|
11
|
+
* refuses it by name, the way it refuses the retired SDK specifier: this
|
|
12
|
+
* module says which specifiers are retired, finds them in an authored source,
|
|
13
|
+
* and words the refusal.
|
|
14
|
+
*
|
|
15
|
+
* A specifier is retired when it is relative and its base name, with any
|
|
16
|
+
* `.js`, `.ts` or `.d.ts` suffix removed, is a retired declaration's stem —
|
|
17
|
+
* `./primitive-function-types`, `../functions/primitive-prompt-types.js`.
|
|
18
|
+
* `./primitive`, `primitive-functions` and a tree file that merely shares a
|
|
19
|
+
* prefix (`./primitive-function-types-extra.ts`) are not.
|
|
20
|
+
*
|
|
21
|
+
* The scan is anchored at the start of a line, as the SDK one is, so prose
|
|
22
|
+
* naming a retired file — a comment, a doc line, a string — refuses nothing.
|
|
23
|
+
* `import("…")` is the one form read mid-line: a type position spells it
|
|
24
|
+
* there (`type T = import("./x").Y`).
|
|
25
|
+
*/
|
|
26
|
+
import { basename } from "path";
|
|
27
|
+
import { workflowTypeBaseName } from "./schema-codegen/naming.js";
|
|
28
|
+
import { PRIMITIVE_DECLARATION_SPECIFIER, RETIRED_DECLARATIONS, } from "./primitive-declaration-names.js";
|
|
29
|
+
/** The retired declaration a specifier names, or null; see the module note. */
|
|
30
|
+
export function retiredDeclarationStem(specifier) {
|
|
31
|
+
if (!specifier.startsWith("./") && !specifier.startsWith("../"))
|
|
32
|
+
return null;
|
|
33
|
+
const stem = basename(specifier).replace(/\.d\.ts$|\.ts$|\.js$/, "");
|
|
34
|
+
return RETIRED_DECLARATIONS.find((retired) => retired.file === `${stem}.d.ts`) ?? null;
|
|
35
|
+
}
|
|
36
|
+
/** The names of an import or export clause (`{ A, type B as C }` → `A`, `B`). */
|
|
37
|
+
function clauseNames(clause) {
|
|
38
|
+
const braces = /\{([^}]*)\}/.exec(clause);
|
|
39
|
+
if (!braces)
|
|
40
|
+
return [];
|
|
41
|
+
return braces[1]
|
|
42
|
+
.split(",")
|
|
43
|
+
.map((part) => part.trim().replace(/^type\s+/, "").split(/\s+as\s+/)[0].trim())
|
|
44
|
+
.filter((name) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The import and export forms that name a module, each anchored at the start
|
|
48
|
+
* of a line: a clause and its `from` (on one line or ending a multi-line
|
|
49
|
+
* clause), a bare side-effect import, and a triple-slash reference.
|
|
50
|
+
*/
|
|
51
|
+
const FROM_FORM = /^[ \t]*(?:import|export)\b([^;'"]*?)\bfrom[ \t]*(['"])([^'"\n]+)\2/gm;
|
|
52
|
+
const BARE_FORM = /^[ \t]*import[ \t]*(['"])([^'"\n]+)\1/gm;
|
|
53
|
+
const REFERENCE_FORM = /^[ \t]*\/\/\/[ \t]*<reference[ \t]+path[ \t]*=[ \t]*(['"])([^'"\n]+)\1/gm;
|
|
54
|
+
const DYNAMIC_FORM = /\bimport[ \t]*\([ \t]*(['"])([^'"\n]+)\1[ \t]*\)/g;
|
|
55
|
+
/** Whether the line holding `index` is a comment line (`//`, `*`, `/*`). */
|
|
56
|
+
function onCommentLine(source, index) {
|
|
57
|
+
const start = source.lastIndexOf("\n", index - 1) + 1;
|
|
58
|
+
return /^[ \t]*(\/\/|\*|\/\*)/.test(source.slice(start, index + 1));
|
|
59
|
+
}
|
|
60
|
+
/** Every module specifier a source names, with the names its clause lists, in source order. */
|
|
61
|
+
export function scanImportSpecifiers(source) {
|
|
62
|
+
const found = [];
|
|
63
|
+
// A clause holds no `;` and no quote, so a `from` past the end of a
|
|
64
|
+
// statement is never read as this one's.
|
|
65
|
+
for (const match of source.matchAll(FROM_FORM)) {
|
|
66
|
+
found.push({ specifier: match[3], names: clauseNames(match[1]), index: match.index, typeOnly: /^\s*type\b/.test(match[1]) });
|
|
67
|
+
}
|
|
68
|
+
for (const match of source.matchAll(BARE_FORM))
|
|
69
|
+
found.push({ specifier: match[2], names: [], index: match.index, typeOnly: false });
|
|
70
|
+
for (const match of source.matchAll(REFERENCE_FORM))
|
|
71
|
+
found.push({ specifier: match[2], names: [], index: match.index, typeOnly: true });
|
|
72
|
+
for (const match of source.matchAll(DYNAMIC_FORM)) {
|
|
73
|
+
if (onCommentLine(source, match.index))
|
|
74
|
+
continue;
|
|
75
|
+
found.push({ specifier: match[2], names: [], index: match.index, typeOnly: false });
|
|
76
|
+
}
|
|
77
|
+
return found.sort((a, b) => a.index - b.index);
|
|
78
|
+
}
|
|
79
|
+
/** Every retired import a source makes, in source order. */
|
|
80
|
+
export function scanRetiredImports(source) {
|
|
81
|
+
const found = [];
|
|
82
|
+
for (const { specifier, names } of scanImportSpecifiers(source)) {
|
|
83
|
+
const retired = retiredDeclarationStem(specifier);
|
|
84
|
+
if (retired)
|
|
85
|
+
found.push({ specifier, retired, names });
|
|
86
|
+
}
|
|
87
|
+
return found;
|
|
88
|
+
}
|
|
89
|
+
/** A name of the namespace to give as the example when the import names none. */
|
|
90
|
+
function fallbackExample(namespace, functionKey) {
|
|
91
|
+
switch (namespace) {
|
|
92
|
+
case "Functions":
|
|
93
|
+
return `${workflowTypeBaseName(functionKey)}Input`;
|
|
94
|
+
case "Prompts":
|
|
95
|
+
return "<Key>PromptOutput";
|
|
96
|
+
case "Db3":
|
|
97
|
+
return "<Model>";
|
|
98
|
+
case "UserProperties":
|
|
99
|
+
return "UserProperties";
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The refusal for one retired import of `file` (tree-relative), in the
|
|
104
|
+
* function `functionKey`'s build: the replacement specifier, the namespace and
|
|
105
|
+
* an example name — the name the import listed, or one the namespace holds. A
|
|
106
|
+
* top-level `Primitive*` name keeps its spelling in `primitive.d.ts`, so only
|
|
107
|
+
* the specifier changes.
|
|
108
|
+
*/
|
|
109
|
+
export function retiredImportRefusal(functionKey, file, found) {
|
|
110
|
+
const head = `function '${functionKey}': ${file} imports "${found.specifier}", which codegen no longer writes.`;
|
|
111
|
+
const first = found.names[0];
|
|
112
|
+
if (first && /^Primitive/.test(first)) {
|
|
113
|
+
return `${head} Import type { ${first} } from "${PRIMITIVE_DECLARATION_SPECIFIER}": the name is unchanged.`;
|
|
114
|
+
}
|
|
115
|
+
const namespace = found.retired.namespace;
|
|
116
|
+
const example = first ?? fallbackExample(namespace, functionKey);
|
|
117
|
+
return (`${head} Import type { ${namespace} } from "${PRIMITIVE_DECLARATION_SPECIFIER}" and write ` +
|
|
118
|
+
`${namespace}.<Name> (for example ${namespace}.${example}).`);
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=retired-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retired-imports.js","sourceRoot":"","sources":["../../../src/lib/retired-imports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACL,+BAA+B,EAC/B,oBAAoB,GAErB,MAAM,kCAAkC,CAAC;AAW1C,+EAA+E;AAC/E,MAAM,UAAU,sBAAsB,CAAC,SAAiB;IACtD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7E,MAAM,IAA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AK,YAAY,+BAA+B,2BAA2B,CAAC;IAC9G,CAAC;IACD,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1C,MAAM,OAAO,GAAG,KAAK,IAAI,eAAe,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACjE,OAAO,CACL,GAAG,IAAI,kBAAkB,SAAS,YAAY,+BAA+B,cAAc;QAC3F,GAAG,SAAS,wBAAwB,SAAS,IAAI,OAAO,IAAI,CAC7D,CAAC;AACJ,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Those spellings no longer reach a client.
|
|
9
9
|
*
|
|
10
10
|
* #2636 — the vocabulary itself is no longer copied by hand: it is GENERATED
|
|
11
|
-
* from the server's `src/
|
|
11
|
+
* from the server's `src/function-runs/run-status.ts` into
|
|
12
12
|
* `run-status.generated.ts` (`pnpm gen:run-status`) and re-exported here, so a
|
|
13
13
|
* future status is a one-site edit plus regeneration rather than four
|
|
14
14
|
* hand-edits that a lagging copy turns into a hung poll loop. This module stays
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* GENERATED FILE — do not edit by hand.
|
|
3
3
|
*
|
|
4
4
|
* The canonical workflow-run status vocabulary, as the CLI sees it.
|
|
5
|
-
* Generated from the server's `src/
|
|
5
|
+
* Generated from the server's `src/function-runs/run-status.ts` by
|
|
6
6
|
* `scripts/gen-run-status-mirrors.mjs` (`pnpm gen:run-status`), because
|
|
7
7
|
* the CLI is a separately built package and cannot import worker
|
|
8
8
|
* source. A stale copy is worse than a missing feature: a poll loop whose
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* colours, help text) live in `cli/src/lib/run-status.ts`, which re-exports
|
|
15
15
|
* everything below.
|
|
16
16
|
*/
|
|
17
|
-
export declare const RUN_STATUSES: readonly ["queued", "running", "apply_pending", "apply_claimed", "completed", "failed", "terminated", "missing", "skipped"];
|
|
17
|
+
export declare const RUN_STATUSES: readonly ["queued", "running", "apply_pending", "apply_claimed", "completed", "failed", "terminated", "missing", "skipped", "denied"];
|
|
18
18
|
export type RunStatus = (typeof RUN_STATUSES)[number];
|
|
19
19
|
/** Comma-separated list for help text and error messages. */
|
|
20
20
|
export declare const RUN_STATUS_LIST: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* GENERATED FILE — do not edit by hand.
|
|
3
3
|
*
|
|
4
4
|
* The canonical workflow-run status vocabulary, as the CLI sees it.
|
|
5
|
-
* Generated from the server's `src/
|
|
5
|
+
* Generated from the server's `src/function-runs/run-status.ts` by
|
|
6
6
|
* `scripts/gen-run-status-mirrors.mjs` (`pnpm gen:run-status`), because
|
|
7
7
|
* the CLI is a separately built package and cannot import worker
|
|
8
8
|
* source. A stale copy is worse than a missing feature: a poll loop whose
|
|
@@ -24,6 +24,7 @@ export const RUN_STATUSES = [
|
|
|
24
24
|
"terminated",
|
|
25
25
|
"missing",
|
|
26
26
|
"skipped",
|
|
27
|
+
"denied",
|
|
27
28
|
];
|
|
28
29
|
/** Comma-separated list for help text and error messages. */
|
|
29
30
|
export const RUN_STATUS_LIST = RUN_STATUSES.join(", ");
|
|
@@ -33,6 +34,7 @@ export const TERMINAL_RUN_STATUSES = new Set([
|
|
|
33
34
|
"failed",
|
|
34
35
|
"terminated",
|
|
35
36
|
"skipped",
|
|
37
|
+
"denied",
|
|
36
38
|
]);
|
|
37
39
|
/**
|
|
38
40
|
* Apply-flow states: the run finished executing but is parked waiting for a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-status.generated.js","sourceRoot":"","sources":["../../../src/lib/run-status.generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ;IACR,SAAS;IACT,eAAe;IACf,eAAe;IACf,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,SAAS;
|
|
1
|
+
{"version":3,"file":"run-status.generated.js","sourceRoot":"","sources":["../../../src/lib/run-status.generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ;IACR,SAAS;IACT,eAAe;IACf,eAAe;IACf,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,SAAS;IACT,QAAQ;CACA,CAAC;AAIX,6DAA6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEvD,wDAAwD;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAS;IACxE,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,QAAQ;CACT,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAS;IACrE,eAAe;IACf,eAAe;CAChB,CAAC,CAAC;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAS;IACzE,QAAQ;IACR,SAAS;CACV,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAS;IACvE,GAAG,qBAAqB;IACxB,GAAG,kBAAkB;IACrB,SAAS;CACV,CAAC,CAAC;AAEH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ,IAAK,YAAkC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACjF,CAAC;AACJ,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Those spellings no longer reach a client.
|
|
9
9
|
*
|
|
10
10
|
* #2636 — the vocabulary itself is no longer copied by hand: it is GENERATED
|
|
11
|
-
* from the server's `src/
|
|
11
|
+
* from the server's `src/function-runs/run-status.ts` into
|
|
12
12
|
* `run-status.generated.ts` (`pnpm gen:run-status`) and re-exported here, so a
|
|
13
13
|
* future status is a one-site edit plus regeneration rather than four
|
|
14
14
|
* hand-edits that a lagging copy turns into a hung poll loop. This module stays
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compiled space (#5544, project `unified-schemas` phase 10): every type
|
|
3
|
+
* name the generated declarations emit, across the five namespaces of
|
|
4
|
+
* `functions/primitive.d.ts` (`Schemas`, `Functions`, `Prompts`, `Db3`,
|
|
5
|
+
* `UserProperties`) and the shared Swift file.
|
|
6
|
+
*
|
|
7
|
+
* A name one party produces is emitted short. Every party to a name two or
|
|
8
|
+
* more parties produce becomes `<Namespace>_<PascalKey>_<Name>`, in both
|
|
9
|
+
* languages: a collision in either language's normalization renames the
|
|
10
|
+
* parties in both, so a reader types the same name in TypeScript and Swift.
|
|
11
|
+
* TypeScript renames inside its namespace too, though the namespace alone
|
|
12
|
+
* would keep two `Money`s apart there, because Swift has no namespaces.
|
|
13
|
+
*
|
|
14
|
+
* A party is a source: a `schemas/` file, a function, a prompt, a db3 model
|
|
15
|
+
* (two db3 types declaring one model identically are one party, by the
|
|
16
|
+
* caller's `identity`), the user properties. A name still produced twice after
|
|
17
|
+
* the rename is reported in `collisions`, with both sources, for the caller
|
|
18
|
+
* to refuse in its own error class.
|
|
19
|
+
*/
|
|
20
|
+
/** A namespace of `primitive.d.ts`. */
|
|
21
|
+
export type SpaceNamespace = "Schemas" | "Functions" | "Prompts" | "Db3" | "UserProperties";
|
|
22
|
+
/** One name a party produces. */
|
|
23
|
+
export interface SpaceName {
|
|
24
|
+
/** What a lookup names it by: the explicit ref of a ref target, or a declaration's own id. */
|
|
25
|
+
id: string;
|
|
26
|
+
namespace: SpaceNamespace;
|
|
27
|
+
/** The party's key: a `schemas/` file stem, a function or prompt key, a db3 type, `UserProperties`. */
|
|
28
|
+
key: string;
|
|
29
|
+
/** Where the name is declared, for a refusal: `schemas/common.toml`, `functions/charge.toml`. */
|
|
30
|
+
source: string;
|
|
31
|
+
/** The name each language emits when no other party produces it. */
|
|
32
|
+
short: {
|
|
33
|
+
ts: string;
|
|
34
|
+
swift: string;
|
|
35
|
+
};
|
|
36
|
+
/** `<Name>` in `<Namespace>_<PascalKey>_<Name>`. */
|
|
37
|
+
suffix: string;
|
|
38
|
+
/**
|
|
39
|
+
* Names of one namespace and one short name with the same identity are one
|
|
40
|
+
* party, whatever their keys: a db3 model two types declare identically.
|
|
41
|
+
*/
|
|
42
|
+
identity?: string;
|
|
43
|
+
}
|
|
44
|
+
/** A name two parties still produce after the rename. */
|
|
45
|
+
export interface SpaceCollision {
|
|
46
|
+
name: string;
|
|
47
|
+
sources: [string, string];
|
|
48
|
+
}
|
|
49
|
+
export interface CompiledSpace {
|
|
50
|
+
/** Each name's emitted TypeScript name (unqualified), by id. */
|
|
51
|
+
ts: ReadonlyMap<string, string>;
|
|
52
|
+
/** Each name's emitted Swift name, by id. */
|
|
53
|
+
swift: ReadonlyMap<string, string>;
|
|
54
|
+
/** The ids of the names a collision renamed. */
|
|
55
|
+
renamed: ReadonlySet<string>;
|
|
56
|
+
collisions: {
|
|
57
|
+
ts: SpaceCollision[];
|
|
58
|
+
swift: SpaceCollision[];
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Compute the compiled space; see the module note. Deterministic for any order of `names`. */
|
|
62
|
+
export declare function compiledSpace(names: readonly SpaceName[]): CompiledSpace;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compiled space (#5544, project `unified-schemas` phase 10): every type
|
|
3
|
+
* name the generated declarations emit, across the five namespaces of
|
|
4
|
+
* `functions/primitive.d.ts` (`Schemas`, `Functions`, `Prompts`, `Db3`,
|
|
5
|
+
* `UserProperties`) and the shared Swift file.
|
|
6
|
+
*
|
|
7
|
+
* A name one party produces is emitted short. Every party to a name two or
|
|
8
|
+
* more parties produce becomes `<Namespace>_<PascalKey>_<Name>`, in both
|
|
9
|
+
* languages: a collision in either language's normalization renames the
|
|
10
|
+
* parties in both, so a reader types the same name in TypeScript and Swift.
|
|
11
|
+
* TypeScript renames inside its namespace too, though the namespace alone
|
|
12
|
+
* would keep two `Money`s apart there, because Swift has no namespaces.
|
|
13
|
+
*
|
|
14
|
+
* A party is a source: a `schemas/` file, a function, a prompt, a db3 model
|
|
15
|
+
* (two db3 types declaring one model identically are one party, by the
|
|
16
|
+
* caller's `identity`), the user properties. A name still produced twice after
|
|
17
|
+
* the rename is reported in `collisions`, with both sources, for the caller
|
|
18
|
+
* to refuse in its own error class.
|
|
19
|
+
*/
|
|
20
|
+
import { pascalCase } from "../db-codegen/dbNaming.js";
|
|
21
|
+
/** The party a name belongs to: its namespace and key, or its identity when it has one. */
|
|
22
|
+
function partyOf(name) {
|
|
23
|
+
return name.identity !== undefined
|
|
24
|
+
? `${name.namespace}\u0000identity\u0000${name.identity}`
|
|
25
|
+
: `${name.namespace}\u0000${name.key}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* `<Namespace>_<PascalKey>_<Name>`: the key's alphanumerics PascalCased, the
|
|
29
|
+
* same in both languages. A party one identity joins is named by its first key.
|
|
30
|
+
*/
|
|
31
|
+
function renamed(name, partyKey) {
|
|
32
|
+
return `${name.namespace}_${pascalCase(partyKey)}_${name.suffix}`;
|
|
33
|
+
}
|
|
34
|
+
/** Compute the compiled space; see the module note. Deterministic for any order of `names`. */
|
|
35
|
+
export function compiledSpace(names) {
|
|
36
|
+
const sorted = [...names].sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
37
|
+
// Names sharing a short name in either language are joined; a group with two
|
|
38
|
+
// or more parties is a collision, and every name in it is renamed.
|
|
39
|
+
const parent = sorted.map((_, i) => i);
|
|
40
|
+
const find = (i) => (parent[i] === i ? i : (parent[i] = find(parent[i])));
|
|
41
|
+
const join = (a, b) => {
|
|
42
|
+
const ra = find(a);
|
|
43
|
+
const rb = find(b);
|
|
44
|
+
if (ra !== rb)
|
|
45
|
+
parent[Math.max(ra, rb)] = Math.min(ra, rb);
|
|
46
|
+
};
|
|
47
|
+
for (const language of ["ts", "swift"]) {
|
|
48
|
+
const first = new Map();
|
|
49
|
+
sorted.forEach((name, i) => {
|
|
50
|
+
const at = first.get(name.short[language]);
|
|
51
|
+
if (at === undefined)
|
|
52
|
+
first.set(name.short[language], i);
|
|
53
|
+
else
|
|
54
|
+
join(at, i);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const parties = new Map();
|
|
58
|
+
sorted.forEach((name, i) => {
|
|
59
|
+
const root = find(i);
|
|
60
|
+
if (!parties.has(root))
|
|
61
|
+
parties.set(root, new Set());
|
|
62
|
+
parties.get(root).add(partyOf(name));
|
|
63
|
+
});
|
|
64
|
+
const partyKey = new Map();
|
|
65
|
+
for (const name of sorted) {
|
|
66
|
+
const party = partyOf(name);
|
|
67
|
+
const known = partyKey.get(party);
|
|
68
|
+
if (known === undefined || name.key < known)
|
|
69
|
+
partyKey.set(party, name.key);
|
|
70
|
+
}
|
|
71
|
+
const ts = new Map();
|
|
72
|
+
const swift = new Map();
|
|
73
|
+
const renamedIds = new Set();
|
|
74
|
+
sorted.forEach((name, i) => {
|
|
75
|
+
if (parties.get(find(i)).size > 1) {
|
|
76
|
+
const emitted = renamed(name, partyKey.get(partyOf(name)));
|
|
77
|
+
renamedIds.add(name.id);
|
|
78
|
+
ts.set(name.id, emitted);
|
|
79
|
+
swift.set(name.id, emitted);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
ts.set(name.id, name.short.ts);
|
|
83
|
+
swift.set(name.id, name.short.swift);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
const survivors = (emitted) => {
|
|
87
|
+
const byName = new Map();
|
|
88
|
+
const out = [];
|
|
89
|
+
for (const name of sorted) {
|
|
90
|
+
const emittedName = emitted.get(name.id);
|
|
91
|
+
const prior = byName.get(emittedName);
|
|
92
|
+
if (prior && partyOf(prior) !== partyOf(name)) {
|
|
93
|
+
out.push({ name: emittedName, sources: [prior.source, name.source] });
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (!prior)
|
|
97
|
+
byName.set(emittedName, name);
|
|
98
|
+
}
|
|
99
|
+
return out;
|
|
100
|
+
};
|
|
101
|
+
return { ts, swift, renamed: renamedIds, collisions: { ts: survivors(ts), swift: survivors(swift) } };
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=compiledSpace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiledSpace.js","sourceRoot":"","sources":["../../../../src/lib/schema-codegen/compiledSpace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAyCvD,2FAA2F;AAC3F,SAAS,OAAO,CAAC,IAAe;IAC9B,OAAO,IAAI,CAAC,QAAQ,KAAK,SAAS;QAChC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,uBAAuB,IAAI,CAAC,QAAQ,EAAE;QACzD,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,SAAS,IAAI,CAAC,GAAG,EAAE,CAAC;AAC3C,CAAC;AAED;;;GAGG;AACH,SAAS,OAAO,CAAC,IAAe,EAAE,QAAgB;IAChD,OAAO,GAAG,IAAI,CAAC,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;AACpE,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,aAAa,CAAC,KAA2B;IACvD,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C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,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;AACxG,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Vendored from the canonical server module
|
|
5
|
+
* `src/function-runs/db3-bridge.ts` — the SAME interpretation the server
|
|
6
|
+
* applies to a function's schemas. The CLI cannot import server `src/`
|
|
7
|
+
* at runtime, so the CLI imports this committed copy instead.
|
|
8
|
+
*
|
|
9
|
+
* Regenerate with:
|
|
10
|
+
* node cli/scripts/gen-schema-descriptor.mjs (runs at CLI prebuild)
|
|
11
|
+
*
|
|
12
|
+
* A CI freshness guard
|
|
13
|
+
* (`cli/scripts/gen-schema-descriptor.mjs --check`, also asserted by
|
|
14
|
+
* `cli/tests/unit/schema-codegen-descriptor-drift-guard.test.ts`) fails if
|
|
15
|
+
* this committed copy does not match the source — see issue #1442 / #998.
|
|
16
|
+
*/
|
|
17
|
+
/** The two projections of a db3 model, in the order messages list them. */
|
|
18
|
+
export declare const DB3_PROJECTIONS: readonly ["row", "declared"];
|
|
19
|
+
/** A projection of a db3 model. */
|
|
20
|
+
export type Db3Projection = (typeof DB3_PROJECTIONS)[number];
|
|
21
|
+
/** A db3 type as the bridge reads it. */
|
|
22
|
+
export interface Db3BridgeType {
|
|
23
|
+
/** The type's name, as a ref spells it. */
|
|
24
|
+
name: string;
|
|
25
|
+
/** The parsed `[models.*]` tables. */
|
|
26
|
+
models: unknown;
|
|
27
|
+
/** The type's `timestamps`: the create and update stamp names, and the models they are limited to. */
|
|
28
|
+
timestamps?: {
|
|
29
|
+
create?: unknown;
|
|
30
|
+
update?: unknown;
|
|
31
|
+
models?: unknown;
|
|
32
|
+
} | null;
|
|
33
|
+
/** The type's `autoPopulatedFields`, by field name. */
|
|
34
|
+
autoPopulatedFields?: Readonly<Record<string, unknown>> | null;
|
|
35
|
+
}
|
|
36
|
+
/** A projected model, or why the model cannot be bridged. */
|
|
37
|
+
export type Db3ProjectionResult = {
|
|
38
|
+
ok: true;
|
|
39
|
+
schema: Record<string, unknown>;
|
|
40
|
+
} | {
|
|
41
|
+
ok: false;
|
|
42
|
+
reason: string;
|
|
43
|
+
};
|
|
44
|
+
/** A db3 type as a family index holds it: both projections of every model it can bridge. */
|
|
45
|
+
export interface Db3TypeProjections {
|
|
46
|
+
/** The models the type declares, in declaration order. */
|
|
47
|
+
models: string[];
|
|
48
|
+
/** Each bridged model's projections, keyed `<model>/row` and `<model>/declared`. */
|
|
49
|
+
defs: Record<string, unknown>;
|
|
50
|
+
/** Why a model cannot be bridged, by model. */
|
|
51
|
+
modelErrors?: Record<string, string>;
|
|
52
|
+
/** Why the type cannot be bridged at all. */
|
|
53
|
+
error?: string;
|
|
54
|
+
}
|
|
55
|
+
/** A marker the bridge writes, read back. */
|
|
56
|
+
export interface Db3ProjectionMarker {
|
|
57
|
+
type: string;
|
|
58
|
+
model: string;
|
|
59
|
+
projection: Db3Projection;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The marker a projection carries: the projection's explicit ref,
|
|
63
|
+
* `db3:<type>#/$defs/<model>/<projection>`, the model pointer-escaped.
|
|
64
|
+
*/
|
|
65
|
+
export declare function db3ProjectionMarker(type: string, model: string, projection: Db3Projection): string;
|
|
66
|
+
/** A `$comment` read as a projection marker, or null when it is not one. */
|
|
67
|
+
export declare function parseDb3ProjectionMarker(comment: unknown): Db3ProjectionMarker | null;
|
|
68
|
+
/** The models a type declares, in declaration order; empty when its `models` is not a table. */
|
|
69
|
+
export declare function db3ModelNames(type: Db3BridgeType): string[];
|
|
70
|
+
/**
|
|
71
|
+
* One projection of one model of `type`. Refuses a model the type does not
|
|
72
|
+
* declare (listing the ones it does), a model that is not a table, and a
|
|
73
|
+
* field the field grammar refuses (naming the field and the grammar's reason).
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* db3ModelProjection({ name: "workspace", models: { tasks: { fields: { title: { type: "string", required: true } } } } }, "tasks", "declared");
|
|
77
|
+
* // → { ok: true, schema: { type: "object", properties: { title: { type: "string" } }, required: ["title"],
|
|
78
|
+
* // additionalProperties: false, $comment: "db3:workspace#/$defs/tasks/declared" } }
|
|
79
|
+
*/
|
|
80
|
+
export declare function db3ModelProjection(type: Db3BridgeType, model: string, projection: Db3Projection): Db3ProjectionResult;
|
|
81
|
+
/**
|
|
82
|
+
* Both projections of every model of `type`, as a family index's db3 slot
|
|
83
|
+
* holds them. A model that cannot be bridged keeps its reason, so a ref to it
|
|
84
|
+
* is refused naming it; a type whose `models` is not a table has none.
|
|
85
|
+
*/
|
|
86
|
+
export declare function db3TypeProjections(type: Db3BridgeType): Db3TypeProjections;
|