@ycodium-ai/agent-antigravity 0.2.4486 → 0.2.5004

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 +57 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1387,7 +1387,7 @@ var require_yauzl = __commonJS({
1387
1387
  import { definePlugin } from "@ycodium-ai/plugin-api";
1388
1388
 
1389
1389
  // ../../packages/plugin-api/src/version.ts
1390
- var PLUGIN_API_VERSION = 119;
1390
+ var PLUGIN_API_VERSION = 142;
1391
1391
 
1392
1392
  // src/index.ts
1393
1393
  import {
@@ -2635,7 +2635,15 @@ function parsePermissionRequest(params, known) {
2635
2635
  { fallbackStatus: "pending" }
2636
2636
  );
2637
2637
  const kind = toolCall?.kind ?? "unknown";
2638
- const detail = toolCall?.command ?? toolCall?.title ?? toolCall?.detail;
2638
+ const content = toolCall?.data["content"];
2639
+ const firstText = Array.isArray(content) ? content.flatMap((entry) => {
2640
+ if (!isRecord2(entry) || entry["type"] !== "content" || !isRecord2(entry["content"]))
2641
+ return [];
2642
+ const block = entry["content"];
2643
+ return block["type"] === "text" && typeof block["text"] === "string" && block["text"].trim() ? [block["text"]] : [];
2644
+ })[0] : void 0;
2645
+ const originalTitle = (request2.title ?? known?.rawTitle)?.trim() || void 0;
2646
+ const detail = toolCall?.command ?? firstText ?? originalTitle;
2639
2647
  return {
2640
2648
  kind,
2641
2649
  ...detail ? { detail } : {},
@@ -2876,6 +2884,7 @@ function makeAcpRequestOpenedEvent(input2) {
2876
2884
  ...input2.detail ? { detail: input2.detail } : {},
2877
2885
  ...toolName ? { toolName } : {},
2878
2886
  args: input2.args,
2887
+ ...input2.statement !== void 0 ? { statement: input2.statement } : {},
2879
2888
  ...input2.options ? { options: input2.options } : {},
2880
2889
  ...input2.fileChanges ? { fileChanges: input2.fileChanges } : {},
2881
2890
  declineReasonRelay: "queued"
@@ -28149,6 +28158,38 @@ function createPromptResults({
28149
28158
  return { add, receive, reject, stop, complete, hasInterrupted, forget, wait, finishUnreceived };
28150
28159
  }
28151
28160
 
28161
+ // ../../packages/ycodium-acp-executor/src/permission-statement.ts
28162
+ function defaultPermissionStatement(request2) {
28163
+ const rawInput = request2.toolCall?.data["rawInput"];
28164
+ const input2 = isRecord2(rawInput) ? rawInput : {};
28165
+ const coveredArgs = [];
28166
+ const text = (name) => {
28167
+ const value = input2[name];
28168
+ if (typeof value !== "string" || value.trim().length === 0) return void 0;
28169
+ coveredArgs.push(name);
28170
+ return value;
28171
+ };
28172
+ const description = text("description");
28173
+ const justification = text("justification") ?? text("reason");
28174
+ const command = request2.kind === "execute" ? text("command") ?? text("cmd") ?? request2.toolCall?.command : void 0;
28175
+ let outsideSandbox = false;
28176
+ for (const name of ["sandbox_permissions", "sandboxPermissions", "dangerouslyDisableSandbox"]) {
28177
+ const value = input2[name];
28178
+ const outside = name === "dangerouslyDisableSandbox" ? value === true || value === "true" : typeof value === "string" && /full[-_]access|danger|escalat/i.test(value);
28179
+ if (!outside) continue;
28180
+ outsideSandbox = true;
28181
+ coveredArgs.push(name);
28182
+ }
28183
+ if ("timeoutMs" in input2) coveredArgs.push("timeoutMs");
28184
+ return {
28185
+ ...description !== void 0 ? { description } : {},
28186
+ ...justification !== void 0 ? { justification } : {},
28187
+ ...command !== void 0 ? { command } : {},
28188
+ ...outsideSandbox ? { outsideSandbox: true } : {},
28189
+ ...coveredArgs.length > 0 ? { coveredArgs } : {}
28190
+ };
28191
+ }
28192
+
28152
28193
  // ../../packages/ycodium-acp-executor/src/executor/requests.ts
28153
28194
  function createExecutorRequests({
28154
28195
  emit,
@@ -28282,6 +28323,13 @@ function createExecutorRequests({
28282
28323
  return { outcome: { outcome: "selected", optionId } };
28283
28324
  }
28284
28325
  }
28326
+ const permissionContext = {
28327
+ request: params,
28328
+ permissionRequest,
28329
+ previousToolCall: tracked?.state
28330
+ };
28331
+ const statement = hooks.permissionStatement?.(permissionContext) ?? defaultPermissionStatement(permissionRequest);
28332
+ const fileChanges = hooks.permissionFileChanges?.(permissionContext) ?? fileChangesFromAcpPermission(permissionRequest);
28285
28333
  const requestId = randomId();
28286
28334
  const outcome = await new Promise((resolve6) => {
28287
28335
  const pending = {
@@ -28301,10 +28349,11 @@ function createExecutorRequests({
28301
28349
  turnId: shared.activeTurnId,
28302
28350
  requestId,
28303
28351
  permissionRequest,
28304
- detail: permissionRequest.detail,
28352
+ detail: statement.command ?? permissionRequest.detail,
28305
28353
  args: permissionRequest.toolCall?.data["rawInput"] ?? params.toolCall.rawInput,
28354
+ statement,
28306
28355
  options: acpApprovalOptions(params),
28307
- fileChanges: fileChangesFromAcpPermission(permissionRequest),
28356
+ fileChanges,
28308
28357
  source: "acp.jsonrpc",
28309
28358
  method: "session/request_permission",
28310
28359
  rawPayload: params
@@ -30758,13 +30807,16 @@ var ANTIGRAVITY_CARD = {
30758
30807
  descriptionKey: "form.binaryPath.description",
30759
30808
  placeholderKey: "form.binaryPath.placeholder",
30760
30809
  // 不用 executable-path:那个控件要求绝对路径、空着不让加,可空着正是「用这里下载的运行时」。
30761
- control: "text"
30810
+ control: "text",
30811
+ // 也就拿不到 executable-path 自带的本机专属,得自己标。
30812
+ machineLocal: true
30762
30813
  }
30763
30814
  },
30764
30815
  homePath: {
30765
30816
  type: "string",
30766
30817
  "x-ycodium-form": {
30767
30818
  titleKey: "form.homePath.title",
30819
+ machineLocal: true,
30768
30820
  descriptionKey: "form.homePath.description",
30769
30821
  placeholderKey: "form.homePath.placeholder"
30770
30822
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-antigravity",
3
- "version": "0.2.4486",
3
+ "version": "0.2.5004",
4
4
  "description": "Google Antigravity executor: runs the Antigravity agent over Agent Client Protocol stdio.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -31,9 +31,9 @@
31
31
  "typescript": "~6.0.3",
32
32
  "vite-plus": "0.2.2",
33
33
  "yauzl": "^3.4.0",
34
- "@ycodium-ai/plugin-api": "0.2.4486",
35
34
  "ycodium-executor-testing": "0.0.0",
36
- "ycodium-acp-executor": "0.2.0"
35
+ "@ycodium-ai/plugin-api": "0.2.5004",
36
+ "ycodium-acp-executor": "0.2.5004"
37
37
  },
38
38
  "ycodium": {
39
39
  "plugin": "./dist/index.js",