@ycodium-ai/agent-kimi 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 +4 -4
package/dist/index.js CHANGED
@@ -886,22 +886,25 @@ function parseAvailableCommandsUpdate(params) {
886
886
  }
887
887
  return commands;
888
888
  }
889
- function parsePermissionRequest(params) {
889
+ function parsePermissionRequest(params, known) {
890
+ const request = params.toolCall;
891
+ const earlier = known?.state.data;
890
892
  const toolCall = makeToolCallState(
891
893
  {
892
- toolCallId: params.toolCall.toolCallId,
893
- title: params.toolCall.title,
894
- kind: params.toolCall.kind,
895
- status: params.toolCall.status,
896
- rawInput: params.toolCall.rawInput,
897
- rawOutput: params.toolCall.rawOutput,
898
- content: params.toolCall.content,
899
- locations: params.toolCall.locations
894
+ toolCallId: request.toolCallId,
895
+ name: earlier?.["name"],
896
+ title: request.title ?? known?.rawTitle,
897
+ kind: request.kind ?? earlier?.["kind"],
898
+ status: request.status ?? known?.state.status,
899
+ rawInput: request.rawInput !== void 0 ? request.rawInput : earlier?.["rawInput"],
900
+ rawOutput: request.rawOutput !== void 0 ? request.rawOutput : earlier?.["rawOutput"],
901
+ content: request.content !== void 0 ? request.content : earlier?.["content"],
902
+ locations: request.locations !== void 0 ? request.locations : earlier?.["locations"]
900
903
  },
901
904
  { fallbackStatus: "pending" }
902
905
  );
903
- const kind = normalizeToolKind(params.toolCall.kind) ?? "unknown";
904
- const detail = toolCall?.command ?? toolCall?.title ?? toolCall?.detail ?? (typeof params.sessionId === "string" ? `Session ${params.sessionId}` : void 0);
906
+ const kind = toolCall?.kind ?? "unknown";
907
+ const detail = toolCall?.command ?? toolCall?.title ?? toolCall?.detail;
905
908
  return {
906
909
  kind,
907
910
  ...detail ? { detail } : {},
@@ -1139,7 +1142,7 @@ function makeAcpRequestOpenedEvent(input2) {
1139
1142
  requestId: input2.requestId,
1140
1143
  payload: {
1141
1144
  requestType,
1142
- detail: input2.detail,
1145
+ ...input2.detail ? { detail: input2.detail } : {},
1143
1146
  ...toolName ? { toolName } : {},
1144
1147
  args: input2.args,
1145
1148
  ...input2.options ? { options: input2.options } : {},
@@ -25900,7 +25903,8 @@ function createExecutorRequests({
25900
25903
  failIfDisposed,
25901
25904
  randomId,
25902
25905
  hooks,
25903
- shared
25906
+ shared,
25907
+ toolCalls
25904
25908
  }) {
25905
25909
  const emitResolved = (pending, decision, reason) => {
25906
25910
  emit(
@@ -26008,7 +26012,14 @@ function createExecutorRequests({
26008
26012
  }
26009
26013
  const userInputOutcome = await handlePermissionAsUserInput(params);
26010
26014
  if (userInputOutcome !== void 0) return userInputOutcome;
26011
- const permissionRequest = parsePermissionRequest(params);
26015
+ const tracked = toolCalls.get(params.toolCall.toolCallId);
26016
+ const parsed = parsePermissionRequest(params, tracked);
26017
+ const overriddenKind = hooks.permissionRequestKind?.({
26018
+ title: params.toolCall.title ?? tracked?.rawTitle,
26019
+ kind: parsed.kind,
26020
+ rawInput: parsed.toolCall?.data["rawInput"]
26021
+ });
26022
+ const permissionRequest = overriddenKind === void 0 ? parsed : { ...parsed, kind: overriddenKind };
26012
26023
  if (options.autoApprove?.(permissionRequest) === true) {
26013
26024
  const optionId = selectAutoApprovedAcpPermissionOption(params);
26014
26025
  if (optionId !== void 0) {
@@ -26034,7 +26045,7 @@ function createExecutorRequests({
26034
26045
  turnId: shared.activeTurnId,
26035
26046
  requestId,
26036
26047
  permissionRequest,
26037
- detail: permissionRequest.detail ?? "Approve this tool call?",
26048
+ detail: permissionRequest.detail,
26038
26049
  args: permissionRequest.toolCall?.data["rawInput"] ?? params.toolCall.rawInput,
26039
26050
  options: acpApprovalOptions(params),
26040
26051
  fileChanges: fileChangesFromAcpPermission(permissionRequest),
@@ -27331,7 +27342,8 @@ function createAcpExecutor(options) {
27331
27342
  failIfDisposed,
27332
27343
  randomId,
27333
27344
  hooks,
27334
- shared
27345
+ shared,
27346
+ toolCalls
27335
27347
  });
27336
27348
  const { rememberSettledPromptKey, abortPendingSettlement, settleFromNotification } = createExecutorSettlement({ hooks, shared });
27337
27349
  const promptResults = createPromptResults({ options, shared });
@@ -28958,7 +28970,7 @@ var executors = [
28958
28970
  ];
28959
28971
  var index_default = definePlugin({
28960
28972
  id: "agent-kimi",
28961
- apiVersion: 43,
28973
+ apiVersion: 47,
28962
28974
  executors,
28963
28975
  activate(ctx) {
28964
28976
  ctx.log.info("Kimi Code executor ready");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-kimi",
3
- "version": "0.2.3510",
3
+ "version": "0.2.3576",
4
4
  "description": "Kimi Code executor: runs `kimi acp` 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-executor-testing": "0.0.0",
25
- "ycodium-acp-executor": "0.2.3510",
26
- "@ycodium-ai/plugin-api": "0.2.3510"
24
+ "@ycodium-ai/plugin-api": "0.2.3576",
25
+ "ycodium-acp-executor": "0.2.3576",
26
+ "ycodium-executor-testing": "0.0.0"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",