@sleep2agi/agent-network 2.3.0-preview.162 → 2.3.0-preview.164
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.js +2 -2
- package/dist/src/client.js +1 -1
- package/dist/src/codex-copresence-login-gate.d.ts +2 -0
- package/dist/src/codex-copresence-profile.d.ts +1 -0
- package/dist/src/codex-copresence-recovery.d.ts +4 -1
- package/dist/src/codex-copresence-rpc.d.ts +2 -0
- package/dist/src/codex-copresence-yolo.d.ts +16 -0
- package/dist/src/codex-lifecycle-preflight.d.ts +2 -0
- package/dist/src/codex-reasoning-effort.d.ts +17 -0
- package/dist/src/daemon-codex-inventory.d.ts +35 -0
- package/dist/src/daemon-provider-account-custody.d.ts +28 -0
- package/dist/src/daemon-provider-account-readback.d.ts +3 -0
- package/dist/src/daemon-provider-application.d.ts +34 -0
- package/dist/src/daemon-provider-apply-command.d.ts +9 -0
- package/dist/src/daemon-provider-command.d.ts +7 -0
- package/dist/src/daemon-provider-lifecycle.d.ts +4 -0
- package/dist/src/daemon-provider-store.d.ts +104 -0
- package/dist/src/node-server.js +8 -8
- package/dist/src/opencode-agent-node-pair.d.ts +6 -6
- package/dist/src/opencode-preset.d.ts +4 -0
- package/dist/src/opencode-v2-configured-model.d.ts +34 -0
- package/dist/src/opencode-v2-create-align.d.ts +18 -0
- package/dist/src/provider-application-contract.d.ts +11 -0
- package/dist/src/provider-apply.d.ts +28 -0
- package/dist/src/provider-presets.d.ts +76 -0
- package/package.json +2 -1
|
@@ -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.164";
|
|
2
|
+
export declare const PAIRED_AGENT_NODE_VERSION = "2.5.0-preview.130";
|
|
3
|
+
export declare const PAIRED_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.130";
|
|
4
|
+
export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.164";
|
|
5
|
+
export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.130";
|
|
6
|
+
export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.130";
|
|
7
7
|
export type PairedAgentNodeResolution = {
|
|
8
8
|
spec: string;
|
|
9
9
|
args: string[];
|
|
@@ -71,3 +71,7 @@ export declare function clearOpencodeAuthJson(nodeWorkDir: string): string;
|
|
|
71
71
|
* a model after creation, which the runtime's separate safe renderer retains.
|
|
72
72
|
*/
|
|
73
73
|
export declare function writeOpencodeConfigJson(nodeWorkDir: string, preset: OpencodePreset): string;
|
|
74
|
+
/** Replace opencode.json through the same private-file writer. Callers pass
|
|
75
|
+
* the full document (for example after merging a native V2 `providers`
|
|
76
|
+
* entry). This does not interpret the body. */
|
|
77
|
+
export declare function replaceOpencodeConfigJson(nodeWorkDir: string, body: string): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type OpenCodeV2AlignCode = "opencode_v2_configured_model_missing" | "opencode_v2_model_mismatch" | "opencode_v2_provider_mismatch" | "opencode_v2_config_unreadable" | "opencode_v2_provider_credential_missing";
|
|
2
|
+
export declare class OpenCodeV2AlignError extends Error {
|
|
3
|
+
readonly code: OpenCodeV2AlignCode;
|
|
4
|
+
constructor(code: OpenCodeV2AlignCode, reason: string);
|
|
5
|
+
}
|
|
6
|
+
export interface OpenCodeConfiguredSelection {
|
|
7
|
+
readonly model: string;
|
|
8
|
+
readonly providerId: string;
|
|
9
|
+
readonly modelId: string;
|
|
10
|
+
/** Native `providers[providerId]` object, when the merged config has one. */
|
|
11
|
+
readonly providerEntry?: Readonly<Record<string, unknown>>;
|
|
12
|
+
/**
|
|
13
|
+
* Native `provider[providerId]` object. OpenCode 2.0.22 still reads this
|
|
14
|
+
* key (options.baseURL / options.apiKey). It is copied as written.
|
|
15
|
+
*/
|
|
16
|
+
readonly legacyProviderEntry?: Readonly<Record<string, unknown>>;
|
|
17
|
+
readonly credentialEnv: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
export interface OpenCodeConfigLayer {
|
|
20
|
+
readonly label: string;
|
|
21
|
+
readonly document: Readonly<Record<string, unknown>>;
|
|
22
|
+
}
|
|
23
|
+
/** Drop JSONC comments and trailing commas without touching string contents. */
|
|
24
|
+
export declare function stripJsonc(input: string): string;
|
|
25
|
+
/** Merge already-loaded layers. Exported so tests can pin precedence
|
|
26
|
+
* without depending on the machine's real OpenCode config. */
|
|
27
|
+
export declare function mergeOpenCodeConfigLayers(layers: readonly OpenCodeConfigLayer[]): OpenCodeConfiguredSelection;
|
|
28
|
+
export declare function renderOpenCodeV2AlignedConfig(selection: OpenCodeConfiguredSelection): string;
|
|
29
|
+
export declare function assertOpenCodeV2RequestedModel(selection: OpenCodeConfiguredSelection, requestedModel: string | undefined): void;
|
|
30
|
+
export declare function readOpenCodeConfiguredSelection(input: {
|
|
31
|
+
projectDir: string;
|
|
32
|
+
homeDir: string;
|
|
33
|
+
xdgConfigHome?: string;
|
|
34
|
+
}): OpenCodeConfiguredSelection;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type OpenCodeConfiguredSelection } from "./opencode-v2-configured-model";
|
|
2
|
+
export interface PlanOpencodeV2CreateInput {
|
|
3
|
+
projectDir: string;
|
|
4
|
+
homeDir: string;
|
|
5
|
+
xdgConfigHome?: string;
|
|
6
|
+
requestedModel?: string;
|
|
7
|
+
requestedProvider?: string;
|
|
8
|
+
requestedBaseUrl?: string;
|
|
9
|
+
requestedApiKeyEnv?: string;
|
|
10
|
+
argv: readonly string[];
|
|
11
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
12
|
+
}
|
|
13
|
+
export interface PlannedOpencodeV2Create {
|
|
14
|
+
readonly selection: OpenCodeConfiguredSelection;
|
|
15
|
+
readonly opencodeJson: string;
|
|
16
|
+
readonly credentialEnv: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function planOpencodeV2Create(input: PlanOpencodeV2CreateInput): PlannedOpencodeV2Create;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ProviderApplicationSelection = {
|
|
2
|
+
node_id: string;
|
|
3
|
+
node_revision: string;
|
|
4
|
+
provider_id: string;
|
|
5
|
+
auth_id: string;
|
|
6
|
+
model: string;
|
|
7
|
+
confirm_restart: true;
|
|
8
|
+
account_id?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function validProviderApplicationSelection(v: any): v is ProviderApplicationSelection;
|
|
11
|
+
export declare function validProviderApplicationReceipt(v: any, requestId: string, revision: number, selection: ProviderApplicationSelection): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ResolvedProvider } from "./provider-presets";
|
|
2
|
+
export interface StageProviderInput {
|
|
3
|
+
runtime: string;
|
|
4
|
+
opencodeGeneration?: string;
|
|
5
|
+
opencodeUnsafeTools?: boolean;
|
|
6
|
+
provider?: string;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
apiKeyEnv?: string;
|
|
9
|
+
model?: string;
|
|
10
|
+
argv: readonly string[];
|
|
11
|
+
shellEnv: Readonly<Record<string, string | undefined>>;
|
|
12
|
+
dotenv?: Readonly<Record<string, string | undefined>>;
|
|
13
|
+
readStdin?: () => string | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface StagedProvider {
|
|
16
|
+
readonly resolved: ResolvedProvider;
|
|
17
|
+
readonly secret: string;
|
|
18
|
+
}
|
|
19
|
+
/** Returns null when the operator did not ask for a provider. Throws on a
|
|
20
|
+
* partial or illegal request. Does not write. */
|
|
21
|
+
export declare function stageProviderRequest(input: StageProviderInput): StagedProvider | null;
|
|
22
|
+
export declare function applyStagedProviderToProfile(profile: {
|
|
23
|
+
model?: string;
|
|
24
|
+
env?: Record<string, string>;
|
|
25
|
+
}, staged: StagedProvider): void;
|
|
26
|
+
/** Write the runtime file. Call after the node directory exists, and for
|
|
27
|
+
* OpenCode after writeOpencodePresetIfRequested so this merge is last. */
|
|
28
|
+
export declare function materializeStagedProvider(nodeDir: string, resolved: ResolvedProvider): void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export type ProviderFamily = "codex" | "opencode-v2";
|
|
2
|
+
export type ProviderPresetId = "deepseek" | "minimax" | "custom-openai-compat";
|
|
3
|
+
export interface ProviderPreset {
|
|
4
|
+
readonly id: ProviderPresetId;
|
|
5
|
+
/** Id used inside the runtime file. `custom-openai-compat` is `custom`. */
|
|
6
|
+
readonly providerId: string;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly defaultModel: string;
|
|
9
|
+
readonly defaultBaseUrl: string;
|
|
10
|
+
readonly defaultEnvKey: string;
|
|
11
|
+
readonly requiresBaseUrl: boolean;
|
|
12
|
+
readonly requiresModel: boolean;
|
|
13
|
+
readonly requiresEnvKey: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ProviderRuntimeContext {
|
|
16
|
+
readonly opencodeGeneration?: string;
|
|
17
|
+
readonly opencodeUnsafeTools?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function providerFamilyForRuntime(runtime: string, ctx?: ProviderRuntimeContext): ProviderFamily | null;
|
|
20
|
+
/** Presets legal for this runtime. OpenCode V1, Claude, and every other
|
|
21
|
+
* runtime get an empty list — they are not a third column of the same table. */
|
|
22
|
+
export declare function providerPresetsForRuntime(runtime: string, ctx?: ProviderRuntimeContext): readonly ProviderPreset[];
|
|
23
|
+
export declare function assertProviderSupported(runtime: string, ctx?: ProviderRuntimeContext): ProviderFamily;
|
|
24
|
+
export declare function assertProviderEnvName(name: string): string;
|
|
25
|
+
export declare function assertProviderBaseUrl(raw: string): string;
|
|
26
|
+
export interface ResolvedProvider {
|
|
27
|
+
readonly family: ProviderFamily;
|
|
28
|
+
readonly presetId: ProviderPresetId;
|
|
29
|
+
readonly providerId: string;
|
|
30
|
+
readonly label: string;
|
|
31
|
+
readonly model: string;
|
|
32
|
+
/** Value stored on the node profile. Codex is the bare id; OpenCode is provider/model. */
|
|
33
|
+
readonly profileModel: string;
|
|
34
|
+
readonly baseUrl: string;
|
|
35
|
+
/** True when the operator passed --base-url. Catalog OpenCode entries omit settings otherwise. */
|
|
36
|
+
readonly baseUrlExplicit: boolean;
|
|
37
|
+
readonly envKey: string;
|
|
38
|
+
readonly wireApi: "responses";
|
|
39
|
+
readonly opencodePackage?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function resolveProviderSelection(input: {
|
|
42
|
+
runtime: string;
|
|
43
|
+
opencodeGeneration?: string;
|
|
44
|
+
opencodeUnsafeTools?: boolean;
|
|
45
|
+
provider: string;
|
|
46
|
+
baseUrl?: string;
|
|
47
|
+
apiKeyEnv?: string;
|
|
48
|
+
model?: string;
|
|
49
|
+
}): ResolvedProvider;
|
|
50
|
+
/** Read the credential without ever accepting it on argv. */
|
|
51
|
+
export declare function takeProviderSecret(input: {
|
|
52
|
+
envKey: string;
|
|
53
|
+
argv: readonly string[];
|
|
54
|
+
shellEnv: Readonly<Record<string, string | undefined>>;
|
|
55
|
+
dotenv?: Readonly<Record<string, string | undefined>>;
|
|
56
|
+
readStdin?: () => string | undefined;
|
|
57
|
+
}): string;
|
|
58
|
+
/** Idempotent line merge. Other tables, including [projects.*] and
|
|
59
|
+
* [mcp_servers.commhub], stay byte-identical. Unknown keys inside the managed
|
|
60
|
+
* provider table are kept. The key value is never written. */
|
|
61
|
+
export declare function mergeCodexProviderToml(existing: string, spec: ResolvedProvider): string;
|
|
62
|
+
export interface OpenCodeV2ProviderEntry {
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly env: readonly string[];
|
|
65
|
+
readonly package?: string;
|
|
66
|
+
readonly settings?: {
|
|
67
|
+
readonly baseURL: string;
|
|
68
|
+
};
|
|
69
|
+
readonly models: Readonly<Record<string, {
|
|
70
|
+
readonly name: string;
|
|
71
|
+
}>>;
|
|
72
|
+
}
|
|
73
|
+
export declare function renderOpenCodeV2Provider(spec: ResolvedProvider): OpenCodeV2ProviderEntry;
|
|
74
|
+
/** Merge one native provider into an existing opencode.json. V1 `provider`,
|
|
75
|
+
* tools, permission, and mcp keys are left in place. */
|
|
76
|
+
export declare function mergeOpenCodeV2Config(existing: string, spec: ResolvedProvider): 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.164",
|
|
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",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"node": ">=22.13.0"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
+
"smol-toml": "1.9.1",
|
|
72
73
|
"@inquirer/prompts": "^8.4.3",
|
|
73
74
|
"@larksuiteoapi/node-sdk": "^1.42.0",
|
|
74
75
|
"markdown-it": "^14.1.0",
|