primitive-admin 1.1.0-alpha.6 → 1.1.0-alpha.60
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 +389 -71
- package/assets/skill/skills/primitive-platform/SKILL.md +670 -0
- package/dist/bin/primitive.d.ts +2 -0
- package/dist/bin/primitive.js +287 -17
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.d.ts +2 -0
- package/dist/src/commands/admins.js +138 -19
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/analytics.d.ts +2 -0
- package/dist/src/commands/analytics.js +554 -55
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/apps.d.ts +2 -0
- package/dist/src/commands/apps.js +27 -80
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth.d.ts +2 -0
- package/dist/src/commands/auth.js +177 -7
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.d.ts +2 -0
- package/dist/src/commands/blob-buckets.js +330 -0
- package/dist/src/commands/blob-buckets.js.map +1 -0
- package/dist/src/commands/catalog.d.ts +2 -0
- package/dist/src/commands/catalog.js +37 -38
- package/dist/src/commands/catalog.js.map +1 -1
- package/dist/src/commands/collection-type-configs.d.ts +2 -0
- package/dist/src/commands/collection-type-configs.js +92 -0
- package/dist/src/commands/collection-type-configs.js.map +1 -0
- package/dist/src/commands/collections.d.ts +2 -0
- package/dist/src/commands/collections.js +526 -0
- package/dist/src/commands/collections.js.map +1 -0
- package/dist/src/commands/comparisons.d.ts +2 -0
- package/dist/src/commands/comparisons.js +6 -6
- package/dist/src/commands/comparisons.js.map +1 -1
- package/dist/src/commands/config.d.ts +35 -0
- package/dist/src/commands/config.js +437 -0
- package/dist/src/commands/config.js.map +1 -0
- package/dist/src/commands/connections.d.ts +2 -0
- package/dist/src/commands/connections.js +100 -0
- package/dist/src/commands/connections.js.map +1 -0
- package/dist/src/commands/cron-triggers.d.ts +2 -0
- package/dist/src/commands/cron-triggers.js +204 -0
- package/dist/src/commands/cron-triggers.js.map +1 -0
- package/dist/src/commands/database-types.d.ts +2 -0
- package/dist/src/commands/database-types.js +171 -0
- package/dist/src/commands/database-types.js.map +1 -0
- package/dist/src/commands/databases.d.ts +65 -0
- package/dist/src/commands/databases.js +2153 -96
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +2 -0
- package/dist/src/commands/documents.js +1230 -19
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.d.ts +2 -0
- package/dist/src/commands/email-templates.js +174 -0
- package/dist/src/commands/email-templates.js.map +1 -0
- package/dist/src/commands/env.d.ts +12 -0
- package/dist/src/commands/env.js +260 -0
- package/dist/src/commands/env.js.map +1 -0
- package/dist/src/commands/group-type-configs.d.ts +2 -0
- package/dist/src/commands/group-type-configs.js +86 -0
- package/dist/src/commands/group-type-configs.js.map +1 -0
- package/dist/src/commands/groups.d.ts +2 -0
- package/dist/src/commands/groups.js +38 -99
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/guides.d.ts +223 -0
- package/dist/src/commands/guides.js +617 -65
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +17 -0
- package/dist/src/commands/init.js +964 -202
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.d.ts +2 -0
- package/dist/src/commands/integrations.js +484 -205
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.d.ts +2 -0
- package/dist/src/commands/llm.js +13 -8
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/locks.d.ts +8 -0
- package/dist/src/commands/locks.js +160 -0
- package/dist/src/commands/locks.js.map +1 -0
- package/dist/src/commands/metadata.d.ts +2 -0
- package/dist/src/commands/metadata.js +406 -0
- package/dist/src/commands/metadata.js.map +1 -0
- package/dist/src/commands/prompts.d.ts +2 -0
- package/dist/src/commands/prompts.js +135 -355
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.d.ts +3 -0
- package/dist/src/commands/rule-sets.js +271 -0
- package/dist/src/commands/rule-sets.js.map +1 -0
- package/dist/src/commands/scripts.d.ts +20 -0
- package/dist/src/commands/scripts.js +739 -0
- package/dist/src/commands/scripts.js.map +1 -0
- package/dist/src/commands/secrets.d.ts +2 -0
- package/dist/src/commands/secrets.js +108 -0
- package/dist/src/commands/secrets.js.map +1 -0
- package/dist/src/commands/sessions.d.ts +2 -0
- package/dist/src/commands/sessions.js +75 -0
- package/dist/src/commands/sessions.js.map +1 -0
- package/dist/src/commands/settings.d.ts +18 -0
- package/dist/src/commands/settings.js +54 -0
- package/dist/src/commands/settings.js.map +1 -0
- package/dist/src/commands/skill.d.ts +2 -0
- package/dist/src/commands/skill.js +29 -0
- package/dist/src/commands/skill.js.map +1 -0
- package/dist/src/commands/sync-app-settings.d.ts +125 -0
- package/dist/src/commands/sync-app-settings.js +380 -0
- package/dist/src/commands/sync-app-settings.js.map +1 -0
- package/dist/src/commands/sync.d.ts +958 -0
- package/dist/src/commands/sync.js +8954 -812
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.d.ts +2 -0
- package/dist/src/commands/tokens.js +130 -21
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.d.ts +2 -0
- package/dist/src/commands/users.js +440 -22
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/vars.d.ts +8 -0
- package/dist/src/commands/vars.js +96 -0
- package/dist/src/commands/vars.js.map +1 -0
- package/dist/src/commands/waitlist.d.ts +2 -0
- package/dist/src/commands/waitlist.js +10 -10
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +2 -0
- package/dist/src/commands/webhooks.js +442 -0
- package/dist/src/commands/webhooks.js.map +1 -0
- package/dist/src/commands/workflows.d.ts +94 -0
- package/dist/src/commands/workflows.js +1581 -448
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +1814 -0
- package/dist/src/lib/api-client.js +1655 -103
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +130 -0
- package/dist/src/lib/app-settings-descriptor.js +262 -0
- package/dist/src/lib/app-settings-descriptor.js.map +1 -0
- package/dist/src/lib/auth-flow.d.ts +8 -0
- package/dist/src/lib/batch.d.ts +26 -0
- package/dist/src/lib/batch.js +32 -0
- package/dist/src/lib/batch.js.map +1 -0
- package/dist/src/lib/block-layout.d.ts +160 -0
- package/dist/src/lib/block-layout.js +451 -0
- package/dist/src/lib/block-layout.js.map +1 -0
- package/dist/src/lib/canonical-json.d.ts +12 -0
- package/dist/src/lib/canonical-json.js +35 -0
- package/dist/src/lib/canonical-json.js.map +1 -0
- package/dist/src/lib/channel.d.ts +30 -0
- package/dist/src/lib/channel.js +68 -0
- package/dist/src/lib/channel.js.map +1 -0
- package/dist/src/lib/cli-manifest.d.ts +68 -0
- package/dist/src/lib/cli-manifest.js +71 -0
- package/dist/src/lib/cli-manifest.js.map +1 -0
- package/dist/src/lib/codegen-shared/generatedFiles.d.ts +97 -0
- package/dist/src/lib/codegen-shared/generatedFiles.js +184 -0
- package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -0
- package/dist/src/lib/codegen-shared/prettierStable.d.ts +262 -0
- package/dist/src/lib/codegen-shared/prettierStable.js +610 -0
- package/dist/src/lib/codegen-shared/prettierStable.js.map +1 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.d.ts +68 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js +168 -0
- package/dist/src/lib/codegen-shared/resolveCodegenSourceDir.js.map +1 -0
- package/dist/src/lib/config-object-descriptor.d.ts +108 -0
- package/dist/src/lib/config-object-descriptor.js +607 -0
- package/dist/src/lib/config-object-descriptor.js.map +1 -0
- package/dist/src/lib/config-payload.d.ts +85 -0
- package/dist/src/lib/config-payload.js +105 -0
- package/dist/src/lib/config-payload.js.map +1 -0
- package/dist/src/lib/config-surface.d.ts +93 -0
- package/dist/src/lib/config-surface.js +178 -0
- package/dist/src/lib/config-surface.js.map +1 -0
- package/dist/src/lib/config-toml.d.ts +10 -0
- package/dist/src/lib/config-toml.js +42 -0
- package/dist/src/lib/config-toml.js.map +1 -0
- package/dist/src/lib/config.d.ts +53 -0
- package/dist/src/lib/config.js +92 -53
- package/dist/src/lib/config.js.map +1 -1
- package/dist/src/lib/confirm-prompt.d.ts +83 -0
- package/dist/src/lib/confirm-prompt.js +110 -0
- package/dist/src/lib/confirm-prompt.js.map +1 -0
- package/dist/src/lib/constants.d.ts +11 -0
- package/dist/src/lib/constants.js +12 -0
- package/dist/src/lib/constants.js.map +1 -0
- package/dist/src/lib/crash-handlers.d.ts +20 -0
- package/dist/src/lib/crash-handlers.js +49 -0
- package/dist/src/lib/crash-handlers.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +89 -0
- package/dist/src/lib/credentials-store.js +330 -0
- package/dist/src/lib/credentials-store.js.map +1 -0
- package/dist/src/lib/csv.d.ts +47 -0
- package/dist/src/lib/csv.js +172 -0
- package/dist/src/lib/csv.js.map +1 -0
- package/dist/src/lib/data-input.d.ts +23 -0
- package/dist/src/lib/data-input.js +50 -0
- package/dist/src/lib/data-input.js.map +1 -0
- package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
- package/dist/src/lib/db-codegen/dbFingerprint.js +17 -0
- package/dist/src/lib/db-codegen/dbFingerprint.js.map +1 -0
- package/dist/src/lib/db-codegen/dbGenerator.d.ts +67 -0
- package/dist/src/lib/db-codegen/dbGenerator.js +170 -0
- package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -0
- package/dist/src/lib/db-codegen/dbNaming.d.ts +87 -0
- package/dist/src/lib/db-codegen/dbNaming.js +180 -0
- package/dist/src/lib/db-codegen/dbNaming.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +272 -0
- package/dist/src/lib/db-codegen/dbTemplates.js +480 -0
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +73 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js +139 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -0
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +146 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js +517 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.d.ts +112 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js +211 -0
- package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js.map +1 -0
- package/dist/src/lib/env-resolver.d.ts +62 -0
- package/dist/src/lib/env-resolver.js +121 -0
- package/dist/src/lib/env-resolver.js.map +1 -0
- package/dist/src/lib/fetch.d.ts +5 -0
- package/dist/src/lib/generated-allowlist.d.ts +28 -0
- package/dist/src/lib/generated-allowlist.js +266 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -0
- package/dist/src/lib/generated-config-surfaces.d.ts +578 -0
- package/dist/src/lib/generated-config-surfaces.js +3630 -0
- package/dist/src/lib/generated-config-surfaces.js.map +1 -0
- package/dist/src/lib/generated-template-lint.d.ts +206 -0
- package/dist/src/lib/generated-template-lint.js +589 -0
- package/dist/src/lib/generated-template-lint.js.map +1 -0
- package/dist/src/lib/generated-workflow-model-fields.d.ts +20 -0
- package/dist/src/lib/generated-workflow-model-fields.js +53 -0
- package/dist/src/lib/generated-workflow-model-fields.js.map +1 -0
- package/dist/src/lib/google-client-secret-status.d.ts +35 -0
- package/dist/src/lib/google-client-secret-status.js +56 -0
- package/dist/src/lib/google-client-secret-status.js.map +1 -0
- package/dist/src/lib/init-config.d.ts +81 -0
- package/dist/src/lib/init-config.js +149 -0
- package/dist/src/lib/init-config.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +568 -0
- package/dist/src/lib/log-inspection.js +639 -0
- package/dist/src/lib/log-inspection.js.map +1 -0
- package/dist/src/lib/migration-nag.d.ts +49 -0
- package/dist/src/lib/migration-nag.js +163 -0
- package/dist/src/lib/migration-nag.js.map +1 -0
- package/dist/src/lib/output.d.ts +109 -0
- package/dist/src/lib/output.js +191 -8
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/package-manager.d.ts +140 -0
- package/dist/src/lib/package-manager.js +305 -0
- package/dist/src/lib/package-manager.js.map +1 -0
- package/dist/src/lib/paginate.d.ts +83 -0
- package/dist/src/lib/paginate.js +95 -0
- package/dist/src/lib/paginate.js.map +1 -0
- package/dist/src/lib/platform-owned.d.ts +51 -0
- package/dist/src/lib/platform-owned.js +64 -0
- package/dist/src/lib/platform-owned.js.map +1 -0
- package/dist/src/lib/project-config.d.ts +97 -0
- package/dist/src/lib/project-config.js +219 -0
- package/dist/src/lib/project-config.js.map +1 -0
- package/dist/src/lib/query-operators.d.ts +43 -0
- package/dist/src/lib/query-operators.js +80 -0
- package/dist/src/lib/query-operators.js.map +1 -0
- package/dist/src/lib/record-filter.d.ts +18 -0
- package/dist/src/lib/record-filter.js +55 -0
- package/dist/src/lib/record-filter.js.map +1 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +65 -0
- package/dist/src/lib/refresh-admin-credentials.js +103 -0
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -0
- package/dist/src/lib/resolve-init-dev-port.d.ts +56 -0
- package/dist/src/lib/resolve-init-dev-port.js +55 -0
- package/dist/src/lib/resolve-init-dev-port.js.map +1 -0
- package/dist/src/lib/resolve-init-server.d.ts +71 -0
- package/dist/src/lib/resolve-init-server.js +94 -0
- package/dist/src/lib/resolve-init-server.js.map +1 -0
- package/dist/src/lib/resolve-platform.d.ts +45 -0
- package/dist/src/lib/resolve-platform.js +43 -0
- package/dist/src/lib/resolve-platform.js.map +1 -0
- package/dist/src/lib/run-status.d.ts +19 -0
- package/dist/src/lib/run-status.generated.d.ts +39 -0
- package/dist/src/lib/run-status.generated.js +66 -0
- package/dist/src/lib/run-status.generated.js.map +1 -0
- package/dist/src/lib/run-status.js +19 -0
- package/dist/src/lib/run-status.js.map +1 -0
- package/dist/src/lib/signing-secret-status.d.ts +81 -0
- package/dist/src/lib/signing-secret-status.js +116 -0
- package/dist/src/lib/signing-secret-status.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +25 -0
- package/dist/src/lib/skill-installer.js +266 -0
- package/dist/src/lib/skill-installer.js.map +1 -0
- package/dist/src/lib/snapshots.d.ts +99 -0
- package/dist/src/lib/snapshots.js +357 -0
- package/dist/src/lib/snapshots.js.map +1 -0
- package/dist/src/lib/swift-codegen/dbGenerator.d.ts +100 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js +682 -0
- package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.d.ts +42 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.js +100 -0
- package/dist/src/lib/swift-codegen/dbSwiftTypes.js.map +1 -0
- package/dist/src/lib/swift-codegen/generator.d.ts +85 -0
- package/dist/src/lib/swift-codegen/generator.js +266 -0
- package/dist/src/lib/swift-codegen/generator.js.map +1 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +72 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js +644 -0
- package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.d.ts +90 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.js +152 -0
- package/dist/src/lib/swift-codegen/siblingSymbols.js.map +1 -0
- package/dist/src/lib/swift-codegen/swiftNaming.d.ts +85 -0
- package/dist/src/lib/swift-codegen/swiftNaming.js +198 -0
- package/dist/src/lib/swift-codegen/swiftNaming.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +72 -0
- package/dist/src/lib/sync-paths.js +130 -0
- package/dist/src/lib/sync-paths.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +445 -0
- package/dist/src/lib/sync-resource-types.js +812 -0
- package/dist/src/lib/sync-resource-types.js.map +1 -0
- package/dist/src/lib/sync-selectors.d.ts +95 -0
- package/dist/src/lib/sync-selectors.js +228 -0
- package/dist/src/lib/sync-selectors.js.map +1 -0
- package/dist/src/lib/template.d.ts +121 -0
- package/dist/src/lib/template.js +447 -67
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/lib/token-inject.d.ts +56 -0
- package/dist/src/lib/token-inject.js +204 -0
- package/dist/src/lib/token-inject.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +123 -0
- package/dist/src/lib/toml-database-config.js +527 -0
- package/dist/src/lib/toml-database-config.js.map +1 -0
- package/dist/src/lib/toml-metadata-config.d.ts +151 -0
- package/dist/src/lib/toml-metadata-config.js +476 -0
- package/dist/src/lib/toml-metadata-config.js.map +1 -0
- package/dist/src/lib/toml-native-form.d.ts +46 -0
- package/dist/src/lib/toml-native-form.js +78 -0
- package/dist/src/lib/toml-native-form.js.map +1 -0
- package/dist/src/lib/toml-params-validator.d.ts +129 -0
- package/dist/src/lib/toml-params-validator.js +298 -0
- package/dist/src/lib/toml-params-validator.js.map +1 -0
- package/dist/src/lib/toml-scalar-edit.d.ts +43 -0
- package/dist/src/lib/toml-scalar-edit.js +283 -0
- package/dist/src/lib/toml-scalar-edit.js.map +1 -0
- package/dist/src/lib/user-selector.d.ts +24 -0
- package/dist/src/lib/user-selector.js +33 -0
- package/dist/src/lib/user-selector.js.map +1 -0
- package/dist/src/lib/version-check.d.ts +35 -0
- package/dist/src/lib/version-check.js +241 -0
- package/dist/src/lib/version-check.js.map +1 -0
- package/dist/src/lib/watch.d.ts +121 -0
- package/dist/src/lib/watch.js +169 -0
- package/dist/src/lib/watch.js.map +1 -0
- package/dist/src/lib/workflow-apply.d.ts +51 -0
- package/dist/src/lib/workflow-apply.js +89 -0
- package/dist/src/lib/workflow-apply.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.d.ts +129 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js +269 -0
- package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js.map +1 -0
- package/dist/src/lib/workflow-codegen/generator.d.ts +96 -0
- package/dist/src/lib/workflow-codegen/generator.js +361 -0
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -0
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +83 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js +71 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -0
- package/dist/src/lib/workflow-codegen/naming.d.ts +33 -0
- package/dist/src/lib/workflow-codegen/naming.js +81 -0
- package/dist/src/lib/workflow-codegen/naming.js.map +1 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.d.ts +80 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.js +303 -0
- package/dist/src/lib/workflow-codegen/schemaToTs.js.map +1 -0
- package/dist/src/lib/workflow-config-apply.d.ts +70 -0
- package/dist/src/lib/workflow-config-apply.js +137 -0
- package/dist/src/lib/workflow-config-apply.js.map +1 -0
- package/dist/src/lib/workflow-config-sidecar.d.ts +63 -0
- package/dist/src/lib/workflow-config-sidecar.js +96 -0
- package/dist/src/lib/workflow-config-sidecar.js.map +1 -0
- package/dist/src/lib/workflow-field-descriptor.d.ts +91 -0
- package/dist/src/lib/workflow-field-descriptor.js +153 -0
- package/dist/src/lib/workflow-field-descriptor.js.map +1 -0
- package/dist/src/lib/workflow-fragments.d.ts +64 -0
- package/dist/src/lib/workflow-fragments.js +342 -0
- package/dist/src/lib/workflow-fragments.js.map +1 -0
- package/dist/src/lib/workflow-include-preserve.d.ts +71 -0
- package/dist/src/lib/workflow-include-preserve.js +153 -0
- package/dist/src/lib/workflow-include-preserve.js.map +1 -0
- package/dist/src/lib/workflow-payload.d.ts +86 -0
- package/dist/src/lib/workflow-payload.js +168 -0
- package/dist/src/lib/workflow-payload.js.map +1 -0
- package/dist/src/lib/workflow-toml-validator.d.ts +199 -0
- package/dist/src/lib/workflow-toml-validator.js +754 -0
- package/dist/src/lib/workflow-toml-validator.js.map +1 -0
- package/dist/src/types/index.d.ts +533 -0
- package/dist/src/validators.d.ts +65 -0
- package/dist/src/validators.js +64 -0
- package/dist/src/validators.js.map +1 -0
- package/package.json +32 -6
package/README.md
CHANGED
|
@@ -5,9 +5,13 @@ Command-line interface for administering Primitive applications. This CLI provid
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
pnpm add -g primitive-admin
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
pnpm is the recommended package manager. If you use npm instead, run
|
|
12
|
+
`npm install -g primitive-admin` — install with one manager only, or you end up
|
|
13
|
+
with two global copies.
|
|
14
|
+
|
|
11
15
|
### Development Setup
|
|
12
16
|
|
|
13
17
|
From the **worklet root directory**:
|
|
@@ -71,11 +75,15 @@ primitive apps --help
|
|
|
71
75
|
The CLI uses browser-based OAuth for authentication. When you run `primitive login`, it opens your browser to authenticate via Google OAuth and stores credentials locally.
|
|
72
76
|
|
|
73
77
|
```bash
|
|
74
|
-
# Login to the
|
|
78
|
+
# Login to the environment resolved from .primitive/config.json
|
|
79
|
+
# (project mode), or the default/PRIMITIVE_SERVER_URL server (legacy mode)
|
|
75
80
|
primitive login
|
|
76
81
|
|
|
77
|
-
# Login to a
|
|
78
|
-
primitive
|
|
82
|
+
# Login to a specific named environment
|
|
83
|
+
primitive -e prod login
|
|
84
|
+
|
|
85
|
+
# Login to a custom server without a project config (legacy mode)
|
|
86
|
+
PRIMITIVE_SERVER_URL=https://api.example.com primitive login
|
|
79
87
|
|
|
80
88
|
# View current session
|
|
81
89
|
primitive whoami
|
|
@@ -129,17 +137,20 @@ Manage applications (requires admin access).
|
|
|
129
137
|
|
|
130
138
|
```bash
|
|
131
139
|
primitive apps list # List all accessible apps
|
|
132
|
-
primitive apps create "My App" # Create a new app
|
|
140
|
+
primitive apps create "My App" # Create a new app (mints the app id)
|
|
133
141
|
primitive apps get <app-id> # Get app details
|
|
134
|
-
primitive apps update <app-id> [opts] # Update app settings
|
|
135
142
|
primitive apps delete <app-id> # Delete an app
|
|
136
143
|
```
|
|
137
144
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
App settings are configuration, so they are authored in `app.toml` and applied
|
|
146
|
+
with `sync push` (issue #2645) — there is no `apps update`:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
primitive settings get # what the server is running
|
|
150
|
+
primitive sync pull --only app # write those settings into app.toml
|
|
151
|
+
primitive config set app app.mode=invite-only
|
|
152
|
+
primitive sync push --only app # apply the edit
|
|
153
|
+
```
|
|
143
154
|
- `--google-oauth` / `--no-google-oauth` - Enable/disable Google OAuth
|
|
144
155
|
- `--passkey` / `--no-passkey` - Enable/disable passkey auth
|
|
145
156
|
- `--magic-link` / `--no-magic-link` - Enable/disable magic link auth
|
|
@@ -150,12 +161,13 @@ Manage users within an app.
|
|
|
150
161
|
|
|
151
162
|
```bash
|
|
152
163
|
primitive users list [app-id] # List users
|
|
164
|
+
primitive users create <email> [--role admin|member] # Create/add user by email
|
|
153
165
|
primitive users invite [app-id] <email> [--role admin] # Invite user
|
|
154
166
|
primitive users remove [app-id] <user-id> # Remove user
|
|
155
167
|
primitive users set-role [app-id] <user-id> <role> # Change role
|
|
156
168
|
primitive users transfer-owner [app-id] <new-owner-id> # Transfer ownership
|
|
157
|
-
primitive users
|
|
158
|
-
primitive users invitations
|
|
169
|
+
primitive users mint-jwt <user-id> [--role <role>] # Mint test JWT (dev/test only)
|
|
170
|
+
primitive users invitations [app-id] # List pending invitations
|
|
159
171
|
```
|
|
160
172
|
|
|
161
173
|
### Waitlist
|
|
@@ -175,57 +187,72 @@ Manage HTTP integrations (external API connections).
|
|
|
175
187
|
|
|
176
188
|
```bash
|
|
177
189
|
primitive integrations list [app-id] # List integrations
|
|
178
|
-
primitive integrations create [app-id] [options] # Create integration
|
|
179
190
|
primitive integrations get <integration-id> # Get details
|
|
180
|
-
primitive integrations update <id> [options] # Update integration
|
|
181
|
-
primitive integrations delete <id> # Soft delete
|
|
182
191
|
primitive integrations test <id> # Test connection
|
|
183
192
|
primitive integrations logs <id> # View invocation logs
|
|
184
193
|
```
|
|
185
194
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
195
|
+
An integration is authored in `integrations/<key>.toml` and applied with
|
|
196
|
+
`sync push` — creating, updating and deleting one are all edits to that file:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
primitive config fields integration # its keys, types, defaults
|
|
200
|
+
primitive config new integration weather-api # scaffold the file
|
|
201
|
+
primitive sync push --only integration/weather-api
|
|
202
|
+
```
|
|
192
203
|
|
|
193
204
|
**Secrets management:**
|
|
205
|
+
|
|
206
|
+
Integration-scoped secrets are **retired** — the `primitive integrations secrets`
|
|
207
|
+
command group no longer exists. Use app-level secrets instead
|
|
208
|
+
(`primitive secrets set <KEY> --value <value>`) and reference them in integration
|
|
209
|
+
config via `{{secrets.KEY}}`. See the **Secrets** section below.
|
|
210
|
+
|
|
211
|
+
### Secrets
|
|
212
|
+
|
|
213
|
+
Manage encrypted app secrets (API keys, tokens, credentials). Values are encrypted at rest and never displayed after creation.
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
primitive secrets list [--app <app-id>] # List secrets (values never shown)
|
|
217
|
+
primitive secrets set <KEY> --value <value> [--summary <text>] # Create or update a secret
|
|
218
|
+
primitive secrets delete <KEY> # Delete a secret
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Examples:**
|
|
194
222
|
```bash
|
|
195
|
-
primitive
|
|
196
|
-
primitive
|
|
197
|
-
primitive
|
|
223
|
+
primitive secrets set OPENAI_API_KEY --value "sk-..." --summary "Production key"
|
|
224
|
+
primitive secrets set STRIPE_SECRET --value "sk_live_..."
|
|
225
|
+
primitive secrets list --json
|
|
226
|
+
primitive secrets delete STRIPE_SECRET
|
|
198
227
|
```
|
|
199
228
|
|
|
229
|
+
Keys must be uppercase letters, digits, and underscores (e.g., `OPENAI_API_KEY`). Max 100 secrets per app, 2 KB per value. The `set` command is an upsert — it creates or updates automatically. Use `{{secrets.KEY}}` in workflows and `secrets.KEY` in CEL rules.
|
|
230
|
+
|
|
200
231
|
### Prompts
|
|
201
232
|
|
|
202
233
|
Manage LLM prompt configurations.
|
|
203
234
|
|
|
204
235
|
```bash
|
|
205
236
|
primitive prompts list [app-id] # List prompts
|
|
206
|
-
primitive prompts create [app-id] [options] # Create prompt
|
|
207
237
|
primitive prompts get <prompt-id> # Get details
|
|
208
|
-
primitive prompts update <id> [options] # Update prompt
|
|
209
|
-
primitive prompts delete <id> # Soft delete
|
|
210
238
|
primitive prompts execute <id> --vars '{}' # Execute prompt
|
|
211
239
|
primitive prompts preview <id> --vars '{}' # Preview rendered template
|
|
212
240
|
```
|
|
213
241
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
242
|
+
A prompt is authored in `prompts/<key>.toml` and applied with `sync push`:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
primitive config new prompt summarizer
|
|
246
|
+
primitive sync push --only prompt/summarizer
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Configs (prompt variations)** are `[[configs]]` entries in that same file —
|
|
250
|
+
`active = true` marks the live one, `status = "archived"` retires one, and
|
|
251
|
+
duplicating is copying the block under a new `name`. The CLI reads them:
|
|
222
252
|
|
|
223
|
-
**Configs (prompt variations):**
|
|
224
253
|
```bash
|
|
225
254
|
primitive prompts configs list <prompt-id>
|
|
226
|
-
primitive prompts configs
|
|
227
|
-
primitive prompts configs activate <prompt-id> <config-id>
|
|
228
|
-
primitive prompts configs duplicate <prompt-id> <config-id>
|
|
255
|
+
primitive prompts configs get <prompt> <config>
|
|
229
256
|
```
|
|
230
257
|
|
|
231
258
|
### Workflows
|
|
@@ -234,20 +261,101 @@ Manage multi-step workflow definitions.
|
|
|
234
261
|
|
|
235
262
|
```bash
|
|
236
263
|
primitive workflows list [app-id] # List workflows
|
|
237
|
-
primitive workflows create [app-id] --from-file wf.toml # Create workflow
|
|
238
264
|
primitive workflows get <workflow-id> # Get details
|
|
239
|
-
primitive workflows update <id> [options] # Update metadata
|
|
240
|
-
primitive workflows draft update <id> --from-file wf.toml # Update draft
|
|
241
|
-
primitive workflows publish <id> # Publish draft
|
|
242
265
|
primitive workflows preview <id> --input '{}' # Preview execution
|
|
266
|
+
primitive workflows disable <id> # Take it out of service now
|
|
267
|
+
primitive workflows enable <id> # Put it back
|
|
243
268
|
```
|
|
244
269
|
|
|
270
|
+
A workflow is authored in `workflows/<key>.toml` (named config bodies in
|
|
271
|
+
`workflows/<key>.configs/<name>.toml`) and applied with `sync push`:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
primitive config new workflow process-doc
|
|
275
|
+
primitive sync push --only workflow/process-doc
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
`primitive workflows publish <id>` survives for one legacy case only: a
|
|
279
|
+
workflow with no active config, created before the configuration model. The
|
|
280
|
+
server refuses it for every other workflow.
|
|
281
|
+
|
|
245
282
|
**Run management:**
|
|
246
283
|
```bash
|
|
247
284
|
primitive workflows runs list <workflow-id>
|
|
248
285
|
primitive workflows runs status <workflow-id> <run-id>
|
|
249
286
|
```
|
|
250
287
|
|
|
288
|
+
**Workflow TOML push-time validation (issue #685):** `primitive sync push` —
|
|
289
|
+
the only command that sends a workflow TOML since #2645 — runs the
|
|
290
|
+
file through `cli/src/lib/workflow-toml-validator.ts` before sending it to
|
|
291
|
+
the server. For a step whose `kind` the CLI knows about, the validator
|
|
292
|
+
rejects any top-level field outside the allowlist — most commonly catching
|
|
293
|
+
the footgun where `[steps.<id>.request]` is written under `[[steps]]` (TOML
|
|
294
|
+
places the sub-table under `steps[N][<id>]`, not the intended
|
|
295
|
+
`steps[N].request`, so the runtime silently runs the step with an empty
|
|
296
|
+
`request` block). The correct form for the most-recent step is
|
|
297
|
+
`[steps.request]`. For a step whose `kind` the CLI does NOT know (an older
|
|
298
|
+
CLI run against a newer server that registered a new step kind), the
|
|
299
|
+
per-field check is skipped — so a valid new-kind field is never falsely
|
|
300
|
+
rejected — while the kind-agnostic misnested-header footgun detector still
|
|
301
|
+
fires (issue #998).
|
|
302
|
+
|
|
303
|
+
**The allowlist is generated, not hand-maintained (issue #998):** The field
|
|
304
|
+
union and the known-kind set live in the committed artifact
|
|
305
|
+
`cli/src/lib/generated-allowlist.ts`, generated from the server step runners
|
|
306
|
+
(`src/workflows/steps/*.ts`) and the universal `BaseStepDefinition` shape by
|
|
307
|
+
`cli/scripts/gen-allowlist.mjs`. The generator runs automatically at CLI
|
|
308
|
+
`prebuild`; regenerate manually with `node cli/scripts/gen-allowlist.mjs`
|
|
309
|
+
(or `pnpm -C cli gen:allowlist`). The union is derived from what each runner
|
|
310
|
+
*reads* off the step config — not from what the `*StepDefinition` type
|
|
311
|
+
declares (types over-declare and would weaken the footgun detector). A
|
|
312
|
+
freshness guard (`node cli/scripts/gen-allowlist.mjs --check`, also asserted
|
|
313
|
+
by `cli/tests/unit/workflow-toml-validator-drift-guard.test.ts`) fails if the
|
|
314
|
+
committed artifact drifts from a fresh scan, so the historical hand-edit
|
|
315
|
+
drift (#685/#802/#971) cannot recur. When you add a new step kind or a runner
|
|
316
|
+
starts reading a new field, just regenerate and commit the artifact — there is
|
|
317
|
+
no hand-maintained list to update.
|
|
318
|
+
|
|
319
|
+
**A configuration object's field surface has ONE definition (issue #2644):**
|
|
320
|
+
`src/config-surface/` on the server records, per configuration object, which
|
|
321
|
+
`models.yaml` fields exist, which TOML key each carries, which modes the server
|
|
322
|
+
accepts it in, and — for a field with real behavior — the handler that owns it.
|
|
323
|
+
The server's create/update handlers take their accepted key set from it
|
|
324
|
+
(`pickWritableFields`), and `cli/scripts/gen-config-surfaces.mjs` vendors the
|
|
325
|
+
same modules into the committed artifact
|
|
326
|
+
`cli/src/lib/generated-config-surfaces.ts`, which the CLI's push builder, pull
|
|
327
|
+
serializer and TOML key validation read. The generator runs automatically at CLI
|
|
328
|
+
`prebuild`; regenerate manually with `node cli/scripts/gen-config-surfaces.mjs`
|
|
329
|
+
(or `pnpm -C cli gen:config-surfaces`).
|
|
330
|
+
|
|
331
|
+
Three hard-fail checks live in `cli/tests/unit/config-surface-drift-guard.test.ts`:
|
|
332
|
+
freshness (`--check`, a byte comparison), coverage (every model field of every
|
|
333
|
+
registered object is either exposed or classified `notExposed` **with a
|
|
334
|
+
reason**), and registry existence (every `SYNC_RESOURCE_TYPES` label has a
|
|
335
|
+
definition — the migration's `PENDING_MIGRATION` exemption list is gone, so
|
|
336
|
+
there is nowhere to park one). Add a
|
|
337
|
+
field to `models.yaml` and the CLI unit suite fails until you regenerate and
|
|
338
|
+
classify it — so the CLI can no longer silently drop a new server-side field.
|
|
339
|
+
This supersedes the workflow-only descriptor and generator from #2326.
|
|
340
|
+
|
|
341
|
+
**Template expressions are linted at push time (issue #2689):** the validator
|
|
342
|
+
also inspects every `{{ }}` expression on a step and rejects the ones that can
|
|
343
|
+
never resolve — an unknown root (`{{ inputs.userId }}`; the valid roots are
|
|
344
|
+
`input`, `steps`, `outputs`, `meta`, `secrets`, `vars`, plus the contextual
|
|
345
|
+
`selected`/`user`/`md`, the built-ins `now`/`today`/`uuid`/`ulid`, and — inside a
|
|
346
|
+
forEach step's body only — `iteration`/`loop` and the loop's binding name) or a
|
|
347
|
+
reference to a `steps.<id>` / `outputs.<name>` the file does not declare. An
|
|
348
|
+
expression that is only sometimes present is marked optional with
|
|
349
|
+
`| default: ''` or a trailing `|| ''`, and anything statically undecidable (a
|
|
350
|
+
dynamic bracket key) is left to the run-time check. The lint itself is a
|
|
351
|
+
verbatim generated copy of the server module
|
|
352
|
+
`src/workflows/runner/template-static-lint.ts` at
|
|
353
|
+
`cli/src/lib/generated-template-lint.ts` (`cli/scripts/gen-template-lint.mjs`,
|
|
354
|
+
run at `prebuild`, with a `--check` freshness mode asserted by
|
|
355
|
+
`cli/tests/unit/template-lint-drift-guard.test.ts`), so the CLI's push-time
|
|
356
|
+
verdict and the server's save-time verdict come from the same code.
|
|
357
|
+
|
|
358
|
+
|
|
251
359
|
### Tokens
|
|
252
360
|
|
|
253
361
|
Manage long-lived API access tokens for headless/server authentication.
|
|
@@ -263,7 +371,7 @@ primitive tokens revoke <token-id> [app-id] # Revoke t
|
|
|
263
371
|
**Create options:**
|
|
264
372
|
- `--name <name>` - Token name (required)
|
|
265
373
|
- `--user <user-id>` - App user ID to associate the token with (required)
|
|
266
|
-
- `--ttl <duration>` - Token lifetime (e.g., 7d, 30d, 4w,
|
|
374
|
+
- `--ttl <duration>` - Token lifetime (e.g., 30m, 2h, 7d, 30d, 4w, 3mo, 1y). Omit for never-expiring. Units: `m`/`min`=minutes (≤1440), `h`=hours (≤24), `d`=days, `w`=weeks, `mo`=months, `y`=years. **Note:** as of #420 `m` means minutes (was months); use `mo` for months.
|
|
267
375
|
|
|
268
376
|
### Databases
|
|
269
377
|
|
|
@@ -273,6 +381,7 @@ Manage online databases and permissions. `list` returns databases the user has d
|
|
|
273
381
|
primitive databases list [app-id] # List databases (direct access)
|
|
274
382
|
primitive databases create <title> [app-id] # Create database
|
|
275
383
|
primitive databases get <database-id> [app-id] # Get details
|
|
384
|
+
primitive databases update <database-id> [options] # Update title or type
|
|
276
385
|
primitive databases delete <database-id> [app-id] # Delete database
|
|
277
386
|
```
|
|
278
387
|
|
|
@@ -283,18 +392,48 @@ primitive databases permissions grant <database-id> --user-id <uid> --permission
|
|
|
283
392
|
primitive databases permissions revoke <database-id> <user-id> [app-id]
|
|
284
393
|
```
|
|
285
394
|
|
|
286
|
-
|
|
395
|
+
Permission values: `owner` (set at creation), `manager`
|
|
396
|
+
|
|
397
|
+
**Metadata:**
|
|
398
|
+
```bash
|
|
399
|
+
primitive databases metadata update <database-id> --data '{"key":"value"}' # Merge-update metadata
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
**Operations:**
|
|
403
|
+
```bash
|
|
404
|
+
primitive databases operations list <database-id> [app-id] # List registered operations
|
|
405
|
+
primitive databases operations execute <database-id> <op-name> --params '{}' # Execute operation
|
|
406
|
+
primitive databases operations execute <database-id> <op-name> --token <jwt> # Execute as specific user
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
The `--token` flag lets you execute an operation as a specific user using a test JWT from `users mint-jwt`. Useful for testing access rules.
|
|
410
|
+
|
|
411
|
+
Under `--json`, the printed shape is the operation's own. A `query` — and a `pipeline` whose `returnField` names a query step — prints the CLI's list envelope `{ items, hasMore, nextCursor? }`, the same shape as `databases records query --json`. Every other operation type prints unchanged: `count` → `{ count }`, `aggregate` → `{ result }`, mutation → `{ results }`, `applyToQuery` → `{ matched, affected, failed, … }`, and a `returnField = "all"` pipeline → `{ steps: { … } }` with each step's own keys left alone. `--timing` adds `_timing` alongside whichever shape you get.
|
|
412
|
+
|
|
413
|
+
**Records (schema introspection):**
|
|
414
|
+
```bash
|
|
415
|
+
primitive databases records models <database-id> [app-id] # List model names
|
|
416
|
+
primitive databases records describe <database-id> <model> [app-id] # Show inferred schema
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**Indexes:**
|
|
420
|
+
```bash
|
|
421
|
+
primitive databases indexes list <database-id> [--model <name>] # List indexes
|
|
422
|
+
primitive databases indexes create <database-id> <model> <field> [options] # Create index
|
|
423
|
+
primitive databases indexes drop <database-id> <model> <field> # Drop index
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
**Export / Import:**
|
|
287
427
|
```bash
|
|
288
|
-
primitive databases
|
|
289
|
-
primitive databases
|
|
290
|
-
primitive databases group-permissions revoke <database-id> <group-type> <group-id>
|
|
428
|
+
primitive databases export [app-id] <database-id> --output <dir> # Export records, indexes, constraints
|
|
429
|
+
primitive databases import [app-id] <path> --overwrite --dry-run # Import from export directory
|
|
291
430
|
```
|
|
292
431
|
|
|
293
|
-
|
|
432
|
+
Export creates a directory with `metadata.json`, `records.jsonl`, `indexes.json`, and `constraints.json`. Import restores records and indexes into a new or existing database. Database type config (operations, triggers, access rules) is managed separately via `primitive sync` — run `sync push` on the target app before importing.
|
|
294
433
|
|
|
295
434
|
### Documents
|
|
296
435
|
|
|
297
|
-
Manage document ownership
|
|
436
|
+
Manage document ownership, group permissions, and export/import.
|
|
298
437
|
|
|
299
438
|
```bash
|
|
300
439
|
primitive documents transfer-owner [app-id] <document-id> <new-owner-id> # Transfer ownership
|
|
@@ -309,6 +448,15 @@ primitive documents group-permissions revoke <document-id> <group-type> <group-i
|
|
|
309
448
|
|
|
310
449
|
Permission values: `read-write`, `reader`
|
|
311
450
|
|
|
451
|
+
**Export / Import:**
|
|
452
|
+
```bash
|
|
453
|
+
primitive documents export [app-id] <document-id> --output <dir> # Export Yjs state, blobs, permissions, aliases
|
|
454
|
+
primitive documents export-all [app-id] --user-id <id> --owned-only # Export all docs for a user
|
|
455
|
+
primitive documents import [app-id] <path> --overwrite --aliases overwrite|skip --dry-run # Import from export
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Export creates a directory per document with `metadata.json`, `document.yjs` (Yjs state), `permissions.json` (for reference), and `blobs/` (attachments). Permissions are exported for reference but not restored during import — the importing admin is the new owner and manages sharing in the target app. Document IDs are preserved across import. User-scoped aliases can be restored with `--aliases overwrite` (update existing) or `--aliases skip` (keep existing, default).
|
|
459
|
+
|
|
312
460
|
### Groups
|
|
313
461
|
|
|
314
462
|
Manage groups, members, and memberships.
|
|
@@ -336,26 +484,44 @@ primitive groups memberships <user-id> [app-id] # List user's group mem
|
|
|
336
484
|
|
|
337
485
|
**Group resource access:**
|
|
338
486
|
```bash
|
|
339
|
-
primitive groups databases <group-type> <group-id> # List databases a group can access
|
|
340
487
|
primitive groups documents <group-type> <group-id> # List documents a group can access
|
|
341
488
|
```
|
|
342
489
|
|
|
343
|
-
Group permissions on
|
|
490
|
+
Group permissions on documents are managed via `primitive documents group-permissions` (see [Documents](#documents) above).
|
|
344
491
|
|
|
345
492
|
### Analytics
|
|
346
493
|
|
|
347
494
|
View usage analytics for an app.
|
|
348
495
|
|
|
349
496
|
```bash
|
|
350
|
-
|
|
351
|
-
primitive analytics
|
|
352
|
-
primitive analytics
|
|
353
|
-
primitive analytics
|
|
497
|
+
# Overview & active users
|
|
498
|
+
primitive analytics overview [app-id] # DAU / WAU / MAU + growth
|
|
499
|
+
primitive analytics daily-active [app-id] # Daily active users time series
|
|
500
|
+
primitive analytics rolling-active [app-id] # Rolling active users (28 points)
|
|
501
|
+
primitive analytics cohort-retention [app-id] # Weekly cohort retention matrix
|
|
502
|
+
|
|
503
|
+
# Users
|
|
504
|
+
primitive analytics top-users [app-id] # Most active users
|
|
505
|
+
primitive analytics user-search [app-id] --query <q> # Search by email or ULID
|
|
506
|
+
primitive analytics user-detail <user-ulid> [app-id] # User activity breakdown
|
|
507
|
+
primitive analytics user-snapshot <user-ulid> [app-id] # Latest context snapshot
|
|
508
|
+
|
|
509
|
+
# Events
|
|
510
|
+
primitive analytics events [app-id] # Paginated event feed
|
|
511
|
+
primitive analytics events-grouped [app-id] # Events grouped by dimension
|
|
512
|
+
|
|
513
|
+
# Features
|
|
514
|
+
primitive analytics integrations [app-id] # Integration usage metrics
|
|
515
|
+
primitive analytics workflows [app-id] # Top workflows by runs
|
|
516
|
+
primitive analytics prompts [app-id] # Top prompts by executions
|
|
354
517
|
```
|
|
355
518
|
|
|
356
|
-
**
|
|
357
|
-
- `--window-days <n>` - Time window (default
|
|
358
|
-
- `--limit <n>` - Result limit
|
|
519
|
+
**Common options:**
|
|
520
|
+
- `--window-days <n>` - Time window in days (default varies per command)
|
|
521
|
+
- `--limit <n>` - Result limit (top-users, workflows, prompts)
|
|
522
|
+
- `--group-by <dim>` - Dimension for events-grouped (action, feature, route, country, deviceType, plan, day)
|
|
523
|
+
- `--page <n>` - Page number for events feed (0-based)
|
|
524
|
+
- `--json` - Output raw JSON
|
|
359
525
|
|
|
360
526
|
### Admins (Super-Admin Only)
|
|
361
527
|
|
|
@@ -437,6 +603,9 @@ baseUrl = "https://myapp.com"
|
|
|
437
603
|
googleOAuthEnabled = true
|
|
438
604
|
passkeyEnabled = true
|
|
439
605
|
magicLinkEnabled = false
|
|
606
|
+
otpEnabled = true # email one-time-passcode sign-in
|
|
607
|
+
appleSignInEnabled = true # Sign in with Apple
|
|
608
|
+
appleAudiences = ["com.example.MyApp"] # allowed Apple audiences
|
|
440
609
|
|
|
441
610
|
[cors]
|
|
442
611
|
mode = "custom"
|
|
@@ -444,6 +613,19 @@ allowedOrigins = ["https://myapp.com"]
|
|
|
444
613
|
allowCredentials = true
|
|
445
614
|
```
|
|
446
615
|
|
|
616
|
+
Notes on `[auth]`:
|
|
617
|
+
|
|
618
|
+
- Only keys you actually list are pushed. Omitting a key leaves the server's
|
|
619
|
+
current value untouched — it is **not** reset to `false`. To turn a method
|
|
620
|
+
off, set it explicitly (e.g. `magicLinkEnabled = false`).
|
|
621
|
+
- An unrecognized `[auth]` key (for example a typo like `googleOauthEnabled`)
|
|
622
|
+
produces a warning on `push` and is ignored, rather than being silently
|
|
623
|
+
dropped. The push still applies the recognized keys.
|
|
624
|
+
- `appleAudiences = []` and an omitted `appleAudiences` both mean "no
|
|
625
|
+
audiences" (the server stores them the same way), so `pull` omits the key
|
|
626
|
+
when there are no audiences. A `[] ` round-trip reading back as an omitted
|
|
627
|
+
key is expected, not data loss.
|
|
628
|
+
|
|
447
629
|
### Example: integrations/weather-api.toml
|
|
448
630
|
|
|
449
631
|
```toml
|
|
@@ -500,6 +682,133 @@ primitive apps list
|
|
|
500
682
|
primitive apps list --json | jq '.[0].appId'
|
|
501
683
|
```
|
|
502
684
|
|
|
685
|
+
### Stdout vs. stderr
|
|
686
|
+
|
|
687
|
+
The CLI follows the same convention as `git`, `kubectl`, `aws`, and `gh`:
|
|
688
|
+
|
|
689
|
+
- **stdout** carries the *data* the command produced — JSON documents under
|
|
690
|
+
`--json`, tabular listings (`apps list`), raw values (`primitive token`),
|
|
691
|
+
and the primary `label: value` fields a `get` / `show` / `describe` command
|
|
692
|
+
emits (e.g. `primitive integrations get <id>`).
|
|
693
|
+
- **stderr** carries *diagnostics* — status text (`✓ Created…`,
|
|
694
|
+
`i Waiting for completion...`), warnings (`!` markers), progress lines, and
|
|
695
|
+
the `key: value` summaries shown *after* a side-effecting command runs
|
|
696
|
+
(e.g. the `Webhook ID: …` confirmation printed by `webhooks create`).
|
|
697
|
+
|
|
698
|
+
This means `primitive <cmd> --json | jq` always works, regardless of any
|
|
699
|
+
status / warning / progress text the command may print along the way.
|
|
700
|
+
It also means `primitive integrations get <id> > out.txt` writes the
|
|
701
|
+
integration's fields to `out.txt` while the status diagnostics still appear
|
|
702
|
+
on the terminal via stderr.
|
|
703
|
+
|
|
704
|
+
Conversely, redirecting stderr (`primitive <cmd> 2>/dev/null`) silences
|
|
705
|
+
diagnostics — including success checkmarks like `✓ Pushed 3 changes` — so
|
|
706
|
+
prefer `2>&1 >file.txt` if you want the full transcript.
|
|
707
|
+
|
|
708
|
+
For contributors writing new commands, the output helpers in
|
|
709
|
+
`cli/src/lib/output.ts` make the data-vs-diagnostic split explicit: use
|
|
710
|
+
`json()` and `result(label, value)` for data the caller asked for, and
|
|
711
|
+
`success()` / `info()` / `warn()` / `keyValue()` / `divider()` / `heading()`
|
|
712
|
+
for diagnostics about what the command did.
|
|
713
|
+
|
|
714
|
+
## Programmatic surfaces
|
|
715
|
+
|
|
716
|
+
### `primitive help --json` — command manifest
|
|
717
|
+
|
|
718
|
+
`primitive help --json` prints a machine-readable manifest of the full command
|
|
719
|
+
tree (commands, subcommands, positional args, options, aliases, global options,
|
|
720
|
+
and the CLI version) to **stdout** as a single JSON document, then exits `0`. It
|
|
721
|
+
is hidden/undocumented in human `--help` output, auth-free, and runs entirely
|
|
722
|
+
offline (no project config, no credentials, no network) — so it works in any
|
|
723
|
+
directory, including one with no `.primitive/`.
|
|
724
|
+
|
|
725
|
+
```bash
|
|
726
|
+
primitive help --json | jq '.commands[] | select(.name=="sync") | .commands[].name'
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
Shape (`schemaVersion: 1`):
|
|
730
|
+
|
|
731
|
+
```jsonc
|
|
732
|
+
{
|
|
733
|
+
"schemaVersion": 1,
|
|
734
|
+
"name": "primitive",
|
|
735
|
+
"version": "1.0.49",
|
|
736
|
+
"globalOptions": [ { "flags": "-e, --env <name>", "description": "…", "required": true, "defaultValue": null, "hidden": false } ],
|
|
737
|
+
"commands": [
|
|
738
|
+
{
|
|
739
|
+
"name": "sync",
|
|
740
|
+
"description": "…",
|
|
741
|
+
"aliases": [],
|
|
742
|
+
"args": [],
|
|
743
|
+
"options": [],
|
|
744
|
+
"commands": [
|
|
745
|
+
{
|
|
746
|
+
"name": "push",
|
|
747
|
+
"description": "…",
|
|
748
|
+
"aliases": [],
|
|
749
|
+
"args": [ { "name": "app-id", "required": false, "variadic": false, "description": "…" } ],
|
|
750
|
+
"options": [ { "flags": "--dir <path>", "description": "…", "required": true, "defaultValue": null, "hidden": false } ],
|
|
751
|
+
"commands": []
|
|
752
|
+
}
|
|
753
|
+
]
|
|
754
|
+
}
|
|
755
|
+
]
|
|
756
|
+
}
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
`hidden` marks a deprecated alias that still works but is not part of the
|
|
760
|
+
supported surface (it is omitted from human `--help` too). Tooling that treats
|
|
761
|
+
the manifest as an allowlist — the docs CLI gate does — should skip those flags.
|
|
762
|
+
|
|
763
|
+
`schemaVersion` is the contract knob: consumers assert the shape they understand
|
|
764
|
+
and fail loud if a future CLI bumps it (a breaking change for downstream tooling
|
|
765
|
+
such as docs CI that drift-gates documented invocations against the published
|
|
766
|
+
CLI).
|
|
767
|
+
|
|
768
|
+
### `primitive-admin/validators` — TOML validators
|
|
769
|
+
|
|
770
|
+
The TOML validators that `sync push` runs as its load-bearing gate are exported
|
|
771
|
+
from the `primitive-admin/validators` subpath (ESM-only, with types) so external
|
|
772
|
+
tooling can validate exactly the way the published CLI does — instead of
|
|
773
|
+
re-implementing the flow and silently drifting.
|
|
774
|
+
|
|
775
|
+
```ts
|
|
776
|
+
import {
|
|
777
|
+
validateWorkflowTomlSource, // source-level wrapper (parse → expand → validate)
|
|
778
|
+
validateWorkflowToml, // raw: pure fn over already-parsed TOML
|
|
779
|
+
formatWorkflowTomlErrors,
|
|
780
|
+
validateOperations, // raw: pure fn over already-parsed operations[]
|
|
781
|
+
formatIssue,
|
|
782
|
+
} from "primitive-admin/validators";
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
Two contracts:
|
|
786
|
+
|
|
787
|
+
- **`validateWorkflowTomlSource(raw, filePath)`** — pass the **raw TOML source
|
|
788
|
+
string** and the workflow's path. It runs the *identical* parse →
|
|
789
|
+
`expandWorkflowTomlData()` (`include` fragment expansion) → `validateWorkflowToml`
|
|
790
|
+
→ `formatWorkflowTomlErrors` path that `sync push` runs, so it cannot diverge
|
|
791
|
+
from `sync push` on workflow `include` fragments. Returns
|
|
792
|
+
`{ errors, formatted }` (`formatted` is `null` when valid). Fragment files
|
|
793
|
+
resolve relative to `<filePath>/../../workflow-fragments/`, matching the CLI.
|
|
794
|
+
|
|
795
|
+
- **The raw validators** (`validateWorkflowToml`, `validateOperations`,
|
|
796
|
+
`formatWorkflowTomlErrors`, `formatIssue`) are **pure functions over
|
|
797
|
+
already-parsed TOML** — they do *not* read files or parse TOML. The consumer
|
|
798
|
+
parses (e.g. with `smol-toml`) and, for workflows, performs any `include`
|
|
799
|
+
expansion itself. There is **no coupling on a specific TOML parser version**:
|
|
800
|
+
pass whatever parsed object / `operations[]` you already have.
|
|
801
|
+
|
|
802
|
+
```ts
|
|
803
|
+
import * as TOML from "smol-toml";
|
|
804
|
+
const data = TOML.parse(raw);
|
|
805
|
+
const errs = validateWorkflowToml(data);
|
|
806
|
+
if (errs.length) throw new Error(formatWorkflowTomlErrors(path, errs));
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
Internal helpers (`collectParamRefs`, `declaredParamNames`,
|
|
810
|
+
`locateOperationLine`) are intentionally **not** exported.
|
|
811
|
+
|
|
503
812
|
## Exit Codes
|
|
504
813
|
|
|
505
814
|
- `0` - Success
|
|
@@ -508,12 +817,20 @@ primitive apps list --json | jq '.[0].appId'
|
|
|
508
817
|
|
|
509
818
|
## Environment Variables
|
|
510
819
|
|
|
511
|
-
- `PRIMITIVE_SERVER_URL` - Server URL for login (defaults to `https://primitiveapi.com`)
|
|
820
|
+
- `PRIMITIVE_SERVER_URL` - Server URL for login in legacy mode (defaults to `https://primitiveapi.com`)
|
|
821
|
+
|
|
822
|
+
**Login server resolution:**
|
|
823
|
+
1. Project mode (`.primitive/config.json` present): the active environment's
|
|
824
|
+
`apiUrl`. Select the environment with `-e <name>`, `PRIMITIVE_ENV`, or
|
|
825
|
+
`defaultEnvironment`. An unresolvable environment fails loudly — `login`
|
|
826
|
+
never silently falls back to production.
|
|
827
|
+
2. Legacy mode (no project config): `PRIMITIVE_SERVER_URL`, else the default
|
|
828
|
+
`https://primitiveapi.com`.
|
|
512
829
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
830
|
+
> `login` no longer accepts `-s/--server` (removed in a breaking change). Use
|
|
831
|
+
> `-e <env>` in a project, or `PRIMITIVE_SERVER_URL` for local dev / scripts.
|
|
832
|
+
> `init` and `bootstrap` keep their own `-s/--server` (they run before a
|
|
833
|
+
> project config exists).
|
|
517
834
|
|
|
518
835
|
## Development
|
|
519
836
|
|
|
@@ -570,12 +887,13 @@ cli/tests/
|
|
|
570
887
|
config.test.ts # Credentials and config management
|
|
571
888
|
output.test.ts # Output formatting functions
|
|
572
889
|
integration/
|
|
573
|
-
api-client.test.ts
|
|
574
|
-
commands.test.ts
|
|
575
|
-
tokens.test.ts
|
|
576
|
-
databases.test.ts
|
|
577
|
-
documents.test.ts
|
|
578
|
-
groups.test.ts
|
|
890
|
+
api-client.test.ts # API client HTTP tests
|
|
891
|
+
commands.test.ts # CLI command tests
|
|
892
|
+
tokens.test.ts # Token lifecycle tests
|
|
893
|
+
databases.test.ts # Database CRUD, permissions, group permissions tests
|
|
894
|
+
documents.test.ts # Document group permissions, group resource listing tests
|
|
895
|
+
groups.test.ts # Group CRUD, members, memberships tests
|
|
896
|
+
classroom-e2e.test.ts # End-to-end classroom app workflow (types, rules, operations, access)
|
|
579
897
|
```
|
|
580
898
|
|
|
581
899
|
## Troubleshooting
|