@ycodium-ai/agent-grok 0.2.3510 → 0.2.3566

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 +30 -18
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -950,22 +950,25 @@ function parseAvailableCommandsUpdate(params) {
950
950
  }
951
951
  return commands;
952
952
  }
953
- function parsePermissionRequest(params) {
953
+ function parsePermissionRequest(params, known) {
954
+ const request = params.toolCall;
955
+ const earlier = known?.state.data;
954
956
  const toolCall = makeToolCallState(
955
957
  {
956
- toolCallId: params.toolCall.toolCallId,
957
- title: params.toolCall.title,
958
- kind: params.toolCall.kind,
959
- status: params.toolCall.status,
960
- rawInput: params.toolCall.rawInput,
961
- rawOutput: params.toolCall.rawOutput,
962
- content: params.toolCall.content,
963
- locations: params.toolCall.locations
958
+ toolCallId: request.toolCallId,
959
+ name: earlier?.["name"],
960
+ title: request.title ?? known?.rawTitle,
961
+ kind: request.kind ?? earlier?.["kind"],
962
+ status: request.status ?? known?.state.status,
963
+ rawInput: request.rawInput !== void 0 ? request.rawInput : earlier?.["rawInput"],
964
+ rawOutput: request.rawOutput !== void 0 ? request.rawOutput : earlier?.["rawOutput"],
965
+ content: request.content !== void 0 ? request.content : earlier?.["content"],
966
+ locations: request.locations !== void 0 ? request.locations : earlier?.["locations"]
964
967
  },
965
968
  { fallbackStatus: "pending" }
966
969
  );
967
- const kind = normalizeToolKind(params.toolCall.kind) ?? "unknown";
968
- const detail = toolCall?.command ?? toolCall?.title ?? toolCall?.detail ?? (typeof params.sessionId === "string" ? `Session ${params.sessionId}` : void 0);
970
+ const kind = toolCall?.kind ?? "unknown";
971
+ const detail = toolCall?.command ?? toolCall?.title ?? toolCall?.detail;
969
972
  return {
970
973
  kind,
971
974
  ...detail ? { detail } : {},
@@ -1203,7 +1206,7 @@ function makeAcpRequestOpenedEvent(input2) {
1203
1206
  requestId: input2.requestId,
1204
1207
  payload: {
1205
1208
  requestType,
1206
- detail: input2.detail,
1209
+ ...input2.detail ? { detail: input2.detail } : {},
1207
1210
  ...toolName ? { toolName } : {},
1208
1211
  args: input2.args,
1209
1212
  ...input2.options ? { options: input2.options } : {},
@@ -25964,7 +25967,8 @@ function createExecutorRequests({
25964
25967
  failIfDisposed,
25965
25968
  randomId,
25966
25969
  hooks,
25967
- shared
25970
+ shared,
25971
+ toolCalls
25968
25972
  }) {
25969
25973
  const emitResolved = (pending, decision, reason) => {
25970
25974
  emit(
@@ -26072,7 +26076,14 @@ function createExecutorRequests({
26072
26076
  }
26073
26077
  const userInputOutcome = await handlePermissionAsUserInput(params);
26074
26078
  if (userInputOutcome !== void 0) return userInputOutcome;
26075
- const permissionRequest = parsePermissionRequest(params);
26079
+ const tracked = toolCalls.get(params.toolCall.toolCallId);
26080
+ const parsed = parsePermissionRequest(params, tracked);
26081
+ const overriddenKind = hooks.permissionRequestKind?.({
26082
+ title: params.toolCall.title ?? tracked?.rawTitle,
26083
+ kind: parsed.kind,
26084
+ rawInput: parsed.toolCall?.data["rawInput"]
26085
+ });
26086
+ const permissionRequest = overriddenKind === void 0 ? parsed : { ...parsed, kind: overriddenKind };
26076
26087
  if (options.autoApprove?.(permissionRequest) === true) {
26077
26088
  const optionId = selectAutoApprovedAcpPermissionOption(params);
26078
26089
  if (optionId !== void 0) {
@@ -26098,7 +26109,7 @@ function createExecutorRequests({
26098
26109
  turnId: shared.activeTurnId,
26099
26110
  requestId,
26100
26111
  permissionRequest,
26101
- detail: permissionRequest.detail ?? "Approve this tool call?",
26112
+ detail: permissionRequest.detail,
26102
26113
  args: permissionRequest.toolCall?.data["rawInput"] ?? params.toolCall.rawInput,
26103
26114
  options: acpApprovalOptions(params),
26104
26115
  fileChanges: fileChangesFromAcpPermission(permissionRequest),
@@ -27377,7 +27388,8 @@ function createAcpExecutor(options) {
27377
27388
  failIfDisposed,
27378
27389
  randomId,
27379
27390
  hooks,
27380
- shared
27391
+ shared,
27392
+ toolCalls
27381
27393
  });
27382
27394
  const { rememberSettledPromptKey, abortPendingSettlement, settleFromNotification } = createExecutorSettlement({ hooks, shared });
27383
27395
  const promptResults = createPromptResults({ options, shared });
@@ -28899,7 +28911,7 @@ function extractXAiAskUserQuestions(params) {
28899
28911
  options: question.options.length > 0 ? question.options.map((option) => ({
28900
28912
  label: option.label,
28901
28913
  description: option.description ?? option.label
28902
- })) : [{ label: "OK", description: "Continue" }]
28914
+ })) : [{ label: "OK", description: "Continue", displayKind: "acknowledge" }]
28903
28915
  }));
28904
28916
  }
28905
28917
  var answerValues = (answer) => {
@@ -29819,7 +29831,7 @@ var executors = [
29819
29831
  ];
29820
29832
  var index_default = definePlugin({
29821
29833
  id: "agent-grok",
29822
- apiVersion: 43,
29834
+ apiVersion: 46,
29823
29835
  executors,
29824
29836
  activate(ctx) {
29825
29837
  ctx.log.info("grok executor ready");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-grok",
3
- "version": "0.2.3510",
3
+ "version": "0.2.3566",
4
4
  "description": "Grok executor: grok 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
- "ycodium-acp-executor": "0.2.3510",
26
- "ycodium-executor-testing": "0.0.0"
24
+ "ycodium-executor-testing": "0.0.0",
25
+ "ycodium-acp-executor": "0.2.3566",
26
+ "@ycodium-ai/plugin-api": "0.2.3566"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",