@agentshouse/kit 0.2.1-alpha.7 → 0.2.1-alpha.8

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
@@ -7,7 +7,15 @@ through the agent CLIs you chose and gives each Agent the `house` command.
7
7
  ## Install
8
8
 
9
9
  Connect a computer from agents.house. It gives you the one command that
10
- installs House Kit on that computer and updates it when you run it again.
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.
15
+
16
+ On your own Ubuntu 26.04 server, run the Linux command with `--linux` to
17
+ install House Kit natively, with its workspace at `/agents/house`; `kit` and
18
+ `house` are then on the server's `PATH`.
11
19
 
12
20
  ## Commands
13
21
 
@@ -19,7 +27,8 @@ and `--environment <id>` to reconnect an Environment you already have.
19
27
  `kit resident` keeps the Environment connected, and keeps the Rooms you chose
20
28
  for this Environment as Git repositories under `/agents/house/working-copies`.
21
29
  Commit in one and run `house git push --owner` there to send the commit to
22
- House; inside an Agent conversation the Agent runs `house git push`.
30
+ House; on a computer, run it through the install command from the copy's
31
+ directory. Inside an Agent conversation the Agent runs `house git push`.
23
32
 
24
33
  ## License
25
34
 
@@ -0,0 +1,22 @@
1
+ import { setGlobalProxyFromEnv } from 'node:http';
2
+ import { HouseRefusal, post } from './api.js';
3
+ import { readEnrolment } from './home.js';
4
+ function unanswered(error) {
5
+ return error instanceof HouseRefusal ? error.status >= 500 : error instanceof TypeError && error.message === 'fetch failed';
6
+ }
7
+ setGlobalProxyFromEnv();
8
+ try {
9
+ const { house, credential } = (await readEnrolment());
10
+ try {
11
+ await post(house, '/kit/agents/desired', {}, credential);
12
+ }
13
+ catch (error) {
14
+ if (!unanswered(error))
15
+ throw error;
16
+ process.stderr.write(`kit: House did not answer, so the stored credential stands: ${error.message}\n`);
17
+ }
18
+ }
19
+ catch (error) {
20
+ process.stderr.write(`kit: ${error.message}\n`);
21
+ process.exitCode = 1;
22
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "version": "0.2.1-alpha.8",
4
+ "hosts": {
5
+ "linux": {
6
+ "command": "bash <(curl -fsSL https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.8/connect-linux.sh)",
7
+ "asset": {
8
+ "name": "connect-linux.sh",
9
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.8/connect-linux.sh"
10
+ },
11
+ "workspace": {
12
+ "argument": "--workspace",
13
+ "quoting": "posix"
14
+ }
15
+ },
16
+ "windows": {
17
+ "command": "& ([scriptblock]::Create((irm https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.8/connect-windows.ps1)))",
18
+ "asset": {
19
+ "name": "connect-windows.ps1",
20
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-alpha.8/connect-windows.ps1"
21
+ },
22
+ "workspace": {
23
+ "argument": "--workspace",
24
+ "quoting": "powershell"
25
+ }
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,4 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { writeEnrolment } from './home.js';
3
+ const [house, environment] = process.argv.slice(2);
4
+ await writeEnrolment({ house: house, environment: environment, credential: readFileSync(0, 'utf8').trim() });
package/dist/login.js CHANGED
@@ -26,8 +26,9 @@ function listen() {
26
26
  server.close();
27
27
  server.closeAllConnections();
28
28
  };
29
+ const port = Number(process.env.HOUSE_KIT_LOGIN_PORT ?? 0);
29
30
  server.once('error', reject);
30
- server.listen(0, '127.0.0.1', () => {
31
+ server.listen(port, port === 0 ? '127.0.0.1' : '0.0.0.0', () => {
31
32
  const address = server.address();
32
33
  if (address === null || typeof address === 'string') {
33
34
  reject(new Error('the login callback has no port'));
@@ -49,8 +50,11 @@ function listen() {
49
50
  }
50
51
  async function typed(question) {
51
52
  const reader = createInterface({ input: process.stdin, output: process.stdout });
53
+ const closed = new Promise((_, reject) => {
54
+ reader.once('close', () => reject(new Error('no code was typed')));
55
+ });
52
56
  try {
53
- return (await reader.question(question)).trim();
57
+ return (await Promise.race([reader.question(question), closed])).trim();
54
58
  }
55
59
  finally {
56
60
  reader.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/kit",
3
- "version": "0.2.1-alpha.7",
3
+ "version": "0.2.1-alpha.8",
4
4
  "description": "House Kit connects an Environment to agents.house.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -12,11 +12,14 @@
12
12
  "kit": "dist/kit-main.js",
13
13
  "house": "dist/house-main.js"
14
14
  },
15
+ "exports": {
16
+ "./bootstrap": "./dist/bootstrap.json"
17
+ },
15
18
  "files": [
16
19
  "dist"
17
20
  ],
18
21
  "scripts": {
19
- "build": "tsc -p tsconfig.build.json",
22
+ "build": "tsc -p tsconfig.build.json && node scripts/bootstrap-manifest.mjs",
20
23
  "test": "tsc -p tsconfig.json && vitest run"
21
24
  },
22
25
  "dependencies": {