@ycodium-ai/agent-dsh 0.2.2996 → 0.2.3000
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/index.js +141 -142
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -31661,6 +31661,9 @@ function asTrimmedString(value) {
|
|
|
31661
31661
|
const trimmed = value.trim();
|
|
31662
31662
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
31663
31663
|
}
|
|
31664
|
+
function readAcpText(source, key) {
|
|
31665
|
+
return asTrimmedString(source?.[key]);
|
|
31666
|
+
}
|
|
31664
31667
|
var selectPromptTurnId = (input2, activeTurnId, freshTurnId) => {
|
|
31665
31668
|
const target = input2.expectedActiveTurnId;
|
|
31666
31669
|
if (target === void 0) return input2.turnId ?? activeTurnId ?? freshTurnId();
|
|
@@ -31880,141 +31883,7 @@ function deriveToolActivityPresentation(input2) {
|
|
|
31880
31883
|
};
|
|
31881
31884
|
}
|
|
31882
31885
|
|
|
31883
|
-
// ../../packages/ycodium-acp-executor/src/
|
|
31884
|
-
function extractModelConfigId(sessionResponse) {
|
|
31885
|
-
const configOptions = sessionResponse.configOptions;
|
|
31886
|
-
if (!configOptions) return void 0;
|
|
31887
|
-
for (const opt of configOptions) {
|
|
31888
|
-
if (opt.category === "model" && opt.id.trim().length > 0) {
|
|
31889
|
-
return opt.id.trim();
|
|
31890
|
-
}
|
|
31891
|
-
}
|
|
31892
|
-
return configOptions.find((opt) => opt.id.trim() === "model" && opt.type === "select") ? "model" : void 0;
|
|
31893
|
-
}
|
|
31894
|
-
function findSessionConfigOption(configOptions, configId) {
|
|
31895
|
-
if (!configOptions) {
|
|
31896
|
-
return void 0;
|
|
31897
|
-
}
|
|
31898
|
-
const normalizedConfigId = configId.trim();
|
|
31899
|
-
if (!normalizedConfigId) {
|
|
31900
|
-
return void 0;
|
|
31901
|
-
}
|
|
31902
|
-
return configOptions.find((option) => option.id.trim() === normalizedConfigId);
|
|
31903
|
-
}
|
|
31904
|
-
function collectSessionConfigOptionValues(configOption) {
|
|
31905
|
-
if (configOption.type !== "select" || !configOption.options) {
|
|
31906
|
-
return [];
|
|
31907
|
-
}
|
|
31908
|
-
return configOption.options.flatMap(
|
|
31909
|
-
(entry) => "value" in entry ? [entry.value] : entry.options.map((option) => option.value)
|
|
31910
|
-
);
|
|
31911
|
-
}
|
|
31912
|
-
function collectSessionModelIds(models) {
|
|
31913
|
-
if (!isRecord3(models) || !Array.isArray(models["availableModels"])) {
|
|
31914
|
-
return [];
|
|
31915
|
-
}
|
|
31916
|
-
return models["availableModels"].flatMap(
|
|
31917
|
-
(model) => isRecord3(model) && typeof model["modelId"] === "string" ? [model["modelId"]] : []
|
|
31918
|
-
);
|
|
31919
|
-
}
|
|
31920
|
-
function catalogModelLastSegment(value) {
|
|
31921
|
-
if (value.startsWith("[")) {
|
|
31922
|
-
let parsed;
|
|
31923
|
-
try {
|
|
31924
|
-
parsed = JSON.parse(value);
|
|
31925
|
-
} catch {
|
|
31926
|
-
return void 0;
|
|
31927
|
-
}
|
|
31928
|
-
if (!Array.isArray(parsed) || parsed.length < 2) return void 0;
|
|
31929
|
-
const last = parsed[parsed.length - 1];
|
|
31930
|
-
return typeof last === "string" ? last : void 0;
|
|
31931
|
-
}
|
|
31932
|
-
const separator = value.indexOf("/");
|
|
31933
|
-
return separator > 0 && separator < value.length - 1 ? value.slice(separator + 1) : void 0;
|
|
31934
|
-
}
|
|
31935
|
-
function matchAdvertisedModelValue(requestedModelId, advertisedValues) {
|
|
31936
|
-
const wanted = requestedModelId.trim();
|
|
31937
|
-
if (!wanted) return void 0;
|
|
31938
|
-
if (advertisedValues.includes(wanted)) return wanted;
|
|
31939
|
-
const byLastSegment = advertisedValues.filter(
|
|
31940
|
-
(value) => catalogModelLastSegment(value) === wanted
|
|
31941
|
-
);
|
|
31942
|
-
return byLastSegment.length === 1 ? byLastSegment[0] : void 0;
|
|
31943
|
-
}
|
|
31944
|
-
function parseSessionModeState(sessionResponse) {
|
|
31945
|
-
const modes = sessionResponse.modes;
|
|
31946
|
-
if (!modes) return void 0;
|
|
31947
|
-
const currentModeId = modes.currentModeId.trim();
|
|
31948
|
-
if (!currentModeId) {
|
|
31949
|
-
return void 0;
|
|
31950
|
-
}
|
|
31951
|
-
const availableModes = [];
|
|
31952
|
-
for (const mode of modes.availableModes) {
|
|
31953
|
-
const id = mode.id.trim();
|
|
31954
|
-
const name = mode.name.trim();
|
|
31955
|
-
if (!id || !name) {
|
|
31956
|
-
continue;
|
|
31957
|
-
}
|
|
31958
|
-
const description = mode.description?.trim() || void 0;
|
|
31959
|
-
availableModes.push(
|
|
31960
|
-
description !== void 0 ? { id, name, description } : { id, name }
|
|
31961
|
-
);
|
|
31962
|
-
}
|
|
31963
|
-
if (availableModes.length === 0) {
|
|
31964
|
-
return void 0;
|
|
31965
|
-
}
|
|
31966
|
-
return {
|
|
31967
|
-
currentModeId,
|
|
31968
|
-
availableModes
|
|
31969
|
-
};
|
|
31970
|
-
}
|
|
31971
|
-
function acpCommandsToSlashCommands(commands) {
|
|
31972
|
-
return commands.map((command) => ({
|
|
31973
|
-
name: command.name,
|
|
31974
|
-
...command.description === void 0 ? {} : { description: command.description },
|
|
31975
|
-
...command.inputHint === void 0 ? {} : { input: { hint: command.inputHint } }
|
|
31976
|
-
}));
|
|
31977
|
-
}
|
|
31978
|
-
function parseAvailableCommandsUpdate(params) {
|
|
31979
|
-
const update = params.update;
|
|
31980
|
-
if (update["sessionUpdate"] !== "available_commands_update") {
|
|
31981
|
-
return void 0;
|
|
31982
|
-
}
|
|
31983
|
-
const availableCommands = update["availableCommands"];
|
|
31984
|
-
if (!Array.isArray(availableCommands)) {
|
|
31985
|
-
return [];
|
|
31986
|
-
}
|
|
31987
|
-
const commands = [];
|
|
31988
|
-
for (const command of availableCommands) {
|
|
31989
|
-
if (!isRecord3(command)) {
|
|
31990
|
-
continue;
|
|
31991
|
-
}
|
|
31992
|
-
const name = typeof command["name"] === "string" ? command["name"].trim() : "";
|
|
31993
|
-
if (!name) {
|
|
31994
|
-
continue;
|
|
31995
|
-
}
|
|
31996
|
-
const description = typeof command["description"] === "string" ? command["description"].trim() || void 0 : void 0;
|
|
31997
|
-
const input2 = isRecord3(command["input"]) ? command["input"] : void 0;
|
|
31998
|
-
const inputHint = typeof input2?.["hint"] === "string" ? input2["hint"].trim() || void 0 : void 0;
|
|
31999
|
-
commands.push({
|
|
32000
|
-
name,
|
|
32001
|
-
...description ? { description } : {},
|
|
32002
|
-
...inputHint ? { inputHint } : {}
|
|
32003
|
-
});
|
|
32004
|
-
}
|
|
32005
|
-
return commands;
|
|
32006
|
-
}
|
|
32007
|
-
function normalizePlanStepStatus(raw) {
|
|
32008
|
-
switch (raw) {
|
|
32009
|
-
case "completed":
|
|
32010
|
-
return "completed";
|
|
32011
|
-
case "in_progress":
|
|
32012
|
-
case "inProgress":
|
|
32013
|
-
return "inProgress";
|
|
32014
|
-
default:
|
|
32015
|
-
return "pending";
|
|
32016
|
-
}
|
|
32017
|
-
}
|
|
31886
|
+
// ../../packages/ycodium-acp-executor/src/tool-call-state.ts
|
|
32018
31887
|
function normalizeToolCallStatus(raw, fallback) {
|
|
32019
31888
|
switch (raw) {
|
|
32020
31889
|
case "pending":
|
|
@@ -32237,6 +32106,142 @@ function decideToolCallUpdateEmission(input2) {
|
|
|
32237
32106
|
}
|
|
32238
32107
|
return { emit: false, skippedSinceEmit: skippedSinceEmit + 1 };
|
|
32239
32108
|
}
|
|
32109
|
+
|
|
32110
|
+
// ../../packages/ycodium-acp-executor/src/runtime-model.ts
|
|
32111
|
+
function normalizePlanStepStatus(raw) {
|
|
32112
|
+
switch (raw) {
|
|
32113
|
+
case "completed":
|
|
32114
|
+
return "completed";
|
|
32115
|
+
case "in_progress":
|
|
32116
|
+
case "inProgress":
|
|
32117
|
+
return "inProgress";
|
|
32118
|
+
default:
|
|
32119
|
+
return "pending";
|
|
32120
|
+
}
|
|
32121
|
+
}
|
|
32122
|
+
function extractModelConfigId(sessionResponse) {
|
|
32123
|
+
const configOptions = sessionResponse.configOptions;
|
|
32124
|
+
if (!configOptions) return void 0;
|
|
32125
|
+
for (const opt of configOptions) {
|
|
32126
|
+
if (opt.category === "model" && opt.id.trim().length > 0) {
|
|
32127
|
+
return opt.id.trim();
|
|
32128
|
+
}
|
|
32129
|
+
}
|
|
32130
|
+
return configOptions.find((opt) => opt.id.trim() === "model" && opt.type === "select") ? "model" : void 0;
|
|
32131
|
+
}
|
|
32132
|
+
function findSessionConfigOption(configOptions, configId) {
|
|
32133
|
+
if (!configOptions) {
|
|
32134
|
+
return void 0;
|
|
32135
|
+
}
|
|
32136
|
+
const normalizedConfigId = configId.trim();
|
|
32137
|
+
if (!normalizedConfigId) {
|
|
32138
|
+
return void 0;
|
|
32139
|
+
}
|
|
32140
|
+
return configOptions.find((option) => option.id.trim() === normalizedConfigId);
|
|
32141
|
+
}
|
|
32142
|
+
function collectSessionConfigOptionValues(configOption) {
|
|
32143
|
+
if (configOption.type !== "select" || !configOption.options) {
|
|
32144
|
+
return [];
|
|
32145
|
+
}
|
|
32146
|
+
return configOption.options.flatMap(
|
|
32147
|
+
(entry) => "value" in entry ? [entry.value] : entry.options.map((option) => option.value)
|
|
32148
|
+
);
|
|
32149
|
+
}
|
|
32150
|
+
function collectSessionModelIds(models) {
|
|
32151
|
+
if (!isRecord3(models) || !Array.isArray(models["availableModels"])) {
|
|
32152
|
+
return [];
|
|
32153
|
+
}
|
|
32154
|
+
return models["availableModels"].flatMap(
|
|
32155
|
+
(model) => isRecord3(model) && typeof model["modelId"] === "string" ? [model["modelId"]] : []
|
|
32156
|
+
);
|
|
32157
|
+
}
|
|
32158
|
+
function catalogModelLastSegment(value) {
|
|
32159
|
+
if (value.startsWith("[")) {
|
|
32160
|
+
let parsed;
|
|
32161
|
+
try {
|
|
32162
|
+
parsed = JSON.parse(value);
|
|
32163
|
+
} catch {
|
|
32164
|
+
return void 0;
|
|
32165
|
+
}
|
|
32166
|
+
if (!Array.isArray(parsed) || parsed.length < 2) return void 0;
|
|
32167
|
+
const last = parsed[parsed.length - 1];
|
|
32168
|
+
return typeof last === "string" ? last : void 0;
|
|
32169
|
+
}
|
|
32170
|
+
const separator = value.indexOf("/");
|
|
32171
|
+
return separator > 0 && separator < value.length - 1 ? value.slice(separator + 1) : void 0;
|
|
32172
|
+
}
|
|
32173
|
+
function matchAdvertisedModelValue(requestedModelId, advertisedValues) {
|
|
32174
|
+
const wanted = requestedModelId.trim();
|
|
32175
|
+
if (!wanted) return void 0;
|
|
32176
|
+
if (advertisedValues.includes(wanted)) return wanted;
|
|
32177
|
+
const byLastSegment = advertisedValues.filter(
|
|
32178
|
+
(value) => catalogModelLastSegment(value) === wanted
|
|
32179
|
+
);
|
|
32180
|
+
return byLastSegment.length === 1 ? byLastSegment[0] : void 0;
|
|
32181
|
+
}
|
|
32182
|
+
function parseSessionModeState(sessionResponse) {
|
|
32183
|
+
const modes = sessionResponse.modes;
|
|
32184
|
+
if (!modes) return void 0;
|
|
32185
|
+
const currentModeId = modes.currentModeId.trim();
|
|
32186
|
+
if (!currentModeId) {
|
|
32187
|
+
return void 0;
|
|
32188
|
+
}
|
|
32189
|
+
const availableModes = [];
|
|
32190
|
+
for (const mode of modes.availableModes) {
|
|
32191
|
+
const id = mode.id.trim();
|
|
32192
|
+
const name = mode.name.trim();
|
|
32193
|
+
if (!id || !name) {
|
|
32194
|
+
continue;
|
|
32195
|
+
}
|
|
32196
|
+
const description = mode.description?.trim() || void 0;
|
|
32197
|
+
availableModes.push(
|
|
32198
|
+
description !== void 0 ? { id, name, description } : { id, name }
|
|
32199
|
+
);
|
|
32200
|
+
}
|
|
32201
|
+
if (availableModes.length === 0) {
|
|
32202
|
+
return void 0;
|
|
32203
|
+
}
|
|
32204
|
+
return {
|
|
32205
|
+
currentModeId,
|
|
32206
|
+
availableModes
|
|
32207
|
+
};
|
|
32208
|
+
}
|
|
32209
|
+
function acpCommandsToSlashCommands(commands) {
|
|
32210
|
+
return commands.map((command) => ({
|
|
32211
|
+
name: command.name,
|
|
32212
|
+
...command.description === void 0 ? {} : { description: command.description },
|
|
32213
|
+
...command.inputHint === void 0 ? {} : { input: { hint: command.inputHint } }
|
|
32214
|
+
}));
|
|
32215
|
+
}
|
|
32216
|
+
function parseAvailableCommandsUpdate(params) {
|
|
32217
|
+
const update = params.update;
|
|
32218
|
+
if (update["sessionUpdate"] !== "available_commands_update") {
|
|
32219
|
+
return void 0;
|
|
32220
|
+
}
|
|
32221
|
+
const availableCommands = update["availableCommands"];
|
|
32222
|
+
if (!Array.isArray(availableCommands)) {
|
|
32223
|
+
return [];
|
|
32224
|
+
}
|
|
32225
|
+
const commands = [];
|
|
32226
|
+
for (const command of availableCommands) {
|
|
32227
|
+
if (!isRecord3(command)) {
|
|
32228
|
+
continue;
|
|
32229
|
+
}
|
|
32230
|
+
const name = typeof command["name"] === "string" ? command["name"].trim() : "";
|
|
32231
|
+
if (!name) {
|
|
32232
|
+
continue;
|
|
32233
|
+
}
|
|
32234
|
+
const description = typeof command["description"] === "string" ? command["description"].trim() || void 0 : void 0;
|
|
32235
|
+
const input2 = isRecord3(command["input"]) ? command["input"] : void 0;
|
|
32236
|
+
const inputHint = typeof input2?.["hint"] === "string" ? input2["hint"].trim() || void 0 : void 0;
|
|
32237
|
+
commands.push({
|
|
32238
|
+
name,
|
|
32239
|
+
...description ? { description } : {},
|
|
32240
|
+
...inputHint ? { inputHint } : {}
|
|
32241
|
+
});
|
|
32242
|
+
}
|
|
32243
|
+
return commands;
|
|
32244
|
+
}
|
|
32240
32245
|
function parsePermissionRequest(params) {
|
|
32241
32246
|
const toolCall = makeToolCallState(
|
|
32242
32247
|
{
|
|
@@ -32276,12 +32281,6 @@ function boundToolCallRawPayload(params, update, toolCall) {
|
|
|
32276
32281
|
}
|
|
32277
32282
|
};
|
|
32278
32283
|
}
|
|
32279
|
-
function readAcpText(source, key) {
|
|
32280
|
-
const value = source?.[key];
|
|
32281
|
-
if (typeof value !== "string") return void 0;
|
|
32282
|
-
const trimmed = value.trim();
|
|
32283
|
-
return trimmed.length > 0 ? trimmed : void 0;
|
|
32284
|
-
}
|
|
32285
32284
|
function textFromContentBlocks(blocks) {
|
|
32286
32285
|
const parts = blocks.flatMap(
|
|
32287
32286
|
(block) => isRecord3(block) && block["type"] === "text" && typeof block["text"] === "string" ? [block["text"]] : []
|
|
@@ -35232,7 +35231,7 @@ var executors = [
|
|
|
35232
35231
|
];
|
|
35233
35232
|
var index_default = definePlugin({
|
|
35234
35233
|
id: "agent-dsh",
|
|
35235
|
-
apiVersion:
|
|
35234
|
+
apiVersion: 6,
|
|
35236
35235
|
executors,
|
|
35237
35236
|
activate(ctx) {
|
|
35238
35237
|
ctx.log.info("dsh executor ready");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-dsh",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3000",
|
|
4
4
|
"description": "DeepSeek Harness executor: dsh CLI over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"esbuild": "0.28.1",
|
|
23
23
|
"vite-plus": "0.2.2",
|
|
24
24
|
"yaml": "^2.9.0",
|
|
25
|
-
"ycodium-executor
|
|
26
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
27
|
-
"ycodium-
|
|
25
|
+
"ycodium-acp-executor": "0.2.3000",
|
|
26
|
+
"@ycodium-ai/plugin-api": "0.2.3000",
|
|
27
|
+
"ycodium-executor-testing": "0.0.0"
|
|
28
28
|
},
|
|
29
29
|
"ycodium": {
|
|
30
30
|
"plugin": "./dist/index.js",
|