alink-cli 0.11.0 → 0.11.1
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.mjs +79 -13
- package/dist/bin.mjs.map +1 -1
- package/dist/daemon.js +11 -17
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -13702,6 +13702,7 @@ const CLAUDE_DRIVER_KIND = ProviderDriverKind.make("claudeAgent");
|
|
|
13702
13702
|
const GEMINI_DRIVER_KIND = ProviderDriverKind.make("gemini");
|
|
13703
13703
|
const QWEN_DRIVER_KIND = ProviderDriverKind.make("qwen");
|
|
13704
13704
|
const KIMI_DRIVER_KIND = ProviderDriverKind.make("kimi");
|
|
13705
|
+
const JOYCODE_DRIVER_KIND = ProviderDriverKind.make("joycode");
|
|
13705
13706
|
const DEFAULT_MODEL = "gpt-5.6-sol";
|
|
13706
13707
|
/**
|
|
13707
13708
|
* Codex default-model preference, most preferred first. The provider snapshot
|
|
@@ -13715,7 +13716,8 @@ const DEFAULT_MODEL_BY_PROVIDER = {
|
|
|
13715
13716
|
[CLAUDE_DRIVER_KIND]: "claude-sonnet-5",
|
|
13716
13717
|
[GEMINI_DRIVER_KIND]: "gemini-2.5-pro",
|
|
13717
13718
|
[QWEN_DRIVER_KIND]: "qwen3-coder-plus",
|
|
13718
|
-
[KIMI_DRIVER_KIND]: "kimi-k2"
|
|
13719
|
+
[KIMI_DRIVER_KIND]: "kimi-k2",
|
|
13720
|
+
[JOYCODE_DRIVER_KIND]: "default"
|
|
13719
13721
|
};
|
|
13720
13722
|
/** Per-provider text generation model defaults. */
|
|
13721
13723
|
const DEFAULT_TEXT_GENERATION_MODEL_BY_PROVIDER = {
|
|
@@ -13723,7 +13725,8 @@ const DEFAULT_TEXT_GENERATION_MODEL_BY_PROVIDER = {
|
|
|
13723
13725
|
[CLAUDE_DRIVER_KIND]: "claude-haiku-4-5",
|
|
13724
13726
|
[GEMINI_DRIVER_KIND]: "gemini-2.5-flash",
|
|
13725
13727
|
[QWEN_DRIVER_KIND]: "qwen3-coder-flash",
|
|
13726
|
-
[KIMI_DRIVER_KIND]: "kimi-k2"
|
|
13728
|
+
[KIMI_DRIVER_KIND]: "kimi-k2",
|
|
13729
|
+
[JOYCODE_DRIVER_KIND]: "default"
|
|
13727
13730
|
};
|
|
13728
13731
|
const MODEL_SLUG_ALIASES_BY_PROVIDER = {
|
|
13729
13732
|
[CODEX_DRIVER_KIND]: {
|
|
@@ -13760,7 +13763,8 @@ const MODEL_SLUG_ALIASES_BY_PROVIDER = {
|
|
|
13760
13763
|
},
|
|
13761
13764
|
[GEMINI_DRIVER_KIND]: {},
|
|
13762
13765
|
[QWEN_DRIVER_KIND]: {},
|
|
13763
|
-
[KIMI_DRIVER_KIND]: {}
|
|
13766
|
+
[KIMI_DRIVER_KIND]: {},
|
|
13767
|
+
[JOYCODE_DRIVER_KIND]: {}
|
|
13764
13768
|
};
|
|
13765
13769
|
//#endregion
|
|
13766
13770
|
//#region ../t3-contracts/src/orchestration.ts
|
|
@@ -20758,7 +20762,7 @@ const ClaudeSettings = makeProviderSettingsSchema({
|
|
|
20758
20762
|
] });
|
|
20759
20763
|
/**
|
|
20760
20764
|
* Shared shape for ACP-based agents (agentlink fork additions): Gemini CLI,
|
|
20761
|
-
* Qwen Code, Kimi CLI. Each only needs an enable switch, a binary path, and
|
|
20765
|
+
* Qwen Code, Kimi CLI, JoyCode. Each only needs an enable switch, a binary path, and
|
|
20762
20766
|
* a custom-model list — everything else is negotiated over ACP at runtime.
|
|
20763
20767
|
*/
|
|
20764
20768
|
const makeAcpAgentSettingsSchema = (input) => makeProviderSettingsSchema({
|
|
@@ -20788,6 +20792,11 @@ const KimiSettings = makeAcpAgentSettingsSchema({
|
|
|
20788
20792
|
binaryTitle: "Binary path",
|
|
20789
20793
|
binaryDescription: "Path to the Kimi CLI binary (started with `kimi acp`)."
|
|
20790
20794
|
});
|
|
20795
|
+
const JoyCodeSettings = makeAcpAgentSettingsSchema({
|
|
20796
|
+
binaryFallback: "joycode",
|
|
20797
|
+
binaryTitle: "Binary path",
|
|
20798
|
+
binaryDescription: "Path to the JoyCode CLI binary (started with `joycode app-server`)."
|
|
20799
|
+
});
|
|
20791
20800
|
const ObservabilitySettings = Struct({
|
|
20792
20801
|
otlpTracesUrl: TrimmedString.pipe(withDecodingDefault(succeed$1(""))),
|
|
20793
20802
|
otlpMetricsUrl: TrimmedString.pipe(withDecodingDefault(succeed$1("")))
|
|
@@ -20858,7 +20867,8 @@ const ServerSettings = Struct({
|
|
|
20858
20867
|
claudeAgent: ClaudeSettings.pipe(withDecodingDefault(succeed$1({}))),
|
|
20859
20868
|
gemini: GeminiSettings.pipe(withDecodingDefault(succeed$1({}))),
|
|
20860
20869
|
qwen: QwenSettings.pipe(withDecodingDefault(succeed$1({}))),
|
|
20861
|
-
kimi: KimiSettings.pipe(withDecodingDefault(succeed$1({})))
|
|
20870
|
+
kimi: KimiSettings.pipe(withDecodingDefault(succeed$1({}))),
|
|
20871
|
+
joycode: JoyCodeSettings.pipe(withDecodingDefault(succeed$1({})))
|
|
20862
20872
|
}).pipe(withDecodingDefault(succeed$1({}))),
|
|
20863
20873
|
providerInstances: Record(ProviderInstanceId, ProviderInstanceConfig).pipe(withDecodingDefault(succeed$1({}))),
|
|
20864
20874
|
observability: ObservabilitySettings.pipe(withDecodingDefault(succeed$1({})))
|
|
@@ -20948,7 +20958,8 @@ const ServerSettingsPatch = Struct({
|
|
|
20948
20958
|
claudeAgent: optionalKey(ClaudeSettingsPatch),
|
|
20949
20959
|
gemini: optionalKey(AcpAgentSettingsPatch),
|
|
20950
20960
|
qwen: optionalKey(AcpAgentSettingsPatch),
|
|
20951
|
-
kimi: optionalKey(AcpAgentSettingsPatch)
|
|
20961
|
+
kimi: optionalKey(AcpAgentSettingsPatch),
|
|
20962
|
+
joycode: optionalKey(AcpAgentSettingsPatch)
|
|
20952
20963
|
})),
|
|
20953
20964
|
providerInstances: optionalKey(Record(ProviderInstanceId, ProviderInstanceConfig))
|
|
20954
20965
|
});
|
|
@@ -86687,7 +86698,7 @@ const makeAcpNativeLoggerFactory = fn("makeAcpNativeLoggerFactory")(function* ()
|
|
|
86687
86698
|
//#region src/provider/Layers/AcpAgentAdapter.ts
|
|
86688
86699
|
/**
|
|
86689
86700
|
* AcpAgentAdapter — generic `ProviderAdapter` over `AcpSessionRuntime` for
|
|
86690
|
-
* the fork's ACP CLIs (Gemini / Qwen / Kimi).
|
|
86701
|
+
* the fork's ACP CLIs (Gemini / Qwen / Kimi / JoyCode).
|
|
86691
86702
|
*
|
|
86692
86703
|
* Ported from the upstream `GrokAdapter`, minus the Grok-specific pieces the
|
|
86693
86704
|
* fork doesn't need: the MCP provider-session bridge (the `mcp/` subsystem
|
|
@@ -86698,7 +86709,7 @@ const makeAcpNativeLoggerFactory = fn("makeAcpNativeLoggerFactory")(function* ()
|
|
|
86698
86709
|
* cursors.
|
|
86699
86710
|
*
|
|
86700
86711
|
* One instance of this adapter is created per provider instance by the
|
|
86701
|
-
* driver (`Drivers/<X>Driver.ts`); behavior differences between the
|
|
86712
|
+
* driver (`Drivers/<X>Driver.ts`); behavior differences between the
|
|
86702
86713
|
* CLIs live entirely in their `AcpAgentDescriptor`.
|
|
86703
86714
|
*
|
|
86704
86715
|
* @module provider/Layers/AcpAgentAdapter
|
|
@@ -87544,8 +87555,27 @@ function buildDiscoveredModelsFromSessionModelState(descriptor, modelState) {
|
|
|
87544
87555
|
};
|
|
87545
87556
|
}).filter((model) => model !== void 0);
|
|
87546
87557
|
}
|
|
87558
|
+
function buildDiscoveredAcpAgentModels(descriptor, sessionSetupResult) {
|
|
87559
|
+
const models = buildDiscoveredModelsFromSessionModelState(descriptor, sessionSetupResult.models);
|
|
87560
|
+
if (models.length > 0) return models;
|
|
87561
|
+
const modelConfig = sessionSetupResult.configOptions?.find((option) => option.category === "model" && option.type === "select");
|
|
87562
|
+
if (!modelConfig || modelConfig.type !== "select") return [];
|
|
87563
|
+
const options = modelConfig.options.flatMap((entry) => "value" in entry ? [entry] : entry.options);
|
|
87564
|
+
const seen = /* @__PURE__ */ new Set();
|
|
87565
|
+
return options.map((option) => {
|
|
87566
|
+
const slug = resolveAcpAgentModelId(descriptor, option.value);
|
|
87567
|
+
if (!slug || seen.has(slug)) return;
|
|
87568
|
+
seen.add(slug);
|
|
87569
|
+
return {
|
|
87570
|
+
slug,
|
|
87571
|
+
name: option.name.trim() || slug,
|
|
87572
|
+
isCustom: false,
|
|
87573
|
+
capabilities: EMPTY_CAPABILITIES
|
|
87574
|
+
};
|
|
87575
|
+
}).filter((model) => model !== void 0);
|
|
87576
|
+
}
|
|
87547
87577
|
const discoverModelsViaAcp = (descriptor, settings, environment = process.env) => gen(function* () {
|
|
87548
|
-
return
|
|
87578
|
+
return buildDiscoveredAcpAgentModels(descriptor, (yield* (yield* makeAcpAgentRuntime(descriptor, {
|
|
87549
87579
|
settings,
|
|
87550
87580
|
environment,
|
|
87551
87581
|
childProcessSpawner: yield* ChildProcessSpawner,
|
|
@@ -87554,7 +87584,7 @@ const discoverModelsViaAcp = (descriptor, settings, environment = process.env) =
|
|
|
87554
87584
|
name: "agentlink-provider-probe",
|
|
87555
87585
|
version: "0.0.0"
|
|
87556
87586
|
}
|
|
87557
|
-
})).start()).sessionSetupResult
|
|
87587
|
+
})).start()).sessionSetupResult);
|
|
87558
87588
|
}).pipe(scoped);
|
|
87559
87589
|
const runVersionCommand = (descriptor, settings, environment = process.env) => gen(function* () {
|
|
87560
87590
|
const command = settings.binaryPath.trim() || descriptor.defaultBinary;
|
|
@@ -87595,7 +87625,7 @@ const checkAcpAgentProviderStatus = (descriptor, settings, environment = process
|
|
|
87595
87625
|
version: null,
|
|
87596
87626
|
status: "error",
|
|
87597
87627
|
auth: { status: "unknown" },
|
|
87598
|
-
message: isCommandMissingCause(error) ? `${descriptor.displayName} (\`${descriptor.defaultBinary}\`) is not installed or not on PATH.` : `Failed to execute ${descriptor.displayName} health check.`
|
|
87628
|
+
message: isCommandMissingCause(error) ? descriptor.missingBinaryMessage ?? `${descriptor.displayName} (\`${descriptor.defaultBinary}\`) is not installed or not on PATH.` : `Failed to execute ${descriptor.displayName} health check.`
|
|
87599
87629
|
}
|
|
87600
87630
|
});
|
|
87601
87631
|
}
|
|
@@ -87797,6 +87827,41 @@ const GeminiDriver = makeAcpAgentDriver({
|
|
|
87797
87827
|
defaultConfig: () => decodeGeminiSettings({})
|
|
87798
87828
|
});
|
|
87799
87829
|
//#endregion
|
|
87830
|
+
//#region src/provider/acp/JoyCodeAcpAgent.ts
|
|
87831
|
+
/**
|
|
87832
|
+
* JoyCodeAcpAgent — descriptor for JoyCode CLI. `joycode app-server` starts
|
|
87833
|
+
* its ACP server over stdio.
|
|
87834
|
+
*
|
|
87835
|
+
* JoyCode 1.0.1 advertises both `loadSession` and `session/resume`, but its
|
|
87836
|
+
* `session/load` response is currently JSON-RPC `null`. daemon-t3 decodes
|
|
87837
|
+
* that response as an ACP LoadSessionResponse object, so the probe driver
|
|
87838
|
+
* deliberately starts fresh until that compatibility boundary is resolved.
|
|
87839
|
+
*
|
|
87840
|
+
* @module provider/acp/JoyCodeAcpAgent
|
|
87841
|
+
*/
|
|
87842
|
+
const JoyCodeAcpAgent = {
|
|
87843
|
+
provider: ProviderDriverKind.make("joycode"),
|
|
87844
|
+
displayName: "JoyCode",
|
|
87845
|
+
defaultBinary: "joycode",
|
|
87846
|
+
acpArgs: ["app-server"],
|
|
87847
|
+
defaultModel: "default",
|
|
87848
|
+
builtInModels: ["default"],
|
|
87849
|
+
missingBinaryMessage: "请安装 joycode-cli,参考内部文档。",
|
|
87850
|
+
supportsSessionLoad: false
|
|
87851
|
+
};
|
|
87852
|
+
//#endregion
|
|
87853
|
+
//#region src/provider/Drivers/JoyCodeDriver.ts
|
|
87854
|
+
/** JoyCodeDriver — JoyCode CLI (`joycode app-server`) via generic ACP. */
|
|
87855
|
+
const decodeJoyCodeSettings = decodeSync(JoyCodeSettings);
|
|
87856
|
+
const JoyCodeDriver = makeAcpAgentDriver({
|
|
87857
|
+
driver: {
|
|
87858
|
+
descriptor: JoyCodeAcpAgent,
|
|
87859
|
+
npmPackageName: "@joycode/joycode-cli"
|
|
87860
|
+
},
|
|
87861
|
+
configSchema: JoyCodeSettings,
|
|
87862
|
+
defaultConfig: () => decodeJoyCodeSettings({})
|
|
87863
|
+
});
|
|
87864
|
+
//#endregion
|
|
87800
87865
|
//#region src/provider/acp/KimiAcpAgent.ts
|
|
87801
87866
|
/**
|
|
87802
87867
|
* KimiAcpAgent — descriptor for the Kimi CLI (Kimi Code CLI, Moonshot),
|
|
@@ -87886,7 +87951,7 @@ const decodeQwenSettings = decodeSync(QwenSettings);
|
|
|
87886
87951
|
* satisfy it.
|
|
87887
87952
|
*
|
|
87888
87953
|
* agentlink fork: Cursor/Grok/OpenCode drivers were removed; ACP-based
|
|
87889
|
-
* drivers (Gemini/Qwen/Kimi) land here on top of `acp/AcpSessionRuntime.ts`.
|
|
87954
|
+
* drivers (Gemini/Qwen/Kimi/JoyCode) land here on top of `acp/AcpSessionRuntime.ts`.
|
|
87890
87955
|
*
|
|
87891
87956
|
* @module provider/builtInDrivers
|
|
87892
87957
|
*/
|
|
@@ -87907,7 +87972,8 @@ const BUILT_IN_DRIVERS = [
|
|
|
87907
87972
|
configSchema: QwenSettings,
|
|
87908
87973
|
defaultConfig: () => decodeQwenSettings({})
|
|
87909
87974
|
}),
|
|
87910
|
-
KimiDriver
|
|
87975
|
+
KimiDriver,
|
|
87976
|
+
JoyCodeDriver
|
|
87911
87977
|
];
|
|
87912
87978
|
//#endregion
|
|
87913
87979
|
//#region src/provider/Services/ProviderInstanceRegistryMutator.ts
|