lua-cli 3.9.1 → 3.9.2

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 (81) hide show
  1. package/README.md +2 -90
  2. package/dist/cli/command-definitions.js +14 -14
  3. package/dist/cli/command-definitions.js.map +1 -1
  4. package/dist/commands/agents.d.ts.map +1 -1
  5. package/dist/commands/agents.js +11 -2
  6. package/dist/commands/agents.js.map +1 -1
  7. package/dist/commands/apiKey.d.ts +21 -1
  8. package/dist/commands/apiKey.d.ts.map +1 -1
  9. package/dist/commands/apiKey.js +25 -7
  10. package/dist/commands/apiKey.js.map +1 -1
  11. package/dist/commands/compile.d.ts.map +1 -1
  12. package/dist/commands/compile.js +3 -11
  13. package/dist/commands/compile.js.map +1 -1
  14. package/dist/commands/configure.d.ts +2 -2
  15. package/dist/commands/configure.js +2 -2
  16. package/dist/commands/destroy.d.ts +24 -0
  17. package/dist/commands/destroy.d.ts.map +1 -1
  18. package/dist/commands/destroy.js +30 -8
  19. package/dist/commands/destroy.js.map +1 -1
  20. package/dist/commands/init.d.ts.map +1 -1
  21. package/dist/commands/init.js +29 -0
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/commands/jobs.js +9 -29
  24. package/dist/commands/jobs.js.map +1 -1
  25. package/dist/commands/sync.d.ts.map +1 -1
  26. package/dist/commands/sync.js +191 -13
  27. package/dist/commands/sync.js.map +1 -1
  28. package/dist/config/constants.d.ts +11 -7
  29. package/dist/config/constants.d.ts.map +1 -1
  30. package/dist/config/constants.js +11 -7
  31. package/dist/config/constants.js.map +1 -1
  32. package/dist/index.js +0 -0
  33. package/dist/primitives/mcp-server.handler.d.ts +16 -5
  34. package/dist/primitives/mcp-server.handler.d.ts.map +1 -1
  35. package/dist/primitives/mcp-server.handler.js +75 -1
  36. package/dist/primitives/mcp-server.handler.js.map +1 -1
  37. package/dist/services/analytics.d.ts.map +1 -1
  38. package/dist/services/analytics.js +2 -6
  39. package/dist/services/analytics.js.map +1 -1
  40. package/dist/services/auth.d.ts +26 -16
  41. package/dist/services/auth.d.ts.map +1 -1
  42. package/dist/services/auth.js +101 -45
  43. package/dist/services/auth.js.map +1 -1
  44. package/dist/utils/auth-flows.d.ts.map +1 -1
  45. package/dist/utils/auth-flows.js +12 -8
  46. package/dist/utils/auth-flows.js.map +1 -1
  47. package/dist/utils/backup-helpers.d.ts +27 -0
  48. package/dist/utils/backup-helpers.d.ts.map +1 -1
  49. package/dist/utils/backup-helpers.js +62 -0
  50. package/dist/utils/backup-helpers.js.map +1 -1
  51. package/dist/utils/cli.d.ts.map +1 -1
  52. package/dist/utils/cli.js +3 -2
  53. package/dist/utils/cli.js.map +1 -1
  54. package/dist/utils/command-utils.d.ts +3 -4
  55. package/dist/utils/command-utils.d.ts.map +1 -1
  56. package/dist/utils/command-utils.js +20 -9
  57. package/dist/utils/command-utils.js.map +1 -1
  58. package/dist/utils/keytar-loader.d.ts +20 -0
  59. package/dist/utils/keytar-loader.d.ts.map +1 -0
  60. package/dist/utils/keytar-loader.js +35 -0
  61. package/dist/utils/keytar-loader.js.map +1 -0
  62. package/dist/utils/sandbox-storage.d.ts +18 -18
  63. package/dist/utils/sandbox-storage.d.ts.map +1 -1
  64. package/dist/utils/sandbox-storage.js +101 -77
  65. package/dist/utils/sandbox-storage.js.map +1 -1
  66. package/dist/utils/sync-display.d.ts +16 -1
  67. package/dist/utils/sync-display.d.ts.map +1 -1
  68. package/dist/utils/sync-display.js +79 -0
  69. package/dist/utils/sync-display.js.map +1 -1
  70. package/dist/utils/sync-fetch.d.ts +68 -0
  71. package/dist/utils/sync-fetch.d.ts.map +1 -1
  72. package/dist/utils/sync-fetch.js +157 -0
  73. package/dist/utils/sync-fetch.js.map +1 -1
  74. package/node_modules/@lua/shared-types/dist/index.d.mts +1 -31
  75. package/node_modules/@lua/shared-types/dist/index.d.ts +1 -31
  76. package/node_modules/@lua/shared-types/dist/index.js +0 -114
  77. package/node_modules/@lua/shared-types/dist/index.mjs +0 -109
  78. package/node_modules/@lua/shared-types/src/index.ts +1 -0
  79. package/node_modules/@lua/shared-types/src/model-registry.ts +20 -0
  80. package/package.json +7 -5
  81. package/template/package.json +1 -1
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Lazy Keytar Loader
3
+ *
4
+ * Defers the native keytar module import until first use and skips it
5
+ * entirely when LUA_SKIP_KEYCHAIN is set. This allows lua-cli to run
6
+ * in environments where native Node.js addons are unavailable
7
+ * (StackBlitz WebContainers, certain CI runners, etc.).
8
+ *
9
+ * The promise is cached so the dynamic import runs at most once per
10
+ * process, even under concurrent calls.
11
+ */
12
+ let _keytarPromise = null;
13
+ /**
14
+ * Returns the keytar module or null.
15
+ *
16
+ * - Returns null immediately if LUA_SKIP_KEYCHAIN is set.
17
+ * - Caches the import promise so concurrent callers share the same
18
+ * in-flight request and failed imports are not retried.
19
+ */
20
+ export async function getKeytar() {
21
+ if (process.env.LUA_SKIP_KEYCHAIN)
22
+ return null;
23
+ if (!_keytarPromise) {
24
+ _keytarPromise = import("keytar").then((mod) => {
25
+ // Handle ESM/CJS interop: keytar methods may live on mod.default
26
+ if (typeof mod.setPassword === 'function')
27
+ return mod;
28
+ if (mod.default && typeof mod.default.setPassword === 'function')
29
+ return mod.default;
30
+ return null;
31
+ }).catch(() => null);
32
+ }
33
+ return _keytarPromise;
34
+ }
35
+ //# sourceMappingURL=keytar-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keytar-loader.js","sourceRoot":"","sources":["../../src/utils/keytar-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,IAAI,cAAc,GAAmD,IAAI,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAAE,OAAO,IAAI,CAAC;IAC/C,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YAC7C,iEAAiE;YACjE,IAAI,OAAO,GAAG,CAAC,WAAW,KAAK,UAAU;gBAAE,OAAO,GAAG,CAAC;YACtD,IAAI,GAAG,CAAC,OAAO,IAAI,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,UAAU;gBAAE,OAAO,GAAG,CAAC,OAAqB,CAAC;YACnG,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * Sandbox Storage Utilities
3
- * Handles storage and retrieval of sandbox primitive IDs using a local JSON file
4
- * at ~/.lua-cli/sandbox.json. Replaces the previous keytar-based implementation.
3
+ * Handles secure storage and retrieval of sandbox skill IDs using keytar
5
4
  */
6
5
  import { SkillOverride } from '../interfaces/dev.js';
7
6
  import { YamlConfig } from '../types/yaml.types.js';
8
7
  /**
9
- * Retrieves sandbox skill ID from local storage.
8
+ * Retrieves sandbox skill ID from secure storage.
10
9
  *
11
10
  * @param skillName - Optional skill name for multi-skill projects
12
11
  * @returns The sandbox skill ID or null if not found
13
12
  */
14
13
  export declare function getSandboxSkillId(skillName?: string): Promise<string | null>;
15
14
  /**
16
- * Stores sandbox skill ID in local storage.
15
+ * Stores sandbox skill ID in secure storage.
17
16
  *
18
17
  * @param sandboxId - The sandbox skill ID to store
19
18
  * @param skillName - Optional skill name for multi-skill projects
@@ -21,49 +20,50 @@ export declare function getSandboxSkillId(skillName?: string): Promise<string |
21
20
  export declare function setSandboxSkillId(sandboxId: string, skillName?: string): Promise<void>;
22
21
  /**
23
22
  * Retrieves all sandbox skill IDs for all skills in the project.
23
+ * Uses YAML config to get skill names and IDs.
24
24
  *
25
25
  * @param yamlConfig - The lua.skill.yaml config containing skill information
26
26
  * @returns Array of skill overrides with skillId and sandboxId pairs
27
27
  */
28
28
  export declare function getAllSandboxSkillIds(yamlConfig: YamlConfig): Promise<SkillOverride[]>;
29
29
  /**
30
- * Retrieves sandbox preprocessor ID from local storage.
30
+ * Retrieves sandbox preprocessor ID from secure storage.
31
31
  *
32
32
  * @param preprocessorName - Preprocessor name
33
33
  * @returns The sandbox preprocessor ID or null if not found
34
34
  */
35
35
  export declare function getSandboxPreProcessorId(preprocessorName: string): Promise<string | null>;
36
36
  /**
37
- * Stores sandbox preprocessor ID in local storage.
37
+ * Stores sandbox preprocessor ID in secure storage.
38
38
  *
39
39
  * @param sandboxId - The sandbox preprocessor ID to store
40
40
  * @param preprocessorName - Preprocessor name
41
41
  */
42
42
  export declare function setSandboxPreProcessorId(sandboxId: string, preprocessorName: string): Promise<void>;
43
43
  /**
44
- * Gets all sandbox preprocessor overrides for the current config.
45
- *
46
- * @param config - Configuration with preprocessors
47
- * @returns Array of preprocessor overrides
48
- */
49
- export declare function getAllSandboxPreProcessorIds(config: YamlConfig): Promise<Array<{
50
- preprocessorId: string;
51
- sandboxId: string;
52
- }>>;
53
- /**
54
- * Retrieves sandbox postprocessor ID from local storage.
44
+ * Retrieves sandbox postprocessor ID from secure storage.
55
45
  *
56
46
  * @param postprocessorName - Postprocessor name
57
47
  * @returns The sandbox postprocessor ID or null if not found
58
48
  */
59
49
  export declare function getSandboxPostProcessorId(postprocessorName: string): Promise<string | null>;
60
50
  /**
61
- * Stores sandbox postprocessor ID in local storage.
51
+ * Stores sandbox postprocessor ID in secure storage.
62
52
  *
63
53
  * @param sandboxId - The sandbox postprocessor ID to store
64
54
  * @param postprocessorName - Postprocessor name
65
55
  */
66
56
  export declare function setSandboxPostProcessorId(sandboxId: string, postprocessorName: string): Promise<void>;
57
+ /**
58
+ * Gets all sandbox preprocessor overrides for the current config.
59
+ *
60
+ * @param config - Configuration with preprocessors
61
+ * @returns Array of preprocessor overrides
62
+ */
63
+ export declare function getAllSandboxPreProcessorIds(config: YamlConfig): Promise<Array<{
64
+ preprocessorId: string;
65
+ sandboxId: string;
66
+ }>>;
67
67
  /**
68
68
  * Gets all sandbox postprocessor overrides for the current config.
69
69
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox-storage.d.ts","sourceRoot":"","sources":["../../src/utils/sandbox-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAwCpD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIlF;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAK5F;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAmB5F;AAMD;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAG/F;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIzG;AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAmBpI;AAMD;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGjG;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,SAAS,EAAE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AAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAS3G;AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC,CAsBlI;AAED;;;;;GAKG;AACH,wBAAsB,6BAA6B,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC,CAsBpI"}
@@ -1,63 +1,53 @@
1
1
  /**
2
2
  * Sandbox Storage Utilities
3
- * Handles storage and retrieval of sandbox primitive IDs using a local JSON file
4
- * at ~/.lua-cli/sandbox.json. Replaces the previous keytar-based implementation.
3
+ * Handles secure storage and retrieval of sandbox skill IDs using keytar
5
4
  */
6
- import { readFileSync, writeFileSync, mkdirSync } from 'fs';
7
- import { dirname } from 'path';
8
- import { SANDBOX_STORAGE_FILE } from '../config/constants.js';
5
+ import { getKeytar } from './keytar-loader.js';
6
+ import { SANDBOX_STORAGE } from '../config/constants.js';
9
7
  import { skillHandler, preprocessorHandler, postprocessorHandler } from '../primitives/index.js';
10
- function readStore() {
11
- try {
12
- const raw = readFileSync(SANDBOX_STORAGE_FILE, 'utf8');
13
- const parsed = JSON.parse(raw);
14
- return {
15
- skills: parsed.skills ?? {},
16
- preprocessors: parsed.preprocessors ?? {},
17
- postprocessors: parsed.postprocessors ?? {},
18
- };
19
- }
20
- catch {
21
- return { skills: {}, preprocessors: {}, postprocessors: {} };
22
- }
23
- }
24
- function writeStore(store) {
25
- try {
26
- mkdirSync(dirname(SANDBOX_STORAGE_FILE), { recursive: true });
27
- writeFileSync(SANDBOX_STORAGE_FILE, JSON.stringify(store, null, 2), 'utf8');
28
- }
29
- catch {
30
- // Silently ignore write failures — sandbox IDs are transient dev-time values
31
- }
32
- }
33
- // =============================================================================
34
- // Skill sandbox IDs
35
- // =============================================================================
36
8
  /**
37
- * Retrieves sandbox skill ID from local storage.
9
+ * Retrieves sandbox skill ID from secure storage.
38
10
  *
39
11
  * @param skillName - Optional skill name for multi-skill projects
40
12
  * @returns The sandbox skill ID or null if not found
41
13
  */
42
14
  export async function getSandboxSkillId(skillName) {
43
- const store = readStore();
44
- const key = skillName ?? '__default__';
45
- return store.skills[key] ?? null;
15
+ const keytar = await getKeytar();
16
+ if (!keytar)
17
+ return null;
18
+ try {
19
+ const account = skillName
20
+ ? `${SANDBOX_STORAGE.ACCOUNT}_${skillName}`
21
+ : SANDBOX_STORAGE.ACCOUNT;
22
+ return await keytar.getPassword(SANDBOX_STORAGE.SERVICE, account);
23
+ }
24
+ catch (error) {
25
+ return null;
26
+ }
46
27
  }
47
28
  /**
48
- * Stores sandbox skill ID in local storage.
29
+ * Stores sandbox skill ID in secure storage.
49
30
  *
50
31
  * @param sandboxId - The sandbox skill ID to store
51
32
  * @param skillName - Optional skill name for multi-skill projects
52
33
  */
53
34
  export async function setSandboxSkillId(sandboxId, skillName) {
54
- const store = readStore();
55
- const key = skillName ?? '__default__';
56
- store.skills[key] = sandboxId;
57
- writeStore(store);
35
+ const keytar = await getKeytar();
36
+ if (!keytar)
37
+ return;
38
+ try {
39
+ const account = skillName
40
+ ? `${SANDBOX_STORAGE.ACCOUNT}_${skillName}`
41
+ : SANDBOX_STORAGE.ACCOUNT;
42
+ await keytar.setPassword(SANDBOX_STORAGE.SERVICE, account, sandboxId);
43
+ }
44
+ catch (error) {
45
+ // Ignore storage errors
46
+ }
58
47
  }
59
48
  /**
60
49
  * Retrieves all sandbox skill IDs for all skills in the project.
50
+ * Uses YAML config to get skill names and IDs.
61
51
  *
62
52
  * @param yamlConfig - The lua.skill.yaml config containing skill information
63
53
  * @returns Array of skill overrides with skillId and sandboxId pairs
@@ -66,11 +56,15 @@ export async function getAllSandboxSkillIds(yamlConfig) {
66
56
  try {
67
57
  const skills = skillHandler.getFromYaml(yamlConfig);
68
58
  const skillOverrides = [];
59
+ // For each skill in YAML, get its sandbox ID
69
60
  for (const skill of skills) {
70
61
  if (skill.skillId && skill.name) {
71
62
  const sandboxId = await getSandboxSkillId(skill.name);
72
63
  if (sandboxId) {
73
- skillOverrides.push({ skillId: skill.skillId, sandboxId });
64
+ skillOverrides.push({
65
+ skillId: skill.skillId,
66
+ sandboxId: sandboxId
67
+ });
74
68
  }
75
69
  }
76
70
  }
@@ -81,29 +75,77 @@ export async function getAllSandboxSkillIds(yamlConfig) {
81
75
  return [];
82
76
  }
83
77
  }
84
- // =============================================================================
85
- // Preprocessor sandbox IDs
86
- // =============================================================================
87
78
  /**
88
- * Retrieves sandbox preprocessor ID from local storage.
79
+ * Retrieves sandbox preprocessor ID from secure storage.
89
80
  *
90
81
  * @param preprocessorName - Preprocessor name
91
82
  * @returns The sandbox preprocessor ID or null if not found
92
83
  */
93
84
  export async function getSandboxPreProcessorId(preprocessorName) {
94
- const store = readStore();
95
- return store.preprocessors[preprocessorName] ?? null;
85
+ const keytar = await getKeytar();
86
+ if (!keytar)
87
+ return null;
88
+ try {
89
+ const account = `${SANDBOX_STORAGE.ACCOUNT}_preprocessor_${preprocessorName}`;
90
+ return await keytar.getPassword(SANDBOX_STORAGE.SERVICE, account);
91
+ }
92
+ catch (error) {
93
+ return null;
94
+ }
96
95
  }
97
96
  /**
98
- * Stores sandbox preprocessor ID in local storage.
97
+ * Stores sandbox preprocessor ID in secure storage.
99
98
  *
100
99
  * @param sandboxId - The sandbox preprocessor ID to store
101
100
  * @param preprocessorName - Preprocessor name
102
101
  */
103
102
  export async function setSandboxPreProcessorId(sandboxId, preprocessorName) {
104
- const store = readStore();
105
- store.preprocessors[preprocessorName] = sandboxId;
106
- writeStore(store);
103
+ const keytar = await getKeytar();
104
+ if (!keytar)
105
+ return;
106
+ try {
107
+ const account = `${SANDBOX_STORAGE.ACCOUNT}_preprocessor_${preprocessorName}`;
108
+ await keytar.setPassword(SANDBOX_STORAGE.SERVICE, account, sandboxId);
109
+ }
110
+ catch (error) {
111
+ // Ignore storage errors
112
+ }
113
+ }
114
+ /**
115
+ * Retrieves sandbox postprocessor ID from secure storage.
116
+ *
117
+ * @param postprocessorName - Postprocessor name
118
+ * @returns The sandbox postprocessor ID or null if not found
119
+ */
120
+ export async function getSandboxPostProcessorId(postprocessorName) {
121
+ const keytar = await getKeytar();
122
+ if (!keytar)
123
+ return null;
124
+ try {
125
+ const account = `${SANDBOX_STORAGE.ACCOUNT}_postprocessor_${postprocessorName}`;
126
+ return await keytar.getPassword(SANDBOX_STORAGE.SERVICE, account);
127
+ }
128
+ catch (error) {
129
+ return null;
130
+ }
131
+ }
132
+ /**
133
+ * Stores sandbox postprocessor ID in secure storage.
134
+ *
135
+ * @param sandboxId - The sandbox postprocessor ID to store
136
+ * @param postprocessorName - Postprocessor name
137
+ */
138
+ export async function setSandboxPostProcessorId(sandboxId, postprocessorName) {
139
+ const keytar = await getKeytar();
140
+ if (!keytar)
141
+ return;
142
+ try {
143
+ const account = `${SANDBOX_STORAGE.ACCOUNT}_postprocessor_${postprocessorName}`;
144
+ await keytar.setPassword(SANDBOX_STORAGE.SERVICE, account, sandboxId);
145
+ }
146
+ catch (error) {
147
+ // Ignore storage errors
148
+ }
107
149
  }
108
150
  /**
109
151
  * Gets all sandbox preprocessor overrides for the current config.
@@ -119,7 +161,10 @@ export async function getAllSandboxPreProcessorIds(config) {
119
161
  if (preprocessor.preprocessorId && preprocessor.name) {
120
162
  const sandboxId = await getSandboxPreProcessorId(preprocessor.name);
121
163
  if (sandboxId) {
122
- overrides.push({ preprocessorId: preprocessor.preprocessorId, sandboxId });
164
+ overrides.push({
165
+ preprocessorId: preprocessor.preprocessorId,
166
+ sandboxId: sandboxId
167
+ });
123
168
  }
124
169
  }
125
170
  }
@@ -129,30 +174,6 @@ export async function getAllSandboxPreProcessorIds(config) {
129
174
  }
130
175
  return overrides;
131
176
  }
132
- // =============================================================================
133
- // Postprocessor sandbox IDs
134
- // =============================================================================
135
- /**
136
- * Retrieves sandbox postprocessor ID from local storage.
137
- *
138
- * @param postprocessorName - Postprocessor name
139
- * @returns The sandbox postprocessor ID or null if not found
140
- */
141
- export async function getSandboxPostProcessorId(postprocessorName) {
142
- const store = readStore();
143
- return store.postprocessors[postprocessorName] ?? null;
144
- }
145
- /**
146
- * Stores sandbox postprocessor ID in local storage.
147
- *
148
- * @param sandboxId - The sandbox postprocessor ID to store
149
- * @param postprocessorName - Postprocessor name
150
- */
151
- export async function setSandboxPostProcessorId(sandboxId, postprocessorName) {
152
- const store = readStore();
153
- store.postprocessors[postprocessorName] = sandboxId;
154
- writeStore(store);
155
- }
156
177
  /**
157
178
  * Gets all sandbox postprocessor overrides for the current config.
158
179
  *
@@ -167,7 +188,10 @@ export async function getAllSandboxPostProcessorIds(config) {
167
188
  if (postprocessor.postprocessorId && postprocessor.name) {
168
189
  const sandboxId = await getSandboxPostProcessorId(postprocessor.name);
169
190
  if (sandboxId) {
170
- overrides.push({ postprocessorId: postprocessor.postprocessorId, sandboxId });
191
+ overrides.push({
192
+ postprocessorId: postprocessor.postprocessorId,
193
+ sandboxId: sandboxId
194
+ });
171
195
  }
172
196
  }
173
197
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox-storage.js","sourceRoot":"","sources":["../../src/utils/sandbox-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAYjG,SAAS,SAAS;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;QACvD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AAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,MAAkB;IACpE,MAAM,SAAS,GAAwD,EAAE,CAAC;IAE1E,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,oBAAoB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAEhE,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;YAC3C,IAAI,aAAa,CAAC,eAAe,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC;gBACxD,MAAM,SAAS,GAAG,MAAM,yBAAyB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;gBACtE,IAAI,SAAS,EAAE,CAAC;oBACd,SAAS,CAAC,IAAI,CAAC;wBACb,eAAe,EAAE,aAAa,CAAC,eAAe;wBAC9C,SAAS,EAAE,SAAS;qBACrB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0CAA0C,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -2,10 +2,25 @@
2
2
  * Sync Display — Presentation layer for drift detection.
3
3
  * Displays colored diffs, warnings, and comparison output.
4
4
  */
5
- import type { PersonaDrift } from './sync-fetch.js';
5
+ import type { PersonaDrift, PrimitiveDriftItem } from './sync-fetch.js';
6
6
  export declare function showColoredDiff(oldText: string, newText: string, oldLabel?: string, newLabel?: string): void;
7
7
  export declare function showPersonaDiff(serverPersona: string | null, localPersona: string): void;
8
8
  export declare function showDriftWarning(drift: PersonaDrift): void;
9
9
  export declare function showNameDiff(serverName: string | null, localName: string): void;
10
10
  export declare function showModelDiff(serverModel: string | null, localModel: string): void;
11
+ /**
12
+ * Displays primitive drift in interactive mode, grouped by type.
13
+ * Shows each item's local version, server version, and backup availability.
14
+ *
15
+ * @param items - The list of drifted primitives to display.
16
+ * @param backupAvailable - Whether a backup exists for this agent.
17
+ */
18
+ export declare function showPrimitiveDrift(items: PrimitiveDriftItem[], backupAvailable?: boolean): void;
19
+ /**
20
+ * Displays a compact summary of primitive drift for check mode.
21
+ * Prints one line per drifted item showing type, name, and version info.
22
+ *
23
+ * @param items - The list of drifted primitives to summarise.
24
+ */
25
+ export declare function showPrimitiveDriftSummary(items: PrimitiveDriftItem[]): void;
11
26
  //# sourceMappingURL=sync-display.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync-display.d.ts","sourceRoot":"","sources":["../../src/utils/sync-display.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAUpD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAiB,EAC3B,QAAQ,GAAE,MAAgB,GACzB,IAAI,CAsBN;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAOxF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAG1D;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAO/E;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAOlF"}
1
+ {"version":3,"file":"sync-display.d.ts","sourceRoot":"","sources":["../../src/utils/sync-display.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAmBxE,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAiB,EAC3B,QAAQ,GAAE,MAAgB,GACzB,IAAI,CAsBN;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAOxF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAG1D;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAO/E;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAOlF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAyC/F;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAsB3E"}
@@ -10,6 +10,14 @@ const colors = {
10
10
  reset: '\x1b[0m',
11
11
  bold: '\x1b[1m',
12
12
  };
13
+ const primitiveTypeLabels = {
14
+ skill: 'SKILLS',
15
+ webhook: 'WEBHOOKS',
16
+ job: 'JOBS',
17
+ preprocessor: 'PREPROCESSORS',
18
+ postprocessor: 'POSTPROCESSORS',
19
+ mcpServer: 'MCP SERVERS',
20
+ };
13
21
  export function showColoredDiff(oldText, newText, oldLabel = 'Server', newLabel = 'Local') {
14
22
  if (!oldText && !newText) {
15
23
  console.log(colors.gray + '(both empty)' + colors.reset);
@@ -72,4 +80,75 @@ export function showModelDiff(serverModel, localModel) {
72
80
  console.log(colors.green + `+ Local: "${localModel || '(none)'}"` + colors.reset);
73
81
  console.log('='.repeat(60) + '\n');
74
82
  }
83
+ /**
84
+ * Displays primitive drift in interactive mode, grouped by type.
85
+ * Shows each item's local version, server version, and backup availability.
86
+ *
87
+ * @param items - The list of drifted primitives to display.
88
+ * @param backupAvailable - Whether a backup exists for this agent.
89
+ */
90
+ export function showPrimitiveDrift(items, backupAvailable) {
91
+ if (items.length === 0)
92
+ return;
93
+ // Group items by type preserving insertion order.
94
+ const grouped = new Map();
95
+ for (const item of items) {
96
+ const group = grouped.get(item.type);
97
+ if (group) {
98
+ group.push(item);
99
+ }
100
+ else {
101
+ grouped.set(item.type, [item]);
102
+ }
103
+ }
104
+ for (const [type, groupItems] of grouped) {
105
+ const label = primitiveTypeLabels[type] ?? type.toUpperCase();
106
+ console.log('\n' + colors.bold + `━━━ ${label} ━━━` + colors.reset);
107
+ for (const item of groupItems) {
108
+ console.log('\n ' + colors.bold + item.name + colors.reset);
109
+ const localDisplay = item.localVersion
110
+ ? `v${item.localVersion}`
111
+ : colors.gray + '(not found)' + colors.reset;
112
+ console.log(` Local: ${localDisplay}`);
113
+ const serverDisplay = item.serverVersion
114
+ ? `v${item.serverVersion}`
115
+ : colors.gray + '(not found)' + colors.reset;
116
+ console.log(` Server: ${serverDisplay}`);
117
+ }
118
+ }
119
+ if (backupAvailable !== undefined) {
120
+ const backupDisplay = backupAvailable
121
+ ? colors.green + 'available' + colors.reset
122
+ : colors.red + 'not available' + colors.reset;
123
+ console.log(`\n Backup: ${backupDisplay}`);
124
+ }
125
+ console.log('');
126
+ }
127
+ /**
128
+ * Displays a compact summary of primitive drift for check mode.
129
+ * Prints one line per drifted item showing type, name, and version info.
130
+ *
131
+ * @param items - The list of drifted primitives to summarise.
132
+ */
133
+ export function showPrimitiveDriftSummary(items) {
134
+ if (items.length === 0)
135
+ return;
136
+ console.log('Primitive drift detected:');
137
+ for (const item of items) {
138
+ const label = primitiveTypeLabels[item.type] ?? item.type.toUpperCase();
139
+ const vSuffix = (ver) => (ver ? `, v${ver}` : '');
140
+ let versionInfo;
141
+ if (item.status === 'version-mismatch') {
142
+ versionInfo = `local v${item.localVersion}, server v${item.serverVersion}`;
143
+ }
144
+ else if (item.status === 'missing-locally') {
145
+ versionInfo = `server only${vSuffix(item.serverVersion)}`;
146
+ }
147
+ else {
148
+ versionInfo = `local only${vSuffix(item.localVersion)}`;
149
+ }
150
+ const paddedLabel = label.padEnd(16);
151
+ console.log(` ${colors.red}${paddedLabel}${colors.reset} ${item.name} (${versionInfo})`);
152
+ }
153
+ }
75
154
  //# sourceMappingURL=sync-display.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync-display.js","sourceRoot":"","sources":["../../src/utils/sync-display.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAGjC,MAAM,MAAM,GAAG;IACb,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;CAChB,CAAC;AAEF,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,OAAe,EACf,WAAmB,QAAQ,EAC3B,WAAmB,OAAO;IAE1B,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAAC,OAAO;IAAC,CAAC;IAC/F,IAAI,CAAC,OAAO,EAAE,CAAC;QAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,QAAQ,cAAc,QAAQ,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAAC,OAAO;IAAC,CAAC;IACrH,IAAI,CAAC,OAAO,EAAE,CAAC;QAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,MAAM,QAAQ,cAAc,QAAQ,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAAC,OAAO;IAAC,CAAC;IAEnH,MAAM,IAAI,GAAG,S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AW,EAAE,CAAC;QAExE,MAAM,OAAO,GAAG,CAAC,GAAkB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAEjE,IAAI,WAAmB,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,KAAK,kBAAkB,EAAE,CAAC;YACvC,WAAW,GAAG,UAAU,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,aAAa,EAAE,CAAC;QAC7E,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,KAAK,iBAAiB,EAAE,CAAC;YAC7C,WAAW,GAAG,cAAc,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;QAC5D,CAAC;aAAM,CAAC;YACN,WAAW,GAAG,aAAa,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAC1D,CAAC;QAED,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,GAAG,GAAG,WAAW,GAAG,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,GAAG,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC"}
@@ -2,6 +2,7 @@
2
2
  * Sync Fetch — Data fetching layer for drift detection.
3
3
  * Fetches server state (persona, name) and compares with local code.
4
4
  */
5
+ import type { YamlConfig } from '../types/yaml.types.js';
5
6
  export interface PersonaDrift {
6
7
  hasDrift: boolean;
7
8
  serverPersona: string | null;
@@ -28,4 +29,71 @@ export interface ModelDrift {
28
29
  }
29
30
  export declare function fetchServerModel(apiKey: string, agentId: string): Promise<string | null>;
30
31
  export declare function checkModelDrift(apiKey: string, agentId: string): Promise<ModelDrift | null>;
32
+ /** Describes how a primitive differs between local config and the server. */
33
+ export type PrimitiveDriftStatus = 'version-mismatch' | 'missing-locally' | 'missing-on-server';
34
+ /** A single primitive that has drifted between local config and the server. */
35
+ export interface PrimitiveDriftItem {
36
+ /** The name of the primitive as it appears in the YAML config or on the server. */
37
+ name: string;
38
+ /** The primitive type. */
39
+ type: 'skill' | 'webhook' | 'job' | 'preprocessor' | 'postprocessor' | 'mcpServer';
40
+ /** How the local config and server differ for this primitive. */
41
+ status: PrimitiveDriftStatus;
42
+ /** The version recorded in the local YAML config, or null when not present locally. */
43
+ localVersion: string | null;
44
+ /** The active version on the server, or null when not present on the server. */
45
+ serverVersion: string | null;
46
+ /** The server-assigned entity ID, if known. */
47
+ entityId: string | null;
48
+ }
49
+ /** Aggregate result of comparing all primitives between local config and the server. */
50
+ export interface PrimitiveDrift {
51
+ items: PrimitiveDriftItem[];
52
+ hasDrift: boolean;
53
+ /** Whether a backup exists for this agent (per-agent, not per-primitive). */
54
+ backupAvailable?: boolean;
55
+ }
56
+ interface ServerPrimitive {
57
+ id: string;
58
+ name: string;
59
+ /** Active version string, or null when none exists. */
60
+ activeVersion: string | null;
61
+ }
62
+ interface ServerPrimitives {
63
+ skills: ServerPrimitive[];
64
+ webhooks: ServerPrimitive[];
65
+ jobs: ServerPrimitive[];
66
+ preprocessors: ServerPrimitive[];
67
+ postprocessors: ServerPrimitive[];
68
+ mcpServers: ServerPrimitive[];
69
+ }
70
+ /**
71
+ * Fetches all primitive types from the server in parallel.
72
+ * Each fetch failure is caught individually — a partial result is returned
73
+ * rather than failing the entire operation.
74
+ *
75
+ * @param apiKey - Developer API key used for authentication.
76
+ * @param agentId - The agent whose primitives to fetch.
77
+ * @returns Normalised server primitives grouped by type.
78
+ */
79
+ export declare function fetchServerPrimitives(apiKey: string, agentId: string): Promise<ServerPrimitives>;
80
+ /**
81
+ * Compares one primitive type across local and server lists.
82
+ * Returns items that have drifted (version mismatch, missing locally, or missing on server).
83
+ */
84
+ export declare function comparePrimitives(type: PrimitiveDriftItem['type'], localItems: Array<{
85
+ name: string;
86
+ version: string | null;
87
+ entityId: string | null;
88
+ }>, serverItems: Array<{
89
+ id: string;
90
+ name: string;
91
+ activeVersion: string | null;
92
+ }>): PrimitiveDriftItem[];
93
+ /**
94
+ * Compares all primitive types in the local YAML config against the server
95
+ * and returns items that have drifted.
96
+ */
97
+ export declare function checkPrimitiveDrift(apiKey: string, agentId: string, localConfig: YamlConfig): Promise<PrimitiveDrift>;
98
+ export {};
31
99
  //# sourceMappingURL=sync-fetch.d.ts.map