@sleep2agi/agent-network 2.3.0-preview.123 → 2.3.0-preview.125

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.
@@ -1,7 +1,7 @@
1
- export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.123";
1
+ export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.125";
2
2
  export declare const PAIRED_AGENT_NODE_VERSION = "2.5.0-preview.96";
3
3
  export declare const PAIRED_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.96";
4
- export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.123";
4
+ export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.125";
5
5
  export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.96";
6
6
  export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.96";
7
7
  export type PairedAgentNodeResolution = {
@@ -6,3 +6,30 @@ export type ProcRow = {
6
6
  export declare function ownedConnectionFromSnapshot(rootPid: number, beforeStart: string | null, afterStart: string | null, rows: ProcRow[], socketOwners: ReadonlyMap<number, ReadonlySet<string>>, establishedInodes: ReadonlySet<string>, unread?: boolean): boolean;
7
7
  /** Fail-closed attribution of an exact loopback connection to a managed POSIX TUI tree. */
8
8
  export declare function probePosixOwnedLoopbackConnection(rootPid: number, port: number, platform?: NodeJS.Platform): boolean;
9
+ /**
10
+ * #2255 (2026-10-02) —— 一次探不到 ≠ 没连上。`anet node start` 等到 TUI 画出 banner(「OpenAI Codex」)就只探一次:
11
+ * 实测真 codex 0.155.1 先画 banner(~170 ms)、后建 ws(~221 ms),假 TUI 同样先打印后连接。空闲机器上 400 ms 的
12
+ * 「等画出来」恰好把这几十毫秒盖住;CI runner / 忙的机器上盖不住,启动就以「managed TUI tree has no attributable
13
+ * connection」失败 —— 会话其实好好的。Windows 那条路径一直是轮询(TUI_HEALTH_MS 内反复探),这里对齐。
14
+ *
15
+ * 每 intervalMs 探一次,直到:探到(connected)/ TUI 退了(tui-exited,不再白等)/ 到点(deadline)。
16
+ * 判据本身不变:仍是 probePosixOwnedLoopbackConnection 的 fail-closed 归属,只是不再只给一次机会。
17
+ */
18
+ /** 与 Windows 路径的 TUI_HEALTH_MS 同一个预算(cli.ts):TUI 活着却 25 s 都没连上,才判失败。 */
19
+ export declare const POSIX_TUI_ATTRIBUTION_MS = 25000;
20
+ export type PosixAttributionResult = {
21
+ outcome: "connected" | "tui-exited" | "deadline";
22
+ probes: number;
23
+ waitedMs: number;
24
+ };
25
+ export declare function waitForPosixOwnedLoopbackConnection(opts: {
26
+ rootPid: number;
27
+ port: number;
28
+ deadlineMs: number;
29
+ intervalMs?: number;
30
+ /** TUI 还在不在(pid 还活着、而且还是同一个进程)。不在就别等了。 */
31
+ alive: () => boolean;
32
+ probe?: (rootPid: number, port: number) => boolean;
33
+ sleep?: (ms: number) => Promise<void>;
34
+ now?: () => number;
35
+ }): Promise<PosixAttributionResult>;
@@ -0,0 +1,44 @@
1
+ import { type ChildProcess, type ExecFileSyncOptions, type ExecFileSyncOptionsWithBufferEncoding, type ExecFileSyncOptionsWithStringEncoding, type SpawnOptions, type SpawnSyncOptions, type SpawnSyncReturns } from "node:child_process";
2
+ export type TmuxEnv = Record<string, string | undefined>;
3
+ export interface TmuxIsolation {
4
+ /** Socket path passed to tmux as `-S`. */
5
+ socket: string;
6
+ /** Which variable asked for isolation. */
7
+ source: "ANET_TMUX_SOCKET" | "TMUX_TMPDIR";
8
+ }
9
+ export declare class TmuxKillServerRefused extends Error {
10
+ constructor(args: readonly string[]);
11
+ }
12
+ /**
13
+ * Where tmux should talk to, or null for "today's default behaviour".
14
+ * `TMUX_TMPDIR` resolves the same way tmux itself does: `$TMUX_TMPDIR/tmux-<uid>/default`.
15
+ */
16
+ export declare function resolveTmuxIsolation(env?: TmuxEnv, uid?: number): TmuxIsolation | null;
17
+ /** The socket path inside `$TMUX` (`<socket>,<server pid>,<session idx>`), or null. */
18
+ export declare function socketOfTmuxVar(value: string | undefined): string | null;
19
+ /**
20
+ * True when argv asks tmux to kill its server, including `a ; kill-server`
21
+ * chains and the unambiguous prefixes tmux accepts (`kill-ser`, `kill-serv`, …).
22
+ */
23
+ export declare function isKillServer(args: readonly string[]): boolean;
24
+ export interface TmuxInvocation {
25
+ file: "tmux";
26
+ args: string[];
27
+ /** undefined ⇒ inherit the caller's env exactly as before (no isolation requested). */
28
+ env: TmuxEnv | undefined;
29
+ isolation: TmuxIsolation | null;
30
+ }
31
+ /**
32
+ * Pure argv/env builder. Throws TmuxKillServerRefused for kill-server.
33
+ * `env` is the env the child would otherwise get (the caller's `options.env`,
34
+ * else process.env); isolation is decided from it.
35
+ */
36
+ export declare function buildTmuxInvocation(args: readonly string[], env?: TmuxEnv, uid?: number): TmuxInvocation;
37
+ /** `execFileSync("tmux", args, options)` through the #505 rules. */
38
+ export declare function execTmux(args: readonly string[], options: ExecFileSyncOptionsWithStringEncoding): string;
39
+ export declare function execTmux(args: readonly string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
40
+ export declare function execTmux(args: readonly string[], options?: ExecFileSyncOptions): string | Buffer;
41
+ /** `spawnSync("tmux", args, options)` through the #505 rules. */
42
+ export declare function spawnSyncTmux(args: readonly string[], options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
43
+ /** `spawn("tmux", args, options)` through the #505 rules. */
44
+ export declare function spawnTmux(args: readonly string[], options?: SpawnOptions): ChildProcess;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.3.0-preview.123",
3
+ "version": "2.3.0-preview.125",
4
4
  "description": "AI Agent Network CLI — Local-first multi-agent orchestration across 6 runtimes (Claude Code CLI / Claude Agent SDK / Codex SDK / Codex app-server / Grok Build ACP / OpenCode CLI) and 8+ LLM providers. Apache 2.0.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",
@@ -75,7 +75,7 @@
75
75
  "puppeteer-core": "^24.10.2"
76
76
  },
77
77
  "devDependencies": {
78
- "@modelcontextprotocol/sdk": "^1.12.0",
78
+ "@modelcontextprotocol/sdk": "1.32.0",
79
79
  "@types/markdown-it": "^14.1.2",
80
80
  "@types/node": "^25.0.0",
81
81
  "javascript-obfuscator": "^5.4.1",