@bastani/atomic 0.9.15 → 0.9.16-alpha.1
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 +7 -0
- package/dist/builtin/intercom/CHANGELOG.md +10 -0
- package/dist/builtin/intercom/README.md +8 -8
- package/dist/builtin/intercom/contact-supervisor-tool.ts +68 -32
- package/dist/builtin/intercom/index-heavy.ts +1 -0
- package/dist/builtin/intercom/index.ts +21 -15
- package/dist/builtin/intercom/intercom-tool.ts +66 -10
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/parent-ask-handoff.ts +72 -0
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +13 -0
- package/dist/builtin/subagents/README.md +23 -12
- package/dist/builtin/subagents/agents/worker.md +2 -2
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/subagent/SKILL.md +10 -17
- package/dist/builtin/subagents/src/extension/index.ts +5 -30
- package/dist/builtin/subagents/src/extension/notification-content.ts +1 -1
- package/dist/builtin/subagents/src/extension/schemas.ts +2 -14
- package/dist/builtin/subagents/src/extension/tool-description.ts +1 -2
- package/dist/builtin/subagents/src/extension/tool-rendering.ts +53 -0
- package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +1 -1
- package/dist/builtin/subagents/src/intercom/result-intercom.ts +4 -4
- package/dist/builtin/subagents/src/runs/foreground/execution-parent-ask-handoff.ts +78 -0
- package/dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts +7 -5
- package/dist/builtin/subagents/src/runs/foreground/notify.ts +5 -6
- package/dist/builtin/subagents/src/runs/foreground/parent-ask-output.ts +48 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-burst-display.ts +46 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-burst.ts +403 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +48 -9
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-input.ts +3 -1
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-live-update.ts +11 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +164 -93
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +36 -29
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parent-ask-projection.ts +11 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +42 -17
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +3 -121
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +7 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +30 -220
- package/dist/builtin/subagents/src/runs/inprocess/control-status.ts +0 -34
- package/dist/builtin/subagents/src/runs/inprocess/index.ts +0 -12
- package/dist/builtin/subagents/src/runs/inprocess/prompt-behavior.ts +1 -1
- package/dist/builtin/subagents/src/runs/inprocess/runner.ts +2 -141
- package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +8 -0
- package/dist/builtin/subagents/src/shared/status-format.ts +3 -3
- package/dist/builtin/subagents/src/shared/types-config.ts +41 -0
- package/dist/builtin/subagents/src/shared/types-foreground-state.ts +7 -15
- package/dist/builtin/subagents/src/shared/types-results.ts +3 -1
- package/dist/builtin/subagents/src/shared/types-runtime.ts +1 -11
- package/dist/builtin/subagents/src/tui/render-progress.ts +2 -2
- package/dist/builtin/subagents/src/tui/render-result-compact.ts +2 -2
- package/dist/builtin/subagents/src/tui/render-result.ts +38 -14
- package/dist/builtin/subagents/src/tui/render-status-progress.ts +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +10 -0
- package/dist/builtin/workflows/README.md +1 -1
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/durable/dbos-embedded-postgres-root.ts +548 -39
- package/dist/builtin/workflows/src/durable/dbos-embedded-postgres.ts +529 -65
- package/dist/builtin/workflows/src/durable/dbos-lifecycle.ts +30 -8
- package/dist/builtin/workflows/src/durable/dbos-local-postgres.ts +36 -3
- package/dist/builtin/workflows/src/durable/local-command.ts +68 -10
- package/dist/builtin/workflows/src/extension/dispatcher.ts +7 -1
- package/dist/builtin/workflows/src/extension/extension-factory.ts +2 -2
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +1094 -298
- package/dist/builtin/workflows/src/extension/public-types.ts +2 -2
- package/dist/builtin/workflows/src/extension/render-result.ts +16 -2
- package/dist/builtin/workflows/src/extension/runtime.ts +8 -1
- package/dist/builtin/workflows/src/extension/workflow-request-abort.ts +15 -0
- package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +4 -3
- package/dist/builtin/workflows/src/extension/workflow-tool-registration.ts +107 -13
- package/dist/builtin/workflows/src/extension/workflow-tool.ts +22 -12
- package/dist/builtin/workflows/src/tui/widget.ts +25 -6
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js +19 -3
- package/dist/core/event-bus.js.map +1 -1
- package/docs/intercom.md +28 -26
- package/docs/subagents.md +15 -11
- package/docs/workflows.md +27 -10
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
- package/dist/builtin/subagents/src/runs/inprocess/attempt-handles.ts +0 -104
- /package/dist/builtin/subagents/src/runs/foreground/{subagent-executor-resume.ts → subagent-executor-cwd.ts} +0 -0
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-process attempt handles for a top-level session's direct children.
|
|
3
|
-
*
|
|
4
|
-
* Delegation is one level deep, so this registry only ever holds a parent's own
|
|
5
|
-
* children. A live child is addressed by its run id or canonical task path, and
|
|
6
|
-
* interrupt/resume reach it through the handle registered when its attempt
|
|
7
|
-
* started — never through a request file, a capability token, or a poller.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export interface InProcessAttemptResumeOutcome {
|
|
11
|
-
readonly status: "ok" | "error" | "interrupted" | "continued";
|
|
12
|
-
readonly path: string;
|
|
13
|
-
readonly sessionFile?: string;
|
|
14
|
-
readonly envelope?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface InProcessAttemptHandle {
|
|
18
|
-
readonly runId: string;
|
|
19
|
-
readonly path: string;
|
|
20
|
-
readonly status: () => string;
|
|
21
|
-
readonly interrupt: () => Promise<void>;
|
|
22
|
-
readonly resume: (message: string) => Promise<InProcessAttemptResumeOutcome>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface InProcessAttemptControlResult {
|
|
26
|
-
readonly ok: boolean;
|
|
27
|
-
readonly message: string;
|
|
28
|
-
readonly outcome?: InProcessAttemptResumeOutcome;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const attemptHandles = new Map<string, Map<string, InProcessAttemptHandle>>();
|
|
32
|
-
|
|
33
|
-
function attemptKey(id: string): string {
|
|
34
|
-
return id.trim();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function registerInProcessAttempt(handle: InProcessAttemptHandle): () => void {
|
|
38
|
-
const key = attemptKey(handle.runId);
|
|
39
|
-
let handles = attemptHandles.get(key);
|
|
40
|
-
if (!handles) {
|
|
41
|
-
handles = new Map();
|
|
42
|
-
attemptHandles.set(key, handles);
|
|
43
|
-
}
|
|
44
|
-
handles.set(handle.path, handle);
|
|
45
|
-
const pathKey = attemptKey(handle.path);
|
|
46
|
-
if (pathKey !== key) {
|
|
47
|
-
let byPath = attemptHandles.get(pathKey);
|
|
48
|
-
if (!byPath) {
|
|
49
|
-
byPath = new Map();
|
|
50
|
-
attemptHandles.set(pathKey, byPath);
|
|
51
|
-
}
|
|
52
|
-
byPath.set(handle.path, handle);
|
|
53
|
-
}
|
|
54
|
-
return () => {
|
|
55
|
-
for (const lookupKey of [key, pathKey]) {
|
|
56
|
-
const current = attemptHandles.get(lookupKey);
|
|
57
|
-
if (!current || current.get(handle.path) !== handle) continue;
|
|
58
|
-
current.delete(handle.path);
|
|
59
|
-
if (current.size === 0) attemptHandles.delete(lookupKey);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function handlesFor(id: string): InProcessAttemptHandle[] {
|
|
65
|
-
return [...(attemptHandles.get(attemptKey(id))?.values() ?? [])];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export async function interruptInProcessAttempt(targetId: string): Promise<InProcessAttemptControlResult | undefined> {
|
|
69
|
-
const handles = handlesFor(targetId);
|
|
70
|
-
if (handles.length === 0) return undefined;
|
|
71
|
-
const active = handles.filter((handle) => handle.status() === "running" || handle.status() === "continued");
|
|
72
|
-
if (active.length === 0) {
|
|
73
|
-
return { ok: false, message: `Run ${targetId} has no active child attempt to interrupt.` };
|
|
74
|
-
}
|
|
75
|
-
await Promise.all(active.map((handle) => handle.interrupt()));
|
|
76
|
-
return { ok: true, message: `Interrupt requested for run ${targetId}.` };
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export async function resumeInProcessAttempt(
|
|
80
|
-
targetId: string,
|
|
81
|
-
message: string,
|
|
82
|
-
): Promise<InProcessAttemptControlResult | undefined> {
|
|
83
|
-
const handles = handlesFor(targetId);
|
|
84
|
-
if (handles.length === 0) return undefined;
|
|
85
|
-
const handle =
|
|
86
|
-
handles.find((candidate) => candidate.status() === "interrupted" || candidate.status() === "error") ?? handles[0];
|
|
87
|
-
if (!handle) return undefined;
|
|
88
|
-
if (handle.status() === "running" || handle.status() === "continued") {
|
|
89
|
-
return { ok: false, message: `Run ${targetId} is still running; resume is not required.` };
|
|
90
|
-
}
|
|
91
|
-
const outcome = await handle.resume(message);
|
|
92
|
-
return {
|
|
93
|
-
ok: outcome.status === "ok" || outcome.status === "continued",
|
|
94
|
-
message:
|
|
95
|
-
outcome.status === "ok"
|
|
96
|
-
? `Reloaded run ${targetId} through the in-process control plane.`
|
|
97
|
-
: `Run ${targetId} resume ended with status '${outcome.status}'.`,
|
|
98
|
-
outcome,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function clearInProcessAttemptHandles(): void {
|
|
103
|
-
attemptHandles.clear();
|
|
104
|
-
}
|
|
File without changes
|