primitive-admin 1.0.63 → 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 +12 -5
- 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 +2 -1
- 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 +89 -43
- 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 +12 -15
- package/dist/src/commands/init.js +44 -92
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.js +35 -12
- 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.js +33 -28
- 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 +390 -13
- package/dist/src/commands/sync.js +2613 -451
- 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 +89 -18
- package/dist/src/lib/env-resolver-core.js +145 -23
- 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-config.d.ts +1 -1
- package/dist/src/lib/init-ios-links.d.ts +6 -5
- package/dist/src/lib/init-ios-links.js +9 -8
- 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/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 +1 -1
- package/dist/src/lib/local-test-cases.js +2 -1
- package/dist/src/lib/local-test-cases.js.map +1 -1
- 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 +38 -21
- package/dist/src/lib/project-config.js +57 -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-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/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
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* They read the same `ConfigTable`, so they cannot disagree about which fields
|
|
13
13
|
* exist — which is the whole point.
|
|
14
14
|
*/
|
|
15
|
-
import { isEmptyForEmit, writableFieldNames, } from "./generated-config-surfaces.js";
|
|
15
|
+
import { isEmptyForEmit, tomlGroupsOf, writableFieldNames, } from "./generated-config-surfaces.js";
|
|
16
16
|
/**
|
|
17
17
|
* Project a server record onto its TOML table, using the definition's field
|
|
18
18
|
* list and `emit` semantics.
|
|
@@ -29,8 +29,13 @@ import { isEmptyForEmit, writableFieldNames, } from "./generated-config-surfaces
|
|
|
29
29
|
* empty JSON Schema `{}` is a real, distinct value ("accepts anything"), so a
|
|
30
30
|
* generic "an empty object is unset" would drop it on pull and the next push
|
|
31
31
|
* would clear it server-side.
|
|
32
|
+
*
|
|
33
|
+
* `tomlGroup` (#3798) names the block a field authored under SEVERAL blocks is
|
|
34
|
+
* written into — the prompt's kind, for the model settings chat and agent
|
|
35
|
+
* share. A field declaring one block ignores it; with none named, a
|
|
36
|
+
* multi-block field goes to its first block.
|
|
32
37
|
*/
|
|
33
|
-
export function projectRecordToToml(table, record, values = {}) {
|
|
38
|
+
export function projectRecordToToml(table, record, values = {}, { tomlGroup } = {}) {
|
|
34
39
|
const out = {};
|
|
35
40
|
for (const field of table.fields) {
|
|
36
41
|
const produce = values[field.field];
|
|
@@ -44,6 +49,20 @@ export function projectRecordToToml(table, record, values = {}) {
|
|
|
44
49
|
}
|
|
45
50
|
if (value === undefined)
|
|
46
51
|
continue;
|
|
52
|
+
// #3626 — a grouped field is written inside its sub-table
|
|
53
|
+
// (`[configs.chat].systemPrompt`). The group itself is created lazily, so a
|
|
54
|
+
// group none of whose fields emit is simply absent from the pulled file
|
|
55
|
+
// rather than an empty `[configs.chat]` header the next diff would have to
|
|
56
|
+
// equate with nothing.
|
|
57
|
+
const groups = tomlGroupsOf(field);
|
|
58
|
+
if (groups.length > 0) {
|
|
59
|
+
const name = tomlGroup !== undefined && groups.includes(tomlGroup)
|
|
60
|
+
? tomlGroup
|
|
61
|
+
: groups[0];
|
|
62
|
+
const group = (out[name] ??= {});
|
|
63
|
+
group[field.tomlKey] = value;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
47
66
|
out[field.tomlKey] = value;
|
|
48
67
|
}
|
|
49
68
|
return out;
|
|
@@ -61,15 +80,41 @@ export function projectRecordToToml(table, record, values = {}) {
|
|
|
61
80
|
export function buildPayloadFromToml(table, tomlTable, { mode, values = {} }) {
|
|
62
81
|
const source = tomlTable && typeof tomlTable === "object" ? tomlTable : {};
|
|
63
82
|
const payload = {};
|
|
83
|
+
/**
|
|
84
|
+
* #3626 — where the field is authored. A grouped field is read ONLY from its
|
|
85
|
+
* sub-table: the same key at the table root is not a second spelling, it is
|
|
86
|
+
* an unknown key `acceptedTomlKeys` already refused (SO3626-013). The nine
|
|
87
|
+
* deprecated flat chat keys reach the group through
|
|
88
|
+
* `hoistDeprecatedChatKeys`, which runs before this.
|
|
89
|
+
*
|
|
90
|
+
* #3798 — a field authored under several blocks is read from the first of
|
|
91
|
+
* them the entry carries a value in. An entry carrying two blocks is the kind
|
|
92
|
+
* rule's refusal (`promptKindFileErrors`), decided before any payload is sent.
|
|
93
|
+
*/
|
|
94
|
+
const readAt = (field) => {
|
|
95
|
+
const groups = tomlGroupsOf(field);
|
|
96
|
+
if (groups.length === 0)
|
|
97
|
+
return source[field.tomlKey];
|
|
98
|
+
for (const name of groups) {
|
|
99
|
+
const group = source[name];
|
|
100
|
+
if (group &&
|
|
101
|
+
typeof group === "object" &&
|
|
102
|
+
!Array.isArray(group) &&
|
|
103
|
+
group[field.tomlKey] !== undefined) {
|
|
104
|
+
return group[field.tomlKey];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
};
|
|
64
109
|
for (const field of table.fields) {
|
|
65
110
|
if (!field.writableOn.includes(mode))
|
|
66
111
|
continue;
|
|
67
112
|
const produce = values[field.field];
|
|
68
113
|
if (produce) {
|
|
69
|
-
payload[field.field] = produce(
|
|
114
|
+
payload[field.field] = produce(readAt(field), mode, source);
|
|
70
115
|
continue;
|
|
71
116
|
}
|
|
72
|
-
const value =
|
|
117
|
+
const value = readAt(field);
|
|
73
118
|
// #2880 DSO-002 — the file is the source of truth (#1567), so an absent key
|
|
74
119
|
// means the field's DECLARED default rather than "leave whatever the server
|
|
75
120
|
// has". Sending it is what makes the comparison's reading of that absence
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-payload.js","sourceRoot":"","sources":["../../../src/lib/config-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,cAAc,EACd,kBAAkB,GAGnB,MAAM,gCAAgC,CAAC;AAqBxC
|
|
1
|
+
{"version":3,"file":"config-payload.js","sourceRoot":"","sources":["../../../src/lib/config-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,cAAc,EACd,YAAY,EACZ,kBAAkB,GAGnB,MAAM,gCAAgC,CAAC;AAqBxC;;;;;;;;;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,MAAM,CAAC,MAAM,SAAS,GAAc,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC;AAE7D,+EAA+E;AAC/E,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* trip is therefore loud-and-lossy — push omits what it does not know, so
|
|
16
16
|
* the server keeps its stored values — never silently destructive.
|
|
17
17
|
*/
|
|
18
|
-
import { retiredConfigKey, type ConfigObjectSurface, type ConfigField, type ConfigTable } from "./generated-config-surfaces.js";
|
|
18
|
+
import { findUnknownGroupedTomlKeys, retiredConfigKey, type ConfigObjectSurface, type ConfigField, type ConfigTable } from "./generated-config-surfaces.js";
|
|
19
19
|
export { retiredConfigKey };
|
|
20
|
+
export { findUnknownGroupedTomlKeys };
|
|
20
21
|
/** A surface by label. Throws rather than silently skipping checks. */
|
|
21
22
|
export declare function requireConfigSurface(label: string): ConfigObjectSurface;
|
|
22
23
|
/** A table by label and TOML path. Throws rather than silently skipping checks. */
|
|
@@ -30,6 +31,7 @@ export declare const WEBHOOK_TABLE: ConfigTable;
|
|
|
30
31
|
export declare const CRON_TRIGGER_TABLE: ConfigTable;
|
|
31
32
|
export declare const BLOB_BUCKET_TABLE: ConfigTable;
|
|
32
33
|
export declare const EMAIL_TEMPLATE_TABLE: ConfigTable;
|
|
34
|
+
export declare const SERVER_FUNCTION_TABLE: ConfigTable;
|
|
33
35
|
export declare const DATABASE_TYPE_TABLE: ConfigTable;
|
|
34
36
|
export declare const RULE_SET_TABLE: ConfigTable;
|
|
35
37
|
export declare const GROUP_TYPE_CONFIG_TABLE: ConfigTable;
|
|
@@ -47,6 +49,15 @@ export declare const METADATA_CATEGORY_CONFIG_TABLE: ConfigTable;
|
|
|
47
49
|
export declare const TEST_CASE_TABLE: ConfigTable;
|
|
48
50
|
/** The `test-case` surface itself, for the sidecars' document-shape check. */
|
|
49
51
|
export declare const TEST_CASE_SURFACE: ConfigObjectSurface;
|
|
52
|
+
/**
|
|
53
|
+
* The value a create materializes when the file omits `field`, as the
|
|
54
|
+
* definition records it — or `undefined` when the field has no such default.
|
|
55
|
+
*
|
|
56
|
+
* Read rather than repeated, so a caller that omits a value BECAUSE the server
|
|
57
|
+
* would assign it anyway (#3201's `[[configs]] status`) can never disagree
|
|
58
|
+
* with the default push sends for the same absent key.
|
|
59
|
+
*/
|
|
60
|
+
export declare function fieldServerDefault(table: ConfigTable, field: string): ConfigField["serverDefault"];
|
|
50
61
|
/**
|
|
51
62
|
* Does this field's declared type genuinely admit more than one spelling
|
|
52
63
|
* (#2880 criterion 5)?
|
|
@@ -15,11 +15,15 @@
|
|
|
15
15
|
* trip is therefore loud-and-lossy — push omits what it does not know, so
|
|
16
16
|
* the server keeps its stored values — never silently destructive.
|
|
17
17
|
*/
|
|
18
|
-
import { GENERATED_CONFIG_MODEL_FIELDS, acceptedTomlKeys, retiredConfigKey, findMisshapenTomlTables, findUnknownTomlDocumentKeys, getConfigSurface, getConfigTable, recognizedResponseKeys, } from "./generated-config-surfaces.js";
|
|
18
|
+
import { GENERATED_CONFIG_MODEL_FIELDS, acceptedTomlKeys, findUnknownGroupedTomlKeys, tomlGroupsOf, retiredConfigKey, findMisshapenTomlTables, findUnknownTomlDocumentKeys, getConfigSurface, getConfigTable, recognizedResponseKeys, } from "./generated-config-surfaces.js";
|
|
19
19
|
// #2645/#2803 — the guidance for a key a definition deliberately RETIRED. Its
|
|
20
20
|
// text is vendored with the definitions so `config push` and the server's
|
|
21
21
|
// create/update handlers say the same thing about the same key.
|
|
22
22
|
export { retiredConfigKey };
|
|
23
|
+
// #3626 — keys inside a `[configs.<group>]` block that no field declares
|
|
24
|
+
// under it. Re-exported beside `findUnknownTomlKeys` so a caller checking a
|
|
25
|
+
// table's keys needs one import for both halves of the same question.
|
|
26
|
+
export { findUnknownGroupedTomlKeys };
|
|
23
27
|
/** A surface by label. Throws rather than silently skipping checks. */
|
|
24
28
|
export function requireConfigSurface(label) {
|
|
25
29
|
const surface = getConfigSurface(label);
|
|
@@ -56,6 +60,12 @@ export const BLOB_BUCKET_TABLE = requireConfigTable("blob-bucket", ["bucket"]);
|
|
|
56
60
|
export const EMAIL_TEMPLATE_TABLE = requireConfigTable("email-template", [
|
|
57
61
|
"template",
|
|
58
62
|
]);
|
|
63
|
+
// #3179 — the `[function]` table. One table over the HEADER model; the three
|
|
64
|
+
// version-carried keys (`entry`, `mode`, `limits`) are declared beside `key`
|
|
65
|
+
// in its `tomlOnlyKeys`, because an author writes a function, never a version.
|
|
66
|
+
export const SERVER_FUNCTION_TABLE = requireConfigTable("function", [
|
|
67
|
+
"function",
|
|
68
|
+
]);
|
|
59
69
|
// The five structured objects (#2644 phase 3). Their authored sub-trees —
|
|
60
70
|
// `[rules]`, `[models.*]`, `[triggers]`, the `[metadata]` manifest — keep the
|
|
61
71
|
// validators that already own them; these tables are the scalar surface.
|
|
@@ -78,6 +88,17 @@ export const METADATA_CATEGORY_CONFIG_TABLE = requireConfigTable("metadata-categ
|
|
|
78
88
|
export const TEST_CASE_TABLE = requireConfigTable("test-case", ["test"]);
|
|
79
89
|
/** The `test-case` surface itself, for the sidecars' document-shape check. */
|
|
80
90
|
export const TEST_CASE_SURFACE = requireConfigSurface("test-case");
|
|
91
|
+
/**
|
|
92
|
+
* The value a create materializes when the file omits `field`, as the
|
|
93
|
+
* definition records it — or `undefined` when the field has no such default.
|
|
94
|
+
*
|
|
95
|
+
* Read rather than repeated, so a caller that omits a value BECAUSE the server
|
|
96
|
+
* would assign it anyway (#3201's `[[configs]] status`) can never disagree
|
|
97
|
+
* with the default push sends for the same absent key.
|
|
98
|
+
*/
|
|
99
|
+
export function fieldServerDefault(table, field) {
|
|
100
|
+
return table.fields.find((f) => f.field === field)?.serverDefault;
|
|
101
|
+
}
|
|
81
102
|
/**
|
|
82
103
|
* Does this field's declared type genuinely admit more than one spelling
|
|
83
104
|
* (#2880 criterion 5)?
|
|
@@ -159,6 +180,22 @@ function valueMatchesDeclaredType(field, value) {
|
|
|
159
180
|
return true;
|
|
160
181
|
}
|
|
161
182
|
}
|
|
183
|
+
/** The value as a TOML table, or `undefined` when it is not one. */
|
|
184
|
+
function readTomlTable(value) {
|
|
185
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
186
|
+
? value
|
|
187
|
+
: undefined;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Is `key` a spelling this table still accepts but has superseded (#3626)?
|
|
191
|
+
*
|
|
192
|
+
* The nine flat chat keys are the first: declared in `tomlOnlyKeys` with
|
|
193
|
+
* `kind: "deprecated"` so an unmigrated prompt file keeps pushing, while the
|
|
194
|
+
* field itself is authored inside `[configs.chat]`.
|
|
195
|
+
*/
|
|
196
|
+
function isDeprecatedTomlKey(table, key) {
|
|
197
|
+
return table.tomlOnlyKeys?.[key]?.kind === "deprecated";
|
|
198
|
+
}
|
|
162
199
|
/**
|
|
163
200
|
* Every value in `tomlData` whose spelling does not match the type its field
|
|
164
201
|
* declares (#2880 criterion 5).
|
|
@@ -185,10 +222,41 @@ export function configDeclaredTypeErrors(filePath, tomlData, table) {
|
|
|
185
222
|
if (!entry.value || typeof entry.value !== "object")
|
|
186
223
|
continue;
|
|
187
224
|
for (const field of table.fields) {
|
|
188
|
-
|
|
225
|
+
// #3626 — a grouped field is read at its group path and LABELLED with it
|
|
226
|
+
// (`configs[0].chat.temperature`), so the message names where the value
|
|
227
|
+
// actually is. A group that is not a table has no value to type-check;
|
|
228
|
+
// `findUnknownGroupedTomlKeys` reports that shape.
|
|
229
|
+
//
|
|
230
|
+
// #3798 — a field several blocks share is read in the first of its
|
|
231
|
+
// blocks that holds a value, and labelled with that block, so a
|
|
232
|
+
// mistyped `[configs.agent].temperature` names `agent`.
|
|
233
|
+
const groups = tomlGroupsOf(field);
|
|
234
|
+
const groupName = groups.find((name) => readTomlTable(entry.value[name])?.[field.tomlKey] !== undefined) ?? groups[0];
|
|
235
|
+
let container = readTomlTable(groupName
|
|
236
|
+
? entry.value[groupName]
|
|
237
|
+
: entry.value);
|
|
238
|
+
let label = groupName ? `${entry.label}.${groupName}` : entry.label;
|
|
239
|
+
// #3626, CR3626-003 — a grouped key whose FLAT spelling the table still
|
|
240
|
+
// accepts as DEPRECATED is read where the file actually wrote it. The
|
|
241
|
+
// grouping moved the reader into the sub-table, which silently took the
|
|
242
|
+
// declared-type check away from every unmigrated file: a flat
|
|
243
|
+
// `temperature = "hot"` passed the preflight it used to fail and was
|
|
244
|
+
// hoisted into the payload unread. Accepting the old spelling has to mean
|
|
245
|
+
// accepting it on the same terms, so the root value is checked — and
|
|
246
|
+
// labelled at the root, because that is the line the author has to fix.
|
|
247
|
+
if (groupName &&
|
|
248
|
+
container?.[field.tomlKey] === undefined &&
|
|
249
|
+
isDeprecatedTomlKey(table, field.tomlKey) &&
|
|
250
|
+
entry.value[field.tomlKey] !== undefined) {
|
|
251
|
+
container = entry.value;
|
|
252
|
+
label = entry.label;
|
|
253
|
+
}
|
|
254
|
+
if (!container)
|
|
255
|
+
continue;
|
|
256
|
+
const value = container[field.tomlKey];
|
|
189
257
|
if (valueMatchesDeclaredType(field, value))
|
|
190
258
|
continue;
|
|
191
|
-
errors.push(`${filePath}: ${
|
|
259
|
+
errors.push(`${filePath}: ${label}.${field.tomlKey} — expected a ` +
|
|
192
260
|
`${declaredTypeName(field.type)}, found ${foundSpelling(value)}. ` +
|
|
193
261
|
"The declared type is the contract: `config diff` and `config push` " +
|
|
194
262
|
"both read it this way and neither converts it for you.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-surface.js","sourceRoot":"","sources":["../../../src/lib/config-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,2BAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,sBAAsB,GAIvB,MAAM,gCAAgC,CAAC;AAExC,8EAA8E;AAC9E,0EAA0E;AAC1E,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,OAAO,GAAG,iCAAiC,GAAG,cAAc;YACjE,kBAAkB,CAAC;AAC3B,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,2BAA2B,CACzC,IAAY,EACZ,QAA2B,EAC3B,IAAuB;IAEvB,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,OAAO,CACL,GAAG,IAAI,qBAAqB,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM;QAC9D,IAAI,MAAM,MAAM,KAAK,YAAY,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,MAAM;QACxE,uDAAuD,CACxD,CAAC;AACJ,CAAC"}
|
package/dist/src/lib/config.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ~/.primitive/credentials.json and a handful of helpers here. After the
|
|
6
6
|
* project-config overhaul (issue #373) credentials live per-environment
|
|
7
7
|
* inside `<projectRoot>/.primitive/credentials.json` when a
|
|
8
|
-
*
|
|
8
|
+
* primitive/config.json is in scope, and fall back to the legacy global
|
|
9
9
|
* file otherwise.
|
|
10
10
|
*
|
|
11
11
|
* The rest of the CLI continues to import from this module, so we keep
|
|
@@ -18,15 +18,39 @@ export declare function saveCredentials(credentials: Credentials): void;
|
|
|
18
18
|
export declare function clearCredentials(): void;
|
|
19
19
|
export declare function isTokenExpired(credentials: Credentials): boolean;
|
|
20
20
|
export declare function isTokenExpiringSoon(credentials: Credentials): boolean;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The app this invocation runs against: the resolved environment's, and only
|
|
23
|
+
* ever that (#3152).
|
|
24
|
+
*
|
|
25
|
+
* It never answers "none" (#3154). Outside a project there is no environment,
|
|
26
|
+
* and therefore no app — but there is also no configuration tree, no server
|
|
27
|
+
* and no credentials, so "which app?" is not a question with a quieter answer
|
|
28
|
+
* than the others. `requireCurrentEnvironment()` gives the one refusal, which
|
|
29
|
+
* is what retired the "No app specified" branch and its five local copies.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getCurrentApp(): {
|
|
32
|
+
appId: string;
|
|
33
|
+
appName?: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function getCurrentAppId(): string;
|
|
36
|
+
/**
|
|
37
|
+
* The app a command acts on: an explicit one where the command still takes
|
|
38
|
+
* one (`users`, `apps`, `admins`, the database data verbs), otherwise the
|
|
39
|
+
* environment's.
|
|
40
|
+
*
|
|
41
|
+
* The explicit forms are checked FIRST and short-circuit, so a cross-app read
|
|
42
|
+
* still works with no environment able to name that app — that is the whole
|
|
43
|
+
* reason `--app` survives on those commands (intent §Decisions).
|
|
44
|
+
*/
|
|
24
45
|
export declare function resolveAppId(appId: string | undefined, options: {
|
|
25
46
|
app?: string;
|
|
26
47
|
}): string;
|
|
27
48
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
49
|
+
* The API base URL for the active environment.
|
|
50
|
+
*
|
|
51
|
+
* The credentials-file fallback is gone (#3154): a `serverUrl` left in
|
|
52
|
+
* `~/.primitive/credentials.json` by whatever the last `login` targeted was a
|
|
53
|
+
* second source for the one thing an environment exists to say.
|
|
30
54
|
*/
|
|
31
55
|
export declare function getServerUrl(): string;
|
|
32
56
|
/**
|
|
@@ -39,15 +63,9 @@ export declare function getServerUrl(): string;
|
|
|
39
63
|
* - Project mode → the active environment's `apiUrl` (canonical). Lets
|
|
40
64
|
* getCurrentEnvironment() throw on an unresolvable env (ambiguous/unknown
|
|
41
65
|
* --env) so the caller can fail loudly instead of silently targeting prod.
|
|
42
|
-
* - Legacy mode (no
|
|
66
|
+
* - Legacy mode (no primitive/config.json) → DEFAULT_SERVER_URL, which
|
|
43
67
|
* honors the PRIMITIVE_SERVER_URL escape hatch (constants.ts).
|
|
44
68
|
*
|
|
45
69
|
* The trailing slash is stripped so callers can build `${url}/admin/api/...`.
|
|
46
70
|
*/
|
|
47
71
|
export declare function getConfiguredServerUrl(): string;
|
|
48
|
-
/**
|
|
49
|
-
* Exposed so commands can check whether there's a pre-project-config
|
|
50
|
-
* credentials file at ~/.primitive/credentials.json (used by migration
|
|
51
|
-
* prompts).
|
|
52
|
-
*/
|
|
53
|
-
export declare function legacyCredentialsExist(): boolean;
|
package/dist/src/lib/config.js
CHANGED
|
@@ -5,16 +5,15 @@
|
|
|
5
5
|
* ~/.primitive/credentials.json and a handful of helpers here. After the
|
|
6
6
|
* project-config overhaul (issue #373) credentials live per-environment
|
|
7
7
|
* inside `<projectRoot>/.primitive/credentials.json` when a
|
|
8
|
-
*
|
|
8
|
+
* primitive/config.json is in scope, and fall back to the legacy global
|
|
9
9
|
* file otherwise.
|
|
10
10
|
*
|
|
11
11
|
* The rest of the CLI continues to import from this module, so we keep
|
|
12
12
|
* the original public API (loadCredentials, saveCredentials, etc.) and
|
|
13
13
|
* just delegate to the new stores.
|
|
14
14
|
*/
|
|
15
|
-
import { clearCredentialsStore,
|
|
16
|
-
import { getCurrentEnvironment,
|
|
17
|
-
import { PROJECT_CONFIG_DISPLAY_NAME } from "./project-config.js";
|
|
15
|
+
import { clearCredentialsStore, loadCredentialsStore, saveCredentialsStore, } from "./credentials-store.js";
|
|
16
|
+
import { getCurrentEnvironment, requireCurrentEnvironment, } from "./env-resolver.js";
|
|
18
17
|
import { DEFAULT_SERVER_URL } from "./constants.js";
|
|
19
18
|
export function loadCredentials() {
|
|
20
19
|
return loadCredentialsStore();
|
|
@@ -41,71 +40,44 @@ export function isTokenExpiringSoon(credentials) {
|
|
|
41
40
|
// Consider expiring soon if less than 5 minutes remaining
|
|
42
41
|
return expiresAt - now < 5 * 60 * 1000;
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
/**
|
|
44
|
+
* The app this invocation runs against: the resolved environment's, and only
|
|
45
|
+
* ever that (#3152).
|
|
46
|
+
*
|
|
47
|
+
* It never answers "none" (#3154). Outside a project there is no environment,
|
|
48
|
+
* and therefore no app — but there is also no configuration tree, no server
|
|
49
|
+
* and no credentials, so "which app?" is not a question with a quieter answer
|
|
50
|
+
* than the others. `requireCurrentEnvironment()` gives the one refusal, which
|
|
51
|
+
* is what retired the "No app specified" branch and its five local copies.
|
|
52
|
+
*/
|
|
53
|
+
export function getCurrentApp() {
|
|
54
|
+
const env = requireCurrentEnvironment(); // may throw on an unresolvable env
|
|
55
|
+
return { appId: env.config.appId, appName: env.config.appName };
|
|
49
56
|
}
|
|
50
57
|
export function getCurrentAppId() {
|
|
51
|
-
|
|
52
|
-
// loadCredentialsStore), which is what we want. In legacy mode it comes
|
|
53
|
-
// from the global credentials file.
|
|
54
|
-
const credentials = loadCredentials();
|
|
55
|
-
return credentials?.currentAppId;
|
|
58
|
+
return getCurrentApp().appId;
|
|
56
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* The app a command acts on: an explicit one where the command still takes
|
|
62
|
+
* one (`users`, `apps`, `admins`, the database data verbs), otherwise the
|
|
63
|
+
* environment's.
|
|
64
|
+
*
|
|
65
|
+
* The explicit forms are checked FIRST and short-circuit, so a cross-app read
|
|
66
|
+
* still works with no environment able to name that app — that is the whole
|
|
67
|
+
* reason `--app` survives on those commands (intent §Decisions).
|
|
68
|
+
*/
|
|
57
69
|
export function resolveAppId(appId, options) {
|
|
58
|
-
|
|
59
|
-
if (!resolved) {
|
|
60
|
-
// When the active env declares an `appId` in .primitive/config.json but
|
|
61
|
-
// has no credentials slot, loadCredentialsStore() returns null (its
|
|
62
|
-
// null == unauthenticated contract), so getCurrentAppId() yields nothing
|
|
63
|
-
// even though an appId IS configured. In that case the accurate problem
|
|
64
|
-
// is that the user isn't authenticated for this env — not that no app was
|
|
65
|
-
// specified. (A creds slot would have blended in env.config.appId and made
|
|
66
|
-
// `resolved` truthy, so reaching here with a configured appId can only mean
|
|
67
|
-
// missing credentials.)
|
|
68
|
-
let env = null;
|
|
69
|
-
try {
|
|
70
|
-
env = getCurrentEnvironment();
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
// Env resolution failed (ambiguous/unknown env) — fall back to the
|
|
74
|
-
// original "No app specified." message below.
|
|
75
|
-
}
|
|
76
|
-
if (env && env.config.appId) {
|
|
77
|
-
console.error(`Not logged in to environment "${env.name}". An appId is configured in ${PROJECT_CONFIG_DISPLAY_NAME} but you're not authenticated. Run 'primitive -e ${env.name} login'.`);
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
|
-
const envName = getCurrentEnvNameSafe();
|
|
81
|
-
const hint = envName
|
|
82
|
-
? `(current environment: ${envName}). Set 'appId' in .primitive/config.json, pass --app, or run 'primitive use <app-id>'.`
|
|
83
|
-
: `Use <app-id>, --app, or 'primitive use <app-id>' to set context.`;
|
|
84
|
-
console.error(`No app specified. ${hint}`);
|
|
85
|
-
process.exit(1);
|
|
86
|
-
}
|
|
87
|
-
return resolved;
|
|
70
|
+
return appId || options.app || getCurrentAppId();
|
|
88
71
|
}
|
|
89
72
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
73
|
+
* The API base URL for the active environment.
|
|
74
|
+
*
|
|
75
|
+
* The credentials-file fallback is gone (#3154): a `serverUrl` left in
|
|
76
|
+
* `~/.primitive/credentials.json` by whatever the last `login` targeted was a
|
|
77
|
+
* second source for the one thing an environment exists to say.
|
|
92
78
|
*/
|
|
93
79
|
export function getServerUrl() {
|
|
94
|
-
|
|
95
|
-
// truth for the API URL, even if we haven't logged in yet.
|
|
96
|
-
try {
|
|
97
|
-
const env = getCurrentEnvironment();
|
|
98
|
-
if (env)
|
|
99
|
-
return env.config.apiUrl;
|
|
100
|
-
}
|
|
101
|
-
catch (err) {
|
|
102
|
-
// Env resolution failed — fall through to credentials-based lookup.
|
|
103
|
-
}
|
|
104
|
-
const credentials = loadCredentials();
|
|
105
|
-
if (!credentials?.serverUrl) {
|
|
106
|
-
throw new Error("Not logged in. Run 'primitive login' first.");
|
|
107
|
-
}
|
|
108
|
-
return credentials.serverUrl;
|
|
80
|
+
return requireCurrentEnvironment().config.apiUrl;
|
|
109
81
|
}
|
|
110
82
|
/**
|
|
111
83
|
* Resolves the API base URL to authenticate against, used by `primitive login`
|
|
@@ -117,7 +89,7 @@ export function getServerUrl() {
|
|
|
117
89
|
* - Project mode → the active environment's `apiUrl` (canonical). Lets
|
|
118
90
|
* getCurrentEnvironment() throw on an unresolvable env (ambiguous/unknown
|
|
119
91
|
* --env) so the caller can fail loudly instead of silently targeting prod.
|
|
120
|
-
* - Legacy mode (no
|
|
92
|
+
* - Legacy mode (no primitive/config.json) → DEFAULT_SERVER_URL, which
|
|
121
93
|
* honors the PRIMITIVE_SERVER_URL escape hatch (constants.ts).
|
|
122
94
|
*
|
|
123
95
|
* The trailing slash is stripped so callers can build `${url}/admin/api/...`.
|
|
@@ -126,12 +98,4 @@ export function getConfiguredServerUrl() {
|
|
|
126
98
|
const env = getCurrentEnvironment(); // may throw on an unresolvable env
|
|
127
99
|
return (env ? env.config.apiUrl : DEFAULT_SERVER_URL).replace(/\/$/, "");
|
|
128
100
|
}
|
|
129
|
-
/**
|
|
130
|
-
* Exposed so commands can check whether there's a pre-project-config
|
|
131
|
-
* credentials file at ~/.primitive/credentials.json (used by migration
|
|
132
|
-
* prompts).
|
|
133
|
-
*/
|
|
134
|
-
export function legacyCredentialsExist() {
|
|
135
|
-
return peekLegacyCredentials() !== null;
|
|
136
|
-
}
|
|
137
101
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAC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zC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,GAAG,GAAG,yBAAyB,EAAE,CAAC,CAAC,mCAAmC;IAC5E,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,EAAE,CAAC,KAAK,CAAC;AAC/B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAyB,EACzB,OAAyB;IAEzB,OAAO,KAAK,IAAI,OAAO,CAAC,GAAG,IAAI,eAAe,EAAE,CAAC;AACnD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,yBAAyB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,GAAG,GAAG,qBAAqB,EAAE,CAAC,CAAC,mCAAmC;IACxE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Credentials storage with dual-mode support.
|
|
3
3
|
*
|
|
4
|
+
* Credentials are tokens and who they belong to, and nothing else: the app an
|
|
5
|
+
* invocation runs against is the resolved environment's `appId` (#3152), never
|
|
6
|
+
* a slot in this file.
|
|
7
|
+
*
|
|
4
8
|
* Mode A (project mode): credentials live at
|
|
5
9
|
* <projectRoot>/.primitive/credentials.json
|
|
6
10
|
* with per-environment slots:
|
|
@@ -11,30 +15,58 @@
|
|
|
11
15
|
* }
|
|
12
16
|
* }
|
|
13
17
|
*
|
|
14
|
-
* Mode B (
|
|
18
|
+
* Mode B (global mode): no primitive/config.json in scope, so we fall back to
|
|
15
19
|
* ~/.primitive/credentials.json
|
|
16
20
|
* with the flat Credentials shape the CLI has always used.
|
|
17
21
|
*
|
|
18
|
-
*
|
|
19
|
-
* run
|
|
22
|
+
* Mode B is NOT a default any more (#3154, intent criterion 5). It used to be
|
|
23
|
+
* the silent answer for every command run outside a project, which is how an
|
|
24
|
+
* app-scoped command could quietly operate against whatever server the last
|
|
25
|
+
* `login` happened to target. Now a command has to say out loud that it may
|
|
26
|
+
* work outside a project, by calling `allowGlobalCredentials()` in its own
|
|
27
|
+
* action; every other command gets `missing-config` here instead of a file.
|
|
28
|
+
*
|
|
29
|
+
* Exactly four commands say it: `login`, which creates the file; `logout`,
|
|
30
|
+
* which is the only way to clear what login wrote; `init`, which must call the
|
|
31
|
+
* API before a project can exist; and `bootstrap`, which creates the first
|
|
32
|
+
* super-admin on an empty no-OAuth database and therefore cannot be inside a
|
|
33
|
+
* project either. The last two are the divergence from the intent's "login and
|
|
34
|
+
* init and nothing else", adjudicated on #3154 as finding F1.
|
|
35
|
+
*
|
|
36
|
+
* The opt-in is per ACTION, not per argv: `primitive --env prod login` and
|
|
37
|
+
* `primitive login` reach the same line, so there is no flag shape for a
|
|
38
|
+
* pre-parse to miss. And it only PERMITS the global file — inside a project
|
|
39
|
+
* all four still use the per-environment slots.
|
|
20
40
|
*/
|
|
21
41
|
import type { Credentials } from "../types/index.js";
|
|
22
42
|
export declare const PROJECT_LOCAL_DIR = ".primitive";
|
|
23
43
|
export declare const PROJECT_CREDENTIALS_FILENAME = "credentials.json";
|
|
24
|
-
/** Returns true when a
|
|
44
|
+
/** Returns true when a primitive/config.json is in scope (project mode active). */
|
|
25
45
|
export declare function isProjectMode(): boolean;
|
|
26
46
|
/**
|
|
27
47
|
* Returns the path to the credentials file that will be used, based on
|
|
28
48
|
* whether we're in project mode or legacy mode.
|
|
29
49
|
*/
|
|
30
50
|
export declare function getCredentialsFilePath(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Declare that THIS command may fall back to `~/.primitive/credentials.json`
|
|
53
|
+
* when no project is in scope. Called at the top of `login`, `logout`, `init`
|
|
54
|
+
* and `bootstrap`, and nowhere else.
|
|
55
|
+
*/
|
|
56
|
+
export declare function allowGlobalCredentials(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Drop the declaration again. One invocation runs one command, so nothing in
|
|
59
|
+
* the CLI calls this — it exists so a test file can exercise both sides of the
|
|
60
|
+
* boundary in one process, the way `resetEnvResolver()` does for the resolver.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resetGlobalCredentialsAllowance(): void;
|
|
31
63
|
/**
|
|
32
64
|
* Reads credentials for the current environment (project mode) or the
|
|
33
65
|
* legacy global file. Returns the standard Credentials shape so existing
|
|
34
66
|
* callers don't need to change.
|
|
35
67
|
*
|
|
36
68
|
* In project mode, we blend the per-env stored creds with the serverUrl
|
|
37
|
-
* and appId from
|
|
69
|
+
* and appId from primitive/config.json to produce the Credentials the rest of
|
|
38
70
|
* the CLI expects.
|
|
39
71
|
*/
|
|
40
72
|
export declare function loadCredentialsStore(): Credentials | null;
|
|
@@ -63,9 +95,6 @@ export declare function clearCredentialsForEnvInProject(projectRoot: string, env
|
|
|
63
95
|
* project's credentials file. Used by `primitive init` to carry the session
|
|
64
96
|
* it just authenticated into the freshly scaffolded project, so the first
|
|
65
97
|
* in-project CLI command works without a second `primitive login`.
|
|
66
|
-
*
|
|
67
|
-
* Does not persist currentAppId/Name — the project's .primitive/config.json
|
|
68
|
-
* is the source of truth for those (same rule as saveCredentialsStore).
|
|
69
98
|
*/
|
|
70
99
|
export declare function seedCredentialsForEnvInProject(projectRoot: string, envName: string, credentials: Credentials): void;
|
|
71
100
|
/**
|
|
@@ -73,17 +102,3 @@ export declare function seedCredentialsForEnvInProject(projectRoot: string, envN
|
|
|
73
102
|
* Returns an empty array in legacy mode.
|
|
74
103
|
*/
|
|
75
104
|
export declare function listAuthenticatedEnvironments(): string[];
|
|
76
|
-
/**
|
|
77
|
-
* Updates the "current app" in credential storage. In project mode with a
|
|
78
|
-
* project-level appId this is a no-op (the project config is canonical).
|
|
79
|
-
*/
|
|
80
|
-
export declare function setCurrentAppStore(appId: string, appName?: string): void;
|
|
81
|
-
/**
|
|
82
|
-
* Clears the "current app" for the current environment.
|
|
83
|
-
*/
|
|
84
|
-
export declare function clearCurrentAppStore(): void;
|
|
85
|
-
/**
|
|
86
|
-
* Returns the legacy credentials file, if one exists. Used by migration
|
|
87
|
-
* prompts that want to detect a pre-project-config install.
|
|
88
|
-
*/
|
|
89
|
-
export declare function peekLegacyCredentials(): Credentials | null;
|