primitive-admin 1.2.0-alpha.1 → 1.2.0-alpha.10
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 +105 -134
- package/assets/skill/skills/primitive-platform/SKILL.md +37 -4
- package/dist/bin/primitive.js +30 -35
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/agent-sessions.d.ts +133 -0
- package/dist/src/commands/agent-sessions.js +792 -0
- package/dist/src/commands/agent-sessions.js.map +1 -0
- package/dist/src/commands/analytics.js +0 -148
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps-children.d.ts +54 -0
- package/dist/src/commands/apps-children.js +631 -0
- package/dist/src/commands/apps-children.js.map +1 -0
- package/dist/src/commands/apps.d.ts +6 -0
- package/dist/src/commands/apps.js +131 -9
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.d.ts +3 -3
- package/dist/src/commands/auth-sessions.js +117 -23
- package/dist/src/commands/auth-sessions.js.map +1 -1
- package/dist/src/commands/auth.js +460 -36
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/collections.js +316 -256
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/config.d.ts +1 -1
- package/dist/src/commands/config.js +60 -28
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/connections.js +11 -12
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +2 -76
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.d.ts +9 -0
- package/dist/src/commands/databases.js +221 -457
- 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 +157 -0
- package/dist/src/commands/db3-types.js.map +1 -0
- package/dist/src/commands/db3.d.ts +12 -0
- package/dist/src/commands/db3.js +1052 -0
- package/dist/src/commands/db3.js.map +1 -0
- package/dist/src/commands/documents.d.ts +121 -2
- package/dist/src/commands/documents.js +1601 -1251
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/env.d.ts +9 -1
- package/dist/src/commands/env.js +164 -49
- 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 +297 -24
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/groups.js +150 -49
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +5 -5
- package/dist/src/commands/init.d.ts +7 -0
- package/dist/src/commands/init.js +23 -5
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +14 -8
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.d.ts +2 -2
- package/dist/src/commands/metadata-category-configs.js +2 -2
- package/dist/src/commands/prompts.d.ts +7 -0
- package/dist/src/commands/prompts.js +48 -5
- package/dist/src/commands/prompts.js.map +1 -1
- 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/sync-app-settings.d.ts +36 -8
- package/dist/src/commands/sync-app-settings.js +109 -23
- package/dist/src/commands/sync-app-settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +360 -610
- package/dist/src/commands/sync.js +3151 -6697
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +3 -3
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.js +77 -2
- package/dist/src/commands/users.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/aggregate-output.d.ts +25 -0
- package/dist/src/lib/aggregate-output.js +53 -0
- package/dist/src/lib/aggregate-output.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +681 -551
- package/dist/src/lib/api-client.js +880 -814
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +47 -1
- package/dist/src/lib/app-settings-descriptor.js +114 -10
- 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 +41 -1
- package/dist/src/lib/auth-flow.js +70 -16
- 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 +2 -2
- package/dist/src/lib/block-selector.js +2 -2
- package/dist/src/lib/child-apps-local.d.ts +164 -0
- package/dist/src/lib/child-apps-local.js +258 -0
- package/dist/src/lib/child-apps-local.js.map +1 -0
- package/dist/src/lib/ci-session-request.d.ts +22 -0
- package/dist/src/lib/ci-session-request.js +51 -0
- package/dist/src/lib/ci-session-request.js.map +1 -0
- package/dist/src/lib/codegen-shared/generatedFiles.d.ts +10 -8
- package/dist/src/lib/codegen-shared/generatedFiles.js +21 -15
- package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +1 -1
- package/dist/src/lib/codegen-shared/prettierStable.js +1 -1
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +2 -2
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +2 -2
- 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/config-object-descriptor.d.ts +3 -22
- package/dist/src/lib/config-object-descriptor.js +56 -290
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-payload.js +2 -3
- package/dist/src/lib/config-payload.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +5 -7
- package/dist/src/lib/config-surface.js +18 -40
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/connections-list.d.ts +10 -0
- package/dist/src/lib/connections-list.js +18 -0
- package/dist/src/lib/connections-list.js.map +1 -0
- package/dist/src/lib/credentials-home.d.ts +58 -0
- package/dist/src/lib/credentials-home.js +204 -0
- package/dist/src/lib/credentials-home.js.map +1 -0
- package/dist/src/lib/credentials-lock.d.ts +88 -0
- package/dist/src/lib/credentials-lock.js +302 -0
- package/dist/src/lib/credentials-lock.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +179 -24
- package/dist/src/lib/credentials-store.js +712 -77
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/csv.d.ts +8 -9
- package/dist/src/lib/csv.js +3 -4
- package/dist/src/lib/csv.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/db-codegen/dbGenerator.js +5 -16
- package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -1
- package/dist/src/lib/db-codegen/dbNaming.d.ts +5 -13
- package/dist/src/lib/db-codegen/dbNaming.js +5 -17
- package/dist/src/lib/db-codegen/dbNaming.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +7 -56
- package/dist/src/lib/db-codegen/dbTemplates.js +25 -125
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +2 -2
- package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +67 -2
- package/dist/src/lib/db-codegen/dbTypeIR.js +13 -2
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/db3-export.d.ts +231 -0
- package/dist/src/lib/db3-export.js +510 -0
- package/dist/src/lib/db3-export.js.map +1 -0
- package/dist/src/lib/db3-index-output.d.ts +27 -0
- package/dist/src/lib/db3-index-output.js +49 -0
- package/dist/src/lib/db3-index-output.js.map +1 -0
- package/dist/src/lib/document-export-lookups.d.ts +31 -0
- package/dist/src/lib/document-export-lookups.js +53 -0
- package/dist/src/lib/document-export-lookups.js.map +1 -0
- package/dist/src/lib/document-export-permissions.d.ts +7 -5
- package/dist/src/lib/document-export-permissions.js +7 -5
- package/dist/src/lib/document-export-permissions.js.map +1 -1
- package/dist/src/lib/document-export-record-log.d.ts +57 -0
- package/dist/src/lib/document-export-record-log.js +215 -0
- package/dist/src/lib/document-export-record-log.js.map +1 -0
- package/dist/src/lib/document-ingest-artifact.d.ts +26 -2
- package/dist/src/lib/document-ingest-artifact.js +42 -8
- 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-rows.d.ts +16 -0
- package/dist/src/lib/document-ingest-rows.js +17 -0
- package/dist/src/lib/document-ingest-rows.js.map +1 -1
- package/dist/src/lib/document-ingest.d.ts +33 -1
- package/dist/src/lib/document-ingest.js +49 -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/env-resolver-core.d.ts +70 -2
- package/dist/src/lib/env-resolver-core.js +137 -20
- package/dist/src/lib/env-resolver-core.js.map +1 -1
- package/dist/src/lib/env-resolver.d.ts +14 -2
- package/dist/src/lib/env-resolver.js +32 -10
- package/dist/src/lib/env-resolver.js.map +1 -1
- package/dist/src/lib/function-authorize-check.d.ts +142 -0
- package/dist/src/lib/function-authorize-check.js +310 -0
- package/dist/src/lib/function-authorize-check.js.map +1 -0
- package/dist/src/lib/function-authorize-view.d.ts +15 -0
- package/dist/src/lib/function-authorize-view.js +50 -0
- package/dist/src/lib/function-authorize-view.js.map +1 -0
- package/dist/src/lib/function-bundle.d.ts +38 -18
- package/dist/src/lib/function-bundle.js +96 -35
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +75 -12
- package/dist/src/lib/function-collect.js +427 -12
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +29 -0
- package/dist/src/lib/function-db-types.js +117 -7
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-document-types.d.ts +5 -3
- package/dist/src/lib/function-document-types.js +10 -14
- package/dist/src/lib/function-document-types.js.map +1 -1
- package/dist/src/lib/function-lint.d.ts +34 -0
- package/dist/src/lib/function-lint.js +112 -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 +16 -21
- package/dist/src/lib/function-run.js +37 -30
- package/dist/src/lib/function-run.js.map +1 -1
- package/dist/src/lib/function-schema-codegen.d.ts +1 -1
- package/dist/src/lib/function-schema-codegen.js +5 -5
- package/dist/src/lib/function-schema-codegen.js.map +1 -1
- package/dist/src/lib/function-source-roots.d.ts +67 -0
- package/dist/src/lib/function-source-roots.js +148 -0
- package/dist/src/lib/function-source-roots.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +108 -22
- package/dist/src/lib/function-sync.js +127 -39
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-trigger-listing.d.ts +11 -6
- package/dist/src/lib/function-trigger-listing.js +32 -11
- package/dist/src/lib/function-trigger-listing.js.map +1 -1
- package/dist/src/lib/function-typecheck.d.ts +37 -2
- package/dist/src/lib/function-typecheck.js +210 -28
- 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-allowlist.js +0 -20
- package/dist/src/lib/generated-allowlist.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +703 -203
- package/dist/src/lib/generated-config-surfaces.js +2270 -2014
- 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/init-adopt.js +12 -3
- package/dist/src/lib/init-adopt.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/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/local-state.d.ts +38 -7
- package/dist/src/lib/local-state.js +172 -49
- package/dist/src/lib/local-state.js.map +1 -1
- package/dist/src/lib/local-test-cases.d.ts +5 -2
- package/dist/src/lib/local-test-cases.js +7 -4
- package/dist/src/lib/local-test-cases.js.map +1 -1
- package/dist/src/lib/log-inspection.d.ts +42 -4
- package/dist/src/lib/log-inspection.js +37 -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 +25 -0
- package/dist/src/lib/login-scope-lines.js +45 -0
- package/dist/src/lib/login-scope-lines.js.map +1 -0
- package/dist/src/lib/logout-admin-session.d.ts +2 -1
- package/dist/src/lib/logout-admin-session.js +7 -1
- package/dist/src/lib/logout-admin-session.js.map +1 -1
- 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.js +2 -0
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/paginate.d.ts +0 -5
- package/dist/src/lib/paginate.js +0 -5
- package/dist/src/lib/paginate.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/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-config.d.ts +7 -0
- package/dist/src/lib/project-config.js +22 -1
- package/dist/src/lib/project-config.js.map +1 -1
- 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 +10 -3
- package/dist/src/lib/prompt-schema-codegen.js +52 -11
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -1
- package/dist/src/lib/pull-write.d.ts +31 -0
- package/dist/src/lib/pull-write.js +49 -0
- package/dist/src/lib/pull-write.js.map +1 -0
- package/dist/src/lib/push-failure-report.d.ts +45 -0
- package/dist/src/lib/push-failure-report.js +57 -0
- package/dist/src/lib/push-failure-report.js.map +1 -0
- package/dist/src/lib/records-verbs.d.ts +69 -0
- package/dist/src/lib/records-verbs.js +40 -0
- package/dist/src/lib/records-verbs.js.map +1 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +7 -0
- package/dist/src/lib/refresh-admin-credentials.js +16 -4
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
- package/dist/src/lib/root-import-decision.d.ts +65 -0
- package/dist/src/lib/root-import-decision.js +109 -0
- package/dist/src/lib/root-import-decision.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/generated-schema-descriptor.d.ts +129 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.js +269 -0
- package/dist/src/lib/schema-codegen/generated-schema-descriptor.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/schemaToTs.d.ts +82 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js +305 -0
- package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/scope-request.d.ts +84 -0
- package/dist/src/lib/scope-request.js +235 -0
- package/dist/src/lib/scope-request.js.map +1 -0
- package/dist/src/lib/session-id.d.ts +9 -0
- package/dist/src/lib/session-id.js +28 -0
- package/dist/src/lib/session-id.js.map +1 -0
- package/dist/src/lib/snapshot-build-rows.d.ts +21 -0
- package/dist/src/lib/snapshot-build-rows.js +22 -0
- package/dist/src/lib/snapshot-build-rows.js.map +1 -1
- package/dist/src/lib/snapshot-build.js +8 -3
- package/dist/src/lib/snapshot-build.js.map +1 -1
- package/dist/src/lib/snapshots.d.ts +17 -1
- package/dist/src/lib/snapshots.js +50 -2
- package/dist/src/lib/snapshots.js.map +1 -1
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +6 -2
- package/dist/src/lib/swift-codegen/agentGenerator.js +57 -5
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/banners.d.ts +34 -7
- package/dist/src/lib/swift-codegen/banners.js +37 -7
- package/dist/src/lib/swift-codegen/banners.js.map +1 -1
- package/dist/src/lib/swift-codegen/dbGenerator.d.ts +4 -3
- package/dist/src/lib/swift-codegen/dbGenerator.js +14 -117
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +3 -3
- package/dist/src/lib/swift-codegen/functionGenerator.js +23 -18
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/generator.d.ts +5 -5
- package/dist/src/lib/swift-codegen/generator.js +35 -40
- package/dist/src/lib/swift-codegen/generator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +3 -3
- package/dist/src/lib/swift-codegen/schemaToSwift.js +4 -4
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
- 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/sync-paths.d.ts +35 -0
- package/dist/src/lib/sync-paths.js +57 -5
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/sync-resource-types.d.ts +26 -26
- package/dist/src/lib/sync-resource-types.js +61 -189
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +5 -1
- package/dist/src/lib/sync-selectors.js +23 -13
- package/dist/src/lib/sync-selectors.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/toml-database-config.d.ts +15 -75
- package/dist/src/lib/toml-database-config.js +17 -306
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/transient-retry.d.ts +43 -0
- package/dist/src/lib/transient-retry.js +94 -0
- package/dist/src/lib/transient-retry.js.map +1 -0
- package/dist/src/lib/vars-override.d.ts +105 -0
- package/dist/src/lib/vars-override.js +143 -0
- package/dist/src/lib/vars-override.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/workflow-codegen/generator.d.ts +7 -7
- package/dist/src/lib/workflow-codegen/generator.js +16 -23
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +6 -12
- package/dist/src/lib/workflow-codegen/invokerIR.js +4 -5
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
- package/dist/src/lib/workflow-toml-validator.d.ts +2 -0
- package/dist/src/lib/workflow-toml-validator.js +28 -1
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/dist/src/types/index.d.ts +30 -37
- 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 -12
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ApiClient } from "../lib/api-client.js";
|
|
3
|
-
import { type
|
|
4
|
-
import { type FieldForm } from "../lib/toml-native-form.js";
|
|
3
|
+
import { type PullWriteTally } from "../lib/pull-write.js";
|
|
5
4
|
import { type PushMode } from "../lib/config-payload.js";
|
|
6
5
|
import { type ConfigObjectSurface, type ConfigTable } from "../lib/generated-config-surfaces.js";
|
|
7
6
|
import { type PromptKind } from "../lib/generated-config-surfaces.js";
|
|
8
|
-
import { type AgentFunctionFacts } from "../lib/generated-config-surfaces.js";
|
|
7
|
+
import { type AgentFunctionFact, type AgentFunctionFacts } from "../lib/generated-config-surfaces.js";
|
|
8
|
+
import { type AgentSchemaConfigFact } from "../lib/generated-config-surfaces.js";
|
|
9
9
|
import { type DocumentSchemaResolution } from "../lib/function-document-types.js";
|
|
10
10
|
import { type PresenceOutcome, type TestBlockType } from "../lib/sync-resource-types.js";
|
|
11
11
|
export { resolveSlugCollisions, slugifyTestCaseName, testCaseFileBasenames, } from "../lib/test-case-file-names.js";
|
|
@@ -38,15 +38,6 @@ export declare function wrapEntityError(err: unknown, action: "create" | "update
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function wrapPromptConfigError(err: unknown, action: "create" | "update" | "activate", promptKey: string, configName: string | undefined): Error;
|
|
40
40
|
export declare function computeFileHash(filePath: string): string;
|
|
41
|
-
/**
|
|
42
|
-
* A transform's comparison hash: the script body itself (#2731 B7).
|
|
43
|
-
*
|
|
44
|
-
* Unlike the config types there is no projection to do — the `.rhai` bytes are
|
|
45
|
-
* exactly what push sends and exactly what diff compares — so the "semantic"
|
|
46
|
-
* hash is just a stable hash of the body, computable from a server response
|
|
47
|
-
* without going through the file.
|
|
48
|
-
*/
|
|
49
|
-
export declare function computeScriptBodyHash(body: string): string;
|
|
50
41
|
export declare function shouldPushFile(filePath: string, storedHash: string | undefined): boolean;
|
|
51
42
|
/**
|
|
52
43
|
* Hash the *expanded* (post-fragment-splice) content of a workflow TOML.
|
|
@@ -69,114 +60,6 @@ export declare function computeExpandedContentHash(parsed: any): string;
|
|
|
69
60
|
* push-skip cache for any workflow that references them.
|
|
70
61
|
*/
|
|
71
62
|
export declare function shouldPushExpandedFile(parsed: any, storedHash: string | undefined): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* The `[workflow].activeConfigName` a file actually states, trimmed — or
|
|
74
|
-
* `undefined` when the file has no opinion about activation.
|
|
75
|
-
*
|
|
76
|
-
* Push reads the key the same way: `applyWorkflowConfigSidecars` activates a
|
|
77
|
-
* configuration only for a truthy name and otherwise leaves the running one
|
|
78
|
-
* alone (`cli/src/lib/workflow-config-apply.ts`). Every diff decision about
|
|
79
|
-
* activation keys off this one predicate so the comparison cannot claim a
|
|
80
|
-
* difference push has no way to reconcile (#2743, review follow-up).
|
|
81
|
-
*/
|
|
82
|
-
export declare function authoredActiveConfigName(parsed: any): string | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* The configuration a server workflow is RUNNING — its `activeConfigId`, or the
|
|
85
|
-
* first config as the fallback `serializeWorkflow` has always used, so pull's
|
|
86
|
-
* `activeConfigName` and the diff's reading of it can never disagree.
|
|
87
|
-
*/
|
|
88
|
-
export declare function resolveActiveWorkflowConfig(workflow: any, configs: any[]): any;
|
|
89
|
-
/**
|
|
90
|
-
* Normalize a parsed workflow TOML object into the form the SERVER would hold
|
|
91
|
-
* after a `config push` of that file. Used by `diff` so a hand-authored workflow
|
|
92
|
-
* compares equal to the running state it already describes — while a server
|
|
93
|
-
* value that genuinely differs still shows as Modified.
|
|
94
|
-
*
|
|
95
|
-
* In order:
|
|
96
|
-
* 1. Trim the fields the server trims (`name`, `description`).
|
|
97
|
-
* 2. Drop explicit-empty authored values — a `""` string or an empty
|
|
98
|
-
* `capabilities` array. Push sends these as `null` (or the model default),
|
|
99
|
-
* and the pull serializer omits the key for a cleared field, so "spelled
|
|
100
|
-
* out as empty" and "absent" have to hash the same (#2743).
|
|
101
|
-
* 3. Lowercase the two enums and floor the five queue limits, mirroring the
|
|
102
|
-
* server's accepted-value canonicalization
|
|
103
|
-
* (`src/workflows/config/workflow-field-handlers.ts`). A value the server
|
|
104
|
-
* would REJECT is left alone: push fails loudly for those, so there is
|
|
105
|
-
* nothing to preview. #2743 — without this, `dequeueOrder = "LIFO"` or
|
|
106
|
-
* `perUserMaxRunning = 4.9` pushes fine and then reports Modified forever.
|
|
107
|
-
* 4. Fill the model defaults (`WORKFLOW_MODEL_DEFAULTS`) for what the file
|
|
108
|
-
* omits. `perAppMax*` / `queueTtlSeconds` joined that list in #1177: once
|
|
109
|
-
* the pull serializer emitted them (a GET always returns them, they carry
|
|
110
|
-
* a non-null model default), an unchanged workflow hashed unequal to a
|
|
111
|
-
* local TOML that omits them — a false `modified` that made `config pull`
|
|
112
|
-
* rewrite the file just to inject defaults. (`status` was on this list
|
|
113
|
-
* until #2803 took availability off the config wire entirely.)
|
|
114
|
-
* 5. Fill `activeConfigName` with the name the server itself creates
|
|
115
|
-
* (`default`), so a hand-authored file that never named a config compares
|
|
116
|
-
* equal to the workflow that pushing it produces (#2743). This is the
|
|
117
|
-
* compare-BY-NAME case only: when the local file names no configuration at
|
|
118
|
-
* all, `config diff` hashes both sides with `compareActivation: false` and
|
|
119
|
-
* the fill never decides anything.
|
|
120
|
-
* 6. Fill `key` from `resolvedKey` when the file omits it. `[workflow].key`
|
|
121
|
-
* is optional — push and diff both resolve it from the FILENAME
|
|
122
|
-
* (`tomlData.workflow?.key || basename(file, ".toml")`) — while the pull
|
|
123
|
-
* serializer always emits it. Without this a file relying on the filename
|
|
124
|
-
* hashes unequal to the very workflow it describes and reports Modified
|
|
125
|
-
* forever, which is exactly the non-convergence #2743 removes. Callers
|
|
126
|
-
* that already know the resolved key pass it; the rest leave the key as
|
|
127
|
-
* authored.
|
|
128
|
-
*
|
|
129
|
-
* Only the DIFF-hash path (`hashWorkflowTomlForDiff`) normalizes; the stored
|
|
130
|
-
* content-hash path that push's skip check compares is untouched, so upgrading
|
|
131
|
-
* forces no one-time re-push (same note as #1446's schema canonicalization).
|
|
132
|
-
*
|
|
133
|
-
* Returns a shallow clone with a normalized `workflow` table; the input is
|
|
134
|
-
* not mutated. Non-workflow TOML (no `workflow` table) is returned unchanged.
|
|
135
|
-
*/
|
|
136
|
-
export declare function normalizeWorkflowTomlDefaults(parsed: any, resolvedKey?: string): any;
|
|
137
|
-
/**
|
|
138
|
-
* Canonical content hash of a workflow TOML for `diff`'s content comparison.
|
|
139
|
-
* Applies `normalizeWorkflowTomlDefaults` first so omitted-vs-defaulted fields
|
|
140
|
-
* don't spuriously diff, then runs the same `computeExpandedContentHash` that
|
|
141
|
-
* pull stores and push compares. Both the local file and the
|
|
142
|
-
* `serializeWorkflow`-produced remote form flow through this single function,
|
|
143
|
-
* so the two sides are normalized identically by construction.
|
|
144
|
-
*
|
|
145
|
-
* `resolvedKey` is the key the caller already paired the two sides on (the
|
|
146
|
-
* `[workflow].key`, or the filename when the file omits it). Passing it lets a
|
|
147
|
-
* file that relies on the filename fallback hash equal to the remote form,
|
|
148
|
-
* which always spells the key out — see `normalizeWorkflowTomlDefaults`.
|
|
149
|
-
*
|
|
150
|
-
* `compareActivation: false` drops `activeConfigName` from the hash. `config diff`
|
|
151
|
-
* passes it when the local file names no configuration: push activates nothing
|
|
152
|
-
* for such a file, so the configuration the server happens to be running is not
|
|
153
|
-
* a difference push could ever reconcile, and hashing it in would report the
|
|
154
|
-
* workflow Modified after every successful push — the non-convergence #2743
|
|
155
|
-
* exists to remove (review follow-up). The remote name stays visible as a hint
|
|
156
|
-
* on the Synced row instead. Defaults to comparing, so the include-reconcile
|
|
157
|
-
* path (`reconcileWorkflowIncludes`, which asks whether the local file already
|
|
158
|
-
* expands to the running state) keeps seeing activation as content.
|
|
159
|
-
*/
|
|
160
|
-
export declare function hashWorkflowTomlForDiff(parsed: any, resolvedKey?: string, options?: {
|
|
161
|
-
compareActivation?: boolean;
|
|
162
|
-
}): string;
|
|
163
|
-
/**
|
|
164
|
-
* Build the canonical content hash for a *server* workflow (as returned by
|
|
165
|
-
* `getWorkflow` + active `getWorkflowConfig`), mirroring exactly what a fresh
|
|
166
|
-
* `config pull` would write to disk. Serializes via `serializeWorkflow`, parses
|
|
167
|
-
* the resulting TOML (remote serialized TOML never carries `include`s, so a
|
|
168
|
-
* plain `parseConfigToml` is sufficient — no fragment path needed), then hashes
|
|
169
|
-
* through `hashWorkflowTomlForDiff` so it lines up with the local-file hash.
|
|
170
|
-
*
|
|
171
|
-
* `logger` is optional but `config diff` passes it: the serializer's
|
|
172
|
-
* unrecognized-server-key warning (#2644) is the only signal that this CLI
|
|
173
|
-
* version cannot represent a field the server holds, and a diff that swallowed
|
|
174
|
-
* it would report the workflow as in sync with no hint that anything is
|
|
175
|
-
* missing.
|
|
176
|
-
*/
|
|
177
|
-
export declare function hashRemoteWorkflowForDiff(workflow: any, draft: any, configs: any[], logger?: (message: string) => void, options?: {
|
|
178
|
-
compareActivation?: boolean;
|
|
179
|
-
}): string;
|
|
180
63
|
export interface ParsedAuthSettings {
|
|
181
64
|
settings: Record<string, any>;
|
|
182
65
|
warnings: string[];
|
|
@@ -253,44 +136,6 @@ export declare function planScopedVarsPull(serverVars: Array<{
|
|
|
253
136
|
content: string;
|
|
254
137
|
varEntities: Record<string, VarEntity>;
|
|
255
138
|
};
|
|
256
|
-
/**
|
|
257
|
-
* Validate a `config push`'s webhook writes against the server's per-app cap.
|
|
258
|
-
* Returns a list of human-readable errors (empty when the push may proceed).
|
|
259
|
-
*
|
|
260
|
-
* Run in `config push`'s up-front preflight (the `planVarsPush` cap pattern) so a
|
|
261
|
-
* push that would run past the cap aborts BEFORE any mutation. Without it the
|
|
262
|
-
* push creates webhooks one at a time until the server rejects one at the cap,
|
|
263
|
-
* leaving a partial push.
|
|
264
|
-
*
|
|
265
|
-
* **Only creates are capped.** The server grandfathers apps that already hold
|
|
266
|
-
* more webhooks than the cap: it refuses new creates and nothing else. A plain
|
|
267
|
-
* file count would break that — `config pull` writes one toml per webhook, so a
|
|
268
|
-
* grandfathered app pulls more files than the cap and could then never push
|
|
269
|
-
* again, its workflows, databases and vars included. So the check compares the
|
|
270
|
-
* local keys against the keys already on the server: a push that creates
|
|
271
|
-
* nothing new is always allowed, however far over the cap the app is, and a
|
|
272
|
-
* push that does create is rejected only when the resulting row count would
|
|
273
|
-
* exceed the cap.
|
|
274
|
-
*
|
|
275
|
-
* The remote key list this runs against comes from `GET
|
|
276
|
-
* /admin/api/apps/{appId}/webhooks`, which applies no default status filter, so
|
|
277
|
-
* archived rows are in `remoteKeys` exactly as they are in the server's count.
|
|
278
|
-
* The two therefore agree on what is already on the server.
|
|
279
|
-
*
|
|
280
|
-
* Still advisory rather than authoritative: this counts creates the way the
|
|
281
|
-
* *config dir* implies, while the apply loop decides create-vs-update from
|
|
282
|
-
* local sync state, so a checkout with missing sync state issues creates this
|
|
283
|
-
* check did not predict. Those creates name keys the server already holds, and
|
|
284
|
-
* the server does not cap a create that adds no row — it answers 409
|
|
285
|
-
* `WEBHOOK_KEY_EXISTS`, which `adoptByKeyOnCreate409` converges on. A push
|
|
286
|
-
* allowed here can still be rejected server-side (concurrent writes, a stale
|
|
287
|
-
* list); that rejection carries `WEBHOOK_LIMIT_REACHED` and names the limit.
|
|
288
|
-
*
|
|
289
|
-
* Planned prunes are deliberately NOT netted out of the count: `--prune` runs
|
|
290
|
-
* after the webhook create loop, so a push that only fits once its prunes land
|
|
291
|
-
* would still fail mid-apply. Prune first, then push the additions.
|
|
292
|
-
*/
|
|
293
|
-
export declare function validateWebhookCapForPush(localKeys: string[], remoteKeys: string[]): string[];
|
|
294
139
|
/**
|
|
295
140
|
* Validate a parsed `vars.toml` table against the same key/value constraints
|
|
296
141
|
* the server enforces (key format, string type, non-empty, size cap) plus the
|
|
@@ -314,6 +159,10 @@ export declare function validateWebhookCapForPush(localKeys: string[], remoteKey
|
|
|
314
159
|
*/
|
|
315
160
|
export declare function validateVarsFile(parsedVars: Record<string, unknown>, options?: {
|
|
316
161
|
onlyKeys?: ReadonlySet<string>;
|
|
162
|
+
/** The file the entries came from, for the messages (#4485). */
|
|
163
|
+
fileName?: string;
|
|
164
|
+
/** Skip the count cap — the caller measures it on a layered set (#4485). */
|
|
165
|
+
skipCountCap?: boolean;
|
|
317
166
|
}): string[];
|
|
318
167
|
/**
|
|
319
168
|
* Plan the config-var writes a `config push` should make, detecting concurrent
|
|
@@ -418,114 +267,17 @@ export declare function countVarsAfterPush(remoteVars: Array<{
|
|
|
418
267
|
* local value). Pure and side-effect-free so it's unit-testable without a live
|
|
419
268
|
* server.
|
|
420
269
|
*/
|
|
421
|
-
export declare function diffVars(localVars: Map<string, string>, remoteVars: Map<string, string
|
|
270
|
+
export declare function diffVars(localVars: Map<string, string>, remoteVars: Map<string, string>,
|
|
271
|
+
/**
|
|
272
|
+
* The file `config pull` would write a server value into — a machine-local
|
|
273
|
+
* environment's override file (#4485). Defaults to `vars.toml`.
|
|
274
|
+
*/
|
|
275
|
+
pullTargetFile?: string): Array<{
|
|
422
276
|
type: "var";
|
|
423
277
|
key: string;
|
|
424
278
|
status: string;
|
|
425
279
|
hint?: string;
|
|
426
280
|
}>;
|
|
427
|
-
/**
|
|
428
|
-
* Which of a workflow's configs `config pull` writes as sidecar files
|
|
429
|
-
* (issue #2645, spec §Contracts/Named configs).
|
|
430
|
-
*
|
|
431
|
-
* Every config EXCEPT the active one. The active config's body is already the
|
|
432
|
-
* `steps` at the top of `workflows/<key>.toml` — that is where authors edit it
|
|
433
|
-
* and where `applyWorkflowBody` writes it — so emitting it again as a sidecar
|
|
434
|
-
* would put the same body in two files and create a mismatch to adjudicate on
|
|
435
|
-
* the next push. Two declarations of one piece of state is the shape of problem
|
|
436
|
-
* this whole issue removes; it would be perverse to introduce one here.
|
|
437
|
-
*
|
|
438
|
-
* A config whose steps were not fetched is SKIPPED rather than written empty.
|
|
439
|
-
* A sidecar is a claim about the server, and `steps = []` is a claim that would
|
|
440
|
-
* tell the next push to blank a live configuration.
|
|
441
|
-
*
|
|
442
|
-
* Pure, so the selection is unit-testable without a live server.
|
|
443
|
-
*/
|
|
444
|
-
export declare function workflowConfigSidecarsToWrite(workflow: any, configs: any[]): Array<{
|
|
445
|
-
name: string;
|
|
446
|
-
content: string;
|
|
447
|
-
}>;
|
|
448
|
-
/**
|
|
449
|
-
* The names a workflow's configs occupy on the server, whatever their body.
|
|
450
|
-
*
|
|
451
|
-
* `workflowConfigSidecarsToWrite` deliberately skips a config whose steps were
|
|
452
|
-
* not fetched, so it cannot answer "which sidecar files are stale". This can:
|
|
453
|
-
* a local file whose name is absent HERE names a config the server no longer
|
|
454
|
-
* has, which is the only safe basis for deleting it (issue #2645, review
|
|
455
|
-
* follow-up).
|
|
456
|
-
*/
|
|
457
|
-
export declare function workflowConfigNamesOnServer(workflow: any, configs: any[]): Set<string>;
|
|
458
|
-
/**
|
|
459
|
-
* Delete the sidecars naming a config the server no longer has (#2645).
|
|
460
|
-
*
|
|
461
|
-
* Pull is what makes the repo describe the server, and a sidecar left behind
|
|
462
|
-
* after its config was archived — or after that config became the active one,
|
|
463
|
-
* whose body is the workflow file's `steps` — is a file that would RE-CREATE it
|
|
464
|
-
* on the next push. The repo would then be silently undoing the archive.
|
|
465
|
-
*
|
|
466
|
-
* Returns the file names removed, so pull can say what it did.
|
|
467
|
-
*/
|
|
468
|
-
export declare function removeStaleWorkflowConfigSidecars(configDir: string, key: string, namesOnServer: Set<string>): string[];
|
|
469
|
-
/**
|
|
470
|
-
* The content hash `config push` skips a workflow on — sidecars included.
|
|
471
|
-
*
|
|
472
|
-
* The stored hash used to cover `workflows/<key>.toml` alone, so editing or
|
|
473
|
-
* adding a named config sidecar without touching the workflow file left the
|
|
474
|
-
* hash unchanged: push reported success and made no call at all, which is
|
|
475
|
-
* worse than failing (issue #2645, review follow-up). The named configs are
|
|
476
|
-
* part of what push applies, so they are part of what push compares.
|
|
477
|
-
*
|
|
478
|
-
* A workflow with no sidecars hashes exactly as before, so the common case
|
|
479
|
-
* does not re-push once on upgrade. An unreadable sidecar hashes to a distinct
|
|
480
|
-
* value rather than throwing: a hash is a comparison, and the parse error
|
|
481
|
-
* belongs to the apply path, which raises it with the file name attached.
|
|
482
|
-
*/
|
|
483
|
-
export declare function workflowHashInput(configDir: string, key: string, parsedWorkflowToml: any): any;
|
|
484
|
-
/** See `workflowHashInput`. */
|
|
485
|
-
export declare function computeWorkflowContentHash(configDir: string, key: string, parsedWorkflowToml: any): string;
|
|
486
|
-
/**
|
|
487
|
-
* Canonical hash of a named config sidecar, for `config diff` (#2645).
|
|
488
|
-
*
|
|
489
|
-
* Hashes the parsed body rather than the bytes so comment and key-order
|
|
490
|
-
* differences do not read as drift — the same semantic comparison `config diff`
|
|
491
|
-
* makes everywhere else (spec criterion 3).
|
|
492
|
-
*/
|
|
493
|
-
export declare function hashWorkflowConfigSidecar(parsed: any): string;
|
|
494
|
-
/**
|
|
495
|
-
* Does the file's `[workflow].activeConfigName` name a configuration that the
|
|
496
|
-
* push could actually activate (#2743, review follow-up)?
|
|
497
|
-
*
|
|
498
|
-
* The diff normalizer equates an omitted `activeConfigName` with `default` —
|
|
499
|
-
* the name the server itself gives the config it creates — so a file that
|
|
500
|
-
* spells `default` out hashes equal to the omitted form. For a workflow with no
|
|
501
|
-
* configuration at all (a legacy row the GET's auto-migration could not heal),
|
|
502
|
-
* the remote side serializes an EMPTY active config name and normalizes to
|
|
503
|
-
* `default` too, so the pair hashes equal while `config push` would stop on
|
|
504
|
-
* `activeConfigName "default" names no configuration`. Reporting Synced for a
|
|
505
|
-
* file whose next push fails is the one drift a change gate must not skip.
|
|
506
|
-
*
|
|
507
|
-
* A name the repo carries as a sidecar resolves: push creates that config and
|
|
508
|
-
* activates it (and the sidecar comparison already reports the difference).
|
|
509
|
-
* Read-only and non-throwing, like every other diff predicate.
|
|
510
|
-
*/
|
|
511
|
-
export declare function workflowActiveConfigNameUnresolvable(configDir: string, key: string, localParsed: any, configs: any[]): boolean;
|
|
512
|
-
/**
|
|
513
|
-
* The `config diff` note for a workflow whose file names no configuration while
|
|
514
|
-
* the server runs one other than the `default` it creates itself (#2743, review
|
|
515
|
-
* follow-up).
|
|
516
|
-
*
|
|
517
|
-
* Such a file is not drift push can act on: activation is preserved, not
|
|
518
|
-
* converged, so the row is Synced — the alternative, reporting Modified,
|
|
519
|
-
* repeats forever because no push changes it. But the repo does not describe
|
|
520
|
-
* which configuration is live, and only `config pull` records it, so the fact is
|
|
521
|
-
* carried as a hint on the Synced row — the same way an operational disable is
|
|
522
|
-
* (`outOfServiceHint`). The server-created `default` is the shape a
|
|
523
|
-
* hand-authored file already means, so it is silent.
|
|
524
|
-
*
|
|
525
|
-
* Pure and non-throwing, like every other diff predicate. Returns the existing
|
|
526
|
-
* hint untouched when there is nothing to add.
|
|
527
|
-
*/
|
|
528
|
-
export declare function unmanagedActiveConfigHint(localParsed: any, workflow: any, configs: any[], existingHint?: string): string | undefined;
|
|
529
281
|
/**
|
|
530
282
|
* Drop the archived rows from a pull listing (#2803).
|
|
531
283
|
*
|
|
@@ -624,53 +376,34 @@ export declare function outOfServiceHint(remote: any, existingHint?: string): st
|
|
|
624
376
|
/**
|
|
625
377
|
* Serialize an integration DETAIL response to its `integrations/<key>.toml`.
|
|
626
378
|
*
|
|
627
|
-
*
|
|
628
|
-
*
|
|
629
|
-
*
|
|
630
|
-
* of clearing it. A null/empty rule has no TOML representation and is simply
|
|
631
|
-
* omitted; the push path sends `null` for an omitted rule, which matches the
|
|
632
|
-
* server state it came from.
|
|
379
|
+
* The `[integration]` keys come from the vendored definition, so the
|
|
380
|
+
* deprecated `accessRule` (#4872) is never written, even from a server that
|
|
381
|
+
* still returns it.
|
|
633
382
|
*/
|
|
634
383
|
export declare function serializeIntegration(integration: any, logger?: (message: string) => void): string;
|
|
635
384
|
/**
|
|
636
385
|
* Build the `config push` body for one integration TOML.
|
|
637
386
|
*
|
|
638
|
-
* `accessRule`
|
|
639
|
-
*
|
|
640
|
-
* leaving a stale one live. There is deliberately NO local "rule is required"
|
|
641
|
-
* check here — a remote integration missing from local sync state is pushed as
|
|
642
|
-
* a create, expected to 409, and adopted by key (#1006); a local check would
|
|
643
|
-
* strand that path. The server decides (#2631).
|
|
387
|
+
* The deprecated `accessRule` line (#4872) is accepted in the file and never
|
|
388
|
+
* sent: the body carries the definition's fields only.
|
|
644
389
|
*/
|
|
645
390
|
export declare function buildIntegrationPushPayload(key: string, tomlData: any, { mode }?: {
|
|
646
391
|
mode?: PushMode;
|
|
647
392
|
}): Record<string, any>;
|
|
648
|
-
export declare function
|
|
649
|
-
export declare function tomlTableToWebhookConfig(scheme: string, table: any): Record<string, any> | undefined;
|
|
650
|
-
export declare function serializeWebhook(webhook: any, logger?: (message: string) => void): string;
|
|
393
|
+
export declare function serializeBlobBucket(bucket: any, ruleSetIdToName?: Map<string, string>, logger?: (message: string) => void): string;
|
|
651
394
|
/**
|
|
652
|
-
*
|
|
395
|
+
* The entity a `blob-buckets/<key>.toml` describes (#4116) — the parse
|
|
396
|
+
* `config push` builds its bodies from and `config diff` compares.
|
|
653
397
|
*
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
* `
|
|
657
|
-
*
|
|
658
|
-
*/
|
|
659
|
-
export declare function buildWebhookPushPayload(key: string, tomlData: any, { mode }?: {
|
|
660
|
-
mode?: PushMode;
|
|
661
|
-
}): Record<string, any>;
|
|
662
|
-
export declare function serializeCronTrigger(trigger: any, logger?: (message: string) => void): string;
|
|
663
|
-
/**
|
|
664
|
-
* Build the `config push` body for one cron-trigger TOML.
|
|
398
|
+
* Read in CREATE mode, so the immutable `ttlTier` stays nameable. The rule set
|
|
399
|
+
* is left as `_ruleSetName` for `resolveRuleSetReference`. The id spelling
|
|
400
|
+
* `ruleSetId` is a retired key (#4283): the preflight refuses a file carrying
|
|
401
|
+
* it, and this parse never reads it.
|
|
665
402
|
*
|
|
666
|
-
* `
|
|
667
|
-
*
|
|
668
|
-
* the server used to drop it silently.
|
|
403
|
+
* An omitted `name` stays omitted: the update leaves the server's name alone,
|
|
404
|
+
* and only the create body falls back to the key.
|
|
669
405
|
*/
|
|
670
|
-
export declare function
|
|
671
|
-
mode?: PushMode;
|
|
672
|
-
}): Record<string, any>;
|
|
673
|
-
export declare function serializeBlobBucket(bucket: any, logger?: (message: string) => void): string;
|
|
406
|
+
export declare function parseBlobBucketToml(doc: any): any;
|
|
674
407
|
/**
|
|
675
408
|
* Build the PATCH payload for a blob-bucket update from local TOML.
|
|
676
409
|
*
|
|
@@ -726,35 +459,14 @@ export declare function promptConfigPayload(tomlConfig: any, options?: {
|
|
|
726
459
|
create?: boolean;
|
|
727
460
|
}): Record<string, any>;
|
|
728
461
|
/**
|
|
729
|
-
* Build the POST body for a blob-bucket create from
|
|
462
|
+
* Build the POST body for a blob-bucket create from the parsed entity
|
|
463
|
+
* (`parseBlobBucketToml`, its rule set resolved).
|
|
730
464
|
*
|
|
731
465
|
* `ttlTier` is here and absent from the update body because the definition says
|
|
732
466
|
* so (`writableOn: ["create"]`) — the retention tier is fixed at creation.
|
|
733
467
|
*/
|
|
734
468
|
export declare function buildBlobBucketCreatePayload(key: string, bucket: any): Record<string, any>;
|
|
735
469
|
export declare function serializePrompt(prompt: any, logger?: (message: string) => void): string;
|
|
736
|
-
/**
|
|
737
|
-
* The `config push` warning for a resource pushed with no `accessRule` (#2652).
|
|
738
|
-
*
|
|
739
|
-
* Returns `null` when a rule is declared — and for a `runAs = "system"`
|
|
740
|
-
* workflow, which rejects any rule and cannot be started by a member at all.
|
|
741
|
-
* Otherwise it names the resource, the consequence, and the one-line restore,
|
|
742
|
-
* because after the #2652 flip a ruleless prompt or caller workflow denies
|
|
743
|
-
* every non-admin caller from the deploy onward.
|
|
744
|
-
*
|
|
745
|
-
* Both kinds now push `accessRule` as value-or-`null` — the prompt since #1567,
|
|
746
|
-
* the workflow since #2743's always-send conversion — so for either one an
|
|
747
|
-
* omitted key really does leave the resource ruleless on the server. The
|
|
748
|
-
* workflow wording says so explicitly, because it used to say the opposite
|
|
749
|
-
* (the update path preserved a stored rule) and an operator who learned that
|
|
750
|
-
* caveat needs to see it retracted.
|
|
751
|
-
*/
|
|
752
|
-
export declare function missingAccessRuleWarning(opts: {
|
|
753
|
-
kind: "prompt" | "workflow";
|
|
754
|
-
key: string;
|
|
755
|
-
accessRule: unknown;
|
|
756
|
-
runAs?: unknown;
|
|
757
|
-
}): string | null;
|
|
758
470
|
/**
|
|
759
471
|
* Build the `config push` body for one prompt TOML's `[prompt]` table.
|
|
760
472
|
*
|
|
@@ -819,25 +531,6 @@ export declare function seededOnlyPromptConfigFields(firstConfig: any, seededCon
|
|
|
819
531
|
export declare function buildPromptConfigPayload(tomlConfig: any, { mode }?: {
|
|
820
532
|
mode?: PushMode;
|
|
821
533
|
}): Record<string, any>;
|
|
822
|
-
/**
|
|
823
|
-
* Rewrite a workflow TOML file's string-form `inputSchema` / `outputSchema` to
|
|
824
|
-
* native object form for `config migrate-toml` (issue #1446).
|
|
825
|
-
*
|
|
826
|
-
* Purely local, no server fetch. Parses the raw source WITHOUT expanding
|
|
827
|
-
* fragment `include`s (so those directives survive the rewrite), swaps a
|
|
828
|
-
* JSON-string schema for its parsed object when it round-trips faithfully
|
|
829
|
-
* (`canEmitNative === null`), and re-serializes via `stringifyConfigToml`.
|
|
830
|
-
*
|
|
831
|
-
* Only rewrites when a field is actually converted: a file whose schemas are
|
|
832
|
-
* already native, absent, or un-representable (a `null` default) is returned
|
|
833
|
-
* with `changed: false` and its original bytes untouched — so migrate is
|
|
834
|
-
* idempotent and never reports a spurious migration or reformats a file it
|
|
835
|
-
* didn't need to touch.
|
|
836
|
-
*/
|
|
837
|
-
export declare function rewriteWorkflowSchemasToNative(rawToml: string, workflowKey?: string, log?: (message: string) => void): {
|
|
838
|
-
content: string;
|
|
839
|
-
changed: boolean;
|
|
840
|
-
};
|
|
841
534
|
/**
|
|
842
535
|
* #2644 — `config push` rejects any key the vendored definition does not
|
|
843
536
|
* recognize, so a mistyped or newer-server key fails locally instead of being
|
|
@@ -849,6 +542,13 @@ export declare function rewriteWorkflowSchemasToNative(rawToml: string, workflow
|
|
|
849
542
|
* the third `[[configs]]` block is as loud as one in the first.
|
|
850
543
|
*/
|
|
851
544
|
export declare function configUnknownKeyError(filePath: string, tomlData: any, table: ConfigTable): string | null;
|
|
545
|
+
/**
|
|
546
|
+
* The warnings `config push` prints for one file that still carries a
|
|
547
|
+
* DEPRECATED key (#4872): the registry's dated sentence per key, prefixed with
|
|
548
|
+
* the file. The key is accepted and ignored, so these never fail the push;
|
|
549
|
+
* `[]` for a file that carries none.
|
|
550
|
+
*/
|
|
551
|
+
export declare function configDeprecatedKeyWarnings(filePath: string, tomlData: any, table: ConfigTable): string[];
|
|
852
552
|
/**
|
|
853
553
|
* #2644 — the document-level half of the same rejection: a top-level table the
|
|
854
554
|
* object's definition does not declare, or a field table written with the wrong
|
|
@@ -858,7 +558,7 @@ export declare function configUnknownKeyError(filePath: string, tomlData: any, t
|
|
|
858
558
|
* Unrecognized keys INSIDE a table were already rejected; a mistyped table
|
|
859
559
|
* HEADER was not, and it is the more destructive of the two — `[integraton]`
|
|
860
560
|
* leaves `[integration]` absent, so the push builder reads an empty table and
|
|
861
|
-
* sends `description: null
|
|
561
|
+
* sends `description: null`, CLEARING it server-side.
|
|
862
562
|
* The design gate settled the posture (2026-08-12): push rejects everything
|
|
863
563
|
* unknown, tables included.
|
|
864
564
|
*/
|
|
@@ -891,6 +591,26 @@ export interface ConfigFileValidationError {
|
|
|
891
591
|
/** The messages, verbatim — the same text `config push` aborts with. */
|
|
892
592
|
messages: string[];
|
|
893
593
|
}
|
|
594
|
+
/**
|
|
595
|
+
* The `SyncState.entities` slots of the object types #3190 retired. A state
|
|
596
|
+
* file written before the retirement still carries them; `config pull` drops
|
|
597
|
+
* them and says so once (`retiredSyncStateSlots`).
|
|
598
|
+
*/
|
|
599
|
+
export declare const RETIRED_SYNC_STATE_SLOTS: readonly ["workflows", "scripts", "webhooks", "cronTriggers"];
|
|
600
|
+
/** The retired slots a prior state holds records in, in declaration order. */
|
|
601
|
+
export declare function retiredSyncStateSlots(entities: unknown): string[];
|
|
602
|
+
/**
|
|
603
|
+
* The retirement sentences for every retired object directory a config tree
|
|
604
|
+
* still holds (#3190), in the table's order. `config push` refuses the tree on
|
|
605
|
+
* any of them and `config diff` reports the same rows.
|
|
606
|
+
*/
|
|
607
|
+
export declare function retiredConfigDirectoriesIn(configDir: string): string[];
|
|
608
|
+
/**
|
|
609
|
+
* The files a config tree still holds under a retired type-config directory
|
|
610
|
+
* (#4731), as one refusal per directory naming each file. An empty directory
|
|
611
|
+
* an older pull left behind holds nothing to apply and is not refused.
|
|
612
|
+
*/
|
|
613
|
+
export declare function retiredTypeConfigFilesIn(configDir: string): string[];
|
|
894
614
|
/**
|
|
895
615
|
* `config push`'s preflight — every check the authored files decide on their
|
|
896
616
|
* own, run before the FIRST mutating call (#976 fix A, #3320, #3375).
|
|
@@ -926,9 +646,23 @@ export declare function runConfigPushPreflight(input: {
|
|
|
926
646
|
syncState: SyncState | null;
|
|
927
647
|
force: boolean;
|
|
928
648
|
isCrossAppPush: boolean;
|
|
929
|
-
|
|
649
|
+
/**
|
|
650
|
+
* The environment is machine-local (#4117): `[app].name` is the shared
|
|
651
|
+
* tree's, never this app's, so it is out of the validated body.
|
|
652
|
+
*/
|
|
653
|
+
localEnvironment?: boolean;
|
|
654
|
+
client: Pick<ApiClient, "listIntegrations" | "listFunctions" | "listPrompts" | "listPromptConfigs">;
|
|
655
|
+
/** #4485 — the environment's vars override file, layered over vars.toml. */
|
|
656
|
+
varsOverridePath?: string | null;
|
|
930
657
|
}): Promise<{
|
|
931
658
|
parsedVars: Record<string, unknown> | null;
|
|
659
|
+
/** #4441 — agent files to apply before the functions leg. */
|
|
660
|
+
agentFilesFirst: string[];
|
|
661
|
+
/** #4485 — which override keys replace or add, when an override was read. */
|
|
662
|
+
varsOverrideKeys: {
|
|
663
|
+
overridingKeys: string[];
|
|
664
|
+
addedKeys: string[];
|
|
665
|
+
} | null;
|
|
932
666
|
}>;
|
|
933
667
|
export declare function promptKindFileErrors(filePath: string, tomlData: any): string[];
|
|
934
668
|
/**
|
|
@@ -958,6 +692,90 @@ export declare function agentFunctionFactsForPush(input: {
|
|
|
958
692
|
facts: AgentFunctionFacts;
|
|
959
693
|
liveListed: boolean;
|
|
960
694
|
};
|
|
695
|
+
/**
|
|
696
|
+
* The functions the app holds now, as the agent rules read them — #3798. A
|
|
697
|
+
* live row that is archived is a tombstone, not a function, so it is absent.
|
|
698
|
+
*/
|
|
699
|
+
export declare function liveAgentFunctionFacts(live: ReadonlyArray<Record<string, unknown>> | null): Record<string, AgentFunctionFact>;
|
|
700
|
+
/** A selected `functions/<file>` and the key push resolves it to. */
|
|
701
|
+
export interface FunctionChangePreflightFile {
|
|
702
|
+
file: string;
|
|
703
|
+
key: string;
|
|
704
|
+
}
|
|
705
|
+
/** A prompt of the app's live listing, as `functionChangePreflight` reads it. */
|
|
706
|
+
export interface FunctionChangePreflightPrompt {
|
|
707
|
+
promptId: string;
|
|
708
|
+
promptKey: string;
|
|
709
|
+
kind?: unknown;
|
|
710
|
+
status?: unknown;
|
|
711
|
+
/** `[prompt.agent]` as stored. */
|
|
712
|
+
agent?: unknown;
|
|
713
|
+
}
|
|
714
|
+
/** A selected agent prompt file. */
|
|
715
|
+
export interface FunctionChangePreflightAgentFile {
|
|
716
|
+
/** The file name under `prompts/`. */
|
|
717
|
+
file: string;
|
|
718
|
+
promptKey: string;
|
|
719
|
+
/** The parsed file. */
|
|
720
|
+
tomlData: any;
|
|
721
|
+
}
|
|
722
|
+
/** What `functionChangePreflight` reads: everything the push already listed or parsed. */
|
|
723
|
+
export interface FunctionChangePreflightInput {
|
|
724
|
+
/** The function files this push selects. */
|
|
725
|
+
selectedFunctionFiles: ReadonlyArray<FunctionChangePreflightFile>;
|
|
726
|
+
/** The functions the app holds now (`liveAgentFunctionFacts`). */
|
|
727
|
+
live: AgentFunctionFacts;
|
|
728
|
+
/** What this push believes: the live functions overlaid by the selected files. */
|
|
729
|
+
pushed: AgentFunctionFacts;
|
|
730
|
+
/** The app's prompts, or `null` when they could not be listed. */
|
|
731
|
+
prompts: ReadonlyArray<FunctionChangePreflightPrompt> | null;
|
|
732
|
+
/** Every config of each live agent that names a changed function, by `promptId`. */
|
|
733
|
+
configsOf: ReadonlyMap<string, ReadonlyArray<AgentSchemaConfigFact>>;
|
|
734
|
+
/** The agent prompt files this push selects. */
|
|
735
|
+
selectedAgentFiles: ReadonlyArray<FunctionChangePreflightAgentFile>;
|
|
736
|
+
}
|
|
737
|
+
/** The preflight errors, the warnings, and the agent files to apply first. */
|
|
738
|
+
export interface FunctionChangePreflightResult {
|
|
739
|
+
errors: string[];
|
|
740
|
+
warnings: string[];
|
|
741
|
+
/** Agent files to apply before the server-functions leg (`partitionPromptFilesForPush`). */
|
|
742
|
+
agentFilesFirst: string[];
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* The selected function files that CHANGE a live function — #4441. A file
|
|
746
|
+
* whose function is not live creates it, which no agent can depend on yet.
|
|
747
|
+
* The push lists the app's prompts only when this is non-empty.
|
|
748
|
+
*/
|
|
749
|
+
export declare function functionChangePreflightKeys(selectedFunctionFiles: ReadonlyArray<FunctionChangePreflightFile>, live: AgentFunctionFacts): FunctionChangePreflightFile[];
|
|
750
|
+
/**
|
|
751
|
+
* The live, non-archived agent prompts that name at least one of `keys`.
|
|
752
|
+
* Whose configs the push reads for `functionChangePreflight`.
|
|
753
|
+
*/
|
|
754
|
+
export declare function functionChangePreflightAgents(prompts: ReadonlyArray<FunctionChangePreflightPrompt>, keys: ReadonlyArray<string>): FunctionChangePreflightPrompt[];
|
|
755
|
+
/**
|
|
756
|
+
* Would a function change this push makes break a live agent? — #4441.
|
|
757
|
+
*
|
|
758
|
+
* The same rule the function routes run (`agentFunctionChangeRefusals`), so a
|
|
759
|
+
* change the preflight lets through is one the server accepts, run for every
|
|
760
|
+
* selected file that changes a live function against every live non-archived
|
|
761
|
+
* agent that names it, with every config of that agent:
|
|
762
|
+
*
|
|
763
|
+
* - an agent whose prompt file this push does NOT select would be broken by
|
|
764
|
+
* the change: a preflight error naming the function file, the agent and its
|
|
765
|
+
* uses, and the remedy (change the agent in the same push, or retire it);
|
|
766
|
+
* - an agent whose file IS selected keeps the existing order (applied after
|
|
767
|
+
* the functions leg) unless its LIVE declaration would be broken by the
|
|
768
|
+
* change. Then the file must go first to release the reference, which it
|
|
769
|
+
* can only do when it is valid against the functions the app holds NOW —
|
|
770
|
+
* its references, the providers of its non-archived configs, and the
|
|
771
|
+
* providers of the configs the server still holds at its prompt PATCH. When it
|
|
772
|
+
* is, it joins `agentFilesFirst`; when it is not, the push cannot be
|
|
773
|
+
* ordered in one run and the error names the sequence that can.
|
|
774
|
+
*
|
|
775
|
+
* `prompts: null` (the listing failed) checks nothing and says so once; the
|
|
776
|
+
* server's refusal remains.
|
|
777
|
+
*/
|
|
778
|
+
export declare function functionChangePreflight(input: FunctionChangePreflightInput): FunctionChangePreflightResult;
|
|
961
779
|
/**
|
|
962
780
|
* The function half of an agent's declaration — #3798: every tool, turn
|
|
963
781
|
* context and history function that the functions this push believes
|
|
@@ -975,17 +793,36 @@ export declare function promptAgentFunctionErrors(filePath: string, tomlData: an
|
|
|
975
793
|
* server functions that must exist when it is created, and the push applies
|
|
976
794
|
* prompts before functions, so agent files go AFTER the server-functions leg;
|
|
977
795
|
* every other file keeps its place. A file that does not parse stays first, so
|
|
978
|
-
* the leg reports it where it always has.
|
|
796
|
+
* the leg reports it where it always has. #4441 — the agent files in
|
|
797
|
+
* `agentFilesFirst` (`functionChangePreflight`) go before the leg instead.
|
|
979
798
|
*/
|
|
980
|
-
export declare function partitionPromptFilesForPush(promptsDir: string, files: readonly string[]): {
|
|
799
|
+
export declare function partitionPromptFilesForPush(promptsDir: string, files: readonly string[], agentFilesFirst?: readonly string[]): {
|
|
981
800
|
beforeFunctions: string[];
|
|
982
801
|
afterFunctions: string[];
|
|
983
802
|
};
|
|
984
803
|
/**
|
|
985
|
-
*
|
|
986
|
-
*
|
|
987
|
-
*
|
|
988
|
-
*
|
|
804
|
+
* The deferred agent files `config push` can still apply — #4437. An agent
|
|
805
|
+
* that names a function this push failed to apply, and that the server does
|
|
806
|
+
* not already hold, would only be refused as naming a function the app does
|
|
807
|
+
* not have. It is held back instead, with a failure that names the function as
|
|
808
|
+
* the cause; the function's own failure row says why. A file that does not
|
|
809
|
+
* parse is left for the prompt leg to report.
|
|
810
|
+
*/
|
|
811
|
+
export declare function holdAgentPromptFilesForUnappliedFunctions(promptsDir: string, files: readonly string[], unappliedFunctionKeys: ReadonlySet<string>): {
|
|
812
|
+
apply: string[];
|
|
813
|
+
held: Array<{
|
|
814
|
+
key: string;
|
|
815
|
+
message: string;
|
|
816
|
+
}>;
|
|
817
|
+
};
|
|
818
|
+
/**
|
|
819
|
+
* Every `prompts/<key>.tests/*.toml` sidecar the agent test case's rule
|
|
820
|
+
* refuses — #4262 (#3798 refused every sidecar on an agent). An agent's case
|
|
821
|
+
* is checked by the vendored shape rule (`resolveAgentTestCase`), which the
|
|
822
|
+
* admin routes run too; a `[test.agent]` block on a chat or decisions
|
|
823
|
+
* prompt's case is refused by name. One line per file, naming it. What needs
|
|
824
|
+
* the app (the input, context and event schemas, the declared names) is the
|
|
825
|
+
* routes' to decide at apply.
|
|
989
826
|
*/
|
|
990
827
|
export declare function promptAgentSidecarErrors(configDir: string): string[];
|
|
991
828
|
/**
|
|
@@ -1013,14 +850,32 @@ export declare function promptKindImmutableOutcome(storedKind: PromptKind | unde
|
|
|
1013
850
|
action: "immutable";
|
|
1014
851
|
}> | null;
|
|
1015
852
|
/**
|
|
1016
|
-
* The
|
|
1017
|
-
*
|
|
853
|
+
* The file-decidable refusals `config push` gives one config file — the
|
|
854
|
+
* per-file body of `collectConfigFileValidationErrors`, shared with `config
|
|
855
|
+
* pull` (#4160), which never keeps a local file push would refuse.
|
|
1018
856
|
*
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
857
|
+
* `tables` are the tables whose unrecognized keys are checked here (none for a
|
|
858
|
+
* workflow, whose own validator owns that message); declared types run over
|
|
859
|
+
* every table of the surface.
|
|
1021
860
|
*/
|
|
1022
|
-
export declare function
|
|
861
|
+
export declare function configFileValidationMessages(filePath: string, tomlData: any, surface: ConfigObjectSurface, tables: readonly ConfigTable[]): string[];
|
|
862
|
+
/**
|
|
863
|
+
* Whether `config pull` must rewrite a local file whatever it says (#4160):
|
|
864
|
+
* `config push` would refuse it. Keeping such a file because its VALUES match
|
|
865
|
+
* would leave the tree unpushable after a pull that reported success.
|
|
866
|
+
*
|
|
867
|
+
* #4872 — or it still carries a DEPRECATED key. The key compares as nothing,
|
|
868
|
+
* so the file would be kept, and the pull the push warning names would not
|
|
869
|
+
* remove the line.
|
|
870
|
+
*/
|
|
871
|
+
export declare function pullMustRewrite(label: string, tomlData: any): boolean;
|
|
1023
872
|
export declare function collectConfigFileValidationErrors(configDir: string): ConfigFileValidationError[];
|
|
873
|
+
/**
|
|
874
|
+
* The deprecated-key warnings for every file `collectConfigFileValidationErrors`
|
|
875
|
+
* reads (#4872), one line per file and key. Advisory: the keys are accepted and
|
|
876
|
+
* ignored, so these are printed and never refuse a push.
|
|
877
|
+
*/
|
|
878
|
+
export declare function collectConfigDeprecatedKeyWarnings(configDir: string): string[];
|
|
1024
879
|
/**
|
|
1025
880
|
* Every `functions/<key>.toml` whose file-decidable errors `config push` would
|
|
1026
881
|
* refuse (#3320).
|
|
@@ -1038,17 +893,6 @@ export declare function collectConfigFileValidationErrors(configDir: string): Co
|
|
|
1038
893
|
* the parse error itself, and reporting it twice helps nobody.
|
|
1039
894
|
*/
|
|
1040
895
|
export declare function collectFunctionTomlValidationErrors(configDir: string): ConfigFileValidationError[];
|
|
1041
|
-
/**
|
|
1042
|
-
* The retired runtime keys every `functions/*.toml` in the tree still carries
|
|
1043
|
-
* — #3482, the warning half of the collector above.
|
|
1044
|
-
*
|
|
1045
|
-
* Separate from the errors because it IS separate: a file carrying one of
|
|
1046
|
-
* these pushes, with every other key applied, so it is not a row `config diff`
|
|
1047
|
-
* calls invalid. It is a line an author reads on stderr from both commands, so
|
|
1048
|
-
* the two keep reading identically (the #2880 symmetry the errors collector
|
|
1049
|
-
* exists for, applied to advice rather than refusals).
|
|
1050
|
-
*/
|
|
1051
|
-
export declare function collectFunctionTomlIgnoredKeyWarnings(configDir: string): string[];
|
|
1052
896
|
/**
|
|
1053
897
|
* The collectors' rows, one per diff row (#2880 symmetry, #3320).
|
|
1054
898
|
*
|
|
@@ -1066,8 +910,7 @@ export declare function mergeConfigFileValidationErrors(collected: ConfigFileVal
|
|
|
1066
910
|
*
|
|
1067
911
|
* Test cases are a registered surface (#2644 phase 3) but they are not a
|
|
1068
912
|
* `SYNC_RESOURCE_TYPES` directory — they live beside the block they test, in
|
|
1069
|
-
* `prompts/<key>.tests
|
|
1070
|
-
* and (since #2769) `integrations/<key>.tests/` — so
|
|
913
|
+
* `prompts/<key>.tests/` and (since #2769) `integrations/<key>.tests/` — so
|
|
1071
914
|
* `unknownKeyPreflightTargets`, which crosses
|
|
1072
915
|
* the registry with that table, never reaches them. Listing them here gives the
|
|
1073
916
|
* sidecars the same unrecognized-key rejection every per-entity file has
|
|
@@ -1075,42 +918,6 @@ export declare function mergeConfigFileValidationErrors(collected: ConfigFileVal
|
|
|
1075
918
|
* dropped on the way to the server.
|
|
1076
919
|
*/
|
|
1077
920
|
export declare function testCaseTomlFiles(configDir: string): string[];
|
|
1078
|
-
/** The `[workflow]` case of `configUnknownKeyError` (#2644 phase 1). */
|
|
1079
|
-
export declare function workflowUnknownKeyError(filePath: string, tomlData: any): string | null;
|
|
1080
|
-
/**
|
|
1081
|
-
* Will `config push` reach this workflow key through its UPDATE path?
|
|
1082
|
-
*
|
|
1083
|
-
* The push takes that path when sync state already holds an id for the key —
|
|
1084
|
-
* the `existingId` the apply loop reads. Everything else is a create (including
|
|
1085
|
-
* a create that 409s and adopts by key, which cannot be known before the server
|
|
1086
|
-
* answers). Exported so the front-loaded preflight can decide, before the first
|
|
1087
|
-
* mutating call, which files the update-only `name` pre-check applies to.
|
|
1088
|
-
*/
|
|
1089
|
-
export declare function isWorkflowUpdateTarget(key: string, syncState: {
|
|
1090
|
-
entities?: {
|
|
1091
|
-
workflows?: Record<string, any>;
|
|
1092
|
-
};
|
|
1093
|
-
} | null): boolean;
|
|
1094
|
-
/**
|
|
1095
|
-
* Will the apply loop actually SEND this workflow, or skip it as unchanged?
|
|
1096
|
-
*
|
|
1097
|
-
* Mirrors the loop's skip condition (`!force && existingId &&
|
|
1098
|
-
* !shouldPushExpandedFile(...)`): a create always sends, `--force` always
|
|
1099
|
-
* sends, and an update sends only when the expanded content (workflow file plus
|
|
1100
|
-
* its config sidecars) differs from the hash sync state recorded for it.
|
|
1101
|
-
*
|
|
1102
|
-
* Exported so the front-loaded preflight can scope the update-only `name`
|
|
1103
|
-
* pre-check to the files this push will really update. Without that scoping a
|
|
1104
|
-
* workflow created through the manifest-key `name` fallback — an authoring
|
|
1105
|
-
* shape the create path deliberately supports — would push once and then fail
|
|
1106
|
-
* every later push, including a no-change one and its `--dry-run`, on a file
|
|
1107
|
-
* the push was never going to send (#2743, review follow-up).
|
|
1108
|
-
*/
|
|
1109
|
-
export declare function workflowPushSendsUpdate(configDir: string, key: string, parsedWorkflowToml: any, syncState: {
|
|
1110
|
-
entities?: {
|
|
1111
|
-
workflows?: Record<string, any>;
|
|
1112
|
-
};
|
|
1113
|
-
} | null, force?: boolean): boolean;
|
|
1114
921
|
/**
|
|
1115
922
|
* The UPDATE path's `name` pre-check (#2743).
|
|
1116
923
|
*
|
|
@@ -1143,18 +950,24 @@ export declare function workflowPushSendsUpdate(configDir: string, key: string,
|
|
|
1143
950
|
* other unusable-schema case stays the apply loop's warning (D3455-004).
|
|
1144
951
|
*/
|
|
1145
952
|
export declare function documentSchemaPreflightError(resolution: DocumentSchemaResolution): string | null;
|
|
1146
|
-
export declare function
|
|
1147
|
-
|
|
1148
|
-
export declare function serializeDatabaseType(typeConfig: any, operations: any[], ruleSetIdToName: Map<string, string>, options?: {
|
|
1149
|
-
/** Per-op form hints derived from the existing file. */
|
|
1150
|
-
hints?: OperationFormHints;
|
|
1151
|
-
/** Default form for ops with no hint. New files → "native". */
|
|
1152
|
-
defaultForm?: FieldForm;
|
|
1153
|
-
/** Sink for human-readable fallback messages (logged via `info`). */
|
|
953
|
+
export declare function serializeDatabaseType(typeConfig: any, ruleSetIdToName: Map<string, string>, options?: {
|
|
954
|
+
/** Sink for human-readable messages (logged via `info`). */
|
|
1154
955
|
logger?: (message: string) => void;
|
|
1155
|
-
/** Server subscription rows to emit as `[[subscriptions]]` (issue #803). */
|
|
1156
|
-
subscriptions?: any[];
|
|
1157
956
|
}): string;
|
|
957
|
+
/**
|
|
958
|
+
* #4802 — the `db3-types/<name>.toml` a type row is pulled as: the database
|
|
959
|
+
* type file's content, its `[type]` table naming the type `name`.
|
|
960
|
+
*/
|
|
961
|
+
export declare function serializeDb3Type(typeConfig: any, ruleSetIdToName: Map<string, string>, options?: {
|
|
962
|
+
logger?: (message: string) => void;
|
|
963
|
+
}): string;
|
|
964
|
+
/**
|
|
965
|
+
* #4802 — a `db3-types/<name>.toml` file as the payload `PUT db3-types/:name`
|
|
966
|
+
* takes: the database type file's, its type read from `[type] name`.
|
|
967
|
+
*/
|
|
968
|
+
export declare function parseDb3TypeToml(tomlData: any): {
|
|
969
|
+
typeConfig: any;
|
|
970
|
+
};
|
|
1158
971
|
/**
|
|
1159
972
|
* Flatten an email-template detail response onto its field surface.
|
|
1160
973
|
*
|
|
@@ -1192,18 +1005,6 @@ export declare function serializeRuleSet(ruleSet: any, logger?: (message: string
|
|
|
1192
1005
|
* push would "succeed", change nothing, and be planned again on every run.
|
|
1193
1006
|
*/
|
|
1194
1007
|
export declare function buildRuleSetPushPayload(tomlData: any, mode: PushMode): Record<string, any>;
|
|
1195
|
-
export declare function serializeGroupTypeConfig(config: any, ruleSetIdToName: Map<string, string>, logger?: (message: string) => void): string;
|
|
1196
|
-
/**
|
|
1197
|
-
* The create/update body for one group-type config (#2644).
|
|
1198
|
-
*
|
|
1199
|
-
* Takes the entity `parseGroupTypeConfigToml` produced, AFTER the rule-set
|
|
1200
|
-
* name → id resolution: the definition says which fields the server accepts in
|
|
1201
|
-
* each mode, so `groupType` rides the create body and the URL on update.
|
|
1202
|
-
*/
|
|
1203
|
-
export declare function buildGroupTypeConfigPayload(configData: any, mode: PushMode): Record<string, any>;
|
|
1204
|
-
export declare function serializeCollectionTypeConfig(config: any, ruleSetIdToName: Map<string, string>, logger?: (message: string) => void): string;
|
|
1205
|
-
/** The create/update body for one collection-type config (#2644). */
|
|
1206
|
-
export declare function buildCollectionTypeConfigPayload(configData: any, mode: PushMode): Record<string, any>;
|
|
1207
1008
|
/**
|
|
1208
1009
|
* The upsert body for one metadata-category config (#2644).
|
|
1209
1010
|
*
|
|
@@ -1246,8 +1047,7 @@ export declare function hasMeaningfulValue(v: any): boolean;
|
|
|
1246
1047
|
* The server PATCH endpoint distinguishes an omitted key (preserve) from an
|
|
1247
1048
|
* explicit `null` (clear), so sending every owned scalar as `value ?? null`
|
|
1248
1049
|
* converges the server to the local TOML: a field removed from the file lands
|
|
1249
|
-
* as `null` and is cleared.
|
|
1250
|
-
* `collection-type-config` push already uses.
|
|
1050
|
+
* as `null` and is cleared.
|
|
1251
1051
|
*/
|
|
1252
1052
|
export declare function buildOwnedScalarUpdate(typeConfig: any): Record<string, any>;
|
|
1253
1053
|
/**
|
|
@@ -1260,46 +1060,8 @@ export declare function buildOwnedScalarUpdate(typeConfig: any): Record<string,
|
|
|
1260
1060
|
* GET; without it (fresh type or a failed fetch) nothing is reported cleared.
|
|
1261
1061
|
*/
|
|
1262
1062
|
export declare function ownedScalarsBeingCleared(updateData: Record<string, any>, serverConfig: any): string[];
|
|
1263
|
-
|
|
1264
|
-
export interface PendingOpClaims {
|
|
1265
|
-
pendingOpDeletes: string[];
|
|
1266
|
-
finalOpNames: string[];
|
|
1267
|
-
pendingOpUpdates: Array<{
|
|
1268
|
-
name: string;
|
|
1269
|
-
access: string | null;
|
|
1270
|
-
params: any;
|
|
1271
|
-
}>;
|
|
1272
|
-
pendingOpUpserts: Array<Record<string, any>>;
|
|
1273
|
-
}
|
|
1274
|
-
/**
|
|
1275
|
-
* What this push's operation set will BE, stated to the server (issues #813,
|
|
1276
|
-
* #1336, #2732).
|
|
1277
|
-
*
|
|
1278
|
-
* The type-config PATCH runs its gates BEFORE the same push's operation calls,
|
|
1279
|
-
* so without a look-ahead every gate judges the pre-push operations: a push
|
|
1280
|
-
* that removes a model is blocked by the very references it is deleting. The
|
|
1281
|
-
* file IS the target state (config-as-code), so the claims are derived from it:
|
|
1282
|
-
*
|
|
1283
|
-
* - `finalOpNames` — the names the type ends with. Both other claims are
|
|
1284
|
-
* verified against it server-side, which is what keeps them from being a
|
|
1285
|
-
* gate bypass for a direct-API caller.
|
|
1286
|
-
* - `pendingOpDeletes` — its complement among the ops last sync recorded, so
|
|
1287
|
-
* an op this push deletes is excluded from the schema / OPS_EXIST gates.
|
|
1288
|
-
* - `pendingOpUpserts` — the post-push BODY of every declared op, so the
|
|
1289
|
-
* schema-edit gate lints a rewritten op as rewritten and a model removal
|
|
1290
|
-
* plus its operation rewrites lands in one push (#2732).
|
|
1291
|
-
* - `pendingOpUpdates` — the rule-only form (`access`/`params`) the manifest
|
|
1292
|
-
* re-lint reads (#1336).
|
|
1293
|
-
*
|
|
1294
|
-
* All four are built here and sent together, on the dry-run and on the real
|
|
1295
|
-
* PATCH alike. They are never conditioned on the push having a deletion: a push
|
|
1296
|
-
* that only REWRITES operations is exactly the case #2732 exists for.
|
|
1297
|
-
*/
|
|
1298
|
-
export declare function buildPendingOpClaims(operations: any[], existingOpNames: string[]): PendingOpClaims;
|
|
1299
|
-
export declare function parseDatabaseTypeToml(tomlData: any): {
|
|
1063
|
+
export declare function parseDatabaseTypeToml(tomlData: any, table?: ConfigTable): {
|
|
1300
1064
|
typeConfig: any;
|
|
1301
|
-
operations: any[];
|
|
1302
|
-
subscriptions: any[];
|
|
1303
1065
|
};
|
|
1304
1066
|
/**
|
|
1305
1067
|
* The parsed shape of a rule-set TOML: the definition's fields plus the
|
|
@@ -1307,8 +1069,6 @@ export declare function parseDatabaseTypeToml(tomlData: any): {
|
|
|
1307
1069
|
* `config diff` hashes both sides through.
|
|
1308
1070
|
*/
|
|
1309
1071
|
export declare function parseRuleSetToml(tomlData: any): any;
|
|
1310
|
-
export declare function parseGroupTypeConfigToml(tomlData: any): any;
|
|
1311
|
-
export declare function parseCollectionTypeConfigToml(tomlData: any): any;
|
|
1312
1072
|
/**
|
|
1313
1073
|
* `config diff`'s hash for one configuration object, over the field set its
|
|
1314
1074
|
* DEFINITION declares (#2644 criterion 8).
|
|
@@ -1492,6 +1252,26 @@ export interface ConfigDiffSpec {
|
|
|
1492
1252
|
/** How the type names itself in the rule-set resolution message. */
|
|
1493
1253
|
describe(entity: any): string;
|
|
1494
1254
|
}
|
|
1255
|
+
/**
|
|
1256
|
+
* #4802 — the comparison a `db3-types/<name>.toml` file goes through: the
|
|
1257
|
+
* database type's, read off its own table. Kept out of `CONFIG_DIFF_SPECS`
|
|
1258
|
+
* (the shared comparator's registry, whose round-trip bar requires a fixture
|
|
1259
|
+
* per entry): it is the database type spec with another `[type]` table, and
|
|
1260
|
+
* its own suite covers the round trip.
|
|
1261
|
+
*/
|
|
1262
|
+
export declare const DB3_TYPE_DIFF_SPEC: ConfigDiffSpec;
|
|
1263
|
+
/**
|
|
1264
|
+
* #4802 — the names a config tree holds in BOTH `db3-types/` and
|
|
1265
|
+
* `database-type-configs/`, each one resource. Twins whose files read the same
|
|
1266
|
+
* type are `agreeing`: the db3 file is pushed and the legacy one is synced
|
|
1267
|
+
* with it. Twins that read differently are refused before anything is
|
|
1268
|
+
* applied, naming both files.
|
|
1269
|
+
*/
|
|
1270
|
+
export declare function classifyDb3TypeTwins(configDir: string, maps?: ConfigDiffMaps): {
|
|
1271
|
+
agreeing: string[];
|
|
1272
|
+
refusals: string[];
|
|
1273
|
+
refusedNames: string[];
|
|
1274
|
+
};
|
|
1495
1275
|
/**
|
|
1496
1276
|
* Every type the shared comparator serves — the types `config diff` compares
|
|
1497
1277
|
* field-for-field, and that `config push` gates on the same projection
|
|
@@ -1524,6 +1304,21 @@ export declare function projectConfigPair(spec: ConfigDiffSpec, localParsed: any
|
|
|
1524
1304
|
local: Record<string, any>;
|
|
1525
1305
|
remote: Record<string, any>;
|
|
1526
1306
|
};
|
|
1307
|
+
/**
|
|
1308
|
+
* One `config diff` row's verdict once both sides exist (#4116, DSO-4116-003).
|
|
1309
|
+
*
|
|
1310
|
+
* A type whose files name a rule set cannot be compared without the app's
|
|
1311
|
+
* rule-set listing: an unresolvable reference would read as a difference that
|
|
1312
|
+
* is not there. So when the listing failed the row says so rather than
|
|
1313
|
+
* comparing; otherwise `compare` decides.
|
|
1314
|
+
*/
|
|
1315
|
+
export declare function configDiffRowVerdict(parsed: any, remote: any, compare: (parsed: any, remote: any) => {
|
|
1316
|
+
status: string;
|
|
1317
|
+
hint?: string;
|
|
1318
|
+
}, contentComparable: boolean): {
|
|
1319
|
+
status: string;
|
|
1320
|
+
hint?: string;
|
|
1321
|
+
};
|
|
1527
1322
|
/**
|
|
1528
1323
|
* One `config diff` row's content verdict for a registered type (#2880).
|
|
1529
1324
|
*
|
|
@@ -1556,6 +1351,64 @@ export declare function hashLocalConfigForDiff(spec: ConfigDiffSpec, parsedToml:
|
|
|
1556
1351
|
* `extra` carries the sibling rows a type's file also holds: a database type's
|
|
1557
1352
|
* operations and subscriptions, which the list response does not include.
|
|
1558
1353
|
*/
|
|
1354
|
+
/**
|
|
1355
|
+
* The baseline `config pull` records for a function with a pushed version —
|
|
1356
|
+
* #4717, F4717-CODE-003. #4738 — `access` is on neither side of any function
|
|
1357
|
+
* comparison, so this is the one hash every function's baseline is read by.
|
|
1358
|
+
*/
|
|
1359
|
+
export declare function pulledFunctionSemanticHash(record: any, active: any): string;
|
|
1360
|
+
/**
|
|
1361
|
+
* The function baseline with `access` out — #4717, F4717-CODE-004.
|
|
1362
|
+
*
|
|
1363
|
+
* Still recorded beside `semanticHash` at every baseline write. Since #4738
|
|
1364
|
+
* the two are equal; a baseline written between #4717 and #4738 carries a
|
|
1365
|
+
* `semanticHash` with the header's rule hashed in, and this is the one the
|
|
1366
|
+
* next push reads.
|
|
1367
|
+
*/
|
|
1368
|
+
export declare function functionAccessFreeSemanticHash(record: any, active: any, maps?: ConfigDiffMaps): string;
|
|
1369
|
+
/**
|
|
1370
|
+
* The manifest entry a function's push gate reads (#4717, #4738): the
|
|
1371
|
+
* access-free baseline for every function, bare or flagged. An entry written
|
|
1372
|
+
* before that hash existed keeps its one hash.
|
|
1373
|
+
*/
|
|
1374
|
+
export declare function functionPushBaselineEntry<E extends {
|
|
1375
|
+
semanticHash?: string;
|
|
1376
|
+
accessFreeSemanticHash?: string;
|
|
1377
|
+
}>(entry: E | null | undefined): E | null | undefined;
|
|
1378
|
+
/**
|
|
1379
|
+
* The manifest entry a prompt's or an integration's push gate reads (#4872).
|
|
1380
|
+
*
|
|
1381
|
+
* A baseline recorded before the retirement hashed `accessRule` into
|
|
1382
|
+
* `semanticHash`, and the live projection no longer carries it, so that hash
|
|
1383
|
+
* matches neither side and would turn an ordinary local edit into a false
|
|
1384
|
+
* `both-changed`. Every baseline written since records `ruleFreeSemanticHash`
|
|
1385
|
+
* beside it, and that is the one read.
|
|
1386
|
+
*
|
|
1387
|
+
* An entry without it is a pre-retirement entry, and its hash is translated
|
|
1388
|
+
* rather than trusted or thrown away. The old projection was the current one
|
|
1389
|
+
* plus `accessRule` (a `whenSet` string; canonical JSON sorts keys), and the
|
|
1390
|
+
* file still carries the rule it was synced with, so the old hash of either
|
|
1391
|
+
* side is recomputable: the side whose old hash IS the baseline did not move,
|
|
1392
|
+
* and its rule-free hash becomes the baseline. Only when neither side
|
|
1393
|
+
* reproduces it — the rule line was edited or removed, or the baseline is from
|
|
1394
|
+
* an older projection still — does the fallback apply:
|
|
1395
|
+
*
|
|
1396
|
+
* - an integration drops the hash, so `classifyPushChange` reads the #2731
|
|
1397
|
+
* legacy signals; its header `modifiedAt` covers everything it projects;
|
|
1398
|
+
* - a prompt keeps the stale hash, which matches neither side and so declines
|
|
1399
|
+
* as `both-changed`. Its `[[configs]]` rows are not covered by the header
|
|
1400
|
+
* timestamp, so the legacy inference would read a remote template edit as
|
|
1401
|
+
* "server unchanged" and overwrite it.
|
|
1402
|
+
*/
|
|
1403
|
+
export declare function ruleFreePushBaselineEntry<E extends {
|
|
1404
|
+
semanticHash?: string;
|
|
1405
|
+
ruleFreeSemanticHash?: string;
|
|
1406
|
+
}>(entry: E | null | undefined, legacy: {
|
|
1407
|
+
label: "prompt" | "integration";
|
|
1408
|
+
maps: ConfigDiffMaps;
|
|
1409
|
+
localParsed: any;
|
|
1410
|
+
liveRecord: any;
|
|
1411
|
+
}): E | null | undefined;
|
|
1559
1412
|
export declare function hashRemoteConfigForDiff(spec: ConfigDiffSpec, record: any, maps: ConfigDiffMaps, extra?: any): string;
|
|
1560
1413
|
/** One field's disagreement between the local file and the live server entity. */
|
|
1561
1414
|
export interface PushFieldDiff {
|
|
@@ -1780,28 +1633,6 @@ export declare function resolveExistingId(input: {
|
|
|
1780
1633
|
liveId?: string;
|
|
1781
1634
|
manifestId?: string;
|
|
1782
1635
|
}): string | undefined;
|
|
1783
|
-
/**
|
|
1784
|
-
* Which CHILD rows a database type's push reconciles against (#2731 B3).
|
|
1785
|
-
*
|
|
1786
|
-
* `resolveExistingId` answers this for a whole entity; a database type's
|
|
1787
|
-
* operations and subscriptions are rows with the same question and the same
|
|
1788
|
-
* two possible answers. The manifest can name an operation the server no
|
|
1789
|
-
* longer has (the update PUTs a row that is gone) and be silent about one it
|
|
1790
|
-
* does have (the create POSTs a duplicate key) — both abort the push with a
|
|
1791
|
-
* server error, which is exactly the recovery `--force` is supposed to
|
|
1792
|
-
* perform.
|
|
1793
|
-
*
|
|
1794
|
-
* When the reconcile read the rows, they ARE the baseline: existence, the
|
|
1795
|
-
* timestamp each update guards with, and — as the complement of the file's own
|
|
1796
|
-
* list — which rows this push deletes. `undefined` means the read did not
|
|
1797
|
-
* happen (the degraded path, or a type live state says is absent), and the
|
|
1798
|
-
* manifest stays what it has always been.
|
|
1799
|
-
*/
|
|
1800
|
-
export declare function liveChildBaseline(live: Map<string, any> | undefined, manifestChildren?: Record<string, {
|
|
1801
|
-
modifiedAt: string;
|
|
1802
|
-
}>): Record<string, {
|
|
1803
|
-
modifiedAt: string;
|
|
1804
|
-
}> | undefined;
|
|
1805
1636
|
/**
|
|
1806
1637
|
* The app's live rule sets, indexed the three ways push reads them (#2731 B3).
|
|
1807
1638
|
*
|
|
@@ -1814,7 +1645,7 @@ export declare function liveChildBaseline(live: Map<string, any> | undefined, ma
|
|
|
1814
1645
|
* the file spells;
|
|
1815
1646
|
* - `nameToId` — how a referencing file's `ruleSetName` resolves to something
|
|
1816
1647
|
* push can send. Seeding it from live is what lets `--only
|
|
1817
|
-
*
|
|
1648
|
+
* database-type-config/orders` resolve a rule set that exists on the server but
|
|
1818
1649
|
* was never recorded locally, instead of failing as an unresolved
|
|
1819
1650
|
* reference.
|
|
1820
1651
|
*/
|
|
@@ -1855,63 +1686,6 @@ export declare function remoteSemanticBaseline(input: {
|
|
|
1855
1686
|
*/
|
|
1856
1687
|
isStoredRecord?: (returned: any) => boolean;
|
|
1857
1688
|
}): string | undefined;
|
|
1858
|
-
/** What `config push` decides for one transform (#2731 B7). */
|
|
1859
|
-
export type ScriptPushOutcome = {
|
|
1860
|
-
action: "skip";
|
|
1861
|
-
localHash: string;
|
|
1862
|
-
remoteHash: string;
|
|
1863
|
-
} | {
|
|
1864
|
-
action: "update";
|
|
1865
|
-
direction: "local-edited" | "forced" | "no-active-body";
|
|
1866
|
-
localHash: string;
|
|
1867
|
-
} | {
|
|
1868
|
-
action: "drift";
|
|
1869
|
-
localHash: string;
|
|
1870
|
-
remoteHash: string;
|
|
1871
|
-
} | {
|
|
1872
|
-
action: "conflict";
|
|
1873
|
-
direction: "both-changed" | "unknown-direction";
|
|
1874
|
-
localHash: string;
|
|
1875
|
-
remoteHash: string;
|
|
1876
|
-
};
|
|
1877
|
-
/**
|
|
1878
|
-
* `config push`'s change decision for one transform (#2731 B7).
|
|
1879
|
-
*
|
|
1880
|
-
* A transform's comparator IS its bytes: the body push sends is the body diff
|
|
1881
|
-
* compares, so there is no projection to reconcile — only the same three
|
|
1882
|
-
* questions every converted type asks. Local versus the LIVE active body, with
|
|
1883
|
-
* the manifest demoted to the baseline that says which side moved.
|
|
1884
|
-
*
|
|
1885
|
-
* A script the manifest has never seen reaches here too (adopted by name from
|
|
1886
|
-
* the live index). It has no baseline and no legacy signal, so an unequal body
|
|
1887
|
-
* classifies as `unknown-direction` — a conflict to report rather than a server
|
|
1888
|
-
* body to overwrite on a guess.
|
|
1889
|
-
*/
|
|
1890
|
-
export declare function decidePushForScript(input: {
|
|
1891
|
-
localBody: string;
|
|
1892
|
-
/** Byte hash of the local file — the legacy direction signal. */
|
|
1893
|
-
localFileHash?: string;
|
|
1894
|
-
/**
|
|
1895
|
-
* The live active body, and the script row's timestamp beside it — the other
|
|
1896
|
-
* legacy direction signal (#2731 B4). Activating a config updates the script
|
|
1897
|
-
* row, so a timestamp still equal to the manifest's proves the server body
|
|
1898
|
-
* has not moved: an upgraded installation's first push applies a genuine
|
|
1899
|
-
* local edit instead of reporting a direction it could have known.
|
|
1900
|
-
*
|
|
1901
|
-
* `null` is an ANSWER, not a failed read: the script row exists and nothing
|
|
1902
|
-
* is active on it. See below.
|
|
1903
|
-
*/
|
|
1904
|
-
live: {
|
|
1905
|
-
body: string;
|
|
1906
|
-
modifiedAt?: string;
|
|
1907
|
-
} | null;
|
|
1908
|
-
entry?: {
|
|
1909
|
-
contentHash?: string;
|
|
1910
|
-
semanticHash?: string;
|
|
1911
|
-
modifiedAt?: string;
|
|
1912
|
-
} | null;
|
|
1913
|
-
force?: boolean;
|
|
1914
|
-
}): ScriptPushOutcome;
|
|
1915
1689
|
/**
|
|
1916
1690
|
* One side of a field diff, rendered for a conflict report (#2731 B5).
|
|
1917
1691
|
*
|
|
@@ -1986,6 +1760,38 @@ export declare function countAppliedChanges(input: {
|
|
|
1986
1760
|
* than taking the command down.
|
|
1987
1761
|
*/
|
|
1988
1762
|
export declare function configSemanticHash(label: string, filePath: string, maps: ConfigDiffMaps): string | undefined;
|
|
1763
|
+
/**
|
|
1764
|
+
* Whether a local config file says what the file `config pull` would write
|
|
1765
|
+
* says (#4160) — the definition-projected field set `config diff` compares, so
|
|
1766
|
+
* a file diff calls Synced keeps its comments, key order and explicit defaults
|
|
1767
|
+
* through a pull.
|
|
1768
|
+
*
|
|
1769
|
+
* Both sides go through the same projection with the same context, so
|
|
1770
|
+
* `extra` is the context a reference is read through (a test case's lookups),
|
|
1771
|
+
* never server-only rows. As in diff, the file is paired by the identity it
|
|
1772
|
+
* states (or `filePath`'s name), and the fields it leaves unmanaged take the
|
|
1773
|
+
* server's values — so a kept file's baseline is the server's projection
|
|
1774
|
+
* (`pulledSemanticHash`), never the file's own.
|
|
1775
|
+
*/
|
|
1776
|
+
export declare function sameConfigAs(label: string, serverContent: string, filePath: string, maps: ConfigDiffMaps, extra?: any): (localContent: string) => boolean;
|
|
1777
|
+
/**
|
|
1778
|
+
* #4802 — `sameConfigAs` for a `db3-types/` file: a local file that reads the
|
|
1779
|
+
* same type as the server's rendering is left as it is.
|
|
1780
|
+
*/
|
|
1781
|
+
export declare function sameDb3TypeAs(serverContent: string, maps: ConfigDiffMaps): (localContent: string) => boolean;
|
|
1782
|
+
/**
|
|
1783
|
+
* The semantic baseline `config pull` stamps for a config file (#4160): the
|
|
1784
|
+
* projection of what the server serializes, whether the file was written or
|
|
1785
|
+
* kept. A kept file can leave unmanaged fields or its identity to the server,
|
|
1786
|
+
* so hashing it would record a baseline the server never had.
|
|
1787
|
+
*/
|
|
1788
|
+
export declare function pulledSemanticHash(label: string, serverContent: string, maps: ConfigDiffMaps): string | undefined;
|
|
1789
|
+
/**
|
|
1790
|
+
* Whether a local TOML file parses to the same document as `serverContent`
|
|
1791
|
+
* (#4160): the comparison for `vars.toml`, which has no field definition
|
|
1792
|
+
* behind it, so only comments, key order and spelling are free.
|
|
1793
|
+
*/
|
|
1794
|
+
export declare function sameTomlAs(serverContent: string): (localContent: string) => boolean;
|
|
1989
1795
|
/**
|
|
1990
1796
|
* The sync state `config push` writes into (#2731 B6, closing #2374).
|
|
1991
1797
|
*
|
|
@@ -2136,69 +1942,6 @@ export declare function serializeTestCase(testCase: any, lookupMaps?: TestCaseLo
|
|
|
2136
1942
|
*/
|
|
2137
1943
|
export declare function serializeTestCaseForComparison(testCase: any, lookupMaps?: TestCaseLookupMaps): string;
|
|
2138
1944
|
export declare function parseTestCaseToml(tomlData: any): any;
|
|
2139
|
-
/**
|
|
2140
|
-
* Pull server-side `Script` rows into `transforms/*.rhai` and record
|
|
2141
|
-
* each in the returned sync-state map. Issue #892 slice 7 + codex
|
|
2142
|
-
* follow-up on PR #893; body materialization fixed in issue #1196.
|
|
2143
|
-
* Exported so the unit test can drive it against stubbed
|
|
2144
|
-
* `client.listScripts` / `client.getScript`.
|
|
2145
|
-
*
|
|
2146
|
-
* Two-call contract: `listScripts` returns the `Script` HEADER only
|
|
2147
|
-
* (no `body` — see `serializeScript` in `src/admin-api.ts`). The Rhai
|
|
2148
|
-
* source lives on a versioned `ScriptConfig`. So for each listed
|
|
2149
|
-
* script we fetch the full record with `getScript`, which returns the
|
|
2150
|
-
* header plus serialized `configs` (each carrying its `body`), and
|
|
2151
|
-
* write the ACTIVE config's body. Reading the body off the list shape
|
|
2152
|
-
* (the old behavior) always produced 0-byte files.
|
|
2153
|
-
*
|
|
2154
|
-
* Idempotency: every call writes the active-config body the server
|
|
2155
|
-
* returned, so re-running `config pull` on an unchanged server overwrites
|
|
2156
|
-
* with the same bytes and produces the same `contentHash`. The result
|
|
2157
|
-
* map always reflects the current server state for the writes performed.
|
|
2158
|
-
*
|
|
2159
|
-
* `count` is the number of files actually written, not the number of
|
|
2160
|
-
* scripts listed: scripts with no active config and scripts whose
|
|
2161
|
-
* config fetch fails are skipped (we never clobber a `.rhai` with an
|
|
2162
|
-
* empty file).
|
|
2163
|
-
*
|
|
2164
|
-
* Older-server graceful path: if `listScripts` rejects (e.g. older
|
|
2165
|
-
* server without the route), the caller catches and treats it as
|
|
2166
|
-
* "no scripts to pull", leaving the directory empty. A per-script
|
|
2167
|
-
* `getScript` failure is caught and that one script is skipped without
|
|
2168
|
-
* aborting the rest of the pull.
|
|
2169
|
-
*/
|
|
2170
|
-
export declare function pullScripts(client: ApiClient, appId: string, configDir: string, logger?: (msg: string) => void,
|
|
2171
|
-
/**
|
|
2172
|
-
* `config pull --only` (issue #2645): which transform names this pull may
|
|
2173
|
-
* write. Defaults to every one the server lists.
|
|
2174
|
-
*/
|
|
2175
|
-
selects?: (name: string) => boolean): Promise<{
|
|
2176
|
-
scriptEntities: Record<string, {
|
|
2177
|
-
id: string;
|
|
2178
|
-
modifiedAt: string;
|
|
2179
|
-
contentHash?: string;
|
|
2180
|
-
semanticHash?: string;
|
|
2181
|
-
}>;
|
|
2182
|
-
count: number;
|
|
2183
|
-
/**
|
|
2184
|
-
* Which scripts the server listed, for the #1659 prune pass. `ok: false` when
|
|
2185
|
-
* the listing failed (an older server without the route, or a transient
|
|
2186
|
-
* error) or when any per-script fetch failed — in either case this pull's
|
|
2187
|
-
* picture of the type is incomplete and must not drive deletions. Scripts
|
|
2188
|
-
* skipped for having no active config are still *present*, so their keys stay
|
|
2189
|
-
* in the set and their local `.rhai` survives.
|
|
2190
|
-
*/
|
|
2191
|
-
presence: PresenceOutcome;
|
|
2192
|
-
/**
|
|
2193
|
-
* Whether the script LISTING succeeded. Distinct from `presence`: a failed
|
|
2194
|
-
* per-script fetch blocks pruning but still leaves the other scripts written,
|
|
2195
|
-
* so their fresh state entries must be kept. Only a failed listing means
|
|
2196
|
-
* nothing was written and the prior state slot should be preserved whole.
|
|
2197
|
-
*/
|
|
2198
|
-
listOk: boolean;
|
|
2199
|
-
/** Names the server listed, empty when the listing failed. */
|
|
2200
|
-
serverKeys: string[];
|
|
2201
|
-
}>;
|
|
2202
1945
|
/**
|
|
2203
1946
|
* The manifest row `config push` records for a function it just pushed
|
|
2204
1947
|
* (#3317), and whether the server had already moved past that push.
|
|
@@ -2236,6 +1979,7 @@ export declare function pushedFunctionBaseline(input: {
|
|
|
2236
1979
|
modifiedAt: string;
|
|
2237
1980
|
contentHash: string;
|
|
2238
1981
|
semanticHash?: string;
|
|
1982
|
+
accessFreeSemanticHash?: string;
|
|
2239
1983
|
envelopeHash: string;
|
|
2240
1984
|
activeConfigId?: string;
|
|
2241
1985
|
sources: string[];
|
|
@@ -2261,12 +2005,15 @@ export declare function pushedFunctionBaseline(input: {
|
|
|
2261
2005
|
* normalizes outside the tree, and the refusals are reported rather than
|
|
2262
2006
|
* swallowed.
|
|
2263
2007
|
*/
|
|
2264
|
-
export declare function pullFunctions(client: ApiClient, appId: string, configDir: string, logger?: (msg: string) => void, selects?: (key: string) => boolean
|
|
2008
|
+
export declare function pullFunctions(client: ApiClient, appId: string, configDir: string, logger?: (msg: string) => void, selects?: (key: string) => boolean,
|
|
2009
|
+
/** Counts each function file as written or left unchanged (#4160). */
|
|
2010
|
+
writes?: PullWriteTally): Promise<{
|
|
2265
2011
|
functionEntities: Record<string, {
|
|
2266
2012
|
id: string;
|
|
2267
2013
|
modifiedAt: string;
|
|
2268
2014
|
contentHash?: string;
|
|
2269
2015
|
semanticHash?: string;
|
|
2016
|
+
accessFreeSemanticHash?: string;
|
|
2270
2017
|
envelopeHash?: string;
|
|
2271
2018
|
activeConfigId?: string;
|
|
2272
2019
|
sources?: string[];
|
|
@@ -2350,6 +2097,7 @@ export declare function listAllTestCases(client: ApiClient, appId: string, block
|
|
|
2350
2097
|
items: any[];
|
|
2351
2098
|
} | {
|
|
2352
2099
|
ok: false;
|
|
2100
|
+
error: unknown;
|
|
2353
2101
|
}>;
|
|
2354
2102
|
/**
|
|
2355
2103
|
* Copy a block's prior `entities.testCases` records into the pull's fresh map
|
|
@@ -2383,6 +2131,8 @@ export declare function pullTestCasesForBlock(params: {
|
|
|
2383
2131
|
priorTestCaseEntities?: Record<string, any>;
|
|
2384
2132
|
lookupMaps?: TestCaseLookupMaps;
|
|
2385
2133
|
logger?: (message: string) => void;
|
|
2134
|
+
/** Counts each case file as written or left unchanged (#4160). */
|
|
2135
|
+
writes?: PullWriteTally;
|
|
2386
2136
|
}): Promise<TestCasePullOutcome>;
|
|
2387
2137
|
/**
|
|
2388
2138
|
* One pull leg: every block of a type the pull selected (#2769).
|
|
@@ -2405,6 +2155,8 @@ export declare function pullTestCasesForBlocks(params: {
|
|
|
2405
2155
|
priorTestCaseEntities?: Record<string, any>;
|
|
2406
2156
|
lookupMaps?: TestCaseLookupMaps;
|
|
2407
2157
|
logger?: (message: string) => void;
|
|
2158
|
+
/** Counts each case file as written or left unchanged (#4160). */
|
|
2159
|
+
writes?: PullWriteTally;
|
|
2408
2160
|
}): Promise<{
|
|
2409
2161
|
count: number;
|
|
2410
2162
|
skippedBlocks: string[];
|
|
@@ -2413,8 +2165,6 @@ export declare function pullTestCasesForBlocks(params: {
|
|
|
2413
2165
|
interface PushResolutionMaps {
|
|
2414
2166
|
promptKeyToId: Map<string, string>;
|
|
2415
2167
|
promptConfigNameToId: Map<string, string>;
|
|
2416
|
-
workflowConfigNameToId: Map<string, string>;
|
|
2417
|
-
scriptConfigNameToId?: Map<string, string>;
|
|
2418
2168
|
integrationConfigNameToId?: Map<string, string>;
|
|
2419
2169
|
/**
|
|
2420
2170
|
* Fill one block's config name→id entries from the server on demand (#2769),
|