primitive-admin 1.0.62 → 1.0.64
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 +132 -42
- package/assets/skill/skills/primitive-platform/SKILL.md +142 -661
- package/dist/bin/primitive.js +121 -41
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.js +37 -50
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/analytics.js +178 -9
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps.js +17 -7
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-sessions.d.ts +7 -0
- package/dist/src/commands/auth-sessions.js +144 -0
- package/dist/src/commands/auth-sessions.js.map +1 -0
- package/dist/src/commands/auth.js +76 -116
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +2 -1
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/catalog.js +26 -10
- package/dist/src/commands/catalog.js.map +1 -1
- package/dist/src/commands/collection-type-configs.js +3 -10
- package/dist/src/commands/collection-type-configs.js.map +1 -1
- package/dist/src/commands/collections.js +736 -19
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/config.js +13 -27
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/connections.js +8 -9
- package/dist/src/commands/connections.js.map +1 -1
- package/dist/src/commands/cron-triggers.js +2 -1
- package/dist/src/commands/cron-triggers.js.map +1 -1
- package/dist/src/commands/database-type-configs.js +5 -12
- package/dist/src/commands/database-type-configs.js.map +1 -1
- package/dist/src/commands/databases.js +59 -72
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +58 -0
- package/dist/src/commands/documents.js +1623 -95
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +5 -4
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/env.d.ts +1 -1
- package/dist/src/commands/env.js +106 -44
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/feature-flags.js +2 -1
- package/dist/src/commands/feature-flags.js.map +1 -1
- package/dist/src/commands/functions.d.ts +20 -0
- package/dist/src/commands/functions.js +1630 -0
- package/dist/src/commands/functions.js.map +1 -0
- package/dist/src/commands/group-type-configs.js +2 -1
- package/dist/src/commands/group-type-configs.js.map +1 -1
- package/dist/src/commands/groups.js +30 -17
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.js +17 -11
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +24 -12
- package/dist/src/commands/init.js +198 -110
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +65 -26
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/locks.js +17 -2
- package/dist/src/commands/locks.js.map +1 -1
- package/dist/src/commands/metadata-category-configs.js +2 -1
- package/dist/src/commands/metadata-category-configs.js.map +1 -1
- package/dist/src/commands/metadata.js +8 -1
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/prompts.js +106 -59
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.js +3 -10
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/scripts.d.ts +10 -0
- package/dist/src/commands/scripts.js +159 -25
- package/dist/src/commands/scripts.js.map +1 -1
- package/dist/src/commands/secrets.js +2 -1
- package/dist/src/commands/secrets.js.map +1 -1
- package/dist/src/commands/sessions.js +10 -9
- package/dist/src/commands/sessions.js.map +1 -1
- package/dist/src/commands/sync-app-settings.js +3 -5
- package/dist/src/commands/sync-app-settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +391 -44
- package/dist/src/commands/sync.js +2622 -534
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +2 -1
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.js +19 -10
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.js +2 -1
- package/dist/src/commands/vars.js.map +1 -1
- package/dist/src/commands/waitlist.js +2 -1
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +29 -0
- package/dist/src/commands/webhooks.js +135 -64
- package/dist/src/commands/webhooks.js.map +1 -1
- package/dist/src/commands/workflows.d.ts +1 -29
- package/dist/src/commands/workflows.js +113 -179
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +628 -14
- package/dist/src/lib/api-client.js +776 -70
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +1 -1
- package/dist/src/lib/app-settings-descriptor.js +9 -1
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/block-selector.d.ts +58 -0
- package/dist/src/lib/block-selector.js +92 -0
- package/dist/src/lib/block-selector.js.map +1 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +24 -54
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +31 -153
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -1
- package/dist/src/lib/collection-export.d.ts +184 -0
- package/dist/src/lib/collection-export.js +252 -0
- package/dist/src/lib/collection-export.js.map +1 -0
- package/dist/src/lib/config-json-field.d.ts +28 -0
- package/dist/src/lib/config-json-field.js +56 -0
- package/dist/src/lib/config-json-field.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.js +88 -6
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-payload.d.ts +8 -1
- package/dist/src/lib/config-payload.js +49 -4
- package/dist/src/lib/config-payload.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +12 -1
- package/dist/src/lib/config-surface.js +71 -3
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/config.d.ts +31 -13
- package/dist/src/lib/config.js +34 -70
- package/dist/src/lib/config.js.map +1 -1
- package/dist/src/lib/credentials-store.d.ts +37 -22
- package/dist/src/lib/credentials-store.js +103 -97
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js +8 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/deprecation.d.ts +22 -0
- package/dist/src/lib/deprecation.js +43 -0
- package/dist/src/lib/deprecation.js.map +1 -0
- package/dist/src/lib/document-export-permissions.d.ts +30 -0
- package/dist/src/lib/document-export-permissions.js +54 -0
- package/dist/src/lib/document-export-permissions.js.map +1 -0
- package/dist/src/lib/document-ingest-artifact.d.ts +120 -0
- package/dist/src/lib/document-ingest-artifact.js +505 -0
- package/dist/src/lib/document-ingest-artifact.js.map +1 -0
- package/dist/src/lib/document-ingest-input.d.ts +51 -0
- package/dist/src/lib/document-ingest-input.js +132 -0
- package/dist/src/lib/document-ingest-input.js.map +1 -0
- package/dist/src/lib/document-ingest-rows.d.ts +137 -0
- package/dist/src/lib/document-ingest-rows.js +181 -0
- package/dist/src/lib/document-ingest-rows.js.map +1 -0
- package/dist/src/lib/document-ingest.d.ts +101 -0
- package/dist/src/lib/document-ingest.js +384 -0
- package/dist/src/lib/document-ingest.js.map +1 -0
- package/dist/src/lib/env-resolver-core.d.ts +128 -17
- package/dist/src/lib/env-resolver-core.js +204 -22
- package/dist/src/lib/env-resolver-core.js.map +1 -1
- package/dist/src/lib/env-resolver.d.ts +18 -3
- package/dist/src/lib/env-resolver.js +23 -3
- package/dist/src/lib/env-resolver.js.map +1 -1
- package/dist/src/lib/function-bundle.d.ts +147 -0
- package/dist/src/lib/function-bundle.js +341 -0
- package/dist/src/lib/function-bundle.js.map +1 -0
- package/dist/src/lib/function-collect.d.ts +123 -0
- package/dist/src/lib/function-collect.js +610 -0
- package/dist/src/lib/function-collect.js.map +1 -0
- package/dist/src/lib/function-db-types.d.ts +202 -0
- package/dist/src/lib/function-db-types.js +870 -0
- package/dist/src/lib/function-db-types.js.map +1 -0
- package/dist/src/lib/function-document-types.d.ts +144 -0
- package/dist/src/lib/function-document-types.js +370 -0
- package/dist/src/lib/function-document-types.js.map +1 -0
- package/dist/src/lib/function-grants-preflight.d.ts +64 -0
- package/dist/src/lib/function-grants-preflight.js +105 -0
- package/dist/src/lib/function-grants-preflight.js.map +1 -0
- package/dist/src/lib/function-log-lines.d.ts +76 -0
- package/dist/src/lib/function-log-lines.js +160 -0
- package/dist/src/lib/function-log-lines.js.map +1 -0
- package/dist/src/lib/function-log-row.d.ts +29 -0
- package/dist/src/lib/function-log-row.js +73 -0
- package/dist/src/lib/function-log-row.js.map +1 -0
- package/dist/src/lib/function-log-tail.d.ts +132 -0
- package/dist/src/lib/function-log-tail.js +262 -0
- package/dist/src/lib/function-log-tail.js.map +1 -0
- package/dist/src/lib/function-run.d.ts +289 -0
- package/dist/src/lib/function-run.js +389 -0
- package/dist/src/lib/function-run.js.map +1 -0
- package/dist/src/lib/function-schema-codegen.d.ts +143 -0
- package/dist/src/lib/function-schema-codegen.js +420 -0
- package/dist/src/lib/function-schema-codegen.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +459 -0
- package/dist/src/lib/function-sync.js +1258 -0
- package/dist/src/lib/function-sync.js.map +1 -0
- package/dist/src/lib/function-trigger-listing.d.ts +27 -0
- package/dist/src/lib/function-trigger-listing.js +70 -0
- package/dist/src/lib/function-trigger-listing.js.map +1 -0
- package/dist/src/lib/function-typecheck.d.ts +86 -0
- package/dist/src/lib/function-typecheck.js +370 -0
- package/dist/src/lib/function-typecheck.js.map +1 -0
- package/dist/src/lib/function-versions.d.ts +122 -0
- package/dist/src/lib/function-versions.js +182 -0
- package/dist/src/lib/function-versions.js.map +1 -0
- package/dist/src/lib/generated-allowlist.js +4 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +2332 -78
- package/dist/src/lib/generated-config-surfaces.js +6979 -468
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/generated-sdk-types.d.ts +12 -0
- package/dist/src/lib/generated-sdk-types.js +13 -0
- package/dist/src/lib/generated-sdk-types.js.map +1 -0
- package/dist/src/lib/init-adopt.js +2 -2
- package/dist/src/lib/init-adopt.js.map +1 -1
- package/dist/src/lib/init-assets.js +3 -3
- package/dist/src/lib/init-client-platforms.d.ts +14 -0
- package/dist/src/lib/init-client-platforms.js +71 -0
- package/dist/src/lib/init-client-platforms.js.map +1 -0
- package/dist/src/lib/init-config.d.ts +1 -1
- package/dist/src/lib/init-email-redirect-uris.d.ts +37 -0
- package/dist/src/lib/init-email-redirect-uris.js +46 -0
- package/dist/src/lib/init-email-redirect-uris.js.map +1 -0
- package/dist/src/lib/init-ios-links.d.ts +41 -0
- package/dist/src/lib/init-ios-links.js +67 -1
- package/dist/src/lib/init-ios-links.js.map +1 -1
- package/dist/src/lib/init-plan.d.ts +1 -1
- package/dist/src/lib/init-plan.js +1 -1
- package/dist/src/lib/init-xcode.d.ts +6 -5
- package/dist/src/lib/init-xcode.js +34 -10
- package/dist/src/lib/init-xcode.js.map +1 -1
- package/dist/src/lib/integration-selector.d.ts +42 -0
- package/dist/src/lib/integration-selector.js +46 -0
- package/dist/src/lib/integration-selector.js.map +1 -0
- package/dist/src/lib/ios-app-id.d.ts +34 -0
- package/dist/src/lib/ios-app-id.js +69 -0
- package/dist/src/lib/ios-app-id.js.map +1 -0
- package/dist/src/lib/list-options.d.ts +68 -0
- package/dist/src/lib/list-options.js +89 -0
- package/dist/src/lib/list-options.js.map +1 -0
- package/dist/src/lib/local-state.d.ts +1 -1
- package/dist/src/lib/local-state.js +1 -1
- package/dist/src/lib/local-test-cases.d.ts +63 -0
- package/dist/src/lib/local-test-cases.js +136 -0
- package/dist/src/lib/local-test-cases.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +152 -5
- package/dist/src/lib/log-inspection.js +179 -2
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/logout-admin-session.d.ts +33 -0
- package/dist/src/lib/logout-admin-session.js +70 -0
- package/dist/src/lib/logout-admin-session.js.map +1 -0
- package/dist/src/lib/output.d.ts +15 -0
- package/dist/src/lib/output.js +28 -0
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/paginate.d.ts +15 -0
- package/dist/src/lib/paginate.js +17 -0
- package/dist/src/lib/paginate.js.map +1 -1
- package/dist/src/lib/project-config.d.ts +46 -21
- package/dist/src/lib/project-config.js +74 -47
- package/dist/src/lib/project-config.js.map +1 -1
- package/dist/src/lib/prompt-cost-format.d.ts +11 -0
- package/dist/src/lib/prompt-cost-format.js +41 -0
- package/dist/src/lib/prompt-cost-format.js.map +1 -0
- package/dist/src/lib/prompt-schema-codegen.d.ts +147 -0
- package/dist/src/lib/prompt-schema-codegen.js +462 -0
- package/dist/src/lib/prompt-schema-codegen.js.map +1 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +9 -1
- package/dist/src/lib/refresh-admin-credentials.js +22 -2
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
- package/dist/src/lib/resolve-owner.d.ts +19 -0
- package/dist/src/lib/resolve-owner.js +20 -0
- package/dist/src/lib/resolve-owner.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +49 -3
- package/dist/src/lib/skill-installer.js +275 -100
- package/dist/src/lib/skill-installer.js.map +1 -1
- package/dist/src/lib/snapshot-audit-source.d.ts +45 -0
- package/dist/src/lib/snapshot-audit-source.js +58 -0
- package/dist/src/lib/snapshot-audit-source.js.map +1 -0
- package/dist/src/lib/snapshot-audit-store.d.ts +52 -0
- package/dist/src/lib/snapshot-audit-store.js +196 -0
- package/dist/src/lib/snapshot-audit-store.js.map +1 -0
- package/dist/src/lib/snapshot-audit.d.ts +207 -0
- package/dist/src/lib/snapshot-audit.js +431 -0
- package/dist/src/lib/snapshot-audit.js.map +1 -0
- package/dist/src/lib/snapshot-build-rows.d.ts +60 -0
- package/dist/src/lib/snapshot-build-rows.js +87 -0
- package/dist/src/lib/snapshot-build-rows.js.map +1 -0
- package/dist/src/lib/snapshot-build.d.ts +50 -0
- package/dist/src/lib/snapshot-build.js +111 -0
- package/dist/src/lib/snapshot-build.js.map +1 -0
- package/dist/src/lib/snapshot-manifest-layout.d.ts +61 -0
- package/dist/src/lib/snapshot-manifest-layout.js +70 -0
- package/dist/src/lib/snapshot-manifest-layout.js.map +1 -0
- package/dist/src/lib/snapshots.d.ts +8 -9
- package/dist/src/lib/snapshots.js +20 -83
- package/dist/src/lib/snapshots.js.map +1 -1
- package/dist/src/lib/step-run-table.d.ts +43 -0
- package/dist/src/lib/step-run-table.js +129 -0
- package/dist/src/lib/step-run-table.js.map +1 -0
- package/dist/src/lib/storage-pending-retry.d.ts +26 -0
- package/dist/src/lib/storage-pending-retry.js +42 -0
- package/dist/src/lib/storage-pending-retry.js.map +1 -0
- package/dist/src/lib/swift-codegen/agentGenerator.d.ts +42 -0
- package/dist/src/lib/swift-codegen/agentGenerator.js +118 -0
- package/dist/src/lib/swift-codegen/agentGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/banners.d.ts +24 -0
- package/dist/src/lib/swift-codegen/banners.js +25 -0
- package/dist/src/lib/swift-codegen/banners.js.map +1 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js +19 -7
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -1
- package/dist/src/lib/swift-codegen/functionGenerator.d.ts +139 -0
- package/dist/src/lib/swift-codegen/functionGenerator.js +462 -0
- package/dist/src/lib/swift-codegen/functionGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/generator.d.ts +7 -1
- package/dist/src/lib/swift-codegen/generator.js +28 -11
- package/dist/src/lib/swift-codegen/generator.js.map +1 -1
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +15 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js +21 -4
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -1
- package/dist/src/lib/sync-paths.d.ts +72 -55
- package/dist/src/lib/sync-paths.js +97 -100
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/sync-resource-types.d.ts +23 -4
- package/dist/src/lib/sync-resource-types.js +106 -8
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +45 -2
- package/dist/src/lib/sync-selectors.js +66 -5
- package/dist/src/lib/sync-selectors.js.map +1 -1
- package/dist/src/lib/template.d.ts +2 -2
- package/dist/src/lib/template.js +2 -2
- package/dist/src/lib/test-case-file-names.d.ts +40 -0
- package/dist/src/lib/test-case-file-names.js +91 -0
- package/dist/src/lib/test-case-file-names.js.map +1 -0
- package/dist/src/lib/test-case-keys.d.ts +1 -1
- package/dist/src/lib/test-case-keys.js +1 -1
- package/dist/src/lib/test-case-variables.d.ts +14 -0
- package/dist/src/lib/test-case-variables.js +42 -0
- package/dist/src/lib/test-case-variables.js.map +1 -1
- package/dist/src/lib/toml-database-config.js +19 -2
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/web-url.d.ts +40 -0
- package/dist/src/lib/web-url.js +76 -0
- package/dist/src/lib/web-url.js.map +1 -0
- package/dist/src/lib/webhook-deliver.d.ts +209 -0
- package/dist/src/lib/webhook-deliver.js +519 -0
- package/dist/src/lib/webhook-deliver.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generator.d.ts +1 -1
- package/dist/src/lib/workflow-codegen/generator.js +1 -1
- package/dist/src/lib/workflow-toml-validator.d.ts +17 -8
- package/dist/src/lib/workflow-toml-validator.js +25 -12
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/dist/src/lib/workflow-usage.d.ts +196 -0
- package/dist/src/lib/workflow-usage.js +310 -0
- package/dist/src/lib/workflow-usage.js.map +1 -0
- package/dist/src/types/index.d.ts +12 -2
- package/package.json +5 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `primitive env use` records which environment THIS machine is pointed at.
|
|
5
5
|
* That is not a team decision, so it must not land in the committed
|
|
6
|
-
*
|
|
6
|
+
* `primitive/config.json` — `defaultEnvironment` stays the team default a
|
|
7
7
|
* fresh clone resolves. The file sits beside `credentials.json`, which has the
|
|
8
8
|
* same "local, never committed" property.
|
|
9
9
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `primitive env use` records which environment THIS machine is pointed at.
|
|
5
5
|
* That is not a team decision, so it must not land in the committed
|
|
6
|
-
*
|
|
6
|
+
* `primitive/config.json` — `defaultEnvironment` stays the team default a
|
|
7
7
|
* fresh clone resolves. The file sits beside `credentials.json`, which has the
|
|
8
8
|
* same "local, never committed" property.
|
|
9
9
|
*
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The case files on disk that the server has never been told about (#3061).
|
|
3
|
+
*
|
|
4
|
+
* A `<key>.tests/*.toml` sidecar is authored locally and becomes runnable only
|
|
5
|
+
* when `config push` registers it. The test verbs run the REGISTERED set, so a
|
|
6
|
+
* file nobody pushed contributes nothing to `Total Tests` — and until this
|
|
7
|
+
* module existed, nothing to the output either. `Total Tests: 3 / Failed: 0`
|
|
8
|
+
* beside four case files is a pass standing in for work that did not happen,
|
|
9
|
+
* and is indistinguishable from a case that genuinely ran.
|
|
10
|
+
*
|
|
11
|
+
* Naming those files is only useful if the naming is never wrong, so pairing
|
|
12
|
+
* here mirrors what push pairs with:
|
|
13
|
+
* 1. the sync manifest, which maps a file to the live case it manages even
|
|
14
|
+
* when the file has since been renamed;
|
|
15
|
+
* 2. the file name pull would give the case — its committed key, or the slug
|
|
16
|
+
* of an unkeyed case's name (web-admin, an older CLI or the raw API),
|
|
17
|
+
* collision suffixes included — from the one shared naming rule in
|
|
18
|
+
* `test-case-file-names.ts`.
|
|
19
|
+
* Both passes CLAIM: one live case accounts for one file, the way pull assigns
|
|
20
|
+
* one file per case and push's adoption pass pairs. Matching a name loosely
|
|
21
|
+
* instead would let a single registered "foo" excuse both `foo.toml` and a
|
|
22
|
+
* newly authored `foo-2.toml`, which is the silence this issue is about.
|
|
23
|
+
* Anything left over is a file no live case accounts for. The bias is toward
|
|
24
|
+
* silence: a pairing this module cannot make is a warning it does not print.
|
|
25
|
+
*
|
|
26
|
+
* Reads only — the scan never registers anything. `config push` stays the one
|
|
27
|
+
* verb that mutates the server, which is what the warning tells the user.
|
|
28
|
+
*/
|
|
29
|
+
/** What one suite's sidecar directory holds, against what is registered. */
|
|
30
|
+
export interface LocalTestCaseScan {
|
|
31
|
+
/** Every `*.toml` case file in the directory, basename order. */
|
|
32
|
+
localFiles: string[];
|
|
33
|
+
/** The subset no registered case accounts for, basename order. */
|
|
34
|
+
unregistered: string[];
|
|
35
|
+
}
|
|
36
|
+
/** The sync-state baseline rows that map a sidecar to a live case. */
|
|
37
|
+
export type ManagedTestCases = Record<string, {
|
|
38
|
+
id?: string;
|
|
39
|
+
} | undefined>;
|
|
40
|
+
/** Read the manifest's test-case rows, or nothing when it cannot be read. */
|
|
41
|
+
export declare function readManagedTestCases(configDir: string): ManagedTestCases;
|
|
42
|
+
/**
|
|
43
|
+
* The `*.toml` case files in a suite's sidecar directory, if it has one.
|
|
44
|
+
*
|
|
45
|
+
* An empty array means the directory is absent or holds no case file. A
|
|
46
|
+
* directory that cannot be READ throws instead of reporting nothing: this whole
|
|
47
|
+
* issue is about a silence indistinguishable from having no work, and callers
|
|
48
|
+
* turn the throw into a diagnostic that names the directory.
|
|
49
|
+
*/
|
|
50
|
+
export declare function listLocalTestCaseFiles(testsDir: string): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Which of a suite's local case files no registered case accounts for.
|
|
53
|
+
*
|
|
54
|
+
* `managedPrefix` is the manifest's namespace for this block —
|
|
55
|
+
* `<blockType>/<blockKey>` — so a row that maps `foo.toml` to a live case is
|
|
56
|
+
* read only for the block that owns it.
|
|
57
|
+
*/
|
|
58
|
+
export declare function scanLocalTestCases(params: {
|
|
59
|
+
testsDir: string;
|
|
60
|
+
registered: any[];
|
|
61
|
+
managed?: ManagedTestCases;
|
|
62
|
+
managedPrefix?: string;
|
|
63
|
+
}): LocalTestCaseScan;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The case files on disk that the server has never been told about (#3061).
|
|
3
|
+
*
|
|
4
|
+
* A `<key>.tests/*.toml` sidecar is authored locally and becomes runnable only
|
|
5
|
+
* when `config push` registers it. The test verbs run the REGISTERED set, so a
|
|
6
|
+
* file nobody pushed contributes nothing to `Total Tests` — and until this
|
|
7
|
+
* module existed, nothing to the output either. `Total Tests: 3 / Failed: 0`
|
|
8
|
+
* beside four case files is a pass standing in for work that did not happen,
|
|
9
|
+
* and is indistinguishable from a case that genuinely ran.
|
|
10
|
+
*
|
|
11
|
+
* Naming those files is only useful if the naming is never wrong, so pairing
|
|
12
|
+
* here mirrors what push pairs with:
|
|
13
|
+
* 1. the sync manifest, which maps a file to the live case it manages even
|
|
14
|
+
* when the file has since been renamed;
|
|
15
|
+
* 2. the file name pull would give the case — its committed key, or the slug
|
|
16
|
+
* of an unkeyed case's name (web-admin, an older CLI or the raw API),
|
|
17
|
+
* collision suffixes included — from the one shared naming rule in
|
|
18
|
+
* `test-case-file-names.ts`.
|
|
19
|
+
* Both passes CLAIM: one live case accounts for one file, the way pull assigns
|
|
20
|
+
* one file per case and push's adoption pass pairs. Matching a name loosely
|
|
21
|
+
* instead would let a single registered "foo" excuse both `foo.toml` and a
|
|
22
|
+
* newly authored `foo-2.toml`, which is the silence this issue is about.
|
|
23
|
+
* Anything left over is a file no live case accounts for. The bias is toward
|
|
24
|
+
* silence: a pairing this module cannot make is a warning it does not print.
|
|
25
|
+
*
|
|
26
|
+
* Reads only — the scan never registers anything. `config push` stays the one
|
|
27
|
+
* verb that mutates the server, which is what the warning tells the user.
|
|
28
|
+
*/
|
|
29
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "fs";
|
|
30
|
+
import { basename, join } from "path";
|
|
31
|
+
import { testCaseFileBasenames } from "./test-case-file-names.js";
|
|
32
|
+
import { normalizeTestCaseKey } from "./test-case-keys.js";
|
|
33
|
+
import { syncStateReadPath } from "./sync-paths.js";
|
|
34
|
+
/** Read the manifest's test-case rows, or nothing when it cannot be read. */
|
|
35
|
+
export function readManagedTestCases(configDir) {
|
|
36
|
+
const syncFile = syncStateReadPath(configDir);
|
|
37
|
+
if (!existsSync(syncFile))
|
|
38
|
+
return {};
|
|
39
|
+
try {
|
|
40
|
+
const state = JSON.parse(readFileSync(syncFile, "utf-8"));
|
|
41
|
+
const managed = state?.entities?.testCases;
|
|
42
|
+
return managed && typeof managed === "object" ? managed : {};
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// A manifest we cannot parse is a manifest we cannot pair with; the key and
|
|
46
|
+
// name passes still speak, and an unpairable file is left unnamed.
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The `*.toml` case files in a suite's sidecar directory, if it has one.
|
|
52
|
+
*
|
|
53
|
+
* An empty array means the directory is absent or holds no case file. A
|
|
54
|
+
* directory that cannot be READ throws instead of reporting nothing: this whole
|
|
55
|
+
* issue is about a silence indistinguishable from having no work, and callers
|
|
56
|
+
* turn the throw into a diagnostic that names the directory.
|
|
57
|
+
*/
|
|
58
|
+
export function listLocalTestCaseFiles(testsDir) {
|
|
59
|
+
if (!existsSync(testsDir))
|
|
60
|
+
return [];
|
|
61
|
+
if (!statSync(testsDir).isDirectory())
|
|
62
|
+
return [];
|
|
63
|
+
return readdirSync(testsDir)
|
|
64
|
+
.filter((entry) => entry.endsWith(".toml"))
|
|
65
|
+
.filter((entry) => {
|
|
66
|
+
// Attachment folders live beside the cases (`<case>/`); only files are
|
|
67
|
+
// cases, and a directory named `x.toml` is neither.
|
|
68
|
+
try {
|
|
69
|
+
return statSync(join(testsDir, entry)).isFile();
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
// Gone between the listing and the stat is gone — anything else is a
|
|
73
|
+
// directory we cannot read, which the caller has to hear about.
|
|
74
|
+
if (err?.code === "ENOENT")
|
|
75
|
+
return false;
|
|
76
|
+
throw err;
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
.sort();
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Which of a suite's local case files no registered case accounts for.
|
|
83
|
+
*
|
|
84
|
+
* `managedPrefix` is the manifest's namespace for this block —
|
|
85
|
+
* `<blockType>/<blockKey>` — so a row that maps `foo.toml` to a live case is
|
|
86
|
+
* read only for the block that owns it.
|
|
87
|
+
*/
|
|
88
|
+
export function scanLocalTestCases(params) {
|
|
89
|
+
const localFiles = listLocalTestCaseFiles(params.testsDir);
|
|
90
|
+
if (localFiles.length === 0)
|
|
91
|
+
return { localFiles, unregistered: [] };
|
|
92
|
+
const registered = (params.registered ?? []).filter((live) => live && typeof live === "object");
|
|
93
|
+
// The file each live case belongs in, allocated exactly as pull allocates it:
|
|
94
|
+
// keys claim theirs first, unkeyed names take what is left, and a collision
|
|
95
|
+
// suffix is assigned rather than accepted from any name that carries one.
|
|
96
|
+
const liveByFileName = new Map();
|
|
97
|
+
for (const [live, name] of testCaseFileBasenames(registered)) {
|
|
98
|
+
liveByFileName.set(normalizeTestCaseKey(name), live);
|
|
99
|
+
}
|
|
100
|
+
const liveById = new Map();
|
|
101
|
+
for (const live of registered) {
|
|
102
|
+
if (typeof live.testCaseId === "string" && live.testCaseId) {
|
|
103
|
+
liveById.set(live.testCaseId, live);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const managedLiveFor = (slug) => {
|
|
107
|
+
if (!params.managedPrefix)
|
|
108
|
+
return undefined;
|
|
109
|
+
const id = params.managed?.[`${params.managedPrefix}/${slug}`]?.id;
|
|
110
|
+
return id ? liveById.get(id) : undefined;
|
|
111
|
+
};
|
|
112
|
+
// A live case accounts for ONE file. Claiming is what keeps a single
|
|
113
|
+
// registered "foo" from excusing `foo.toml` and `foo-2.toml` alike.
|
|
114
|
+
const claimed = new Set();
|
|
115
|
+
const unclaimed = [];
|
|
116
|
+
// The manifest states identity outright, so it is read first: a file renamed
|
|
117
|
+
// since it was pulled keeps its case even where the naming rules would hand
|
|
118
|
+
// that case to the file still sitting under its old name.
|
|
119
|
+
for (const file of localFiles) {
|
|
120
|
+
const live = managedLiveFor(basename(file, ".toml"));
|
|
121
|
+
if (live && !claimed.has(live)) {
|
|
122
|
+
claimed.add(live);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
unclaimed.push(file);
|
|
126
|
+
}
|
|
127
|
+
const unregistered = unclaimed.filter((file) => {
|
|
128
|
+
const live = liveByFileName.get(normalizeTestCaseKey(basename(file, ".toml")));
|
|
129
|
+
if (!live || claimed.has(live))
|
|
130
|
+
return true;
|
|
131
|
+
claimed.add(live);
|
|
132
|
+
return false;
|
|
133
|
+
});
|
|
134
|
+
return { localFiles, unregistered };
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=local-test-cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-test-cases.js","sourceRoot":"","sources":["../../../src/lib/local-test-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAapD,6EAA6E;AAC7E,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC;QAC3C,OAAO,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,4EAA4E;QAC5E,mEAAmE;QACnE,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE;QAAE,OAAO,EAAE,CAAC;IACjD,OAAO,WAAW,CAAC,QAAQ,CAAC;SACzB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;SAC1C,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAChB,uEAAuE;QACvE,oDAAoD;QACpD,IAAI,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAClD,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,qEAAqE;YACrE,gEAAgE;YAChE,IAAI,GAAG,EAAE,IAAI,KAAK,QAAQ;gBAAE,OAAO,KAAK,CAAC;YACzC,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAKlC;IACC,MAAM,UAAU,GAAG,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC3D,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAErE,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CACjD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAC3C,CAAC;IAEF,8EAA8E;IAC9E,4EAA4E;IAC5E,0EAA0E;IAC1E,MAAM,cAAc,GAAG,IAAI,GAAG,EAAe,CAAC;IAC9C,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,qBAAqB,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7D,cAAc,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAe,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAC3D,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,CAAC,IAAY,EAAO,EAAE;QAC3C,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,OAAO,SAAS,CAAC;QAC5C,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,aAAa,IAAI,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;QACnE,OAAO,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3C,CAAC,CAAC;IAEF,qEAAqE;IACrE,oEAAoE;IACpE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAO,CAAC;IAC/B,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,6EAA6E;IAC7E,4EAA4E;IAC5E,0DAA0D;IAC1D,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QACrD,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,SAAS;QACX,CAAC;QACD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7C,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -40,8 +40,11 @@
|
|
|
40
40
|
* Nothing here reaches the network; adapters are pure functions over records
|
|
41
41
|
* the caller already fetched (one upstream call per command invocation).
|
|
42
42
|
*/
|
|
43
|
+
import { type ListEnvelope } from "./paginate.js";
|
|
43
44
|
/** The log store an entry came from. Workflow runs and steps are distinct. */
|
|
44
|
-
export type LogSource = "integration" | "workflow-run" | "workflow-step" | "webhook" | "activity"
|
|
45
|
+
export type LogSource = "integration" | "workflow-run" | "workflow-step" | "webhook" | "activity"
|
|
46
|
+
/** A server function's invocation record — #3287. */
|
|
47
|
+
| "function-log";
|
|
45
48
|
/**
|
|
46
49
|
* Normalized outcome vocabulary (platform terms only):
|
|
47
50
|
* - `ok` — completed / accepted successfully
|
|
@@ -68,6 +71,14 @@ export interface Correlation {
|
|
|
68
71
|
integrationKey?: string;
|
|
69
72
|
webhookId?: string;
|
|
70
73
|
workflowRunId?: string;
|
|
74
|
+
/**
|
|
75
|
+
* The function whose run made an outbound call — #3691.
|
|
76
|
+
*
|
|
77
|
+
* A pivot key like the rest: it is what `functions logs <function-id>` and
|
|
78
|
+
* `functions runs <function-id>` take, and it is not recoverable from the
|
|
79
|
+
* attributed `userId`, which is `sys:<appId>` for a call no human made.
|
|
80
|
+
*/
|
|
81
|
+
functionId?: string;
|
|
71
82
|
/** The acting user, where the source records one (workflow, activity). */
|
|
72
83
|
userId?: string;
|
|
73
84
|
}
|
|
@@ -86,8 +97,14 @@ interface BaseLogEntry {
|
|
|
86
97
|
export interface IntegrationDetail {
|
|
87
98
|
method?: string;
|
|
88
99
|
path?: string;
|
|
89
|
-
/** The call source: user | admin | test | workflow. */
|
|
100
|
+
/** The call source: user | admin | test | workflow | function. */
|
|
90
101
|
callSource?: string;
|
|
102
|
+
/**
|
|
103
|
+
* The key of the function that made the call — #3183 writes it on the row,
|
|
104
|
+
* #3691 surfaces it. Attribution an operator reads, filed beside
|
|
105
|
+
* `callSource` the way the `function-log` view files its own key.
|
|
106
|
+
*/
|
|
107
|
+
functionKey?: string;
|
|
91
108
|
requestBytes?: number;
|
|
92
109
|
responseBytes?: number;
|
|
93
110
|
errorCode?: string;
|
|
@@ -146,6 +163,41 @@ export interface WebhookDetail {
|
|
|
146
163
|
payloadSummary?: string;
|
|
147
164
|
processingDurationMs?: number;
|
|
148
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* One captured console line — #3287. The same `{ t, s, line }` shape the
|
|
168
|
+
* record stores, so a consumer reading the detail reads what was printed.
|
|
169
|
+
*/
|
|
170
|
+
export interface FunctionLogLine {
|
|
171
|
+
/** Milliseconds after the capture began. */
|
|
172
|
+
t: number;
|
|
173
|
+
/** `out` for log/info/debug/trace, `err` for warn/error. */
|
|
174
|
+
s: "out" | "err";
|
|
175
|
+
line: string;
|
|
176
|
+
/** Written at the bundle's module scope, before any invocation claimed it. */
|
|
177
|
+
m?: true;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* A server function invocation, as an operator reads it — #3287.
|
|
181
|
+
*
|
|
182
|
+
* An allowlist like every other detail here: the correlation keys are on the
|
|
183
|
+
* envelope's `correlation`, and what is left is what the invocation DID.
|
|
184
|
+
*/
|
|
185
|
+
export interface FunctionLogDetail {
|
|
186
|
+
functionKey?: string;
|
|
187
|
+
configId?: string;
|
|
188
|
+
contentHash?: string;
|
|
189
|
+
/** `http`, `webhook`, `cron`, `database`, `workflow`, `function`. */
|
|
190
|
+
triggerKind?: string;
|
|
191
|
+
errorCode?: string;
|
|
192
|
+
errorMessage?: string;
|
|
193
|
+
errorStack?: string;
|
|
194
|
+
stdout?: FunctionLogLine[];
|
|
195
|
+
stderr?: FunctionLogLine[];
|
|
196
|
+
/** A line or the channel hit a cap. */
|
|
197
|
+
truncated?: boolean;
|
|
198
|
+
/** The drain found nothing — an evicted isolate, not an empty function. */
|
|
199
|
+
logsUnavailable?: boolean;
|
|
200
|
+
}
|
|
149
201
|
export interface ActivityDetail {
|
|
150
202
|
action?: string;
|
|
151
203
|
feature?: string;
|
|
@@ -183,11 +235,26 @@ export interface WebhookLogEntry extends BaseLogEntry {
|
|
|
183
235
|
}
|
|
184
236
|
export interface ActivityLogEntry extends BaseLogEntry {
|
|
185
237
|
source: "activity";
|
|
186
|
-
/**
|
|
187
|
-
|
|
238
|
+
/**
|
|
239
|
+
* The activity row's own status, where the action records one.
|
|
240
|
+
*
|
|
241
|
+
* Almost no action does — an activity event is a COUNT, and reading one as
|
|
242
|
+
* a success or a failure would be fabricating a signal. `function.invoke`
|
|
243
|
+
* is the exception (#3287): the emit already carries the settled status in
|
|
244
|
+
* its context, so a failed invocation can be counted as a failure instead
|
|
245
|
+
* of reported as `neutral` (which is what it was, and what made the shared
|
|
246
|
+
* inspection contract unable to count failures at all).
|
|
247
|
+
*/
|
|
248
|
+
nativeStatus: string | null;
|
|
188
249
|
detail: ActivityDetail;
|
|
189
250
|
}
|
|
190
|
-
export
|
|
251
|
+
export interface FunctionLogEntry extends BaseLogEntry {
|
|
252
|
+
source: "function-log";
|
|
253
|
+
/** `completed`, `failed`, `timeout`, or the platform's own refusal code. */
|
|
254
|
+
nativeStatus: string | null;
|
|
255
|
+
detail: FunctionLogDetail;
|
|
256
|
+
}
|
|
257
|
+
export type LogEntry = IntegrationLogEntry | WorkflowRunLogEntry | WorkflowStepLogEntry | WebhookLogEntry | ActivityLogEntry | FunctionLogEntry;
|
|
191
258
|
export interface RawIntegrationLog {
|
|
192
259
|
timestamp?: string;
|
|
193
260
|
status?: number;
|
|
@@ -206,6 +273,9 @@ export interface RawIntegrationLog {
|
|
|
206
273
|
workflowKey?: string;
|
|
207
274
|
runId?: string;
|
|
208
275
|
stepId?: string;
|
|
276
|
+
/** #3183/#3691 — which function made the call, on a function-path row. */
|
|
277
|
+
functionId?: string;
|
|
278
|
+
functionKey?: string;
|
|
209
279
|
}
|
|
210
280
|
export interface RawWorkflowRun {
|
|
211
281
|
runId?: string;
|
|
@@ -270,6 +340,34 @@ export interface RawActivityRow {
|
|
|
270
340
|
total_tokens?: number;
|
|
271
341
|
[key: string]: unknown;
|
|
272
342
|
}
|
|
343
|
+
/** One invocation record, as the logs routes answer it — #3287. */
|
|
344
|
+
export interface RawFunctionLog {
|
|
345
|
+
invocationId?: string;
|
|
346
|
+
functionId?: string;
|
|
347
|
+
functionKey?: string | null;
|
|
348
|
+
configId?: string | null;
|
|
349
|
+
contentHash?: string | null;
|
|
350
|
+
runId?: string | null;
|
|
351
|
+
trigger?: {
|
|
352
|
+
kind?: string;
|
|
353
|
+
[key: string]: unknown;
|
|
354
|
+
} | null;
|
|
355
|
+
/** #3482 — which runtime the platform ran this invocation under. */
|
|
356
|
+
runtime?: string | null;
|
|
357
|
+
attributionUserId?: string | null;
|
|
358
|
+
status?: string;
|
|
359
|
+
errorCode?: string | null;
|
|
360
|
+
errorMessage?: string | null;
|
|
361
|
+
errorStack?: string | null;
|
|
362
|
+
stdout?: FunctionLogLine[];
|
|
363
|
+
stderr?: FunctionLogLine[];
|
|
364
|
+
truncated?: boolean;
|
|
365
|
+
logsUnavailable?: boolean;
|
|
366
|
+
contentSuppressed?: boolean;
|
|
367
|
+
durationMs?: number;
|
|
368
|
+
startedAt?: string | null;
|
|
369
|
+
[key: string]: unknown;
|
|
370
|
+
}
|
|
273
371
|
/** HTTP status → outcome: `<400` ok, `>=400` error, absent neutral. */
|
|
274
372
|
export declare function integrationOutcome(httpStatus: number | null | undefined): Outcome;
|
|
275
373
|
/**
|
|
@@ -356,6 +454,40 @@ export declare function toWebhookInspectionRow(raw: RawWebhookEvent): WebhookLog
|
|
|
356
454
|
* `entity_key`, …) is dropped by construction, not enumerated as a denylist.
|
|
357
455
|
*/
|
|
358
456
|
export declare function toActivityInspectionRow(raw: RawActivityRow): ActivityLogEntry;
|
|
457
|
+
/**
|
|
458
|
+
* An invocation record's status → outcome — #3287.
|
|
459
|
+
*
|
|
460
|
+
* `completed` is the only success. Everything else that names a settled
|
|
461
|
+
* invocation is a failure an operator has to be able to COUNT: the function
|
|
462
|
+
* threw (`failed`), it ran out of wall clock (`timeout`), or the platform
|
|
463
|
+
* refused the dispatch before any code ran and recorded its own code
|
|
464
|
+
* (`FUNCTION_BUNDLE_MISSING` and friends). A status nobody has taught this
|
|
465
|
+
* function is `neutral`, never fabricated as `ok`.
|
|
466
|
+
*/
|
|
467
|
+
export declare function functionLogOutcome(status: string | null | undefined): Outcome;
|
|
468
|
+
export declare function toFunctionLogInspectionRow(raw: RawFunctionLog): FunctionLogEntry;
|
|
469
|
+
/**
|
|
470
|
+
* The settled status a `function.invoke` activity row carries — #3287, D-2.
|
|
471
|
+
*
|
|
472
|
+
* The intent keeps the event a COUNT and adds no blob: the emit already puts
|
|
473
|
+
* the settled status in the event's context, so nothing on the write side
|
|
474
|
+
* moves. What moved is this — the shared inspection contract reported a failed
|
|
475
|
+
* invocation as `neutral`, which meant an operator could not count failures at
|
|
476
|
+
* all, and the count was the one thing the event was for.
|
|
477
|
+
*
|
|
478
|
+
* `context_json` arrives as an object or as a JSON STRING depending on the
|
|
479
|
+
* store, and an unparseable one is not a reason to guess: it answers null and
|
|
480
|
+
* the row stays `neutral`, exactly as every other action does.
|
|
481
|
+
*/
|
|
482
|
+
export declare function functionInvokeStatus(raw: RawActivityRow): string | null;
|
|
483
|
+
/**
|
|
484
|
+
* `function.invoke`'s status → outcome; every other action stays `neutral`.
|
|
485
|
+
*
|
|
486
|
+
* `started` is `pending` on purpose: a task start is in flight when the row is
|
|
487
|
+
* written, and its terminal outcome lives on the run row, which the
|
|
488
|
+
* `workflow-run` source already maps.
|
|
489
|
+
*/
|
|
490
|
+
export declare function activityOutcome(status: string | null): Outcome;
|
|
359
491
|
/** Build the "flag not supported for this source" message (behavior 12). */
|
|
360
492
|
export declare function unsupportedFlagMessage(flag: string, source: string, supported: string[]): string;
|
|
361
493
|
/**
|
|
@@ -417,6 +549,21 @@ export interface RawActivityResponse {
|
|
|
417
549
|
}
|
|
418
550
|
export declare function buildIntegrationEnvelope(raw: RawIntegrationLog[]): UnpaginatedEnvelope<IntegrationLogEntry>;
|
|
419
551
|
export declare function buildWorkflowRunEnvelope(raw: RawWorkflowRun[], page?: RawPage): PaginatedEnvelope<WorkflowRunLogEntry>;
|
|
552
|
+
/**
|
|
553
|
+
* The `workflows runs list --json` envelope (#3646).
|
|
554
|
+
*
|
|
555
|
+
* `runs list` is a `list` verb, so what it prints is the CLI's one list
|
|
556
|
+
* envelope — `{items, hasMore, nextCursor?}`, with `nextCursor` OMITTED on the
|
|
557
|
+
* last page and the deprecated `cursor` alias not re-emitted — rather than the
|
|
558
|
+
* endpoint's #1316 envelope passed through, which is what
|
|
559
|
+
* {@link buildWorkflowRunEnvelope} still does for `runs failures` (a sweep, not
|
|
560
|
+
* a `list`). The rows are the same inspection shape either way, and `scanned`
|
|
561
|
+
* (#2237) survives as a key beside the envelope's three because it describes
|
|
562
|
+
* how far the filtered read got, which is not a pagination claim.
|
|
563
|
+
*/
|
|
564
|
+
export declare function buildWorkflowRunListEnvelope(raw: RawWorkflowRun[], page?: RawPage): ListEnvelope<WorkflowRunLogEntry> & {
|
|
565
|
+
scanned?: number;
|
|
566
|
+
};
|
|
420
567
|
export declare function buildWorkflowStepEnvelope(raw: RawWorkflowStepRun[]): UnpaginatedEnvelope<WorkflowStepLogEntry>;
|
|
421
568
|
export declare function buildWebhookEnvelope(raw: RawWebhookEvent[], page?: RawPage): PaginatedEnvelope<WebhookLogEntry>;
|
|
422
569
|
/**
|