@kafca/agentdock 0.1.30 → 0.1.33
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/LICENSE.md +73 -0
- package/README.md +15 -0
- package/dist/renderer/assets/{Badge-DlVJI1Ys.js → Badge-VeSLCPPV.js} +1 -1
- package/dist/renderer/assets/{Chat-oa8OjaHQ.js → Chat-DWTQeTgn.js} +1 -1
- package/dist/renderer/assets/{ChatMarkdown-C-N8KS5C.js → ChatMarkdown-C9gSQIVb.js} +1 -1
- package/dist/renderer/assets/{Config-D9sL_d4D.js → Config-CTA-pZNR.js} +1 -1
- package/dist/renderer/assets/{CronList-Z5JU3DHk.js → CronList-BngBCnFY.js} +1 -1
- package/dist/renderer/assets/{Dashboard-D3BwbG43.js → Dashboard-D4pGvDpc.js} +2 -2
- package/dist/renderer/assets/{EmptyState-QOj765Ul.js → EmptyState-DMf8rzDs.js} +1 -1
- package/dist/renderer/assets/{KnowledgeDetail-J7n01mPu.js → KnowledgeDetail-C1Ym_cHk.js} +1 -1
- package/dist/renderer/assets/{KnowledgeHome-BFnH0NVk.js → KnowledgeHome-DPRiR72G.js} +1 -1
- package/dist/renderer/assets/{Logs-DfSUifXc.js → Logs-CRHecmzO.js} +1 -1
- package/dist/renderer/assets/{Modal-QjEGhyru.js → Modal-BDhhPv2l.js} +1 -1
- package/dist/renderer/assets/{Page-qdHFSw7x.js → Page-DdDZN7AE.js} +1 -1
- package/dist/renderer/assets/{ProjectDetail-DS_rfvhh.js → ProjectDetail-DCsr3LkW.js} +1 -1
- package/dist/renderer/assets/{ProjectList-COtyZd7H.js → ProjectList-Cnm-iLvg.js} +1 -1
- package/dist/renderer/assets/{Select-BQ8mncVu.js → Select-Dw4FCXhJ.js} +1 -1
- package/dist/renderer/assets/{SessionChat-DjVnjuQy.js → SessionChat-O-6abK8x.js} +1 -1
- package/dist/renderer/assets/{SessionList-88dgGZJ8.js → SessionList-5yptvVL9.js} +1 -1
- package/dist/renderer/assets/ThreadChat-CIM_o2HO.js +23 -0
- package/dist/renderer/assets/{Workspace-D_hzSJjX.js → Workspace-D9UeUCNr.js} +1 -1
- package/dist/renderer/assets/{arrow-left-BMpknulW.js → arrow-left-CKfxNOXE.js} +1 -1
- package/dist/renderer/assets/{book-open-CiaOeQbU.js → book-open-CQddlENV.js} +1 -1
- package/dist/renderer/assets/{check-CgwYH4GF.js → check-CZYvOmIS.js} +1 -1
- package/dist/renderer/assets/{chevron-down-BzD2S1OO.js → chevron-down-CVIWFoXF.js} +1 -1
- package/dist/renderer/assets/{circle-BDHD7g7l.js → circle-DSfdQM7k.js} +1 -1
- package/dist/renderer/assets/{desktop-BiR5LPL5.js → desktop-B9KUgeOV.js} +1 -1
- package/dist/renderer/assets/{desktop-BkMW-h5p.js → desktop-O8_6ZCVZ.js} +2 -2
- package/dist/renderer/assets/{funnel-Bruf5FYA.js → funnel-pB5NegZB.js} +1 -1
- package/dist/renderer/assets/{heart-D7Mz04B0.js → heart-BT5laZ_b.js} +1 -1
- package/dist/renderer/assets/{index-CL1e8m3U.js → index-BYyDk28K.js} +2 -2
- package/dist/renderer/assets/{index-gZIRr4_o.js → index-zTUUYax3.js} +1 -1
- package/dist/renderer/assets/{pencil-C6gzDMse.js → pencil-C0thxLi6.js} +1 -1
- package/dist/renderer/assets/{play-DqTXX-Pr.js → play-CmZ0kWtt.js} +1 -1
- package/dist/renderer/assets/{plug-ykmbeaO3.js → plug-CeDQatBe.js} +1 -1
- package/dist/renderer/assets/{plus-DHE60vMX.js → plus-Di__xFOZ.js} +1 -1
- package/dist/renderer/assets/projects-B-pbhhtH.js +1 -0
- package/dist/renderer/assets/{save-CGIvrdQI.js → save-BDatCjfO.js} +1 -1
- package/dist/renderer/assets/{search-D7IFAwyE.js → search-DnTOjP0C.js} +1 -1
- package/dist/renderer/assets/{server-aOsirp7I.js → server-Ey_iHY6m.js} +1 -1
- package/dist/renderer/assets/{session-utils-Dxfp4ohQ.js → session-utils-DWaM7Rkr.js} +1 -1
- package/dist/renderer/assets/{sessions-Db1XPbG2.js → sessions-CYYjLD5I.js} +1 -1
- package/dist/renderer/assets/{shield-check-ChXeQK-d.js → shield-check-Br8BQzcn.js} +1 -1
- package/dist/renderer/assets/{trash-2-CfN-c1zw.js → trash-2-7YD616fw.js} +1 -1
- package/dist/renderer/assets/{user-C7OHaBp4.js → user-BR_5jmr9.js} +1 -1
- package/dist/renderer/assets/{wifi-off-CpaJigye.js → wifi-off-By9QdREz.js} +1 -1
- package/dist/renderer/index.html +1 -1
- package/dist-electron/services/local-ai-core/src/acp/local-core-acp-backend.js +28 -4
- package/dist-electron/services/local-ai-core/src/acp/local-core-acp-response-processor.js +2 -4
- package/dist-electron/services/local-ai-core/src/acp/local-core-acp-turn-coordinator.js +102 -15
- package/dist-electron/services/local-ai-core/src/agents/claudecode/behavior.js +5 -0
- package/dist-electron/services/local-ai-core/src/agents/claudecode/definition.js +36 -0
- package/dist-electron/services/local-ai-core/src/agents/claudecode/index.js +15 -0
- package/dist-electron/services/local-ai-core/src/agents/codex/behavior.js +5 -0
- package/dist-electron/services/local-ai-core/src/agents/codex/definition.js +24 -0
- package/dist-electron/services/local-ai-core/src/agents/codex/index.js +15 -0
- package/dist-electron/services/local-ai-core/src/agents/hermes/behavior.js +29 -0
- package/dist-electron/services/local-ai-core/src/agents/hermes/definition.js +22 -0
- package/dist-electron/services/local-ai-core/src/agents/hermes/index.js +15 -0
- package/dist-electron/services/local-ai-core/src/agents/index.js +98 -0
- package/dist-electron/services/local-ai-core/src/agents/localcore-acp/behavior.js +5 -0
- package/dist-electron/services/local-ai-core/src/agents/localcore-acp/definition.js +14 -0
- package/dist-electron/services/local-ai-core/src/agents/localcore-acp/index.js +27 -0
- package/dist-electron/services/local-ai-core/src/agents/opencode/behavior.js +5 -0
- package/dist-electron/services/local-ai-core/src/agents/opencode/definition.js +18 -0
- package/dist-electron/services/local-ai-core/src/agents/opencode/index.js +15 -0
- package/dist-electron/services/local-ai-core/src/agents/opencode/launch.js +119 -0
- package/dist-electron/services/local-ai-core/src/agents/pi/behavior.js +5 -0
- package/dist-electron/services/local-ai-core/src/agents/pi/definition.js +23 -0
- package/dist-electron/services/local-ai-core/src/agents/pi/index.js +15 -0
- package/dist-electron/services/local-ai-core/src/agents/pi/launch.js +139 -0
- package/dist-electron/services/local-ai-core/src/agents/shared/acp-behavior.js +11 -0
- package/dist-electron/services/local-ai-core/src/agents/shared/agent-plugin.js +60 -0
- package/dist-electron/services/local-ai-core/src/agents/shared/definition.js +12 -0
- package/dist-electron/services/local-ai-core/src/agents/shared/launch-utils.js +122 -0
- package/dist-electron/services/local-ai-core/src/agents/shared/progress-replay.js +19 -0
- package/dist-electron/services/local-ai-core/src/agents/shared/replay-prefix.js +68 -0
- package/dist-electron/services/local-ai-core/src/channel/lark/local-core-lark-gateway.js +0 -2
- package/dist-electron/services/local-ai-core/src/channel/weixin/local-core-weixin-gateway.js +0 -1
- package/dist-electron/services/local-ai-core/src/cli/lac.js +2 -1
- package/dist-electron/services/local-ai-core/src/kernel/bootstrap.js +17 -11
- package/dist-electron/services/local-ai-core/src/plugins/builtin/agent-localcore-acp-plugin.js +9 -130
- package/dist-electron/services/local-ai-core/src/router/workspace-route-config.js +22 -397
- package/dist-electron/services/local-ai-core/src/runtime/agent-runtime-detector.js +9 -45
- package/dist-electron/services/local-ai-core/src/runtime/local-core-controller.js +9 -4
- package/dist-electron/services/local-ai-core/src/runtime/local-core-runtime-state.js +62 -1
- package/dist-electron/services/local-ai-core/src/runtime/runtime-detection-service.js +2 -12
- package/dist-electron/services/local-ai-core/src/scheduler/lark-schedule-adapter.js +16 -7
- package/dist-electron/services/local-ai-core/src/scheduler/local-schedule-adapter.js +10 -2
- package/dist-electron/services/local-ai-core/src/scheduler/scheduled-job-route.js +24 -0
- package/dist-electron/services/local-ai-core/src/scheduler/weixin-schedule-adapter.js +15 -6
- package/dist-electron/shared/desktop.js +3 -1
- package/dist-electron/src/pages/Threads/thread-chat-model.js +27 -18
- package/dist-electron/src/pages/Threads/thread-chat-permission.test.js +57 -18
- package/dist-electron/{electron → tests/contracts}/local-core-contracts.test.js +1 -1
- package/dist-electron/{electron → tests/electron}/agent-runtime-detector.test.js +31 -1
- package/dist-electron/{electron → tests/electron}/lac-cli.test.js +6 -3
- package/dist-electron/{electron → tests/electron}/plugin-kernel.test.js +93 -13
- package/dist-electron/{electron → tests/electron}/renderer-packaging.test.js +11 -6
- package/dist-electron/{electron → tests/electron}/runtime-detection-service.test.js +1 -1
- package/dist-electron/{electron → tests/electron}/security-approval-store.test.js +2 -2
- package/dist-electron/{electron → tests/electron}/workspace-task-store.test.js +95 -7
- package/dist-electron/{electron → tests/integration}/channel-content.test.js +2 -2
- package/dist-electron/{electron → tests/integration}/local-core-acp-content.test.js +1 -1
- package/dist-electron/{electron → tests/integration}/local-core-refactor.test.js +437 -15
- package/package.json +3 -2
- package/dist/renderer/assets/ThreadChat-BCdbTxBo.js +0 -23
- package/dist/renderer/assets/projects-Bx5p10th.js +0 -1
- /package/dist-electron/{electron → tests/contracts}/architecture-docs.test.js +0 -0
- /package/dist-electron/{electron → tests/electron}/knowledge-skill-script.test.js +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hermesAgentDefinition = void 0;
|
|
4
|
+
const behavior_js_1 = require("./behavior.js");
|
|
5
|
+
exports.hermesAgentDefinition = {
|
|
6
|
+
agentType: 'hermes',
|
|
7
|
+
displayName: 'Hermes',
|
|
8
|
+
behavior: behavior_js_1.hermesAcpBehavior,
|
|
9
|
+
detection: {
|
|
10
|
+
commandCandidates: ['hermes'],
|
|
11
|
+
versionArgs: ['--version'],
|
|
12
|
+
},
|
|
13
|
+
buildLaunchConfig() {
|
|
14
|
+
return {
|
|
15
|
+
command: 'hermes',
|
|
16
|
+
args: ['acp'],
|
|
17
|
+
env: {
|
|
18
|
+
HERMES_YOLO_MODE: '1',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hermesAgentDefinition = exports.hermesAcpBehavior = void 0;
|
|
4
|
+
exports.createBuiltinHermesAgentPlugin = createBuiltinHermesAgentPlugin;
|
|
5
|
+
const agent_plugin_js_1 = require("../shared/agent-plugin.js");
|
|
6
|
+
const behavior_js_1 = require("./behavior.js");
|
|
7
|
+
Object.defineProperty(exports, "hermesAcpBehavior", { enumerable: true, get: function () { return behavior_js_1.hermesAcpBehavior; } });
|
|
8
|
+
const definition_js_1 = require("./definition.js");
|
|
9
|
+
Object.defineProperty(exports, "hermesAgentDefinition", { enumerable: true, get: function () { return definition_js_1.hermesAgentDefinition; } });
|
|
10
|
+
function createBuiltinHermesAgentPlugin() {
|
|
11
|
+
return (0, agent_plugin_js_1.createBuiltinAgentPlugin)({
|
|
12
|
+
definition: definition_js_1.hermesAgentDefinition,
|
|
13
|
+
match: (normalizedAgentType) => normalizedAgentType === 'hermes',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createBuiltinPiAgentPlugin = exports.createBuiltinOpencodeAgentPlugin = exports.createBuiltinLocalCoreAcpAgentPlugin = exports.createBuiltinHermesAgentPlugin = exports.createBuiltinClaudeCodeAgentPlugin = exports.createBuiltinCodexAgentPlugin = void 0;
|
|
4
|
+
exports.getAgentRuntimeDefinitions = getAgentRuntimeDefinitions;
|
|
5
|
+
exports.getStaticAgentRuntimeDefinitions = getStaticAgentRuntimeDefinitions;
|
|
6
|
+
exports.resolveAgentRuntimeDefinition = resolveAgentRuntimeDefinition;
|
|
7
|
+
exports.resolveAgentAcpBehavior = resolveAgentAcpBehavior;
|
|
8
|
+
exports.createBuiltinStaticAgentCapabilityPlugin = createBuiltinStaticAgentCapabilityPlugin;
|
|
9
|
+
const acp_behavior_js_1 = require("./shared/acp-behavior.js");
|
|
10
|
+
const definition_js_1 = require("./shared/definition.js");
|
|
11
|
+
const index_js_1 = require("./codex/index.js");
|
|
12
|
+
const index_js_2 = require("./claudecode/index.js");
|
|
13
|
+
const index_js_3 = require("./hermes/index.js");
|
|
14
|
+
const index_js_4 = require("./localcore-acp/index.js");
|
|
15
|
+
const index_js_5 = require("./opencode/index.js");
|
|
16
|
+
const index_js_6 = require("./pi/index.js");
|
|
17
|
+
const STATIC_AGENT_DEFINITIONS = [
|
|
18
|
+
{
|
|
19
|
+
agentType: 'cursor',
|
|
20
|
+
displayName: 'Cursor',
|
|
21
|
+
behavior: acp_behavior_js_1.standardAcpBehavior,
|
|
22
|
+
detection: { commandCandidates: ['cursor-agent', 'cursor'], versionArgs: ['--version'] },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
agentType: 'gemini',
|
|
26
|
+
displayName: 'Gemini',
|
|
27
|
+
behavior: acp_behavior_js_1.standardAcpBehavior,
|
|
28
|
+
detection: { commandCandidates: ['gemini'], versionArgs: ['--version'] },
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
agentType: 'qoder',
|
|
32
|
+
displayName: 'Qoder',
|
|
33
|
+
behavior: acp_behavior_js_1.standardAcpBehavior,
|
|
34
|
+
detection: { commandCandidates: ['qoder'], versionArgs: ['--version'] },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
agentType: 'iflow',
|
|
38
|
+
displayName: 'iFlow',
|
|
39
|
+
behavior: acp_behavior_js_1.standardAcpBehavior,
|
|
40
|
+
detection: { commandCandidates: ['iflow'], versionArgs: ['--version'] },
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
const AGENT_RUNTIME_DEFINITIONS = [
|
|
44
|
+
index_js_6.piAgentDefinition,
|
|
45
|
+
index_js_5.opencodeAgentDefinition,
|
|
46
|
+
index_js_1.codexAgentDefinition,
|
|
47
|
+
index_js_2.claudeCodeAgentDefinition,
|
|
48
|
+
index_js_3.hermesAgentDefinition,
|
|
49
|
+
index_js_4.localCoreAcpAgentDefinition,
|
|
50
|
+
...STATIC_AGENT_DEFINITIONS,
|
|
51
|
+
];
|
|
52
|
+
const AGENT_RUNTIME_DEFINITIONS_BY_TYPE = new Map(AGENT_RUNTIME_DEFINITIONS.map((definition) => [definition.agentType, definition]));
|
|
53
|
+
function getAgentRuntimeDefinitions() {
|
|
54
|
+
return [...AGENT_RUNTIME_DEFINITIONS];
|
|
55
|
+
}
|
|
56
|
+
function getStaticAgentRuntimeDefinitions() {
|
|
57
|
+
return [...STATIC_AGENT_DEFINITIONS];
|
|
58
|
+
}
|
|
59
|
+
function resolveAgentRuntimeDefinition(agentType) {
|
|
60
|
+
const normalized = (0, definition_js_1.normalizeAgentType)(agentType);
|
|
61
|
+
return AGENT_RUNTIME_DEFINITIONS_BY_TYPE.get(normalized)
|
|
62
|
+
|| AGENT_RUNTIME_DEFINITIONS.find((definition) => (0, definition_js_1.agentDefinitionMatches)(definition, normalized))
|
|
63
|
+
|| null;
|
|
64
|
+
}
|
|
65
|
+
function resolveAgentAcpBehavior(agentType) {
|
|
66
|
+
return resolveAgentRuntimeDefinition(agentType)?.behavior || acp_behavior_js_1.standardAcpBehavior;
|
|
67
|
+
}
|
|
68
|
+
function createBuiltinStaticAgentCapabilityPlugin(agentType, displayName = agentType) {
|
|
69
|
+
return {
|
|
70
|
+
manifest: {
|
|
71
|
+
id: `builtin.agent-${agentType}`,
|
|
72
|
+
kind: 'agent',
|
|
73
|
+
version: '0.1.0',
|
|
74
|
+
provides: [`agent:${agentType}`],
|
|
75
|
+
},
|
|
76
|
+
capabilities: {
|
|
77
|
+
agents: [
|
|
78
|
+
{
|
|
79
|
+
id: `agent.${agentType}`,
|
|
80
|
+
agentType,
|
|
81
|
+
displayName,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
var index_js_7 = require("./codex/index.js");
|
|
88
|
+
Object.defineProperty(exports, "createBuiltinCodexAgentPlugin", { enumerable: true, get: function () { return index_js_7.createBuiltinCodexAgentPlugin; } });
|
|
89
|
+
var index_js_8 = require("./claudecode/index.js");
|
|
90
|
+
Object.defineProperty(exports, "createBuiltinClaudeCodeAgentPlugin", { enumerable: true, get: function () { return index_js_8.createBuiltinClaudeCodeAgentPlugin; } });
|
|
91
|
+
var index_js_9 = require("./hermes/index.js");
|
|
92
|
+
Object.defineProperty(exports, "createBuiltinHermesAgentPlugin", { enumerable: true, get: function () { return index_js_9.createBuiltinHermesAgentPlugin; } });
|
|
93
|
+
var index_js_10 = require("./localcore-acp/index.js");
|
|
94
|
+
Object.defineProperty(exports, "createBuiltinLocalCoreAcpAgentPlugin", { enumerable: true, get: function () { return index_js_10.createBuiltinLocalCoreAcpAgentPlugin; } });
|
|
95
|
+
var index_js_11 = require("./opencode/index.js");
|
|
96
|
+
Object.defineProperty(exports, "createBuiltinOpencodeAgentPlugin", { enumerable: true, get: function () { return index_js_11.createBuiltinOpencodeAgentPlugin; } });
|
|
97
|
+
var index_js_12 = require("./pi/index.js");
|
|
98
|
+
Object.defineProperty(exports, "createBuiltinPiAgentPlugin", { enumerable: true, get: function () { return index_js_12.createBuiltinPiAgentPlugin; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.localCoreAcpAgentDefinition = void 0;
|
|
4
|
+
const desktop_js_1 = require("../../../../../shared/desktop.js");
|
|
5
|
+
const behavior_js_1 = require("./behavior.js");
|
|
6
|
+
exports.localCoreAcpAgentDefinition = {
|
|
7
|
+
agentType: desktop_js_1.LOCALCORE_ACP_AGENT_TYPE,
|
|
8
|
+
aliases: ['acp', ''],
|
|
9
|
+
displayName: 'LocalCore ACP',
|
|
10
|
+
behavior: behavior_js_1.localCoreAcpBehavior,
|
|
11
|
+
detection: {
|
|
12
|
+
builtin: true,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.localCoreAcpAgentDefinition = exports.localCoreAcpBehavior = void 0;
|
|
4
|
+
exports.createBuiltinLocalCoreAcpAgentPlugin = createBuiltinLocalCoreAcpAgentPlugin;
|
|
5
|
+
const desktop_js_1 = require("../../../../../shared/desktop.js");
|
|
6
|
+
const agent_plugin_js_1 = require("../shared/agent-plugin.js");
|
|
7
|
+
const behavior_js_1 = require("./behavior.js");
|
|
8
|
+
Object.defineProperty(exports, "localCoreAcpBehavior", { enumerable: true, get: function () { return behavior_js_1.localCoreAcpBehavior; } });
|
|
9
|
+
const definition_js_1 = require("./definition.js");
|
|
10
|
+
Object.defineProperty(exports, "localCoreAcpAgentDefinition", { enumerable: true, get: function () { return definition_js_1.localCoreAcpAgentDefinition; } });
|
|
11
|
+
function createBuiltinLocalCoreAcpAgentPlugin() {
|
|
12
|
+
const plugin = (0, agent_plugin_js_1.createBuiltinAgentPlugin)({
|
|
13
|
+
definition: definition_js_1.localCoreAcpAgentDefinition,
|
|
14
|
+
match: (normalizedAgentType) => !normalizedAgentType || normalizedAgentType === 'acp' || normalizedAgentType === desktop_js_1.LOCALCORE_ACP_AGENT_TYPE,
|
|
15
|
+
});
|
|
16
|
+
plugin.capabilities = {
|
|
17
|
+
...plugin.capabilities,
|
|
18
|
+
channels: [
|
|
19
|
+
{
|
|
20
|
+
id: `channel.${desktop_js_1.LOCALCORE_ACP_AGENT_TYPE}`,
|
|
21
|
+
platform: desktop_js_1.LOCALCORE_ACP_AGENT_TYPE,
|
|
22
|
+
displayName: 'LocalCore ACP',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
return plugin;
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.opencodeAgentDefinition = void 0;
|
|
4
|
+
const behavior_js_1 = require("./behavior.js");
|
|
5
|
+
const launch_js_1 = require("./launch.js");
|
|
6
|
+
exports.opencodeAgentDefinition = {
|
|
7
|
+
agentType: 'opencode',
|
|
8
|
+
displayName: 'OpenCode',
|
|
9
|
+
behavior: behavior_js_1.opencodeAcpBehavior,
|
|
10
|
+
detection: {
|
|
11
|
+
commandCandidates: ['opencode'],
|
|
12
|
+
versionArgs: ['--version'],
|
|
13
|
+
},
|
|
14
|
+
resolveModel: launch_js_1.resolveOpencodeModel,
|
|
15
|
+
buildLaunchConfig(input) {
|
|
16
|
+
return (0, launch_js_1.buildOpencodeLaunchConfig)(input.model, input.providers);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.opencodeAgentDefinition = exports.opencodeAcpBehavior = void 0;
|
|
4
|
+
exports.createBuiltinOpencodeAgentPlugin = createBuiltinOpencodeAgentPlugin;
|
|
5
|
+
const agent_plugin_js_1 = require("../shared/agent-plugin.js");
|
|
6
|
+
const behavior_js_1 = require("./behavior.js");
|
|
7
|
+
Object.defineProperty(exports, "opencodeAcpBehavior", { enumerable: true, get: function () { return behavior_js_1.opencodeAcpBehavior; } });
|
|
8
|
+
const definition_js_1 = require("./definition.js");
|
|
9
|
+
Object.defineProperty(exports, "opencodeAgentDefinition", { enumerable: true, get: function () { return definition_js_1.opencodeAgentDefinition; } });
|
|
10
|
+
function createBuiltinOpencodeAgentPlugin() {
|
|
11
|
+
return (0, agent_plugin_js_1.createBuiltinAgentPlugin)({
|
|
12
|
+
definition: definition_js_1.opencodeAgentDefinition,
|
|
13
|
+
match: (normalizedAgentType) => normalizedAgentType === 'opencode',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveOpencodeModel = resolveOpencodeModel;
|
|
4
|
+
exports.buildOpencodeLaunchConfig = buildOpencodeLaunchConfig;
|
|
5
|
+
const desktop_js_1 = require("../../../../../shared/desktop.js");
|
|
6
|
+
const launch_utils_js_1 = require("../shared/launch-utils.js");
|
|
7
|
+
function resolveOpencodeModel(input) {
|
|
8
|
+
const configuredProviderModel = getFirstProviderModelRef(input.providers);
|
|
9
|
+
if (configuredProviderModel &&
|
|
10
|
+
(!input.rawModel || input.normalizedModel === desktop_js_1.DEFAULT_DESKTOP_OPENCODE_MODEL)) {
|
|
11
|
+
return configuredProviderModel;
|
|
12
|
+
}
|
|
13
|
+
return input.normalizedModel;
|
|
14
|
+
}
|
|
15
|
+
function buildOpencodeLaunchConfig(model, providers) {
|
|
16
|
+
const inlineConfig = buildOpencodeInlineConfig(model, providers);
|
|
17
|
+
return {
|
|
18
|
+
command: 'opencode',
|
|
19
|
+
args: ['acp'],
|
|
20
|
+
env: {
|
|
21
|
+
...(inlineConfig.env || {}),
|
|
22
|
+
OPENCODE_CONFIG_CONTENT: JSON.stringify(inlineConfig.config || { $schema: 'https://opencode.ai/config.json' }),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function getFirstProviderModelRef(providers) {
|
|
27
|
+
for (const provider of providers) {
|
|
28
|
+
const providerId = normalizeOpencodeProviderId(provider.name);
|
|
29
|
+
const modelId = (0, launch_utils_js_1.getProviderDefaultModelId)(provider);
|
|
30
|
+
if (providerId && modelId) {
|
|
31
|
+
return `${providerId}/${modelId}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return '';
|
|
35
|
+
}
|
|
36
|
+
function buildOpencodeInlineConfig(model, providers) {
|
|
37
|
+
const config = {
|
|
38
|
+
$schema: 'https://opencode.ai/config.json',
|
|
39
|
+
};
|
|
40
|
+
const env = {};
|
|
41
|
+
if (model) {
|
|
42
|
+
config.model = model;
|
|
43
|
+
}
|
|
44
|
+
const providerConfig = {};
|
|
45
|
+
for (const provider of providers) {
|
|
46
|
+
const providerId = normalizeOpencodeProviderId(provider.name);
|
|
47
|
+
if (!providerId) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const entry = {
|
|
51
|
+
name: String(provider.name || providerId),
|
|
52
|
+
};
|
|
53
|
+
if (shouldUseOpenAiCompatibleProvider(providerId)) {
|
|
54
|
+
entry.npm = '@ai-sdk/openai-compatible';
|
|
55
|
+
}
|
|
56
|
+
const options = {};
|
|
57
|
+
const baseUrl = String(provider.base_url || '').trim();
|
|
58
|
+
if (baseUrl) {
|
|
59
|
+
options.baseURL = baseUrl;
|
|
60
|
+
}
|
|
61
|
+
const apiKey = String(provider.api_key || '').trim();
|
|
62
|
+
if (apiKey) {
|
|
63
|
+
const envName = opencodeProviderApiKeyEnvName(providerId);
|
|
64
|
+
env[envName] = apiKey;
|
|
65
|
+
options.apiKey = `{env:${envName}}`;
|
|
66
|
+
}
|
|
67
|
+
if (Object.keys(options).length > 0) {
|
|
68
|
+
entry.options = options;
|
|
69
|
+
}
|
|
70
|
+
const models = buildOpencodeProviderModels(provider);
|
|
71
|
+
if (Object.keys(models).length > 0) {
|
|
72
|
+
entry.models = models;
|
|
73
|
+
}
|
|
74
|
+
providerConfig[providerId] = entry;
|
|
75
|
+
}
|
|
76
|
+
if (Object.keys(providerConfig).length > 0) {
|
|
77
|
+
config.provider = providerConfig;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
config,
|
|
81
|
+
env,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function buildOpencodeProviderModels(provider) {
|
|
85
|
+
const models = {};
|
|
86
|
+
const addModel = (model, alias) => {
|
|
87
|
+
const modelId = String(model || '').trim();
|
|
88
|
+
if (!modelId || models[modelId]) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
models[modelId] = {
|
|
92
|
+
name: String(alias || modelId).trim() || modelId,
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
addModel(provider.model);
|
|
96
|
+
for (const model of Array.isArray(provider.models) ? provider.models : []) {
|
|
97
|
+
addModel(model?.model, model?.alias);
|
|
98
|
+
}
|
|
99
|
+
return models;
|
|
100
|
+
}
|
|
101
|
+
function normalizeOpencodeProviderId(value) {
|
|
102
|
+
return String(value || '')
|
|
103
|
+
.trim()
|
|
104
|
+
.toLowerCase()
|
|
105
|
+
.replace(/[^a-z0-9._-]+/g, '-')
|
|
106
|
+
.replace(/^-+|-+$/g, '');
|
|
107
|
+
}
|
|
108
|
+
function opencodeProviderApiKeyEnvName(providerId) {
|
|
109
|
+
const suffix = providerId.toUpperCase().replace(/[^A-Z0-9]+/g, '_').replace(/^_+|_+$/g, '');
|
|
110
|
+
return `AI_WORKSTATION_OPENCODE_${suffix || 'PROVIDER'}_API_KEY`;
|
|
111
|
+
}
|
|
112
|
+
function shouldUseOpenAiCompatibleProvider(providerId) {
|
|
113
|
+
const builtInNonCompatibleProviders = new Set([
|
|
114
|
+
'anthropic',
|
|
115
|
+
'google',
|
|
116
|
+
'gemini',
|
|
117
|
+
]);
|
|
118
|
+
return !builtInNonCompatibleProviders.has(providerId);
|
|
119
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.piAgentDefinition = void 0;
|
|
4
|
+
const desktop_js_1 = require("../../../../../shared/desktop.js");
|
|
5
|
+
const behavior_js_1 = require("./behavior.js");
|
|
6
|
+
const launch_js_1 = require("./launch.js");
|
|
7
|
+
exports.piAgentDefinition = {
|
|
8
|
+
agentType: 'pi',
|
|
9
|
+
displayName: 'Pi',
|
|
10
|
+
behavior: behavior_js_1.piAcpBehavior,
|
|
11
|
+
detection: {
|
|
12
|
+
commandCandidates: ['pi'],
|
|
13
|
+
versionArgs: ['--version'],
|
|
14
|
+
bundledRuntimes: [
|
|
15
|
+
{
|
|
16
|
+
packageName: desktop_js_1.DESKTOP_PI_CODING_AGENT_PACKAGE,
|
|
17
|
+
candidates: ['dist/cli.js'],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
resolveModel: launch_js_1.resolvePiModel,
|
|
22
|
+
buildLaunchConfig: launch_js_1.buildPiLaunchConfig,
|
|
23
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.piAgentDefinition = exports.piAcpBehavior = void 0;
|
|
4
|
+
exports.createBuiltinPiAgentPlugin = createBuiltinPiAgentPlugin;
|
|
5
|
+
const agent_plugin_js_1 = require("../shared/agent-plugin.js");
|
|
6
|
+
const behavior_js_1 = require("./behavior.js");
|
|
7
|
+
Object.defineProperty(exports, "piAcpBehavior", { enumerable: true, get: function () { return behavior_js_1.piAcpBehavior; } });
|
|
8
|
+
const definition_js_1 = require("./definition.js");
|
|
9
|
+
Object.defineProperty(exports, "piAgentDefinition", { enumerable: true, get: function () { return definition_js_1.piAgentDefinition; } });
|
|
10
|
+
function createBuiltinPiAgentPlugin() {
|
|
11
|
+
return (0, agent_plugin_js_1.createBuiltinAgentPlugin)({
|
|
12
|
+
definition: definition_js_1.piAgentDefinition,
|
|
13
|
+
match: (normalizedAgentType) => normalizedAgentType === 'pi',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvePiModel = resolvePiModel;
|
|
4
|
+
exports.buildPiLaunchConfig = buildPiLaunchConfig;
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const desktop_js_1 = require("../../../../../shared/desktop.js");
|
|
7
|
+
const launch_utils_js_1 = require("../shared/launch-utils.js");
|
|
8
|
+
function resolvePiModel(input) {
|
|
9
|
+
return input.rawModel || (0, launch_utils_js_1.getFirstProviderModelId)(input.providers);
|
|
10
|
+
}
|
|
11
|
+
function buildPiLaunchConfig(input) {
|
|
12
|
+
const bundledPiAcp = (0, launch_utils_js_1.resolveBundledAcpCommand)(desktop_js_1.DESKTOP_PI_ACP_PACKAGE, 'pi-acp');
|
|
13
|
+
const bundledPiCommand = (0, launch_utils_js_1.resolveBundledAcpCommand)(desktop_js_1.DESKTOP_PI_CODING_AGENT_PACKAGE, 'pi').args[0];
|
|
14
|
+
return {
|
|
15
|
+
command: bundledPiAcp.command,
|
|
16
|
+
args: [...bundledPiAcp.args],
|
|
17
|
+
env: {
|
|
18
|
+
...collectPiProviderEnv(input.providers),
|
|
19
|
+
...writePiProviderRuntimeConfig(input),
|
|
20
|
+
PI_ACP_PI_COMMAND: bundledPiCommand,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function collectPiProviderEnv(providers) {
|
|
25
|
+
const env = {};
|
|
26
|
+
for (const provider of providers) {
|
|
27
|
+
const apiKey = String(provider.api_key || '').trim();
|
|
28
|
+
const envName = piProviderApiKeyEnvName(provider.name);
|
|
29
|
+
if (apiKey && envName) {
|
|
30
|
+
env[envName] = apiKey;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return env;
|
|
34
|
+
}
|
|
35
|
+
function writePiProviderRuntimeConfig(input) {
|
|
36
|
+
if (input.providers.length === 0) {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
const { providerId, modelId } = resolvePiProviderModel(input.providers, input.model);
|
|
40
|
+
const agentDir = (0, launch_utils_js_1.projectLocalStateDir)(input.configState, '.pi-agent', input.project.name);
|
|
41
|
+
(0, launch_utils_js_1.ensurePrivateDir)(agentDir);
|
|
42
|
+
const auth = {};
|
|
43
|
+
const modelProviders = {};
|
|
44
|
+
for (const provider of input.providers) {
|
|
45
|
+
const id = normalizePiProviderId(provider.name);
|
|
46
|
+
if (!id) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const apiKey = String(provider.api_key || '').trim();
|
|
50
|
+
const baseUrl = String(provider.base_url || '').trim();
|
|
51
|
+
if (apiKey) {
|
|
52
|
+
auth[id] = { type: 'api_key', key: apiKey };
|
|
53
|
+
}
|
|
54
|
+
if (baseUrl || apiKey) {
|
|
55
|
+
modelProviders[id] = {
|
|
56
|
+
name: String(provider.name || id).trim() || id,
|
|
57
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
58
|
+
...(apiKey ? { apiKey } : {}),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
(0, launch_utils_js_1.writeJsonFile)((0, node_path_1.resolve)(agentDir, 'auth.json'), auth);
|
|
63
|
+
(0, launch_utils_js_1.writeJsonFile)((0, node_path_1.resolve)(agentDir, 'models.json'), { providers: modelProviders });
|
|
64
|
+
(0, launch_utils_js_1.writeJsonFile)((0, node_path_1.resolve)(agentDir, 'settings.json'), {
|
|
65
|
+
...(providerId ? { defaultProvider: providerId } : {}),
|
|
66
|
+
...(modelId ? { defaultModel: modelId } : {}),
|
|
67
|
+
quietStartup: true,
|
|
68
|
+
}, 0o644);
|
|
69
|
+
return {
|
|
70
|
+
PI_CODING_AGENT_DIR: agentDir,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function resolvePiProviderModel(providers, model) {
|
|
74
|
+
const [explicitProvider, explicitModel] = (0, launch_utils_js_1.splitProviderModelRef)(model);
|
|
75
|
+
if (explicitProvider && explicitModel) {
|
|
76
|
+
return {
|
|
77
|
+
providerId: normalizePiProviderId(explicitProvider),
|
|
78
|
+
modelId: explicitModel,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
for (const provider of providers) {
|
|
82
|
+
const providerId = normalizePiProviderId(provider.name);
|
|
83
|
+
const modelId = (0, launch_utils_js_1.getProviderDefaultModelId)(provider);
|
|
84
|
+
if (providerId && modelId && (!model || model === modelId)) {
|
|
85
|
+
return { providerId, modelId };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const fallbackProvider = providers.find((provider) => normalizePiProviderId(provider.name));
|
|
89
|
+
return {
|
|
90
|
+
providerId: normalizePiProviderId(fallbackProvider?.name),
|
|
91
|
+
modelId: model,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function normalizePiProviderId(providerName) {
|
|
95
|
+
const providerId = (0, launch_utils_js_1.normalizeProviderId)(providerName);
|
|
96
|
+
const aliases = {
|
|
97
|
+
google: 'google',
|
|
98
|
+
gemini: 'google',
|
|
99
|
+
kimi: 'kimi-coding',
|
|
100
|
+
moonshot: 'moonshotai',
|
|
101
|
+
zhipuai: 'zai',
|
|
102
|
+
};
|
|
103
|
+
return aliases[providerId] || providerId;
|
|
104
|
+
}
|
|
105
|
+
function piProviderApiKeyEnvName(providerName) {
|
|
106
|
+
const providerId = (0, launch_utils_js_1.normalizeProviderId)(providerName);
|
|
107
|
+
const envNames = {
|
|
108
|
+
anthropic: 'ANTHROPIC_API_KEY',
|
|
109
|
+
'azure-openai': 'AZURE_OPENAI_API_KEY',
|
|
110
|
+
'azure-openai-responses': 'AZURE_OPENAI_API_KEY',
|
|
111
|
+
cerebras: 'CEREBRAS_API_KEY',
|
|
112
|
+
cloudflare: 'CLOUDFLARE_API_KEY',
|
|
113
|
+
'cloudflare-ai-gateway': 'CLOUDFLARE_API_KEY',
|
|
114
|
+
'cloudflare-workers-ai': 'CLOUDFLARE_API_KEY',
|
|
115
|
+
deepseek: 'DEEPSEEK_API_KEY',
|
|
116
|
+
fireworks: 'FIREWORKS_API_KEY',
|
|
117
|
+
gemini: 'GEMINI_API_KEY',
|
|
118
|
+
google: 'GEMINI_API_KEY',
|
|
119
|
+
groq: 'GROQ_API_KEY',
|
|
120
|
+
huggingface: 'HF_TOKEN',
|
|
121
|
+
kimi: 'KIMI_API_KEY',
|
|
122
|
+
'kimi-coding': 'KIMI_API_KEY',
|
|
123
|
+
minimax: 'MINIMAX_API_KEY',
|
|
124
|
+
'minimax-cn': 'MINIMAX_CN_API_KEY',
|
|
125
|
+
mistral: 'MISTRAL_API_KEY',
|
|
126
|
+
moonshot: 'KIMI_API_KEY',
|
|
127
|
+
openai: 'OPENAI_API_KEY',
|
|
128
|
+
opencode: 'OPENCODE_API_KEY',
|
|
129
|
+
'opencode-go': 'OPENCODE_API_KEY',
|
|
130
|
+
openrouter: 'OPENROUTER_API_KEY',
|
|
131
|
+
siliconflow: 'SILICONFLOW_API_KEY',
|
|
132
|
+
vercel: 'AI_GATEWAY_API_KEY',
|
|
133
|
+
'vercel-ai-gateway': 'AI_GATEWAY_API_KEY',
|
|
134
|
+
xai: 'XAI_API_KEY',
|
|
135
|
+
zai: 'ZAI_API_KEY',
|
|
136
|
+
zhipuai: 'ZAI_API_KEY',
|
|
137
|
+
};
|
|
138
|
+
return envNames[providerId] || '';
|
|
139
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.standardAcpBehavior = void 0;
|
|
4
|
+
exports.standardAcpBehavior = {
|
|
5
|
+
normalizeAssistantText(input) {
|
|
6
|
+
return input.rawText;
|
|
7
|
+
},
|
|
8
|
+
normalizeFinalAssistantText(input) {
|
|
9
|
+
return input.rawText;
|
|
10
|
+
},
|
|
11
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createBuiltinAgentPlugin = createBuiltinAgentPlugin;
|
|
4
|
+
const desktop_js_1 = require("../../../../../shared/desktop.js");
|
|
5
|
+
const workspace_route_config_js_1 = require("../../router/workspace-route-config.js");
|
|
6
|
+
function createRuntime(agentType, match, displayName) {
|
|
7
|
+
return {
|
|
8
|
+
agentType,
|
|
9
|
+
transport: desktop_js_1.LOCALCORE_ACP_AGENT_TYPE,
|
|
10
|
+
displayName: displayName || agentType,
|
|
11
|
+
matchesProject(project) {
|
|
12
|
+
const normalizedAgentType = String(project.agent?.type || '').trim().toLowerCase();
|
|
13
|
+
return match(normalizedAgentType);
|
|
14
|
+
},
|
|
15
|
+
createRoute(configState, project) {
|
|
16
|
+
if (!this.matchesProject(project)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
kind: desktop_js_1.LOCALCORE_ACP_AGENT_TYPE,
|
|
21
|
+
agentType,
|
|
22
|
+
transport: desktop_js_1.LOCALCORE_ACP_AGENT_TYPE,
|
|
23
|
+
config: {
|
|
24
|
+
...(0, workspace_route_config_js_1.toLocalCoreProjectConfig)(configState, project),
|
|
25
|
+
agentType,
|
|
26
|
+
},
|
|
27
|
+
supportsStreamingProbe: true,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function createBuiltinAgentPlugin(options) {
|
|
33
|
+
const agentType = options.definition?.agentType || options.agentType || '';
|
|
34
|
+
const displayName = options.definition?.displayName || options.displayName || agentType;
|
|
35
|
+
const pluginId = options.pluginId || `builtin.agent-${agentType}`;
|
|
36
|
+
let runtime = null;
|
|
37
|
+
return {
|
|
38
|
+
manifest: {
|
|
39
|
+
id: pluginId,
|
|
40
|
+
kind: 'agent',
|
|
41
|
+
version: '0.1.0',
|
|
42
|
+
provides: [`agent:${agentType}`],
|
|
43
|
+
},
|
|
44
|
+
capabilities: {
|
|
45
|
+
agents: [
|
|
46
|
+
{
|
|
47
|
+
id: `agent.${agentType}`,
|
|
48
|
+
agentType,
|
|
49
|
+
displayName,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
createRuntime(_ctx) {
|
|
54
|
+
if (!runtime) {
|
|
55
|
+
runtime = createRuntime(agentType, options.match, displayName);
|
|
56
|
+
}
|
|
57
|
+
return { runtime };
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeAgentType = normalizeAgentType;
|
|
4
|
+
exports.agentDefinitionMatches = agentDefinitionMatches;
|
|
5
|
+
function normalizeAgentType(value) {
|
|
6
|
+
return String(value || '').trim().toLowerCase();
|
|
7
|
+
}
|
|
8
|
+
function agentDefinitionMatches(definition, agentType) {
|
|
9
|
+
const normalized = normalizeAgentType(agentType);
|
|
10
|
+
return normalized === definition.agentType
|
|
11
|
+
|| Boolean(definition.aliases?.some((alias) => normalizeAgentType(alias) === normalized));
|
|
12
|
+
}
|