@agentshouse/kit 0.2.1-c8179f06883b6 → 0.2.1-c87bb54c0a0ce

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
@@ -42,7 +42,7 @@ that connection on Connections. `house help` lists the Tools. Codex sessions sta
42
42
  login run a lone `house` command outside their sandbox. `kit logout` disconnects this
43
43
  computer, stops House Kit and ends your own agent's connection, so `house` and `git` no
44
44
  longer act as you here; a later `kit login` reconnects the same Environment.
45
- `kit codex --key <key>` starts Codex with `house` acting as you through a key made on Connections; next time, just `kit codex`.
45
+ In a container you do not control, such as ChatGPT's, `npm i -g @agentshouse/kit` and `kit chatgpt --key <key>` with a key made on Connections let `house <tool>` act as you, starting and configuring nothing else.
46
46
 
47
47
  `kit resident` keeps the Environment connected and, as it connects, copies each
48
48
  Room you chose for it as a Git repository in the workspace's `local-copies`.
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "version": "0.2.1-c8179f06883b6",
3
+ "version": "0.2.1-c87bb54c0a0ce",
4
4
  "hosts": {
5
5
  "macos": {
6
6
  "asset": {
7
7
  "name": "connect-linux.sh",
8
- "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-c8179f06883b6/connect-linux.sh"
8
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-c87bb54c0a0ce/connect-linux.sh"
9
9
  }
10
10
  },
11
11
  "linux": {
12
12
  "asset": {
13
13
  "name": "connect-linux.sh",
14
- "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-c8179f06883b6/connect-linux.sh"
14
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-c87bb54c0a0ce/connect-linux.sh"
15
15
  }
16
16
  },
17
17
  "windows": {
18
18
  "asset": {
19
19
  "name": "connect-windows.ps1",
20
- "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-c8179f06883b6/connect-windows.ps1"
20
+ "url": "https://github.com/agentshouse/kit/releases/download/v0.2.1-c87bb54c0a0ce/connect-windows.ps1"
21
21
  }
22
22
  }
23
23
  }
@@ -0,0 +1,25 @@
1
+ import { parseArgs } from 'node:util';
2
+ import { kitHome, readOwnAgent, writeOwnAgent } from './home.js';
3
+ import { accepted, DEFAULT_HOUSE } from './login.js';
4
+ const KEY_SOURCE = 'New key for a script on Connections';
5
+ const USAGE = `usage: kit chatgpt --key <key> [--house <origin>]
6
+ --key <key> a key from ${KEY_SOURCE}
7
+ --house <origin> the House of the key, ${DEFAULT_HOUSE} unless one is stored
8
+ `;
9
+ export async function chatgpt(argv) {
10
+ const { values } = parseArgs({
11
+ args: argv,
12
+ options: { key: { type: 'string' }, house: { type: 'string' }, help: { type: 'boolean', default: false } },
13
+ });
14
+ if (values.help) {
15
+ process.stdout.write(USAGE);
16
+ return;
17
+ }
18
+ if (values.key === undefined)
19
+ throw new Error(`pass --key with a key from ${KEY_SOURCE}`);
20
+ const house = values.house ?? (await readOwnAgent())?.house ?? DEFAULT_HOUSE;
21
+ if (!(await accepted(house, values.key)))
22
+ throw new Error(`${house} does not accept this key; pass one from ${KEY_SOURCE}`);
23
+ await writeOwnAgent({ house, credential: values.key });
24
+ process.stdout.write(`house now calls ${house} as you, with the key kept in ${kitHome()}.\n`);
25
+ }
package/dist/clis.js CHANGED
@@ -17,7 +17,7 @@ const RAW_SUBTYPES = [
17
17
  'hook_started',
18
18
  'hook_response',
19
19
  ];
20
- export async function executable(path) {
20
+ async function executable(path) {
21
21
  try {
22
22
  await access(path, constants.X_OK);
23
23
  return true;
package/dist/kit-main.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import { setGlobalProxyFromEnv } from 'node:http';
3
3
  import { parseArgs } from 'node:util';
4
4
  import { answerGitCredential } from './app-git.js';
5
- import { codex } from './codex.js';
5
+ import { chatgpt } from './chatgpt.js';
6
6
  import { login } from './login.js';
7
7
  import { logout } from './logout.js';
8
8
  import { resident } from './resident.js';
9
- const USAGE = 'usage: kit <login|logout|resident|codex>\n';
9
+ const USAGE = 'usage: kit <login|logout|resident|chatgpt>\n';
10
10
  const COMMANDS = new Map([
11
11
  [
12
12
  'logout',
@@ -41,8 +41,8 @@ setGlobalProxyFromEnv();
41
41
  async function run() {
42
42
  if (command === 'login')
43
43
  return login(argv);
44
- if (command === 'codex')
45
- return codex(argv);
44
+ if (command === 'chatgpt')
45
+ return chatgpt(argv);
46
46
  if (command === '--help') {
47
47
  parseArgs({ args: argv });
48
48
  process.stdout.write(USAGE);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/kit",
3
- "version": "0.2.1-c8179f06883b6",
3
+ "version": "0.2.1-c87bb54c0a0ce",
4
4
  "description": "House Kit connects an Environment to agents.house.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/dist/codex.js DELETED
@@ -1,61 +0,0 @@
1
- import { homedir } from 'node:os';
2
- import { delimiter, join, resolve } from 'node:path';
3
- import { parseArgs } from 'node:util';
4
- import { CLIS, executable, writeCodexRule } from './clis.js';
5
- import { kitHome, readOwnAgent, writeOwnAgent } from './home.js';
6
- import { accepted, DEFAULT_HOUSE } from './login.js';
7
- const USAGE = `usage: kit codex [--key <key>] [--house <origin>] [<codex argument>...]
8
- --key <key> a key from New key for a script on Connections, kept for later runs
9
- --house <origin> the House of the key, ${DEFAULT_HOUSE} unless one is stored
10
- `;
11
- const VALUED = ['--key', '--house'];
12
- const KEY_SOURCE = 'New key for a script on Connections';
13
- function codexArgumentsStart(argv) {
14
- let index = 0;
15
- while (index < argv.length) {
16
- const arg = argv[index];
17
- if (VALUED.includes(arg))
18
- index += 2;
19
- else if (arg === '--help' || VALUED.some((option) => arg.startsWith(`${option}=`)))
20
- index += 1;
21
- else
22
- break;
23
- }
24
- return index;
25
- }
26
- async function onPath(name) {
27
- for (const directory of (process.env.PATH ?? '').split(delimiter)) {
28
- const path = resolve(directory, name);
29
- if (await executable(path))
30
- return path;
31
- }
32
- throw new Error(`${name} is not on your PATH; install it with ${CLIS['codex-acp'].install}`);
33
- }
34
- export async function codex(argv) {
35
- const start = codexArgumentsStart(argv);
36
- const { values } = parseArgs({
37
- args: argv.slice(0, start),
38
- options: { key: { type: 'string' }, house: { type: 'string' }, help: { type: 'boolean', default: false } },
39
- });
40
- if (values.help) {
41
- process.stdout.write(USAGE);
42
- return;
43
- }
44
- process.env.HOUSE_KIT_HOME = resolve(process.env.HOUSE_KIT_HOME || join(homedir(), '.house-kit-outside'));
45
- const stored = await readOwnAgent();
46
- if (values.key !== undefined) {
47
- const house = values.house ?? stored?.house ?? DEFAULT_HOUSE;
48
- if (!(await accepted(house, values.key)))
49
- throw new Error(`${house} does not accept this key; pass one from ${KEY_SOURCE}`);
50
- await writeOwnAgent({ house, credential: values.key });
51
- }
52
- else if (values.house !== undefined) {
53
- throw new Error('--house names the House of a --key; pass the key with it');
54
- }
55
- else if (stored === null) {
56
- throw new Error(`${kitHome()} holds no House key; pass --key with one from ${KEY_SOURCE}`);
57
- }
58
- await writeCodexRule();
59
- const path = await onPath('codex');
60
- process.execve(path, [path, ...argv.slice(start)], process.env);
61
- }