@agentshouse/kit 0.2.1-alpha.12 → 0.2.1-alpha.13

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 CHANGED
@@ -8,10 +8,15 @@ through the agent CLIs you chose and gives each Agent the `house` command.
8
8
 
9
9
  Connect a computer from agents.house. It gives you the one command that
10
10
  installs House Kit on that computer and updates it when you run it again. On
11
- Linux, macOS and Windows 11 it runs House Kit in one Docker container with
12
- your workspace, `~/AgentsHouse` unless you pass `--workspace <path>`, mounted
13
- at `/agents/house`. Append a `kit` or `house` command to the same command to
14
- run it in that container.
11
+ macOS and Linux it installs House Kit natively under your own account, without
12
+ an admin password, as a service that runs while you are logged in. `kit` and
13
+ `house` are then on your login shell's `PATH`, and your workspace is
14
+ `~/AgentsHouse` unless you pass `--workspace <path>`.
15
+
16
+ Add `--container` to run House Kit in one Docker container instead, with your
17
+ workspace mounted at `/agents/house`; your Agents then reach only that
18
+ workspace. On Windows 11 the container is the one choice. Append a `kit` or
19
+ `house` command to the container's command to run it in that container.
15
20
 
16
21
  On your own Ubuntu 26.04 server, run the Linux command with `--linux` to
17
22
  install House Kit natively, with its workspace at `/agents/house`; `kit` and
@@ -29,10 +34,10 @@ set. Pass `--manual` to paste the code by hand on a machine without a browser,
29
34
  and `--environment <id>` to reconnect an Environment you already have.
30
35
 
31
36
  `kit resident` keeps the Environment connected, and keeps the Rooms you chose
32
- for this Environment as Git repositories under `/agents/house/working-copies`.
33
- Commit in one and run `house git push --owner` there to send the commit to
34
- House; on a computer, run it through the install command from the copy's
35
- directory. Inside an Agent conversation the Agent runs `house git push`.
37
+ for this Environment as Git repositories under `working-copies` in the
38
+ workspace. Commit in one and run `house git push --owner` there to send the
39
+ commit to House; in the container, run it through the install command from the
40
+ copy's directory. Inside an Agent conversation the Agent runs `house git push`.
36
41
 
37
42
  ## License
38
43
 
package/dist/acp.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ndJsonStream, PROTOCOL_VERSION, } from '@agentclientprotocol/sdk';
2
- import { spawn } from 'node:child_process';
2
+ import { execFileSync, spawn } from 'node:child_process';
3
3
  import { readdirSync, readFileSync } from 'node:fs';
4
4
  import { Readable, Writable } from 'node:stream';
5
5
  import { CLIS, KIT_VERSION, cliCommand, withoutProxy } from './clis.js';
@@ -60,15 +60,29 @@ export async function startAdapter(kind, cwd, app, jobs = () => undefined, added
60
60
  throw error;
61
61
  }
62
62
  }
63
+ const LISTING_BYTES = 1 << 28;
64
+ function listed(options) {
65
+ return execFileSync('ps', [options, '-o', 'pid=,ppid=,command='], { encoding: 'utf8', maxBuffer: LISTING_BYTES })
66
+ .split('\n')
67
+ .flatMap((line) => {
68
+ const fields = /^\s*(\d+)\s+(\d+)\s?(.*)$/.exec(line);
69
+ return fields === null ? [] : [[Number(fields[1]), Number(fields[2]), fields[3]]];
70
+ });
71
+ }
63
72
  function parents() {
64
73
  const children = new Map();
74
+ const adopt = (pid, parent) => children.set(parent, [...(children.get(parent) ?? []), pid]);
75
+ if (process.platform === 'darwin') {
76
+ for (const [pid, parent] of listed('-Aww'))
77
+ adopt(pid, parent);
78
+ return children;
79
+ }
65
80
  for (const entry of readdirSync('/proc')) {
66
81
  if (!/^\d+$/.test(entry))
67
82
  continue;
68
83
  try {
69
84
  const stat = readFileSync(`/proc/${entry}/stat`, 'utf8');
70
- const parent = Number(stat.slice(stat.lastIndexOf(')') + 2).split(' ')[1]);
71
- children.set(parent, [...(children.get(parent) ?? []), Number(entry)]);
85
+ adopt(Number(entry), Number(stat.slice(stat.lastIndexOf(')') + 2).split(' ')[1]));
72
86
  }
73
87
  catch { }
74
88
  }
@@ -96,6 +110,11 @@ function killAll(pids) {
96
110
  }
97
111
  }
98
112
  function marked(marker) {
113
+ if (process.platform === 'darwin') {
114
+ return listed('-AEww')
115
+ .filter(([, , command]) => ` ${command} `.includes(` ${marker} `))
116
+ .map(([pid]) => pid);
117
+ }
99
118
  return readdirSync('/proc')
100
119
  .filter((entry) => {
101
120
  try {
package/dist/agents.js CHANGED
@@ -2,7 +2,7 @@ import { client } from '@agentclientprotocol/sdk';
2
2
  import { readFile } from 'node:fs/promises';
3
3
  import { killTree, startAdapter } from './acp.js';
4
4
  import { CLIS, KIT_VERSION, cliCommand, install, run } from './clis.js';
5
- import { kitHome } from './home.js';
5
+ import { agentBase, kitHome } from './home.js';
6
6
  const SIGNED_OUT = { signed_in: false, models: [] };
7
7
  function select(options, category) {
8
8
  const option = options.find((candidate) => candidate.category === category);
@@ -66,6 +66,8 @@ async function sshHostKey() {
66
66
  return listed.status === 0 ? (/^\d+ (SHA256:\S+)/.exec(listed.output)?.[1] ?? null) : null;
67
67
  }
68
68
  async function operatingSystem() {
69
+ if (process.platform === 'darwin')
70
+ return `macOS ${(await run('sw_vers', ['-productVersion'], 10_000)).output.trim()}`;
69
71
  const release = await readFile('/etc/os-release', 'utf8');
70
72
  return /^PRETTY_NAME="?([^"\n]*)"?$/m.exec(release)?.[1] ?? release;
71
73
  }
@@ -124,6 +126,7 @@ export class Agents {
124
126
  const body = {
125
127
  os: await operatingSystem(),
126
128
  kit_version: KIT_VERSION,
129
+ agent_base: agentBase(),
127
130
  agents,
128
131
  ...(hostKey === null ? {} : { ssh_host_key: hostKey }),
129
132
  };
@@ -1,23 +1,26 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "0.2.1-alpha.12",
3
+ "version": "0.2.1-alpha.13",
4
4
  "hosts": {
5
5
  "linux": {
6
- "command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.12/connect-linux.sh)",
6
+ "command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.13/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.12/connect-linux.sh"
9
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.13/connect-linux.sh"
10
10
  },
11
11
  "workspace": {
12
12
  "argument": "--workspace",
13
13
  "quoting": "posix"
14
+ },
15
+ "container": {
16
+ "argument": "--container"
14
17
  }
15
18
  },
16
19
  "windows": {
17
- "command": "& ([scriptblock]::Create((irm https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.12/connect-windows.ps1)))",
20
+ "command": "& ([scriptblock]::Create((irm https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.13/connect-windows.ps1)))",
18
21
  "asset": {
19
22
  "name": "connect-windows.ps1",
20
- "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.12/connect-windows.ps1"
23
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.13/connect-windows.ps1"
21
24
  },
22
25
  "workspace": {
23
26
  "argument": "--workspace",
@@ -7,10 +7,10 @@ import { blocksOf, firstChange } from './blocks.js';
7
7
  import { openBridge } from './bridge.js';
8
8
  import { CLIS } from './clis.js';
9
9
  import { placeFiles } from './files.js';
10
+ import { agentBase } from './home.js';
10
11
  import { instructions } from './instructions.js';
11
12
  import { holdSecretInput } from './secret-input.js';
12
13
  import { createHowWeWork } from './skills.js';
13
- const LAUNCH_BASE = '/agents/house';
14
14
  const KILLED = 'the conversation was killed';
15
15
  function causeOf(error) {
16
16
  return error instanceof Error ? error.message : String(error);
@@ -241,7 +241,7 @@ export class Conversations {
241
241
  const route = this.kit.agents.route(agentId);
242
242
  if (route === undefined)
243
243
  throw new Error(`this Environment hosts no Agent ${agentId}`);
244
- if (route.working_directory === join(LAUNCH_BASE, route.agent_id)) {
244
+ if (route.working_directory === join(agentBase(), route.agent_id)) {
245
245
  await mkdir(route.working_directory, { recursive: true });
246
246
  }
247
247
  return route;
package/dist/copies.js CHANGED
@@ -3,7 +3,7 @@ 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, WORKING_COPIES, } from './git.js';
6
+ import { blobId, blobText, git, HOUSE_REF, importCommits, revision, run, succeeded, tree, workingCopies, } from './git.js';
7
7
  import { kitHome } from './home.js';
8
8
  import { operationId } from './operation.js';
9
9
  import { refusalOf } from './refusals.js';
@@ -369,7 +369,7 @@ export class WorkingCopies {
369
369
  logged(`House serves nothing of ${rootOf({ private: scope.private, room_handle: scope.handle })} to copy`);
370
370
  return;
371
371
  }
372
- const repository = scope.private ? join(WORKING_COPIES, 'private') : join(WORKING_COPIES, 'rooms', read.anchor);
372
+ const repository = scope.private ? join(workingCopies(), 'private') : join(workingCopies(), 'rooms', read.anchor);
373
373
  if (await exists(repository)) {
374
374
  logged(`${repository} already exists and House Kit leaves it as it is`);
375
375
  return;
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 { WORKING_COPIES } from './git.js';
7
+ import { workingCopies } 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(`${WORKING_COPIES}/`)) {
128
+ if (common === undefined || worktree === undefined || !dirname(common).startsWith(`${workingCopies()}/`)) {
129
129
  return delegated(git, args);
130
130
  }
131
131
  const listing = [...globals, '-C', worktree, 'ls-files', '--stage', '-z'];
package/dist/git.js CHANGED
@@ -1,7 +1,11 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import { createHash } from 'node:crypto';
3
+ import { join } from 'node:path';
3
4
  import { withoutProxy } from './clis.js';
4
- export const WORKING_COPIES = '/agents/house/working-copies';
5
+ import { agentBase } from './home.js';
6
+ export function workingCopies() {
7
+ return join(agentBase(), 'working-copies');
8
+ }
5
9
  export const HOUSE_REF = 'refs/house/received';
6
10
  const COMMITTER = 'House Kit <house-kit@localhost>';
7
11
  export function run(cwd, args, input, env = {}) {
package/dist/home.js CHANGED
@@ -6,6 +6,9 @@ const CONFIGURATION = 'kit.json';
6
6
  export function kitHome() {
7
7
  return process.env.HOUSE_KIT_HOME ?? join(homedir(), '.house-kit');
8
8
  }
9
+ export function agentBase() {
10
+ return process.env.HOUSE_KIT_WORKSPACE ?? '/agents/house';
11
+ }
9
12
  export async function readHome(name) {
10
13
  try {
11
14
  return JSON.parse(await readFile(join(kitHome(), name), 'utf8'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/kit",
3
- "version": "0.2.1-alpha.12",
3
+ "version": "0.2.1-alpha.13",
4
4
  "description": "House Kit connects an Environment to agents.house.",
5
5
  "license": "MIT",
6
6
  "repository": {