primitive-admin 1.2.0-alpha.14 → 1.2.0-alpha.16
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 +181 -73
- package/assets/skill/skills/primitive-platform/SKILL.md +87 -23
- package/dist/bin/primitive.js +11 -82
- 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.js +2 -0
- package/dist/src/commands/agent-sessions.js.map +1 -1
- package/dist/src/commands/analytics.js +181 -12
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps-children.js +2 -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 +11 -0
- package/dist/src/commands/apps.js +65 -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 +16 -1
- 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 +2 -0
- 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 +1 -1
- package/dist/src/commands/config.js +42 -9
- 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.js +2 -0
- package/dist/src/commands/db3-types.js.map +1 -1
- package/dist/src/commands/db3.d.ts +12 -0
- package/dist/src/commands/db3.js +408 -31
- package/dist/src/commands/db3.js.map +1 -1
- package/dist/src/commands/documents.d.ts +52 -12
- package/dist/src/commands/documents.js +120 -29
- 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 +2 -0
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/functions.js +90 -11
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/groups.js +20 -3
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +2 -0
- 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 +9 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +82 -47
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/locks.js +2 -0
- package/dist/src/commands/locks.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.js +2 -0
- 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 -47
- 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.js +2 -0
- 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/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 +344 -14
- package/dist/src/commands/sync.js +1834 -345
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +2 -0
- 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 +878 -16
- 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/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 +1354 -97
- package/dist/src/lib/api-client.js +513 -164
- 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-flow.d.ts +33 -0
- package/dist/src/lib/auth-flow.js +404 -13
- package/dist/src/lib/auth-flow.js.map +1 -1
- package/dist/src/lib/block-selector.d.ts +9 -15
- package/dist/src/lib/block-selector.js +9 -20
- package/dist/src/lib/block-selector.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/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 +6 -0
- package/dist/src/lib/config-object-descriptor.js +71 -1
- package/dist/src/lib/config-object-descriptor.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/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 +18 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js +14 -5
- 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 +51 -14
- package/dist/src/lib/db3-export.js +136 -28
- package/dist/src/lib/db3-export.js.map +1 -1
- package/dist/src/lib/db3-index-output.d.ts +92 -4
- package/dist/src/lib/db3-index-output.js +183 -11
- package/dist/src/lib/db3-index-output.js.map +1 -1
- package/dist/src/lib/db3-type-models.d.ts +49 -7
- package/dist/src/lib/db3-type-models.js +159 -28
- package/dist/src/lib/db3-type-models.js.map +1 -1
- package/dist/src/lib/deprecation.d.ts +2 -2
- package/dist/src/lib/deprecation.js +2 -2
- 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 +1 -1
- package/dist/src/lib/function-authorize-check.js +2 -1
- package/dist/src/lib/function-authorize-check.js.map +1 -1
- package/dist/src/lib/function-authorize-view.d.ts +12 -0
- package/dist/src/lib/function-authorize-view.js +38 -0
- package/dist/src/lib/function-authorize-view.js.map +1 -1
- package/dist/src/lib/function-bundle.d.ts +27 -5
- package/dist/src/lib/function-bundle.js +106 -7
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +15 -0
- package/dist/src/lib/function-collect.js +73 -14
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +63 -40
- package/dist/src/lib/function-db-types.js +289 -293
- 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 +24 -1
- package/dist/src/lib/function-lint.js +123 -1
- package/dist/src/lib/function-lint.js.map +1 -1
- package/dist/src/lib/function-run.d.ts +1 -1
- package/dist/src/lib/function-run.js +1 -1
- package/dist/src/lib/function-run.js.map +1 -1
- package/dist/src/lib/function-schema-codegen.d.ts +85 -21
- package/dist/src/lib/function-schema-codegen.js +191 -85
- 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 +38 -4
- package/dist/src/lib/function-sync.js +91 -14
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-typecheck.d.ts +52 -0
- package/dist/src/lib/function-typecheck.js +171 -54
- package/dist/src/lib/function-typecheck.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 +239 -14
- package/dist/src/lib/generated-config-surfaces.js +670 -85
- 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/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/log-inspection.d.ts +4 -1
- package/dist/src/lib/log-inspection.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/output.d.ts +1 -1
- package/dist/src/lib/output.js +1 -1
- 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/prompt-schema-codegen.d.ts +36 -12
- package/dist/src/lib/prompt-schema-codegen.js +94 -98
- 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 +12 -2
- package/dist/src/lib/records-verbs.js +7 -2
- package/dist/src/lib/records-verbs.js.map +1 -1
- 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/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 +129 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +154 -1
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js.map +1 -1
- 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/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 +40 -13
- package/dist/src/lib/schema-codegen/schemaToTs.js +124 -160
- package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -1
- 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/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 +24 -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 +168 -50
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +31 -7
- package/dist/src/lib/swift-codegen/schemaToSwift.js +213 -177
- 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/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 +37 -5
- package/dist/src/lib/sync-resource-types.js +50 -5
- 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/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/toml-database-config.d.ts +2 -1
- package/dist/src/lib/toml-database-config.js +7 -4
- 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/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 +13 -34
- package/package.json +5 -3
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* `cli/tests/unit/config-surface-drift-guard.test.ts`) fails if this committed
|
|
15
15
|
* copy does not match the source.
|
|
16
16
|
*/
|
|
17
|
+
import { ONEOF_SIBLING_CONSTRAINT_KEYS, SCHEMA_KEYWORDS, refusedSchemaKeywords, } from "./schema-codegen/generated-schema-descriptor.js";
|
|
17
18
|
// ── src/config-surface/helpers.ts ────────────────────────────────────────
|
|
18
19
|
/**
|
|
19
20
|
* Shared spellings used by every configuration-object definition (issue #2644).
|
|
@@ -2761,12 +2762,36 @@ export const RETIRED_TOML_SPELLINGS = {
|
|
|
2761
2762
|
reasoningBudget: flatChatKeySpelling("reasoningBudget", true),
|
|
2762
2763
|
},
|
|
2763
2764
|
};
|
|
2765
|
+
// #5993 — a db3 type takes no rule set. Nothing evaluates one: every
|
|
2766
|
+
// `db3-types` route is for app admins and owners, who bypass rule sets. The
|
|
2767
|
+
// database type file still takes `ruleSetName`, and its `ruleSetId` keeps the
|
|
2768
|
+
// #3997 sentence, so these are keyed by the db3 type's surface.
|
|
2769
|
+
const DB3_TYPE_RULE_SET_SENTENCE = "A db3 type takes no rule set: nothing evaluated the one this line names, " +
|
|
2770
|
+
"and managing a type is for app admins and owners. Delete the line and " +
|
|
2771
|
+
"push again (`config pull` rewrites the file without it).";
|
|
2772
|
+
/**
|
|
2773
|
+
* Guidance keyed by surface label, then TOML prefix, then key — consulted
|
|
2774
|
+
* before `RETIRED_CONFIG_KEYS` and `RETIRED_TOML_SPELLINGS` when the caller
|
|
2775
|
+
* knows the surface.
|
|
2776
|
+
*/
|
|
2777
|
+
export const RETIRED_SURFACE_TOML_KEYS = {
|
|
2778
|
+
"db3-type": {
|
|
2779
|
+
type: {
|
|
2780
|
+
ruleSetName: { toml: DB3_TYPE_RULE_SET_SENTENCE, emptyAccepted: true },
|
|
2781
|
+
ruleSetId: { toml: DB3_TYPE_RULE_SET_SENTENCE },
|
|
2782
|
+
},
|
|
2783
|
+
},
|
|
2784
|
+
};
|
|
2764
2785
|
/**
|
|
2765
|
-
* The TOML guidance for `key` under `prefix`:
|
|
2766
|
-
*
|
|
2786
|
+
* The TOML guidance for `key` under `prefix`: the surface's own when
|
|
2787
|
+
* `surfaceLabel` names one, else a fully retired key's, else a retired
|
|
2788
|
+
* spelling's, else null when the key is simply unknown.
|
|
2767
2789
|
*/
|
|
2768
|
-
export function retiredTomlKey(prefix, key) {
|
|
2769
|
-
return (
|
|
2790
|
+
export function retiredTomlKey(prefix, key, surfaceLabel) {
|
|
2791
|
+
return ((surfaceLabel ? RETIRED_SURFACE_TOML_KEYS[surfaceLabel]?.[prefix]?.[key] : undefined) ??
|
|
2792
|
+
retiredConfigKey(prefix, key) ??
|
|
2793
|
+
RETIRED_TOML_SPELLINGS[prefix]?.[key] ??
|
|
2794
|
+
null);
|
|
2770
2795
|
}
|
|
2771
2796
|
// ── src/config-surface/function-grants.ts ────────────────────────────────
|
|
2772
2797
|
/**
|
|
@@ -3606,6 +3631,20 @@ function parseManifestCallers(raw, errors) {
|
|
|
3606
3631
|
if (raw.db3 !== undefined && typeof raw.db3 !== "boolean") {
|
|
3607
3632
|
errors.push("the manifest's `authorize.callers.db3` must be a boolean when present.");
|
|
3608
3633
|
}
|
|
3634
|
+
const usersBatch = raw.usersBatch;
|
|
3635
|
+
if (usersBatch !== undefined && typeof usersBatch !== "boolean") {
|
|
3636
|
+
if (!Array.isArray(usersBatch) || usersBatch.some((k) => typeof k !== "string")) {
|
|
3637
|
+
errors.push("the manifest's `authorize.callers.usersBatch` must be a boolean or an array of function keys when present.");
|
|
3638
|
+
}
|
|
3639
|
+
else if (usersBatch.length > MAX_MANIFEST_CALLER_FUNCTIONS) {
|
|
3640
|
+
errors.push(`the manifest's \`authorize.callers.usersBatch\` lists ${usersBatch.length} keys, over the ` +
|
|
3641
|
+
`${MAX_MANIFEST_CALLER_FUNCTIONS} limit.`);
|
|
3642
|
+
}
|
|
3643
|
+
else if (usersBatch.some((k) => k === "" || k.length > MAX_MANIFEST_NAME_LENGTH)) {
|
|
3644
|
+
errors.push("the manifest's `authorize.callers.usersBatch` carries a key that is empty or over " +
|
|
3645
|
+
`${MAX_MANIFEST_NAME_LENGTH} characters.`);
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3609
3648
|
if (errors.length > before)
|
|
3610
3649
|
return null;
|
|
3611
3650
|
return {
|
|
@@ -3616,6 +3655,9 @@ function parseManifestCallers(raw, errors) {
|
|
|
3616
3655
|
agents: raw.agents,
|
|
3617
3656
|
users: raw.users,
|
|
3618
3657
|
...(raw.db3 !== undefined ? { db3: raw.db3 } : {}),
|
|
3658
|
+
...(usersBatch !== undefined
|
|
3659
|
+
? { usersBatch: Array.isArray(usersBatch) ? [...new Set(usersBatch)].sort() : usersBatch }
|
|
3660
|
+
: {}),
|
|
3619
3661
|
};
|
|
3620
3662
|
}
|
|
3621
3663
|
/**
|
|
@@ -6653,33 +6695,23 @@ const GEMINI_TYPES = [
|
|
|
6653
6695
|
"array",
|
|
6654
6696
|
];
|
|
6655
6697
|
/**
|
|
6656
|
-
*
|
|
6657
|
-
*
|
|
6658
|
-
*
|
|
6698
|
+
* What Gemini's function `Schema` does with one keyword, from the keyword
|
|
6699
|
+
* table: `pass` (spelled the same way, with the same meaning — `required`
|
|
6700
|
+
* among them, and Gemini's own `nullable`, `propertyOrdering` and `example`),
|
|
6701
|
+
* `drop` (an annotation with no value meaning, dropped in silence, spec §3),
|
|
6702
|
+
* `rule` (handled by its own rule below) or `refuse`. A key the table does not
|
|
6703
|
+
* name is refused: a keyword nobody classified could mean anything.
|
|
6659
6704
|
*/
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
"maxItems",
|
|
6671
|
-
"minProperties",
|
|
6672
|
-
"maxProperties",
|
|
6673
|
-
"required",
|
|
6674
|
-
// Gemini's own spellings, accepted as authored.
|
|
6675
|
-
"nullable",
|
|
6676
|
-
"propertyOrdering",
|
|
6677
|
-
"example",
|
|
6678
|
-
];
|
|
6679
|
-
/** Annotations with no value meaning: dropped in silence (spec §3). */
|
|
6680
|
-
const GEMINI_DROPPED_KEYWORDS = ["$schema", "$id", "$comment"];
|
|
6681
|
-
/** Keywords handled by their own rule below, not by the tables. */
|
|
6682
|
-
const GEMINI_STRUCTURAL_KEYWORDS = [
|
|
6705
|
+
export function geminiKeywordVerdict(keyword) {
|
|
6706
|
+
return Object.prototype.hasOwnProperty.call(SCHEMA_KEYWORDS, keyword)
|
|
6707
|
+
? SCHEMA_KEYWORDS[keyword].gemini
|
|
6708
|
+
: "refuse";
|
|
6709
|
+
}
|
|
6710
|
+
/**
|
|
6711
|
+
* Keywords handled by their own rule below: exactly the table's `rule` rows,
|
|
6712
|
+
* which the keyword-table conformance test holds it to.
|
|
6713
|
+
*/
|
|
6714
|
+
export const GEMINI_STRUCTURAL_KEYWORDS = [
|
|
6683
6715
|
"type",
|
|
6684
6716
|
"enum",
|
|
6685
6717
|
"const",
|
|
@@ -6700,10 +6732,12 @@ const GEMINI_FORMATS = [
|
|
|
6700
6732
|
"double",
|
|
6701
6733
|
];
|
|
6702
6734
|
/**
|
|
6703
|
-
*
|
|
6704
|
-
*
|
|
6735
|
+
* Why Gemini's function `Schema` cannot carry a refused keyword, for the ones
|
|
6736
|
+
* with a reason of their own. Each is refused rather than dropped: dropping any
|
|
6737
|
+
* of them widens what the model may produce. A refused keyword with no entry
|
|
6738
|
+
* here gets the generic reason.
|
|
6705
6739
|
*/
|
|
6706
|
-
const
|
|
6740
|
+
export const GEMINI_REFUSAL_REASONS = {
|
|
6707
6741
|
$ref: "Gemini's function Schema has no $ref — inline the referenced schema",
|
|
6708
6742
|
$defs: "Gemini's function Schema has no $defs — inline each definition where it is used",
|
|
6709
6743
|
definitions: "Gemini's function Schema has no definitions — inline each definition where it is used",
|
|
@@ -6730,21 +6764,10 @@ const GEMINI_REFUSED_KEYWORDS = {
|
|
|
6730
6764
|
writeOnly: "Gemini's function Schema has no writeOnly — drop it, or say so in description",
|
|
6731
6765
|
deprecated: "Gemini's function Schema has no deprecated — say so in description",
|
|
6732
6766
|
};
|
|
6733
|
-
/**
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
* discriminated union is, restated here because that module is vendored
|
|
6738
|
-
* separately and cannot be imported from `src/config-surface/`.
|
|
6739
|
-
*/
|
|
6740
|
-
const ONEOF_SIBLING_KEYWORDS = [
|
|
6741
|
-
"type",
|
|
6742
|
-
"properties",
|
|
6743
|
-
"required",
|
|
6744
|
-
"additionalProperties",
|
|
6745
|
-
"items",
|
|
6746
|
-
"enum",
|
|
6747
|
-
];
|
|
6767
|
+
/** The reason a key the table does not classify, or classifies without one, is refused. */
|
|
6768
|
+
const GEMINI_UNCLASSIFIED_REASON = "is not a keyword Gemini's function Schema carries, and dropping a " +
|
|
6769
|
+
"keyword whose meaning the platform does not know could widen what the " +
|
|
6770
|
+
"model may produce";
|
|
6748
6771
|
function isPlainSchemaObject(value) {
|
|
6749
6772
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6750
6773
|
}
|
|
@@ -6811,7 +6834,10 @@ function discriminatedOneOf(node, members) {
|
|
|
6811
6834
|
'members, every one of them type = "object"',
|
|
6812
6835
|
};
|
|
6813
6836
|
}
|
|
6814
|
-
|
|
6837
|
+
// Sibling keywords that make a `oneOf` node a MIXED schema rather than a
|
|
6838
|
+
// clean tagged union: `describeSchema`'s own list, the platform's rule for
|
|
6839
|
+
// what a discriminated union is.
|
|
6840
|
+
const sibling = ONEOF_SIBLING_CONSTRAINT_KEYS.filter((key) => Object.prototype.hasOwnProperty.call(node, key));
|
|
6815
6841
|
if (sibling.length > 0) {
|
|
6816
6842
|
return {
|
|
6817
6843
|
ok: false,
|
|
@@ -6893,7 +6919,8 @@ function translateGeminiNode(node, path, out) {
|
|
|
6893
6919
|
// ── Pass one: the tables, in the author's own key order ────────────────
|
|
6894
6920
|
const deferred = new Set();
|
|
6895
6921
|
for (const key of Object.keys(node)) {
|
|
6896
|
-
|
|
6922
|
+
const verdict = geminiKeywordVerdict(key);
|
|
6923
|
+
if (verdict === "drop")
|
|
6897
6924
|
continue;
|
|
6898
6925
|
if (key === "additionalProperties") {
|
|
6899
6926
|
// Dropped for `false` and `true` alike: Gemini has no closed-object
|
|
@@ -6908,22 +6935,19 @@ function translateGeminiNode(node, path, out) {
|
|
|
6908
6935
|
"but the platform validates the original schema)");
|
|
6909
6936
|
continue;
|
|
6910
6937
|
}
|
|
6911
|
-
if (
|
|
6912
|
-
refuse(key, GEMINI_REFUSED_KEYWORDS[key]);
|
|
6913
|
-
continue;
|
|
6914
|
-
}
|
|
6915
|
-
if (GEMINI_PASS_KEYWORDS.includes(key)) {
|
|
6938
|
+
if (verdict === "pass") {
|
|
6916
6939
|
result[key] = schemaCopy(node[key]);
|
|
6917
6940
|
continue;
|
|
6918
6941
|
}
|
|
6919
|
-
if (GEMINI_STRUCTURAL_KEYWORDS.includes(key)) {
|
|
6942
|
+
if (verdict === "rule" && GEMINI_STRUCTURAL_KEYWORDS.includes(key)) {
|
|
6920
6943
|
deferred.add(key);
|
|
6921
6944
|
continue;
|
|
6922
6945
|
}
|
|
6923
|
-
// Fail closed: a keyword nobody classified could mean
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6946
|
+
// Fail closed: a refused keyword, or one nobody classified, could mean
|
|
6947
|
+
// anything to the model.
|
|
6948
|
+
refuse(key, Object.prototype.hasOwnProperty.call(GEMINI_REFUSAL_REASONS, key)
|
|
6949
|
+
? GEMINI_REFUSAL_REASONS[key]
|
|
6950
|
+
: GEMINI_UNCLASSIFIED_REASON);
|
|
6927
6951
|
}
|
|
6928
6952
|
// ── Pass two: the structural keywords, in a fixed order ────────────────
|
|
6929
6953
|
if (deferred.has("enum")) {
|
|
@@ -7368,6 +7392,324 @@ export function agentSchemaDeficitRefusal(deficit) {
|
|
|
7368
7392
|
`rewrite the schema, or archive every ${provider} config of this prompt`,
|
|
7369
7393
|
};
|
|
7370
7394
|
}
|
|
7395
|
+
// ── src/config-surface/prompt-schema-refusals.ts ─────────────────────────
|
|
7396
|
+
/**
|
|
7397
|
+
* What a prompt push refuses — #5536 (project `unified-schemas` phase 5)
|
|
7398
|
+
* reported it, #5538 (phase 6, intent criterion 8) refuses it.
|
|
7399
|
+
*
|
|
7400
|
+
* Two checks judge a prompt's schemas: the lossless Gemini translator
|
|
7401
|
+
* (`translateSchemaForProvider`) on the output schemas a Gemini config sends,
|
|
7402
|
+
* and the engine (the function push's rules) on every schema. A write
|
|
7403
|
+
* carrying a keyword either would refuse is refused, each keyword named with
|
|
7404
|
+
* its fix and a code: `PROMPT_SCHEMA_NOT_TRANSLATABLE` for the translator,
|
|
7405
|
+
* `PROMPT_SCHEMA_UNSUPPORTED_KEYWORD` for the engine. The admin prompt routes,
|
|
7406
|
+
* the CLI preflight (through the vendored copy), the Gemini call path and the
|
|
7407
|
+
* audit (`scripts/lib/schema-audit-core.ts`) all read this module, so they
|
|
7408
|
+
* cannot disagree about which schemas are refused.
|
|
7409
|
+
*
|
|
7410
|
+
* An agent's translator refusals are not here: they are already the push
|
|
7411
|
+
* error `AGENT_SCHEMA_NOT_TRANSLATABLE` (DSO-5536-002).
|
|
7412
|
+
*/
|
|
7413
|
+
/**
|
|
7414
|
+
* The code a prompt write is refused with for a keyword the lossless Gemini
|
|
7415
|
+
* translator cannot carry, and the code a run of a stored prompt whose output
|
|
7416
|
+
* schema it cannot carry fails with.
|
|
7417
|
+
*/
|
|
7418
|
+
export const PROMPT_SCHEMA_NOT_TRANSLATABLE = "PROMPT_SCHEMA_NOT_TRANSLATABLE";
|
|
7419
|
+
/** The code a prompt write is refused with for a keyword or a shape the schema check would not enforce. */
|
|
7420
|
+
export const PROMPT_SCHEMA_UNSUPPORTED_KEYWORD = "PROMPT_SCHEMA_UNSUPPORTED_KEYWORD";
|
|
7421
|
+
/**
|
|
7422
|
+
* The fix for each keyword the engine refuses: one entry per refused row of
|
|
7423
|
+
* the keyword table, and no other key.
|
|
7424
|
+
*/
|
|
7425
|
+
export const ENGINE_REFUSAL_FIXES = {
|
|
7426
|
+
$dynamicRef: "Write a local $ref to #/$defs/<Name> instead",
|
|
7427
|
+
$recursiveRef: "Write a local $ref to #/$defs/<Name> instead",
|
|
7428
|
+
allOf: "Merge the members into one schema",
|
|
7429
|
+
not: "State what is allowed instead",
|
|
7430
|
+
if: "Declare a discriminated oneOf instead",
|
|
7431
|
+
then: "Declare a discriminated oneOf instead",
|
|
7432
|
+
else: "Declare a discriminated oneOf instead",
|
|
7433
|
+
patternProperties: "Name the properties",
|
|
7434
|
+
propertyNames: "Name the properties",
|
|
7435
|
+
dependencies: "Declare a discriminated oneOf instead",
|
|
7436
|
+
dependentRequired: "Declare a discriminated oneOf instead",
|
|
7437
|
+
dependentSchemas: "Declare a discriminated oneOf instead",
|
|
7438
|
+
unevaluatedProperties: "Use additionalProperties: false instead",
|
|
7439
|
+
contains: "Declare items, and bound the count with minItems/maxItems",
|
|
7440
|
+
minContains: "Declare items, and bound the count with minItems/maxItems",
|
|
7441
|
+
maxContains: "Declare items, and bound the count with minItems/maxItems",
|
|
7442
|
+
prefixItems: "Declare one items schema",
|
|
7443
|
+
additionalItems: "Declare one items schema",
|
|
7444
|
+
unevaluatedItems: "Declare one items schema",
|
|
7445
|
+
};
|
|
7446
|
+
/**
|
|
7447
|
+
* The fix for a translator refusal whose reason states only what would be
|
|
7448
|
+
* lost, appended to the refusal line (DSO-5536-008: the translator's own
|
|
7449
|
+
* texts are refusal texts elsewhere and stay as they are). `"*"` is the fix
|
|
7450
|
+
* for a keyword the translator has no reason of its own for.
|
|
7451
|
+
*/
|
|
7452
|
+
export const TRANSLATOR_REFUSAL_FIXES = {
|
|
7453
|
+
exclusiveMinimum: "for an integer, write minimum one above the bound; otherwise drop it and check the bound in the code that reads the answer, or run the prompt on a non-Gemini config",
|
|
7454
|
+
exclusiveMaximum: "for an integer, write maximum one below the bound; otherwise drop it and check the bound in the code that reads the answer, or run the prompt on a non-Gemini config",
|
|
7455
|
+
multipleOf: "drop it and check the value in the code that reads the answer, or run the prompt on a non-Gemini config",
|
|
7456
|
+
uniqueItems: "drop it and de-duplicate in the code that reads the answer, or run the prompt on a non-Gemini config",
|
|
7457
|
+
"*": "remove the keyword, or run the prompt on a non-Gemini config",
|
|
7458
|
+
};
|
|
7459
|
+
/** The type names the engine reads. */
|
|
7460
|
+
const ENGINE_SCHEMA_TYPES = ["object", "array", "string", "number", "integer", "boolean", "null"];
|
|
7461
|
+
function isJudgedSchemaObject(value) {
|
|
7462
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
7463
|
+
}
|
|
7464
|
+
function judgedPath(path, segment) {
|
|
7465
|
+
if (segment.startsWith("["))
|
|
7466
|
+
return `${path}${segment}`;
|
|
7467
|
+
return path ? `${path}.${segment}` : segment;
|
|
7468
|
+
}
|
|
7469
|
+
/**
|
|
7470
|
+
* Every keyword of `schema` the function push's rules refuse, over the nodes
|
|
7471
|
+
* they check (the root, `properties`, `items`, `anyOf`, `oneOf`; never
|
|
7472
|
+
* `$defs`): the keyword table's refused class, each reason ending with its
|
|
7473
|
+
* fix, and the shape rules. An enforced constraint (`uniqueItems`,
|
|
7474
|
+
* `multipleOf`, …) is never one: only the translator refuses those.
|
|
7475
|
+
*
|
|
7476
|
+
* The walk keeps its own work stack rather than recursing: the compiler
|
|
7477
|
+
* accepts a schema nested deeper than the call stack, and every refusal must
|
|
7478
|
+
* still be named for it.
|
|
7479
|
+
*/
|
|
7480
|
+
export function engineSchemaRefusals(schema, path = "") {
|
|
7481
|
+
const out = [];
|
|
7482
|
+
const work = [{ node: schema, path }];
|
|
7483
|
+
while (work.length > 0) {
|
|
7484
|
+
const step = work.pop();
|
|
7485
|
+
if ("refusal" in step) {
|
|
7486
|
+
out.push(step.refusal);
|
|
7487
|
+
continue;
|
|
7488
|
+
}
|
|
7489
|
+
// A node's steps in report order, pushed reversed so they pop in order.
|
|
7490
|
+
const steps = [];
|
|
7491
|
+
const fault = (keyword, reason) => steps.push({ refusal: { path: step.path, keyword, reason } });
|
|
7492
|
+
const node = step.node;
|
|
7493
|
+
if (!isJudgedSchemaObject(node)) {
|
|
7494
|
+
fault("(schema)", "must be a JSON Schema object");
|
|
7495
|
+
}
|
|
7496
|
+
else {
|
|
7497
|
+
for (const keyword of refusedSchemaKeywords()) {
|
|
7498
|
+
if (Object.prototype.hasOwnProperty.call(node, keyword)) {
|
|
7499
|
+
fault(keyword, `${keyword} is not supported: the schema check would not enforce it. ${ENGINE_REFUSAL_FIXES[keyword]}`);
|
|
7500
|
+
}
|
|
7501
|
+
}
|
|
7502
|
+
if (node.additionalProperties !== undefined && typeof node.additionalProperties !== "boolean") {
|
|
7503
|
+
fault("additionalProperties", "must be true or false; a schema for the extra properties is not supported");
|
|
7504
|
+
}
|
|
7505
|
+
if (node.type !== undefined) {
|
|
7506
|
+
const types = Array.isArray(node.type) ? node.type : [node.type];
|
|
7507
|
+
if (types.length === 0)
|
|
7508
|
+
fault("type", "must name at least one JSON Schema type");
|
|
7509
|
+
const unknown = types.find((type) => !ENGINE_SCHEMA_TYPES.includes(type));
|
|
7510
|
+
if (unknown !== undefined)
|
|
7511
|
+
fault("type", `must be one of ${ENGINE_SCHEMA_TYPES.join(", ")}, not ${JSON.stringify(unknown)}`);
|
|
7512
|
+
}
|
|
7513
|
+
if (node.enum !== undefined && !Array.isArray(node.enum))
|
|
7514
|
+
fault("enum", "must be an array of allowed values");
|
|
7515
|
+
if (node.required !== undefined && (!Array.isArray(node.required) || node.required.some((name) => typeof name !== "string"))) {
|
|
7516
|
+
fault("required", "must be an array of property names");
|
|
7517
|
+
}
|
|
7518
|
+
if (node.properties !== undefined) {
|
|
7519
|
+
if (!isJudgedSchemaObject(node.properties)) {
|
|
7520
|
+
fault("properties", "must be an object of property schemas");
|
|
7521
|
+
}
|
|
7522
|
+
else {
|
|
7523
|
+
for (const [name, child] of Object.entries(node.properties)) {
|
|
7524
|
+
steps.push({ node: child, path: judgedPath(judgedPath(step.path, "properties"), name) });
|
|
7525
|
+
}
|
|
7526
|
+
}
|
|
7527
|
+
}
|
|
7528
|
+
if (node.items !== undefined) {
|
|
7529
|
+
if (Array.isArray(node.items))
|
|
7530
|
+
fault("items", "must be one schema for every item; a list of item schemas is not supported");
|
|
7531
|
+
else
|
|
7532
|
+
steps.push({ node: node.items, path: judgedPath(step.path, "items") });
|
|
7533
|
+
}
|
|
7534
|
+
for (const keyword of ["anyOf", "oneOf"]) {
|
|
7535
|
+
const value = node[keyword];
|
|
7536
|
+
if (value === undefined)
|
|
7537
|
+
continue;
|
|
7538
|
+
if (!Array.isArray(value)) {
|
|
7539
|
+
fault(keyword, "must be an array of schemas");
|
|
7540
|
+
continue;
|
|
7541
|
+
}
|
|
7542
|
+
value.forEach((child, index) => steps.push({ node: child, path: judgedPath(judgedPath(step.path, keyword), `[${index}]`) }));
|
|
7543
|
+
}
|
|
7544
|
+
}
|
|
7545
|
+
for (let i = steps.length - 1; i >= 0; i--)
|
|
7546
|
+
work.push(steps[i]);
|
|
7547
|
+
}
|
|
7548
|
+
return out;
|
|
7549
|
+
}
|
|
7550
|
+
/**
|
|
7551
|
+
* The schemas an agent's model reads from its declaration (a table or one
|
|
7552
|
+
* JSON string): each client tool's `inputSchema` and `outputSchema`, each
|
|
7553
|
+
* event's `schema` and the turn context's. Never a server tool's: those are
|
|
7554
|
+
* its function's, judged at the function push.
|
|
7555
|
+
*/
|
|
7556
|
+
export function agentDeclarationSchemas(agent) {
|
|
7557
|
+
const declaration = parseAgentDeclarationBlock(agent);
|
|
7558
|
+
if (!declaration)
|
|
7559
|
+
return [];
|
|
7560
|
+
const out = [];
|
|
7561
|
+
for (const tool of Array.isArray(declaration.tools) ? declaration.tools : []) {
|
|
7562
|
+
if (!isJudgedSchemaObject(tool) || (typeof tool.function === "string" && tool.function.trim() !== ""))
|
|
7563
|
+
continue;
|
|
7564
|
+
for (const which of ["inputSchema", "outputSchema"]) {
|
|
7565
|
+
if (tool[which] !== undefined)
|
|
7566
|
+
out.push({ subject: `agent tool "${String(tool.name)}" ${which}`, schema: tool[which] });
|
|
7567
|
+
}
|
|
7568
|
+
}
|
|
7569
|
+
for (const event of Array.isArray(declaration.events) ? declaration.events : []) {
|
|
7570
|
+
if (isJudgedSchemaObject(event) && event.schema !== undefined)
|
|
7571
|
+
out.push({ subject: `agent event "${String(event.name)}" schema`, schema: event.schema });
|
|
7572
|
+
}
|
|
7573
|
+
const turnContext = declaration.turnContext;
|
|
7574
|
+
if (isJudgedSchemaObject(turnContext) && turnContext.schema !== undefined)
|
|
7575
|
+
out.push({ subject: "agent turnContext.schema", schema: turnContext.schema });
|
|
7576
|
+
return out;
|
|
7577
|
+
}
|
|
7578
|
+
/**
|
|
7579
|
+
* A schema field's value as judged: `undefined` for an absent or cleared one
|
|
7580
|
+
* (`null`, `""`), a JSON-string spelling parsed, a string that does not parse
|
|
7581
|
+
* kept as it is (the engine reports it as no schema object).
|
|
7582
|
+
*/
|
|
7583
|
+
function judgedSchemaValue(value) {
|
|
7584
|
+
if (value === undefined || value === null || value === "")
|
|
7585
|
+
return undefined;
|
|
7586
|
+
if (typeof value !== "string")
|
|
7587
|
+
return value;
|
|
7588
|
+
try {
|
|
7589
|
+
return JSON.parse(value);
|
|
7590
|
+
}
|
|
7591
|
+
catch {
|
|
7592
|
+
return value;
|
|
7593
|
+
}
|
|
7594
|
+
}
|
|
7595
|
+
/** A config the server would store as non-archived on Gemini: status and provider read as the write normalizes them. */
|
|
7596
|
+
function isLiveGemini(config) {
|
|
7597
|
+
return (String(config.status ?? "active").trim().toLowerCase() !== "archived" &&
|
|
7598
|
+
String(config.provider).trim().toLowerCase() === "gemini");
|
|
7599
|
+
}
|
|
7600
|
+
/** The reason a schema nested deeper than the translator's walk is refused with. */
|
|
7601
|
+
const TRANSLATOR_OVERFLOW_REASON = "is nested deeper than the translator walks; flatten the schema";
|
|
7602
|
+
/**
|
|
7603
|
+
* `translateSchemaForProvider(schema, "gemini")`, failing closed. The
|
|
7604
|
+
* translator recurses, so a schema nested deeper than the call stack cannot be
|
|
7605
|
+
* translated: it is one refusal about the whole document (`(schema)`, the
|
|
7606
|
+
* engine's spelling), so a schema Gemini would never be sent is refused at
|
|
7607
|
+
* push and at call time rather than accepted unread. Any other error is a
|
|
7608
|
+
* fault and propagates.
|
|
7609
|
+
*/
|
|
7610
|
+
export function translateSchemaForGemini(schema) {
|
|
7611
|
+
try {
|
|
7612
|
+
return translateSchemaForProvider(schema, "gemini");
|
|
7613
|
+
}
|
|
7614
|
+
catch (error) {
|
|
7615
|
+
if (error instanceof RangeError) {
|
|
7616
|
+
return { ok: false, refusals: [{ path: "", keyword: "(schema)", reason: TRANSLATOR_OVERFLOW_REASON }] };
|
|
7617
|
+
}
|
|
7618
|
+
throw error;
|
|
7619
|
+
}
|
|
7620
|
+
}
|
|
7621
|
+
/** The translator's refusals for one schema: `translateSchemaForGemini`'s, or none. */
|
|
7622
|
+
export function translatorRefusals(schema) {
|
|
7623
|
+
const translated = translateSchemaForGemini(schema);
|
|
7624
|
+
return translated.ok === false ? translated.refusals : [];
|
|
7625
|
+
}
|
|
7626
|
+
/**
|
|
7627
|
+
* Every keyword of a prompt's schemas the translator or the engine would
|
|
7628
|
+
* refuse. The translator judges `outputSchema` when a non-archived config
|
|
7629
|
+
* names Gemini (case-insensitive), and each Gemini config's own
|
|
7630
|
+
* `outputSchema` unless that config is archived; `inputSchema` is never
|
|
7631
|
+
* translated, and an agent's schemas are judged by the engine only. Order:
|
|
7632
|
+
* `inputSchema`, `outputSchema`, the agent's schemas, then each config; per
|
|
7633
|
+
* schema the translator first. A top-level value that is no schema object
|
|
7634
|
+
* is reported once, by the engine.
|
|
7635
|
+
*/
|
|
7636
|
+
export function promptSchemaDeficits(input) {
|
|
7637
|
+
const configs = input.configs ?? [];
|
|
7638
|
+
const out = [];
|
|
7639
|
+
const judge = (subject, field, value, translate, config) => {
|
|
7640
|
+
const schema = judgedSchemaValue(value);
|
|
7641
|
+
if (schema === undefined)
|
|
7642
|
+
return;
|
|
7643
|
+
const where = config === undefined ? { subject, field } : { subject, field, config };
|
|
7644
|
+
if (translate && isJudgedSchemaObject(schema)) {
|
|
7645
|
+
for (const refusal of translatorRefusals(schema))
|
|
7646
|
+
out.push({ ...where, check: "translator", provider: "gemini", ...refusal });
|
|
7647
|
+
}
|
|
7648
|
+
for (const refusal of engineSchemaRefusals(schema))
|
|
7649
|
+
out.push({ ...where, check: "engine", ...refusal });
|
|
7650
|
+
};
|
|
7651
|
+
judge("inputSchema", "inputSchema", input.inputSchema, false);
|
|
7652
|
+
judge("outputSchema", "outputSchema", input.outputSchema, configs.some(isLiveGemini));
|
|
7653
|
+
if (judgedSchemaValue(input.agent) !== undefined) {
|
|
7654
|
+
for (const { subject, schema } of agentDeclarationSchemas(input.agent)) {
|
|
7655
|
+
for (const refusal of engineSchemaRefusals(schema))
|
|
7656
|
+
out.push({ subject, field: "agent", check: "engine", ...refusal });
|
|
7657
|
+
}
|
|
7658
|
+
}
|
|
7659
|
+
for (const config of configs) {
|
|
7660
|
+
judge(`config "${config.name}" outputSchema`, "outputSchema", config.outputSchema, isLiveGemini(config), config.name);
|
|
7661
|
+
}
|
|
7662
|
+
return out;
|
|
7663
|
+
}
|
|
7664
|
+
/**
|
|
7665
|
+
* The fix a translator line appends: the table's for a lossy constraint, the
|
|
7666
|
+
* default for a keyword the translator has no reason of its own for, and none
|
|
7667
|
+
* where the reason already says what to write (a keyword with a reason of its
|
|
7668
|
+
* own, or one the translator handles by its own rule).
|
|
7669
|
+
*/
|
|
7670
|
+
function translatorFix(keyword) {
|
|
7671
|
+
if (Object.prototype.hasOwnProperty.call(TRANSLATOR_REFUSAL_FIXES, keyword))
|
|
7672
|
+
return TRANSLATOR_REFUSAL_FIXES[keyword];
|
|
7673
|
+
if (Object.prototype.hasOwnProperty.call(GEMINI_REFUSAL_REASONS, keyword))
|
|
7674
|
+
return null;
|
|
7675
|
+
if (keyword === "(schema)" || GEMINI_STRUCTURAL_KEYWORDS.includes(keyword))
|
|
7676
|
+
return null;
|
|
7677
|
+
return TRANSLATOR_REFUSAL_FIXES["*"];
|
|
7678
|
+
}
|
|
7679
|
+
/**
|
|
7680
|
+
* The refusal line for one deficit: the subject, the path, the keyword, why,
|
|
7681
|
+
* and the fix. A translator reason with no fix of its own names what Gemini
|
|
7682
|
+
* needs instead (`properties`, `type`, the overflow's "flatten the schema").
|
|
7683
|
+
*/
|
|
7684
|
+
export function promptSchemaRefusalLine(deficit) {
|
|
7685
|
+
const at = `${deficit.subject} at ${schemaPathLabel(deficit.path)}`;
|
|
7686
|
+
if (deficit.check === "translator") {
|
|
7687
|
+
const fix = translatorFix(deficit.keyword);
|
|
7688
|
+
return `${at}: ${deficit.keyword} cannot be translated for gemini without losing meaning — ${deficit.reason}${fix ? `. Fix: ${fix}` : ""}`;
|
|
7689
|
+
}
|
|
7690
|
+
const named = deficit.keyword === "(schema)"
|
|
7691
|
+
? `the schema ${deficit.reason}`
|
|
7692
|
+
: deficit.reason.startsWith(`${deficit.keyword} `)
|
|
7693
|
+
? deficit.reason
|
|
7694
|
+
: `${deficit.keyword} ${deficit.reason}`;
|
|
7695
|
+
return `${at}: ${named}`;
|
|
7696
|
+
}
|
|
7697
|
+
/** The code a write is refused with for one deficit. */
|
|
7698
|
+
export function promptSchemaDeficitCode(deficit) {
|
|
7699
|
+
return deficit.check === "translator" ? PROMPT_SCHEMA_NOT_TRANSLATABLE : PROMPT_SCHEMA_UNSUPPORTED_KEYWORD;
|
|
7700
|
+
}
|
|
7701
|
+
/** A refused write's `details.refusals`: one entry per deficit, in `promptSchemaDeficits` order. */
|
|
7702
|
+
export function promptSchemaRefusals(deficits) {
|
|
7703
|
+
return deficits.map((deficit) => ({
|
|
7704
|
+
code: promptSchemaDeficitCode(deficit),
|
|
7705
|
+
message: promptSchemaRefusalLine(deficit),
|
|
7706
|
+
subject: deficit.subject,
|
|
7707
|
+
field: deficit.field,
|
|
7708
|
+
...(deficit.config !== undefined ? { config: deficit.config } : {}),
|
|
7709
|
+
path: deficit.path,
|
|
7710
|
+
keyword: deficit.keyword,
|
|
7711
|
+
}));
|
|
7712
|
+
}
|
|
7371
7713
|
// ── src/config-surface/agent-function-change.ts ──────────────────────────
|
|
7372
7714
|
/**
|
|
7373
7715
|
* A change to a server function that an agent uses — issue #4441.
|
|
@@ -7947,6 +8289,26 @@ export const PROMPT_SURFACE = {
|
|
|
7947
8289
|
writableOn: BOTH,
|
|
7948
8290
|
validation: handledBy("src/config-surface/agent-declaration.ts", "resolveAgentDeclaration", "apply"),
|
|
7949
8291
|
},
|
|
8292
|
+
// #5249 — the prompt that judges this prompt's test cases by default,
|
|
8293
|
+
// authored as its KEY and resolved to the stored id at push, as #3998
|
|
8294
|
+
// did for a test case's `evaluatorPromptKey`. The id has no TOML
|
|
8295
|
+
// spelling. Present-only (intent decision): an absent key leaves the
|
|
8296
|
+
// stored link alone, so a tree written before this keeps every link
|
|
8297
|
+
// made in the web admin, and `""` clears it.
|
|
8298
|
+
//
|
|
8299
|
+
// UPDATE_ONLY because push links through the update route, after this
|
|
8300
|
+
// push's creates, so a prompt can name an evaluator created in the same
|
|
8301
|
+
// push. The create route is unchanged: it accepts the key and ignores
|
|
8302
|
+
// it (`requestOnlyKeys` below). The resolver needs the app's prompt
|
|
8303
|
+
// listing, so it is not decidable from the file alone.
|
|
8304
|
+
{
|
|
8305
|
+
field: "defaultEvaluatorPromptId",
|
|
8306
|
+
tomlKey: "defaultEvaluatorPromptKey",
|
|
8307
|
+
type: "string",
|
|
8308
|
+
emit: "whenSet",
|
|
8309
|
+
writableOn: UPDATE_ONLY,
|
|
8310
|
+
validation: handledBy("cli/src/commands/sync.ts", "resolvePromptEvaluatorLinks", "apply"),
|
|
8311
|
+
},
|
|
7950
8312
|
],
|
|
7951
8313
|
notExposed: {
|
|
7952
8314
|
promptId: {
|
|
@@ -7993,16 +8355,32 @@ export const PROMPT_SURFACE = {
|
|
|
7993
8355
|
kind: "server-owned",
|
|
7994
8356
|
note: "Provenance stamp written when a prompt is copied from the catalog.",
|
|
7995
8357
|
},
|
|
8358
|
+
// #5534 — the authored schemas and their provenance, kept beside the
|
|
8359
|
+
// compiled ones in the fields above. Written by the server's compile;
|
|
8360
|
+
// read back as the detail's `source` and `provenance`.
|
|
8361
|
+
schemaSource: {
|
|
8362
|
+
kind: "server-owned",
|
|
8363
|
+
note: "The authored inputSchema, outputSchema and agent of a write whose " +
|
|
8364
|
+
"compile inlined a ref, as one JSON object; returned as `source`.",
|
|
8365
|
+
},
|
|
8366
|
+
schemaSourceR2Key: {
|
|
8367
|
+
kind: "server-owned",
|
|
8368
|
+
note: "Where an oversized schemaSource was offloaded, under a per-write key.",
|
|
8369
|
+
},
|
|
8370
|
+
schemaProvenance: {
|
|
8371
|
+
kind: "server-owned",
|
|
8372
|
+
note: "Each schema field's pointer → ref chain map, with the h1: hash of " +
|
|
8373
|
+
"each inlined definition; returned as `provenance`.",
|
|
8374
|
+
},
|
|
8375
|
+
schemaProvenanceR2Key: {
|
|
8376
|
+
kind: "server-owned",
|
|
8377
|
+
note: "Where an oversized schemaProvenance was offloaded, under a per-write key.",
|
|
8378
|
+
},
|
|
7996
8379
|
activeConfigId: {
|
|
7997
8380
|
kind: "server-owned",
|
|
7998
8381
|
note: "Pointer to the active AppPromptConfig. Activation is its own " +
|
|
7999
8382
|
"endpoint (activatePromptConfig), not a [prompt] key.",
|
|
8000
8383
|
},
|
|
8001
|
-
defaultEvaluatorPromptId: {
|
|
8002
|
-
kind: "server-owned",
|
|
8003
|
-
note: "Link to the evaluator prompt, written when an evaluator is created " +
|
|
8004
|
-
"against this prompt. Managed through the prompts API, not TOML.",
|
|
8005
|
-
},
|
|
8006
8384
|
createdBy: {
|
|
8007
8385
|
kind: "server-owned",
|
|
8008
8386
|
note: "Admin who created the prompt; assigned server-side.",
|
|
@@ -8017,11 +8395,25 @@ export const PROMPT_SURFACE = {
|
|
|
8017
8395
|
},
|
|
8018
8396
|
},
|
|
8019
8397
|
requestOnlyKeys: {
|
|
8398
|
+
// #5534 — the CLI's compile of the schemas the body carries, which the
|
|
8399
|
+
// server recompiles and compares; never stored as sent.
|
|
8400
|
+
compiled: {
|
|
8401
|
+
note: "The compiled form of each schema field the body carries " +
|
|
8402
|
+
"({ inputSchema?, outputSchema?, agent? }), sent by `config push`. " +
|
|
8403
|
+
"The server recompiles and refuses PROMPT_SCHEMA_COMPILED_MISMATCH " +
|
|
8404
|
+
"when they differ.",
|
|
8405
|
+
},
|
|
8406
|
+
provenance: {
|
|
8407
|
+
note: "The provenance of each field in `compiled`, which the server " +
|
|
8408
|
+
"compares with its own; required with `compiled`.",
|
|
8409
|
+
},
|
|
8020
8410
|
defaultEvaluatorPromptId: {
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8411
|
+
// #5249 — the field above is update-only; the create route has always
|
|
8412
|
+
// accepted this key and ignored it, and still does.
|
|
8413
|
+
modes: ["create"],
|
|
8414
|
+
note: "Accepted and ignored by the create route: a create links an " +
|
|
8415
|
+
"evaluator only through `sourcePromptId`. `config push` links " +
|
|
8416
|
+
"through the update route after its creates.",
|
|
8025
8417
|
},
|
|
8026
8418
|
},
|
|
8027
8419
|
tomlOnlyKeys: {
|
|
@@ -8045,6 +8437,17 @@ export const PROMPT_SURFACE = {
|
|
|
8045
8437
|
},
|
|
8046
8438
|
},
|
|
8047
8439
|
responseOnlyKeys: {
|
|
8440
|
+
// #5534 — the authored schemas and their provenance, on the detail
|
|
8441
|
+
// and the write responses (not the list).
|
|
8442
|
+
source: {
|
|
8443
|
+
kind: "server-owned",
|
|
8444
|
+
note: "The authored schema of each field whose compile inlined a ref " +
|
|
8445
|
+
"(null when none did); `config pull` writes it back.",
|
|
8446
|
+
},
|
|
8447
|
+
provenance: {
|
|
8448
|
+
kind: "server-owned",
|
|
8449
|
+
note: "Each such field's pointer → ref chain map; read by `config diff` for pins.",
|
|
8450
|
+
},
|
|
8048
8451
|
configs: {
|
|
8049
8452
|
kind: "structural",
|
|
8050
8453
|
note: "The prompt's AppPromptConfig rows, returned inline on the detail " +
|
|
@@ -8328,6 +8731,27 @@ export const PROMPT_SURFACE = {
|
|
|
8328
8731
|
note: "Where an oversized userPromptTemplate was offloaded. Assigned by " +
|
|
8329
8732
|
"storeField; the value round-trips through `userPromptTemplate`.",
|
|
8330
8733
|
},
|
|
8734
|
+
// #5534 — the authored schemas and their provenance, kept beside the
|
|
8735
|
+
// compiled ones in the fields above. Written by the server's compile;
|
|
8736
|
+
// read back as the detail's `source` and `provenance`.
|
|
8737
|
+
schemaSource: {
|
|
8738
|
+
kind: "server-owned",
|
|
8739
|
+
note: "The authored outputSchema of a write whose compile inlined a ref, " +
|
|
8740
|
+
"as one JSON object; returned as `source`.",
|
|
8741
|
+
},
|
|
8742
|
+
schemaSourceR2Key: {
|
|
8743
|
+
kind: "server-owned",
|
|
8744
|
+
note: "Where an oversized schemaSource was offloaded, under a per-write key.",
|
|
8745
|
+
},
|
|
8746
|
+
schemaProvenance: {
|
|
8747
|
+
kind: "server-owned",
|
|
8748
|
+
note: "The outputSchema's pointer → ref chain map, with the h1: hash of " +
|
|
8749
|
+
"each inlined definition; returned as `provenance`.",
|
|
8750
|
+
},
|
|
8751
|
+
schemaProvenanceR2Key: {
|
|
8752
|
+
kind: "server-owned",
|
|
8753
|
+
note: "Where an oversized schemaProvenance was offloaded, under a per-write key.",
|
|
8754
|
+
},
|
|
8331
8755
|
createdBy: {
|
|
8332
8756
|
kind: "server-owned",
|
|
8333
8757
|
note: "Admin who created the config; assigned server-side.",
|
|
@@ -8354,7 +8778,33 @@ export const PROMPT_SURFACE = {
|
|
|
8354
8778
|
"(activatePromptConfig), never as a config-body key.",
|
|
8355
8779
|
},
|
|
8356
8780
|
},
|
|
8357
|
-
|
|
8781
|
+
requestOnlyKeys: {
|
|
8782
|
+
// #5534 — the CLI's compile of the schemas the body carries, which the
|
|
8783
|
+
// server recompiles and compares; never stored as sent.
|
|
8784
|
+
compiled: {
|
|
8785
|
+
note: "The compiled form of each schema field the body carries " +
|
|
8786
|
+
"({ outputSchema? }), sent by `config push`. " +
|
|
8787
|
+
"The server recompiles and refuses PROMPT_SCHEMA_COMPILED_MISMATCH " +
|
|
8788
|
+
"when they differ.",
|
|
8789
|
+
},
|
|
8790
|
+
provenance: {
|
|
8791
|
+
note: "The provenance of each field in `compiled`, which the server " +
|
|
8792
|
+
"compares with its own; required with `compiled`.",
|
|
8793
|
+
},
|
|
8794
|
+
},
|
|
8795
|
+
responseOnlyKeys: {
|
|
8796
|
+
// #5534 — the authored schemas and their provenance, on every config
|
|
8797
|
+
// response.
|
|
8798
|
+
source: {
|
|
8799
|
+
kind: "server-owned",
|
|
8800
|
+
note: "The authored schema of each field whose compile inlined a ref " +
|
|
8801
|
+
"(null when none did); `config pull` writes it back.",
|
|
8802
|
+
},
|
|
8803
|
+
provenance: {
|
|
8804
|
+
kind: "server-owned",
|
|
8805
|
+
note: "Each such field's pointer → ref chain map; read by `config diff` for pins.",
|
|
8806
|
+
},
|
|
8807
|
+
},
|
|
8358
8808
|
},
|
|
8359
8809
|
],
|
|
8360
8810
|
// Both of a prompt file's tables ARE field tables (`[prompt]` and the
|
|
@@ -8969,9 +9419,12 @@ export const DATABASE_TYPE_SURFACE = {
|
|
|
8969
9419
|
*
|
|
8970
9420
|
* `db3-types/<name>.toml` is a db3 type: the `DatabaseTypeConfig` row a
|
|
8971
9421
|
* database type is, read by db3s. One namespace, so the file's surface is the
|
|
8972
|
-
* database type file's with
|
|
9422
|
+
* database type file's with two differences: the type is named by `[type]
|
|
8973
9423
|
* name`, where a database type file says `databaseType` (a retired spelling
|
|
8974
|
-
* here, `retired-keys.ts`)
|
|
9424
|
+
* here, `retired-keys.ts`), and it takes no rule set (#5993): nothing
|
|
9425
|
+
* evaluates one for a db3 type, whose management is for app admins and
|
|
9426
|
+
* owners, so `ruleSetName` and `ruleSetId` are refused here with that
|
|
9427
|
+
* sentence. The `[models.*]`, `[triggers]` and `[metadata]` /
|
|
8975
9428
|
* `secrets` sub-trees are the database type's, kept by the validators that
|
|
8976
9429
|
* own them; a db3 ignores the manifest. `config push` applies the file with
|
|
8977
9430
|
* `PUT db3-types/:name`, which pushes the new revision to every db3 of the
|
|
@@ -8997,15 +9450,6 @@ export const DB3_TYPE_SURFACE = {
|
|
|
8997
9450
|
// a push, `#`-free.
|
|
8998
9451
|
validation: handledBy(DB3_TYPES_HANDLER, "Db3TypesController", "apply"),
|
|
8999
9452
|
},
|
|
9000
|
-
{
|
|
9001
|
-
field: "ruleSetId",
|
|
9002
|
-
tomlKey: "ruleSetName",
|
|
9003
|
-
type: "string",
|
|
9004
|
-
emit: "always",
|
|
9005
|
-
writableOn: BOTH,
|
|
9006
|
-
// The type's databases' rule set, by name; a db3 does not read it.
|
|
9007
|
-
validation: handledBy(DB3_TYPES_HANDLER, "Db3TypesController", "apply"),
|
|
9008
|
-
},
|
|
9009
9453
|
{
|
|
9010
9454
|
field: "autoPopulatedFields",
|
|
9011
9455
|
tomlKey: "autoPopulatedFields",
|
|
@@ -9023,7 +9467,18 @@ export const DB3_TYPE_SURFACE = {
|
|
|
9023
9467
|
validation: handledBy(DB3_TYPES_HANDLER, "Db3TypesController", "apply"),
|
|
9024
9468
|
},
|
|
9025
9469
|
],
|
|
9026
|
-
|
|
9470
|
+
// A copy: the database type table's own classification stays as it is.
|
|
9471
|
+
notExposed: {
|
|
9472
|
+
...LEGACY_TYPE_TABLE.notExposed,
|
|
9473
|
+
ruleSetId: {
|
|
9474
|
+
kind: "structural",
|
|
9475
|
+
// Never in a `PUT db3-types/:name` body: the route refuses a bound one.
|
|
9476
|
+
requestModes: [],
|
|
9477
|
+
note: "The database type's rule set, authored as `ruleSetName` in " +
|
|
9478
|
+
"`database-type-configs/` only. A db3 type takes none: nothing " +
|
|
9479
|
+
"evaluates it, and managing a type is for app admins and owners.",
|
|
9480
|
+
},
|
|
9481
|
+
},
|
|
9027
9482
|
tomlOnlyKeys: {
|
|
9028
9483
|
models: {
|
|
9029
9484
|
kind: "structural",
|
|
@@ -9809,6 +10264,18 @@ export function authorizeRequiredMessage(functionKey, file) {
|
|
|
9809
10264
|
"maps each `access` expression to a helper.";
|
|
9810
10265
|
return file ? `${file}: ${message}` : message;
|
|
9811
10266
|
}
|
|
10267
|
+
/**
|
|
10268
|
+
* The refusal of a version that declares `public = true` and has no
|
|
10269
|
+
* `authorize` — #5840. `public = true` opens the function to signed-out
|
|
10270
|
+
* callers, and the version's own `authorize` is what decides about them.
|
|
10271
|
+
*/
|
|
10272
|
+
export function publicRequiresAuthorizeMessage(functionKey, file) {
|
|
10273
|
+
const message = `Function '${functionKey}' declares \`public = true\` and has no \`authorize\`: ` +
|
|
10274
|
+
"a public function decides who may call it, signed-out callers included, in its own " +
|
|
10275
|
+
"`authorize`. Export the object form with one, such as `authorize: allowAnyone()`, " +
|
|
10276
|
+
`or remove \`public\` from functions/${functionKey}.toml.`;
|
|
10277
|
+
return file ? `${file}: ${message}` : message;
|
|
10278
|
+
}
|
|
9812
10279
|
/**
|
|
9813
10280
|
* The refusal of a new version that defines `authorize` while its TOML still
|
|
9814
10281
|
* carries `access`.
|
|
@@ -10238,6 +10705,32 @@ export const APP_SETTINGS_SURFACE = {
|
|
|
10238
10705
|
// (`parseRootDocumentFormatSetting`).
|
|
10239
10706
|
validation: handledBy(SETTINGS_HANDLER, "SettingsController", "apply"),
|
|
10240
10707
|
},
|
|
10708
|
+
{
|
|
10709
|
+
field: "signedOutAccess",
|
|
10710
|
+
tomlKey: "signedOutAccess",
|
|
10711
|
+
type: "boolean",
|
|
10712
|
+
// Always: a pulled file states whether signed-out callers may
|
|
10713
|
+
// invoke the app's `public` functions, rather than leaving it to the
|
|
10714
|
+
// absence of a key (#5840).
|
|
10715
|
+
emit: "always",
|
|
10716
|
+
writableOn: UPDATE_ONLY,
|
|
10717
|
+
// A boolean, refused otherwise; the route answers the functions
|
|
10718
|
+
// turning it on opens (`signedOutFunctions`).
|
|
10719
|
+
validation: handledBy(SETTINGS_HANDLER, "SettingsController", "apply"),
|
|
10720
|
+
},
|
|
10721
|
+
{
|
|
10722
|
+
field: "allowFieldRemoval",
|
|
10723
|
+
tomlKey: "allowFieldRemoval",
|
|
10724
|
+
type: "boolean",
|
|
10725
|
+
// Whenever the app set it. An app that never did may not remove
|
|
10726
|
+
// fields from an in-use db3 type, and a pulled file should not grow
|
|
10727
|
+
// a key for it (#6019).
|
|
10728
|
+
emit: "whenSet",
|
|
10729
|
+
writableOn: UPDATE_ONLY,
|
|
10730
|
+
// A boolean or cleared, refused otherwise; a type write reads the
|
|
10731
|
+
// stored value before it takes `allowFieldRemoval=true`.
|
|
10732
|
+
validation: handledBy(SETTINGS_HANDLER, "SettingsController", "apply"),
|
|
10733
|
+
},
|
|
10241
10734
|
{
|
|
10242
10735
|
field: "protection",
|
|
10243
10736
|
tomlKey: "protection",
|
|
@@ -10326,6 +10819,11 @@ export const APP_SETTINGS_SURFACE = {
|
|
|
10326
10819
|
kind: "server-owned",
|
|
10327
10820
|
note: "When the app last saw counted activity; written by the server.",
|
|
10328
10821
|
},
|
|
10822
|
+
transitions: {
|
|
10823
|
+
kind: "server-owned",
|
|
10824
|
+
note: "The app's platform transition overrides (#5821); set only by a " +
|
|
10825
|
+
"super-admin through the transitions routes, so sync never sees it.",
|
|
10826
|
+
},
|
|
10329
10827
|
passkeyRpId: {
|
|
10330
10828
|
kind: "server-owned",
|
|
10331
10829
|
note: "RETIRED from the write surface by #2891, superseded by " +
|
|
@@ -10612,6 +11110,79 @@ export const APP_SETTINGS_SURFACE = {
|
|
|
10612
11110
|
// top-level key. (App config VARS live in their own `vars.toml`.)
|
|
10613
11111
|
tomlDocumentKeys: {},
|
|
10614
11112
|
};
|
|
11113
|
+
// ── src/config-surface/user-properties.ts ────────────────────────────────
|
|
11114
|
+
/**
|
|
11115
|
+
* The `user-properties` configuration object's definition (#5385, project
|
|
11116
|
+
* `user-index-properties` phase 2).
|
|
11117
|
+
*
|
|
11118
|
+
* `user-properties.toml` is a root singleton beside `app.toml`, so — like
|
|
11119
|
+
* `app-settings` and `test-case` — it is named explicitly rather than reached
|
|
11120
|
+
* through `SYNC_RESOURCE_TYPES`. Its keys are the app's own: each
|
|
11121
|
+
* `[fields.<name>]` table declares a property in the db3 field grammar plus
|
|
11122
|
+
* `client`, and each `[[unique_constraints]]` entry names two or more of them.
|
|
11123
|
+
* There is no fixed key/value table to define, so the surface declares
|
|
11124
|
+
* `noFieldTable`; the file is parsed, normalized and judged by one module,
|
|
11125
|
+
* `src/user-index/properties-schema.ts`, which the CLI vendors byte for byte
|
|
11126
|
+
* (`cli/src/lib/user-properties/generated-properties-schema.ts`) and which
|
|
11127
|
+
* `config push`'s preflight runs before anything is applied. The pushed
|
|
11128
|
+
* schema is stored on the app's `UserPropertiesConfig` row.
|
|
11129
|
+
*/
|
|
11130
|
+
export const USER_PROPERTIES_SURFACE = {
|
|
11131
|
+
label: "user-properties",
|
|
11132
|
+
tables: [],
|
|
11133
|
+
noFieldTable: {
|
|
11134
|
+
note: "Every key under [fields] is a property name the app declares; the field grammar, the client values and the " +
|
|
11135
|
+
"constraint rules are the schema module's (src/user-index/properties-schema.ts), run by config push's preflight " +
|
|
11136
|
+
"through its vendored copy and again by the push route",
|
|
11137
|
+
},
|
|
11138
|
+
tomlDocumentKeys: {
|
|
11139
|
+
fields: {
|
|
11140
|
+
kind: "structural",
|
|
11141
|
+
note: "[fields.<name>] tables: one property each, parsed whole by parseUserPropertiesToml and sent as the file's text",
|
|
11142
|
+
},
|
|
11143
|
+
unique_constraints: {
|
|
11144
|
+
kind: "structural",
|
|
11145
|
+
note: "[[unique_constraints]] entries { name, fields }, parsed whole by parseUserPropertiesToml with the fields",
|
|
11146
|
+
},
|
|
11147
|
+
},
|
|
11148
|
+
noCrossFieldRules: {
|
|
11149
|
+
note: "The file's rules span fields and constraints but are not field-table rules: parseUserPropertiesToml " +
|
|
11150
|
+
"(src/user-index/properties-schema.ts) decides every one, from the file alone, at config push's preflight",
|
|
11151
|
+
},
|
|
11152
|
+
};
|
|
11153
|
+
// ── src/config-surface/schema-file.ts ────────────────────────────────────
|
|
11154
|
+
/**
|
|
11155
|
+
* The `schema` configuration object's definition (#5532, project
|
|
11156
|
+
* `unified-schemas` phase 3).
|
|
11157
|
+
*
|
|
11158
|
+
* `schemas/<file>.toml` holds shared shapes: each `[defs.<Name>]` table is
|
|
11159
|
+
* one JSON Schema document, named by the file's stem and the def's name
|
|
11160
|
+
* (`schemas:<file>#/$defs/<Name>`). There is no fixed key/value table to
|
|
11161
|
+
* define, so the surface declares `noFieldTable`; the file is checked and
|
|
11162
|
+
* compiled by one module, `src/function-runs/schema-file.ts`, which the CLI
|
|
11163
|
+
* vendors (`cli/src/lib/schema-codegen/generated-schema-file.ts`), runs in
|
|
11164
|
+
* `config push`'s preflight and sends compiled with the source, and which the
|
|
11165
|
+
* push route runs again.
|
|
11166
|
+
*/
|
|
11167
|
+
export const SCHEMA_FILE_SURFACE = {
|
|
11168
|
+
label: "schema",
|
|
11169
|
+
tables: [],
|
|
11170
|
+
noFieldTable: {
|
|
11171
|
+
note: "Every key under [defs] is a def name the file declares, and each def is a JSON Schema document; the shape, " +
|
|
11172
|
+
"keyword and compile rules are the schemas/ file module's (src/function-runs/schema-file.ts), run by config " +
|
|
11173
|
+
"push's preflight through its vendored copy and again by the push route",
|
|
11174
|
+
},
|
|
11175
|
+
tomlDocumentKeys: {
|
|
11176
|
+
defs: {
|
|
11177
|
+
kind: "structural",
|
|
11178
|
+
note: "[defs.<Name>] tables: one shared shape each, compiled whole by compileSchemaFile and sent as the file's text",
|
|
11179
|
+
},
|
|
11180
|
+
},
|
|
11181
|
+
noCrossFieldRules: {
|
|
11182
|
+
note: "The file's rules span defs but are not field-table rules: compileSchemaFile (src/function-runs/schema-file.ts) " +
|
|
11183
|
+
"decides every one, from the file alone, at config push's preflight",
|
|
11184
|
+
},
|
|
11185
|
+
};
|
|
10615
11186
|
// ── src/config-surface/index.ts ──────────────────────────────────────────
|
|
10616
11187
|
/**
|
|
10617
11188
|
* The configuration-object registry (issue #2644).
|
|
@@ -10629,9 +11200,10 @@ export const APP_SETTINGS_SURFACE = {
|
|
|
10629
11200
|
/**
|
|
10630
11201
|
* Every configuration object whose field surface is defined here.
|
|
10631
11202
|
*
|
|
10632
|
-
* One entry per `SYNC_RESOURCE_TYPES` label, plus the
|
|
10633
|
-
* round-trip without being a per-entity file: `app-settings` (`app.toml`)
|
|
10634
|
-
* `
|
|
11203
|
+
* One entry per `SYNC_RESOURCE_TYPES` label, plus the three surfaces that
|
|
11204
|
+
* round-trip without being a per-entity file: `app-settings` (`app.toml`),
|
|
11205
|
+
* `user-properties` (`user-properties.toml`, #5385) and `test-case`
|
|
11206
|
+
* (`<key>.tests/`). Nothing that syncs sits outside the registry —
|
|
10635
11207
|
* `PENDING_MIGRATION`, the migration's temporary exemption list, is gone as of
|
|
10636
11208
|
* phase 3, so a new synced type has nowhere to be parked and fails the registry
|
|
10637
11209
|
* guard until it is defined (#2644 criterion 3).
|
|
@@ -10648,6 +11220,8 @@ export const CONFIG_SURFACES = [
|
|
|
10648
11220
|
SERVER_FUNCTION_SURFACE,
|
|
10649
11221
|
TEST_CASE_SURFACE,
|
|
10650
11222
|
APP_SETTINGS_SURFACE,
|
|
11223
|
+
USER_PROPERTIES_SURFACE,
|
|
11224
|
+
SCHEMA_FILE_SURFACE,
|
|
10651
11225
|
];
|
|
10652
11226
|
/**
|
|
10653
11227
|
* The configuration surfaces that have not declared their CROSS-FIELD rules yet
|
|
@@ -10744,6 +11318,8 @@ export const GENERATED_CONFIG_MODEL_FIELDS = {
|
|
|
10744
11318
|
"memberInvitationLimit",
|
|
10745
11319
|
"largeDocumentWindowDays",
|
|
10746
11320
|
"rootDocumentFormat",
|
|
11321
|
+
"signedOutAccess",
|
|
11322
|
+
"allowFieldRemoval",
|
|
10747
11323
|
"protection",
|
|
10748
11324
|
"protected",
|
|
10749
11325
|
"parentAppId",
|
|
@@ -10758,6 +11334,7 @@ export const GENERATED_CONFIG_MODEL_FIELDS = {
|
|
|
10758
11334
|
"previewOrigins",
|
|
10759
11335
|
"childPartition",
|
|
10760
11336
|
"lastActivityAt",
|
|
11337
|
+
"transitions",
|
|
10761
11338
|
"createdAt",
|
|
10762
11339
|
"modifiedAt",
|
|
10763
11340
|
],
|
|
@@ -10790,6 +11367,10 @@ export const GENERATED_CONFIG_MODEL_FIELDS = {
|
|
|
10790
11367
|
"copiedFromCatalogId",
|
|
10791
11368
|
"inputSchema",
|
|
10792
11369
|
"outputSchema",
|
|
11370
|
+
"schemaSource",
|
|
11371
|
+
"schemaSourceR2Key",
|
|
11372
|
+
"schemaProvenance",
|
|
11373
|
+
"schemaProvenanceR2Key",
|
|
10793
11374
|
"activeConfigId",
|
|
10794
11375
|
"defaultEvaluatorPromptId",
|
|
10795
11376
|
"status",
|
|
@@ -10816,6 +11397,10 @@ export const GENERATED_CONFIG_MODEL_FIELDS = {
|
|
|
10816
11397
|
"maxTokens",
|
|
10817
11398
|
"outputFormat",
|
|
10818
11399
|
"outputSchema",
|
|
11400
|
+
"schemaSource",
|
|
11401
|
+
"schemaSourceR2Key",
|
|
11402
|
+
"schemaProvenance",
|
|
11403
|
+
"schemaProvenanceR2Key",
|
|
10819
11404
|
"providerConfig",
|
|
10820
11405
|
"questions",
|
|
10821
11406
|
"reasoningEffort",
|