killeros 1.5.2 → 1.5.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/CHANGELOG.md +25 -0
- package/Killeros.ts +30 -4
- package/README.md +38 -14
- package/killeros/commands.ts +242 -2
- package/killeros/context-compaction.ts +566 -0
- package/killeros/goals.ts +25 -2
- package/killeros/runtime.ts +25 -0
- package/killeros/subagent-lifecycle.ts +237 -8
- package/killeros/subagent-persistence.ts +572 -0
- package/killeros/subagent-process.ts +583 -565
- package/killeros/subagent-ui.ts +17 -1
- package/killeros/subagents.ts +2579 -1581
- package/package.json +1 -1
package/killeros/subagent-ui.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ThreadStatus = "queued" | "running" | "complete" | "failed" | "cancelled" | "limited";
|
|
1
|
+
export type ThreadStatus = "queued" | "running" | "complete" | "failed" | "cancelled" | "limited" | "orphaned";
|
|
2
2
|
|
|
3
3
|
export interface ThreadUsage {
|
|
4
4
|
input: number;
|
|
@@ -12,6 +12,8 @@ export interface ThreadUsage {
|
|
|
12
12
|
|
|
13
13
|
export interface ThreadRecord {
|
|
14
14
|
id: string;
|
|
15
|
+
displayName?: string;
|
|
16
|
+
attempt?: number;
|
|
15
17
|
agent: string;
|
|
16
18
|
task: string;
|
|
17
19
|
status: ThreadStatus;
|
|
@@ -30,7 +32,9 @@ export const THREAD_BOARD_CONTROL_LABELS = {
|
|
|
30
32
|
inspect: "Inspect",
|
|
31
33
|
steer: "Steer",
|
|
32
34
|
interrupt: "Interrupt",
|
|
35
|
+
wait: "Wait",
|
|
33
36
|
collect: "Collect",
|
|
37
|
+
resume: "Resume",
|
|
34
38
|
close: "Close",
|
|
35
39
|
} as const;
|
|
36
40
|
|
|
@@ -73,6 +77,8 @@ export interface ThreadHandoffView {
|
|
|
73
77
|
export interface ThreadListItem {
|
|
74
78
|
record: ThreadRecord;
|
|
75
79
|
id: string;
|
|
80
|
+
displayName?: string;
|
|
81
|
+
attempt?: number;
|
|
76
82
|
agent: string;
|
|
77
83
|
task: string;
|
|
78
84
|
step?: number;
|
|
@@ -83,6 +89,8 @@ export interface ThreadListItem {
|
|
|
83
89
|
|
|
84
90
|
export interface ThreadInspectionView {
|
|
85
91
|
id: string;
|
|
92
|
+
displayName?: string;
|
|
93
|
+
attempt?: number;
|
|
86
94
|
agent: string;
|
|
87
95
|
task: string;
|
|
88
96
|
step?: number;
|
|
@@ -122,6 +130,7 @@ function toRecord(item: ThreadListItem): ThreadRecord {
|
|
|
122
130
|
|
|
123
131
|
function threadStatus(thread: Pick<ThreadRecord, "status" | "terminationReason">): ThreadStatus {
|
|
124
132
|
const reason = thread.terminationReason;
|
|
133
|
+
if (thread.status === "orphaned") return "orphaned";
|
|
125
134
|
if (thread.status === "failed" || reason === "error" || reason === "spawn_error" || reason === "process_closed" || reason === "missing_assistant_message" || reason === "malformed_jsonl" || reason === "invalid_usage" || reason?.startsWith("exit_")) return "failed";
|
|
126
135
|
if (thread.status === "cancelled" || reason === "abort" || reason === "interrupt") return "cancelled";
|
|
127
136
|
if (thread.status === "complete" || reason === "completed") return "complete";
|
|
@@ -143,6 +152,7 @@ export function formatThreadState(thread: Pick<ThreadRecord, "status" | "termina
|
|
|
143
152
|
if (status === "failed") return { status, label: "Failed", reason, partialWork: "Failed before completion. Any saved output is partial work." };
|
|
144
153
|
if (status === "cancelled") return { status, label: "Stopped", reason, partialWork: "Stopped before completion. Any saved output is partial work." };
|
|
145
154
|
if (status === "limited") return { status, label: "Limited", reason, partialWork: "Stopped at a limit before completion. Any saved output is partial work." };
|
|
155
|
+
if (status === "orphaned") return { status, label: "Orphaned", reason, partialWork: "The parent session restarted before completion. Any saved output is partial work." };
|
|
146
156
|
if (status === "running") return { status, label: "Running", reason };
|
|
147
157
|
return { status, label: "Queued", reason };
|
|
148
158
|
}
|
|
@@ -176,7 +186,9 @@ export function formatThreadControls(status: ThreadStatus): readonly ThreadBoard
|
|
|
176
186
|
{ id: "inspect", label: THREAD_BOARD_CONTROL_LABELS.inspect, enabled: true },
|
|
177
187
|
{ id: "steer", label: THREAD_BOARD_CONTROL_LABELS.steer, enabled: active },
|
|
178
188
|
{ id: "interrupt", label: THREAD_BOARD_CONTROL_LABELS.interrupt, enabled: active },
|
|
189
|
+
{ id: "wait", label: THREAD_BOARD_CONTROL_LABELS.wait, enabled: active },
|
|
179
190
|
{ id: "collect", label: THREAD_BOARD_CONTROL_LABELS.collect, enabled: isDone(status) },
|
|
191
|
+
{ id: "resume", label: THREAD_BOARD_CONTROL_LABELS.resume, enabled: isDone(status) },
|
|
180
192
|
{ id: "close", label: THREAD_BOARD_CONTROL_LABELS.close, enabled: isDone(status) },
|
|
181
193
|
];
|
|
182
194
|
}
|
|
@@ -184,6 +196,8 @@ export function formatThreadControls(status: ThreadStatus): readonly ThreadBoard
|
|
|
184
196
|
export function formatThreadInspection(thread: ThreadRecord): ThreadInspectionView {
|
|
185
197
|
return {
|
|
186
198
|
id: thread.id,
|
|
199
|
+
displayName: thread.displayName,
|
|
200
|
+
attempt: thread.attempt,
|
|
187
201
|
agent: thread.agent,
|
|
188
202
|
task: thread.task,
|
|
189
203
|
step: thread.step,
|
|
@@ -199,6 +213,8 @@ function formatThreadListItem(thread: ThreadRecord, selectedThreadId: string | u
|
|
|
199
213
|
return {
|
|
200
214
|
record: { ...thread, trace: thread.trace ? [...thread.trace] : undefined, usage: { ...thread.usage } },
|
|
201
215
|
id: thread.id,
|
|
216
|
+
displayName: thread.displayName,
|
|
217
|
+
attempt: thread.attempt,
|
|
202
218
|
agent: thread.agent,
|
|
203
219
|
task: thread.task,
|
|
204
220
|
step: thread.step,
|