primitive-admin 1.1.0-alpha.64 → 1.1.0-alpha.66

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.
Files changed (90) hide show
  1. package/README.md +4 -4
  2. package/assets/skill/skills/primitive-platform/SKILL.md +83 -13
  3. package/dist/bin/primitive.js +6 -3
  4. package/dist/bin/primitive.js.map +1 -1
  5. package/dist/src/commands/apps.js +14 -5
  6. package/dist/src/commands/apps.js.map +1 -1
  7. package/dist/src/commands/config.js +11 -4
  8. package/dist/src/commands/config.js.map +1 -1
  9. package/dist/src/commands/cron-triggers.js +25 -28
  10. package/dist/src/commands/cron-triggers.js.map +1 -1
  11. package/dist/src/commands/env.d.ts +12 -1
  12. package/dist/src/commands/env.js +96 -21
  13. package/dist/src/commands/env.js.map +1 -1
  14. package/dist/src/commands/feature-flags.d.ts +14 -0
  15. package/dist/src/commands/feature-flags.js +116 -0
  16. package/dist/src/commands/feature-flags.js.map +1 -0
  17. package/dist/src/commands/init.d.ts +1 -1
  18. package/dist/src/commands/init.js +78 -25
  19. package/dist/src/commands/init.js.map +1 -1
  20. package/dist/src/commands/integrations.js +55 -2
  21. package/dist/src/commands/integrations.js.map +1 -1
  22. package/dist/src/commands/prompts.js +58 -3
  23. package/dist/src/commands/prompts.js.map +1 -1
  24. package/dist/src/commands/rule-sets.d.ts +1 -1
  25. package/dist/src/commands/rule-sets.js +1 -0
  26. package/dist/src/commands/rule-sets.js.map +1 -1
  27. package/dist/src/commands/sync-app-settings.d.ts +83 -55
  28. package/dist/src/commands/sync-app-settings.js +131 -200
  29. package/dist/src/commands/sync-app-settings.js.map +1 -1
  30. package/dist/src/commands/sync.d.ts +309 -40
  31. package/dist/src/commands/sync.js +2493 -397
  32. package/dist/src/commands/sync.js.map +1 -1
  33. package/dist/src/commands/users.js +92 -1
  34. package/dist/src/commands/users.js.map +1 -1
  35. package/dist/src/commands/webhooks.js +59 -2
  36. package/dist/src/commands/webhooks.js.map +1 -1
  37. package/dist/src/commands/workflows.js +32 -22
  38. package/dist/src/commands/workflows.js.map +1 -1
  39. package/dist/src/lib/api-client.d.ts +51 -4
  40. package/dist/src/lib/api-client.js +71 -7
  41. package/dist/src/lib/api-client.js.map +1 -1
  42. package/dist/src/lib/app-settings-descriptor.d.ts +143 -15
  43. package/dist/src/lib/app-settings-descriptor.js +315 -28
  44. package/dist/src/lib/app-settings-descriptor.js.map +1 -1
  45. package/dist/src/lib/config-object-descriptor.js +6 -14
  46. package/dist/src/lib/config-object-descriptor.js.map +1 -1
  47. package/dist/src/lib/config-payload.js +14 -3
  48. package/dist/src/lib/config-payload.js.map +1 -1
  49. package/dist/src/lib/config-surface.d.ts +38 -1
  50. package/dist/src/lib/config-surface.js +123 -1
  51. package/dist/src/lib/config-surface.js.map +1 -1
  52. package/dist/src/lib/env-resolver-core.d.ts +147 -0
  53. package/dist/src/lib/env-resolver-core.js +265 -0
  54. package/dist/src/lib/env-resolver-core.js.map +1 -0
  55. package/dist/src/lib/env-resolver.d.ts +28 -6
  56. package/dist/src/lib/env-resolver.js +44 -32
  57. package/dist/src/lib/env-resolver.js.map +1 -1
  58. package/dist/src/lib/generated-config-surfaces.d.ts +66 -0
  59. package/dist/src/lib/generated-config-surfaces.js +391 -104
  60. package/dist/src/lib/generated-config-surfaces.js.map +1 -1
  61. package/dist/src/lib/integration-request-config.d.ts +30 -0
  62. package/dist/src/lib/integration-request-config.js +145 -0
  63. package/dist/src/lib/integration-request-config.js.map +1 -0
  64. package/dist/src/lib/local-state.d.ts +55 -0
  65. package/dist/src/lib/local-state.js +167 -0
  66. package/dist/src/lib/local-state.js.map +1 -0
  67. package/dist/src/lib/log-inspection.d.ts +2 -2
  68. package/dist/src/lib/log-inspection.js +3 -3
  69. package/dist/src/lib/log-inspection.js.map +1 -1
  70. package/dist/src/lib/object-status-filter.d.ts +22 -0
  71. package/dist/src/lib/object-status-filter.js +45 -0
  72. package/dist/src/lib/object-status-filter.js.map +1 -0
  73. package/dist/src/lib/server-text-normalization.d.ts +51 -0
  74. package/dist/src/lib/server-text-normalization.js +90 -0
  75. package/dist/src/lib/server-text-normalization.js.map +1 -0
  76. package/dist/src/lib/swift-codegen/generator.js +2 -4
  77. package/dist/src/lib/swift-codegen/generator.js.map +1 -1
  78. package/dist/src/lib/sync-resource-types.d.ts +8 -0
  79. package/dist/src/lib/sync-resource-types.js +21 -2
  80. package/dist/src/lib/sync-resource-types.js.map +1 -1
  81. package/dist/src/lib/template.d.ts +27 -0
  82. package/dist/src/lib/template.js +46 -20
  83. package/dist/src/lib/template.js.map +1 -1
  84. package/dist/src/lib/workflow-defaults.d.ts +1 -2
  85. package/dist/src/lib/workflow-defaults.js +3 -3
  86. package/dist/src/lib/workflow-defaults.js.map +1 -1
  87. package/dist/src/lib/workflow-payload.js +0 -6
  88. package/dist/src/lib/workflow-payload.js.map +1 -1
  89. package/dist/src/types/index.d.ts +32 -7
  90. package/package.json +2 -2
@@ -1,19 +1,29 @@
1
1
  /**
2
- * Environment resolution.
2
+ * Environment resolution (CLI side).
3
3
  *
4
- * Decides which named environment the CLI is currently targeting. The
5
- * resolution order is:
4
+ * The algorithm itself lives in `env-resolver-core.ts` — the one copy the Vite
5
+ * plugin and the Swift pre-build script also run (#2873). This module is the
6
+ * CLI's thin wrapper around it: process-lifetime caching, the `--env` override
7
+ * commander sets, and — load-bearing — the CLI's own FULL field-level
8
+ * validation via `validateProjectConfig()`. The core carries only the version
9
+ * and structural checks the other readers need; running the CLI's validation
10
+ * first is what keeps `getProjectConfig()` and `getCurrentEnvironment()` from
11
+ * ever disagreeing about the same file.
12
+ *
13
+ * The resolution order is:
6
14
  *
7
15
  * 1. Explicit --env <name> flag (set via setCurrentEnvName from bin/primitive.ts)
8
16
  * 2. PRIMITIVE_ENV environment variable
9
- * 3. The project config's defaultEnvironment
10
- * 4. If the project has exactly one environment, that one
11
- * 5. null (legacy mode — fall back to ~/.primitive/credentials.json)
17
+ * 3. The per-machine selection in .primitive/local.json (`primitive env use`)
18
+ * 4. The project config's committed defaultEnvironment
19
+ * 5. If the project has exactly one environment, that one
20
+ * 6. null (legacy mode — fall back to ~/.primitive/credentials.json)
12
21
  *
13
22
  * Commands read the resolved environment once via getCurrentEnvironment().
14
23
  * The resolution is cached for the lifetime of the process.
15
24
  */
16
25
  import { type ProjectConfig, type ProjectEnvironment } from "./project-config.js";
26
+ import { PrimitiveEnvError, type PrimitiveEnvSource } from "./env-resolver-core.js";
17
27
  export interface ResolvedEnvironment {
18
28
  /** The environment name (e.g. "dev", "prod"). */
19
29
  name: string;
@@ -23,6 +33,8 @@ export interface ResolvedEnvironment {
23
33
  projectConfigPath: string;
24
34
  /** Absolute path to the project root (the parent of .primitive/). */
25
35
  projectRoot: string;
36
+ /** Which precedence step chose this environment. */
37
+ source: PrimitiveEnvSource;
26
38
  }
27
39
  /**
28
40
  * Called by bin/primitive.ts when the user passes --env <name> on the command
@@ -40,6 +52,15 @@ export declare function resetEnvResolver(): void;
40
52
  * .primitive/config.json is present. Throws ProjectConfigError on a broken config.
41
53
  */
42
54
  export declare function getProjectConfig(): ProjectConfig | null;
55
+ /**
56
+ * Reads this machine's environment selection (`primitive env use`), or null
57
+ * when nothing is selected. Throws PrimitiveEnvError on corrupt local state —
58
+ * `env list` / `env show` surface that distinctly instead of quietly falling
59
+ * back to the committed default.
60
+ */
61
+ export declare function getLocalSelection(): string | null;
62
+ /** Absolute path of the local-state file for the current project, if any. */
63
+ export declare function getLocalStatePath(): string | null;
43
64
  /**
44
65
  * Resolves the current environment, or returns null if we're running in
45
66
  * legacy mode (no .primitive/config.json present).
@@ -60,3 +81,4 @@ export declare function getCurrentEnvNameSafe(): string | null;
60
81
  * need to know whether the user passed --env vs. relying on defaults.
61
82
  */
62
83
  export declare function getExplicitEnvName(): string | null;
84
+ export { PrimitiveEnvError };
@@ -1,19 +1,29 @@
1
1
  /**
2
- * Environment resolution.
2
+ * Environment resolution (CLI side).
3
3
  *
4
- * Decides which named environment the CLI is currently targeting. The
5
- * resolution order is:
4
+ * The algorithm itself lives in `env-resolver-core.ts` — the one copy the Vite
5
+ * plugin and the Swift pre-build script also run (#2873). This module is the
6
+ * CLI's thin wrapper around it: process-lifetime caching, the `--env` override
7
+ * commander sets, and — load-bearing — the CLI's own FULL field-level
8
+ * validation via `validateProjectConfig()`. The core carries only the version
9
+ * and structural checks the other readers need; running the CLI's validation
10
+ * first is what keeps `getProjectConfig()` and `getCurrentEnvironment()` from
11
+ * ever disagreeing about the same file.
12
+ *
13
+ * The resolution order is:
6
14
  *
7
15
  * 1. Explicit --env <name> flag (set via setCurrentEnvName from bin/primitive.ts)
8
16
  * 2. PRIMITIVE_ENV environment variable
9
- * 3. The project config's defaultEnvironment
10
- * 4. If the project has exactly one environment, that one
11
- * 5. null (legacy mode — fall back to ~/.primitive/credentials.json)
17
+ * 3. The per-machine selection in .primitive/local.json (`primitive env use`)
18
+ * 4. The project config's committed defaultEnvironment
19
+ * 5. If the project has exactly one environment, that one
20
+ * 6. null (legacy mode — fall back to ~/.primitive/credentials.json)
12
21
  *
13
22
  * Commands read the resolved environment once via getCurrentEnvironment().
14
23
  * The resolution is cached for the lifetime of the process.
15
24
  */
16
- import { loadProjectConfig, findProjectConfigPath, findProjectRoot, PROJECT_CONFIG_DISPLAY_NAME, } from "./project-config.js";
25
+ import { loadProjectConfig, findProjectConfigPath, findProjectRoot, } from "./project-config.js";
26
+ import { PrimitiveEnvError, localStatePathForConfigPath, readLocalSelection, selectEnvironmentName, } from "./env-resolver-core.js";
17
27
  /** Process-lifetime cache for resolution results. */
18
28
  let cachedResolution;
19
29
  let explicitEnvName = null;
@@ -47,6 +57,23 @@ export function getProjectConfig() {
47
57
  }
48
58
  return cachedProjectConfig ?? null;
49
59
  }
60
+ /**
61
+ * Reads this machine's environment selection (`primitive env use`), or null
62
+ * when nothing is selected. Throws PrimitiveEnvError on corrupt local state —
63
+ * `env list` / `env show` surface that distinctly instead of quietly falling
64
+ * back to the committed default.
65
+ */
66
+ export function getLocalSelection() {
67
+ const configPath = findProjectConfigPath();
68
+ if (!configPath)
69
+ return null;
70
+ return readLocalSelection(configPath);
71
+ }
72
+ /** Absolute path of the local-state file for the current project, if any. */
73
+ export function getLocalStatePath() {
74
+ const configPath = findProjectConfigPath();
75
+ return configPath ? localStatePathForConfigPath(configPath) : null;
76
+ }
50
77
  /**
51
78
  * Resolves the current environment, or returns null if we're running in
52
79
  * legacy mode (no .primitive/config.json present).
@@ -58,6 +85,8 @@ export function getProjectConfig() {
58
85
  export function getCurrentEnvironment() {
59
86
  if (cachedResolution !== undefined)
60
87
  return cachedResolution;
88
+ // Validate through the CLI's own loader first: the core's checks are a
89
+ // subset, and a config the CLI rejects must never resolve here.
61
90
  const project = getProjectConfig();
62
91
  if (!project) {
63
92
  cachedResolution = null;
@@ -65,36 +94,18 @@ export function getCurrentEnvironment() {
65
94
  }
66
95
  const configPath = findProjectConfigPath();
67
96
  const projectRoot = findProjectRoot();
68
- // Determine the environment name.
69
- const requested = explicitEnvName ??
70
- process.env.PRIMITIVE_ENV ??
71
- project.defaultEnvironment ??
72
- null;
73
- let name;
74
- if (requested) {
75
- if (!project.environments[requested]) {
76
- const available = Object.keys(project.environments).join(", ") || "(none)";
77
- throw new Error(`Environment "${requested}" is not defined in ${PROJECT_CONFIG_DISPLAY_NAME}. Available: ${available}`);
78
- }
79
- name = requested;
80
- }
81
- else {
82
- const names = Object.keys(project.environments);
83
- if (names.length === 1) {
84
- name = names[0];
85
- }
86
- else if (names.length === 0) {
87
- throw new Error(`${PROJECT_CONFIG_DISPLAY_NAME} has no environments defined. Run 'primitive env add <name>' or 'primitive init'.`);
88
- }
89
- else {
90
- throw new Error(`No environment selected. Set "defaultEnvironment" in ${PROJECT_CONFIG_DISPLAY_NAME}, pass --env <name>, or export PRIMITIVE_ENV. Available: ${names.join(", ")}`);
91
- }
92
- }
97
+ const { name, source } = selectEnvironmentName(project, {
98
+ explicitEnvName,
99
+ envVarName: process.env.PRIMITIVE_ENV || null,
100
+ localSelection: readLocalSelection(configPath),
101
+ configPath,
102
+ });
93
103
  cachedResolution = {
94
104
  name,
95
105
  config: project.environments[name],
96
106
  projectConfigPath: configPath,
97
107
  projectRoot,
108
+ source,
98
109
  };
99
110
  return cachedResolution;
100
111
  }
@@ -118,4 +129,5 @@ export function getCurrentEnvNameSafe() {
118
129
  export function getExplicitEnvName() {
119
130
  return explicitEnvName;
120
131
  }
132
+ export { PrimitiveEnvError };
121
133
  //# sourceMappingURL=env-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"env-resolver.js","sourceRoot":"","sources":["../../../src/lib/env-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,2BAA2B,GAG5B,MAAM,qBAAqB,CAAC;AAa7B,qDAAqD;AACrD,IAAI,gBAAwD,CAAC;AAC7D,IAAI,eAAe,GAAkB,IAAI,CAAC;AAC1C,IAAI,mBAAqD,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAmB;IACnD,eAAe,GAAG,IAAI,CAAC;IACvB,uEAAuE;IACvE,6BAA6B;IAC7B,gBAAgB,GAAG,SAAS,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,gBAAgB,GAAG,SAAS,CAAC;IAC7B,mBAAmB,GAAG,SAAS,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,mBAAmB,GAAG,iBAAiB,EAAE,CAAC;IAC5C,CAAC;IACD,OAAO,mBAAmB,IAAI,IAAI,CAAC;AACrC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB;IACnC,IAAI,gBAAgB,KAAK,SAAS;QAAE,OAAO,gBAAgB,CAAC;IAE5D,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IAC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I,CAAC;QACH,OAAO,qBAAqB,EAAE,EAAE,IAAI,IAAI,IAAI,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -114,6 +114,39 @@ export interface ConfigField {
114
114
  validation: "passthrough" | {
115
115
  handler: string;
116
116
  };
117
+ /**
118
+ * This field's declared type genuinely admits more than one TOML spelling
119
+ * (#2880 criterion 5).
120
+ *
121
+ * The declared type is the contract: a quoted number for a declared number
122
+ * is a validation error `config diff` and `config push` report identically,
123
+ * and neither coerces. A handful of fields are genuinely dual-encoded
124
+ * anyway — `temperature` and `topP` are `StringField`s the server stores as
125
+ * strings and returns parsed (#2869), so `"0.2"` and `0.2` describe one
126
+ * value — and for those the two spellings must compare EQUAL, or diff
127
+ * reports a `Modified` no push can clear.
128
+ *
129
+ * Recorded here rather than inferred from the type, so the carve-out is a
130
+ * decision with a reason attached instead of a rule that quietly widens to
131
+ * every number in the surface.
132
+ */
133
+ dualEncoded?: {
134
+ note: string;
135
+ };
136
+ /**
137
+ * The value the SERVER materializes when a create omits this key (#2880
138
+ * DSO-002).
139
+ *
140
+ * A hand-authored file that omits an optional field the server defaults —
141
+ * an integration's `timeoutMs`, a cron trigger's `timezone` — creates fine
142
+ * and then reads `Modified` forever: the server holds the default, the file
143
+ * holds nothing, and push's payload builder drops the absent key so the
144
+ * difference can never converge. Recording the default here lets the LOCAL
145
+ * side of the comparison apply the same value the server did.
146
+ *
147
+ * Only for a default the server assigns on CREATE and returns on read.
148
+ */
149
+ serverDefault?: string | number | boolean;
117
150
  }
118
151
  export interface ConfigTable {
119
152
  /** TOML path, e.g. ["workflow"] for [workflow], ["configs"] for [[configs]]. */
@@ -494,6 +527,12 @@ export declare function requestSchemaKeys(table: ConfigTable, mode: "create" | "
494
527
  * is no place to write one.
495
528
  */
496
529
  export declare function configRequestSchema(table: ConfigTable, mode: "create" | "update"): ConfigRequestSchema;
530
+ /**
531
+ * The retired-key guidance for a generated schema, keyed by body key — or
532
+ * `undefined` when the schema's object has none. Consumed by the app API's
533
+ * request validator (`src/app-api/request-validation.ts`).
534
+ */
535
+ export declare function retiredRequestKeys(schema: object | undefined): Readonly<Record<string, string>> | undefined;
497
536
  /**
498
537
  * One schema for an endpoint whose body spans MORE than one table.
499
538
  *
@@ -512,6 +551,33 @@ export declare function mergeRequestSchemas(...schemas: readonly ConfigRequestSc
512
551
  export declare function unknownRequestKeys(body: unknown, table: ConfigTable, mode: "create" | "update"): string[];
513
552
  /** The 400 message naming the unknown key(s), shared by both APIs. */
514
553
  export declare function unknownRequestKeysMessage(keys: readonly string[]): string;
554
+ /**
555
+ * Keys deliberately RETIRED from a configuration object's write surface.
556
+ *
557
+ * A retired key is not an unknown key. The generic hint for an unrecognized
558
+ * TOML key — "check the spelling, or upgrade the CLI" — is exactly backwards
559
+ * for one this CLI removed on purpose, and the generic 400 for an unaccepted
560
+ * request key says only that the key is not allowed, not where the value moved
561
+ * to. Both surfaces need the same sentence, and neither should invent it.
562
+ *
563
+ * So the guidance lives here, next to the definitions, with one entry per
564
+ * retired key: the TOML wording for `config push` (which can tell the author to
565
+ * delete a line) and the request wording for the API handlers (which cannot).
566
+ *
567
+ * Keyed by the table's TOML path prefix (`workflow`, `cronTrigger`, …), because
568
+ * that is the identifier both consumers already have in hand.
569
+ *
570
+ * Pure: no models, no tenant context, no `env` (see `types.ts` §Purity).
571
+ */
572
+ export interface RetiredConfigKey {
573
+ /** What `config push` says about a file that still carries the key. */
574
+ toml: string;
575
+ /** What a create/update handler says about a body that still sends it. */
576
+ request: string;
577
+ }
578
+ export declare const RETIRED_CONFIG_KEYS: Record<string, Record<string, RetiredConfigKey>>;
579
+ /** The retired-key entry for `key` under `prefix`, or null when it is simply unknown. */
580
+ export declare function retiredConfigKey(prefix: string, key: string): RetiredConfigKey | null;
515
581
  export declare const WORKFLOW_SURFACE: ConfigObjectSurface;
516
582
  export declare const PROMPT_SURFACE: ConfigObjectSurface;
517
583
  export declare const INTEGRATION_SURFACE: ConfigObjectSurface;