@ycodium-ai/agent-acp 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.
Files changed (2) hide show
  1. package/dist/index.js +141 -142
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -24190,6 +24190,9 @@ function asTrimmedString(value) {
24190
24190
  const trimmed = value.trim();
24191
24191
  return trimmed.length > 0 ? trimmed : void 0;
24192
24192
  }
24193
+ function readAcpText(source, key) {
24194
+ return asTrimmedString(source?.[key]);
24195
+ }
24193
24196
  var selectPromptTurnId = (input2, activeTurnId, freshTurnId) => {
24194
24197
  const target = input2.expectedActiveTurnId;
24195
24198
  if (target === void 0) return input2.turnId ?? activeTurnId ?? freshTurnId();
@@ -24409,141 +24412,7 @@ function deriveToolActivityPresentation(input2) {
24409
24412
  };
24410
24413
  }
24411
24414
 
24412
- // ../../packages/ycodium-acp-executor/src/runtime-model.ts
24413
- function extractModelConfigId(sessionResponse) {
24414
- const configOptions = sessionResponse.configOptions;
24415
- if (!configOptions) return void 0;
24416
- for (const opt of configOptions) {
24417
- if (opt.category === "model" && opt.id.trim().length > 0) {
24418
- return opt.id.trim();
24419
- }
24420
- }
24421
- return configOptions.find((opt) => opt.id.trim() === "model" && opt.type === "select") ? "model" : void 0;
24422
- }
24423
- function findSessionConfigOption(configOptions, configId) {
24424
- if (!configOptions) {
24425
- return void 0;
24426
- }
24427
- const normalizedConfigId = configId.trim();
24428
- if (!normalizedConfigId) {
24429
- return void 0;
24430
- }
24431
- return configOptions.find((option) => option.id.trim() === normalizedConfigId);
24432
- }
24433
- function collectSessionConfigOptionValues(configOption) {
24434
- if (configOption.type !== "select" || !configOption.options) {
24435
- return [];
24436
- }
24437
- return configOption.options.flatMap(
24438
- (entry) => "value" in entry ? [entry.value] : entry.options.map((option) => option.value)
24439
- );
24440
- }
24441
- function collectSessionModelIds(models) {
24442
- if (!isRecord3(models) || !Array.isArray(models["availableModels"])) {
24443
- return [];
24444
- }
24445
- return models["availableModels"].flatMap(
24446
- (model) => isRecord3(model) && typeof model["modelId"] === "string" ? [model["modelId"]] : []
24447
- );
24448
- }
24449
- function catalogModelLastSegment(value) {
24450
- if (value.startsWith("[")) {
24451
- let parsed;
24452
- try {
24453
- parsed = JSON.parse(value);
24454
- } catch {
24455
- return void 0;
24456
- }
24457
- if (!Array.isArray(parsed) || parsed.length < 2) return void 0;
24458
- const last = parsed[parsed.length - 1];
24459
- return typeof last === "string" ? last : void 0;
24460
- }
24461
- const separator = value.indexOf("/");
24462
- return separator > 0 && separator < value.length - 1 ? value.slice(separator + 1) : void 0;
24463
- }
24464
- function matchAdvertisedModelValue(requestedModelId, advertisedValues) {
24465
- const wanted = requestedModelId.trim();
24466
- if (!wanted) return void 0;
24467
- if (advertisedValues.includes(wanted)) return wanted;
24468
- const byLastSegment = advertisedValues.filter(
24469
- (value) => catalogModelLastSegment(value) === wanted
24470
- );
24471
- return byLastSegment.length === 1 ? byLastSegment[0] : void 0;
24472
- }
24473
- function parseSessionModeState(sessionResponse) {
24474
- const modes = sessionResponse.modes;
24475
- if (!modes) return void 0;
24476
- const currentModeId = modes.currentModeId.trim();
24477
- if (!currentModeId) {
24478
- return void 0;
24479
- }
24480
- const availableModes = [];
24481
- for (const mode of modes.availableModes) {
24482
- const id = mode.id.trim();
24483
- const name = mode.name.trim();
24484
- if (!id || !name) {
24485
- continue;
24486
- }
24487
- const description = mode.description?.trim() || void 0;
24488
- availableModes.push(
24489
- description !== void 0 ? { id, name, description } : { id, name }
24490
- );
24491
- }
24492
- if (availableModes.length === 0) {
24493
- return void 0;
24494
- }
24495
- return {
24496
- currentModeId,
24497
- availableModes
24498
- };
24499
- }
24500
- function acpCommandsToSlashCommands(commands) {
24501
- return commands.map((command) => ({
24502
- name: command.name,
24503
- ...command.description === void 0 ? {} : { description: command.description },
24504
- ...command.inputHint === void 0 ? {} : { input: { hint: command.inputHint } }
24505
- }));
24506
- }
24507
- function parseAvailableCommandsUpdate(params) {
24508
- const update = params.update;
24509
- if (update["sessionUpdate"] !== "available_commands_update") {
24510
- return void 0;
24511
- }
24512
- const availableCommands = update["availableCommands"];
24513
- if (!Array.isArray(availableCommands)) {
24514
- return [];
24515
- }
24516
- const commands = [];
24517
- for (const command of availableCommands) {
24518
- if (!isRecord3(command)) {
24519
- continue;
24520
- }
24521
- const name = typeof command["name"] === "string" ? command["name"].trim() : "";
24522
- if (!name) {
24523
- continue;
24524
- }
24525
- const description = typeof command["description"] === "string" ? command["description"].trim() || void 0 : void 0;
24526
- const input2 = isRecord3(command["input"]) ? command["input"] : void 0;
24527
- const inputHint = typeof input2?.["hint"] === "string" ? input2["hint"].trim() || void 0 : void 0;
24528
- commands.push({
24529
- name,
24530
- ...description ? { description } : {},
24531
- ...inputHint ? { inputHint } : {}
24532
- });
24533
- }
24534
- return commands;
24535
- }
24536
- function normalizePlanStepStatus(raw) {
24537
- switch (raw) {
24538
- case "completed":
24539
- return "completed";
24540
- case "in_progress":
24541
- case "inProgress":
24542
- return "inProgress";
24543
- default:
24544
- return "pending";
24545
- }
24546
- }
24415
+ // ../../packages/ycodium-acp-executor/src/tool-call-state.ts
24547
24416
  function normalizeToolCallStatus(raw, fallback) {
24548
24417
  switch (raw) {
24549
24418
  case "pending":
@@ -24766,6 +24635,142 @@ function decideToolCallUpdateEmission(input2) {
24766
24635
  }
24767
24636
  return { emit: false, skippedSinceEmit: skippedSinceEmit + 1 };
24768
24637
  }
24638
+
24639
+ // ../../packages/ycodium-acp-executor/src/runtime-model.ts
24640
+ function normalizePlanStepStatus(raw) {
24641
+ switch (raw) {
24642
+ case "completed":
24643
+ return "completed";
24644
+ case "in_progress":
24645
+ case "inProgress":
24646
+ return "inProgress";
24647
+ default:
24648
+ return "pending";
24649
+ }
24650
+ }
24651
+ function extractModelConfigId(sessionResponse) {
24652
+ const configOptions = sessionResponse.configOptions;
24653
+ if (!configOptions) return void 0;
24654
+ for (const opt of configOptions) {
24655
+ if (opt.category === "model" && opt.id.trim().length > 0) {
24656
+ return opt.id.trim();
24657
+ }
24658
+ }
24659
+ return configOptions.find((opt) => opt.id.trim() === "model" && opt.type === "select") ? "model" : void 0;
24660
+ }
24661
+ function findSessionConfigOption(configOptions, configId) {
24662
+ if (!configOptions) {
24663
+ return void 0;
24664
+ }
24665
+ const normalizedConfigId = configId.trim();
24666
+ if (!normalizedConfigId) {
24667
+ return void 0;
24668
+ }
24669
+ return configOptions.find((option) => option.id.trim() === normalizedConfigId);
24670
+ }
24671
+ function collectSessionConfigOptionValues(configOption) {
24672
+ if (configOption.type !== "select" || !configOption.options) {
24673
+ return [];
24674
+ }
24675
+ return configOption.options.flatMap(
24676
+ (entry) => "value" in entry ? [entry.value] : entry.options.map((option) => option.value)
24677
+ );
24678
+ }
24679
+ function collectSessionModelIds(models) {
24680
+ if (!isRecord3(models) || !Array.isArray(models["availableModels"])) {
24681
+ return [];
24682
+ }
24683
+ return models["availableModels"].flatMap(
24684
+ (model) => isRecord3(model) && typeof model["modelId"] === "string" ? [model["modelId"]] : []
24685
+ );
24686
+ }
24687
+ function catalogModelLastSegment(value) {
24688
+ if (value.startsWith("[")) {
24689
+ let parsed;
24690
+ try {
24691
+ parsed = JSON.parse(value);
24692
+ } catch {
24693
+ return void 0;
24694
+ }
24695
+ if (!Array.isArray(parsed) || parsed.length < 2) return void 0;
24696
+ const last = parsed[parsed.length - 1];
24697
+ return typeof last === "string" ? last : void 0;
24698
+ }
24699
+ const separator = value.indexOf("/");
24700
+ return separator > 0 && separator < value.length - 1 ? value.slice(separator + 1) : void 0;
24701
+ }
24702
+ function matchAdvertisedModelValue(requestedModelId, advertisedValues) {
24703
+ const wanted = requestedModelId.trim();
24704
+ if (!wanted) return void 0;
24705
+ if (advertisedValues.includes(wanted)) return wanted;
24706
+ const byLastSegment = advertisedValues.filter(
24707
+ (value) => catalogModelLastSegment(value) === wanted
24708
+ );
24709
+ return byLastSegment.length === 1 ? byLastSegment[0] : void 0;
24710
+ }
24711
+ function parseSessionModeState(sessionResponse) {
24712
+ const modes = sessionResponse.modes;
24713
+ if (!modes) return void 0;
24714
+ const currentModeId = modes.currentModeId.trim();
24715
+ if (!currentModeId) {
24716
+ return void 0;
24717
+ }
24718
+ const availableModes = [];
24719
+ for (const mode of modes.availableModes) {
24720
+ const id = mode.id.trim();
24721
+ const name = mode.name.trim();
24722
+ if (!id || !name) {
24723
+ continue;
24724
+ }
24725
+ const description = mode.description?.trim() || void 0;
24726
+ availableModes.push(
24727
+ description !== void 0 ? { id, name, description } : { id, name }
24728
+ );
24729
+ }
24730
+ if (availableModes.length === 0) {
24731
+ return void 0;
24732
+ }
24733
+ return {
24734
+ currentModeId,
24735
+ availableModes
24736
+ };
24737
+ }
24738
+ function acpCommandsToSlashCommands(commands) {
24739
+ return commands.map((command) => ({
24740
+ name: command.name,
24741
+ ...command.description === void 0 ? {} : { description: command.description },
24742
+ ...command.inputHint === void 0 ? {} : { input: { hint: command.inputHint } }
24743
+ }));
24744
+ }
24745
+ function parseAvailableCommandsUpdate(params) {
24746
+ const update = params.update;
24747
+ if (update["sessionUpdate"] !== "available_commands_update") {
24748
+ return void 0;
24749
+ }
24750
+ const availableCommands = update["availableCommands"];
24751
+ if (!Array.isArray(availableCommands)) {
24752
+ return [];
24753
+ }
24754
+ const commands = [];
24755
+ for (const command of availableCommands) {
24756
+ if (!isRecord3(command)) {
24757
+ continue;
24758
+ }
24759
+ const name = typeof command["name"] === "string" ? command["name"].trim() : "";
24760
+ if (!name) {
24761
+ continue;
24762
+ }
24763
+ const description = typeof command["description"] === "string" ? command["description"].trim() || void 0 : void 0;
24764
+ const input2 = isRecord3(command["input"]) ? command["input"] : void 0;
24765
+ const inputHint = typeof input2?.["hint"] === "string" ? input2["hint"].trim() || void 0 : void 0;
24766
+ commands.push({
24767
+ name,
24768
+ ...description ? { description } : {},
24769
+ ...inputHint ? { inputHint } : {}
24770
+ });
24771
+ }
24772
+ return commands;
24773
+ }
24769
24774
  function parsePermissionRequest(params) {
24770
24775
  const toolCall = makeToolCallState(
24771
24776
  {
@@ -24805,12 +24810,6 @@ function boundToolCallRawPayload(params, update, toolCall) {
24805
24810
  }
24806
24811
  };
24807
24812
  }
24808
- function readAcpText(source, key) {
24809
- const value = source?.[key];
24810
- if (typeof value !== "string") return void 0;
24811
- const trimmed = value.trim();
24812
- return trimmed.length > 0 ? trimmed : void 0;
24813
- }
24814
24813
  function textFromContentBlocks(blocks) {
24815
24814
  const parts = blocks.flatMap(
24816
24815
  (block) => isRecord3(block) && block["type"] === "text" && typeof block["text"] === "string" ? [block["text"]] : []
@@ -27501,7 +27500,7 @@ var executors = [
27501
27500
  ];
27502
27501
  var index_default = definePlugin({
27503
27502
  id: "agent-acp",
27504
- apiVersion: 5,
27503
+ apiVersion: 6,
27505
27504
  executors,
27506
27505
  activate(ctx) {
27507
27506
  ctx.log.info("generic ACP executor ready");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-acp",
3
- "version": "0.2.2996",
3
+ "version": "0.2.3000",
4
4
  "description": "Generic ACP executor: user-supplied CLI over Agent Client Protocol stdio.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -21,9 +21,9 @@
21
21
  "@types/node": "24.12.4",
22
22
  "esbuild": "0.28.1",
23
23
  "vite-plus": "0.2.2",
24
- "@ycodium-ai/plugin-api": "0.2.2996",
25
- "ycodium-acp-executor": "0.2.2996",
26
- "ycodium-executor-testing": "0.0.0"
24
+ "@ycodium-ai/plugin-api": "0.2.3000",
25
+ "ycodium-executor-testing": "0.0.0",
26
+ "ycodium-acp-executor": "0.2.3000"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",