@agentshouse/kit 0.2.1-c53a84236c3d9 → 0.2.1-c57b73ff93a76

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.
Files changed (131) hide show
  1. package/README.md +44 -43
  2. package/dist/acp.js +90 -19
  3. package/dist/agents.js +118 -40
  4. package/dist/api.js +7 -3
  5. package/dist/app-git.js +10 -26
  6. package/dist/authority-main.js +2 -2
  7. package/dist/bridge.js +4 -7
  8. package/dist/building.js +46 -0
  9. package/dist/calls.js +71 -0
  10. package/dist/chatgpt.js +32 -0
  11. package/dist/clis-main.js +2 -2
  12. package/dist/clis.js +92 -23
  13. package/dist/connection.js +116 -0
  14. package/dist/conversations.js +531 -177
  15. package/dist/copies.js +91 -54
  16. package/dist/end.js +29 -4
  17. package/dist/enrol-main.js +7 -1
  18. package/dist/events.js +33 -8
  19. package/dist/files.js +139 -31
  20. package/dist/git.js +13 -11
  21. package/dist/home.js +96 -7
  22. package/dist/house-cli.js +299 -0
  23. package/dist/house-main.js +7 -188
  24. package/dist/instructions.js +7 -10
  25. package/dist/kit-cli.js +68 -0
  26. package/dist/kit-main.js +8 -22
  27. package/dist/login.js +113 -23
  28. package/dist/logout.js +0 -2
  29. package/dist/mcp.js +6 -2
  30. package/dist/parts.js +34 -16
  31. package/dist/placement.js +39 -0
  32. package/dist/relay.js +33 -2
  33. package/dist/resident.js +99 -34
  34. package/dist/scope.js +3 -0
  35. package/dist/scripts.js +255 -0
  36. package/dist/service-main.js +9 -0
  37. package/dist/service.js +55 -0
  38. package/dist/sign-in.js +22 -39
  39. package/dist/silence.js +28 -0
  40. package/dist/skills.js +49 -35
  41. package/dist/transcription.js +85 -45
  42. package/dist/translate.js +2 -8
  43. package/dist/update.js +115 -53
  44. package/dist/wire.js +22 -0
  45. package/dist/work.js +3 -5
  46. package/package.json +20 -20
  47. package/dist/bootstrap.json +0 -24
  48. package/dist/stream.js +0 -72
  49. package/how-we-work.md +0 -23
  50. package/skills/ask-matt/LICENSE +0 -21
  51. package/skills/ask-matt/PHASE-BOUNDARIES.md +0 -55
  52. package/skills/ask-matt/SKILL.md +0 -91
  53. package/skills/ask-matt/agents/openai.yaml +0 -4
  54. package/skills/code-review/LICENSE +0 -21
  55. package/skills/code-review/SKILL.md +0 -89
  56. package/skills/code-review/agents/openai.yaml +0 -3
  57. package/skills/codebase-design/DEEPENING.md +0 -37
  58. package/skills/codebase-design/DESIGN-IT-TWICE.md +0 -44
  59. package/skills/codebase-design/LICENSE +0 -21
  60. package/skills/codebase-design/SKILL.md +0 -116
  61. package/skills/codebase-design/agents/openai.yaml +0 -3
  62. package/skills/diagnosing-bugs/LICENSE +0 -21
  63. package/skills/diagnosing-bugs/SKILL.md +0 -140
  64. package/skills/diagnosing-bugs/agents/openai.yaml +0 -3
  65. package/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +0 -44
  66. package/skills/domain-modeling/ADR-FORMAT.md +0 -47
  67. package/skills/domain-modeling/CONTEXT-FORMAT.md +0 -60
  68. package/skills/domain-modeling/LICENSE +0 -21
  69. package/skills/domain-modeling/SKILL.md +0 -76
  70. package/skills/domain-modeling/agents/openai.yaml +0 -3
  71. package/skills/grill-me/LICENSE +0 -21
  72. package/skills/grill-me/SKILL.md +0 -8
  73. package/skills/grill-me/agents/openai.yaml +0 -4
  74. package/skills/grill-with-docs/LICENSE +0 -21
  75. package/skills/grill-with-docs/SKILL.md +0 -8
  76. package/skills/grill-with-docs/agents/openai.yaml +0 -4
  77. package/skills/grilling/LICENSE +0 -21
  78. package/skills/grilling/SKILL.md +0 -30
  79. package/skills/grilling/agents/openai.yaml +0 -3
  80. package/skills/handoff/LICENSE +0 -21
  81. package/skills/handoff/SKILL.md +0 -17
  82. package/skills/handoff/agents/openai.yaml +0 -4
  83. package/skills/implement/LICENSE +0 -21
  84. package/skills/implement/SKILL.md +0 -16
  85. package/skills/implement/agents/openai.yaml +0 -4
  86. package/skills/improve-codebase-architecture/HTML-REPORT.md +0 -123
  87. package/skills/improve-codebase-architecture/LICENSE +0 -21
  88. package/skills/improve-codebase-architecture/SKILL.md +0 -72
  89. package/skills/improve-codebase-architecture/agents/openai.yaml +0 -4
  90. package/skills/prototype/LICENSE +0 -21
  91. package/skills/prototype/LOGIC.md +0 -67
  92. package/skills/prototype/SKILL.md +0 -28
  93. package/skills/prototype/UI.md +0 -112
  94. package/skills/prototype/agents/openai.yaml +0 -3
  95. package/skills/research/LICENSE +0 -21
  96. package/skills/research/SKILL.md +0 -14
  97. package/skills/research/agents/openai.yaml +0 -3
  98. package/skills/resolving-merge-conflicts/LICENSE +0 -21
  99. package/skills/resolving-merge-conflicts/SKILL.md +0 -16
  100. package/skills/resolving-merge-conflicts/agents/openai.yaml +0 -3
  101. package/skills/tdd/LICENSE +0 -21
  102. package/skills/tdd/SKILL.md +0 -40
  103. package/skills/tdd/agents/openai.yaml +0 -3
  104. package/skills/tdd/mocking.md +0 -59
  105. package/skills/tdd/tests.md +0 -77
  106. package/skills/teach/GLOSSARY-FORMAT.md +0 -35
  107. package/skills/teach/LEARNING-RECORD-FORMAT.md +0 -46
  108. package/skills/teach/LICENSE +0 -21
  109. package/skills/teach/MISSION-FORMAT.md +0 -31
  110. package/skills/teach/RESOURCES-FORMAT.md +0 -32
  111. package/skills/teach/SKILL.md +0 -141
  112. package/skills/teach/agents/openai.yaml +0 -4
  113. package/skills/to-questionnaire/LICENSE +0 -21
  114. package/skills/to-questionnaire/SKILL.md +0 -55
  115. package/skills/to-questionnaire/agents/openai.yaml +0 -4
  116. package/skills/to-spec/LICENSE +0 -21
  117. package/skills/to-spec/SKILL.md +0 -76
  118. package/skills/to-spec/agents/openai.yaml +0 -4
  119. package/skills/to-tickets/LICENSE +0 -21
  120. package/skills/to-tickets/SKILL.md +0 -106
  121. package/skills/to-tickets/agents/openai.yaml +0 -4
  122. package/skills/wait-what/LICENSE +0 -21
  123. package/skills/wait-what/SKILL.md +0 -8
  124. package/skills/wait-what/agents/openai.yaml +0 -4
  125. package/skills/wayfinder/LICENSE +0 -21
  126. package/skills/wayfinder/SKILL.md +0 -129
  127. package/skills/wayfinder/agents/openai.yaml +0 -4
  128. package/skills/writing-for-agents/LICENSE +0 -21
  129. package/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
  130. package/skills/writing-for-agents/SKILL.md +0 -83
  131. package/skills/writing-for-agents/agents/openai.yaml +0 -3
package/dist/update.js CHANGED
@@ -4,11 +4,15 @@ import { mkdir, readFile, rm, writeFile } from 'node:fs/promises';
4
4
  import { homedir } from 'node:os';
5
5
  import { join } from 'node:path';
6
6
  import { run } from './clis.js';
7
- import { kitHome } from './home.js';
8
- const RECORD = 'outcome=$1; shift; bash "$0" --linux "$@"; printf %s "$?" > "$outcome"; systemctl start house-kit.service';
9
- function logged(error) {
10
- process.stderr.write(`kit: ${error instanceof Error ? error.message : String(error)}\n`);
11
- }
7
+ import { kitHome, workspaceRoot } from './home.js';
8
+ import { service, throughSudo } from './placement.js';
9
+ import { relayed } from './relay.js';
10
+ const BOOTSTRAP_BYTES = 1_000_000;
11
+ // A bootstrap is at most a million bytes, so two minutes carry it over ten kilobytes a second and no stalled host holds the update queue.
12
+ const BOOTSTRAP_MS = 120_000;
13
+ // A bootstrap's downloads and CLI updates take minutes, so one still running after an hour has hung and is ended before it keeps the Kit offline.
14
+ const RERUN_MS = 60 * 60_000;
15
+ const TIMED_OUT = '124';
12
16
  function directory() {
13
17
  return join(kitHome(), 'update');
14
18
  }
@@ -18,10 +22,25 @@ function pending() {
18
22
  function outcome() {
19
23
  return join(directory(), 'outcome');
20
24
  }
21
- function unit(inputId) {
22
- return `house-kit-update-${inputId}`;
25
+ function unit(callId) {
26
+ return `house-kit-update-${callId}`;
27
+ }
28
+ function manager() {
29
+ return service() === 'user' ? ['--user'] : [];
30
+ }
31
+ function elevated() {
32
+ return throughSudo() ? ['sudo', '-n'] : [];
33
+ }
34
+ function account() {
35
+ return throughSudo() ? [`--uid=${process.getuid()}`, `--gid=${process.getgid()}`] : [];
36
+ }
37
+ function placement() {
38
+ return service() === 'user' ? ['--workspace', workspaceRoot()] : ['--linux'];
23
39
  }
24
- async function pendingInput() {
40
+ function record() {
41
+ return `outcome=$1; shift; timeout ${RERUN_MS / 1000} bash "$0" "$@"; printf %s "$?" > "$outcome"; ${[...elevated(), 'systemctl', ...manager(), 'start', 'house-kit.service'].join(' ')}`;
42
+ }
43
+ async function pendingCall() {
25
44
  try {
26
45
  return JSON.parse(await readFile(pending(), 'utf8')).input_id;
27
46
  }
@@ -33,87 +52,130 @@ async function recorded() {
33
52
  const status = await readFile(outcome(), 'utf8').catch(() => null);
34
53
  if (status === null)
35
54
  return null;
55
+ if (status.trim() === TIMED_OUT)
56
+ return { refused: `the Kit bootstrap did not finish within ${RERUN_MS / 1000} seconds` };
36
57
  return status.trim() === '0' ? {} : { refused: `the Kit bootstrap exited with ${status.trim()}` };
37
58
  }
38
- async function finished(inputId) {
59
+ async function forget(callId) {
60
+ if ((await pendingCall()) !== callId)
61
+ return;
62
+ await rm(pending(), { force: true });
63
+ await rm(outcome(), { force: true });
64
+ }
65
+ async function finished(callId) {
39
66
  for (;;) {
40
- const ack = await recorded();
41
- if (ack !== null)
42
- return ack;
67
+ const result = await recorded();
68
+ if (result !== null)
69
+ return result;
43
70
  // systemctl answers at once, so ten seconds only bounds a stuck service manager.
44
- if ((await run('systemctl', ['is-active', '--quiet', unit(inputId)], 10_000)).status !== 0) {
71
+ if ((await run('systemctl', [...manager(), 'is-active', '--quiet', unit(callId)], 10_000)).status !== 0) {
45
72
  return (await recorded()) ?? { refused: 'the Kit bootstrap did not finish' };
46
73
  }
47
74
  // The bootstrap runs for minutes, so checking each second sees its outcome within a second at little cost.
48
75
  await new Promise((resolve) => setTimeout(resolve, 1000));
49
76
  }
50
77
  }
51
- function rerun(script, inputId, flags) {
78
+ async function bounded(body, most) {
79
+ const chunks = [];
80
+ let bytes = 0;
81
+ for await (const chunk of body ?? []) {
82
+ bytes += chunk.length;
83
+ if (bytes > most)
84
+ return null;
85
+ chunks.push(chunk);
86
+ }
87
+ return Buffer.concat(chunks, bytes);
88
+ }
89
+ function rerun(script, callId, flags) {
52
90
  return new Promise((resolve) => {
53
- const child = spawn('systemd-run', [
91
+ const [command, ...args] = [
92
+ ...elevated(),
93
+ 'systemd-run',
94
+ ...manager(),
95
+ ...account(),
54
96
  '--wait',
55
97
  '--collect',
56
98
  '--quiet',
57
- `--unit=${unit(inputId)}`,
99
+ `--unit=${unit(callId)}`,
58
100
  `--setenv=HOME=${homedir()}`,
101
+ `--setenv=HOUSE_KIT_HOME=${kitHome()}`,
59
102
  '/bin/sh',
60
103
  '-c',
61
- RECORD,
104
+ record(),
62
105
  script,
63
106
  outcome(),
107
+ ...placement(),
64
108
  ...flags,
65
- ], { stdio: ['ignore', 'ignore', 'inherit'] });
66
- child.on('error', () => resolve({ refused: 'no service manager runs this Kit' }));
109
+ ];
110
+ const child = spawn(command, args, { stdio: ['ignore', 'ignore', 'inherit'] });
111
+ child.on('error', () => resolve({ refused: 'no service manager runs this Kit process' }));
67
112
  child.on('close', () => resolve(null));
68
113
  });
69
114
  }
70
- export class Updates {
71
- house;
72
- held = new Set();
115
+ export class KitUpdate {
116
+ calls;
117
+ changed;
118
+ waiting = new Map();
73
119
  queue = Promise.resolve();
74
- constructor(house) {
75
- this.house = house;
120
+ constructor(calls, changed) {
121
+ this.calls = calls;
122
+ this.changed = changed;
76
123
  }
77
124
  async resumed() {
78
- const inputId = await pendingInput();
79
- if (inputId === null)
125
+ const callId = await pendingCall();
126
+ if (callId === null)
80
127
  return;
81
- await this.acknowledge(inputId, await finished(inputId));
128
+ await this.enqueue(callId, () => finished(callId));
82
129
  }
83
- start(input) {
84
- if (this.held.has(input.input_id))
85
- return;
86
- this.held.add(input.input_id);
87
- this.queue = this.queue
88
- .then(() => this.carry(input))
89
- .then((ack) => this.acknowledge(input.input_id, ack))
90
- .catch(logged)
91
- .finally(() => this.held.delete(input.input_id));
130
+ hold(call) {
131
+ this.waiting.set(call.input_id, call);
132
+ this.changed();
133
+ }
134
+ held() {
135
+ return this.waiting.size > 0;
136
+ }
137
+ apply(resume) {
138
+ const held = [...this.waiting.values()];
139
+ this.waiting.clear();
140
+ void Promise.all(held.map((call) => this.enqueue(call.input_id, () => this.carry(call)))).then(resume);
92
141
  }
93
- async carry(input) {
94
- if ((await pendingInput()) === input.input_id)
95
- return finished(input.input_id);
96
- const answer = await fetch(input.bootstrap);
97
- if (!answer.ok)
98
- return { refused: `the Kit bootstrap could not be downloaded: ${answer.status}` };
99
- const script = Buffer.from(await answer.arrayBuffer());
100
- if (createHash('sha256').update(script).digest('hex') !== input.sha256) {
142
+ enqueue(callId, work) {
143
+ const before = this.queue;
144
+ const carried = this.calls.carry(callId, async () => {
145
+ await before;
146
+ return { result: await work(), returned: () => forget(callId) };
147
+ });
148
+ this.queue = before.then(() => carried);
149
+ return carried;
150
+ }
151
+ async carry(call) {
152
+ if ((await pendingCall()) === call.input_id)
153
+ return finished(call.input_id);
154
+ const deadline = AbortSignal.timeout(BOOTSTRAP_MS);
155
+ let script;
156
+ try {
157
+ const answer = await fetch(relayed(call.bootstrap), { signal: deadline });
158
+ if (!answer.ok)
159
+ return { refused: `the Kit bootstrap could not be downloaded: ${answer.status}` };
160
+ script = await bounded(answer.body, BOOTSTRAP_BYTES);
161
+ }
162
+ catch (error) {
163
+ if (!deadline.aborted)
164
+ throw error;
165
+ return { refused: `the Kit bootstrap did not arrive within ${BOOTSTRAP_MS / 1000} seconds` };
166
+ }
167
+ if (script === null)
168
+ return { refused: `the Kit bootstrap is larger than ${BOOTSTRAP_BYTES} bytes` };
169
+ if (createHash('sha256').update(script).digest('hex') !== call.sha256) {
101
170
  return { refused: 'the Kit bootstrap does not match its sha256' };
102
171
  }
103
172
  await mkdir(directory(), { recursive: true, mode: 0o700 });
104
173
  const path = join(directory(), 'connect-linux.sh');
105
174
  await writeFile(path, script, { mode: 0o700 });
106
175
  await rm(outcome(), { force: true });
107
- await writeFile(pending(), `${JSON.stringify({ input_id: input.input_id })}\n`, { mode: 0o600 });
108
- return (await rerun(path, input.input_id, input.update_clis ? ['--update-clis'] : [])) ?? (await recorded()) ?? {
176
+ await writeFile(pending(), `${JSON.stringify({ input_id: call.input_id })}\n`, { mode: 0o600 });
177
+ return (await rerun(path, call.input_id, call.update_clis ? ['--update-clis'] : [])) ?? (await recorded()) ?? {
109
178
  refused: 'the Kit bootstrap did not finish',
110
179
  };
111
180
  }
112
- async acknowledge(inputId, ack) {
113
- await this.house.deliver(`/kit/inputs/${inputId}/ack`, ack);
114
- if ((await pendingInput()) !== inputId)
115
- return;
116
- await rm(pending(), { force: true });
117
- await rm(outcome(), { force: true });
118
- }
119
181
  }
package/dist/wire.js ADDED
@@ -0,0 +1,22 @@
1
+ import { newerThanHouse, updateRequired } from './end.js';
2
+ import { machine } from './placement.js';
3
+ import { refusalOf } from './refusals.js';
4
+ export const KIT_WIRE = 3;
5
+ export const KIT_WIRE_HEADER = 'x-house-kit-wire';
6
+ function newer(text) {
7
+ let body;
8
+ try {
9
+ body = JSON.parse(text);
10
+ }
11
+ catch {
12
+ return null;
13
+ }
14
+ return body?.error?.code === 'kit_newer_than_house' ? body.error : null;
15
+ }
16
+ export function endUnserved(text) {
17
+ if (refusalOf(text)?.code === 'kit_update_required')
18
+ updateRequired();
19
+ const refused = newer(text);
20
+ if (refused !== null)
21
+ newerThanHouse(refused.release, refused.commands[machine()]);
22
+ }
package/dist/work.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { once } from 'node:events';
3
3
  import { readFileSync } from 'node:fs';
4
- import { mkdir, rm } from 'node:fs/promises';
4
+ import { rm } from 'node:fs/promises';
5
5
  import { createServer } from 'node:net';
6
6
  import { join } from 'node:path';
7
7
  import { RUNNING_JOB } from './events.js';
8
- import { kitHome } from './home.js';
8
+ import { kitHome, socketDirectory } from './home.js';
9
9
  const ENDED_TASK = new Set(['completed', 'failed', 'killed']);
10
10
  const SCHEDULING = new Set(['CronCreate', 'CronDelete', 'ScheduleWakeup']);
11
11
  const QUEUE_LIST = 'house-kit-queue-';
@@ -194,9 +194,7 @@ class CodexWork extends Work {
194
194
  proving = -1;
195
195
  proven = -1;
196
196
  async open(cli) {
197
- const sockets = join(kitHome(), 'bridges');
198
- await mkdir(sockets, { recursive: true, mode: 0o700 });
199
- this.path = join(sockets, `${randomUUID()}.sock`);
197
+ this.path = join(socketDirectory(), `${randomUUID()}.sock`);
200
198
  this.server = createServer((socket) => this.connected(socket));
201
199
  this.server.listen(this.path);
202
200
  await once(this.server, 'listening');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agentshouse/kit",
3
- "version": "0.2.1-c53a84236c3d9",
4
- "description": "House Kit connects an Environment to agents.house.",
3
+ "version": "0.2.1-c57b73ff93a76",
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
- "build": "tsc -p tsconfig.build.json && node scripts/bootstrap-manifest.mjs",
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": "1.7.0",
30
- "@agentshouse/mdmodel": "0.1.0-alpha.19",
27
+ "@agentclientprotocol/sdk": "2.0.1",
28
+ "@agentshouse/mdmodel": "0.1.0-c4f4d37bc9d6a",
29
+ "@agentshouse/skills": "0.1.0-c1884c2b56810",
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.85.1",
35
- "@agentclientprotocol/codex-acp": "2.1.1"
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.13.6",
46
+ "@types/node": "24.19.2",
47
47
  "@types/ws": "8.18.2",
48
48
  "typescript": "7.0.2",
49
- "vitest": "5.0.1",
49
+ "vitest": "5.0.5",
50
50
  "ws": "8.22.0"
51
51
  },
52
- "packageManager": "npm@11.19.0",
52
+ "packageManager": "npm@11.19.1",
53
53
  "engines": {
54
- "node": "24.21.0",
55
- "npm": "11.19.0"
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.21.0",
60
+ "version": "24.22.1",
61
61
  "onFail": "error"
62
62
  },
63
63
  "packageManager": {
64
64
  "name": "npm",
65
- "version": "11.19.0",
65
+ "version": "11.19.1",
66
66
  "onFail": "error"
67
67
  }
68
68
  }
@@ -1,24 +0,0 @@
1
- {
2
- "schemaVersion": 2,
3
- "version": "0.2.1-c53a84236c3d9",
4
- "hosts": {
5
- "macos": {
6
- "asset": {
7
- "name": "connect-linux.sh",
8
- "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-c53a84236c3d9/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-c53a84236c3d9/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-c53a84236c3d9/connect-windows.ps1"
21
- }
22
- }
23
- }
24
- }
package/dist/stream.js DELETED
@@ -1,72 +0,0 @@
1
- import { subscribe } from 'node:diagnostics_channel';
2
- import { finalRefusal, HouseRefusal, retryDelay } from './api.js';
3
- import { end, REPLACED, SIGN_IN_AGAIN } from './end.js';
4
- import { readEnrolment } from './home.js';
5
- import { relayed } from './relay.js';
6
- const PATH = '/kit/stream';
7
- const SUBPROTOCOL = 'house.kit.stream.1';
8
- const REFUSAL_HEADER = 'x-house-refusal';
9
- function streamUrl(house) {
10
- const url = new URL(PATH, house);
11
- url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
12
- return url;
13
- }
14
- function header(headers, name) {
15
- for (let index = 0; index < headers.length; index += 2) {
16
- if (headers[index].toString('latin1').toLowerCase() === name)
17
- return headers[index + 1].toString('latin1');
18
- }
19
- return '';
20
- }
21
- let refused = null;
22
- subscribe('undici:request:headers', (message) => {
23
- const { request, response } = message;
24
- if (!request.path.endsWith(PATH))
25
- return;
26
- refused = new HouseRefusal(PATH, response.statusCode, header(response.headers, REFUSAL_HEADER) || response.statusText);
27
- });
28
- export function holdStream(handlers) {
29
- let socket = null;
30
- let failures = 0;
31
- const connect = async () => {
32
- const { house, credential } = (await readEnrolment());
33
- refused = null;
34
- const opening = new WebSocket(relayed(streamUrl(house)), {
35
- protocols: [SUBPROTOCOL],
36
- headers: { authorization: `Bearer ${credential}` },
37
- });
38
- let opened = false;
39
- opening.onopen = () => {
40
- opened = true;
41
- failures = 0;
42
- socket = opening;
43
- handlers.opened();
44
- };
45
- opening.onmessage = (event) => {
46
- handlers.frame(JSON.parse(String(event.data)));
47
- };
48
- opening.onerror = () => undefined;
49
- opening.onclose = (event) => {
50
- if (socket === opening)
51
- socket = null;
52
- process.stderr.write(`kit: control stream closed ${event.code} ${event.reason}\n`);
53
- if (event.reason === 'replaced')
54
- end(REPLACED);
55
- if (event.reason === 'credential_rejected' || refused?.status === 401)
56
- end(SIGN_IN_AGAIN);
57
- if (finalRefusal(refused))
58
- end(refused.message);
59
- // A closed socket reopens in one to three seconds, spread so Kits one restart closed return apart; an opening House refused as retryable or left unanswered backs off on the jittered curve.
60
- setTimeout(() => void connect(), opened ? 1000 + Math.random() * 2000 : retryDelay(failures++));
61
- };
62
- };
63
- void connect();
64
- return {
65
- send(frame) {
66
- if (socket === null || socket.readyState !== WebSocket.OPEN)
67
- return false;
68
- socket.send(JSON.stringify(frame));
69
- return true;
70
- },
71
- };
72
- }
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.
@@ -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.