primitive-admin 1.1.0-alpha.63 → 1.1.0-alpha.65
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/assets/skill/skills/primitive-platform/SKILL.md +75 -12
- package/dist/bin/primitive.js +2 -0
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/analytics.js +5 -15
- package/dist/src/commands/analytics.js.map +1 -1
- package/dist/src/commands/config.js +11 -4
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/cron-triggers.js +25 -28
- package/dist/src/commands/cron-triggers.js.map +1 -1
- package/dist/src/commands/database-types.js +13 -313
- package/dist/src/commands/database-types.js.map +1 -1
- package/dist/src/commands/feature-flags.d.ts +14 -0
- package/dist/src/commands/feature-flags.js +116 -0
- package/dist/src/commands/feature-flags.js.map +1 -0
- package/dist/src/commands/integrations.js +55 -2
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.js +9 -6
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/prompts.js +58 -3
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.d.ts +1 -1
- package/dist/src/commands/rule-sets.js +1 -0
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/settings.d.ts +12 -9
- package/dist/src/commands/settings.js +31 -79
- package/dist/src/commands/settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +69 -12
- package/dist/src/commands/sync.js +497 -114
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/users.js +92 -1
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/webhooks.js +59 -2
- package/dist/src/commands/webhooks.js.map +1 -1
- package/dist/src/commands/workflows.js +18 -19
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +51 -4
- package/dist/src/lib/api-client.js +71 -7
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/config-object-descriptor.js +6 -14
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +2 -1
- package/dist/src/lib/config-surface.js +5 -1
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +33 -0
- package/dist/src/lib/generated-config-surfaces.js +240 -55
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- 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/log-inspection.d.ts +2 -2
- package/dist/src/lib/log-inspection.js +3 -3
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/object-status-filter.d.ts +22 -0
- package/dist/src/lib/object-status-filter.js +45 -0
- package/dist/src/lib/object-status-filter.js.map +1 -0
- package/dist/src/lib/swift-codegen/generator.d.ts +11 -2
- package/dist/src/lib/swift-codegen/generator.js +175 -2
- package/dist/src/lib/swift-codegen/generator.js.map +1 -1
- package/dist/src/lib/sync-resource-types.js +13 -2
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/workflow-codegen/generator.js +3 -3
- package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
- package/dist/src/lib/workflow-codegen/invokerIR.d.ts +11 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js +5 -0
- package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -1
- package/dist/src/lib/workflow-defaults.d.ts +1 -2
- package/dist/src/lib/workflow-defaults.js +3 -3
- package/dist/src/lib/workflow-defaults.js.map +1 -1
- 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-payload.js +0 -6
- package/dist/src/lib/workflow-payload.js.map +1 -1
- package/dist/src/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,102 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `primitive settings` — the app-settings
|
|
2
|
+
* `primitive settings` — the app-settings READER (issue #1033, Phase 2;
|
|
3
|
+
* narrowed to a reader by #2645).
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* redacted).
|
|
5
|
+
* App settings are authored in `app.toml` and applied with `sync push`, so
|
|
6
|
+
* this group carries the one thing the file cannot answer: what the server is
|
|
7
|
+
* actually running. `settings get` renders the server-effective settings —
|
|
8
|
+
* `get` rather than `show`, so the read verb is the same word on every
|
|
9
|
+
* configuration surface.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* `settings pull`, `settings diff` and `settings push` are gone. They operated
|
|
12
|
+
* on the same `app.toml` and the same `entities.app` hash `sync` owns, so they
|
|
13
|
+
* were a second pathway to one piece of state; `sync pull|diff|push --only app`
|
|
14
|
+
* is the single one. The remaining command logic lives in
|
|
15
|
+
* `sync-app-settings.ts`, shared with `sync`.
|
|
13
16
|
*/
|
|
14
17
|
import { ApiClient } from "../lib/api-client.js";
|
|
15
18
|
import { resolveAppId } from "../lib/config.js";
|
|
16
|
-
import {
|
|
17
|
-
import { info, warn } from "../lib/output.js";
|
|
18
|
-
import { showAppSettings, pullAppSettings, pushAppSettings, diffAppSettings, } from "./sync-app-settings.js";
|
|
19
|
-
/**
|
|
20
|
-
* Resolve the sync directory and print the per-environment hint the way `sync`
|
|
21
|
-
* does (suppressed under `--json` so stdout stays pure JSON).
|
|
22
|
-
*/
|
|
23
|
-
function resolveConfigDir(appId, options) {
|
|
24
|
-
const configDir = resolveSyncDir({ appId, userDir: options.dir });
|
|
25
|
-
if (isAutoResolvedSyncDir(options.dir) && !options.json) {
|
|
26
|
-
info(`Using per-environment sync directory: ${configDir}`);
|
|
27
|
-
const legacyHint = checkLegacySyncMigration(configDir);
|
|
28
|
-
if (legacyHint)
|
|
29
|
-
warn(legacyHint);
|
|
30
|
-
}
|
|
31
|
-
return configDir;
|
|
32
|
-
}
|
|
19
|
+
import { showAppSettings } from "./sync-app-settings.js";
|
|
33
20
|
export function registerSettingsCommands(program) {
|
|
34
21
|
const settings = program
|
|
35
22
|
.command("settings")
|
|
36
|
-
.description("View
|
|
23
|
+
.description("View the app settings the server is running")
|
|
37
24
|
.addHelpText("after", `
|
|
38
25
|
Examples:
|
|
39
|
-
$ primitive settings
|
|
40
|
-
$ primitive settings
|
|
41
|
-
$ primitive
|
|
42
|
-
$ primitive
|
|
43
|
-
$ primitive
|
|
26
|
+
$ primitive settings get # Render current server settings
|
|
27
|
+
$ primitive settings get --json # Machine-readable
|
|
28
|
+
$ primitive sync pull --only app # Write server settings to app.toml
|
|
29
|
+
$ primitive config set app app.baseUrl=https://example.com
|
|
30
|
+
$ primitive sync diff --only app # Show local app.toml vs server
|
|
31
|
+
$ primitive sync push --only app # Apply app.toml edits to the server
|
|
44
32
|
|
|
45
|
-
app.toml is the
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
app.toml is the ONLY way to manage app configuration (issue #2645): a full
|
|
34
|
+
\`sync push\` applies it, and \`sync push --only app\` applies it alone.
|
|
35
|
+
\`primitive config fields app\` lists its keys, types and defaults. The Google OAuth
|
|
36
|
+
client secret is an ordinary [auth] key holding a reference into the app's
|
|
37
|
+
secret store, never the secret itself: store the value with
|
|
38
|
+
'primitive secrets set GOOGLE_CLIENT_SECRET --value <secret>', then set
|
|
39
|
+
googleClientSecret = "{{secrets.GOOGLE_CLIENT_SECRET}}" in app.toml. A literal
|
|
40
|
+
secret there is rejected by the server.
|
|
48
41
|
`);
|
|
49
|
-
// settings
|
|
42
|
+
// settings get
|
|
50
43
|
settings
|
|
51
|
-
.command("
|
|
44
|
+
.command("get")
|
|
52
45
|
.description("Show the current server-effective app settings")
|
|
53
46
|
.argument("[app-id]", "App ID (uses current app if not specified)")
|
|
54
47
|
.option("--app <app-id>", "App ID")
|
|
55
|
-
.option("--json", "Output as JSON (googleClientSecret redacted)")
|
|
56
|
-
.action(async (appId, options) => {
|
|
57
|
-
const resolvedAppId = resolveAppId(appId, options);
|
|
58
|
-
await showAppSettings(new ApiClient(), resolvedAppId, options);
|
|
59
|
-
});
|
|
60
|
-
// settings pull
|
|
61
|
-
settings
|
|
62
|
-
.command("pull")
|
|
63
|
-
.description("Write the current server settings to app.toml")
|
|
64
|
-
.argument("[app-id]", "App ID (uses current app if not specified)")
|
|
65
|
-
.option("--app <app-id>", "App ID")
|
|
66
|
-
.option("--dir <path>", "Config directory (overrides the auto-resolved per-env path)")
|
|
67
48
|
.option("--json", "Output as JSON")
|
|
68
49
|
.action(async (appId, options) => {
|
|
69
50
|
const resolvedAppId = resolveAppId(appId, options);
|
|
70
|
-
|
|
71
|
-
await pullAppSettings(new ApiClient(), resolvedAppId, configDir, options);
|
|
72
|
-
});
|
|
73
|
-
// settings diff
|
|
74
|
-
settings
|
|
75
|
-
.command("diff")
|
|
76
|
-
.description("Show per-field differences between app.toml and the server")
|
|
77
|
-
.argument("[app-id]", "App ID (uses current app if not specified)")
|
|
78
|
-
.option("--app <app-id>", "App ID")
|
|
79
|
-
.option("--dir <path>", "Config directory (overrides the auto-resolved per-env path)")
|
|
80
|
-
.option("--json", "Output as JSON")
|
|
81
|
-
.action(async (appId, options) => {
|
|
82
|
-
const resolvedAppId = resolveAppId(appId, options);
|
|
83
|
-
const configDir = resolveConfigDir(resolvedAppId, options);
|
|
84
|
-
await diffAppSettings(new ApiClient(), resolvedAppId, configDir, options);
|
|
85
|
-
});
|
|
86
|
-
// settings push
|
|
87
|
-
settings
|
|
88
|
-
.command("push")
|
|
89
|
-
.description("Apply app.toml settings to the server")
|
|
90
|
-
.argument("[app-id]", "App ID (uses current app if not specified)")
|
|
91
|
-
.option("--app <app-id>", "App ID")
|
|
92
|
-
.option("--dir <path>", "Config directory (overrides the auto-resolved per-env path)")
|
|
93
|
-
.option("--force", "Push even if app.toml is unchanged since the last sync")
|
|
94
|
-
.option("--dry-run", "Show what would be changed without applying")
|
|
95
|
-
.option("--json", "Output as JSON")
|
|
96
|
-
.action(async (appId, options) => {
|
|
97
|
-
const resolvedAppId = resolveAppId(appId, options);
|
|
98
|
-
const configDir = resolveConfigDir(resolvedAppId, options);
|
|
99
|
-
await pushAppSettings(new ApiClient(), resolvedAppId, configDir, options);
|
|
51
|
+
await showAppSettings(new ApiClient(), resolvedAppId, options);
|
|
100
52
|
});
|
|
101
53
|
}
|
|
102
54
|
//# sourceMappingURL=settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/commands/settings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/commands/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,QAAQ,GAAG,OAAO;SACrB,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,6CAA6C,CAAC;SAC1D,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;CAiBL,CACI,CAAC;IAEJ,eAAe;IACf,QAAQ;SACL,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,gDAAgD,CAAC;SAC7D,QAAQ,CAAC,UAAU,EAAE,4CAA4C,CAAC;SAClE,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CAAC;SAClC,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QAC/B,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,eAAe,CAAC,IAAI,SAAS,EAAE,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -84,15 +84,15 @@ export declare function resolveActiveWorkflowConfig(workflow: any, configs: any[
|
|
|
84
84
|
* server's accepted-value canonicalization
|
|
85
85
|
* (`src/workflows/config/workflow-field-handlers.ts`). A value the server
|
|
86
86
|
* would REJECT is left alone: push fails loudly for those, so there is
|
|
87
|
-
* nothing to preview. #2743 — without this, `
|
|
87
|
+
* nothing to preview. #2743 — without this, `dequeueOrder = "LIFO"` or
|
|
88
88
|
* `perUserMaxRunning = 4.9` pushes fine and then reports Modified forever.
|
|
89
89
|
* 4. Fill the model defaults (`WORKFLOW_MODEL_DEFAULTS`) for what the file
|
|
90
90
|
* omits. `perAppMax*` / `queueTtlSeconds` joined that list in #1177: once
|
|
91
91
|
* the pull serializer emitted them (a GET always returns them, they carry
|
|
92
92
|
* a non-null model default), an unchanged workflow hashed unequal to a
|
|
93
93
|
* local TOML that omits them — a false `modified` that made `config pull`
|
|
94
|
-
* rewrite the file just to inject defaults. `status`
|
|
95
|
-
*
|
|
94
|
+
* rewrite the file just to inject defaults. (`status` was on this list
|
|
95
|
+
* until #2803 took availability off the config wire entirely.)
|
|
96
96
|
* 5. Fill `activeConfigName` with the name the server itself creates
|
|
97
97
|
* (`default`), so a hand-authored file that never named a config compares
|
|
98
98
|
* equal to the workflow that pushing it produces (#2743). This is the
|
|
@@ -482,23 +482,70 @@ export declare function workflowActiveConfigNameUnresolvable(configDir: string,
|
|
|
482
482
|
* repeats forever because no push changes it. But the repo does not describe
|
|
483
483
|
* which configuration is live, and only `config pull` records it, so the fact is
|
|
484
484
|
* carried as a hint on the Synced row — the same way an operational disable is
|
|
485
|
-
* (`
|
|
485
|
+
* (`outOfServiceHint`). The server-created `default` is the shape a
|
|
486
486
|
* hand-authored file already means, so it is silent.
|
|
487
487
|
*
|
|
488
488
|
* Pure and non-throwing, like every other diff predicate. Returns the existing
|
|
489
489
|
* hint untouched when there is nothing to add.
|
|
490
490
|
*/
|
|
491
491
|
export declare function unmanagedActiveConfigHint(localParsed: any, workflow: any, configs: any[], existingHint?: string): string | undefined;
|
|
492
|
+
/**
|
|
493
|
+
* Drop the archived rows from a pull listing (#2803).
|
|
494
|
+
*
|
|
495
|
+
* A tombstone is retired, not configuration. Exporting one wrote a file the
|
|
496
|
+
* repo then claimed to describe — and, once `status` left the TOML surface, a
|
|
497
|
+
* file whose very next push would fail on the `status` line it carried.
|
|
498
|
+
* `config push --prune` is the path that reclaims an archived row; pull's job
|
|
499
|
+
* is to describe what is configured.
|
|
500
|
+
*/
|
|
501
|
+
export declare function skipArchivedForPull<T extends {
|
|
502
|
+
status?: unknown;
|
|
503
|
+
}>(items: T[]): T[];
|
|
504
|
+
/**
|
|
505
|
+
* The sync-state entries a pull keeps for the archived rows it did NOT export
|
|
506
|
+
* (#2803).
|
|
507
|
+
*
|
|
508
|
+
* Pull removes a tombstone's file, and prune candidates come only from prior
|
|
509
|
+
* sync state — so dropping the state entry with the file would strand the row:
|
|
510
|
+
* no file to delete, no managed key to prune, and (for webhooks and cron
|
|
511
|
+
* triggers) a cap slot and a reserved key nothing could ever reclaim, which is
|
|
512
|
+
* the exact failure #2232 fixed. So the pull records the tombstone instead: no
|
|
513
|
+
* file, but a managed entry carrying the archived row's CURRENT `modifiedAt`,
|
|
514
|
+
* so the next opt-in, confirmed `config push --prune` point-reads it, finds it
|
|
515
|
+
* unchanged, and hard-deletes it — the reclamation path the model promises.
|
|
516
|
+
*
|
|
517
|
+
* Only keys the config tree already managed are recorded. A row archived
|
|
518
|
+
* server-side that this repo never described is not this repo's to delete.
|
|
519
|
+
*
|
|
520
|
+
* Pure, so it is unit-testable without a live server.
|
|
521
|
+
*/
|
|
522
|
+
export declare function archivedTombstoneEntries(items: any[], select: {
|
|
523
|
+
keyOf: (item: any) => string;
|
|
524
|
+
idOf: (item: any) => string;
|
|
525
|
+
}, managedKeys: Iterable<string>): Record<string, {
|
|
526
|
+
id: string;
|
|
527
|
+
modifiedAt: string;
|
|
528
|
+
}>;
|
|
492
529
|
/**
|
|
493
530
|
* The `config diff` annotation for an object an operator took out of service
|
|
494
|
-
* (issue #2645, criterion 9).
|
|
531
|
+
* (issue #2645, criterion 9; #2803).
|
|
532
|
+
*
|
|
533
|
+
* Availability is deliberately not a TOML key, so an object that is out of
|
|
534
|
+
* service is NOT drift — the committed configuration still describes it
|
|
535
|
+
* exactly. Saying so out loud is the point: the reason the control exists is
|
|
536
|
+
* that an out-of-band write used to make `config diff` report a difference
|
|
537
|
+
* nobody intentionally created (#1976). Reporting it as a hint on an
|
|
538
|
+
* otherwise-`Synced` row is what keeps that promise visible instead of merely
|
|
539
|
+
* true.
|
|
495
540
|
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
541
|
+
* Reads either spelling: the canonical `status: "inactive"` for a type that has
|
|
542
|
+
* cut over to #2803's single control, and the superseded
|
|
543
|
+
* `operationallyDisabled` boolean for one that has not yet.
|
|
544
|
+
*
|
|
545
|
+
* An ARCHIVED row gets its own annotation. `config pull` no longer exports
|
|
546
|
+
* tombstones, so without one an archived webhook or integration whose file is
|
|
547
|
+
* still in the tree read as plain `Synced` — the one status where "the server
|
|
548
|
+
* has exactly what the file says" is most misleading.
|
|
502
549
|
*
|
|
503
550
|
* When the row already carries a hint — a real content difference — the toggle
|
|
504
551
|
* is APPENDED rather than substituted: the drift is the part that needs acting
|
|
@@ -506,7 +553,7 @@ export declare function unmanagedActiveConfigHint(localParsed: any, workflow: an
|
|
|
506
553
|
*
|
|
507
554
|
* Pure, so it is unit-testable without a live server.
|
|
508
555
|
*/
|
|
509
|
-
export declare function
|
|
556
|
+
export declare function outOfServiceHint(remote: any, existingHint?: string): string | undefined;
|
|
510
557
|
/**
|
|
511
558
|
* Serialize an integration DETAIL response to its `integrations/<key>.toml`.
|
|
512
559
|
*
|
|
@@ -694,6 +741,16 @@ export declare function rewriteWorkflowSchemasToNative(rawToml: string, workflow
|
|
|
694
741
|
content: string;
|
|
695
742
|
changed: boolean;
|
|
696
743
|
};
|
|
744
|
+
/**
|
|
745
|
+
* #2644 — `config push` rejects any key the vendored definition does not
|
|
746
|
+
* recognize, so a mistyped or newer-server key fails locally instead of being
|
|
747
|
+
* silently dropped on the way to the server (design gate, 2026-08-12). Returns
|
|
748
|
+
* the error message, or null when every key is known.
|
|
749
|
+
*
|
|
750
|
+
* Works for any migrated type, single or repeated: a repeated table's entries
|
|
751
|
+
* are checked one by one and the unknown keys reported together, so a typo in
|
|
752
|
+
* the third `[[configs]]` block is as loud as one in the first.
|
|
753
|
+
*/
|
|
697
754
|
export declare function configUnknownKeyError(filePath: string, tomlData: any, table: ConfigTable): string | null;
|
|
698
755
|
/**
|
|
699
756
|
* #2644 — the document-level half of the same rejection: a top-level table the
|