pullfrog 0.1.5 → 0.1.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/dist/agents/sessionLabeler.d.ts +38 -18
- package/dist/cli.mjs +294 -107
- package/dist/index.js +282 -95
- package/dist/internal.js +4 -2
- package/dist/utils/normalizeEnv.d.ts +21 -1
- package/dist/utils/subprocess.d.ts +40 -0
- package/dist/utils/timer.d.ts +11 -0
- package/package.json +1 -1
|
@@ -36,32 +36,52 @@ export declare const ORCHESTRATOR_LABEL = "orchestrator";
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function deriveLabelFromTaskInput(input: TaskDispatchInput): string;
|
|
38
38
|
/**
|
|
39
|
-
* Stateful tracker mapping
|
|
39
|
+
* Stateful tracker mapping subagent activity back to human-readable labels.
|
|
40
40
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* -
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
41
|
+
* Two attribution channels are supported because the runtimes differ:
|
|
42
|
+
*
|
|
43
|
+
* - **OpenCode** spawns each subagent as its own opencode `Session` with
|
|
44
|
+
* a distinct `sessionID`. The harness records each Task dispatch into a
|
|
45
|
+
* pending FIFO queue; the next previously-unseen sessionID consumes the
|
|
46
|
+
* head of the queue and binds it to that label.
|
|
47
|
+
*
|
|
48
|
+
* - **Claude Code** runs subagents inside the orchestrator's session — they
|
|
49
|
+
* all share `session_id` — and instead stamps every subagent message with
|
|
50
|
+
* `parent_tool_use_id` pointing at the Agent tool_use id that spawned them.
|
|
51
|
+
* The harness binds each Agent tool_use id to its dispatched label up
|
|
52
|
+
* front, then `labelFor` looks the label up directly when an event arrives
|
|
53
|
+
* carrying that `parent_tool_use_id`.
|
|
54
|
+
*
|
|
55
|
+
* `labelFor(sessionID, parentToolUseId?)` accepts both: when
|
|
56
|
+
* `parentToolUseId` is set and known it short-circuits to the direct mapping;
|
|
57
|
+
* otherwise it falls through to the FIFO/sessionID path.
|
|
53
58
|
*/
|
|
54
59
|
export declare class SessionLabeler {
|
|
55
60
|
private readonly labels;
|
|
61
|
+
private readonly labelsByToolUseId;
|
|
56
62
|
private readonly pendingLabels;
|
|
57
63
|
private fallbackCounter;
|
|
58
|
-
recordTaskDispatch(input: TaskDispatchInput): string;
|
|
59
64
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
65
|
+
* Record a Task/Agent tool dispatch.
|
|
66
|
+
*
|
|
67
|
+
* @param input Task tool input — used to derive the lens label.
|
|
68
|
+
* @param toolUseId Optional Agent tool_use id. When provided, future events
|
|
69
|
+
* carrying `parent_tool_use_id === toolUseId` resolve
|
|
70
|
+
* directly to this label without consuming the FIFO queue
|
|
71
|
+
* (Claude path). Always also pushed to the FIFO queue so
|
|
72
|
+
* the OpenCode path still works when toolUseId is absent.
|
|
73
|
+
*/
|
|
74
|
+
recordTaskDispatch(input: TaskDispatchInput, toolUseId?: string | null): string;
|
|
75
|
+
/**
|
|
76
|
+
* Return a label for the given event.
|
|
77
|
+
*
|
|
78
|
+
* @param sessionID Session id from the event (OpenCode: per-session;
|
|
79
|
+
* Claude: shared across orchestrator + subagents).
|
|
80
|
+
* @param parentToolUseId Claude's `parent_tool_use_id` — non-null on
|
|
81
|
+
* subagent messages. When set and known, takes
|
|
82
|
+
* priority over the FIFO/sessionID path.
|
|
63
83
|
*/
|
|
64
|
-
labelFor(sessionID: string | undefined | null): string;
|
|
84
|
+
labelFor(sessionID: string | undefined | null, parentToolUseId?: string | null): string;
|
|
65
85
|
/** number of distinct sessions seen so far (for diagnostics) */
|
|
66
86
|
size(): number;
|
|
67
87
|
/** all (sessionID, label) pairs, oldest first */
|