@koalaauto/agentchannel 3.45.2 → 3.46.0

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.
Files changed (42) hide show
  1. package/dist/src/adapters/codex.js +4 -0
  2. package/dist/src/args.d.ts +1 -1
  3. package/dist/src/args.js +16 -62
  4. package/dist/src/caps.d.ts +25 -2
  5. package/dist/src/caps.js +75 -11
  6. package/dist/src/cli-admin.d.ts +3 -0
  7. package/dist/src/cli-admin.js +307 -0
  8. package/dist/src/cli-memory.d.ts +3 -0
  9. package/dist/src/cli-memory.js +138 -0
  10. package/dist/src/cli-run.d.ts +28 -0
  11. package/dist/src/cli-run.js +429 -0
  12. package/dist/src/cli-shared.d.ts +73 -0
  13. package/dist/src/cli-shared.js +159 -0
  14. package/dist/src/cli.d.ts +9 -38
  15. package/dist/src/cli.js +64 -1181
  16. package/dist/src/client.d.ts +31 -22
  17. package/dist/src/client.js +16 -29
  18. package/dist/src/codexdaemon.d.ts +22 -0
  19. package/dist/src/codexdaemon.js +68 -0
  20. package/dist/src/invite_people.d.ts +31 -0
  21. package/dist/src/invite_people.js +238 -0
  22. package/dist/src/invite_person.d.ts +1 -1
  23. package/dist/src/invite_person.js +1 -1
  24. package/dist/src/mcp.d.ts +1 -1
  25. package/dist/src/mcp.js +14 -47
  26. package/dist/src/prompts.d.ts +2 -2
  27. package/dist/src/prompts.js +6 -17
  28. package/dist/src/runner/home.d.ts +45 -0
  29. package/dist/src/runner/home.js +150 -0
  30. package/dist/src/runner/runner.d.ts +3 -76
  31. package/dist/src/runner/runner.js +25 -327
  32. package/dist/src/runner/structured.d.ts +20 -0
  33. package/dist/src/runner/structured.js +64 -0
  34. package/dist/src/runner/traces.d.ts +29 -0
  35. package/dist/src/runner/traces.js +119 -0
  36. package/dist/src/sandboxcheck.d.ts +3 -0
  37. package/dist/src/sandboxcheck.js +16 -1
  38. package/dist/src/version.d.ts +1 -1
  39. package/dist/src/version.js +1 -1
  40. package/package.json +1 -1
  41. package/dist/src/import.d.ts +0 -244
  42. package/dist/src/import.js +0 -998
package/dist/src/cli.d.ts CHANGED
@@ -1,28 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import { type FetchLike } from './client.js';
3
2
  export { VERSION } from './version.js';
4
- export interface Io {
5
- env: NodeJS.ProcessEnv;
6
- /** Working directory for relative file arguments (default process.cwd()). */
7
- cwd?: string;
8
- out: (s: string) => void;
9
- err: (s: string) => void;
10
- /** stdout is a terminal (a person reading): reads print a summary instead of raw JSON. Agents and scripts get JSON as before. */
11
- tty?: boolean;
12
- fetch?: FetchLike;
13
- /** `ach open`: opens a URL in the browser (tests inject a fake). */
14
- openUrl?: (url: string) => Promise<void>;
15
- /** `ach doctor` status commands (tests inject a fake). */
16
- exec?: import('./doctor.js').ExecLike;
17
- /** Asks a yes/no question (`ach join`); undefined = no terminal to ask in. */
18
- ask?: (question: string) => Promise<string>;
19
- }
3
+ import { type Io } from './cli-shared.js';
4
+ export { AUTH_EXIT_CODE, AUTH_EXIT_MESSAGE, NO_KEY_MESSAGE, writeAchShim } from './cli-run.js';
5
+ export type { Io } from './cli-shared.js';
6
+ export { channelFile, loginTokenOf } from './cli-shared.js';
20
7
  /** Runs the opener and waits for it: a non-zero exit (no browser, no display) is a failure, not "opened". */
21
8
  export declare function runOpener(cmd: string, args: string[], spawn?: typeof import('node:child_process').spawn): Promise<void>;
22
- /** A login link may be pasted as the full URL or as the bare token. */
23
- export declare function loginTokenOf(s: string): string;
24
- /** The channel named in a .ach-channel file in `dir` or a parent directory (for `ach memory hook`). */
25
- export declare function channelFile(dir: string): string | undefined;
9
+ /**
10
+ * Commands a spawned agent (ACH_RUN_TOKEN set) may never run (S3): they would
11
+ * re-point the CLI (login), act as a human (admin), start nested runners or
12
+ * servers (run, mcp), or act outside the run's own task (send, handoff, cancel).
13
+ */
26
14
  export declare const RUN_TOKEN_FORBIDDEN: string[];
27
15
  /** Commands refused when the env looks like a spawned agent whose ACH_RUN_TOKEN was unset (advisory). */
28
16
  export declare const SPAWNED_FORBIDDEN: string[];
@@ -35,23 +23,6 @@ export declare function forbiddenUnderRunToken(cmd: string): boolean;
35
23
  */
36
24
  export declare function readArgFile(file: string, io: Pick<Io, 'env' | 'cwd'>): string;
37
25
  export declare function main(argv: string[], io?: Io): Promise<number>;
38
- /**
39
- * Write <home>/bin/ach, a shim that runs this exact CLI with this node, so spawned
40
- * agents always find a matching `ach` on PATH (even when the runner was started
41
- * with npx or `node dist/src/cli.js`). Returns the dir to prepend to PATH.
42
- */
43
- export declare function writeAchShim(home: string): string | undefined;
44
- /**
45
- * `ach run` where the agent's key is not stored: the key lives only on its own machine and the hub keeps a hash of it, so it
46
- * cannot be read back. The way back is a new key (the panel: the agent's page, Settings or the stopped-runner card) and its join line.
47
- */
48
- export declare const NO_KEY_MESSAGE: {
49
- readonly en: "ach run: there is no key for this agent on this machine (deleted, or a new machine or directory).\nA key cannot be recovered: in the panel open the agent and rotate its key (an admin or its owner can), then run the new `join` line here, in the agent's project directory.";
50
- readonly zh: "ach run:这台机器上没有这个智能体的密钥(被删除了,或是新机器、新目录)。\n密钥找不回,只能换新:在面板里打开这个智能体,点「换新密钥」(管理员或负责人可以),再到它的项目目录里运行新生成的 `join` 命令。";
51
- };
52
- /** B7: `ach run` exit code when the hub answers 401 (systemd: RestartPreventExitStatus=78). */
53
- export declare const AUTH_EXIT_CODE = 78;
54
- export declare const AUTH_EXIT_MESSAGE = "ach run: key rotated or agent deactivated \u2014 run ach join";
55
26
  /** A task as a person reads it: the header, the brief, the last few things said, the files. */
56
27
  export declare function taskSummary(b: any, files?: any[]): string;
57
28
  /** An inbox as a person reads it: each kind of thing with its count and one line per item. */