@agentshouse/kit 0.2.1-ce145e9aadbf6 → 0.2.1-ce47f621f90e1
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 +47 -46
- package/dist/acp.js +102 -108
- package/dist/agents.js +189 -56
- package/dist/api.js +34 -2
- package/dist/app-git.js +48 -0
- package/dist/authority-main.js +2 -2
- package/dist/bridge.js +37 -58
- package/dist/building.js +50 -0
- package/dist/calls.js +71 -0
- package/dist/chatgpt.js +32 -0
- package/dist/clis.js +150 -99
- package/dist/codex-main.js +58 -0
- package/dist/connection.js +105 -0
- package/dist/conversations.js +731 -332
- package/dist/copies.js +188 -128
- package/dist/end.js +33 -0
- package/dist/enrol-main.js +7 -1
- package/dist/events.js +546 -0
- package/dist/files.js +139 -17
- package/dist/git.js +13 -11
- package/dist/home.js +89 -7
- package/dist/house-cli.js +299 -0
- package/dist/house-main.js +7 -159
- package/dist/instructions.js +8 -10
- package/dist/kit-cli.js +68 -0
- package/dist/kit-main.js +8 -19
- package/dist/login.js +119 -104
- package/dist/logout.js +14 -13
- package/dist/mcp.js +6 -2
- package/dist/parts.js +82 -0
- package/dist/placement.js +31 -0
- package/dist/refusals.js +12 -0
- package/dist/relay.js +33 -2
- package/dist/resident.js +117 -51
- package/dist/scope.js +214 -0
- package/dist/scripts.js +255 -0
- package/dist/secret-input.js +3 -2
- package/dist/service-main.js +9 -0
- package/dist/service.js +55 -0
- package/dist/shell.js +3 -0
- package/dist/sign-in.js +40 -33
- package/dist/silence.js +28 -0
- package/dist/skills.js +49 -35
- package/dist/transcription.js +129 -41
- package/dist/translate.js +2 -8
- package/dist/update.js +113 -103
- package/dist/wire.js +40 -0
- package/dist/work.js +346 -0
- package/package.json +20 -20
- package/dist/blocks.js +0 -51
- package/dist/bootstrap.json +0 -24
- package/dist/clis-main.js +0 -23
- package/dist/stream.js +0 -47
- package/how-we-work.md +0 -23
- package/skills/ask-matt/LICENSE +0 -21
- package/skills/ask-matt/PHASE-BOUNDARIES.md +0 -55
- package/skills/ask-matt/SKILL.md +0 -91
- package/skills/ask-matt/agents/openai.yaml +0 -4
- package/skills/code-review/LICENSE +0 -21
- package/skills/code-review/SKILL.md +0 -89
- package/skills/code-review/agents/openai.yaml +0 -3
- package/skills/codebase-design/DEEPENING.md +0 -37
- package/skills/codebase-design/DESIGN-IT-TWICE.md +0 -44
- package/skills/codebase-design/LICENSE +0 -21
- package/skills/codebase-design/SKILL.md +0 -116
- package/skills/codebase-design/agents/openai.yaml +0 -3
- package/skills/diagnosing-bugs/LICENSE +0 -21
- package/skills/diagnosing-bugs/SKILL.md +0 -140
- package/skills/diagnosing-bugs/agents/openai.yaml +0 -3
- package/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +0 -44
- package/skills/domain-modeling/ADR-FORMAT.md +0 -47
- package/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
- package/skills/domain-modeling/LICENSE +0 -21
- package/skills/domain-modeling/SKILL.md +0 -76
- package/skills/domain-modeling/agents/openai.yaml +0 -3
- package/skills/grill-me/LICENSE +0 -21
- package/skills/grill-me/SKILL.md +0 -8
- package/skills/grill-me/agents/openai.yaml +0 -4
- package/skills/grill-with-docs/LICENSE +0 -21
- package/skills/grill-with-docs/SKILL.md +0 -8
- package/skills/grill-with-docs/agents/openai.yaml +0 -4
- package/skills/grilling/LICENSE +0 -21
- package/skills/grilling/SKILL.md +0 -30
- package/skills/grilling/agents/openai.yaml +0 -3
- package/skills/handoff/LICENSE +0 -21
- package/skills/handoff/SKILL.md +0 -17
- package/skills/handoff/agents/openai.yaml +0 -4
- package/skills/implement/LICENSE +0 -21
- package/skills/implement/SKILL.md +0 -16
- package/skills/implement/agents/openai.yaml +0 -4
- package/skills/improve-codebase-architecture/HTML-REPORT.md +0 -123
- package/skills/improve-codebase-architecture/LICENSE +0 -21
- package/skills/improve-codebase-architecture/SKILL.md +0 -72
- package/skills/improve-codebase-architecture/agents/openai.yaml +0 -4
- package/skills/prototype/LICENSE +0 -21
- package/skills/prototype/LOGIC.md +0 -67
- package/skills/prototype/SKILL.md +0 -28
- package/skills/prototype/UI.md +0 -112
- package/skills/prototype/agents/openai.yaml +0 -3
- package/skills/research/LICENSE +0 -21
- package/skills/research/SKILL.md +0 -14
- package/skills/research/agents/openai.yaml +0 -3
- package/skills/resolving-merge-conflicts/LICENSE +0 -21
- package/skills/resolving-merge-conflicts/SKILL.md +0 -16
- package/skills/resolving-merge-conflicts/agents/openai.yaml +0 -3
- package/skills/tdd/LICENSE +0 -21
- package/skills/tdd/SKILL.md +0 -40
- package/skills/tdd/agents/openai.yaml +0 -3
- package/skills/tdd/mocking.md +0 -59
- package/skills/tdd/tests.md +0 -77
- package/skills/teach/GLOSSARY-FORMAT.md +0 -35
- package/skills/teach/LEARNING-RECORD-FORMAT.md +0 -46
- package/skills/teach/LICENSE +0 -21
- package/skills/teach/MISSION-FORMAT.md +0 -31
- package/skills/teach/RESOURCES-FORMAT.md +0 -32
- package/skills/teach/SKILL.md +0 -141
- package/skills/teach/agents/openai.yaml +0 -4
- package/skills/to-questionnaire/LICENSE +0 -21
- package/skills/to-questionnaire/SKILL.md +0 -55
- package/skills/to-questionnaire/agents/openai.yaml +0 -4
- package/skills/to-spec/LICENSE +0 -21
- package/skills/to-spec/SKILL.md +0 -76
- package/skills/to-spec/agents/openai.yaml +0 -4
- package/skills/to-tickets/LICENSE +0 -21
- package/skills/to-tickets/SKILL.md +0 -106
- package/skills/to-tickets/agents/openai.yaml +0 -4
- package/skills/wait-what/LICENSE +0 -21
- package/skills/wait-what/SKILL.md +0 -8
- package/skills/wait-what/agents/openai.yaml +0 -4
- package/skills/wayfinder/LICENSE +0 -21
- package/skills/wayfinder/SKILL.md +0 -129
- package/skills/wayfinder/agents/openai.yaml +0 -4
- package/skills/writing-for-agents/LICENSE +0 -21
- package/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
- package/skills/writing-for-agents/SKILL.md +0 -83
- package/skills/writing-for-agents/agents/openai.yaml +0 -3
package/dist/work.js
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { once } from 'node:events';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { rm } from 'node:fs/promises';
|
|
5
|
+
import { createServer } from 'node:net';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { RUNNING_JOB } from './events.js';
|
|
8
|
+
import { kitHome, socketDirectory } from './home.js';
|
|
9
|
+
const ENDED_TASK = new Set(['completed', 'failed', 'killed']);
|
|
10
|
+
const SCHEDULING = new Set(['CronCreate', 'CronDelete', 'ScheduleWakeup']);
|
|
11
|
+
const QUEUE_LIST = 'house-kit-queue-';
|
|
12
|
+
const SYNC = 'house-kit-sync-';
|
|
13
|
+
const WAKEUP = /Next wakeup scheduled for (\d\d):(\d\d):(\d\d) \(in (\d+)s\)/;
|
|
14
|
+
const HALF_DAY = 12 * 60 * 60 * 1000;
|
|
15
|
+
export function codexLauncher() {
|
|
16
|
+
return join(kitHome(), 'launchers', 'codex');
|
|
17
|
+
}
|
|
18
|
+
export class Work {
|
|
19
|
+
changed;
|
|
20
|
+
jobs = new Set();
|
|
21
|
+
constructor(changed) {
|
|
22
|
+
this.changed = changed;
|
|
23
|
+
}
|
|
24
|
+
async open(_cli) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
async settled() { }
|
|
28
|
+
read(message) {
|
|
29
|
+
this.take(message);
|
|
30
|
+
this.changed();
|
|
31
|
+
}
|
|
32
|
+
take(message) {
|
|
33
|
+
const update = message.params?.update;
|
|
34
|
+
if (message.method !== 'session/update' || update?.asyncTaskId === undefined)
|
|
35
|
+
return;
|
|
36
|
+
if (update.sessionUpdate === 'async_task_spawned')
|
|
37
|
+
this.jobs.add(update.asyncTaskId);
|
|
38
|
+
if (update.sessionUpdate === 'async_task_state_update' && !RUNNING_JOB.has(update.state))
|
|
39
|
+
this.jobs.delete(update.asyncTaskId);
|
|
40
|
+
}
|
|
41
|
+
busy() {
|
|
42
|
+
return this.jobs.size > 0;
|
|
43
|
+
}
|
|
44
|
+
close() { }
|
|
45
|
+
}
|
|
46
|
+
class ClaudeWork extends Work {
|
|
47
|
+
cwd;
|
|
48
|
+
level = new Set();
|
|
49
|
+
listed = new Set();
|
|
50
|
+
started = new Set();
|
|
51
|
+
running = false;
|
|
52
|
+
hooks = new Set();
|
|
53
|
+
calls = new Map();
|
|
54
|
+
crons = new Map();
|
|
55
|
+
wakeups = [];
|
|
56
|
+
goal = false;
|
|
57
|
+
constructor(cwd, changed) {
|
|
58
|
+
super(changed);
|
|
59
|
+
this.cwd = cwd;
|
|
60
|
+
}
|
|
61
|
+
take(message) {
|
|
62
|
+
super.take(message);
|
|
63
|
+
if (message.method === '_claude/sdkMessage')
|
|
64
|
+
this.sdk(message.params.message);
|
|
65
|
+
if (message.method === 'session/update')
|
|
66
|
+
this.update(message.params.update);
|
|
67
|
+
}
|
|
68
|
+
busy() {
|
|
69
|
+
return (super.busy() ||
|
|
70
|
+
this.level.size > 0 ||
|
|
71
|
+
this.started.size > 0 ||
|
|
72
|
+
this.running ||
|
|
73
|
+
this.hooks.size > 0 ||
|
|
74
|
+
this.crons.size > 0 ||
|
|
75
|
+
this.wakeups.length > 0 ||
|
|
76
|
+
this.goal ||
|
|
77
|
+
this.durable());
|
|
78
|
+
}
|
|
79
|
+
sdk(message) {
|
|
80
|
+
switch (message.subtype) {
|
|
81
|
+
case 'background_tasks_changed':
|
|
82
|
+
this.level = new Set(message.tasks.map((task) => task.task_id));
|
|
83
|
+
for (const id of this.level) {
|
|
84
|
+
this.listed.add(id);
|
|
85
|
+
this.started.delete(id);
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
case 'task_started':
|
|
89
|
+
if (!this.listed.has(message.task_id))
|
|
90
|
+
this.started.add(message.task_id);
|
|
91
|
+
break;
|
|
92
|
+
case 'task_updated':
|
|
93
|
+
if (ENDED_TASK.has(message.patch.status))
|
|
94
|
+
this.started.delete(message.task_id);
|
|
95
|
+
break;
|
|
96
|
+
case 'task_notification':
|
|
97
|
+
this.started.delete(message.task_id);
|
|
98
|
+
break;
|
|
99
|
+
case 'session_state_changed':
|
|
100
|
+
if (message.state === 'running' && !this.running)
|
|
101
|
+
this.wakeups = this.wakeups.filter((due) => due > Date.now());
|
|
102
|
+
this.running = message.state === 'running';
|
|
103
|
+
break;
|
|
104
|
+
case 'hook_started':
|
|
105
|
+
this.hooks.add(message.hook_id);
|
|
106
|
+
break;
|
|
107
|
+
case 'hook_response':
|
|
108
|
+
this.hooks.delete(message.hook_id);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
update(update) {
|
|
113
|
+
const air = update._meta?.jetbrains?.air;
|
|
114
|
+
if (update.sessionUpdate === 'session_info_update' && air !== undefined && 'goal' in air) {
|
|
115
|
+
this.goal = air.goal?.status === 'active';
|
|
116
|
+
}
|
|
117
|
+
if (update.sessionUpdate !== 'tool_call' && update.sessionUpdate !== 'tool_call_update')
|
|
118
|
+
return;
|
|
119
|
+
const tool = update._meta?.claudeCode?.toolName;
|
|
120
|
+
if (update.sessionUpdate === 'tool_call' && SCHEDULING.has(tool ?? ''))
|
|
121
|
+
this.calls.set(update.toolCallId, { tool });
|
|
122
|
+
const call = this.calls.get(update.toolCallId);
|
|
123
|
+
if (call === undefined)
|
|
124
|
+
return;
|
|
125
|
+
if (update.rawInput !== undefined)
|
|
126
|
+
call.input = update.rawInput;
|
|
127
|
+
if (update.content !== undefined)
|
|
128
|
+
call.content = update.content;
|
|
129
|
+
if (update.status === 'failed')
|
|
130
|
+
this.calls.delete(update.toolCallId);
|
|
131
|
+
if (update.status !== 'completed')
|
|
132
|
+
return;
|
|
133
|
+
this.calls.delete(update.toolCallId);
|
|
134
|
+
if (call.tool === 'CronCreate')
|
|
135
|
+
this.crons.set(update.toolCallId, JSON.stringify(call.content ?? []));
|
|
136
|
+
if (call.tool === 'ScheduleWakeup')
|
|
137
|
+
this.wakeup(call);
|
|
138
|
+
if (call.tool !== 'CronDelete')
|
|
139
|
+
return;
|
|
140
|
+
for (const [id, text] of this.crons)
|
|
141
|
+
if (text.includes(String(call.input?.id)))
|
|
142
|
+
this.crons.delete(id);
|
|
143
|
+
}
|
|
144
|
+
wakeup(call) {
|
|
145
|
+
if (call.input?.stop === true) {
|
|
146
|
+
this.wakeups = [];
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const time = WAKEUP.exec(JSON.stringify(call.content ?? []));
|
|
150
|
+
if (time === null) {
|
|
151
|
+
this.wakeups.push(Infinity);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const fires = Date.now() + Number(time[4]) * 1000;
|
|
155
|
+
const due = new Date(fires);
|
|
156
|
+
due.setHours(Number(time[1]), Number(time[2]), Number(time[3]), 0);
|
|
157
|
+
if (due.getTime() - fires > HALF_DAY)
|
|
158
|
+
due.setDate(due.getDate() - 1);
|
|
159
|
+
if (fires - due.getTime() > HALF_DAY)
|
|
160
|
+
due.setDate(due.getDate() + 1);
|
|
161
|
+
this.wakeups.push(due.getTime());
|
|
162
|
+
}
|
|
163
|
+
durable() {
|
|
164
|
+
let text;
|
|
165
|
+
try {
|
|
166
|
+
text = readFileSync(join(this.cwd, '.claude', 'scheduled_tasks.json'), 'utf8');
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
return error.code !== 'ENOENT';
|
|
170
|
+
}
|
|
171
|
+
try {
|
|
172
|
+
return JSON.parse(text).tasks?.length !== 0;
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
class CodexWork extends Work {
|
|
180
|
+
threads = new Map();
|
|
181
|
+
queues = new Map();
|
|
182
|
+
goals = new Set();
|
|
183
|
+
items = new Set();
|
|
184
|
+
hooks = new Set();
|
|
185
|
+
starting = new Set();
|
|
186
|
+
settling = [];
|
|
187
|
+
memories = null;
|
|
188
|
+
lost = false;
|
|
189
|
+
server = null;
|
|
190
|
+
path = null;
|
|
191
|
+
socket = null;
|
|
192
|
+
asked = 0;
|
|
193
|
+
heard = 0;
|
|
194
|
+
proving = -1;
|
|
195
|
+
proven = -1;
|
|
196
|
+
async open(cli) {
|
|
197
|
+
this.path = join(socketDirectory(), `${randomUUID()}.sock`);
|
|
198
|
+
this.server = createServer((socket) => this.connected(socket));
|
|
199
|
+
this.server.listen(this.path);
|
|
200
|
+
await once(this.server, 'listening');
|
|
201
|
+
return { CODEX_PATH: codexLauncher(), HOUSE_KIT_CODEX: cli, HOUSE_KIT_CODEX_STREAM: this.path };
|
|
202
|
+
}
|
|
203
|
+
settled() {
|
|
204
|
+
return new Promise((resolve) => {
|
|
205
|
+
this.settling.push(resolve);
|
|
206
|
+
this.settle();
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
take(message) {
|
|
210
|
+
super.take(message);
|
|
211
|
+
this.heard++;
|
|
212
|
+
}
|
|
213
|
+
busy() {
|
|
214
|
+
if (super.busy() ||
|
|
215
|
+
this.lost ||
|
|
216
|
+
this.memories !== false ||
|
|
217
|
+
[...this.threads.values()].some(Boolean) ||
|
|
218
|
+
this.queues.size > 0 ||
|
|
219
|
+
this.goals.size > 0 ||
|
|
220
|
+
this.items.size > 0 ||
|
|
221
|
+
this.hooks.size > 0) {
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
if (this.proven === this.heard)
|
|
225
|
+
return false;
|
|
226
|
+
this.prove();
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
close() {
|
|
230
|
+
this.server?.close();
|
|
231
|
+
if (this.path !== null)
|
|
232
|
+
void rm(this.path, { force: true });
|
|
233
|
+
}
|
|
234
|
+
connected(socket) {
|
|
235
|
+
this.socket = socket;
|
|
236
|
+
let buffer = '';
|
|
237
|
+
socket.on('error', () => this.lose());
|
|
238
|
+
socket.on('close', () => this.lose());
|
|
239
|
+
socket.setEncoding('utf8').on('data', (chunk) => {
|
|
240
|
+
buffer += chunk;
|
|
241
|
+
for (let index = buffer.indexOf('\n'); index >= 0; index = buffer.indexOf('\n')) {
|
|
242
|
+
const message = this.parsed(buffer.slice(0, index));
|
|
243
|
+
buffer = buffer.slice(index + 1);
|
|
244
|
+
if (message !== null)
|
|
245
|
+
this.stream(message, socket);
|
|
246
|
+
}
|
|
247
|
+
this.settle();
|
|
248
|
+
this.changed();
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
parsed(line) {
|
|
252
|
+
try {
|
|
253
|
+
return JSON.parse(line);
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
this.lost = true;
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
lose() {
|
|
261
|
+
this.lost = true;
|
|
262
|
+
this.changed();
|
|
263
|
+
}
|
|
264
|
+
prove() {
|
|
265
|
+
if (this.proving === this.heard)
|
|
266
|
+
return;
|
|
267
|
+
this.proving = this.heard;
|
|
268
|
+
this.socket.write(`${JSON.stringify({ jsonrpc: '2.0', id: `${SYNC}${this.heard}`, method: 'house-kit/sync' })}\n`);
|
|
269
|
+
}
|
|
270
|
+
settle() {
|
|
271
|
+
if (this.starting.size === 0)
|
|
272
|
+
for (const resolve of this.settling.splice(0))
|
|
273
|
+
resolve();
|
|
274
|
+
}
|
|
275
|
+
stream(message, socket) {
|
|
276
|
+
const params = message.params;
|
|
277
|
+
switch (message.method) {
|
|
278
|
+
case 'thread/status/changed':
|
|
279
|
+
this.threads.set(params.threadId, params.status.type === 'active' && params.status.activeFlags.length === 0);
|
|
280
|
+
break;
|
|
281
|
+
case 'thread/closed':
|
|
282
|
+
this.threads.delete(params.threadId);
|
|
283
|
+
break;
|
|
284
|
+
case 'thread/queue/changed':
|
|
285
|
+
this.queues.set(params.threadId, ++this.asked);
|
|
286
|
+
socket.write(`${JSON.stringify({ jsonrpc: '2.0', id: `${QUEUE_LIST}${this.asked}`, method: 'thread/queue/list', params: { threadId: params.threadId } })}\n`);
|
|
287
|
+
break;
|
|
288
|
+
case 'thread/goal/updated':
|
|
289
|
+
if (params.goal.status === 'active')
|
|
290
|
+
this.goals.add(params.threadId);
|
|
291
|
+
else
|
|
292
|
+
this.goals.delete(params.threadId);
|
|
293
|
+
break;
|
|
294
|
+
case 'thread/goal/cleared':
|
|
295
|
+
this.goals.delete(params.threadId);
|
|
296
|
+
break;
|
|
297
|
+
case 'item/started':
|
|
298
|
+
this.items.add(`${params.threadId} ${params.item.id}`);
|
|
299
|
+
break;
|
|
300
|
+
case 'item/completed':
|
|
301
|
+
this.items.delete(`${params.threadId} ${params.item.id}`);
|
|
302
|
+
break;
|
|
303
|
+
case 'hook/started':
|
|
304
|
+
this.hooks.add(params.run.id);
|
|
305
|
+
break;
|
|
306
|
+
case 'hook/completed':
|
|
307
|
+
this.hooks.delete(params.run.id);
|
|
308
|
+
break;
|
|
309
|
+
case 'mcpServer/startupStatus/updated':
|
|
310
|
+
if (params.status === 'starting')
|
|
311
|
+
this.starting.add(`${params.threadId} ${params.name}`);
|
|
312
|
+
else
|
|
313
|
+
this.starting.delete(`${params.threadId} ${params.name}`);
|
|
314
|
+
break;
|
|
315
|
+
case undefined:
|
|
316
|
+
this.answered(message);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
answered(message) {
|
|
320
|
+
if (typeof message.id === 'string' && message.id.startsWith(SYNC)) {
|
|
321
|
+
this.proven = Number(message.id.slice(SYNC.length));
|
|
322
|
+
}
|
|
323
|
+
else if (typeof message.id === 'string' && message.id.startsWith(QUEUE_LIST)) {
|
|
324
|
+
const asked = Number(message.id.slice(QUEUE_LIST.length));
|
|
325
|
+
for (const [thread, latest] of this.queues) {
|
|
326
|
+
if (latest === asked && message.result?.data?.length === 0)
|
|
327
|
+
this.queues.delete(thread);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
else if (message.result?.config?.features !== undefined) {
|
|
331
|
+
this.memories = message.result.config.features.memories !== false;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
class GrokWork extends Work {
|
|
336
|
+
busy() {
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
export function workFor(kind, cwd, changed) {
|
|
341
|
+
if (kind === 'claude-agent-acp')
|
|
342
|
+
return new ClaudeWork(cwd, changed);
|
|
343
|
+
if (kind === 'codex-acp')
|
|
344
|
+
return new CodexWork(changed);
|
|
345
|
+
return new GrokWork(changed);
|
|
346
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/kit",
|
|
3
|
-
"version": "0.2.1-
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.1-ce47f621f90e1",
|
|
4
|
+
"description": "Kit connects an Environment to agents.house.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -12,27 +12,27 @@
|
|
|
12
12
|
"kit": "dist/kit-main.js",
|
|
13
13
|
"house": "dist/house-main.js"
|
|
14
14
|
},
|
|
15
|
-
"exports": {
|
|
16
|
-
"./bootstrap": "./dist/bootstrap.json"
|
|
17
|
-
},
|
|
18
15
|
"files": [
|
|
19
|
-
"dist"
|
|
20
|
-
"how-we-work.md",
|
|
21
|
-
"skills"
|
|
16
|
+
"dist"
|
|
22
17
|
],
|
|
23
18
|
"scripts": {
|
|
24
|
-
"
|
|
19
|
+
"bootstrap-manifest": "node scripts/bootstrap-manifest.mjs",
|
|
20
|
+
"build": "tsc -p tsconfig.build.json",
|
|
25
21
|
"engine": "mkdir -p tmp/engine && docker run --rm -v \"$PWD:/kit\" -w /kit alpine:3.24@sha256:294b683cb724975bec92580e1e685676bd4b50bda910ddb8c51d4cabeaec77e6 sh scripts/engine.sh tmp/engine",
|
|
22
|
+
"follow-skills": "node scripts/follow-skills.mjs",
|
|
23
|
+
"release-files": "node scripts/release-files.mjs",
|
|
26
24
|
"test": "tsc -p tsconfig.json && vitest run"
|
|
27
25
|
},
|
|
28
26
|
"dependencies": {
|
|
29
|
-
"@agentclientprotocol/sdk": "
|
|
30
|
-
"@agentshouse/mdmodel": "0.1.0-
|
|
27
|
+
"@agentclientprotocol/sdk": "2.0.1",
|
|
28
|
+
"@agentshouse/mdmodel": "0.1.0-c4f4d37bc9d6a",
|
|
29
|
+
"@agentshouse/skills": "0.1.0-cdd0f15bef719",
|
|
30
|
+
"@lydell/node-pty": "1.2.0-beta.15",
|
|
31
31
|
"yaml": "2.9.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@agentclientprotocol/claude-agent-acp": "0.
|
|
35
|
-
"@agentclientprotocol/codex-acp": "2.
|
|
34
|
+
"@agentclientprotocol/claude-agent-acp": "0.94.0",
|
|
35
|
+
"@agentclientprotocol/codex-acp": "2.2.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"@agentclientprotocol/claude-agent-acp": {
|
|
@@ -43,26 +43,26 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/node": "24.
|
|
46
|
+
"@types/node": "24.19.2",
|
|
47
47
|
"@types/ws": "8.18.2",
|
|
48
48
|
"typescript": "7.0.2",
|
|
49
|
-
"vitest": "5.0.
|
|
49
|
+
"vitest": "5.0.5",
|
|
50
50
|
"ws": "8.22.0"
|
|
51
51
|
},
|
|
52
|
-
"packageManager": "npm@11.19.
|
|
52
|
+
"packageManager": "npm@11.19.1",
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": "24.
|
|
55
|
-
"npm": "11.19.
|
|
54
|
+
"node": "24.22.1",
|
|
55
|
+
"npm": "11.19.1"
|
|
56
56
|
},
|
|
57
57
|
"devEngines": {
|
|
58
58
|
"runtime": {
|
|
59
59
|
"name": "node",
|
|
60
|
-
"version": "24.
|
|
60
|
+
"version": "24.22.1",
|
|
61
61
|
"onFail": "error"
|
|
62
62
|
},
|
|
63
63
|
"packageManager": {
|
|
64
64
|
"name": "npm",
|
|
65
|
-
"version": "11.19.
|
|
65
|
+
"version": "11.19.1",
|
|
66
66
|
"onFail": "error"
|
|
67
67
|
}
|
|
68
68
|
}
|
package/dist/blocks.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const FENCE = /^\s*(`{3,}|~{3,})\s*(\S*)/;
|
|
2
|
-
export function blocksOf(text) {
|
|
3
|
-
const blocks = [];
|
|
4
|
-
let paragraph = [];
|
|
5
|
-
let fence = null;
|
|
6
|
-
const closeParagraph = () => {
|
|
7
|
-
const joined = paragraph.join('\n').trim();
|
|
8
|
-
if (joined.length > 0)
|
|
9
|
-
blocks.push({ type: 'paragraph', text: joined });
|
|
10
|
-
paragraph = [];
|
|
11
|
-
};
|
|
12
|
-
const closeFence = () => {
|
|
13
|
-
const joined = fence.lines.join('\n');
|
|
14
|
-
if (joined.length > 0)
|
|
15
|
-
blocks.push({ type: 'code', language: fence.language, text: joined });
|
|
16
|
-
fence = null;
|
|
17
|
-
};
|
|
18
|
-
for (const line of text.split('\n')) {
|
|
19
|
-
if (fence !== null) {
|
|
20
|
-
if (line.trim().startsWith(fence.marker))
|
|
21
|
-
closeFence();
|
|
22
|
-
else
|
|
23
|
-
fence.lines.push(line);
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
const opening = FENCE.exec(line);
|
|
27
|
-
if (opening !== null) {
|
|
28
|
-
closeParagraph();
|
|
29
|
-
fence = { marker: opening[1], language: opening[2] || null, lines: [] };
|
|
30
|
-
}
|
|
31
|
-
else if (line.trim().length === 0) {
|
|
32
|
-
closeParagraph();
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
paragraph.push(line);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (fence !== null)
|
|
39
|
-
closeFence();
|
|
40
|
-
closeParagraph();
|
|
41
|
-
return blocks;
|
|
42
|
-
}
|
|
43
|
-
export function firstChange(before, after) {
|
|
44
|
-
let index = 0;
|
|
45
|
-
while (index < before.length &&
|
|
46
|
-
index < after.length &&
|
|
47
|
-
JSON.stringify(before[index]) === JSON.stringify(after[index])) {
|
|
48
|
-
index++;
|
|
49
|
-
}
|
|
50
|
-
return index;
|
|
51
|
-
}
|
package/dist/bootstrap.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": 2,
|
|
3
|
-
"version": "0.2.1-ce145e9aadbf6",
|
|
4
|
-
"hosts": {
|
|
5
|
-
"macos": {
|
|
6
|
-
"asset": {
|
|
7
|
-
"name": "connect-linux.sh",
|
|
8
|
-
"url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-ce145e9aadbf6/connect-linux.sh"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"linux": {
|
|
12
|
-
"asset": {
|
|
13
|
-
"name": "connect-linux.sh",
|
|
14
|
-
"url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-ce145e9aadbf6/connect-linux.sh"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"windows": {
|
|
18
|
-
"asset": {
|
|
19
|
-
"name": "connect-windows.ps1",
|
|
20
|
-
"url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-ce145e9aadbf6/connect-windows.ps1"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
package/dist/clis-main.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { setGlobalProxyFromEnv } from 'node:http';
|
|
2
|
-
import { post } from './api.js';
|
|
3
|
-
import { CLIS, below, locate, versionOf } from './clis.js';
|
|
4
|
-
import { readEnrolment } from './home.js';
|
|
5
|
-
setGlobalProxyFromEnv();
|
|
6
|
-
try {
|
|
7
|
-
const { house, credential } = (await readEnrolment());
|
|
8
|
-
const { agents } = await post(house, '/kit/agents/desired', {}, credential);
|
|
9
|
-
for (const kind of agents) {
|
|
10
|
-
const cli = await locate(kind);
|
|
11
|
-
if (cli === null)
|
|
12
|
-
continue;
|
|
13
|
-
const release = await versionOf(cli);
|
|
14
|
-
if (release === null)
|
|
15
|
-
continue;
|
|
16
|
-
const { bin, minimum } = CLIS[kind];
|
|
17
|
-
process.stdout.write(`${[bin, cli, release, minimum, below(release, minimum) ? 'old' : 'current'].join('\t')}\n`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
process.stderr.write(`kit: ${error.message}\n`);
|
|
22
|
-
process.exitCode = 1;
|
|
23
|
-
}
|
package/dist/stream.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { retryDelay } from './api.js';
|
|
2
|
-
import { readEnrolment } from './home.js';
|
|
3
|
-
import { relayed } from './relay.js';
|
|
4
|
-
const SUBPROTOCOL = 'house.kit.stream.1';
|
|
5
|
-
function streamUrl(house) {
|
|
6
|
-
const url = new URL('/kit/stream', house);
|
|
7
|
-
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
8
|
-
return url;
|
|
9
|
-
}
|
|
10
|
-
export function holdStream(handlers) {
|
|
11
|
-
let socket = null;
|
|
12
|
-
let failures = 0;
|
|
13
|
-
const connect = async () => {
|
|
14
|
-
const { house, credential } = (await readEnrolment());
|
|
15
|
-
const opening = new WebSocket(relayed(streamUrl(house)), {
|
|
16
|
-
protocols: [SUBPROTOCOL],
|
|
17
|
-
headers: { authorization: `Bearer ${credential}` },
|
|
18
|
-
});
|
|
19
|
-
let opened = false;
|
|
20
|
-
opening.onopen = () => {
|
|
21
|
-
opened = true;
|
|
22
|
-
failures = 0;
|
|
23
|
-
socket = opening;
|
|
24
|
-
handlers.opened();
|
|
25
|
-
};
|
|
26
|
-
opening.onmessage = (event) => {
|
|
27
|
-
handlers.frame(JSON.parse(String(event.data)));
|
|
28
|
-
};
|
|
29
|
-
opening.onerror = () => undefined;
|
|
30
|
-
opening.onclose = (event) => {
|
|
31
|
-
if (socket === opening)
|
|
32
|
-
socket = null;
|
|
33
|
-
process.stderr.write(`kit: control stream closed ${event.code} ${event.reason}\n`);
|
|
34
|
-
const delay = opened ? 1000 + Math.random() * 2000 : retryDelay(failures++);
|
|
35
|
-
setTimeout(() => void connect(), delay);
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
void connect();
|
|
39
|
-
return {
|
|
40
|
-
send(frame) {
|
|
41
|
-
if (socket === null || socket.readyState !== WebSocket.OPEN)
|
|
42
|
-
return false;
|
|
43
|
-
socket.send(JSON.stringify(frame));
|
|
44
|
-
return true;
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
package/how-we-work.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# How we work
|
|
2
|
-
|
|
3
|
-
A Room is where information people share is kept; it is not the place for
|
|
4
|
-
private information. Work goes into the Room it belongs to, or the First Room
|
|
5
|
-
when none is named.
|
|
6
|
-
|
|
7
|
-
The skills are already set up; never run `setup-matt-pocock-skills`.
|
|
8
|
-
|
|
9
|
-
## Where skill output goes
|
|
10
|
-
|
|
11
|
-
- Glossary (`CONTEXT.md`): `glossary.md`
|
|
12
|
-
- Decisions (ADRs): `decisions/NNNN-<slug>.md`
|
|
13
|
-
- Plan (spec): `projects/<name>/plan.md`
|
|
14
|
-
- Tasks (tickets): `projects/<name>/tasks/NN-<slug>.md`, with a
|
|
15
|
-
`Status:` line (`needs-triage`, `needs-info`, `ready-for-agent`,
|
|
16
|
-
`ready-for-human`, `wontfix`), a `Blocked by:` line and comments under
|
|
17
|
-
`## Comments`
|
|
18
|
-
- Map (Wayfinding): `projects/<name>/map.md`, its tasks under
|
|
19
|
-
`tasks/` with `Type:`, `Status: claimed|resolved` and `Blocked by:` lines
|
|
20
|
-
- Research: `research/<slug>.md`
|
|
21
|
-
- Questionnaires: `questionnaires/<slug>.md`
|
|
22
|
-
- Learning: `learning/<topic>/`
|
|
23
|
-
- Prototype: one HTML file with every variant on one page.
|
package/skills/ask-matt/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Matt Pocock
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# Phase boundaries
|
|
2
|
-
|
|
3
|
-
A **phase** is a chunk of work inside a session: the grilling, the implementation, the QA. The definition is fuzzy on purpose: a phase ends when you think *"ok, we're done with that"*.
|
|
4
|
-
|
|
5
|
-
The **phase boundary** is the gap between two phases, and it is the only place this decision belongs. Mid-phase there is no decision to make: continue, or split the work that's left into subagents. Compacting mid-phase makes the agent lose the thread.
|
|
6
|
-
|
|
7
|
-
## The five options
|
|
8
|
-
|
|
9
|
-
| Option | What it does |
|
|
10
|
-
| ------------ | --------------------------------------------------------------- |
|
|
11
|
-
| **Continue** | Stay in the session. No context switch at all. |
|
|
12
|
-
| **`/clear`** | Empty the context window and start from nothing. |
|
|
13
|
-
| **`/handoff`** | Write a portable markdown file and seed a session anywhere with it. |
|
|
14
|
-
| **Subagent** | Send the task to its own context window and get a report back. |
|
|
15
|
-
| **`/compact`** | Compress this context and seed a fresh session with the summary. |
|
|
16
|
-
|
|
17
|
-
## The tree
|
|
18
|
-
|
|
19
|
-
Work top to bottom at the boundary. The first **yes** wins.
|
|
20
|
-
|
|
21
|
-
**1. Can you continue in this session?** Two things make the answer yes: the next phase needs this phase as a **primary source**, or you have enough [smart zone](https://www.aihero.dev/ai-coding-dictionary/smart-zone) left (~150k tokens) for the next phase to fit. Grilling → implementation is the standard yes: the implementation wants the reasoning verbatim, not a summary of it. Continue costs nothing and loses nothing, so rule it out before anything else.
|
|
22
|
-
|
|
23
|
-
**2. Is the context irrelevant to what comes next?** Is everything in this session (the exploration, the decisions, the dead ends) disposable? If so, **`/clear`**. It is the cheapest move on the board: it takes no time and hands back the whole window. `/clear` also isn't terminal: the old session stays resumable.
|
|
24
|
-
|
|
25
|
-
The cost of getting this wrong is one-way. Clear a *relevant* context and you lose the **why** behind what you built, and no amount of reading the diff back gets it returned.
|
|
26
|
-
|
|
27
|
-
**3. Do you need to hand off?** `/handoff` is narrow. You need it only when you are:
|
|
28
|
-
|
|
29
|
-
- swapping to a **new harness** (Claude → Codex),
|
|
30
|
-
- moving to a **new directory** or repo,
|
|
31
|
-
- sending the work to a **colleague**,
|
|
32
|
-
- or forking a side task you found **mid-phase** without derailing what you're doing.
|
|
33
|
-
|
|
34
|
-
That list is the whole clause. What `/handoff` buys is **portability**: a file that travels. If nothing is travelling, you don't need it.
|
|
35
|
-
|
|
36
|
-
**4. Can the task be done AFK?** Is it scoped tightly enough to run with you away from the keyboard, no steering? Then send it to a **subagent** and leave this session untouched. Automated review is the standard case: the agent reads the diff and reports, and you aren't needed while it does.
|
|
37
|
-
|
|
38
|
-
**5. Otherwise, `/compact`.** Relevant context, same harness, same directory, and you need to stay in the loop: this is where the tree lands, and it lands here often. Pass it an instruction (`/compact we're going to QA this area`) so the summary keeps what the next phase needs.
|
|
39
|
-
|
|
40
|
-
`/compact` is the **default, not the first reach**. It sits at the bottom because the four questions above it are all cheaper or more precise. The failure mode when people start here is a fresh session that is confidently wrong about a decision the summary flattened.
|
|
41
|
-
|
|
42
|
-
## Primary and secondary sources
|
|
43
|
-
|
|
44
|
-
Every move except **Continue** turns a **primary source** into a **secondary source**: the session as it happened, replaced by a summary of it. The trade is always the same shape:
|
|
45
|
-
|
|
46
|
-
| Source | Information | Noise | Room to move |
|
|
47
|
-
| --------------------------------- | ----------- | ----- | ------------ |
|
|
48
|
-
| Primary (Continue) | Full | Lots | Little |
|
|
49
|
-
| Secondary (`/compact`, `/handoff`) | Lossy | Less | Lots |
|
|
50
|
-
|
|
51
|
-
This is why question 1 comes first. You only pay the lossiness when staying costs more than it saves.
|
|
52
|
-
|
|
53
|
-
## These are judgement calls
|
|
54
|
-
|
|
55
|
-
The questions are not objective: each has taste in it, and the same boundary can go two ways on two days. The value is in asking them **in order**, at the boundary rather than in the middle of the work.
|