@ycodium-ai/agent-acp 0.2.3510 → 0.2.3576

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 +29 -17
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -803,22 +803,25 @@ function parseAvailableCommandsUpdate(params) {
803
803
  }
804
804
  return commands;
805
805
  }
806
- function parsePermissionRequest(params) {
806
+ function parsePermissionRequest(params, known) {
807
+ const request = params.toolCall;
808
+ const earlier = known?.state.data;
807
809
  const toolCall = makeToolCallState(
808
810
  {
809
- toolCallId: params.toolCall.toolCallId,
810
- title: params.toolCall.title,
811
- kind: params.toolCall.kind,
812
- status: params.toolCall.status,
813
- rawInput: params.toolCall.rawInput,
814
- rawOutput: params.toolCall.rawOutput,
815
- content: params.toolCall.content,
816
- locations: params.toolCall.locations
811
+ toolCallId: request.toolCallId,
812
+ name: earlier?.["name"],
813
+ title: request.title ?? known?.rawTitle,
814
+ kind: request.kind ?? earlier?.["kind"],
815
+ status: request.status ?? known?.state.status,
816
+ rawInput: request.rawInput !== void 0 ? request.rawInput : earlier?.["rawInput"],
817
+ rawOutput: request.rawOutput !== void 0 ? request.rawOutput : earlier?.["rawOutput"],
818
+ content: request.content !== void 0 ? request.content : earlier?.["content"],
819
+ locations: request.locations !== void 0 ? request.locations : earlier?.["locations"]
817
820
  },
818
821
  { fallbackStatus: "pending" }
819
822
  );
820
- const kind = normalizeToolKind(params.toolCall.kind) ?? "unknown";
821
- const detail = toolCall?.command ?? toolCall?.title ?? toolCall?.detail ?? (typeof params.sessionId === "string" ? `Session ${params.sessionId}` : void 0);
823
+ const kind = toolCall?.kind ?? "unknown";
824
+ const detail = toolCall?.command ?? toolCall?.title ?? toolCall?.detail;
822
825
  return {
823
826
  kind,
824
827
  ...detail ? { detail } : {},
@@ -1056,7 +1059,7 @@ function makeAcpRequestOpenedEvent(input2) {
1056
1059
  requestId: input2.requestId,
1057
1060
  payload: {
1058
1061
  requestType,
1059
- detail: input2.detail,
1062
+ ...input2.detail ? { detail: input2.detail } : {},
1060
1063
  ...toolName ? { toolName } : {},
1061
1064
  args: input2.args,
1062
1065
  ...input2.options ? { options: input2.options } : {},
@@ -25817,7 +25820,8 @@ function createExecutorRequests({
25817
25820
  failIfDisposed,
25818
25821
  randomId,
25819
25822
  hooks,
25820
- shared
25823
+ shared,
25824
+ toolCalls
25821
25825
  }) {
25822
25826
  const emitResolved = (pending, decision, reason) => {
25823
25827
  emit(
@@ -25925,7 +25929,14 @@ function createExecutorRequests({
25925
25929
  }
25926
25930
  const userInputOutcome = await handlePermissionAsUserInput(params);
25927
25931
  if (userInputOutcome !== void 0) return userInputOutcome;
25928
- const permissionRequest = parsePermissionRequest(params);
25932
+ const tracked = toolCalls.get(params.toolCall.toolCallId);
25933
+ const parsed = parsePermissionRequest(params, tracked);
25934
+ const overriddenKind = hooks.permissionRequestKind?.({
25935
+ title: params.toolCall.title ?? tracked?.rawTitle,
25936
+ kind: parsed.kind,
25937
+ rawInput: parsed.toolCall?.data["rawInput"]
25938
+ });
25939
+ const permissionRequest = overriddenKind === void 0 ? parsed : { ...parsed, kind: overriddenKind };
25929
25940
  if (options.autoApprove?.(permissionRequest) === true) {
25930
25941
  const optionId = selectAutoApprovedAcpPermissionOption(params);
25931
25942
  if (optionId !== void 0) {
@@ -25951,7 +25962,7 @@ function createExecutorRequests({
25951
25962
  turnId: shared.activeTurnId,
25952
25963
  requestId,
25953
25964
  permissionRequest,
25954
- detail: permissionRequest.detail ?? "Approve this tool call?",
25965
+ detail: permissionRequest.detail,
25955
25966
  args: permissionRequest.toolCall?.data["rawInput"] ?? params.toolCall.rawInput,
25956
25967
  options: acpApprovalOptions(params),
25957
25968
  fileChanges: fileChangesFromAcpPermission(permissionRequest),
@@ -27315,7 +27326,8 @@ function createAcpExecutor(options) {
27315
27326
  failIfDisposed,
27316
27327
  randomId,
27317
27328
  hooks,
27318
- shared
27329
+ shared,
27330
+ toolCalls
27319
27331
  });
27320
27332
  const { rememberSettledPromptKey, abortPendingSettlement, settleFromNotification } = createExecutorSettlement({ hooks, shared });
27321
27333
  const promptResults = createPromptResults({ options, shared });
@@ -28469,7 +28481,7 @@ var executors = [
28469
28481
  ];
28470
28482
  var index_default = definePlugin({
28471
28483
  id: "agent-acp",
28472
- apiVersion: 43,
28484
+ apiVersion: 47,
28473
28485
  executors,
28474
28486
  activate(ctx) {
28475
28487
  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.3510",
3
+ "version": "0.2.3576",
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.3510",
25
24
  "ycodium-executor-testing": "0.0.0",
26
- "ycodium-acp-executor": "0.2.3510"
25
+ "@ycodium-ai/plugin-api": "0.2.3576",
26
+ "ycodium-acp-executor": "0.2.3576"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",