@agentshouse/kit 0.2.1-alpha.22 → 0.2.1-alpha.23
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 +1 -1
- package/dist/bootstrap.json +5 -5
- package/dist/copies.js +11 -15
- package/dist/git-main.js +2 -2
- package/dist/git.js +2 -2
- package/dist/instructions.js +2 -2
- package/dist/resident.js +3 -3
- package/dist/skills.js +1 -1
- package/how-we-work.md +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ connects your own agent: `house <tool>` run outside an Agent conversation calls
|
|
|
43
43
|
House as you, until you revoke that connection on Connections.
|
|
44
44
|
|
|
45
45
|
`kit resident` keeps the Environment connected, and keeps the Rooms you chose
|
|
46
|
-
for this Environment as Git repositories under `
|
|
46
|
+
for this Environment as Git repositories under `local-copies` in the
|
|
47
47
|
workspace. Commit in one and run `house git push --owner` there to send the
|
|
48
48
|
commit to House; in the container, run it through the install command from the
|
|
49
49
|
copy's directory. Inside an Agent conversation the Agent runs `house git push`.
|
package/dist/bootstrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "0.2.1-alpha.
|
|
3
|
+
"version": "0.2.1-alpha.23",
|
|
4
4
|
"hosts": {
|
|
5
5
|
"linux": {
|
|
6
|
-
"command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.
|
|
6
|
+
"command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.23/connect-linux.sh)",
|
|
7
7
|
"asset": {
|
|
8
8
|
"name": "connect-linux.sh",
|
|
9
|
-
"url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.
|
|
9
|
+
"url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.23/connect-linux.sh"
|
|
10
10
|
},
|
|
11
11
|
"workspace": {
|
|
12
12
|
"argument": "--workspace",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"windows": {
|
|
20
|
-
"command": "& ([scriptblock]::Create((irm https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.
|
|
20
|
+
"command": "& ([scriptblock]::Create((irm https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.23/connect-windows.ps1)))",
|
|
21
21
|
"asset": {
|
|
22
22
|
"name": "connect-windows.ps1",
|
|
23
|
-
"url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.
|
|
23
|
+
"url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.23/connect-windows.ps1"
|
|
24
24
|
},
|
|
25
25
|
"workspace": {
|
|
26
26
|
"argument": "--workspace",
|
package/dist/copies.js
CHANGED
|
@@ -3,13 +3,12 @@ import { randomUUID } from 'node:crypto';
|
|
|
3
3
|
import { mkdir, readFile, readdir, realpath, rename, rm, rmdir, stat, writeFile } from 'node:fs/promises';
|
|
4
4
|
import { dirname, join } from 'node:path';
|
|
5
5
|
import { HouseRefusal } from './api.js';
|
|
6
|
-
import { blobId, blobText, git, HOUSE_REF, importCommits, revision, run, succeeded, tree,
|
|
6
|
+
import { blobId, blobText, git, HOUSE_REF, importCommits, localCopies, revision, run, succeeded, tree, } from './git.js';
|
|
7
7
|
import { kitHome } from './home.js';
|
|
8
8
|
import { operationId } from './operation.js';
|
|
9
9
|
import { refusalOf } from './refusals.js';
|
|
10
10
|
import { changed } from './translate.js';
|
|
11
11
|
const BRANCH = 'main';
|
|
12
|
-
const ROOM_HOMES = ['capture', 'library', 'collaboration'];
|
|
13
12
|
const PROVENANCE = '_provenance';
|
|
14
13
|
const REPLICA_RETRY_MS = 30_000;
|
|
15
14
|
const IDENTITY = { GIT_COMMITTER_NAME: 'House Kit', GIT_COMMITTER_EMAIL: 'house-kit@localhost' };
|
|
@@ -47,9 +46,6 @@ function rootOf(copy) {
|
|
|
47
46
|
function relative(path) {
|
|
48
47
|
return path.replace(/^\/private\//, '').replace(/^\/rooms\/[^/]+\//, '');
|
|
49
48
|
}
|
|
50
|
-
function prefixesOf(selected) {
|
|
51
|
-
return selected.private ? ['/private'] : ROOM_HOMES.map((home) => `${rootOf(selected)}/${home}`);
|
|
52
|
-
}
|
|
53
49
|
function declaredWritable(path, copy) {
|
|
54
50
|
const deepest = (scopes) => Math.max(-1, ...scopes.filter((scope) => covers(path, scope)).map((scope) => scope.length));
|
|
55
51
|
return deepest(copy.write) > deepest(copy.protected);
|
|
@@ -151,7 +147,7 @@ function movedPaths(moves, before, after) {
|
|
|
151
147
|
.filter((pair) => pairs.filter((other) => other.from === pair.from || other.to === pair.to).length === 1)
|
|
152
148
|
.map(({ from, to }) => [from, to]));
|
|
153
149
|
}
|
|
154
|
-
export class
|
|
150
|
+
export class LocalCopies {
|
|
155
151
|
owner;
|
|
156
152
|
house;
|
|
157
153
|
copies = new Map();
|
|
@@ -178,7 +174,7 @@ export class WorkingCopies {
|
|
|
178
174
|
};
|
|
179
175
|
}
|
|
180
176
|
async load() {
|
|
181
|
-
const home = join(kitHome(), '
|
|
177
|
+
const home = join(kitHome(), 'local-copies');
|
|
182
178
|
const names = (await readdir(join(home, 'rooms')).catch(() => [])).filter((name) => name.endsWith('.json'));
|
|
183
179
|
for (const path of [...names.map((name) => join(home, 'rooms', name)), join(home, 'private.json')]) {
|
|
184
180
|
const text = await readFile(path, 'utf8').catch(() => null);
|
|
@@ -201,7 +197,7 @@ export class WorkingCopies {
|
|
|
201
197
|
return selected;
|
|
202
198
|
}
|
|
203
199
|
async reselect() {
|
|
204
|
-
const {
|
|
200
|
+
const { local_copy: chosen } = await this.house.post('/kit/local-copy/selection', {});
|
|
205
201
|
const selected = [
|
|
206
202
|
...(chosen?.rooms ?? [])
|
|
207
203
|
.filter((room) => room.room_handle !== null)
|
|
@@ -259,11 +255,11 @@ export class WorkingCopies {
|
|
|
259
255
|
async push(cwd, selector, caller) {
|
|
260
256
|
const located = await run(cwd, ['rev-parse', '--path-format=absolute', '--git-common-dir', '--show-toplevel']);
|
|
261
257
|
if (located.status !== 0)
|
|
262
|
-
return { refused: true, text: `${cwd} is not a House
|
|
258
|
+
return { refused: true, text: `${cwd} is not a House Local copy; run house git push inside one` };
|
|
263
259
|
const [common, worktree] = located.stdout.toString('utf8').split('\n');
|
|
264
260
|
const key = await this.keyAt(dirname(common));
|
|
265
261
|
if (key === undefined)
|
|
266
|
-
return { refused: true, text: `${worktree} is not a House
|
|
262
|
+
return { refused: true, text: `${worktree} is not a House Local copy; run house git push inside one` };
|
|
267
263
|
return this.exclusive(key, () => this.pushed(key, worktree, selector, caller));
|
|
268
264
|
}
|
|
269
265
|
async keyAt(repository) {
|
|
@@ -291,7 +287,7 @@ export class WorkingCopies {
|
|
|
291
287
|
}).catch(logged);
|
|
292
288
|
}
|
|
293
289
|
async save(copy) {
|
|
294
|
-
const path = join(kitHome(), '
|
|
290
|
+
const path = join(kitHome(), 'local-copies', copy.private ? 'private.json' : `${copy.key}.json`);
|
|
295
291
|
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
296
292
|
const temporary = `${path}.${process.pid}`;
|
|
297
293
|
await writeFile(temporary, JSON.stringify(copy), { mode: 0o600 });
|
|
@@ -300,7 +296,7 @@ export class WorkingCopies {
|
|
|
300
296
|
return copy;
|
|
301
297
|
}
|
|
302
298
|
async read(selected) {
|
|
303
|
-
const prefixes =
|
|
299
|
+
const prefixes = [rootOf(selected)];
|
|
304
300
|
const discovery = await this.house.post('/kit/door/discover', { prefixes });
|
|
305
301
|
let bundle = await this.house.post('/kit/door/bootstrap', { prefixes });
|
|
306
302
|
if ('transfer' in bundle)
|
|
@@ -347,7 +343,7 @@ export class WorkingCopies {
|
|
|
347
343
|
return;
|
|
348
344
|
}
|
|
349
345
|
const discovery = await this.house.post('/kit/door/discover', {
|
|
350
|
-
prefixes:
|
|
346
|
+
prefixes: [rootOf(copy)],
|
|
351
347
|
});
|
|
352
348
|
const authority = discovery.authorities.find((entry) => entry.room_ref === copy.room_ref);
|
|
353
349
|
if (authority === undefined)
|
|
@@ -369,7 +365,7 @@ export class WorkingCopies {
|
|
|
369
365
|
logged(`House serves nothing of ${rootOf({ private: scope.private, room_handle: scope.handle })} to copy`);
|
|
370
366
|
return;
|
|
371
367
|
}
|
|
372
|
-
const repository = scope.private ? join(
|
|
368
|
+
const repository = scope.private ? join(localCopies(), 'private') : join(localCopies(), 'rooms', read.anchor);
|
|
373
369
|
if (await exists(repository)) {
|
|
374
370
|
logged(`${repository} already exists and House Kit leaves it as it is`);
|
|
375
371
|
return;
|
|
@@ -438,7 +434,7 @@ export class WorkingCopies {
|
|
|
438
434
|
let answer;
|
|
439
435
|
try {
|
|
440
436
|
answer = await this.house.post('/kit/door/enumerate', {
|
|
441
|
-
prefixes:
|
|
437
|
+
prefixes: [rootOf(copy)],
|
|
442
438
|
positions: [{ authority: copy.room_ref, position: copy.position, log_epoch: copy.log_epoch }],
|
|
443
439
|
});
|
|
444
440
|
}
|
package/dist/git-main.js
CHANGED
|
@@ -4,7 +4,7 @@ import { accessSync, constants, realpathSync, statSync } from 'node:fs';
|
|
|
4
4
|
import { request } from 'node:http';
|
|
5
5
|
import { constants as system } from 'node:os';
|
|
6
6
|
import { delimiter, dirname, join } from 'node:path';
|
|
7
|
-
import {
|
|
7
|
+
import { localCopies } from './git.js';
|
|
8
8
|
import { kitHome } from './home.js';
|
|
9
9
|
const VALUED = new Set(['-C', '-c', '--git-dir', '--work-tree', '--namespace', '--config-env', '--attr-source', '--super-prefix']);
|
|
10
10
|
const READS = new Set([
|
|
@@ -125,7 +125,7 @@ async function observed(git, args) {
|
|
|
125
125
|
return delegated(git, args);
|
|
126
126
|
const located = captured(git, [...globals, 'rev-parse', '--path-format=absolute', '--git-common-dir', '--show-toplevel']);
|
|
127
127
|
const [common, worktree] = located?.split('\n') ?? [];
|
|
128
|
-
if (common === undefined || worktree === undefined || !dirname(common).startsWith(`${
|
|
128
|
+
if (common === undefined || worktree === undefined || !dirname(common).startsWith(`${localCopies()}/`)) {
|
|
129
129
|
return delegated(git, args);
|
|
130
130
|
}
|
|
131
131
|
const listing = [...globals, '-C', worktree, 'ls-files', '--stage', '-z'];
|
package/dist/git.js
CHANGED
|
@@ -3,8 +3,8 @@ import { createHash } from 'node:crypto';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { withoutProxy } from './clis.js';
|
|
5
5
|
import { workspaceRoot } from './home.js';
|
|
6
|
-
export function
|
|
7
|
-
return join(workspaceRoot(), '
|
|
6
|
+
export function localCopies() {
|
|
7
|
+
return join(workspaceRoot(), 'local-copies');
|
|
8
8
|
}
|
|
9
9
|
export const HOUSE_REF = 'refs/house/received';
|
|
10
10
|
const COMMITTER = 'House Kit <house-kit@localhost>';
|
package/dist/instructions.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HOW_WE_WORK } from './skills.js';
|
|
2
2
|
const HOUSE_LINE = 'Work with House through the `house` CLI: run `house --help`.';
|
|
3
3
|
const FILE_LINE = 'To give the User a file or a page, upload it with `house upload_attachment` and link it; never start a server.';
|
|
4
|
-
const READ_LINE = 'Before working in a Room, read `/private/rooms/<handle>/AGENTS.md
|
|
5
|
-
const COPIES_LINE = 'House
|
|
4
|
+
const READ_LINE = 'Before working in a Room, read `/private/rooms/<handle>/AGENTS.md`.';
|
|
5
|
+
const COPIES_LINE = 'House Local copies; commit, then `house git push`:';
|
|
6
6
|
const UNREADABLE = /^(?:\S+: )?(?:path_not_found|room_not_found|operation_denied)\b/;
|
|
7
7
|
const FAILED = /^exit: [1-9]\d*$/;
|
|
8
8
|
const CUT = /^stderr: shell: output_cut (\d+) of \d+ bytes; continue with: (.+)$/;
|
package/dist/resident.js
CHANGED
|
@@ -8,7 +8,7 @@ import { Agents } from './agents.js';
|
|
|
8
8
|
import { house } from './api.js';
|
|
9
9
|
import { received } from './bridge.js';
|
|
10
10
|
import { Conversations } from './conversations.js';
|
|
11
|
-
import {
|
|
11
|
+
import { LocalCopies } from './copies.js';
|
|
12
12
|
import { agentBase, kitHome, readEnrolment } from './home.js';
|
|
13
13
|
import { SignIns } from './sign-in.js';
|
|
14
14
|
import { placeSkillSet } from './skills.js';
|
|
@@ -60,7 +60,7 @@ export async function resident() {
|
|
|
60
60
|
await mkdir(agentBase(), { recursive: true });
|
|
61
61
|
process.env.HOUSE_KIT_RESIDENT = String(process.pid);
|
|
62
62
|
const agents = new Agents(house);
|
|
63
|
-
const copies = new
|
|
63
|
+
const copies = new LocalCopies(house);
|
|
64
64
|
await copies.load();
|
|
65
65
|
await installShim();
|
|
66
66
|
await serveOwner(copies);
|
|
@@ -103,7 +103,7 @@ export async function resident() {
|
|
|
103
103
|
frame: (arrived) => {
|
|
104
104
|
if (arrived.type === 'work_available' && arrived.subject === 'agents')
|
|
105
105
|
logged(agents.refresh());
|
|
106
|
-
if (arrived.type === 'work_available' && arrived.subject === '
|
|
106
|
+
if (arrived.type === 'work_available' && arrived.subject === 'local_copy')
|
|
107
107
|
logged(copies.select());
|
|
108
108
|
if (arrived.type === 'entries') {
|
|
109
109
|
copies.entries(arrived);
|
package/dist/skills.js
CHANGED
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
import { KIT_VERSION } from './clis.js';
|
|
7
7
|
import { kitHome, readConfiguration, readHome, writeHome } from './home.js';
|
|
8
8
|
import { refusalOf } from './refusals.js';
|
|
9
|
-
export const HOW_WE_WORK = '/private/
|
|
9
|
+
export const HOW_WE_WORK = '/private/how-we-work.md';
|
|
10
10
|
const SKILL_SET = fileURLToPath(new URL('../skills/', import.meta.url));
|
|
11
11
|
const HOW_WE_WORK_TEXT = readFileSync(new URL('../how-we-work.md', import.meta.url), 'utf8');
|
|
12
12
|
const RECORD = 'skill-set.json';
|
package/how-we-work.md
CHANGED
|
@@ -8,16 +8,16 @@ The skills are already set up; never run `setup-matt-pocock-skills`.
|
|
|
8
8
|
|
|
9
9
|
## Where skill output goes
|
|
10
10
|
|
|
11
|
-
- Glossary (`CONTEXT.md`): `
|
|
12
|
-
- Decisions (ADRs): `
|
|
13
|
-
- Plan (spec): `
|
|
14
|
-
- Tasks (tickets): `
|
|
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
15
|
`Status:` line (`needs-triage`, `needs-info`, `ready-for-agent`,
|
|
16
16
|
`ready-for-human`, `wontfix`), a `Blocked by:` line and comments under
|
|
17
17
|
`## Comments`
|
|
18
|
-
- Map (Wayfinding): `
|
|
18
|
+
- Map (Wayfinding): `projects/<name>/map.md`, its tasks under
|
|
19
19
|
`tasks/` with `Type:`, `Status: claimed|resolved` and `Blocked by:` lines
|
|
20
|
-
- Research: `
|
|
21
|
-
- Questionnaires: `
|
|
22
|
-
- Learning: `
|
|
20
|
+
- Research: `research/<slug>.md`
|
|
21
|
+
- Questionnaires: `questionnaires/<slug>.md`
|
|
22
|
+
- Learning: `learning/<topic>/`
|
|
23
23
|
- Prototype: one HTML file with every variant on one page.
|