@sleep2agi/agent-network 2.3.0-preview.135 → 2.3.0-preview.137
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/dist/bin/cli.d.ts +1 -1
- package/dist/bin/cli.js +2 -2
- package/dist/src/client.js +1 -1
- package/dist/src/codex-adopt.d.ts +46 -0
- package/dist/src/codex-copresence-bridge-log.d.ts +44 -0
- package/dist/src/codex-copresence-login-gate.d.ts +16 -0
- package/dist/src/codex-lifecycle-receipt.d.ts +11 -2
- package/dist/src/codex-lifecycle-restart.d.ts +3 -1
- package/dist/src/codex-menu.d.ts +4 -1
- package/dist/src/codex-resume.d.ts +89 -0
- package/dist/src/node-server-version.d.ts +39 -0
- package/dist/src/node-server.js +8 -7
- package/dist/src/opencode-agent-node-pair.d.ts +6 -6
- package/dist/src/opencode-free-tier.d.ts +27 -0
- package/dist/src/opencode-generation-record.d.ts +24 -0
- package/dist/src/opencode-package-binary.d.ts +15 -0
- package/dist/src/opencode-pin.d.ts +19 -2
- package/dist/src/opencode-versions.d.ts +32 -0
- package/dist/src/unsafe-package-path-reason.d.ts +18 -4
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.
|
|
2
|
-
export declare const PAIRED_AGENT_NODE_VERSION = "2.5.0-preview.
|
|
3
|
-
export declare const PAIRED_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.
|
|
4
|
-
export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.
|
|
5
|
-
export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.
|
|
6
|
-
export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.
|
|
1
|
+
export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.137";
|
|
2
|
+
export declare const PAIRED_AGENT_NODE_VERSION = "2.5.0-preview.104";
|
|
3
|
+
export declare const PAIRED_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.104";
|
|
4
|
+
export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.137";
|
|
5
|
+
export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.104";
|
|
6
|
+
export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.104";
|
|
7
7
|
export type PairedAgentNodeResolution = {
|
|
8
8
|
spec: string;
|
|
9
9
|
args: string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #540 — OpenCode Zen's free tier rejects any request in which a tool is
|
|
3
|
+
* disabled or a permission is denied, answering
|
|
4
|
+
* "OpenCode's free tier can only be used from within OpenCode" (measured on
|
|
5
|
+
* opencode-ai 1.18.1 and 1.18.34 with `{"tools":{"bash":false}}`). Our default
|
|
6
|
+
* safe preset disables every built-in tool, so a free Zen model on a default
|
|
7
|
+
* node fails every task. `anet node create` must say so instead of promising
|
|
8
|
+
* that free models "can still start".
|
|
9
|
+
*
|
|
10
|
+
* The default preset itself is intentionally NOT changed here.
|
|
11
|
+
*/
|
|
12
|
+
/** OpenCode Zen free models are `opencode/<id>-free`. */
|
|
13
|
+
export declare function isOpencodeZenFreeModel(model: string | undefined | null): boolean;
|
|
14
|
+
/** Replaces the old "Keyless/free models can still start without a credential." */
|
|
15
|
+
export declare const OPENCODE_KEYLESS_FREE_MODEL_NOTE: string;
|
|
16
|
+
/** The exact command that sets flags.opencodeUnsafeTools=true in a node config. */
|
|
17
|
+
export declare function opencodeUnsafeToolsCommand(configFile: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Warning lines for a node whose model is a Zen free model while the safe
|
|
20
|
+
* preset is active. Empty when the combination is not the failing one.
|
|
21
|
+
*/
|
|
22
|
+
export declare function opencodeFreeTierSafePresetWarning(opts: {
|
|
23
|
+
nodeId: string;
|
|
24
|
+
model: string | undefined | null;
|
|
25
|
+
unsafeTools: boolean;
|
|
26
|
+
configFile: string;
|
|
27
|
+
}): string[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type OpencodeGeneration } from "./opencode-versions";
|
|
2
|
+
export declare const OPENCODE_GENERATION_FIELD = "opencodeGeneration";
|
|
3
|
+
/** Profile about to be serialised by saveProfile: add the generation when it
|
|
4
|
+
* is missing, otherwise return the very same object. */
|
|
5
|
+
export declare function stampOpencodeGeneration<T extends Record<string, any>>(profile: T, generation?: OpencodeGeneration): T;
|
|
6
|
+
/**
|
|
7
|
+
* Raw `config.json` text → the same text with `opencodeGeneration` appended,
|
|
8
|
+
* or null when nothing should be written:
|
|
9
|
+
* – the field is already present (whatever its value), or
|
|
10
|
+
* – the file is not valid JSON / not an object, or
|
|
11
|
+
* – the file is not in the canonical `JSON.stringify(_, null, 2) + "\n"`
|
|
12
|
+
* form saveProfile writes (hand-edited). Re-serialising such a file could
|
|
13
|
+
* touch bytes of other fields, and an absent field already means V1.
|
|
14
|
+
* In the canonical case the result differs from the input only by the one
|
|
15
|
+
* appended key, so every other field keeps its exact bytes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function recordOpencodeGenerationInConfigText(raw: string, generation?: OpencodeGeneration): string | null;
|
|
18
|
+
/** Start-time backfill for a node created before #542. IO is injected so the
|
|
19
|
+
* caller keeps its own symlink-safe private-file reader/writer. Never throws:
|
|
20
|
+
* the record is advisory and an absent field already reads as V1. */
|
|
21
|
+
export declare function backfillOpencodeGeneration(io: {
|
|
22
|
+
read: () => string | undefined;
|
|
23
|
+
write: (body: string) => void;
|
|
24
|
+
}): boolean;
|
|
@@ -24,3 +24,18 @@ export declare function validateOpencodePackageBinary(rawBinary: string, options
|
|
|
24
24
|
export declare const OPENCODE_VERIFIER_PLATFORMS: ReadonlySet<NodeJS.Platform>;
|
|
25
25
|
export declare function opencodeVerifierSupportsPlatform(platform?: NodeJS.Platform): boolean;
|
|
26
26
|
export declare function resolveOpencodePackageBinaryFromPath(searchPath: string, options: ValidateOpencodePackageBinaryOptions, platform?: NodeJS.Platform): string;
|
|
27
|
+
/**
|
|
28
|
+
* Board #541 — resolve the first trusted package entrypoint matching any of
|
|
29
|
+
* `acceptedVersions`, trying each version across the whole PATH in order (the
|
|
30
|
+
* release pin first), and report which exact version was admitted. Every
|
|
31
|
+
* candidate still goes through the full `validateOpencodePackageBinary`
|
|
32
|
+
* identity gate; only the accepted version set is wider. When nothing matches,
|
|
33
|
+
* the error from the first (release-pin) attempt is rethrown so diagnostics
|
|
34
|
+
* keep naming the pin the operator should install.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveAcceptedOpencodePackageBinaryFromPath(searchPath: string, options: Omit<ValidateOpencodePackageBinaryOptions, "expectedVersion"> & {
|
|
37
|
+
acceptedVersions: readonly string[];
|
|
38
|
+
}, platform?: NodeJS.Platform): {
|
|
39
|
+
binary: string;
|
|
40
|
+
version: string;
|
|
41
|
+
};
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Version this branch was validated against by the maintainers.
|
|
3
|
-
* Bumped when a new opencode-ai release passes the full Docker/E2E gate
|
|
3
|
+
* Bumped when a new opencode-ai release passes the full Docker/E2E gate —
|
|
4
|
+
* in the shared supported-versions table (`opencode-versions.ts`, #542),
|
|
5
|
+
* which agent-node's package gate reads from its byte-identical copy.
|
|
4
6
|
*/
|
|
5
|
-
export declare const OPENCODE_BUILTIN_PIN = "1.18.
|
|
7
|
+
export declare const OPENCODE_BUILTIN_PIN = "1.18.34";
|
|
8
|
+
/**
|
|
9
|
+
* Earlier release pins that remain accepted for one transition window so a
|
|
10
|
+
* host still holding the previous exact install keeps starting after an anet
|
|
11
|
+
* upgrade (board #541). Each entry passed the full Docker/E2E gate when it was
|
|
12
|
+
* the pin; start prints `opencodeLegacyPinNote()` so the operator upgrades.
|
|
13
|
+
* Derived from the shared supported-versions table (#542: v1 accepted
|
|
14
|
+
* versions minus the pin) — agent-node's gate reads the same table.
|
|
15
|
+
*/
|
|
16
|
+
export declare const OPENCODE_TRANSITION_VERSIONS: readonly string[];
|
|
17
|
+
/** Versions a start may accept, preferred first: the release pin, then the
|
|
18
|
+
* transition versions. The order matters — a PATH holding both resolves to
|
|
19
|
+
* the release pin. */
|
|
20
|
+
export declare function acceptedOpencodeVersions(pin?: string): string[];
|
|
21
|
+
/** One-line upgrade note when a start accepted a transition version, else null. */
|
|
22
|
+
export declare function opencodeLegacyPinNote(found: string, pin?: string): string | null;
|
|
6
23
|
/** Exact upstream remediation shared by every CLI failure path. */
|
|
7
24
|
export declare function opencodeExactInstallCommand(version?: string): string;
|
|
8
25
|
/** Preserve package-identity diagnostics while always leaving a missing or
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type OpencodeGeneration = "v1" | "v2";
|
|
2
|
+
export type OpencodeSupportStatus = "supported" | "preview" | "unsupported";
|
|
3
|
+
export interface OpencodeGenerationSupport {
|
|
4
|
+
readonly generation: OpencodeGeneration;
|
|
5
|
+
/** npm package that provides the `opencode` executable. */
|
|
6
|
+
readonly packageName: string;
|
|
7
|
+
/** Release pin: the exact version a fresh install is told to use.
|
|
8
|
+
* null when no version of this generation is vetted. */
|
|
9
|
+
readonly pin: string | null;
|
|
10
|
+
/** Every exact version a start may accept, preferred first (pin first).
|
|
11
|
+
* Empty when the generation is unsupported. */
|
|
12
|
+
readonly acceptedVersions: readonly string[];
|
|
13
|
+
readonly status: OpencodeSupportStatus;
|
|
14
|
+
}
|
|
15
|
+
/** The V1 release pin. Kept as its own literal line so shell suites can
|
|
16
|
+
* read it with a single anchored sed (tests/test1225…/run.sh). */
|
|
17
|
+
export declare const OPENCODE_V1_PIN = "1.18.34";
|
|
18
|
+
export declare const OPENCODE_SUPPORTED_VERSIONS: readonly OpencodeGenerationSupport[];
|
|
19
|
+
/** Generation assumed for every node record that does not name one. */
|
|
20
|
+
export declare const OPENCODE_DEFAULT_GENERATION: OpencodeGeneration;
|
|
21
|
+
export declare function isOpencodeGeneration(value: unknown): value is OpencodeGeneration;
|
|
22
|
+
export declare function opencodeGenerationSupport(generation: OpencodeGeneration): OpencodeGenerationSupport;
|
|
23
|
+
/** Exact versions a start may accept for `generation`, preferred first.
|
|
24
|
+
* Always empty for an unsupported generation. */
|
|
25
|
+
export declare function acceptedOpencodeVersionsFor(generation: OpencodeGeneration): readonly string[];
|
|
26
|
+
export declare function isAcceptedOpencodeVersionFor(generation: OpencodeGeneration, version: string): boolean;
|
|
27
|
+
/** Generation recorded on a node config; a config without one (every node
|
|
28
|
+
* created before #542) is V1. An unrecognised value is returned as
|
|
29
|
+
* undefined so callers can refuse it instead of guessing. */
|
|
30
|
+
export declare function opencodeGenerationOfConfig(config: {
|
|
31
|
+
opencodeGeneration?: unknown;
|
|
32
|
+
} | null | undefined): OpencodeGeneration | undefined;
|
|
@@ -9,9 +9,23 @@ export interface PathModeFacts {
|
|
|
9
9
|
export type UnsafePathReason = "owner" | "group-writable" | "world-writable" | null;
|
|
10
10
|
/** Which condition makes this path unsafe to execute from, if any. */
|
|
11
11
|
export declare function classifyUnsafePath(facts: PathModeFacts): UnsafePathReason;
|
|
12
|
+
export declare function describeUnsafePath(path: string, facts: PathModeFacts): string;
|
|
13
|
+
export interface DirectoryModeFacts {
|
|
14
|
+
uid: number;
|
|
15
|
+
/** Full st_mode (the sticky bit 0o1000 matters here). */
|
|
16
|
+
mode: number;
|
|
17
|
+
processUid: number;
|
|
18
|
+
/** Is this the package root itself or one of its ancestors? Only changes the wording. */
|
|
19
|
+
ancestorOf?: string;
|
|
20
|
+
}
|
|
12
21
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
22
|
+
* #535 (audit P1-2) — the DIRECTORY branch of the agent-node package check used
|
|
23
|
+
* to throw a bare "unsafe ownership or mode" with no path at all. In the audit
|
|
24
|
+
* the offender was an ANCESTOR, `/tmp` (1777), because the npx cache lived
|
|
25
|
+
* under a HOME in /tmp — and nothing in the message said so.
|
|
26
|
+
*
|
|
27
|
+
* Names the exact directory, what is wrong with it, and the command that fixes
|
|
28
|
+
* it. For a sticky world-writable directory (/tmp-like) the fix is NOT chmod —
|
|
29
|
+
* changing /tmp breaks the machine — but moving the npm cache out from under it.
|
|
16
30
|
*/
|
|
17
|
-
export declare function
|
|
31
|
+
export declare function describeUnsafeDirectory(path: string, facts: DirectoryModeFacts): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleep2agi/agent-network",
|
|
3
|
-
"version": "2.3.0-preview.
|
|
3
|
+
"version": "2.3.0-preview.137",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"typecheck": "tsc --noEmit",
|
|
26
26
|
"test:feishu-bridge": "bun tests/feishu-bridge-ackplaceholder.test.ts",
|
|
27
|
-
"build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build src/daemon-capability-display.ts --outdir dist/src --target browser --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 && cp bin/anet.cjs dist/bin/anet.cjs",
|
|
27
|
+
"build": "bun build src/client.ts --outdir dist/src --target node --minify && bun build src/daemon-capability-display.ts --outdir dist/src --target browser --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 && node scripts/stamp-node-server-version.mjs && cp bin/anet.cjs dist/bin/anet.cjs",
|
|
28
28
|
"prepublishOnly": "npm run build"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [
|