@bastani/atomic 0.9.5-alpha.5 → 0.9.5-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/builtin/cursor/package.json +2 -2
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +6 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +8 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +2 -0
- package/dist/builtin/workflows/src/runs/foreground/stage-tool-execution-buffer.ts +47 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-pending-tools.ts +9 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-render-settings.ts +27 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +5 -6
- package/dist/core/extensions/loader-core.d.ts.map +1 -1
- package/dist/core/extensions/loader-core.js +6 -0
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/model-resolver-scope.d.ts +9 -0
- package/dist/core/model-resolver-scope.d.ts.map +1 -1
- package/dist/core/model-resolver-scope.js +12 -4
- package/dist/core/model-resolver-scope.js.map +1 -1
- package/dist/core/model-resolver.d.ts +3 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/resource-loader-extensions.d.ts.map +1 -1
- package/dist/core/resource-loader-extensions.js +4 -0
- package/dist/core/resource-loader-extensions.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +11 -0
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-core.js +3 -2
- package/dist/core/settings-manager-core.js.map +1 -1
- package/dist/core/settings-storage.d.ts.map +1 -1
- package/dist/core/settings-storage.js +2 -1
- package/dist/core/settings-storage.js.map +1 -1
- package/dist/core/trust-manager.d.ts +9 -0
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +44 -2
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main-deferred-startup.d.ts +19 -0
- package/dist/main-deferred-startup.d.ts.map +1 -0
- package/dist/main-deferred-startup.js +21 -0
- package/dist/main-deferred-startup.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +24 -22
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.d.ts +2 -1
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +34 -1
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +2 -2
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +2 -2
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts +5 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +2 -2
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/utils/child-process.d.ts +8 -1
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +39 -6
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/event-loop.d.ts +7 -0
- package/dist/utils/event-loop.d.ts.map +1 -0
- package/dist/utils/event-loop.js +14 -0
- package/dist/utils/event-loop.js.map +1 -0
- package/dist/utils/json.d.ts +4 -0
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/json.js +8 -0
- package/dist/utils/json.js.map +1 -1
- package/docs/settings.md +5 -1
- package/docs/workflows.md +1 -1
- package/npm-shrinkwrap.json +23 -23
- package/package.json +2 -2
|
@@ -3,6 +3,8 @@ import { basename } from "node:path";
|
|
|
3
3
|
import crossSpawn from "cross-spawn";
|
|
4
4
|
const EXIT_STDIO_IDLE_GRACE_MS = 100;
|
|
5
5
|
const EXIT_STDIO_ACTIVE_DRAIN_HARD_CAP_MS = 5_000;
|
|
6
|
+
const WINDOWS_EXIT_POLL_INTERVAL_MS = 50;
|
|
7
|
+
const WINDOWS_EXIT_CODE_GRACE_MS = 1_000;
|
|
6
8
|
const WINDOWS_SHELL_COMMANDS = new Set(["bun", "npm", "npx", "pnpm", "yarn", "yarnpkg", "corepack"]);
|
|
7
9
|
export function shouldUseWindowsShell(command) {
|
|
8
10
|
if (process.platform !== "win32")
|
|
@@ -37,7 +39,7 @@ function isWindowsProcessAlive(pid) {
|
|
|
37
39
|
* after the grace elapses. A longer active-drain hard cap is armed once on `exit`
|
|
38
40
|
* so an endlessly noisy descendant cannot keep the wait pending forever.
|
|
39
41
|
*/
|
|
40
|
-
export function waitForChildProcess(child) {
|
|
42
|
+
export function waitForChildProcess(child, options = {}) {
|
|
41
43
|
return new Promise((resolve, reject) => {
|
|
42
44
|
let settled = false;
|
|
43
45
|
let exited = false;
|
|
@@ -47,6 +49,11 @@ export function waitForChildProcess(child) {
|
|
|
47
49
|
let stdoutEnded = child.stdout === null;
|
|
48
50
|
let stderrEnded = child.stderr === null;
|
|
49
51
|
let windowsExitPoll;
|
|
52
|
+
let windowsExitCodeGraceTimer;
|
|
53
|
+
const platform = options.platform ?? process.platform;
|
|
54
|
+
const processAlive = options.isWindowsProcessAlive ?? isWindowsProcessAlive;
|
|
55
|
+
const windowsExitPollIntervalMs = options.windowsExitPollIntervalMs ?? WINDOWS_EXIT_POLL_INTERVAL_MS;
|
|
56
|
+
const windowsExitCodeGraceMs = options.windowsExitCodeGraceMs ?? WINDOWS_EXIT_CODE_GRACE_MS;
|
|
50
57
|
const cleanup = () => {
|
|
51
58
|
if (windowsExitPoll) {
|
|
52
59
|
clearInterval(windowsExitPoll);
|
|
@@ -60,6 +67,10 @@ export function waitForChildProcess(child) {
|
|
|
60
67
|
clearTimeout(postExitActiveDrainHardCapTimer);
|
|
61
68
|
postExitActiveDrainHardCapTimer = undefined;
|
|
62
69
|
}
|
|
70
|
+
if (windowsExitCodeGraceTimer) {
|
|
71
|
+
clearTimeout(windowsExitCodeGraceTimer);
|
|
72
|
+
windowsExitCodeGraceTimer = undefined;
|
|
73
|
+
}
|
|
63
74
|
child.removeListener("error", onError);
|
|
64
75
|
child.removeListener("exit", onExit);
|
|
65
76
|
child.removeListener("close", onClose);
|
|
@@ -116,6 +127,10 @@ export function waitForChildProcess(child) {
|
|
|
116
127
|
reject(err);
|
|
117
128
|
};
|
|
118
129
|
const onExit = (code) => {
|
|
130
|
+
if (windowsExitCodeGraceTimer) {
|
|
131
|
+
clearTimeout(windowsExitCodeGraceTimer);
|
|
132
|
+
windowsExitCodeGraceTimer = undefined;
|
|
133
|
+
}
|
|
119
134
|
exited = true;
|
|
120
135
|
exitCode = code;
|
|
121
136
|
maybeFinalizeAfterExit();
|
|
@@ -124,18 +139,36 @@ export function waitForChildProcess(child) {
|
|
|
124
139
|
armIdleTimer();
|
|
125
140
|
}
|
|
126
141
|
};
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
142
|
+
const armWindowsExitCodeGraceTimer = () => {
|
|
143
|
+
if (windowsExitCodeGraceTimer)
|
|
129
144
|
return;
|
|
130
|
-
if (
|
|
145
|
+
if (windowsExitPoll) {
|
|
146
|
+
clearInterval(windowsExitPoll);
|
|
147
|
+
windowsExitPoll = undefined;
|
|
148
|
+
}
|
|
149
|
+
windowsExitCodeGraceTimer = setTimeout(() => {
|
|
150
|
+
windowsExitCodeGraceTimer = undefined;
|
|
131
151
|
onExit(child.exitCode ?? 0);
|
|
152
|
+
}, windowsExitCodeGraceMs);
|
|
153
|
+
};
|
|
154
|
+
const pollWindowsExit = () => {
|
|
155
|
+
if (platform !== "win32" || !child.pid || exited || settled)
|
|
156
|
+
return;
|
|
157
|
+
if (!processAlive(child.pid)) {
|
|
158
|
+
if (child.exitCode !== null) {
|
|
159
|
+
onExit(child.exitCode);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
armWindowsExitCodeGraceTimer();
|
|
163
|
+
}
|
|
132
164
|
}
|
|
133
165
|
};
|
|
134
166
|
const onClose = (code) => {
|
|
135
167
|
finalize(code);
|
|
136
168
|
};
|
|
137
|
-
if (
|
|
138
|
-
windowsExitPoll = setInterval(pollWindowsExit,
|
|
169
|
+
if (platform === "win32" && child.pid) {
|
|
170
|
+
windowsExitPoll = setInterval(pollWindowsExit, windowsExitPollIntervalMs);
|
|
171
|
+
}
|
|
139
172
|
child.stdout?.once("end", onStdoutEnd);
|
|
140
173
|
child.stderr?.once("end", onStderrEnd);
|
|
141
174
|
child.stdout?.on("data", onData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"child-process.js","sourceRoot":"","sources":["../../src/utils/child-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,IAAI,SAAS,EAClB,SAAS,IAAI,aAAa,GAO1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,mCAAmC,GAAG,KAAK,CAAC;AAClD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAErG,MAAM,UAAU,qBAAqB,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vC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n\ttype ChildProcess,\n\ttype ChildProcessByStdio,\n\tspawn as nodeSpawn,\n\tspawnSync as nodeSpawnSync,\n\ttype SpawnOptions,\n\ttype SpawnOptionsWithStdioTuple,\n\ttype SpawnSyncOptionsWithStringEncoding,\n\ttype SpawnSyncReturns,\n\ttype StdioNull,\n\ttype StdioPipe,\n} from \"node:child_process\";\nimport { basename } from \"node:path\";\nimport type { Readable } from \"node:stream\";\nimport crossSpawn from \"cross-spawn\";\n\nconst EXIT_STDIO_IDLE_GRACE_MS = 100;\nconst EXIT_STDIO_ACTIVE_DRAIN_HARD_CAP_MS = 5_000;\nconst WINDOWS_SHELL_COMMANDS = new Set([\"bun\", \"npm\", \"npx\", \"pnpm\", \"yarn\", \"yarnpkg\", \"corepack\"]);\n\nexport function shouldUseWindowsShell(command: string): boolean {\n\tif (process.platform !== \"win32\") return false;\n\tconst commandName = basename(command).toLowerCase();\n\treturn commandName.endsWith(\".cmd\") || commandName.endsWith(\".bat\") || WINDOWS_SHELL_COMMANDS.has(commandName);\n}\n\nexport function spawnProcess(\n\tcommand: string,\n\targs: string[],\n\toptions: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,\n): ChildProcessByStdio<null, Readable, Readable>;\nexport function spawnProcess(command: string, args: string[], options: SpawnOptions): ChildProcess;\nexport function spawnProcess(command: string, args: string[], options: SpawnOptions): ChildProcess {\n\treturn process.platform === \"win32\" ? crossSpawn(command, args, options) : nodeSpawn(command, args, options);\n}\n\nexport function spawnProcessSync(\n\tcommand: string,\n\targs: string[],\n\toptions: SpawnSyncOptionsWithStringEncoding,\n): SpawnSyncReturns<string> {\n\treturn process.platform === \"win32\"\n\t\t? crossSpawn.sync(command, args, options)\n\t\t: nodeSpawnSync(command, args, options);\n}\n\nfunction isWindowsProcessAlive(pid: number): boolean {\n\tconst result = nodeSpawnSync(\"tasklist\", [\"/FI\", `PID eq ${pid}`, \"/NH\"], { encoding: \"utf-8\", windowsHide: true });\n\tif (result.status !== 0) return true;\n\treturn new RegExp(`\\\\b${pid}\\\\b`).test(result.stdout);\n}\n\n/**\n * Wait for a child process to terminate without hanging on inherited stdio handles.\n *\n * A short-lived child can `exit` while a detached descendant keeps its stdout/stderr\n * pipe open. We must not resolve and destroy the streams on a short fixed deadline\n * measured from `exit`, or finite post-exit output still being written past that\n * deadline is silently lost (earendil-works/pi#5303). Instead, after `exit` we wait\n * for the pipes to fall idle: the grace timer is re-armed on every chunk, so finite\n * post-exit writers drain while active, while a quiet inherited handle (e.g. a\n * Windows daemonized descendant that never lets `close` fire) releases promptly\n * after the grace elapses. A longer active-drain hard cap is armed once on `exit`\n * so an endlessly noisy descendant cannot keep the wait pending forever.\n */\nexport function waitForChildProcess(child: ChildProcess): Promise<number | null> {\n\treturn new Promise((resolve, reject) => {\n\t\tlet settled = false;\n\t\tlet exited = false;\n\t\tlet exitCode: number | null = null;\n\t\tlet postExitIdleTimer: NodeJS.Timeout | undefined;\n\t\tlet postExitActiveDrainHardCapTimer: NodeJS.Timeout | undefined;\n\t\tlet stdoutEnded = child.stdout === null;\n\t\tlet stderrEnded = child.stderr === null;\n\t\tlet windowsExitPoll: NodeJS.Timeout | undefined;\n\n\t\tconst cleanup = () => {\n\t\t\tif (windowsExitPoll) {\n\t\t\t\tclearInterval(windowsExitPoll);\n\t\t\t\twindowsExitPoll = undefined;\n\t\t\t}\n\t\t\tif (postExitIdleTimer) {\n\t\t\t\tclearTimeout(postExitIdleTimer);\n\t\t\t\tpostExitIdleTimer = undefined;\n\t\t\t}\n\t\t\tif (postExitActiveDrainHardCapTimer) {\n\t\t\t\tclearTimeout(postExitActiveDrainHardCapTimer);\n\t\t\t\tpostExitActiveDrainHardCapTimer = undefined;\n\t\t\t}\n\t\t\tchild.removeListener(\"error\", onError);\n\t\t\tchild.removeListener(\"exit\", onExit);\n\t\t\tchild.removeListener(\"close\", onClose);\n\t\t\tchild.stdout?.removeListener(\"end\", onStdoutEnd);\n\t\t\tchild.stderr?.removeListener(\"end\", onStderrEnd);\n\t\t\tchild.stdout?.removeListener(\"data\", onData);\n\t\t\tchild.stderr?.removeListener(\"data\", onData);\n\t\t};\n\n\t\tconst finalize = (code: number | null) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\tchild.stdout?.destroy();\n\t\t\tchild.stderr?.destroy();\n\t\t\tresolve(code);\n\t\t};\n\n\t\tconst maybeFinalizeAfterExit = () => {\n\t\t\tif (!exited || settled) return;\n\t\t\tif (stdoutEnded && stderrEnded) {\n\t\t\t\tfinalize(exitCode);\n\t\t\t}\n\t\t};\n\n\t\tconst armIdleTimer = () => {\n\t\t\tif (postExitIdleTimer) clearTimeout(postExitIdleTimer);\n\t\t\tpostExitIdleTimer = setTimeout(() => finalize(exitCode), EXIT_STDIO_IDLE_GRACE_MS);\n\t\t};\n\n\t\tconst armActiveDrainHardCapTimer = () => {\n\t\t\tif (postExitActiveDrainHardCapTimer) return;\n\t\t\tpostExitActiveDrainHardCapTimer = setTimeout(\n\t\t\t\t() => finalize(exitCode),\n\t\t\t\tEXIT_STDIO_ACTIVE_DRAIN_HARD_CAP_MS,\n\t\t\t);\n\t\t};\n\n\t\tconst onData = () => {\n\t\t\t// Output is still arriving after exit; keep extending the idle grace\n\t\t\t// so active finite writers can drain without truncating the tail.\n\t\t\tif (exited && !settled) armIdleTimer();\n\t\t};\n\n\t\tconst onStdoutEnd = () => {\n\t\t\tstdoutEnded = true;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t};\n\n\t\tconst onStderrEnd = () => {\n\t\t\tstderrEnded = true;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t};\n\n\t\tconst onError = (err: Error) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\treject(err);\n\t\t};\n\n\t\tconst onExit = (code: number | null) => {\n\t\t\texited = true;\n\t\t\texitCode = code;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t\tif (!settled) {\n\t\t\t\tarmActiveDrainHardCapTimer();\n\t\t\t\tarmIdleTimer();\n\t\t\t}\n\t\t};\n\n\t\tconst pollWindowsExit = () => {\n\t\t\tif (process.platform !== \"win32\" || !child.pid || exited || settled) return;\n\t\t\tif (!isWindowsProcessAlive(child.pid)) {\n\t\t\t\tonExit(child.exitCode ?? 0);\n\t\t\t}\n\t\t};\n\n\t\tconst onClose = (code: number | null) => {\n\t\t\tfinalize(code);\n\t\t};\n\n\t\tif (process.platform === \"win32\" && child.pid) windowsExitPoll = setInterval(pollWindowsExit, 50);\n\t\tchild.stdout?.once(\"end\", onStdoutEnd);\n\t\tchild.stderr?.once(\"end\", onStderrEnd);\n\t\tchild.stdout?.on(\"data\", onData);\n\t\tchild.stderr?.on(\"data\", onData);\n\t\tchild.once(\"error\", onError);\n\t\tchild.once(\"exit\", onExit);\n\t\tchild.once(\"close\", onClose);\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"child-process.js","sourceRoot":"","sources":["../../src/utils/child-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,IAAI,SAAS,EAClB,SAAS,IAAI,aAAa,GAO1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,mCAAmC,GA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,WAAW,CAAC,CAAC;QACvC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACvC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n\ttype ChildProcess,\n\ttype ChildProcessByStdio,\n\tspawn as nodeSpawn,\n\tspawnSync as nodeSpawnSync,\n\ttype SpawnOptions,\n\ttype SpawnOptionsWithStdioTuple,\n\ttype SpawnSyncOptionsWithStringEncoding,\n\ttype SpawnSyncReturns,\n\ttype StdioNull,\n\ttype StdioPipe,\n} from \"node:child_process\";\nimport { basename } from \"node:path\";\nimport type { Readable } from \"node:stream\";\nimport crossSpawn from \"cross-spawn\";\n\nconst EXIT_STDIO_IDLE_GRACE_MS = 100;\nconst EXIT_STDIO_ACTIVE_DRAIN_HARD_CAP_MS = 5_000;\nconst WINDOWS_EXIT_POLL_INTERVAL_MS = 50;\nconst WINDOWS_EXIT_CODE_GRACE_MS = 1_000;\n\ntype WaitForChildProcessOptions = {\n\tplatform?: NodeJS.Platform;\n\tisWindowsProcessAlive?: (pid: number) => boolean;\n\twindowsExitPollIntervalMs?: number;\n\twindowsExitCodeGraceMs?: number;\n};\n\nconst WINDOWS_SHELL_COMMANDS = new Set([\"bun\", \"npm\", \"npx\", \"pnpm\", \"yarn\", \"yarnpkg\", \"corepack\"]);\n\nexport function shouldUseWindowsShell(command: string): boolean {\n\tif (process.platform !== \"win32\") return false;\n\tconst commandName = basename(command).toLowerCase();\n\treturn commandName.endsWith(\".cmd\") || commandName.endsWith(\".bat\") || WINDOWS_SHELL_COMMANDS.has(commandName);\n}\n\nexport function spawnProcess(\n\tcommand: string,\n\targs: string[],\n\toptions: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,\n): ChildProcessByStdio<null, Readable, Readable>;\nexport function spawnProcess(command: string, args: string[], options: SpawnOptions): ChildProcess;\nexport function spawnProcess(command: string, args: string[], options: SpawnOptions): ChildProcess {\n\treturn process.platform === \"win32\" ? crossSpawn(command, args, options) : nodeSpawn(command, args, options);\n}\n\nexport function spawnProcessSync(\n\tcommand: string,\n\targs: string[],\n\toptions: SpawnSyncOptionsWithStringEncoding,\n): SpawnSyncReturns<string> {\n\treturn process.platform === \"win32\"\n\t\t? crossSpawn.sync(command, args, options)\n\t\t: nodeSpawnSync(command, args, options);\n}\n\nfunction isWindowsProcessAlive(pid: number): boolean {\n\tconst result = nodeSpawnSync(\"tasklist\", [\"/FI\", `PID eq ${pid}`, \"/NH\"], { encoding: \"utf-8\", windowsHide: true });\n\tif (result.status !== 0) return true;\n\treturn new RegExp(`\\\\b${pid}\\\\b`).test(result.stdout);\n}\n\n/**\n * Wait for a child process to terminate without hanging on inherited stdio handles.\n *\n * A short-lived child can `exit` while a detached descendant keeps its stdout/stderr\n * pipe open. We must not resolve and destroy the streams on a short fixed deadline\n * measured from `exit`, or finite post-exit output still being written past that\n * deadline is silently lost (earendil-works/pi#5303). Instead, after `exit` we wait\n * for the pipes to fall idle: the grace timer is re-armed on every chunk, so finite\n * post-exit writers drain while active, while a quiet inherited handle (e.g. a\n * Windows daemonized descendant that never lets `close` fire) releases promptly\n * after the grace elapses. A longer active-drain hard cap is armed once on `exit`\n * so an endlessly noisy descendant cannot keep the wait pending forever.\n */\nexport function waitForChildProcess(child: ChildProcess, options: WaitForChildProcessOptions = {}): Promise<number | null> {\n\treturn new Promise((resolve, reject) => {\n\t\tlet settled = false;\n\t\tlet exited = false;\n\t\tlet exitCode: number | null = null;\n\t\tlet postExitIdleTimer: NodeJS.Timeout | undefined;\n\t\tlet postExitActiveDrainHardCapTimer: NodeJS.Timeout | undefined;\n\t\tlet stdoutEnded = child.stdout === null;\n\t\tlet stderrEnded = child.stderr === null;\n\t\tlet windowsExitPoll: NodeJS.Timeout | undefined;\n\t\tlet windowsExitCodeGraceTimer: NodeJS.Timeout | undefined;\n\t\tconst platform = options.platform ?? process.platform;\n\t\tconst processAlive = options.isWindowsProcessAlive ?? isWindowsProcessAlive;\n\t\tconst windowsExitPollIntervalMs = options.windowsExitPollIntervalMs ?? WINDOWS_EXIT_POLL_INTERVAL_MS;\n\t\tconst windowsExitCodeGraceMs = options.windowsExitCodeGraceMs ?? WINDOWS_EXIT_CODE_GRACE_MS;\n\n\t\tconst cleanup = () => {\n\t\t\tif (windowsExitPoll) {\n\t\t\t\tclearInterval(windowsExitPoll);\n\t\t\t\twindowsExitPoll = undefined;\n\t\t\t}\n\t\t\tif (postExitIdleTimer) {\n\t\t\t\tclearTimeout(postExitIdleTimer);\n\t\t\t\tpostExitIdleTimer = undefined;\n\t\t\t}\n\t\t\tif (postExitActiveDrainHardCapTimer) {\n\t\t\t\tclearTimeout(postExitActiveDrainHardCapTimer);\n\t\t\t\tpostExitActiveDrainHardCapTimer = undefined;\n\t\t\t}\n\t\t\tif (windowsExitCodeGraceTimer) {\n\t\t\t\tclearTimeout(windowsExitCodeGraceTimer);\n\t\t\t\twindowsExitCodeGraceTimer = undefined;\n\t\t\t}\n\t\t\tchild.removeListener(\"error\", onError);\n\t\t\tchild.removeListener(\"exit\", onExit);\n\t\t\tchild.removeListener(\"close\", onClose);\n\t\t\tchild.stdout?.removeListener(\"end\", onStdoutEnd);\n\t\t\tchild.stderr?.removeListener(\"end\", onStderrEnd);\n\t\t\tchild.stdout?.removeListener(\"data\", onData);\n\t\t\tchild.stderr?.removeListener(\"data\", onData);\n\t\t};\n\n\t\tconst finalize = (code: number | null) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\tchild.stdout?.destroy();\n\t\t\tchild.stderr?.destroy();\n\t\t\tresolve(code);\n\t\t};\n\n\t\tconst maybeFinalizeAfterExit = () => {\n\t\t\tif (!exited || settled) return;\n\t\t\tif (stdoutEnded && stderrEnded) {\n\t\t\t\tfinalize(exitCode);\n\t\t\t}\n\t\t};\n\n\t\tconst armIdleTimer = () => {\n\t\t\tif (postExitIdleTimer) clearTimeout(postExitIdleTimer);\n\t\t\tpostExitIdleTimer = setTimeout(() => finalize(exitCode), EXIT_STDIO_IDLE_GRACE_MS);\n\t\t};\n\n\t\tconst armActiveDrainHardCapTimer = () => {\n\t\t\tif (postExitActiveDrainHardCapTimer) return;\n\t\t\tpostExitActiveDrainHardCapTimer = setTimeout(\n\t\t\t\t() => finalize(exitCode),\n\t\t\t\tEXIT_STDIO_ACTIVE_DRAIN_HARD_CAP_MS,\n\t\t\t);\n\t\t};\n\n\t\tconst onData = () => {\n\t\t\t// Output is still arriving after exit; keep extending the idle grace\n\t\t\t// so active finite writers can drain without truncating the tail.\n\t\t\tif (exited && !settled) armIdleTimer();\n\t\t};\n\n\t\tconst onStdoutEnd = () => {\n\t\t\tstdoutEnded = true;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t};\n\n\t\tconst onStderrEnd = () => {\n\t\t\tstderrEnded = true;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t};\n\n\t\tconst onError = (err: Error) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\treject(err);\n\t\t};\n\n\t\tconst onExit = (code: number | null) => {\n\t\t\tif (windowsExitCodeGraceTimer) {\n\t\t\t\tclearTimeout(windowsExitCodeGraceTimer);\n\t\t\t\twindowsExitCodeGraceTimer = undefined;\n\t\t\t}\n\t\t\texited = true;\n\t\t\texitCode = code;\n\t\t\tmaybeFinalizeAfterExit();\n\t\t\tif (!settled) {\n\t\t\t\tarmActiveDrainHardCapTimer();\n\t\t\t\tarmIdleTimer();\n\t\t\t}\n\t\t};\n\n\t\tconst armWindowsExitCodeGraceTimer = () => {\n\t\t\tif (windowsExitCodeGraceTimer) return;\n\t\t\tif (windowsExitPoll) {\n\t\t\t\tclearInterval(windowsExitPoll);\n\t\t\t\twindowsExitPoll = undefined;\n\t\t\t}\n\t\t\twindowsExitCodeGraceTimer = setTimeout(() => {\n\t\t\t\twindowsExitCodeGraceTimer = undefined;\n\t\t\t\tonExit(child.exitCode ?? 0);\n\t\t\t}, windowsExitCodeGraceMs);\n\t\t};\n\n\t\tconst pollWindowsExit = () => {\n\t\t\tif (platform !== \"win32\" || !child.pid || exited || settled) return;\n\t\t\tif (!processAlive(child.pid)) {\n\t\t\t\tif (child.exitCode !== null) {\n\t\t\t\t\tonExit(child.exitCode);\n\t\t\t\t} else {\n\t\t\t\t\tarmWindowsExitCodeGraceTimer();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst onClose = (code: number | null) => {\n\t\t\tfinalize(code);\n\t\t};\n\n\t\tif (platform === \"win32\" && child.pid) {\n\t\t\twindowsExitPoll = setInterval(pollWindowsExit, windowsExitPollIntervalMs);\n\t\t}\n\t\tchild.stdout?.once(\"end\", onStdoutEnd);\n\t\tchild.stderr?.once(\"end\", onStderrEnd);\n\t\tchild.stdout?.on(\"data\", onData);\n\t\tchild.stderr?.on(\"data\", onData);\n\t\tchild.once(\"error\", onError);\n\t\tchild.once(\"exit\", onExit);\n\t\tchild.once(\"close\", onClose);\n\t});\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Yield to the macrotask queue so terminal input, timers, and render work can
|
|
3
|
+
* run between otherwise synchronous startup chunks.
|
|
4
|
+
*/
|
|
5
|
+
export declare function yieldToEventLoop(): Promise<void>;
|
|
6
|
+
export declare function yieldToEventLoopIfSlow(startedAt: number, thresholdMs?: number): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=event-loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-loop.d.ts","sourceRoot":"","sources":["../../src/utils/event-loop.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEtD;AAED,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,SAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/F","sourcesContent":["import { setImmediate as waitForImmediate } from \"node:timers/promises\";\n\n/**\n * Yield to the macrotask queue so terminal input, timers, and render work can\n * run between otherwise synchronous startup chunks.\n */\nexport async function yieldToEventLoop(): Promise<void> {\n\tawait waitForImmediate();\n}\n\nexport async function yieldToEventLoopIfSlow(startedAt: number, thresholdMs = 16): Promise<void> {\n\tif (Date.now() - startedAt >= thresholdMs) {\n\t\tawait yieldToEventLoop();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { setImmediate as waitForImmediate } from "node:timers/promises";
|
|
2
|
+
/**
|
|
3
|
+
* Yield to the macrotask queue so terminal input, timers, and render work can
|
|
4
|
+
* run between otherwise synchronous startup chunks.
|
|
5
|
+
*/
|
|
6
|
+
export async function yieldToEventLoop() {
|
|
7
|
+
await waitForImmediate();
|
|
8
|
+
}
|
|
9
|
+
export async function yieldToEventLoopIfSlow(startedAt, thresholdMs = 16) {
|
|
10
|
+
if (Date.now() - startedAt >= thresholdMs) {
|
|
11
|
+
await yieldToEventLoop();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=event-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-loop.js","sourceRoot":"","sources":["../../src/utils/event-loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACrC,MAAM,gBAAgB,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,SAAiB,EAAE,WAAW,GAAG,EAAE;IAC/E,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI,WAAW,EAAE,CAAC;QAC3C,MAAM,gBAAgB,EAAE,CAAC;IAC1B,CAAC;AACF,CAAC","sourcesContent":["import { setImmediate as waitForImmediate } from \"node:timers/promises\";\n\n/**\n * Yield to the macrotask queue so terminal input, timers, and render work can\n * run between otherwise synchronous startup chunks.\n */\nexport async function yieldToEventLoop(): Promise<void> {\n\tawait waitForImmediate();\n}\n\nexport async function yieldToEventLoopIfSlow(startedAt: number, thresholdMs = 16): Promise<void> {\n\tif (Date.now() - startedAt >= thresholdMs) {\n\t\tawait yieldToEventLoop();\n\t}\n}\n"]}
|
package/dist/utils/json.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
/** Strip `//` line comments and trailing commas from JSON, leaving string literals untouched. */
|
|
2
2
|
export declare function stripJsonComments(input: string): string;
|
|
3
|
+
/** Strip one leading UTF-8 BOM (U+FEFF) before JSON parsing. */
|
|
4
|
+
export declare function stripJsonBom(input: string): string;
|
|
5
|
+
/** Parse JSON read from disk, accepting files that start with a UTF-8 BOM. */
|
|
6
|
+
export declare function parseJsonFileContent(input: string): unknown;
|
|
3
7
|
//# sourceMappingURL=json.d.ts.map
|
package/dist/utils/json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvD","sourcesContent":["/** Strip `//` line comments and trailing commas from JSON, leaving string literals untouched. */\nexport function stripJsonComments(input: string): string {\n\treturn input\n\t\t.replace(/\"(?:\\\\.|[^\"\\\\])*\"|\\/\\/[^\\n]*/g, (m) => (m[0] === '\"' ? m : \"\"))\n\t\t.replace(/\"(?:\\\\.|[^\"\\\\])*\"|,(\\s*[}\\]])/g, (m, tail) => tail ?? (m[0] === '\"' ? m : \"\"));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE3D","sourcesContent":["/** Strip `//` line comments and trailing commas from JSON, leaving string literals untouched. */\nexport function stripJsonComments(input: string): string {\n\treturn input\n\t\t.replace(/\"(?:\\\\.|[^\"\\\\])*\"|\\/\\/[^\\n]*/g, (m) => (m[0] === '\"' ? m : \"\"))\n\t\t.replace(/\"(?:\\\\.|[^\"\\\\])*\"|,(\\s*[}\\]])/g, (m, tail) => tail ?? (m[0] === '\"' ? m : \"\"));\n}\n\n/** Strip one leading UTF-8 BOM (U+FEFF) before JSON parsing. */\nexport function stripJsonBom(input: string): string {\n\treturn input.charCodeAt(0) === 0xfeff ? input.slice(1) : input;\n}\n\n/** Parse JSON read from disk, accepting files that start with a UTF-8 BOM. */\nexport function parseJsonFileContent(input: string): unknown {\n\treturn JSON.parse(stripJsonBom(input));\n}\n"]}
|
package/dist/utils/json.js
CHANGED
|
@@ -4,4 +4,12 @@ export function stripJsonComments(input) {
|
|
|
4
4
|
.replace(/"(?:\\.|[^"\\])*"|\/\/[^\n]*/g, (m) => (m[0] === '"' ? m : ""))
|
|
5
5
|
.replace(/"(?:\\.|[^"\\])*"|,(\s*[}\]])/g, (m, tail) => tail ?? (m[0] === '"' ? m : ""));
|
|
6
6
|
}
|
|
7
|
+
/** Strip one leading UTF-8 BOM (U+FEFF) before JSON parsing. */
|
|
8
|
+
export function stripJsonBom(input) {
|
|
9
|
+
return input.charCodeAt(0) === 0xfeff ? input.slice(1) : input;
|
|
10
|
+
}
|
|
11
|
+
/** Parse JSON read from disk, accepting files that start with a UTF-8 BOM. */
|
|
12
|
+
export function parseJsonFileContent(input) {
|
|
13
|
+
return JSON.parse(stripJsonBom(input));
|
|
14
|
+
}
|
|
7
15
|
//# sourceMappingURL=json.js.map
|
package/dist/utils/json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC9C,OAAO,KAAK;SACV,OAAO,CAAC,+BAA+B,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACxE,OAAO,CAAC,gCAAgC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/** Strip `//` line comments and trailing commas from JSON, leaving string literals untouched. */\nexport function stripJsonComments(input: string): string {\n\treturn input\n\t\t.replace(/\"(?:\\\\.|[^\"\\\\])*\"|\\/\\/[^\\n]*/g, (m) => (m[0] === '\"' ? m : \"\"))\n\t\t.replace(/\"(?:\\\\.|[^\"\\\\])*\"|,(\\s*[}\\]])/g, (m, tail) => tail ?? (m[0] === '\"' ? m : \"\"));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC9C,OAAO,KAAK;SACV,OAAO,CAAC,+BAA+B,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACxE,OAAO,CAAC,gCAAgC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,YAAY,CAAC,KAAa;IACzC,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAChE,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,oBAAoB,CAAC,KAAa;IACjD,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/** Strip `//` line comments and trailing commas from JSON, leaving string literals untouched. */\nexport function stripJsonComments(input: string): string {\n\treturn input\n\t\t.replace(/\"(?:\\\\.|[^\"\\\\])*\"|\\/\\/[^\\n]*/g, (m) => (m[0] === '\"' ? m : \"\"))\n\t\t.replace(/\"(?:\\\\.|[^\"\\\\])*\"|,(\\s*[}\\]])/g, (m, tail) => tail ?? (m[0] === '\"' ? m : \"\"));\n}\n\n/** Strip one leading UTF-8 BOM (U+FEFF) before JSON parsing. */\nexport function stripJsonBom(input: string): string {\n\treturn input.charCodeAt(0) === 0xfeff ? input.slice(1) : input;\n}\n\n/** Parse JSON read from disk, accepting files that start with a UTF-8 BOM. */\nexport function parseJsonFileContent(input: string): unknown {\n\treturn JSON.parse(stripJsonBom(input));\n}\n"]}
|
package/docs/settings.md
CHANGED
|
@@ -21,6 +21,10 @@ If no extension or saved decision applies, `defaultProjectTrust` controls the fa
|
|
|
21
21
|
|
|
22
22
|
Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.atomic/agent/trust.json` only; the current session is not reloaded, so restart Atomic for changes to take effect.
|
|
23
23
|
|
|
24
|
+
If a bare directory starts without trust-gated inputs, Atomic may run the interactive session as implicitly trusted. Inert state directories such as `.atomic/todos/` and `.atomic/sessions/` do not require trust and do not disable deferred extension startup. If trust-requiring config appears later, Atomic prompts again on the next launch until you explicitly save a persistent trust decision; the only automatic persistence of implicit startup trust is the existing `/reload` flow after reload discovers trust-requiring resources in an already-trusted session.
|
|
25
|
+
|
|
26
|
+
Settings and trust JSON files may start with a UTF-8 BOM, as commonly written by older Windows tools; Atomic strips that leading marker before parsing.
|
|
27
|
+
|
|
24
28
|
## All Settings
|
|
25
29
|
|
|
26
30
|
### Model & Thinking
|
|
@@ -240,7 +244,7 @@ When multiple sources specify a session directory, precedence is `--session-dir`
|
|
|
240
244
|
|
|
241
245
|
| Setting | Type | Default | Description |
|
|
242
246
|
|---------|------|---------|-------------|
|
|
243
|
-
| `enabledModels` | string[] | - | Model patterns for CTRL+P cycling (same format as `--models` CLI flag) |
|
|
247
|
+
| `enabledModels` | string[] | - | Model patterns for CTRL+P cycling (same format as `--models` CLI flag). In interactive TUI startup, these patterns are resolved again after deferred extension loading so extension-provided providers can match without blocking first paint. |
|
|
244
248
|
| `defaultContextWindow` | number \| string | model default | Optional global fallback context window for models that expose selectable context windows. Accepts raw token counts or compact labels such as `400k` and `1m`. Unsupported values are ignored for models that do not support them. |
|
|
245
249
|
| `defaultContextWindows` | object | `{}` | Per-model preferred context windows keyed as `provider/modelId`. The interactive `/model` context picker writes this setting so a Copilot-specific prompt cap such as `936k` does not leak into Anthropic, Cursor, or other providers. |
|
|
246
250
|
|
package/docs/workflows.md
CHANGED
|
@@ -892,7 +892,7 @@ In non-interactive (`-p`, `--print`, or `--mode json`) sessions, named workflow
|
|
|
892
892
|
/workflow reload
|
|
893
893
|
```
|
|
894
894
|
|
|
895
|
-
Use `connect` for the workflow graph. Use `attach` when you want a chat pane for a specific stage. Attached stage chats capture mouse/trackpad wheel events by default so scrolling stays inside the active stage transcript or prompt instead of falling through to terminal/main-chat scrollback. Press `ctrl+t` inside an attached stage chat to toggle **copy mode**: copy mode disables workflow-chat mouse reporting so normal terminal/tmux text selection can work; press `ctrl+t` again to leave copy mode and restore transcript or prompt scrolling. While copy mode is on, wheel/trackpad gestures are handled by the terminal/tmux and may scroll terminal scrollback, so leave copy mode before using the wheel again. Use `interrupt`, `pause`, and `resume` for resumable live work; `resume` on a non-paused run reopens the saved snapshot or overlay. Use `kill` only when the run should be terminated; killed runs are retained in live history/status for read-only inspection. Use `/workflow reload` after adding, editing, installing, or removing workflow resources or package manifest workflow entries and you want Atomic to rediscover them in-process. `/workflow status` lists all retained active and terminal top-level runs by default; implementation-owned nested child runs are flattened into their parent workflow rather than listed separately. `/workflow status --all` is retained as a compatibility alias.
|
|
895
|
+
Use `connect` for the workflow graph. Use `attach` when you want a chat pane for a specific stage. Attached stage chats capture mouse/trackpad wheel events by default so scrolling stays inside the active stage transcript or prompt instead of falling through to terminal/main-chat scrollback. Live `subagent` tool calls in stage chats use the same single, parallel, and chain progress widgets as main chat, including after exiting and re-attaching to an in-flight stage; press Ctrl+O (the `app.tools.expand` binding) to expand live detail for every child, including current tool activity and artifact paths. Press `ctrl+t` inside an attached stage chat to toggle **copy mode**: copy mode disables workflow-chat mouse reporting so normal terminal/tmux text selection can work; press `ctrl+t` again to leave copy mode and restore transcript or prompt scrolling. While copy mode is on, wheel/trackpad gestures are handled by the terminal/tmux and may scroll terminal scrollback, so leave copy mode before using the wheel again. Use `interrupt`, `pause`, and `resume` for resumable live work; `resume` on a non-paused run reopens the saved snapshot or overlay. Use `kill` only when the run should be terminated; killed runs are retained in live history/status for read-only inspection. Use `/workflow reload` after adding, editing, installing, or removing workflow resources or package manifest workflow entries and you want Atomic to rediscover them in-process. `/workflow status` lists all retained active and terminal top-level runs by default; implementation-owned nested child runs are flattened into their parent workflow rather than listed separately. `/workflow status --all` is retained as a compatibility alias.
|
|
896
896
|
|
|
897
897
|
<p align="center"><img src="images/workflow-graph.png" alt="Workflow Graph Viewer" width="600" /></p>
|
|
898
898
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.5-alpha.
|
|
3
|
+
"version": "0.9.5-alpha.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@bastani/atomic",
|
|
9
|
-
"version": "0.9.5-alpha.
|
|
9
|
+
"version": "0.9.5-alpha.6",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@bastani/atomic-natives": "0.9.5-alpha.
|
|
12
|
+
"@bastani/atomic-natives": "0.9.5-alpha.6",
|
|
13
13
|
"@bufbuild/protobuf": "^2.12.1",
|
|
14
14
|
"@earendil-works/pi-agent-core": "^0.80.3",
|
|
15
15
|
"@earendil-works/pi-ai": "^0.80.3",
|
|
@@ -514,16 +514,16 @@
|
|
|
514
514
|
}
|
|
515
515
|
},
|
|
516
516
|
"node_modules/@bastani/atomic-natives": {
|
|
517
|
-
"version": "0.9.5-alpha.
|
|
518
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.5-alpha.
|
|
517
|
+
"version": "0.9.5-alpha.6",
|
|
518
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.5-alpha.6.tgz",
|
|
519
519
|
"license": "MIT",
|
|
520
520
|
"optionalDependencies": {
|
|
521
|
-
"@bastani/atomic-natives-darwin-arm64": "0.9.5-alpha.
|
|
522
|
-
"@bastani/atomic-natives-darwin-x64": "0.9.5-alpha.
|
|
523
|
-
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.5-alpha.
|
|
524
|
-
"@bastani/atomic-natives-linux-x64-gnu": "0.9.5-alpha.
|
|
525
|
-
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.5-alpha.
|
|
526
|
-
"@bastani/atomic-natives-win32-x64-msvc": "0.9.5-alpha.
|
|
521
|
+
"@bastani/atomic-natives-darwin-arm64": "0.9.5-alpha.6",
|
|
522
|
+
"@bastani/atomic-natives-darwin-x64": "0.9.5-alpha.6",
|
|
523
|
+
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.5-alpha.6",
|
|
524
|
+
"@bastani/atomic-natives-linux-x64-gnu": "0.9.5-alpha.6",
|
|
525
|
+
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.5-alpha.6",
|
|
526
|
+
"@bastani/atomic-natives-win32-x64-msvc": "0.9.5-alpha.6"
|
|
527
527
|
},
|
|
528
528
|
"engines": {
|
|
529
529
|
"bun": ">=1.3.14",
|
|
@@ -531,8 +531,8 @@
|
|
|
531
531
|
}
|
|
532
532
|
},
|
|
533
533
|
"node_modules/@bastani/atomic-natives-darwin-arm64": {
|
|
534
|
-
"version": "0.9.5-alpha.
|
|
535
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.5-alpha.
|
|
534
|
+
"version": "0.9.5-alpha.6",
|
|
535
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.5-alpha.6.tgz",
|
|
536
536
|
"license": "MIT",
|
|
537
537
|
"os": [
|
|
538
538
|
"darwin"
|
|
@@ -543,8 +543,8 @@
|
|
|
543
543
|
"optional": true
|
|
544
544
|
},
|
|
545
545
|
"node_modules/@bastani/atomic-natives-darwin-x64": {
|
|
546
|
-
"version": "0.9.5-alpha.
|
|
547
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.5-alpha.
|
|
546
|
+
"version": "0.9.5-alpha.6",
|
|
547
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.5-alpha.6.tgz",
|
|
548
548
|
"license": "MIT",
|
|
549
549
|
"os": [
|
|
550
550
|
"darwin"
|
|
@@ -555,8 +555,8 @@
|
|
|
555
555
|
"optional": true
|
|
556
556
|
},
|
|
557
557
|
"node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
|
|
558
|
-
"version": "0.9.5-alpha.
|
|
559
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.5-alpha.
|
|
558
|
+
"version": "0.9.5-alpha.6",
|
|
559
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.5-alpha.6.tgz",
|
|
560
560
|
"license": "MIT",
|
|
561
561
|
"os": [
|
|
562
562
|
"linux"
|
|
@@ -570,8 +570,8 @@
|
|
|
570
570
|
"optional": true
|
|
571
571
|
},
|
|
572
572
|
"node_modules/@bastani/atomic-natives-linux-x64-gnu": {
|
|
573
|
-
"version": "0.9.5-alpha.
|
|
574
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.5-alpha.
|
|
573
|
+
"version": "0.9.5-alpha.6",
|
|
574
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.5-alpha.6.tgz",
|
|
575
575
|
"license": "MIT",
|
|
576
576
|
"os": [
|
|
577
577
|
"linux"
|
|
@@ -585,8 +585,8 @@
|
|
|
585
585
|
"optional": true
|
|
586
586
|
},
|
|
587
587
|
"node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
|
|
588
|
-
"version": "0.9.5-alpha.
|
|
589
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.5-alpha.
|
|
588
|
+
"version": "0.9.5-alpha.6",
|
|
589
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.5-alpha.6.tgz",
|
|
590
590
|
"license": "MIT",
|
|
591
591
|
"os": [
|
|
592
592
|
"win32"
|
|
@@ -597,8 +597,8 @@
|
|
|
597
597
|
"optional": true
|
|
598
598
|
},
|
|
599
599
|
"node_modules/@bastani/atomic-natives-win32-x64-msvc": {
|
|
600
|
-
"version": "0.9.5-alpha.
|
|
601
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.5-alpha.
|
|
600
|
+
"version": "0.9.5-alpha.6",
|
|
601
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.5-alpha.6.tgz",
|
|
602
602
|
"license": "MIT",
|
|
603
603
|
"os": [
|
|
604
604
|
"win32"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.5-alpha.
|
|
3
|
+
"version": "0.9.5-alpha.6",
|
|
4
4
|
"description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"atomicConfig": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@bastani/atomic-natives": "0.9.5-alpha.
|
|
80
|
+
"@bastani/atomic-natives": "0.9.5-alpha.6",
|
|
81
81
|
"@bufbuild/protobuf": "^2.12.1",
|
|
82
82
|
"@earendil-works/pi-agent-core": "^0.80.3",
|
|
83
83
|
"@earendil-works/pi-ai": "^0.80.3",
|