@sleep2agi/agent-network 2.3.0-preview.38 → 2.3.0-preview.39

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,4 +1,4 @@
1
- export type RuntimeName = "claude-code-cli" | "codex-sdk" | "claude-agent-sdk" | "grok-build-acp" | "opencode-cli" | "codex-app-server";
1
+ export type RuntimeName = "claude-code-cli" | "codex-sdk" | "claude-agent-sdk" | "grok-build-acp" | "grok-build-cli" | "opencode-cli" | "codex-app-server";
2
2
  /** Operator-facing default for a runtime slot that is empty or missing. */
3
3
  export declare const DEFAULT_RUNTIME: RuntimeName;
4
4
  export declare const SUPPORTED_RUNTIME_NAMES: readonly RuntimeName[];
@@ -1,6 +1,6 @@
1
1
  export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.34";
2
- export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.26";
3
- export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.26";
2
+ export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.28";
3
+ export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.28";
4
4
  export declare function opencodeExactPairInstallCommand(): string;
5
5
  /** Runtime capability advertised by agent-node's operator-facing help. */
6
6
  export declare function agentNodeHelpSupportsOpencode(help: string): boolean;
@@ -0,0 +1,2 @@
1
+ /** Load a reviewed owner-only env file without following a planted link. */
2
+ export declare function loadOwnerOnlyEnvFile(path: string | undefined, env?: NodeJS.ProcessEnv): void;
@@ -0,0 +1,23 @@
1
+ export interface PrimaryNetworkResponse {
2
+ ok?: boolean;
3
+ current_network?: unknown;
4
+ networks?: unknown;
5
+ }
6
+ export type PrimaryNetworkFetch = (input: string, init: {
7
+ headers: Record<string, string>;
8
+ }) => Promise<{
9
+ ok: boolean;
10
+ status: number;
11
+ json: () => Promise<PrimaryNetworkResponse>;
12
+ }>;
13
+ export declare class PrimaryNetworkResolutionError extends Error {
14
+ constructor(message: string, options?: ErrorOptions);
15
+ }
16
+ /**
17
+ * Resolve the authenticated user's active network from the server's explicit
18
+ * `/api/auth/me.current_network` field.
19
+ *
20
+ * Do not fall back to a network name or list position: both are presentation
21
+ * details, and guessing either can silently run a command in the wrong network.
22
+ */
23
+ export declare function resolvePrimaryNetwork(hub: string, headers: Record<string, string>, fetchImpl?: PrimaryNetworkFetch): Promise<string>;
@@ -0,0 +1,10 @@
1
+ export declare function ensurePrivateDirectory(path: string): void;
2
+ /**
3
+ * Write secret-bearing state without ever publishing an umask-derived file.
4
+ * The 0600 temporary file is complete and fsynced before the atomic rename,
5
+ * so replacing a legacy 0644/0664 target also repairs it with no chmod gap.
6
+ */
7
+ export declare function atomicWritePrivateFile(path: string, body: string): void;
8
+ export declare function atomicWritePrivateJson(path: string, value: unknown): void;
9
+ /** Repair a legacy umask-derived private file before reading its secret. */
10
+ export declare function repairPrivateFilePermissions(path: string): void;
@@ -0,0 +1,3 @@
1
+ export declare function formatSecretAssignment(platform: string, name: string, value: string): string;
2
+ export declare function secretPersistenceHeading(platform: string): string;
3
+ export declare function secretShellAction(platform: string): "set" | "export";
@@ -0,0 +1,33 @@
1
+ export type TaskTraceTransport = "mcp_http" | "sdk_mcp_proxy" | "channel_mcp_proxy";
2
+ export type TaskTraceStatus = "sending" | "delivered" | "failed" | "acked" | "started" | "replied" | "expired";
3
+ export interface TaskTraceEvent {
4
+ event: string;
5
+ from_alias: string;
6
+ to_alias: string;
7
+ task_id: string | null;
8
+ parent_task_id: string | null;
9
+ network_id: string | null;
10
+ transport: TaskTraceTransport;
11
+ status: TaskTraceStatus;
12
+ duration_ms: number;
13
+ lifecycle_tracking: "tracked" | "not_tracked";
14
+ error_code?: string;
15
+ error_message?: string;
16
+ }
17
+ export declare function safeTaskTraceError(value: unknown): string;
18
+ export declare function renderTaskTrace(event: TaskTraceEvent, json?: boolean): string;
19
+ export declare function taskTraceEvent(input: Omit<TaskTraceEvent, "event">): TaskTraceEvent;
20
+ export interface SendTaskTraceInput {
21
+ fromAlias: string;
22
+ toAlias: string;
23
+ parentTaskId: string | null;
24
+ networkId: string | null;
25
+ transport: TaskTraceTransport;
26
+ lifecycleTracking: "tracked" | "not_tracked";
27
+ }
28
+ export interface SendTaskTraceDependencies {
29
+ send: () => Promise<any>;
30
+ log: (line: string) => void;
31
+ now?: () => number;
32
+ }
33
+ export declare function sendTaskWithTrace(input: SendTaskTraceInput, dependencies: SendTaskTraceDependencies): Promise<any>;
@@ -0,0 +1,8 @@
1
+ export type TmuxSession = {
2
+ id: string;
3
+ name: string;
4
+ };
5
+ export declare function parseTmuxSessions(output: string): TmuxSession[];
6
+ /** Resolve by exact decoded session name, then attach by tmux's opaque ID.
7
+ * This avoids tmux target prefix matching and works for Unicode names. */
8
+ export declare function findExactTmuxSession(output: string, expectedName: string): TmuxSession | null;
@@ -0,0 +1,13 @@
1
+ export type TokenCreateNameResult = {
2
+ ok: true;
3
+ name: string;
4
+ } | {
5
+ ok: false;
6
+ error: string;
7
+ };
8
+ /** Parse only `anet token create` operands.
9
+ *
10
+ * The legacy positional form stays supported, while flag parsing is strict so
11
+ * a typo cannot become the name of a newly issued credential.
12
+ */
13
+ export declare function parseTokenCreateName(argv: readonly string[]): TokenCreateNameResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.3.0-preview.38",
3
+ "version": "2.3.0-preview.39",
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",
@@ -20,7 +20,7 @@
20
20
  "scripts": {
21
21
  "typecheck": "tsc --noEmit",
22
22
  "test:feishu-bridge": "bun tests/feishu-bridge-ackplaceholder.test.ts",
23
- "build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build bin/cli.ts --outdir dist/bin --target node --minify --external @sleep2agi/commhub-server --external bun:sqlite --external '../../server/*' && bun build src/node-server.ts --outdir dist/src --target node --minify --external @modelcontextprotocol/sdk && bun build src/im/feishu/worker.ts --outdir dist/src/im/feishu --target node --minify --external @larksuiteoapi/node-sdk && tsc --emitDeclarationOnly --declaration --outDir dist && npx javascript-obfuscator dist/bin/cli.js --output dist/bin/cli.js --compact true --string-array true --string-array-encoding base64 && npx javascript-obfuscator dist/src/client.js --output dist/src/client.js --compact true --string-array true && npx javascript-obfuscator dist/src/node-server.js --output dist/src/node-server.js --compact true --string-array true",
23
+ "build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build bin/cli.ts --outdir dist/bin --target node --minify --external @sleep2agi/commhub-server --external bun:sqlite --external '../../server/*' && bun build src/node-server.ts --outdir dist/src --target node --minify && bun build src/im/feishu/worker.ts --outdir dist/src/im/feishu --target node --minify --external @larksuiteoapi/node-sdk && tsc --emitDeclarationOnly --declaration --outDir dist && npx javascript-obfuscator dist/bin/cli.js --output dist/bin/cli.js --compact true --string-array true --string-array-encoding base64 && npx javascript-obfuscator dist/src/client.js --output dist/src/client.js --compact true --string-array true && npx javascript-obfuscator dist/src/node-server.js --output dist/src/node-server.js --compact true --string-array true",
24
24
  "prepublishOnly": "npm run build"
25
25
  },
26
26
  "keywords": [