strands-darwin 0.0.34 → 0.0.36

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 (273) hide show
  1. package/README.md +22 -3
  2. package/README.zh-CN.md +22 -3
  3. package/dist/patches/@strands-agents+sdk+1.16.0.patch +29 -15
  4. package/dist/patches/ink+7.1.1.patch +58 -0
  5. package/dist/src/agent/background-delegation.d.ts +3 -3
  6. package/dist/src/agent/background-delegation.js +2 -2
  7. package/dist/src/agent/background-delegation.js.map +1 -1
  8. package/dist/src/agent/context-breakdown.d.ts +2 -1
  9. package/dist/src/agent/context-breakdown.js +2 -1
  10. package/dist/src/agent/context-breakdown.js.map +1 -1
  11. package/dist/src/agent/instructions.d.ts +22 -3
  12. package/dist/src/agent/instructions.js +67 -34
  13. package/dist/src/agent/instructions.js.map +1 -1
  14. package/dist/src/agent/prompt-cache.js +15 -2
  15. package/dist/src/agent/prompt-cache.js.map +1 -1
  16. package/dist/src/agent/refusal.d.ts +44 -7
  17. package/dist/src/agent/refusal.js +54 -8
  18. package/dist/src/agent/refusal.js.map +1 -1
  19. package/dist/src/agent/rewind.d.ts +2 -0
  20. package/dist/src/agent/rewind.js +4 -1
  21. package/dist/src/agent/rewind.js.map +1 -1
  22. package/dist/src/agent/runtime.d.ts +86 -13
  23. package/dist/src/agent/runtime.js +250 -43
  24. package/dist/src/agent/runtime.js.map +1 -1
  25. package/dist/src/agent/session.d.ts +96 -4
  26. package/dist/src/agent/session.js +249 -9
  27. package/dist/src/agent/session.js.map +1 -1
  28. package/dist/src/agent/stream-idle.d.ts +16 -0
  29. package/dist/src/agent/stream-idle.js +127 -0
  30. package/dist/src/agent/stream-idle.js.map +1 -0
  31. package/dist/src/agent/stream-resumption.d.ts +5 -2
  32. package/dist/src/agent/stream-resumption.js +5 -2
  33. package/dist/src/agent/stream-resumption.js.map +1 -1
  34. package/dist/src/agent/system-prompt.d.ts +1 -1
  35. package/dist/src/agent/system-prompt.js +4 -1
  36. package/dist/src/agent/system-prompt.js.map +1 -1
  37. package/dist/src/agent/thinking.js +4 -2
  38. package/dist/src/agent/thinking.js.map +1 -1
  39. package/dist/src/agent/working-context.d.ts +21 -1
  40. package/dist/src/agent/working-context.js +28 -1
  41. package/dist/src/agent/working-context.js.map +1 -1
  42. package/dist/src/agent/workspace-trust.d.ts +112 -0
  43. package/dist/src/agent/workspace-trust.js +207 -0
  44. package/dist/src/agent/workspace-trust.js.map +1 -0
  45. package/dist/src/agentcore/auto-policy.d.ts +7 -0
  46. package/dist/src/agentcore/auto-policy.js +50 -0
  47. package/dist/src/agentcore/auto-policy.js.map +1 -0
  48. package/dist/src/agentcore/auto-state.d.ts +43 -0
  49. package/dist/src/agentcore/auto-state.js +73 -0
  50. package/dist/src/agentcore/auto-state.js.map +1 -0
  51. package/dist/src/agentcore/cli.d.ts +2 -0
  52. package/dist/src/agentcore/cli.js +38 -0
  53. package/dist/src/agentcore/cli.js.map +1 -0
  54. package/dist/src/agentcore/config.d.ts +48 -0
  55. package/dist/src/agentcore/config.js +44 -0
  56. package/dist/src/agentcore/config.js.map +1 -0
  57. package/dist/src/agentcore/controller.d.ts +105 -0
  58. package/dist/src/agentcore/controller.js +979 -0
  59. package/dist/src/agentcore/controller.js.map +1 -0
  60. package/dist/src/agentcore/projection.d.ts +2 -0
  61. package/dist/src/agentcore/projection.js +8 -0
  62. package/dist/src/agentcore/projection.js.map +1 -0
  63. package/dist/src/agentcore/records.d.ts +41 -0
  64. package/dist/src/agentcore/records.js +149 -0
  65. package/dist/src/agentcore/records.js.map +1 -0
  66. package/dist/src/agentcore/state.d.ts +16 -0
  67. package/dist/src/agentcore/state.js +149 -0
  68. package/dist/src/agentcore/state.js.map +1 -0
  69. package/dist/src/agentcore/tools.d.ts +3 -0
  70. package/dist/src/agentcore/tools.js +11 -0
  71. package/dist/src/agentcore/tools.js.map +1 -0
  72. package/dist/src/agentcore/transport.d.ts +37 -0
  73. package/dist/src/agentcore/transport.js +242 -0
  74. package/dist/src/agentcore/transport.js.map +1 -0
  75. package/dist/src/agentcore/upload-projection.d.ts +208 -0
  76. package/dist/src/agentcore/upload-projection.js +823 -0
  77. package/dist/src/agentcore/upload-projection.js.map +1 -0
  78. package/dist/src/agents/child-recipe.js +4 -1
  79. package/dist/src/agents/child-recipe.js.map +1 -1
  80. package/dist/src/agents/loader.d.ts +12 -0
  81. package/dist/src/agents/loader.js +15 -1
  82. package/dist/src/agents/loader.js.map +1 -1
  83. package/dist/src/agents/subagent-tool.js +6 -7
  84. package/dist/src/agents/subagent-tool.js.map +1 -1
  85. package/dist/src/agents/workflow-tool.js +4 -6
  86. package/dist/src/agents/workflow-tool.js.map +1 -1
  87. package/dist/src/cli-doctor.js +14 -5
  88. package/dist/src/cli-doctor.js.map +1 -1
  89. package/dist/src/cli-import.d.ts +1 -0
  90. package/dist/src/cli-import.js +26 -0
  91. package/dist/src/cli-import.js.map +1 -0
  92. package/dist/src/cli-main.js +60 -10
  93. package/dist/src/cli-main.js.map +1 -1
  94. package/dist/src/cli-permissions.d.ts +2 -0
  95. package/dist/src/cli-permissions.js +20 -0
  96. package/dist/src/cli-permissions.js.map +1 -0
  97. package/dist/src/cli-sessions.js +6 -2
  98. package/dist/src/cli-sessions.js.map +1 -1
  99. package/dist/src/cli-usage.d.ts +9 -1
  100. package/dist/src/cli-usage.js +13 -0
  101. package/dist/src/cli-usage.js.map +1 -1
  102. package/dist/src/cli.js +19 -2
  103. package/dist/src/cli.js.map +1 -1
  104. package/dist/src/commands/custom-commands.d.ts +1 -1
  105. package/dist/src/commands/custom-commands.js +20 -6
  106. package/dist/src/commands/custom-commands.js.map +1 -1
  107. package/dist/src/commands/init-command.d.ts +47 -0
  108. package/dist/src/commands/init-command.js +110 -0
  109. package/dist/src/commands/init-command.js.map +1 -0
  110. package/dist/src/commands/review-command.d.ts +10 -0
  111. package/dist/src/commands/review-command.js +28 -0
  112. package/dist/src/commands/review-command.js.map +1 -0
  113. package/dist/src/config-file.d.ts +9 -0
  114. package/dist/src/config-file.js +82 -0
  115. package/dist/src/config-file.js.map +1 -0
  116. package/dist/src/config.d.ts +100 -7
  117. package/dist/src/config.js +253 -46
  118. package/dist/src/config.js.map +1 -1
  119. package/dist/src/dev-repl.js +33 -2
  120. package/dist/src/dev-repl.js.map +1 -1
  121. package/dist/src/headless-protocol.d.ts +24 -1
  122. package/dist/src/headless-protocol.js +24 -5
  123. package/dist/src/headless-protocol.js.map +1 -1
  124. package/dist/src/headless-runner.d.ts +8 -0
  125. package/dist/src/headless-runner.js +42 -2
  126. package/dist/src/headless-runner.js.map +1 -1
  127. package/dist/src/headless.d.ts +11 -0
  128. package/dist/src/headless.js +33 -7
  129. package/dist/src/headless.js.map +1 -1
  130. package/dist/src/hooks/hook-process.js +7 -2
  131. package/dist/src/hooks/hook-process.js.map +1 -1
  132. package/dist/src/hooks/lifecycle-hooks.js +3 -1
  133. package/dist/src/hooks/lifecycle-hooks.js.map +1 -1
  134. package/dist/src/hooks/tool-hooks.js +3 -1
  135. package/dist/src/hooks/tool-hooks.js.map +1 -1
  136. package/dist/src/import-claude-files.d.ts +28 -0
  137. package/dist/src/import-claude-files.js +227 -0
  138. package/dist/src/import-claude-files.js.map +1 -0
  139. package/dist/src/import-claude-snippets.d.ts +2 -0
  140. package/dist/src/import-claude-snippets.js +105 -0
  141. package/dist/src/import-claude-snippets.js.map +1 -0
  142. package/dist/src/import-claude.d.ts +13 -0
  143. package/dist/src/import-claude.js +287 -0
  144. package/dist/src/import-claude.js.map +1 -0
  145. package/dist/src/mcp/registry.d.ts +57 -1
  146. package/dist/src/mcp/registry.js +78 -6
  147. package/dist/src/mcp/registry.js.map +1 -1
  148. package/dist/src/memory/command.d.ts +1 -1
  149. package/dist/src/memory/command.js +89 -4
  150. package/dist/src/memory/command.js.map +1 -1
  151. package/dist/src/memory/controller.d.ts +32 -0
  152. package/dist/src/memory/controller.js +39 -3
  153. package/dist/src/memory/controller.js.map +1 -1
  154. package/dist/src/memory/state.d.ts +6 -0
  155. package/dist/src/memory/state.js +6 -1
  156. package/dist/src/memory/state.js.map +1 -1
  157. package/dist/src/memory/store.d.ts +13 -0
  158. package/dist/src/memory/store.js +38 -2
  159. package/dist/src/memory/store.js.map +1 -1
  160. package/dist/src/memory/tools.d.ts +7 -0
  161. package/dist/src/memory/tools.js +12 -1
  162. package/dist/src/memory/tools.js.map +1 -1
  163. package/dist/src/paths.js +3 -0
  164. package/dist/src/paths.js.map +1 -1
  165. package/dist/src/permissions-test.d.ts +18 -0
  166. package/dist/src/permissions-test.js +207 -0
  167. package/dist/src/permissions-test.js.map +1 -0
  168. package/dist/src/pricing/model-prices.d.ts +11 -6
  169. package/dist/src/pricing/model-prices.js +37 -16
  170. package/dist/src/pricing/model-prices.js.map +1 -1
  171. package/dist/src/project-identity.d.ts +3 -0
  172. package/dist/src/project-identity.js +8 -0
  173. package/dist/src/project-identity.js.map +1 -0
  174. package/dist/src/project-overrides.d.ts +57 -0
  175. package/dist/src/project-overrides.js +79 -0
  176. package/dist/src/project-overrides.js.map +1 -0
  177. package/dist/src/skills/builtin/setup-agentcore-memory/SKILL.md +158 -0
  178. package/dist/src/skills/loader.d.ts +1 -1
  179. package/dist/src/skills/loader.js +4 -1
  180. package/dist/src/skills/loader.js.map +1 -1
  181. package/dist/src/tools/background-bash.d.ts +21 -3
  182. package/dist/src/tools/background-bash.js +44 -8
  183. package/dist/src/tools/background-bash.js.map +1 -1
  184. package/dist/src/tools/file-editor-serial.d.ts +14 -0
  185. package/dist/src/tools/file-editor-serial.js +15 -0
  186. package/dist/src/tools/file-editor-serial.js.map +1 -1
  187. package/dist/src/tools/shell-env.d.ts +101 -0
  188. package/dist/src/tools/shell-env.js +173 -0
  189. package/dist/src/tools/shell-env.js.map +1 -0
  190. package/dist/src/trajectory/reader.d.ts +1 -1
  191. package/dist/src/trajectory/reader.js +23 -3
  192. package/dist/src/trajectory/reader.js.map +1 -1
  193. package/dist/src/trajectory/replay.js +23 -0
  194. package/dist/src/trajectory/replay.js.map +1 -1
  195. package/dist/src/trajectory/resume-recap.d.ts +11 -1
  196. package/dist/src/trajectory/resume-recap.js +10 -1
  197. package/dist/src/trajectory/resume-recap.js.map +1 -1
  198. package/dist/src/trajectory/rewind-history.d.ts +8 -0
  199. package/dist/src/trajectory/rewind-history.js +81 -0
  200. package/dist/src/trajectory/rewind-history.js.map +1 -0
  201. package/dist/src/trajectory/writer.d.ts +44 -3
  202. package/dist/src/trajectory/writer.js +80 -14
  203. package/dist/src/trajectory/writer.js.map +1 -1
  204. package/dist/src/tui/App.d.ts +8 -1
  205. package/dist/src/tui/App.js +453 -75
  206. package/dist/src/tui/App.js.map +1 -1
  207. package/dist/src/tui/InputBox.d.ts +1 -1
  208. package/dist/src/tui/InputBox.js +1 -1
  209. package/dist/src/tui/MessageList.js +1 -1
  210. package/dist/src/tui/MessageList.js.map +1 -1
  211. package/dist/src/tui/PermissionPrompt.js +5 -3
  212. package/dist/src/tui/PermissionPrompt.js.map +1 -1
  213. package/dist/src/tui/QueuedMessages.js +14 -8
  214. package/dist/src/tui/QueuedMessages.js.map +1 -1
  215. package/dist/src/tui/ToolCallPanel.js +2 -2
  216. package/dist/src/tui/ToolCallPanel.js.map +1 -1
  217. package/dist/src/tui/WorkspaceTrustPrompt.d.ts +8 -0
  218. package/dist/src/tui/WorkspaceTrustPrompt.js +37 -0
  219. package/dist/src/tui/WorkspaceTrustPrompt.js.map +1 -0
  220. package/dist/src/tui/draft-stash.d.ts +25 -0
  221. package/dist/src/tui/draft-stash.js +49 -0
  222. package/dist/src/tui/draft-stash.js.map +1 -0
  223. package/dist/src/tui/frame-budget.d.ts +2 -2
  224. package/dist/src/tui/frame-budget.js +3 -3
  225. package/dist/src/tui/frame-budget.js.map +1 -1
  226. package/dist/src/tui/help-format.d.ts +2 -2
  227. package/dist/src/tui/help-format.js +3 -3
  228. package/dist/src/tui/help-format.js.map +1 -1
  229. package/dist/src/tui/instructions-format.d.ts +14 -0
  230. package/dist/src/tui/instructions-format.js +24 -0
  231. package/dist/src/tui/instructions-format.js.map +1 -0
  232. package/dist/src/tui/mcp-format.d.ts +9 -0
  233. package/dist/src/tui/mcp-format.js +5 -3
  234. package/dist/src/tui/mcp-format.js.map +1 -1
  235. package/dist/src/tui/permission-rule-preview.d.ts +23 -0
  236. package/dist/src/tui/permission-rule-preview.js +38 -0
  237. package/dist/src/tui/permission-rule-preview.js.map +1 -0
  238. package/dist/src/tui/prompt-editor.d.ts +12 -0
  239. package/dist/src/tui/prompt-editor.js +38 -28
  240. package/dist/src/tui/prompt-editor.js.map +1 -1
  241. package/dist/src/tui/prompt-history-search.js +3 -2
  242. package/dist/src/tui/prompt-history-search.js.map +1 -1
  243. package/dist/src/tui/prompt-queue.d.ts +4 -2
  244. package/dist/src/tui/prompt-queue.js +22 -5
  245. package/dist/src/tui/prompt-queue.js.map +1 -1
  246. package/dist/src/tui/rewind-search.js +4 -3
  247. package/dist/src/tui/rewind-search.js.map +1 -1
  248. package/dist/src/tui/search-preview.d.ts +2 -0
  249. package/dist/src/tui/search-preview.js +9 -0
  250. package/dist/src/tui/search-preview.js.map +1 -0
  251. package/dist/src/tui/shell-command.js +4 -1
  252. package/dist/src/tui/shell-command.js.map +1 -1
  253. package/dist/src/tui/spinner.d.ts +1 -0
  254. package/dist/src/tui/spinner.js +6 -0
  255. package/dist/src/tui/spinner.js.map +1 -0
  256. package/dist/src/tui/status-format.d.ts +24 -0
  257. package/dist/src/tui/status-format.js +62 -2
  258. package/dist/src/tui/status-format.js.map +1 -1
  259. package/dist/src/tui/subagent-format.js +6 -0
  260. package/dist/src/tui/subagent-format.js.map +1 -1
  261. package/dist/src/tui/tangent.d.ts +122 -0
  262. package/dist/src/tui/tangent.js +153 -0
  263. package/dist/src/tui/tangent.js.map +1 -0
  264. package/dist/src/tui/task-format.d.ts +5 -0
  265. package/dist/src/tui/task-format.js +15 -0
  266. package/dist/src/tui/task-format.js.map +1 -1
  267. package/dist/src/tui/trust-format.d.ts +31 -0
  268. package/dist/src/tui/trust-format.js +102 -0
  269. package/dist/src/tui/trust-format.js.map +1 -0
  270. package/dist/src/tui/turn-state.d.ts +13 -1
  271. package/dist/src/tui/turn-state.js +13 -0
  272. package/dist/src/tui/turn-state.js.map +1 -1
  273. package/package.json +4 -3
@@ -0,0 +1,57 @@
1
+ import { z } from 'zod';
2
+ import { type AgentCoreConfig } from './agentcore/config.js';
3
+ /** Explicit extensible registry: adding an override requires both schema and merge code.
4
+ * No model/provider/permissions or resource/actor/project identity fields are registered. */
5
+ export declare const PROJECT_OVERRIDE_REGISTRY: {
6
+ readonly agentCoreMemory: z.ZodObject<{
7
+ upload: z.ZodOptional<z.ZodEnum<{
8
+ auto: "auto";
9
+ manual: "manual";
10
+ off: "off";
11
+ }>>;
12
+ autoDailyEvents: z.ZodOptional<z.ZodNumber>;
13
+ autoDailyBytes: z.ZodOptional<z.ZodNumber>;
14
+ authorization: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
15
+ epoch: z.ZodString;
16
+ at: z.ZodString;
17
+ scope: z.ZodString;
18
+ version: z.ZodLiteral<1>;
19
+ }, z.core.$strict>, z.ZodObject<{
20
+ epoch: z.ZodString;
21
+ at: z.ZodString;
22
+ scope: z.ZodString;
23
+ version: z.ZodLiteral<2>;
24
+ project: z.ZodString;
25
+ }, z.core.$strict>], "version">>;
26
+ }, z.core.$strict>;
27
+ };
28
+ declare const overrideSchema: z.ZodObject<{
29
+ agentCoreMemory: z.ZodOptional<z.ZodObject<{
30
+ upload: z.ZodOptional<z.ZodEnum<{
31
+ auto: "auto";
32
+ manual: "manual";
33
+ off: "off";
34
+ }>>;
35
+ autoDailyEvents: z.ZodOptional<z.ZodNumber>;
36
+ autoDailyBytes: z.ZodOptional<z.ZodNumber>;
37
+ authorization: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
38
+ epoch: z.ZodString;
39
+ at: z.ZodString;
40
+ scope: z.ZodString;
41
+ version: z.ZodLiteral<1>;
42
+ }, z.core.$strict>, z.ZodObject<{
43
+ epoch: z.ZodString;
44
+ at: z.ZodString;
45
+ scope: z.ZodString;
46
+ version: z.ZodLiteral<2>;
47
+ project: z.ZodString;
48
+ }, z.core.$strict>], "version">>;
49
+ }, z.core.$strict>>;
50
+ }, z.core.$strict>;
51
+ export type ProjectOverrides = Record<string, z.infer<typeof overrideSchema>>;
52
+ export declare function parseProjectOverrides(value: unknown): ProjectOverrides | undefined;
53
+ export declare function cloudBinding(config: AgentCoreConfig, root: string): string;
54
+ export declare function effectiveCloudPolicy(global: AgentCoreConfig | undefined, overrides: ProjectOverrides | undefined, root: string): AgentCoreConfig | undefined;
55
+ /** Send-time local policy read only: no model construction/reconfiguration or writes. */
56
+ export declare function readCloudPolicy(root: string): Promise<AgentCoreConfig | undefined>;
57
+ export {};
@@ -0,0 +1,79 @@
1
+ import { z } from 'zod';
2
+ import path from 'node:path';
3
+ import { userDarwinDir } from './paths.js';
4
+ import { projectIdentity } from './project-identity.js';
5
+ import { readConfigBytes } from './config-file.js';
6
+ import { authorizationSchema, digest, parseAgentCoreConfig } from './agentcore/config.js';
7
+ /** Explicit extensible registry: adding an override requires both schema and merge code.
8
+ * No model/provider/permissions or resource/actor/project identity fields are registered. */
9
+ export const PROJECT_OVERRIDE_REGISTRY = {
10
+ agentCoreMemory: z.object({
11
+ upload: z.enum(['off', 'manual', 'auto']).optional(),
12
+ autoDailyEvents: z.number().int().min(1).max(100000).optional(),
13
+ autoDailyBytes: z.number().int().min(1).max(107374182400).optional(),
14
+ authorization: authorizationSchema.optional(),
15
+ }).strict(),
16
+ };
17
+ const overrideSchema = z.object({ agentCoreMemory: PROJECT_OVERRIDE_REGISTRY.agentCoreMemory.optional() }).strict();
18
+ export function parseProjectOverrides(value) {
19
+ if (value === undefined)
20
+ return undefined;
21
+ if (!value || typeof value !== 'object' || Array.isArray(value))
22
+ throw new Error('projectOverrides must be an object');
23
+ const entries = Object.entries(value);
24
+ if (entries.length > 1024)
25
+ throw new Error('projectOverrides exceeds 1024 projects');
26
+ const result = Object.create(null);
27
+ for (const [key, entry] of entries) {
28
+ if (!/^[a-z0-9][a-z0-9_-]{0,63}$/.test(key) || ['__proto__', 'prototype', 'constructor'].includes(key))
29
+ throw new Error('projectOverrides: invalid project identity');
30
+ const parsed = overrideSchema.safeParse(entry);
31
+ if (!parsed.success)
32
+ throw new Error(`projectOverrides.${key}: invalid fields/types; only registered upload policy fields are allowed; repair configuration then re-confirm /cloud-memory auto`);
33
+ result[key] = parsed.data;
34
+ }
35
+ return result;
36
+ }
37
+ export function cloudBinding(config, root) {
38
+ return digest([config.region, config.memoryId, config.actorId, projectIdentity(root, config.projectId), config.episodicStrategyId, config.preferenceStrategyId]);
39
+ }
40
+ export function effectiveCloudPolicy(global, overrides, root) {
41
+ if (!global)
42
+ return undefined;
43
+ const project = projectIdentity(root); // Consent is NEVER keyed by the cloud namespace.
44
+ const override = overrides?.[project]?.agentCoreMemory;
45
+ const config = { ...global,
46
+ ...(override?.upload === undefined ? {} : { upload: override.upload }),
47
+ ...(override?.autoDailyEvents === undefined ? {} : { autoDailyEvents: override.autoDailyEvents }),
48
+ ...(override?.autoDailyBytes === undefined ? {} : { autoDailyBytes: override.autoDailyBytes }),
49
+ ...(override === undefined ? {} : { projectOverride: true }),
50
+ };
51
+ delete config.authorization;
52
+ delete config.autoProblem;
53
+ if (!override && global.projectId !== project && overrides?.[global.projectId ?? '']?.agentCoreMemory?.upload === 'auto')
54
+ config.autoProblem = 'Legacy cloud-namespace consent is inactive; re-confirm this working tree with /cloud-memory auto';
55
+ if (config.upload === 'auto') {
56
+ if (override?.upload === 'auto' && override.authorization?.version === 2 && override.authorization.project === project && override.authorization.scope === cloudBinding(config, root))
57
+ config.authorization = override.authorization;
58
+ else {
59
+ config.upload = 'manual';
60
+ config.autoProblem = 'Auto authorization missing or scope changed; re-confirm this project with /cloud-memory auto';
61
+ }
62
+ }
63
+ return config;
64
+ }
65
+ /** Send-time local policy read only: no model construction/reconfiguration or writes. */
66
+ export async function readCloudPolicy(root) {
67
+ const raw = await readConfigBytes(path.join(userDarwinDir(), 'config.json'));
68
+ if (raw === undefined)
69
+ return undefined;
70
+ const record = JSON.parse(raw);
71
+ if (!record || typeof record !== 'object' || Array.isArray(record))
72
+ throw new Error('Cloud policy config invalid');
73
+ const input = record;
74
+ const config = effectiveCloudPolicy(parseAgentCoreConfig(input['agentCoreMemory']), parseProjectOverrides(input['projectOverrides']), root);
75
+ if (config && config.upload !== 'off' && input['trajectory'] === false)
76
+ throw new Error('Cloud uploads require trajectory');
77
+ return config;
78
+ }
79
+ //# sourceMappingURL=project-overrides.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-overrides.js","sourceRoot":"","sources":["../../src/project-overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,oBAAoB,EAAwB,MAAM,uBAAuB,CAAC;AAEhH;6FAC6F;AAC7F,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC;QACxB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;QACpD,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;QAC/D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC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K,CAAC,iBAAiB,CAAC,CAAC,EAAE,qBAAqB,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC5I,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC5H,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: setup-agentcore-memory
3
+ description: Check existing Darwin cloud memory first and skip repeat setup when healthy. Otherwise guide setup or targeted repair with confirmed identity/settings before changes. Use for /setup-agentcore-memory or AgentCore Memory onboarding.
4
+ ---
5
+
6
+ # Set up AgentCore Memory
7
+
8
+ ## 0. Read the guide, then inspect existing config FIRST
9
+
10
+ Read and use this entire guide before proceeding. Explain, in the user's language, that existing configuration is checked first; healthy memory needs no repeat setup. Bare `/setup-agentcore-memory` begins this workflow; do not respond with usage alone. If guidance cannot be loaded, report that setup is blocked; never continue without it.
11
+
12
+ Command invocation, supplied arguments, this guide, `yolo`, and tool permission are NOT consent to install, create resources, write config, or upload. Arguments are proposed preferences, not authorization; even “use defaults/force-install” cannot waive the confirmation below. These setup-specific stops apply even in an autonomous/headless run.
13
+
14
+ FIRST inspect `~/.darwin/config.json` read-only through ordinary tools and the permission gate, before asking actor/default questions, resource discovery or installation. This is a sensitive read even in plan mode; do not bypass denial. Do not dump config, secrets or credentials; display only necessary safe memory state/IDs/scope. Use Darwin's existing config loader through the commands below to validate, not a second schema or private package import.
15
+
16
+ Distinguish a missing config file, an absent `agentCoreMemory` field, and intentionally disabled `agentCoreMemory: false`: show which state applies, then use section 2 for setup proposals; disabled never means permission to enable. Before taking that branch, use section 1's offline/local commands to validate the whole config with the existing loader (a missing file uses built-in defaults); do not make a cloud read for missing/disabled memory. Denied/unreadable config, invalid JSON or invalid schema is **BLOCKED/NEEDS-REPAIR**, NOT absent. Stop and request only the missing read permission or targeted repair confirmation; never fall through to new setup or overwrite known values.
17
+
18
+ ## Project upload authority (preserve during setup)
19
+
20
+ The effective upload mode may come from `projectOverrides[localKey].agentCoreMemory` in the global config. Preserve that entire map and all other projects during any approved config repair. The local key is always SHA256 of Darwin's canonical project key; explicit `agentCoreMemory.projectId` selects only the cloud namespace/shared quota, never consent. Status and doctor label both identities. Auto authorization v2 additionally binds the local key; v1 needs user reconfirmation, never silent migration. Overrides cannot change region/resource/actor/project/strategies. Defaults < global < current project. Only registered upload mode and daily budgets are overridable; never add unknown fields.
21
+
22
+ Do NOT enable auto, construct its authorization, drive a pseudo-terminal, or run cleanup on the user's behalf. After setup the user may type `/cloud-memory auto` in the idle TUI: this is consent for NEW turns in this project, captures a fresh scope-bound epoch, and warns that content can include secrets. `/cloud-memory manual` persists revocation immediately without resetting conversation or deleting evidence. Root `upload: auto` alone is not authorization. Defaults are 500 attempts/104857600 bytes per UTC day; configurable project budgets are positive bounded integers. Auto only sends normally closed traceable v2 events; tool failures do not mean ineligible, and endTurn does not mean goal success. Cancelled/incomplete/seriously damaged collections stay manual. Old pending is never backfilled. Only auto-accepted local bodies expire after seven days; receipts remain, manual/pending/failure/cloud data do not expire. No automatic preference adoption or cloud deletion.
23
+
24
+ User-only `/cloud-memory discard-legacy` previews unaccepted current-project/current-binding legacy local events; the user must submit the displayed manifest hash to clean them. Never execute cleanup as part of setup. Standalone CLI remains read-only and no mutation tool is exposed.
25
+
26
+ ## 1. Check enabled existing memory, then stop when healthy
27
+
28
+ For enabled config validated by the existing loader, run these checks using only saved region, resource, actor and strategy IDs (and saved project scope), never suggested argument overrides:
29
+
30
+ 1. `darwin doctor`: offline general configuration diagnostics; no network or files written.
31
+ 2. `darwin cloud-memory status`: **local-only** memory configuration/status, also using the existing loader.
32
+ 3. `darwin cloud-memory preferences`: actual bounded SDK read-only connectivity check against Memory. Explain that it contacts AWS with a fixed nonsensitive query, up to five results, no pagination, and the saved `timeoutMs`. Empty records are success. Even with `preferences: false`, this explicit setup health read is check-only: it neither enables preferences nor applies/adopts returned content. Preserve `preferences: false`, upload `off`, explicit `projectId`, timeout and legacy `cliPath` (validated but ignored); no cleanup write.
33
+
34
+ Avoid displaying preference content: capture command output in memory, check the command's exit status and parse successful JSON, and return only success plus `records.length` (and omissions if useful). Preserve failure/nonzero status; do not turn a failed command or unparseable output into zero records. Do not echo raw output on failure or store it in a file. This is a projection of the existing command, not a new doctor subcommand. Basic health means valid local config + successful bounded live read, NOT upload/delete permission, extraction, nonempty-record handling or strategy topology verification. Neither status alone nor doctor exit zero proves cloud connectivity.
35
+
36
+ No AWS CLI installation, STS/control-plane discovery, resource listing, credentials disclosure or confirmation of the unchanged actor is required on this path. Report unrelated doctor MCP/skill warnings separately; they are not evidence that memory is absent or a reason to reset it. State precisely which memory checks passed even when general diagnostics have unrelated warnings. If a command is not runnable or validation is unclear, report verification **pending**, not success; do not reinstall or infer missing memory.
37
+
38
+ ### Healthy stop
39
+
40
+ When local validation and the read-only health check pass, respond in the user's language, for example: **AgentCore Memory 已配置且基本检查通过,无需重复设置。** State current region/actor/upload mode, local + read-only checks passed, no config/resource edits or restart needed for unchanged config, and extraction/write not tested. **STOP** the bare setup workflow: no actor question, default confirmation, install/create/IAM change, preference adoption or redundant config write. This branch may finish without a question in both text and structured headless modes.
41
+
42
+ An explicit user request to reconfigure is separate intent: preserve/report the original healthy result first, then ask targeted confirmation for the requested changes only. Supplied arguments alone never silently replace saved settings or authorize mutation.
43
+
44
+ ### Failed or pending check
45
+
46
+ Existing config with SDK failure, no credentials, timeout, AccessDenied or wrong scope failed basic verification; it is NOT absent and NOT healthy. Report only the safely available category (for example timeout, HTTP 403, scope validation, or generic SDK failure when diagnostics are redacted); never guess the hidden cause or print raw errors/secrets. Ask TARGETED repair confirmation, preserving known actor/resources rather than starting over with defaults or automatically creating a resource. A denied/unverified/pending check cannot pass. After a second equivalent failure require a new evidence-backed hypothesis; after three stop/report, no endless polling. Only if the confirmed repair needs cloud details enter section 3, with scope/namespace checks before any change.
47
+
48
+ ## 2. Only for setup or confirmed repair/reconfiguration: questions and proposals
49
+
50
+ For missing/disabled setup, ask for the user's chosen username / `actorId`. Never guess it from OS username, git, AWS ARN, email, or another person's identity; never hardcode an actor. Accept a stable opaque ID matching `[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}`. If absent, ask and STOP the current turn awaiting the user's response. For setup reuse, show a previously user-provided value and ask explicit confirmation of reuse; never silently switch actors. For targeted repair/reconfiguration, ask only about affected settings, not confirmation of an unchanged actor. Group related missing decisions and the proposed defaults in the same question when known, rather than one question per round. In headless mode, return questions and pending status without reading stdin or guessing whenever this branch needs input; do not claim unattended setup is complete.
51
+
52
+ Gather only the bounded read-only environment/resource information needed for the proposal through ordinary tools and the permission gate; do not bypass denial or print secrets or credentials. Establish actual OS/architecture and installed tool versions only if needed for installation, and AWS identity/region only if needed for resource work, never as actor input. Prefer current values; label each proposal **current**, **user-provided**, or **fallback**. If reads are unavailable, label proposals unverified rather than inventing state.
53
+
54
+ Present a proposed defaults table, adapted to the discovered state, and ask explicit confirmation BEFORE any mutation:
55
+
56
+ | Setting | Proposal when not already chosen |
57
+ | --- | --- |
58
+ | Actor | User's answer, explicitly confirm setup reuse; retain unchanged actor during targeted repair |
59
+ | Region | Existing config or explicit AWS region if unambiguous; otherwise propose `us-west-2`; resolve conflicts |
60
+ | Resource | Compatible user-owned existing Memory first; otherwise independent `DarwinMemory`, with name, region and cost implications stated |
61
+ | Raw event retention | `30` days; raw event TTL is NOT long-term record TTL |
62
+ | Project isolation | Omit `projectId` for automatic per-project isolation |
63
+ | Preferences | `true`; acknowledge one bounded startup cloud read per runtime, not automatic adoption |
64
+ | Upload | Propose `manual`; stages new turns locally, sends nothing automatically; requires trajectory |
65
+ | Timeout | `timeoutMs: 5000` |
66
+ | Encryption | Service default, unless the user requires a particular key |
67
+
68
+ Do not ask about every internal constant. Explain every proposed change to an existing value; never overwrite silently. Existing `trajectory: false` conflicts with manual upload: ask whether to retain upload off or explicitly enable trajectory, never override it. Approval covers only the named config/resource actions in this table. Uploads, deletes, IAM expansion, import and redeploy require separate authorization.
69
+
70
+ Runtime already bundles official `@aws-sdk/client-bedrock-agentcore`; do not npm-install it in each project, import private global package paths, or change runtime dependencies. **AWS CLI** `aws bedrock-agentcore-control` is the separate control-plane setup tool. Optional `aws/agentcore-cli` (the `agentcore` infrastructure CLI) is not required. Do not substitute CLI names or rely on `/dev/stdin`. Before using commands, verify installed version/options against official documentation/help or local input skeletons (no service call). If a required tool is missing, propose the official install method appropriate to actual OS/architecture and obtain confirmation before installation, global package installation or sudo. Without approval, provide instructions and report blocked; never force-install.
71
+
72
+ Official references: [AWS CLI installation](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html), [control-plane create-memory](https://docs.aws.amazon.com/cli/latest/reference/bedrock-agentcore-control/create-memory.html), [AgentCore pricing](https://aws.amazon.com/bedrock/agentcore/pricing/). Verify current pricing before creation; explain storage, extraction and retrieval charges rather than promising free setup.
73
+
74
+ ## 3. Reuse or create a compatible resource
75
+
76
+ Use read-only `aws sts get-caller-identity`, then `aws bedrock-agentcore-control list-memories` in the selected region. Honor pagination; cap discovery at 10 pages/100 resources and report omissions, asking for a memory ID if necessary. Use `get-memory --memory-id <returned-id>` to inspect full resource details, not just list summaries. Capture actual IDs; verify ownership, resource and both strategy statuses, `namespaceKeys`, and exact namespace templates below. A name match is not compatibility. On mismatch, stop and propose an independent resource; do not mutate another application's resource or widen reflections.
77
+
78
+ For an explicitly authorized new resource, this bounded create-memory template shows defaults, not overrides of confirmed choices. Set the confirmed resource `name` and `eventExpiryDuration`, replace the placeholder with a stable `clientToken`, and include optional `encryptionKeyArn` when the user confirmed a required KMS key. Never reset confirmed nondefault retention to 30 days or required encryption to the service default. Keep `namespaceKeys` and all three namespace templates strictly unchanged, including their variables:
79
+
80
+ ```json
81
+ {
82
+ "name": "DarwinMemory",
83
+ "eventExpiryDuration": 30,
84
+ "clientToken": "REPLACE_WITH_STABLE_REQUEST_TOKEN",
85
+ "namespaceKeys": [{ "key": "projectid" }],
86
+ "memoryStrategies": [
87
+ {
88
+ "episodicMemoryStrategy": {
89
+ "name": "DarwinEpisodes",
90
+ "namespaceTemplates": ["/users/{actorId}/projects/{projectid}/strategy/{memoryStrategyId}/sessions/{sessionId}/"],
91
+ "reflectionConfiguration": {
92
+ "namespaceTemplates": ["/users/{actorId}/projects/{projectid}/strategy/{memoryStrategyId}/"]
93
+ }
94
+ }
95
+ },
96
+ {
97
+ "userPreferenceMemoryStrategy": {
98
+ "name": "DarwinPreferences",
99
+ "namespaceTemplates": ["/users/{actorId}/strategy/{memoryStrategyId}/preferences/"]
100
+ }
101
+ }
102
+ ]
103
+ }
104
+ ```
105
+
106
+ Before issuing create-memory, validate the exact adapted request against the confirmed settings and the verified API/installed AWS CLI: `eventExpiryDuration` is an integer from 3 to 365 days; optional `encryptionKeyArn` is the confirmed KMS key ARN, not a newly created key or IAM grant. Verify support for `namespaceKeys` and built-in `episodicMemoryStrategy.reflectionConfiguration.namespaceTemplates`; never silently substitute deprecated/wider namespaces. If a confirmed setting cannot be supported, stop and explain rather than reverting to a default. After authorization, write a private request file outside the repository and call `aws bedrock-agentcore-control create-memory --region <confirmed-region> --cli-input-json file://<absolute-request-file> --no-cli-pager`. Use one stable `clientToken` for retries and keep the exact request. After timeout, check resource state/listing before any retry; never repeatedly create with new tokens. Capture AWS-returned memory and strategy IDs rather than constructing IDs from names. Read `get-memory` until resource and both strategies are `ACTIVE`, with a bounded deadline (for example 5 minutes/10 checks). Use background bash start/wait for waits, not foreground sleeps or unbounded polling. On failed status/deadline, stop with pending/failed state.
107
+
108
+ Keep an existing compatible resource. The optional infrastructure CLI's known schema/import fidelity limitations can drop `namespaceKeys` or filter `{memoryStrategyId}` templates. Before **any** import/deploy, freshly verify lossless support for these exact keys/templates/IDs/retention AND obtain separate user authorization. Defaults cannot bypass this limitation. Ordinary setup can use the verified AWS control plane without import/redeploy.
109
+
110
+ Least privilege: read access needs resource-scoped `GetMemoryRecord` and `RetrieveMemoryRecords`; discovery separately needs `ListMemories`/`GetMemory`. `CreateMemory` is only for approved provisioning. `CreateEvent` is only for separately authorized uploads; `DeleteMemoryRecord` is separate deletion authority. Do not add administrator permissions or expand IAM automatically; report missing operations for the owner to review. Explain raw event retention versus long-term storage costs before creation. No test writes, history backfill or automatic preference adoption by default. Synthetic-event testing needs separate explicit authorization and disposable scope; Darwin's live suite tests event acceptance, not full extraction.
111
+
112
+ ## 4. Apply only the approved configuration
113
+
114
+ After explicit confirmation, merge only the approved root `agentCoreMemory` fields into private `~/.darwin/config.json`. Preserve ALL unrelated model/provider, permissions, local memory, trajectory and other settings. Never replace the entire existing config with this example. Validate JSON before/after, show only the changed nonsecret fields, and keep config mode `0600`. Store no credentials in config or committed files. New config omits `cliPath`; remove only legacy `agentCoreMemory.cliPath` after explaining and confirming, never removing other fields to “migrate”.
115
+
116
+ Config template (all capitalized placeholder values must be replaced with confirmed identity / actual AWS-returned IDs):
117
+
118
+ ```json
119
+ {
120
+ "agentCoreMemory": {
121
+ "enabled": true,
122
+ "region": "us-west-2",
123
+ "memoryId": "MEMORY_ID_FROM_AWS",
124
+ "episodicStrategyId": "EPISODIC_STRATEGY_ID_FROM_AWS",
125
+ "preferenceStrategyId": "PREFERENCE_STRATEGY_ID_FROM_AWS",
126
+ "actorId": "USER_CONFIRMED_ACTOR_ID",
127
+ "timeoutMs": 5000,
128
+ "preferences": true,
129
+ "upload": "manual"
130
+ }
131
+ }
132
+ ```
133
+
134
+ Confirmed choices override all example defaults, not only the capitalized placeholders: use the confirmed `region`, `upload` (including `off`), `preferences` (including `false`), and `timeoutMs`. Preserve those choices instead of resetting them to `manual`, `true`, or `5000`; validate the exact merged config against the confirmed settings before writing. Memory ID must be an actual returned ID; the two strategy IDs must be distinct and use the actor segment grammar above. Do not set a global `projectId` default: omission derives automatic isolation from the canonical project key. Only when deliberately sharing checkouts, confirm explicit `projectId` matching `[a-z0-9][a-z0-9_-]{0,63}` (lowercase, 1–64 characters). This config camelCase field maps to lowercase AWS namespace variable `projectid`. Timeout accepts 100–15000 ms. Setup writes support `off` or `manual`; proposal `manual` differs from the runtime's default `off`. Project auto is available only through the user's separate `/cloud-memory auto` authority, never this setup writer. Unknown config fields are rejected.
135
+
136
+ Restart the runtime after config changes. The current session's tool catalogue does not magically refresh; do not pretend newly enabled recall tools already exist.
137
+
138
+ ## 5. After approved setup/repair: verify and hand off
139
+
140
+ Repeat section 1's local and read-only checks against the approved configuration, without displaying preference content. In a new session, gated `episodic_recall` with `intent` and `reflection_recall` with `useCase`, if available, check scoped reads. Queries describe target task intent/use case, never raw logs. An empty new store is valid connectivity, NOT proof of ingestion, extraction, nonempty-record handling or IAM write permission. Command expansion itself has no cloud side effects. Report actionable bounded failures without raw API errors or secrets. After a repeated equivalent failure require a new evidence-backed hypothesis; after three stop/report, do not loop.
141
+
142
+ Hand the following controls to the **user**, not another model tool call:
143
+
144
+ ```text
145
+ /cloud-memory preferences
146
+ /cloud-memory inspect <record-id>
147
+ /cloud-memory confirm <record-id> <hash> global
148
+ /cloud-memory pending
149
+ /cloud-memory preview <token>
150
+ /cloud-memory send <token> <preview-hash>
151
+ /cloud-memory discard <token>
152
+ ```
153
+
154
+ Preferences need inspection and the user's explicit adoption of the displayed hash as an enduring cross-project preference. Never seed preferences automatically. Manual upload means preview exact bytes and confidentiality risks before the user sends; decline with discard. Hashes prove data integrity, not human consent. Mutation controls are TUI user-only; standalone CLI is read-only (`status`, `preferences`, `inspect`, `pending`, `preview`). Never fake human confirmation via bash, SDK calls, pty input, or another channel.
155
+
156
+ The manual projection contains bounded literal **USER goals**, **TOOL evidence**, and **OTHER source/outcome/omissions**. Every public textual tool argument/result is eligible, including arbitrary MCP tools, free-form logs, file/diff content, skills, memory results and public subagent reports. It excludes all assistant prose/reasoning and binary/images; it never traverses child conversations, reads tool paths or hydrates offload/archive content. Execution evidence is captured before after-tool hooks, not necessarily as finally shown to the model; observed public fallback results are labelled when no execution snapshot exists. This is not a confidentiality guarantee: tool content can include secrets. No automatic uploads, history backfill, test writes or preference adoption belong to setup.
157
+
158
+ For this setup/repair branch, finish with a checklist report: resource reused/created and resource plus both strategy ACTIVE states only if actually checked (otherwise unverified); confirmed actor and region; namespace/project isolation; exactly which config fields changed; upload mode; local check versus live read results versus **unverified extraction**; restart only if config changed, and next user commands. The unchanged healthy branch uses section 1's short stop report, not this provisioning checklist. If waiting for an answer, permission, installation, ACTIVE state or verification, report **pending**, not complete.
@@ -3,7 +3,7 @@ export declare const SKILL_FILENAME = "SKILL.md";
3
3
  export declare const SKILLS_DIRNAME = "skills";
4
4
  /** Assets live beside this module in both `src/` and copied `dist/src/` output. */
5
5
  export declare const BUILTIN_SKILLS_DIR: string;
6
- export declare const REQUIRED_BUILTIN_SKILLS: readonly ['developer', 'self-evolution-research', 'self-reflection'];
6
+ export declare const REQUIRED_BUILTIN_SKILLS: readonly ['developer', 'self-evolution-research', 'self-reflection', 'setup-agentcore-memory'];
7
7
  /** A skill directory that could not be used, kept so the UI can surface it. */
8
8
  export interface SkillProblem {
9
9
  directory: string;
@@ -7,7 +7,7 @@ export const SKILL_FILENAME = 'SKILL.md';
7
7
  export const SKILLS_DIRNAME = 'skills';
8
8
  /** Assets live beside this module in both `src/` and copied `dist/src/` output. */
9
9
  export const BUILTIN_SKILLS_DIR = fileURLToPath(new URL('./builtin', import.meta.url));
10
- export const REQUIRED_BUILTIN_SKILLS = ['developer', 'self-evolution-research', 'self-reflection'];
10
+ export const REQUIRED_BUILTIN_SKILLS = ['developer', 'self-evolution-research', 'self-reflection', 'setup-agentcore-memory'];
11
11
  /**
12
12
  * Scans bundled, project and global skill directories.
13
13
  *
@@ -106,6 +106,9 @@ async function scanDirectory(skillsDir, entries, owner, skills, problems, seen)
106
106
  problems.push({ directory, reason: parsed.reason });
107
107
  continue;
108
108
  }
109
+ if (owner === 'built-in' && parsed.instructions.trim() === '') {
110
+ throw new Error(`Invalid built-in skill at ${directory}: instructions are empty`);
111
+ }
109
112
  const key = parsed.name.toLowerCase();
110
113
  const duplicateOf = seen.get(key);
111
114
  if (duplicateOf !== undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/skills/loader.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEvC,mFAAmF;AACnF,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,WAAW,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,WAAW,EAAE,yBAAyB,EAAE,iBAAiB,CAAU,CAAC;AAgB5G;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,IAAY,EACZ,OAAO,GAAkC,EAAE;IAE3C,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,kBAAkB,CAAC;IACxE,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAmB,EAAE,CAAC;IACpC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAoD,CAAC;IAEzE,MAAM,cAAc,GAAG,mBAAmB,CACxC,MAAM,OAAO,CAAC,gBAAgB,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CACzD,CAAC;IACF,MAAM,aAAa,CAAC,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,MA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/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AACnG,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
@@ -44,16 +44,22 @@ export declare class BackgroundBashManager {
44
44
  private readonly tasks;
45
45
  private readonly launches;
46
46
  private readonly listeners;
47
+ private readonly activityListeners;
47
48
  private readonly outputDirectory;
48
49
  private readonly shutdownController;
49
50
  private closing;
50
51
  constructor(projectRoot: string, sessionId: string, openFile?: typeof open);
51
- start(command: string): Promise<BackgroundStartResult>;
52
+ start(command: string, env?: NodeJS.ProcessEnv): Promise<BackgroundStartResult>;
52
53
  status(taskId: string): Promise<BackgroundTaskStatus>;
53
54
  /** Snapshots every current-runtime task in deterministic launch order. */
54
55
  list(): Promise<BackgroundTaskStatus[]>;
55
56
  /** Subscribes to future terminal transitions; completed tasks are not replayed. */
56
57
  subscribe(listener: BackgroundTaskListener): () => void;
58
+ /** Synchronous, metadata-only projection; never opens logs or advances a cursor. */
59
+ get runningCount(): number;
60
+ /** Start/terminal changes only. Separate from the terminal-only wake subscription. */
61
+ subscribeActivity(listener: () => void | Promise<void>): () => void;
62
+ private publishActivity;
57
63
  output(taskId: string): Promise<BackgroundOutputResult>;
58
64
  wait(taskId: string, waitMs: number, signal?: AbortSignal, wakeOnOutput?: boolean): Promise<BackgroundWaitResult>;
59
65
  private waitForTerminal;
@@ -90,8 +96,14 @@ declare const inputSchema: z.ZodObject<{
90
96
  }, z.core.$strict>;
91
97
  type BackgroundBashInput = z.infer<typeof inputSchema>;
92
98
  type BackgroundBashOutput = BashOutput | string | BackgroundStartResult | BackgroundTaskStatus | BackgroundTaskStatus[] | BackgroundOutputResult | BackgroundWaitResult;
93
- /** Configures the pinned SDK foreground tool from Darwin's verified project root. */
94
- export declare function createForegroundBashTool(projectRoot: string): InvokableTool<BashInput, BashOutput | string>;
99
+ /**
100
+ * Configures the pinned SDK foreground tool from Darwin's verified project root and,
101
+ * when given, the environment its persistent shells inherit (SER-082: the runtime
102
+ * passes `scrubShellEnv(...).env`, computed once per `create()`). Omitted, the
103
+ * SDK keeps `process.env` exactly as before — the option is the only seam touched;
104
+ * execution stays the SDK's.
105
+ */
106
+ export declare function createForegroundBashTool(projectRoot: string, env?: Record<string, string>): InvokableTool<BashInput, BashOutput | string>;
95
107
  export interface BackgroundBashToolOptions {
96
108
  /**
97
109
  * The driver drains SER-069 task wakes at idle, so a job's completion really does reach
@@ -100,5 +112,11 @@ export interface BackgroundBashToolOptions {
100
112
  * (a child's job wakes the parent, not the child). Default false.
101
113
  */
102
114
  completionWakes?: boolean;
115
+ /**
116
+ * Environment for `start` jobs — the same scrubbed map the foreground tool was built
117
+ * with, so a background job cannot see what the persistent shell cannot (SER-082).
118
+ * Absent keeps `process.env`, as before the scrub existed.
119
+ */
120
+ env?: Record<string, string>;
103
121
  }
104
122
  export declare function createBackgroundBashTool(manager: BackgroundBashManager, foreground?: InvokableTool<BashInput, BashOutput | string>, options?: BackgroundBashToolOptions): InvokableTool<BackgroundBashInput, BackgroundBashOutput>;
@@ -39,6 +39,7 @@ export class BackgroundBashManager {
39
39
  tasks = new Map();
40
40
  launches = new Set();
41
41
  listeners = new Set();
42
+ activityListeners = new Set();
42
43
  outputDirectory;
43
44
  shutdownController = new AbortController();
44
45
  closing = false;
@@ -48,12 +49,12 @@ export class BackgroundBashManager {
48
49
  this.outputDirectory = path.join(sessionPaths(projectRoot).sessionsDir, sessionId, 'background');
49
50
  installExitCleanup();
50
51
  }
51
- start(command) {
52
+ start(command, env = process.env) {
52
53
  if (this.closing)
53
54
  return Promise.reject(new Error('Background bash manager is shutting down'));
54
55
  // Register the whole launch before its first asynchronous setup completes. shutdown()
55
56
  // latches `closing`, waits this set, and only then takes its stop snapshot.
56
- const launch = this.launch(command);
57
+ const launch = this.launch(command, env);
57
58
  this.launches.add(launch);
58
59
  void launch.then(() => this.launches.delete(launch), () => this.launches.delete(launch));
59
60
  return launch;
@@ -71,6 +72,29 @@ export class BackgroundBashManager {
71
72
  this.listeners.add(listener);
72
73
  return () => this.listeners.delete(listener);
73
74
  }
75
+ /** Synchronous, metadata-only projection; never opens logs or advances a cursor. */
76
+ get runningCount() {
77
+ let count = 0;
78
+ for (const task of this.tasks.values())
79
+ if (task.state === 'running')
80
+ count += 1;
81
+ return count;
82
+ }
83
+ /** Start/terminal changes only. Separate from the terminal-only wake subscription. */
84
+ subscribeActivity(listener) {
85
+ this.activityListeners.add(listener);
86
+ return () => this.activityListeners.delete(listener);
87
+ }
88
+ publishActivity() {
89
+ for (const listener of [...this.activityListeners]) {
90
+ try {
91
+ Promise.resolve(listener()).catch(() => undefined);
92
+ }
93
+ catch {
94
+ // A display observer must not fail a launch or process cleanup.
95
+ }
96
+ }
97
+ }
74
98
  async output(taskId) {
75
99
  const task = this.lookup(taskId);
76
100
  return this.serialize(task, () => this.readOutput(task));
@@ -217,7 +241,7 @@ export class BackgroundBashManager {
217
241
  const running = [...this.tasks.values()].filter((task) => task.state === 'running');
218
242
  await Promise.allSettled(running.map((task) => this.stop(task.id)));
219
243
  }
220
- async launch(command) {
244
+ async launch(command, env) {
221
245
  const id = `bg-${randomUUID()}`;
222
246
  await mkdir(this.outputDirectory, { recursive: true });
223
247
  const outputPath = path.join(this.outputDirectory, `${id}.log`);
@@ -237,9 +261,12 @@ export class BackgroundBashManager {
237
261
  // setup either prevents spawn here or waits for this launch and then sees the task.
238
262
  if (this.closing)
239
263
  throw new Error('Background bash manager is shutting down');
264
+ // `env` is what the runtime handed the tool (SER-082: the scrubbed map, the
265
+ // same one the persistent foreground shell inherits); a bare `start` keeps
266
+ // `process.env`. `-l` still reads the user's own profile files.
240
267
  child = spawn('/bin/bash', ['-lc', command], {
241
268
  cwd: this.projectRoot,
242
- env: process.env,
269
+ env,
243
270
  detached: true,
244
271
  stdio: ['ignore', handle.fd, handle.fd],
245
272
  });
@@ -303,6 +330,7 @@ export class BackgroundBashManager {
303
330
  serial: Promise.resolve(),
304
331
  };
305
332
  this.tasks.set(id, task);
333
+ this.publishActivity();
306
334
  void closed.then(({ code, signal }) => {
307
335
  task.exitCode = code;
308
336
  task.signal = signal;
@@ -325,6 +353,7 @@ export class BackgroundBashManager {
325
353
  return;
326
354
  task.state = state;
327
355
  task.finishedAt = new Date().toISOString();
356
+ this.publishActivity();
328
357
  // Notification delivery must survive diagnostic-file failures. snapshot()
329
358
  // already degrades open/stat problems to outputBytes:null; keep close errors in
330
359
  // that same domain instead of turning a completed task into a missing event.
@@ -598,12 +627,19 @@ const inputSchema = z.object({
598
627
  context.addIssue({ code: 'custom', path: ['wakeOnOutput'], message: `wakeOnOutput is not accepted in ${input.mode} mode` });
599
628
  }
600
629
  });
601
- /** Configures the pinned SDK foreground tool from Darwin's verified project root. */
602
- export function createForegroundBashTool(projectRoot) {
603
- return createBash({ cwd: projectRoot, projectRoot });
630
+ /**
631
+ * Configures the pinned SDK foreground tool from Darwin's verified project root and,
632
+ * when given, the environment its persistent shells inherit (SER-082: the runtime
633
+ * passes `scrubShellEnv(...).env`, computed once per `create()`). Omitted, the
634
+ * SDK keeps `process.env` exactly as before — the option is the only seam touched;
635
+ * execution stays the SDK's.
636
+ */
637
+ export function createForegroundBashTool(projectRoot, env) {
638
+ return createBash({ cwd: projectRoot, projectRoot, ...(env !== undefined && { env }) });
604
639
  }
605
640
  export function createBackgroundBashTool(manager, foreground = sdkBash, options = {}) {
606
641
  const completionWakes = options.completionWakes === true;
642
+ const jobEnv = options.env;
607
643
  return tool({
608
644
  name: 'bash',
609
645
  description: 'Runs foreground commands in a persistent shell and session-owned background commands. ' +
@@ -622,7 +658,7 @@ export function createBackgroundBashTool(manager, foreground = sdkBash, options
622
658
  case 'restart':
623
659
  return foreground.invoke(input, context);
624
660
  case 'start':
625
- return manager.start(input.command);
661
+ return jobEnv === undefined ? manager.start(input.command) : manager.start(input.command, jobEnv);
626
662
  case 'list':
627
663
  return manager.list();
628
664
  case 'status':