@agentshouse/kit 0.2.1-cf6a92e13f031 → 0.2.1-cfbadfb5b5e28
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 +14 -15
- package/dist/acp.js +58 -7
- package/dist/afk.js +17 -0
- package/dist/agents.js +58 -32
- package/dist/authority-main.js +3 -3
- package/dist/bridge.js +4 -4
- package/dist/building.js +50 -0
- package/dist/calls.js +12 -4
- package/dist/chunks.js +49 -0
- package/dist/clis.js +41 -42
- package/dist/connection.js +27 -33
- package/dist/content.js +63 -0
- package/dist/conversations.js +348 -126
- package/dist/copies.js +294 -148
- package/dist/end.js +8 -2
- package/dist/events.js +742 -210
- package/dist/files.js +35 -19
- package/dist/git.js +46 -12
- package/dist/grok.js +39 -0
- package/dist/home.js +0 -7
- package/dist/house-cli.js +26 -13
- package/dist/house-main.js +3 -3
- package/dist/instructions.js +5 -7
- package/dist/kit-cli.js +3 -6
- package/dist/kit-main.js +3 -3
- package/dist/login.js +5 -3
- package/dist/logout.js +1 -1
- package/dist/mcp.js +2 -0
- package/dist/placement.js +10 -18
- package/dist/relay.js +21 -0
- package/dist/resident.js +47 -32
- package/dist/scope.js +12 -4
- package/dist/scripts.js +255 -0
- package/dist/secret-input.js +1 -1
- package/dist/sign-in.js +3 -2
- package/dist/silence.js +28 -0
- package/dist/skills.js +38 -12
- package/dist/transcription.js +37 -25
- package/dist/translate.js +18 -9
- package/dist/update.js +109 -120
- package/dist/wire.js +23 -5
- package/dist/work.js +9 -2
- package/package.json +18 -17
- package/dist/bootstrap.json +0 -24
- package/dist/chatgpt.js +0 -32
- package/dist/clis-main.js +0 -23
- package/dist/parts.js +0 -82
- package/dist/web-wizard.js +0 -100
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/parts.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
export class Parts {
|
|
2
|
-
parts = [];
|
|
3
|
-
context = null;
|
|
4
|
-
emit;
|
|
5
|
-
made = [];
|
|
6
|
-
events = 0;
|
|
7
|
-
writing = null;
|
|
8
|
-
counting = null;
|
|
9
|
-
planned = null;
|
|
10
|
-
constructor(emit) {
|
|
11
|
-
this.emit = emit;
|
|
12
|
-
}
|
|
13
|
-
write(type, id, text) {
|
|
14
|
-
if (text === '')
|
|
15
|
-
return;
|
|
16
|
-
if (this.writing?.type === type && this.writing.id === id) {
|
|
17
|
-
this.parts[this.writing.index].text += text;
|
|
18
|
-
this.emit({ op: 'append', index: this.writing.index, text });
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
this.writing = { type, id, index: this.start({ type, text }) };
|
|
22
|
-
}
|
|
23
|
-
command() {
|
|
24
|
-
if (this.counting === null) {
|
|
25
|
-
this.counting = this.start({ type: 'commands', count: 1 });
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const part = this.parts[this.counting];
|
|
29
|
-
part.count++;
|
|
30
|
-
this.emit({ op: 'count', index: this.counting, count: part.count });
|
|
31
|
-
}
|
|
32
|
-
start(part) {
|
|
33
|
-
this.writing = null;
|
|
34
|
-
this.counting = null;
|
|
35
|
-
return this.add(part, ++this.events);
|
|
36
|
-
}
|
|
37
|
-
reserve() {
|
|
38
|
-
this.writing = null;
|
|
39
|
-
this.counting = null;
|
|
40
|
-
return ++this.events;
|
|
41
|
-
}
|
|
42
|
-
arrive(part, reserved) {
|
|
43
|
-
this.add(part, reserved);
|
|
44
|
-
}
|
|
45
|
-
done(index, result) {
|
|
46
|
-
const part = this.parts[index];
|
|
47
|
-
part.status = 'done';
|
|
48
|
-
part.result = result;
|
|
49
|
-
this.emit({ op: 'status', index, status: 'done', result });
|
|
50
|
-
}
|
|
51
|
-
plan(entries) {
|
|
52
|
-
if (this.planned === null) {
|
|
53
|
-
this.planned = this.start({ type: 'plan', entries });
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
this.parts[this.planned].entries = entries;
|
|
57
|
-
this.emit({ op: 'plan', index: this.planned, entries });
|
|
58
|
-
}
|
|
59
|
-
measure(context) {
|
|
60
|
-
this.context = context;
|
|
61
|
-
this.emit({ op: 'context', ...context });
|
|
62
|
-
}
|
|
63
|
-
saved() {
|
|
64
|
-
return this.parts
|
|
65
|
-
.map((part, index) => ({ part, made: this.made[index] }))
|
|
66
|
-
.sort((a, b) => a.made - b.made)
|
|
67
|
-
.map(({ part }) => part);
|
|
68
|
-
}
|
|
69
|
-
operations() {
|
|
70
|
-
return [
|
|
71
|
-
...this.parts.map((part, index) => ({ op: 'start', index, part })),
|
|
72
|
-
...(this.context === null ? [] : [{ op: 'context', ...this.context }]),
|
|
73
|
-
];
|
|
74
|
-
}
|
|
75
|
-
add(part, made) {
|
|
76
|
-
this.parts.push(part);
|
|
77
|
-
this.made.push(made);
|
|
78
|
-
const index = this.parts.length - 1;
|
|
79
|
-
this.emit({ op: 'start', index, part });
|
|
80
|
-
return index;
|
|
81
|
-
}
|
|
82
|
-
}
|
package/dist/web-wizard.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { loginPath, onLoginPath, withoutProxy } from './clis.js';
|
|
2
|
-
import { killTree } from './scope.js';
|
|
3
|
-
const TERMINAL = 'xterm-256color';
|
|
4
|
-
const SIGNALLED = 128;
|
|
5
|
-
const NO_BASH = "bash is not on the login shell's PATH";
|
|
6
|
-
const LOST = { refused: 'the Kit lost its connection to House' };
|
|
7
|
-
function causeOf(error) {
|
|
8
|
-
return error instanceof Error ? error.message : String(error);
|
|
9
|
-
}
|
|
10
|
-
function failed(cause) {
|
|
11
|
-
process.stderr.write(`kit: a Web Wizard could not start: ${cause}\n`);
|
|
12
|
-
return { refused: `the script could not start: ${cause}` };
|
|
13
|
-
}
|
|
14
|
-
export class WebWizards {
|
|
15
|
-
calls;
|
|
16
|
-
send;
|
|
17
|
-
runs = new Map();
|
|
18
|
-
constructor(calls, send) {
|
|
19
|
-
this.calls = calls;
|
|
20
|
-
this.send = send;
|
|
21
|
-
}
|
|
22
|
-
start(call) {
|
|
23
|
-
void this.calls.carry(call.input_id, () => this.run(call));
|
|
24
|
-
}
|
|
25
|
-
notified(notification) {
|
|
26
|
-
const run = this.runs.get(String(notification.wizard));
|
|
27
|
-
if (run === undefined)
|
|
28
|
-
return;
|
|
29
|
-
if (notification.type === 'wizard_input')
|
|
30
|
-
this.typed(run, String(notification.data));
|
|
31
|
-
if (notification.type === 'wizard_size')
|
|
32
|
-
this.resized(run, { cols: Number(notification.cols), rows: Number(notification.rows) });
|
|
33
|
-
if (notification.type === 'wizard_end')
|
|
34
|
-
this.end(run, {});
|
|
35
|
-
}
|
|
36
|
-
disconnected() {
|
|
37
|
-
for (const run of this.runs.values())
|
|
38
|
-
this.end(run, LOST);
|
|
39
|
-
}
|
|
40
|
-
async run(call) {
|
|
41
|
-
const run = { terminal: null, size: null, typed: [], ended: null, sized: Promise.withResolvers() };
|
|
42
|
-
this.runs.set(call.input_id, run);
|
|
43
|
-
try {
|
|
44
|
-
return { result: await this.ran(call.input_id, call.script, run) };
|
|
45
|
-
}
|
|
46
|
-
finally {
|
|
47
|
-
this.runs.delete(call.input_id);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async ran(wizard, script, run) {
|
|
51
|
-
let terminal;
|
|
52
|
-
try {
|
|
53
|
-
const { spawn } = await import('@lydell/node-pty');
|
|
54
|
-
const shell = await onLoginPath('bash');
|
|
55
|
-
if (shell === null)
|
|
56
|
-
return failed(NO_BASH);
|
|
57
|
-
const path = await loginPath();
|
|
58
|
-
await run.sized.promise;
|
|
59
|
-
if (run.ended !== null)
|
|
60
|
-
return run.ended;
|
|
61
|
-
terminal = spawn(shell, ['-c', script], {
|
|
62
|
-
name: TERMINAL,
|
|
63
|
-
...run.size,
|
|
64
|
-
cwd: process.cwd(),
|
|
65
|
-
env: { ...withoutProxy(), PATH: path },
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
return failed(causeOf(error));
|
|
70
|
-
}
|
|
71
|
-
run.terminal = terminal;
|
|
72
|
-
terminal.onData((data) => this.send({ type: 'wizard_output', wizard, data }));
|
|
73
|
-
for (const data of run.typed.splice(0))
|
|
74
|
-
terminal.write(data);
|
|
75
|
-
const exited = await new Promise((resolve) => terminal.onExit(resolve));
|
|
76
|
-
return run.ended ?? { exit_code: exited.signal ? SIGNALLED + exited.signal : exited.exitCode };
|
|
77
|
-
}
|
|
78
|
-
typed(run, data) {
|
|
79
|
-
if (run.terminal === null)
|
|
80
|
-
run.typed.push(data);
|
|
81
|
-
else
|
|
82
|
-
run.terminal.write(data);
|
|
83
|
-
}
|
|
84
|
-
resized(run, size) {
|
|
85
|
-
run.size = size;
|
|
86
|
-
run.sized.resolve();
|
|
87
|
-
try {
|
|
88
|
-
run.terminal?.resize(size.cols, size.rows);
|
|
89
|
-
}
|
|
90
|
-
catch { }
|
|
91
|
-
}
|
|
92
|
-
end(run, result) {
|
|
93
|
-
if (run.ended !== null)
|
|
94
|
-
return;
|
|
95
|
-
run.ended = result;
|
|
96
|
-
run.sized.resolve();
|
|
97
|
-
if (run.terminal !== null)
|
|
98
|
-
killTree(run.terminal);
|
|
99
|
-
}
|
|
100
|
-
}
|