@ycodium-ai/agent-acp 0.2.2888 → 0.2.2896

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 +67 -8
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { definePlugin } from "@ycodium-ai/plugin-api";
9
9
 
10
10
  // src/acpInstance.ts
11
11
  import * as NodeOS2 from "node:os";
12
- import * as NodePath2 from "node:path";
12
+ import * as NodePath3 from "node:path";
13
13
  import { mergeLaunchEnv, modelSelectionStringOption } from "@ycodium-ai/plugin-api/executor";
14
14
  import { nodeStreamsFromHandle as nodeStreamsFromHandle2 } from "@ycodium-ai/plugin-api/process-stdin";
15
15
 
@@ -24043,6 +24043,60 @@ function approvalOutcomeForDecision(decision, optionId) {
24043
24043
  return decision !== "cancel" && optionId !== void 0 ? { outcome: "selected", optionId } : { outcome: "cancelled" };
24044
24044
  }
24045
24045
 
24046
+ // ../../packages/ycodium-acp-executor/src/artifacts.ts
24047
+ import * as NodePath from "node:path";
24048
+ import * as NodeURL from "node:url";
24049
+ function resourceLinkArtifacts(content) {
24050
+ if (content["type"] !== "resource_link" || typeof content["uri"] !== "string") return [];
24051
+ const uri = content["uri"].trim();
24052
+ let path;
24053
+ try {
24054
+ path = uri.toLowerCase().startsWith("file:") ? NodeURL.fileURLToPath(uri) : uri;
24055
+ } catch {
24056
+ return [];
24057
+ }
24058
+ if (!NodePath.isAbsolute(path)) return [];
24059
+ const name = typeof content["name"] === "string" ? content["name"].trim() : "";
24060
+ const mimeType = typeof content["mimeType"] === "string" ? content["mimeType"].trim() : "";
24061
+ return [
24062
+ {
24063
+ path,
24064
+ ...name.length > 0 ? { name } : {},
24065
+ ...mimeType.length > 0 ? { mimeType } : {}
24066
+ }
24067
+ ];
24068
+ }
24069
+ function acpArtifactEvent(input2) {
24070
+ if (input2.artifacts.length === 0) return void 0;
24071
+ const { toolCallId } = input2;
24072
+ return {
24073
+ ...input2.base,
24074
+ type: "assistant.artifact.produced",
24075
+ payload: {
24076
+ artifacts: input2.artifacts.map((artifact) => ({
24077
+ ...artifact,
24078
+ ...toolCallId !== void 0 ? { toolCallId } : {}
24079
+ }))
24080
+ }
24081
+ };
24082
+ }
24083
+ function makeArtifactEmitter(input2) {
24084
+ return (artifacts, toolCallId) => {
24085
+ const turnId = input2.turnId();
24086
+ const event = acpArtifactEvent({
24087
+ artifacts,
24088
+ toolCallId,
24089
+ base: {
24090
+ ...input2.stamp(),
24091
+ provider: input2.options.provider,
24092
+ threadId: input2.options.threadId,
24093
+ ...turnId === void 0 ? {} : { turnId }
24094
+ }
24095
+ });
24096
+ if (event !== void 0) input2.emit(event);
24097
+ };
24098
+ }
24099
+
24046
24100
  // ../../packages/ycodium-acp-executor/src/event-stream.ts
24047
24101
  var UnboundedEventStream = class {
24048
24102
  subscribers = /* @__PURE__ */ new Set();
@@ -25533,9 +25587,8 @@ function createAcpExecutor(options) {
25533
25587
  options.originBindingGeneration === void 0 ? event : { ...event, originBindingGeneration: options.originBindingGeneration }
25534
25588
  );
25535
25589
  };
25536
- const emit = (event) => {
25537
- publish(event);
25538
- };
25590
+ const emit = publish;
25591
+ const emitArtifacts = makeArtifactEmitter({ emit, stamp, options, turnId: () => activeTurnId });
25539
25592
  const failIfDisposed = () => {
25540
25593
  if (disposed) {
25541
25594
  throw new AcpExecutorDisposedError();
@@ -25638,6 +25691,8 @@ function createAcpExecutor(options) {
25638
25691
  payload: taskEvent.payload
25639
25692
  });
25640
25693
  }
25694
+ if (nextToolCall.status === "completed" && hookResult && "artifacts" in hookResult)
25695
+ emitArtifacts(hookResult.artifacts ?? [], nextToolCall.toolCallId);
25641
25696
  if (handledByHook || !decision.emit) {
25642
25697
  continue;
25643
25698
  }
@@ -25657,6 +25712,10 @@ function createAcpExecutor(options) {
25657
25712
  );
25658
25713
  continue;
25659
25714
  }
25715
+ if (event._tag === "AssistantContentBlock") {
25716
+ emitArtifacts(resourceLinkArtifacts(event.content));
25717
+ continue;
25718
+ }
25660
25719
  if (event._tag === "CompactionUpdated") {
25661
25720
  applyCompactionUpdate(event);
25662
25721
  continue;
@@ -26919,7 +26978,7 @@ function tokenizeLaunchArgs(value) {
26919
26978
  // src/probeModels.ts
26920
26979
  import * as NodeFS from "node:fs";
26921
26980
  import * as NodeOS from "node:os";
26922
- import * as NodePath from "node:path";
26981
+ import * as NodePath2 from "node:path";
26923
26982
  import {
26924
26983
  describeExecutorSpawnFailure,
26925
26984
  ExecutorSpawnRefusedError,
@@ -26931,7 +26990,7 @@ var CLIENT_INFO = { name: "ycodium-agent-acp-probe", version: "0.2.0" };
26931
26990
  var ACP_EFFORT_OPTION_ID = "reasoning";
26932
26991
  function acpProbeSessionCwd(instanceId) {
26933
26992
  const safe = instanceId.replace(/[^a-zA-Z0-9_-]/g, "_");
26934
- return NodePath.join(NodeOS.tmpdir(), `ycodium-acp-probe-${safe}`);
26993
+ return NodePath2.join(NodeOS.tmpdir(), `ycodium-acp-probe-${safe}`);
26935
26994
  }
26936
26995
  function isRecord7(value) {
26937
26996
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -27103,7 +27162,7 @@ var EventBus = class {
27103
27162
  function expandHomePath(value) {
27104
27163
  if (value === "~") return NodeOS2.homedir();
27105
27164
  if (value.startsWith("~/") || value.startsWith("~\\")) {
27106
- return NodePath2.join(NodeOS2.homedir(), value.slice(2));
27165
+ return NodePath3.join(NodeOS2.homedir(), value.slice(2));
27107
27166
  }
27108
27167
  return value;
27109
27168
  }
@@ -27128,7 +27187,7 @@ function nowIso() {
27128
27187
  }
27129
27188
  function acpContinuationKey(recipe) {
27130
27189
  const homePath = recipe.homePath.trim();
27131
- const resolvedHomePath = homePath.length > 0 ? NodePath2.resolve(expandHomePath(homePath)) : "";
27190
+ const resolvedHomePath = homePath.length > 0 ? NodePath3.resolve(expandHomePath(homePath)) : "";
27132
27191
  return `acp:home:${recipe.binaryPath.trim()}\0${resolvedHomePath}`;
27133
27192
  }
27134
27193
  async function stopBooked(booked) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-acp",
3
- "version": "0.2.2888",
3
+ "version": "0.2.2896",
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.2888",
25
- "ycodium-acp-executor": "0.2.2888",
26
- "ycodium-executor-testing": "0.0.0"
24
+ "@ycodium-ai/plugin-api": "0.2.2896",
25
+ "ycodium-executor-testing": "0.0.0",
26
+ "ycodium-acp-executor": "0.2.2896"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",