@sleep2agi/agent-network 2.3.0-preview.163 → 2.3.0-preview.166

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,9 +1,9 @@
1
- export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.163";
2
- export declare const PAIRED_AGENT_NODE_VERSION = "2.5.0-preview.129";
3
- export declare const PAIRED_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.129";
4
- export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.163";
5
- export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.129";
6
- export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.129";
1
+ export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.166";
2
+ export declare const PAIRED_AGENT_NODE_VERSION = "2.5.0-preview.132";
3
+ export declare const PAIRED_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.132";
4
+ export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.166";
5
+ export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.132";
6
+ export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.132";
7
7
  export type PairedAgentNodeResolution = {
8
8
  spec: string;
9
9
  args: string[];
@@ -5,6 +5,7 @@ export type ProviderApplicationSelection = {
5
5
  auth_id: string;
6
6
  model: string;
7
7
  confirm_restart: true;
8
+ account_id?: string;
8
9
  };
9
10
  export declare function validProviderApplicationSelection(v: any): v is ProviderApplicationSelection;
10
11
  export declare function validProviderApplicationReceipt(v: any, requestId: string, revision: number, selection: ProviderApplicationSelection): boolean;
@@ -0,0 +1,9 @@
1
+ export type ProviderCollection = {
2
+ node_id: string;
3
+ alias: string;
4
+ node_revision: string;
5
+ provider_id: string;
6
+ auth_id: string;
7
+ label: string;
8
+ };
9
+ export declare function validProviderCollection(v: any): v is ProviderCollection;
@@ -0,0 +1,7 @@
1
+ export type ProviderInitialization = {
2
+ revision: number;
3
+ provider_id: string;
4
+ auth_id: string;
5
+ model: string;
6
+ };
7
+ export declare function validProviderInitialization(value: any): value is ProviderInitialization;
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Pure helpers for the standalone `anet` executable (`bun build --compile`).
3
+ *
4
+ * npm/node keeps today's behavior: these functions are identity transforms
5
+ * when `stamp.standalone` is false. The compiled binary sets the stamp at
6
+ * build time (`scripts/build-anet-bin.mjs`) and routes Hub / agent-node
7
+ * through internal argv (`__hub` / `__node`) because `process.execPath` is
8
+ * the `anet` binary itself, not bun or node.
9
+ */
10
+ import { STANDALONE_BUILD_STAMP, type StandaloneBuildStamp, type StandalonePackageVersions } from "./standalone-build-stamp";
11
+ export type { StandaloneBuildStamp, StandalonePackageVersions };
12
+ export { STANDALONE_BUILD_STAMP };
13
+ /** Internal argv. Not user-facing commands; the unified entry strips them. */
14
+ export declare const STANDALONE_HUB_ARG = "__hub";
15
+ export declare const STANDALONE_NODE_ARG = "__node";
16
+ export declare const STANDALONE_PRINT_CONFIG_TOKEN_ARG = "__print-config-token";
17
+ export type StandaloneDispatchKind = "cli" | "hub" | "node" | "print-config-token";
18
+ export interface StandaloneDispatch {
19
+ kind: StandaloneDispatchKind;
20
+ /** Args after the internal selector. CLI kind keeps the full user argv. */
21
+ argv: string[];
22
+ }
23
+ export interface DetectedPackageLike {
24
+ name: string;
25
+ displayName: string;
26
+ version: string | null;
27
+ state: "ok" | "unknown" | "not-installed";
28
+ source?: string;
29
+ }
30
+ /**
31
+ * True when `arg` is the script slot bun/node inserts at argv[1]
32
+ * (`bun bin/anet-bin.ts`, or a compiled binary's `/$bunfs/...` path).
33
+ * A user argument that merely ends in `.ts` is not a script slot.
34
+ */
35
+ export declare function isBundlerScriptSlot(arg: string): boolean;
36
+ /** User args, whether argv is Node-shaped (script at [1]) or a raw executable. */
37
+ export declare function standaloneUserArgs(argv: readonly string[]): string[];
38
+ export declare function dispatchStandalone(userArgs: readonly string[]): StandaloneDispatch;
39
+ /**
40
+ * `cli.ts`, `commhub.ts`, and `agent-node`'s CLI all read `process.argv.slice(2)`.
41
+ * Force that shape so the same entries work under bun, node, and `bun build --compile`
42
+ * (compiled argv may or may not keep a virtual script path at [1]).
43
+ */
44
+ export declare function nodeStyleArgv(execPath: string, userArgs: readonly string[]): string[];
45
+ export declare function isStandaloneBuild(stamp: StandaloneBuildStamp): boolean;
46
+ export declare function anetVersionFromStamp(stamp: StandaloneBuildStamp): string | null;
47
+ export declare function standaloneBundleVersion(stamp: StandaloneBuildStamp): string | null;
48
+ /** Bytes of the `anet --version` header. No bundle line unless the stamp has one. */
49
+ export declare function formatAnetVersionBanner(anetVersion: string, bundle: string | null): string;
50
+ export declare function standaloneNodeServerJs(stamp: StandaloneBuildStamp): string | null;
51
+ export declare function applyStandaloneDetectedVersions<T extends {
52
+ anet: {
53
+ version: string;
54
+ };
55
+ agentNode: DetectedPackageLike;
56
+ commhubServer: DetectedPackageLike;
57
+ bun?: DetectedPackageLike;
58
+ }>(versions: T, stamp: StandaloneBuildStamp): T;
59
+ export interface CliReinvokeInput {
60
+ standalone: boolean;
61
+ execArgv: readonly string[];
62
+ /** `process.argv[1]` for npm/node. Ignored when `standalone` is true. */
63
+ scriptPath: string;
64
+ cliArgs: readonly string[];
65
+ /** Match call sites that already forward `process.execArgv` (tsx loaders). */
66
+ includeExecArgv: boolean;
67
+ }
68
+ /**
69
+ * Argv after `process.execPath` when re-invoking this CLI.
70
+ * npm/node: `[script, ...cliArgs]` or `[...execArgv, script, ...cliArgs]`.
71
+ * standalone: just `cliArgs` — the binary is already `anet`.
72
+ */
73
+ export declare function cliReinvokeArgs(input: CliReinvokeInput): string[];
74
+ export declare function cliReinvokeShell(input: CliReinvokeInput & {
75
+ execPath: string;
76
+ quote: (value: string) => string;
77
+ }): string;
78
+ export interface StandaloneHubLaunchInput {
79
+ /** `--version` / `--hub-version` value, or null when the user did not pass one. */
80
+ explicitVersion: string | null;
81
+ port: string;
82
+ host: string;
83
+ devOpen: boolean;
84
+ }
85
+ export type StandaloneHubLaunch = {
86
+ ok: true;
87
+ version: string;
88
+ origin: string;
89
+ warnings: string[];
90
+ args: string[];
91
+ } | {
92
+ ok: false;
93
+ message: string;
94
+ };
95
+ /**
96
+ * Argv for the embedded Hub. The standalone binary cannot `bunx` a registry
97
+ * package; a requested version other than the embedded one is refused.
98
+ */
99
+ export declare function standaloneHubLaunch(stamp: StandaloneBuildStamp, input: StandaloneHubLaunchInput): StandaloneHubLaunch;
100
+ /** Argv after `process.execPath` when launching the embedded agent-node. */
101
+ export declare function standaloneNodeArgs(agentArgs: readonly string[]): string[];
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Build stamp for the standalone `anet` executable.
3
+ *
4
+ * The committed value is inactive. `scripts/build-anet-bin.mjs` rewrites this
5
+ * file only for the duration of `bun build --compile`, then restores it.
6
+ * npm/node runs of `bin/cli.ts` must keep seeing `standalone: false`.
7
+ *
8
+ * Versions are read from each package's package.json at binary-build time.
9
+ * Do not hard-code release versions here — those constants belong to the
10
+ * packages (and to the in-flight release that owns them).
11
+ */
12
+ export interface StandalonePackageVersions {
13
+ /** `@sleep2agi/agent-network` package.json version. */
14
+ anet: string;
15
+ /** `@sleep2agi/agent-node` package.json version. */
16
+ agentNode: string;
17
+ /** `@sleep2agi/commhub-server` package.json version. */
18
+ commhubServer: string;
19
+ /** Release label of this executable (`cli-bin-v<bundle>`). */
20
+ bundle: string;
21
+ }
22
+ export interface StandaloneBuildStamp {
23
+ standalone: boolean;
24
+ versions: StandalonePackageVersions | null;
25
+ /**
26
+ * Prebundled `.anet/node-server.js` payload (target node, version marker
27
+ * already stamped). Null outside the standalone binary. The compiled
28
+ * executable has no real package layout, so the CLI cannot find
29
+ * `node-server.js` via `import.meta.url`.
30
+ */
31
+ nodeServerJs: string | null;
32
+ }
33
+ export declare const STANDALONE_BUILD_STAMP: StandaloneBuildStamp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "2.3.0-preview.163",
3
+ "version": "2.3.0-preview.166",
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",