@ycodium-ai/agent-acp 0.2.2690 → 0.2.2694
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 +33 -18
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -24875,6 +24875,13 @@ function parseSessionModeState(sessionResponse) {
|
|
|
24875
24875
|
availableModes
|
|
24876
24876
|
};
|
|
24877
24877
|
}
|
|
24878
|
+
function acpCommandsToSlashCommands(commands) {
|
|
24879
|
+
return commands.map((command) => ({
|
|
24880
|
+
name: command.name,
|
|
24881
|
+
...command.description === void 0 ? {} : { description: command.description },
|
|
24882
|
+
...command.inputHint === void 0 ? {} : { input: { hint: command.inputHint } }
|
|
24883
|
+
}));
|
|
24884
|
+
}
|
|
24878
24885
|
function parseAvailableCommandsUpdate(params) {
|
|
24879
24886
|
const update = params.update;
|
|
24880
24887
|
if (update["sessionUpdate"] !== "available_commands_update") {
|
|
@@ -25326,24 +25333,7 @@ function filterMcpServersByAgentCapabilities(mcpServers, agentCapabilities) {
|
|
|
25326
25333
|
});
|
|
25327
25334
|
}
|
|
25328
25335
|
|
|
25329
|
-
// ../../packages/ycodium-acp-executor/src/
|
|
25330
|
-
var defaultVendorHooks = {
|
|
25331
|
-
completedStopReason: (response) => response.stopReason
|
|
25332
|
-
};
|
|
25333
|
-
|
|
25334
|
-
// ../../packages/ycodium-acp-executor/src/executor.ts
|
|
25335
|
-
var DEFAULT_CANCEL_GRACE_MS = 5e3;
|
|
25336
|
-
var userInputAnswerOptionId = (question, answers) => {
|
|
25337
|
-
const answer = answers[question.id];
|
|
25338
|
-
const selected = typeof answer === "string" ? answer : Array.isArray(answer) && answer.length === 1 && typeof answer[0] === "string" ? answer[0] : void 0;
|
|
25339
|
-
return selected !== void 0 && question.options.some((option) => option.id === selected) ? selected : void 0;
|
|
25340
|
-
};
|
|
25341
|
-
function defaultNowIso() {
|
|
25342
|
-
return (/* @__PURE__ */ new Date()).toISOString();
|
|
25343
|
-
}
|
|
25344
|
-
function defaultRandomId() {
|
|
25345
|
-
return NodeCrypto.randomUUID();
|
|
25346
|
-
}
|
|
25336
|
+
// ../../packages/ycodium-acp-executor/src/model-selection.ts
|
|
25347
25337
|
function normalizeModelId(value) {
|
|
25348
25338
|
return value?.trim() || void 0;
|
|
25349
25339
|
}
|
|
@@ -25362,6 +25352,25 @@ function modelSelectionStateFromSetup(setup) {
|
|
|
25362
25352
|
advertisedModelValues: strategy === "config-option" ? modelConfigOption === void 0 ? [] : collectSessionConfigOptionValues(modelConfigOption) : collectSessionModelIds(sessionModels)
|
|
25363
25353
|
};
|
|
25364
25354
|
}
|
|
25355
|
+
|
|
25356
|
+
// ../../packages/ycodium-acp-executor/src/vendor-hooks.ts
|
|
25357
|
+
var defaultVendorHooks = {
|
|
25358
|
+
completedStopReason: (response) => response.stopReason
|
|
25359
|
+
};
|
|
25360
|
+
|
|
25361
|
+
// ../../packages/ycodium-acp-executor/src/executor.ts
|
|
25362
|
+
var DEFAULT_CANCEL_GRACE_MS = 5e3;
|
|
25363
|
+
var userInputAnswerOptionId = (question, answers) => {
|
|
25364
|
+
const answer = answers[question.id];
|
|
25365
|
+
const selected = typeof answer === "string" ? answer : Array.isArray(answer) && answer.length === 1 && typeof answer[0] === "string" ? answer[0] : void 0;
|
|
25366
|
+
return selected !== void 0 && question.options.some((option) => option.id === selected) ? selected : void 0;
|
|
25367
|
+
};
|
|
25368
|
+
function defaultNowIso() {
|
|
25369
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
25370
|
+
}
|
|
25371
|
+
function defaultRandomId() {
|
|
25372
|
+
return NodeCrypto.randomUUID();
|
|
25373
|
+
}
|
|
25365
25374
|
function createAcpExecutor(options) {
|
|
25366
25375
|
const hooks = { ...defaultVendorHooks, ...options.hooks };
|
|
25367
25376
|
const cancelGraceMs = options.cancelGraceMs ?? DEFAULT_CANCEL_GRACE_MS;
|
|
@@ -25571,6 +25580,7 @@ function createAcpExecutor(options) {
|
|
|
25571
25580
|
const commands = parseAvailableCommandsUpdate(params);
|
|
25572
25581
|
if (commands !== void 0) {
|
|
25573
25582
|
availableCommands = commands;
|
|
25583
|
+
options.onAvailableCommands?.(commands);
|
|
25574
25584
|
}
|
|
25575
25585
|
if (sessionLoadInFlight) {
|
|
25576
25586
|
droppedReplayUpdates += parsed.events.filter((event) => event._tag !== "ModeChanged").length;
|
|
@@ -27203,6 +27213,11 @@ var createAcpInstance = (config2, host) => {
|
|
|
27203
27213
|
providerInstanceId: host.instanceId,
|
|
27204
27214
|
clientInfo: CLIENT_INFO2,
|
|
27205
27215
|
log: host.log,
|
|
27216
|
+
// agent 自己宣告的斜杠命令按会话报给宿主,输入区的 / 菜单才有它们。
|
|
27217
|
+
onAvailableCommands: (commands) => host.reportSessionInventory?.({
|
|
27218
|
+
threadId: input2.threadId,
|
|
27219
|
+
slashCommands: acpCommandsToSlashCommands(commands)
|
|
27220
|
+
}),
|
|
27206
27221
|
...requestedModelId === void 0 ? {} : { requestedModelId },
|
|
27207
27222
|
...input2.bindingGeneration === void 0 ? {} : { originBindingGeneration: input2.bindingGeneration },
|
|
27208
27223
|
...autoApprove === void 0 ? {} : { autoApprove },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-acp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2694",
|
|
4
4
|
"description": "Generic ACP executor: user-supplied CLI over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@types/node": "24.12.4",
|
|
22
22
|
"esbuild": "0.28.1",
|
|
23
23
|
"vite-plus": "0.2.2",
|
|
24
|
-
"ycodium-
|
|
25
|
-
"
|
|
24
|
+
"@ycodium-ai/plugin-api": "0.2.2694",
|
|
25
|
+
"ycodium-acp-executor": "0.2.2694",
|
|
26
26
|
"ycodium-executor-testing": "0.0.0"
|
|
27
27
|
},
|
|
28
28
|
"ycodium": {
|