@grackle-ai/server 0.75.2 → 0.75.4
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/README.md +17 -61
- package/dist/index.js +8 -24
- package/dist/index.js.map +1 -1
- package/dist/local-powerline-manager.js +1 -1
- package/dist/local-powerline-manager.js.map +1 -1
- package/dist/local-powerline.js +1 -1
- package/dist/local-powerline.js.map +1 -1
- package/package.json +15 -28
- package/dist/adapter-config.d.ts +0 -6
- package/dist/adapter-config.d.ts.map +0 -1
- package/dist/adapter-config.js +0 -19
- package/dist/adapter-config.js.map +0 -1
- package/dist/adapter-manager.d.ts +0 -22
- package/dist/adapter-manager.d.ts.map +0 -1
- package/dist/adapter-manager.js +0 -81
- package/dist/adapter-manager.js.map +0 -1
- package/dist/auto-reconnect.d.ts +0 -23
- package/dist/auto-reconnect.d.ts.map +0 -1
- package/dist/auto-reconnect.js +0 -164
- package/dist/auto-reconnect.js.map +0 -1
- package/dist/compute-task-status.d.ts +0 -28
- package/dist/compute-task-status.d.ts.map +0 -1
- package/dist/compute-task-status.js +0 -70
- package/dist/compute-task-status.js.map +0 -1
- package/dist/credential-bundle.d.ts +0 -12
- package/dist/credential-bundle.d.ts.map +0 -1
- package/dist/credential-bundle.js +0 -183
- package/dist/credential-bundle.js.map +0 -1
- package/dist/event-bus.d.ts +0 -37
- package/dist/event-bus.d.ts.map +0 -1
- package/dist/event-bus.js +0 -65
- package/dist/event-bus.js.map +0 -1
- package/dist/event-processor.d.ts +0 -36
- package/dist/event-processor.d.ts.map +0 -1
- package/dist/event-processor.js +0 -312
- package/dist/event-processor.js.map +0 -1
- package/dist/github-import.d.ts +0 -209
- package/dist/github-import.d.ts.map +0 -1
- package/dist/github-import.js +0 -427
- package/dist/github-import.js.map +0 -1
- package/dist/grpc-service.d.ts +0 -22
- package/dist/grpc-service.d.ts.map +0 -1
- package/dist/grpc-service.js +0 -1736
- package/dist/grpc-service.js.map +0 -1
- package/dist/knowledge-init.d.ts +0 -27
- package/dist/knowledge-init.d.ts.map +0 -1
- package/dist/knowledge-init.js +0 -212
- package/dist/knowledge-init.js.map +0 -1
- package/dist/lifecycle.d.ts +0 -36
- package/dist/lifecycle.d.ts.map +0 -1
- package/dist/lifecycle.js +0 -112
- package/dist/lifecycle.js.map +0 -1
- package/dist/log-writer.d.ts +0 -32
- package/dist/log-writer.d.ts.map +0 -1
- package/dist/log-writer.js +0 -104
- package/dist/log-writer.js.map +0 -1
- package/dist/logger.d.ts +0 -4
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -10
- package/dist/logger.js.map +0 -1
- package/dist/pipe-delivery.d.ts +0 -41
- package/dist/pipe-delivery.d.ts.map +0 -1
- package/dist/pipe-delivery.js +0 -186
- package/dist/pipe-delivery.js.map +0 -1
- package/dist/processor-registry.d.ts +0 -25
- package/dist/processor-registry.d.ts.map +0 -1
- package/dist/processor-registry.js +0 -58
- package/dist/processor-registry.js.map +0 -1
- package/dist/reanimate-agent.d.ts +0 -12
- package/dist/reanimate-agent.d.ts.map +0 -1
- package/dist/reanimate-agent.js +0 -76
- package/dist/reanimate-agent.js.map +0 -1
- package/dist/session-recovery.d.ts +0 -16
- package/dist/session-recovery.d.ts.map +0 -1
- package/dist/session-recovery.js +0 -129
- package/dist/session-recovery.js.map +0 -1
- package/dist/signals/sigchld.d.ts +0 -7
- package/dist/signals/sigchld.d.ts.map +0 -1
- package/dist/signals/sigchld.js +0 -167
- package/dist/signals/sigchld.js.map +0 -1
- package/dist/signals/signal-delivery.d.ts +0 -14
- package/dist/signals/signal-delivery.d.ts.map +0 -1
- package/dist/signals/signal-delivery.js +0 -166
- package/dist/signals/signal-delivery.js.map +0 -1
- package/dist/stream-hub.d.ts +0 -14
- package/dist/stream-hub.d.ts.map +0 -1
- package/dist/stream-hub.js +0 -95
- package/dist/stream-hub.js.map +0 -1
- package/dist/stream-registry.d.ts +0 -84
- package/dist/stream-registry.d.ts.map +0 -1
- package/dist/stream-registry.js +0 -363
- package/dist/stream-registry.js.map +0 -1
- package/dist/test-utils/integration-setup.d.ts +0 -11
- package/dist/test-utils/integration-setup.d.ts.map +0 -1
- package/dist/test-utils/integration-setup.js +0 -32
- package/dist/test-utils/integration-setup.js.map +0 -1
- package/dist/test-utils/mock-database.d.ts +0 -130
- package/dist/test-utils/mock-database.d.ts.map +0 -1
- package/dist/test-utils/mock-database.js +0 -147
- package/dist/test-utils/mock-database.js.map +0 -1
- package/dist/token-push.d.ts +0 -22
- package/dist/token-push.d.ts.map +0 -1
- package/dist/token-push.js +0 -78
- package/dist/token-push.js.map +0 -1
- package/dist/transcript.d.ts +0 -5
- package/dist/transcript.d.ts.map +0 -1
- package/dist/transcript.js +0 -71
- package/dist/transcript.js.map +0 -1
- package/dist/utils/exec.d.ts +0 -17
- package/dist/utils/exec.d.ts.map +0 -1
- package/dist/utils/exec.js +0 -21
- package/dist/utils/exec.js.map +0 -1
- package/dist/utils/format-gh-error.d.ts +0 -6
- package/dist/utils/format-gh-error.d.ts.map +0 -1
- package/dist/utils/format-gh-error.js +0 -30
- package/dist/utils/format-gh-error.js.map +0 -1
- package/dist/utils/network.d.ts +0 -7
- package/dist/utils/network.d.ts.map +0 -1
- package/dist/utils/network.js +0 -21
- package/dist/utils/network.js.map +0 -1
- package/dist/utils/ports.d.ts +0 -3
- package/dist/utils/ports.d.ts.map +0 -1
- package/dist/utils/ports.js +0 -19
- package/dist/utils/ports.js.map +0 -1
- package/dist/utils/sleep.d.ts +0 -3
- package/dist/utils/sleep.d.ts.map +0 -1
- package/dist/utils/sleep.js +0 -5
- package/dist/utils/sleep.js.map +0 -1
- package/dist/ws-bridge.d.ts +0 -30
- package/dist/ws-bridge.d.ts.map +0 -1
- package/dist/ws-bridge.js +0 -372
- package/dist/ws-bridge.js.map +0 -1
- package/dist/ws-broadcast.d.ts +0 -19
- package/dist/ws-broadcast.d.ts.map +0 -1
- package/dist/ws-broadcast.js +0 -60
- package/dist/ws-broadcast.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-processor.d.ts","sourceRoot":"","sources":["../src/event-processor.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,SAAS,EAA0E,MAAM,oBAAoB,CAAC;AAYhI,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,IAAI,CAmBN;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,IAAI,CA6FN;AAsCD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,EAC3C,OAAO,EAAE,kBAAkB,GAC1B,IAAI,CA+KN"}
|
package/dist/event-processor.js
DELETED
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
import { create } from "@bufbuild/protobuf";
|
|
2
|
-
import { grackle, eventTypeToEnum, SESSION_STATUS, TERMINAL_SESSION_STATUSES, END_REASON } from "@grackle-ai/common";
|
|
3
|
-
import { v4 as uuid } from "uuid";
|
|
4
|
-
import { sessionStore, findingStore, taskStore, workspaceStore, slugify } from "@grackle-ai/database";
|
|
5
|
-
import * as streamHub from "./stream-hub.js";
|
|
6
|
-
import * as logWriter from "./log-writer.js";
|
|
7
|
-
import * as processorRegistry from "./processor-registry.js";
|
|
8
|
-
import { writeTranscript } from "./transcript.js";
|
|
9
|
-
import { emit } from "./event-bus.js";
|
|
10
|
-
import { logger } from "./logger.js";
|
|
11
|
-
import { publishChildCompletion } from "./pipe-delivery.js";
|
|
12
|
-
import { cleanupLifecycleStream } from "./lifecycle.js";
|
|
13
|
-
/**
|
|
14
|
-
* Process a finding event, storing it in the finding store and broadcasting.
|
|
15
|
-
* Shared between live event processing and replay on late-bind.
|
|
16
|
-
*/
|
|
17
|
-
export function processFindingEvent(ctx, content, sessionId) {
|
|
18
|
-
if (!ctx.workspaceId) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
try {
|
|
22
|
-
const data = JSON.parse(content);
|
|
23
|
-
const findingId = uuid();
|
|
24
|
-
findingStore.postFinding(findingId, ctx.workspaceId, ctx.taskId || "", sessionId, data.category || "general", data.title || "Untitled", data.content || "", data.tags || []);
|
|
25
|
-
emit("finding.posted", { workspaceId: ctx.workspaceId, findingId });
|
|
26
|
-
logger.info({ findingId, workspaceId: ctx.workspaceId, title: data.title }, "Finding stored");
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
logger.error({ err, workspaceId: ctx.workspaceId, taskId: ctx.taskId }, "Failed to store finding");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Process a subtask creation event, creating a child task and broadcasting.
|
|
34
|
-
* Shared between live event processing and replay on late-bind.
|
|
35
|
-
*/
|
|
36
|
-
export function processSubtaskEvent(ctx, content, subtaskLocalIdMap) {
|
|
37
|
-
if (!ctx.taskId) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
const data = JSON.parse(content);
|
|
42
|
-
const parentTask = taskStore.getTask(ctx.taskId);
|
|
43
|
-
if (!parentTask) {
|
|
44
|
-
logger.warn({ taskId: ctx.taskId }, "Subtask creation failed: parent task not found");
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (!parentTask.canDecompose) {
|
|
48
|
-
logger.warn({ taskId: ctx.taskId }, "Subtask creation failed: parent task cannot decompose");
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const workspace = parentTask.workspaceId ? workspaceStore.getWorkspace(parentTask.workspaceId) : undefined;
|
|
52
|
-
if (parentTask.workspaceId && !workspace) {
|
|
53
|
-
logger.warn({ workspaceId: parentTask.workspaceId }, "Subtask creation failed: workspace not found");
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
// Validate required fields
|
|
57
|
-
const title = typeof data.title === "string" ? data.title.trim() : "";
|
|
58
|
-
const description = typeof data.description === "string" ? data.description.trim() : "";
|
|
59
|
-
if (!title || !description) {
|
|
60
|
-
logger.warn({ taskId: ctx.taskId, rawTitle: data.title, rawDescription: data.description }, "Subtask creation failed: invalid title or description");
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
// Normalize and validate depends_on, local_id, and can_decompose
|
|
64
|
-
const dependsOn = Array.isArray(data.depends_on)
|
|
65
|
-
? data.depends_on.filter((d) => typeof d === "string").map(d => d.trim()).filter(Boolean)
|
|
66
|
-
: [];
|
|
67
|
-
const localId = typeof data.local_id === "string" ? data.local_id.trim() : "";
|
|
68
|
-
const canDecompose = typeof data.can_decompose === "boolean" ? data.can_decompose : false;
|
|
69
|
-
// Resolve depends_on local IDs to real task IDs
|
|
70
|
-
const resolvedDeps = [];
|
|
71
|
-
for (const localDep of dependsOn) {
|
|
72
|
-
const realId = subtaskLocalIdMap.get(localDep);
|
|
73
|
-
if (realId) {
|
|
74
|
-
resolvedDeps.push(realId);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
logger.warn({ localDep, taskId: ctx.taskId }, "Subtask dependency local_id not found, skipping");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
const subtaskId = uuid().slice(0, 8);
|
|
81
|
-
taskStore.createTask(subtaskId, parentTask.workspaceId || undefined, title, description, resolvedDeps, workspace ? slugify(workspace.name) : "", ctx.taskId, canDecompose);
|
|
82
|
-
// Record the local_id → real ID mapping, detecting duplicates
|
|
83
|
-
if (localId) {
|
|
84
|
-
if (subtaskLocalIdMap.has(localId)) {
|
|
85
|
-
logger.warn({
|
|
86
|
-
localId,
|
|
87
|
-
existingSubtaskId: subtaskLocalIdMap.get(localId),
|
|
88
|
-
newSubtaskId: subtaskId,
|
|
89
|
-
parentTaskId: ctx.taskId,
|
|
90
|
-
}, "Duplicate subtask local_id encountered; keeping existing mapping");
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
subtaskLocalIdMap.set(localId, subtaskId);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
emit("task.created", { taskId: subtaskId, workspaceId: parentTask.workspaceId ?? undefined });
|
|
97
|
-
logger.info({ subtaskId, parentTaskId: ctx.taskId, title }, "Subtask created");
|
|
98
|
-
}
|
|
99
|
-
catch (err) {
|
|
100
|
-
logger.error({ err, taskId: ctx.taskId }, "Failed to create subtask");
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Replay pre-association events from the session log through finding/subtask interceptors.
|
|
105
|
-
* Called when a session is late-bound to a task. Does not re-publish to streamHub.
|
|
106
|
-
*
|
|
107
|
-
* Note: Uses synchronous readFileSync while the log is written via a buffered WriteStream.
|
|
108
|
-
* Events written very recently may still be in the write buffer and not yet flushed to disk.
|
|
109
|
-
* In practice this is negligible since replay targets events written before the current
|
|
110
|
-
* iteration of the for-await loop, which are already flushed by the time lateBind is called.
|
|
111
|
-
*/
|
|
112
|
-
function replayLoggedEvents(ctx, subtaskLocalIdMap) {
|
|
113
|
-
try {
|
|
114
|
-
const entries = logWriter.readLog(ctx.logPath);
|
|
115
|
-
let findingsReplayed = 0;
|
|
116
|
-
let subtasksReplayed = 0;
|
|
117
|
-
for (const entry of entries) {
|
|
118
|
-
if (entry.type === "finding") {
|
|
119
|
-
processFindingEvent(ctx, entry.content, entry.session_id);
|
|
120
|
-
findingsReplayed++;
|
|
121
|
-
}
|
|
122
|
-
else if (entry.type === "subtask_create") {
|
|
123
|
-
processSubtaskEvent(ctx, entry.content, subtaskLocalIdMap);
|
|
124
|
-
subtasksReplayed++;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
if (findingsReplayed > 0 || subtasksReplayed > 0) {
|
|
128
|
-
logger.info({ sessionId: ctx.sessionId, taskId: ctx.taskId, findingsReplayed, subtasksReplayed }, "Replayed pre-association events from session log");
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
catch (err) {
|
|
132
|
-
logger.error({ err, sessionId: ctx.sessionId }, "Failed to replay logged events");
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Process an async iterable of agent events from a PowerLine spawn or resume stream.
|
|
137
|
-
* Handles event transformation, logging, finding interception, status updates, and cleanup.
|
|
138
|
-
*
|
|
139
|
-
* This function is fire-and-forget: it runs in the background and does not throw.
|
|
140
|
-
* Callers should use `onComplete` callback for post-processing.
|
|
141
|
-
*
|
|
142
|
-
* Supports late-binding: if a task is associated with the session after the stream starts,
|
|
143
|
-
* the processor registry notifies this function via a bind listener, and pre-association
|
|
144
|
-
* events are replayed from the session log.
|
|
145
|
-
*/
|
|
146
|
-
export function processEventStream(events, options) {
|
|
147
|
-
const { sessionId, logPath } = options;
|
|
148
|
-
// Create a mutable context that can be updated via the processor registry
|
|
149
|
-
const ctx = {
|
|
150
|
-
sessionId,
|
|
151
|
-
logPath,
|
|
152
|
-
workspaceId: options.workspaceId || "",
|
|
153
|
-
taskId: options.taskId || "",
|
|
154
|
-
};
|
|
155
|
-
/** Maps local_id strings (assigned by the agent) to real task IDs, scoped to this stream. */
|
|
156
|
-
const subtaskLocalIdMap = new Map();
|
|
157
|
-
processorRegistry.register(ctx);
|
|
158
|
-
// Register the bind listener synchronously alongside register() to close the race
|
|
159
|
-
// window where lateBind() could fire between register and the async IIFE starting.
|
|
160
|
-
processorRegistry.onBind(sessionId, () => {
|
|
161
|
-
replayLoggedEvents(ctx, subtaskLocalIdMap);
|
|
162
|
-
});
|
|
163
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
164
|
-
(async () => {
|
|
165
|
-
try {
|
|
166
|
-
logWriter.initLog(logPath);
|
|
167
|
-
sessionStore.updateSessionStatus(sessionId, SESSION_STATUS.RUNNING);
|
|
168
|
-
// Emit system context and initial prompt as the first visible events in the stream.
|
|
169
|
-
// Only for task sessions — ad-hoc spawns show the prompt in the chat input already.
|
|
170
|
-
// Use distinct timestamps so clients can reliably sort/dedup by timestamp+eventType.
|
|
171
|
-
if (options.systemContext && options.taskId) {
|
|
172
|
-
const sysCtxEvent = create(grackle.SessionEventSchema, {
|
|
173
|
-
sessionId,
|
|
174
|
-
type: grackle.EventType.SYSTEM,
|
|
175
|
-
timestamp: new Date().toISOString(),
|
|
176
|
-
content: options.systemContext,
|
|
177
|
-
raw: JSON.stringify({ systemContext: true }),
|
|
178
|
-
});
|
|
179
|
-
logWriter.writeEvent(logPath, sysCtxEvent);
|
|
180
|
-
streamHub.publish(sysCtxEvent);
|
|
181
|
-
}
|
|
182
|
-
if (options.prompt && options.taskId) {
|
|
183
|
-
const promptEvent = create(grackle.SessionEventSchema, {
|
|
184
|
-
sessionId,
|
|
185
|
-
type: grackle.EventType.USER_INPUT,
|
|
186
|
-
timestamp: new Date().toISOString(),
|
|
187
|
-
content: options.prompt,
|
|
188
|
-
});
|
|
189
|
-
logWriter.writeEvent(logPath, promptEvent);
|
|
190
|
-
streamHub.publish(promptEvent);
|
|
191
|
-
}
|
|
192
|
-
for await (const event of events) {
|
|
193
|
-
// runtime_session_id is an internal control event: persist it then skip
|
|
194
|
-
// logging/publishing — it has no proto enum value and is not client-visible.
|
|
195
|
-
if (event.type === "runtime_session_id") {
|
|
196
|
-
if (event.content) {
|
|
197
|
-
sessionStore.updateRuntimeSessionId(sessionId, event.content);
|
|
198
|
-
}
|
|
199
|
-
continue;
|
|
200
|
-
}
|
|
201
|
-
const sessionEvent = create(grackle.SessionEventSchema, {
|
|
202
|
-
sessionId,
|
|
203
|
-
type: eventTypeToEnum(event.type),
|
|
204
|
-
timestamp: event.timestamp,
|
|
205
|
-
content: event.content,
|
|
206
|
-
raw: event.raw,
|
|
207
|
-
});
|
|
208
|
-
logWriter.writeEvent(logPath, sessionEvent);
|
|
209
|
-
streamHub.publish(sessionEvent);
|
|
210
|
-
// Intercept finding events and store + broadcast them
|
|
211
|
-
if (event.type === "finding" && ctx.workspaceId) {
|
|
212
|
-
processFindingEvent(ctx, event.content, sessionId);
|
|
213
|
-
}
|
|
214
|
-
// Intercept subtask creation events and create child tasks
|
|
215
|
-
if (event.type === "subtask_create" && ctx.taskId) {
|
|
216
|
-
processSubtaskEvent(ctx, event.content, subtaskLocalIdMap);
|
|
217
|
-
}
|
|
218
|
-
// Intercept usage events and accumulate token counts on the session record
|
|
219
|
-
if (event.type === "usage") {
|
|
220
|
-
try {
|
|
221
|
-
const data = JSON.parse(event.content);
|
|
222
|
-
const inputTokens = Number.isFinite(data.input_tokens)
|
|
223
|
-
? Math.max(0, Math.trunc(data.input_tokens))
|
|
224
|
-
: 0;
|
|
225
|
-
const outputTokens = Number.isFinite(data.output_tokens)
|
|
226
|
-
? Math.max(0, Math.trunc(data.output_tokens))
|
|
227
|
-
: 0;
|
|
228
|
-
const costUsd = Number.isFinite(data.cost_usd)
|
|
229
|
-
? Math.max(0, data.cost_usd)
|
|
230
|
-
: 0;
|
|
231
|
-
if (inputTokens > 0 || outputTokens > 0 || costUsd > 0) {
|
|
232
|
-
sessionStore.updateSessionUsage(sessionId, inputTokens, outputTokens, costUsd);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
catch (err) {
|
|
236
|
-
logger.error({ err, sessionId }, "Failed to process usage event");
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
if (event.type === "status") {
|
|
240
|
-
// Map runtime status strings to our session status model
|
|
241
|
-
if (event.content === "waiting_input") {
|
|
242
|
-
sessionStore.updateSessionStatus(sessionId, SESSION_STATUS.IDLE);
|
|
243
|
-
}
|
|
244
|
-
else if (event.content === "running") {
|
|
245
|
-
sessionStore.updateSessionStatus(sessionId, SESSION_STATUS.RUNNING);
|
|
246
|
-
}
|
|
247
|
-
else if (event.content === "completed") {
|
|
248
|
-
sessionStore.updateSession(sessionId, SESSION_STATUS.STOPPED, undefined, undefined, END_REASON.COMPLETED);
|
|
249
|
-
}
|
|
250
|
-
else if (event.content === "killed") {
|
|
251
|
-
sessionStore.updateSession(sessionId, SESSION_STATUS.STOPPED, undefined, undefined, END_REASON.KILLED);
|
|
252
|
-
}
|
|
253
|
-
else if (event.content === "failed") {
|
|
254
|
-
sessionStore.updateSession(sessionId, SESSION_STATUS.STOPPED, undefined, undefined, END_REASON.INTERRUPTED);
|
|
255
|
-
cleanupLifecycleStream(sessionId);
|
|
256
|
-
}
|
|
257
|
-
// On terminal status: publish child completion to IPC pipe stream.
|
|
258
|
-
// Note: lifecycle streams are NOT cleaned up here — they persist until
|
|
259
|
-
// the spawner explicitly closes the fd (killAgent, closeFd). This is the
|
|
260
|
-
// emergent lifecycle model: fd closure drives hibernation, not status events.
|
|
261
|
-
if (["completed", "killed", "failed"].includes(event.content)) {
|
|
262
|
-
publishChildCompletion(sessionId, event.content);
|
|
263
|
-
}
|
|
264
|
-
// Broadcast task_updated on status changes so frontend re-fetches computed status.
|
|
265
|
-
// This covers both terminal events (completed/killed/failed) and non-terminal
|
|
266
|
-
// transitions (running, waiting_input) that affect the computed task status.
|
|
267
|
-
if (ctx.taskId && ["completed", "killed", "failed", "running", "waiting_input"].includes(event.content)) {
|
|
268
|
-
emit("task.updated", { taskId: ctx.taskId, workspaceId: ctx.workspaceId });
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
// Fallback: if stream ended without a terminal status event, emit a UI refresh
|
|
273
|
-
// without changing status. Guard against overwriting terminal or SUSPENDED states.
|
|
274
|
-
const current = sessionStore.getSession(sessionId);
|
|
275
|
-
if (current && !TERMINAL_SESSION_STATUSES.has(current.status) && current.status !== SESSION_STATUS.SUSPENDED) {
|
|
276
|
-
if (ctx.taskId) {
|
|
277
|
-
emit("task.updated", { taskId: ctx.taskId, workspaceId: ctx.workspaceId });
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
catch (err) {
|
|
282
|
-
const current = sessionStore.getSession(sessionId);
|
|
283
|
-
if (current && !TERMINAL_SESSION_STATUSES.has(current.status)) {
|
|
284
|
-
// Transport error during active or idle session — suspend for auto-recovery
|
|
285
|
-
// on reconnect. Don't publish child completion (session will resume).
|
|
286
|
-
logger.info({ sessionId, err: String(err) }, "Stream lost — suspending session for recovery");
|
|
287
|
-
sessionStore.suspendSession(sessionId);
|
|
288
|
-
streamHub.publish(create(grackle.SessionEventSchema, {
|
|
289
|
-
sessionId,
|
|
290
|
-
type: grackle.EventType.STATUS,
|
|
291
|
-
timestamp: new Date().toISOString(),
|
|
292
|
-
content: SESSION_STATUS.SUSPENDED,
|
|
293
|
-
}));
|
|
294
|
-
if (ctx.taskId) {
|
|
295
|
-
emit("task.updated", { taskId: ctx.taskId, workspaceId: ctx.workspaceId });
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
// If already terminal (killAgent/completed/failed set status before transport
|
|
299
|
-
// died), the session is in its correct final state and task.updated was already
|
|
300
|
-
// emitted — skip the duplicate to avoid interfering with SIGCHLD delivery.
|
|
301
|
-
}
|
|
302
|
-
finally {
|
|
303
|
-
processorRegistry.unregister(sessionId);
|
|
304
|
-
logWriter.endSession(logPath);
|
|
305
|
-
try {
|
|
306
|
-
writeTranscript(logPath);
|
|
307
|
-
}
|
|
308
|
-
catch { /* non-critical */ }
|
|
309
|
-
}
|
|
310
|
-
})();
|
|
311
|
-
}
|
|
312
|
-
//# sourceMappingURL=event-processor.js.map
|
|
@@ -1 +0,0 @@
|
|
|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C,eAAe,CAAC,OAAO,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAChE,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
|
package/dist/github-import.d.ts
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/** Wraps `gh` CLI execution for testability. */
|
|
2
|
-
export interface GitHubClient {
|
|
3
|
-
/** Execute a `gh` CLI command and return stdout. */
|
|
4
|
-
exec(args: string[], options: {
|
|
5
|
-
encoding: BufferEncoding;
|
|
6
|
-
maxBuffer: number;
|
|
7
|
-
timeout?: number;
|
|
8
|
-
}): Promise<string>;
|
|
9
|
-
}
|
|
10
|
-
/** Wraps task/workspace store operations for testability. */
|
|
11
|
-
export interface TaskPersistence {
|
|
12
|
-
/** Look up a workspace by ID. */
|
|
13
|
-
getWorkspace(workspaceId: string): {
|
|
14
|
-
name: string;
|
|
15
|
-
} | undefined;
|
|
16
|
-
/** List all tasks in a workspace. */
|
|
17
|
-
listTasks(workspaceId: string): Array<{
|
|
18
|
-
id: string;
|
|
19
|
-
title: string;
|
|
20
|
-
}>;
|
|
21
|
-
/** Create a new task. */
|
|
22
|
-
createTask(id: string, workspaceId: string, title: string, description: string, dependsOn: string[], workspaceSlug: string, parentTaskId: string, canDecompose: boolean): void;
|
|
23
|
-
/** Set the dependsOn list for a task. */
|
|
24
|
-
setTaskDependsOn(taskId: string, dependsOn: string[]): void;
|
|
25
|
-
}
|
|
26
|
-
/** Wraps event bus broadcasting for testability. */
|
|
27
|
-
export interface ImportEventEmitter {
|
|
28
|
-
/** Emit a task lifecycle event. */
|
|
29
|
-
emit(type: "task.created" | "task.updated", payload: {
|
|
30
|
-
taskId: string;
|
|
31
|
-
workspaceId: string;
|
|
32
|
-
}): void;
|
|
33
|
-
}
|
|
34
|
-
/** Concurrency guard for imports. */
|
|
35
|
-
export interface ImportLock {
|
|
36
|
-
/** Acquire the lock. Throws if already held. */
|
|
37
|
-
acquire(): void;
|
|
38
|
-
/** Release the lock. */
|
|
39
|
-
release(): void;
|
|
40
|
-
}
|
|
41
|
-
/** Shape of a single GitHub issue comment as returned by the GraphQL query. */
|
|
42
|
-
export interface GitHubComment {
|
|
43
|
-
/** Login of the comment author. */
|
|
44
|
-
author: string;
|
|
45
|
-
/** ISO-8601 timestamp of when the comment was created. */
|
|
46
|
-
createdAt: string;
|
|
47
|
-
/** Markdown body of the comment. */
|
|
48
|
-
body: string;
|
|
49
|
-
}
|
|
50
|
-
/** Shape of a GitHub issue as returned by the GraphQL query. */
|
|
51
|
-
export interface GitHubIssue {
|
|
52
|
-
number: number;
|
|
53
|
-
title: string;
|
|
54
|
-
body: string;
|
|
55
|
-
parentNumber: number | undefined;
|
|
56
|
-
labels: string[];
|
|
57
|
-
/** Issue numbers that block this issue (i.e., this issue depends on them). */
|
|
58
|
-
blockedByNumbers: number[];
|
|
59
|
-
/** Comments on the issue. Empty array when fetched without `includeComments`. */
|
|
60
|
-
comments: GitHubComment[];
|
|
61
|
-
/**
|
|
62
|
-
* `true` when the issue had more than {@link COMMENTS_PER_ISSUE} comments
|
|
63
|
-
* and only the first batch was fetched. The imported description will
|
|
64
|
-
* include a truncation notice when this is `true`.
|
|
65
|
-
*/
|
|
66
|
-
commentsHasNextPage: boolean;
|
|
67
|
-
}
|
|
68
|
-
/** Result summary returned by {@link importGitHubIssues}. */
|
|
69
|
-
export interface ImportResult {
|
|
70
|
-
imported: number;
|
|
71
|
-
linked: number;
|
|
72
|
-
skipped: number;
|
|
73
|
-
/** Number of blocking (dependsOn) relationships created. */
|
|
74
|
-
dependencies: number;
|
|
75
|
-
}
|
|
76
|
-
/** Instruction to create a single task during the persist phase. */
|
|
77
|
-
export interface TaskCreateInstruction {
|
|
78
|
-
/** Generated task ID. */
|
|
79
|
-
id: string;
|
|
80
|
-
/** Formatted title (e.g., "#42: Fix the bug"). */
|
|
81
|
-
title: string;
|
|
82
|
-
/** Full task description including comments. */
|
|
83
|
-
description: string;
|
|
84
|
-
/** Resolved parent task ID, or empty string for root tasks. */
|
|
85
|
-
parentTaskId: string;
|
|
86
|
-
/** Original GitHub issue number. */
|
|
87
|
-
issueNumber: number;
|
|
88
|
-
}
|
|
89
|
-
/** Instruction to set dependsOn for a task during the persist phase. */
|
|
90
|
-
export interface DependencyInstruction {
|
|
91
|
-
/** Task ID to update. */
|
|
92
|
-
taskId: string;
|
|
93
|
-
/** Resolved task IDs that this task depends on. */
|
|
94
|
-
dependsOn: string[];
|
|
95
|
-
}
|
|
96
|
-
/** The output of {@link planImport}: a pure description of what to persist. */
|
|
97
|
-
export interface ImportPlan {
|
|
98
|
-
/** Tasks to create, in topological order. */
|
|
99
|
-
tasksToCreate: TaskCreateInstruction[];
|
|
100
|
-
/** Dependency relationships to set after task creation. */
|
|
101
|
-
dependenciesToSet: DependencyInstruction[];
|
|
102
|
-
/** Number of issues skipped because they already exist. */
|
|
103
|
-
skipped: number;
|
|
104
|
-
/** Number of parent links resolved. */
|
|
105
|
-
linked: number;
|
|
106
|
-
}
|
|
107
|
-
/** Options for dependency injection in {@link importGitHubIssues}. */
|
|
108
|
-
export interface ImportGitHubIssuesOptions {
|
|
109
|
-
/** @internal GitHub CLI client for testing. */
|
|
110
|
-
githubClient?: GitHubClient;
|
|
111
|
-
/** @internal Task/workspace persistence for testing. */
|
|
112
|
-
persistence?: TaskPersistence;
|
|
113
|
-
/** @internal Event broadcaster for testing. */
|
|
114
|
-
eventEmitter?: ImportEventEmitter;
|
|
115
|
-
/** @internal Concurrency lock for testing. */
|
|
116
|
-
importLock?: ImportLock;
|
|
117
|
-
/** @internal ID generator for testing. */
|
|
118
|
-
generateId?: () => string;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Builds the full task description from an issue body and its comments.
|
|
122
|
-
*
|
|
123
|
-
* Comments are appended after the body, each preceded by a `---` separator
|
|
124
|
-
* and a header line showing the author login and creation timestamp.
|
|
125
|
-
* When `hasMoreComments` is `true`, a truncation notice is appended after
|
|
126
|
-
* the last fetched comment to indicate that additional comments exist.
|
|
127
|
-
*
|
|
128
|
-
* @param body - The issue body text (may be empty).
|
|
129
|
-
* @param comments - Array of comments to append. Pass an empty array to omit.
|
|
130
|
-
* @param hasMoreComments - When `true`, appends a notice that the comment list
|
|
131
|
-
* was truncated at the fetch limit.
|
|
132
|
-
* @returns The formatted description string.
|
|
133
|
-
*/
|
|
134
|
-
export declare function buildDescriptionWithComments(body: string, comments: GitHubComment[], hasMoreComments?: boolean): string;
|
|
135
|
-
/**
|
|
136
|
-
* Builds a deduplication map from existing tasks whose titles match
|
|
137
|
-
* the `#<number>: <title>` pattern used by imported GitHub issues.
|
|
138
|
-
*
|
|
139
|
-
* @param existingTasks - Tasks already in the workspace.
|
|
140
|
-
* @returns Maps and sets for deduplication during import planning.
|
|
141
|
-
*/
|
|
142
|
-
export declare function buildExistingIssueMap(existingTasks: Array<{
|
|
143
|
-
id: string;
|
|
144
|
-
title: string;
|
|
145
|
-
}>): {
|
|
146
|
-
issueNumberToTaskId: Map<number, string>;
|
|
147
|
-
existingIssueNumbers: Set<number>;
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Given fetched issues and existing state, computes what to create and link
|
|
151
|
-
* without performing any side effects.
|
|
152
|
-
*
|
|
153
|
-
* Performs topological sort, skips existing issues, generates IDs upfront,
|
|
154
|
-
* resolves parent links and blockedBy dependencies, and returns a plan.
|
|
155
|
-
*
|
|
156
|
-
* @param issues - Fetched GitHub issues to import.
|
|
157
|
-
* @param existingIssueNumbers - Issue numbers already imported (to skip).
|
|
158
|
-
* @param existingIssueNumberToTaskId - Map from issue number to existing task ID.
|
|
159
|
-
* @param generateId - Optional ID generator (defaults to `uuid().slice(0, 8)`).
|
|
160
|
-
* @returns An {@link ImportPlan} describing all tasks to create and dependencies to set.
|
|
161
|
-
*/
|
|
162
|
-
export declare function planImport(issues: GitHubIssue[], existingIssueNumbers: Set<number>, existingIssueNumberToTaskId: Map<number, string>, generateId?: () => string): ImportPlan;
|
|
163
|
-
/**
|
|
164
|
-
* Fetches GitHub issues from a repository via the `gh` CLI GraphQL API.
|
|
165
|
-
* Paginates automatically and includes parent sub-issue information.
|
|
166
|
-
*
|
|
167
|
-
* @param repo - Repository in "owner/repo" format.
|
|
168
|
-
* @param state - Issue state filter ("open" or "closed").
|
|
169
|
-
* @param label - Optional label to filter issues by (client-side).
|
|
170
|
-
* @param includeComments - When `true` (default), fetches issue comments and
|
|
171
|
-
* includes them in each returned {@link GitHubIssue}. Pass `false` to omit
|
|
172
|
-
* comments and reduce payload size.
|
|
173
|
-
* @param client - Optional {@link GitHubClient} for testing (defaults to `gh` CLI).
|
|
174
|
-
* @returns Array of parsed GitHub issues.
|
|
175
|
-
*/
|
|
176
|
-
export declare function fetchGitHubIssues(repo: string, state: string, label?: string, includeComments?: boolean, client?: GitHubClient): Promise<GitHubIssue[]>;
|
|
177
|
-
/**
|
|
178
|
-
* Topologically sorts issues so that parents appear before their children.
|
|
179
|
-
* Issues whose parent is outside the import set are treated as roots.
|
|
180
|
-
* Falls back to original order for issues at the same depth.
|
|
181
|
-
*
|
|
182
|
-
* @param issues - The list of GitHub issues to sort.
|
|
183
|
-
* @param issueSet - Set of issue numbers in the current import batch.
|
|
184
|
-
* @returns A new array of issues sorted with parents before children.
|
|
185
|
-
*/
|
|
186
|
-
export declare function topologicalSortIssues<T extends {
|
|
187
|
-
number: number;
|
|
188
|
-
parentNumber: number | undefined;
|
|
189
|
-
}>(issues: T[], issueSet: Set<number>): T[];
|
|
190
|
-
/**
|
|
191
|
-
* Imports GitHub issues as Grackle tasks, with deduplication and parent linking.
|
|
192
|
-
*
|
|
193
|
-
* Orchestrates: fetch issues → dedup against existing tasks → plan (pure) →
|
|
194
|
-
* persist tasks → broadcast updates → return summary.
|
|
195
|
-
*
|
|
196
|
-
* Only one import may run at a time; concurrent calls are rejected.
|
|
197
|
-
*
|
|
198
|
-
* @param workspaceId - The Grackle workspace ID to import tasks into.
|
|
199
|
-
* @param repo - Repository in "owner/repo" format.
|
|
200
|
-
* @param state - Issue state filter ("open" or "closed").
|
|
201
|
-
* @param label - Optional label to filter issues by.
|
|
202
|
-
* @param environmentId - Optional environment ID to assign to created tasks.
|
|
203
|
-
* @param includeComments - When `true` (default), appends issue comments to each
|
|
204
|
-
* task description. Pass `false` to import only the issue body (old behavior).
|
|
205
|
-
* @param options - Optional dependency overrides for testing.
|
|
206
|
-
* @returns Summary of imported, linked, and skipped issues.
|
|
207
|
-
*/
|
|
208
|
-
export declare function importGitHubIssues(workspaceId: string, repo: string, state: string, label?: string, _environmentId?: string, includeComments?: boolean, options?: ImportGitHubIssuesOptions): Promise<ImportResult>;
|
|
209
|
-
//# sourceMappingURL=github-import.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github-import.d.ts","sourceRoot":"","sources":["../src/github-import.ts"],"names":[],"mappings":"AAiCA,gDAAgD;AAChD,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE;QAAE,QAAQ,EAAE,cAAc,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnH;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAChE,qCAAqC;IACrC,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrE,yBAAyB;IACzB,UAAU,CACR,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAA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