@ycodium-ai/agent-antigravity 0.2.2882 → 0.2.2892

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 +137 -78
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -25657,6 +25657,60 @@ function approvalOutcomeForDecision(decision, optionId) {
25657
25657
  return decision !== "cancel" && optionId !== void 0 ? { outcome: "selected", optionId } : { outcome: "cancelled" };
25658
25658
  }
25659
25659
 
25660
+ // ../../packages/ycodium-acp-executor/src/artifacts.ts
25661
+ import * as NodePath from "node:path";
25662
+ import * as NodeURL from "node:url";
25663
+ function resourceLinkArtifacts(content) {
25664
+ if (content["type"] !== "resource_link" || typeof content["uri"] !== "string") return [];
25665
+ const uri = content["uri"].trim();
25666
+ let path;
25667
+ try {
25668
+ path = uri.toLowerCase().startsWith("file:") ? NodeURL.fileURLToPath(uri) : uri;
25669
+ } catch {
25670
+ return [];
25671
+ }
25672
+ if (!NodePath.isAbsolute(path)) return [];
25673
+ const name = typeof content["name"] === "string" ? content["name"].trim() : "";
25674
+ const mimeType = typeof content["mimeType"] === "string" ? content["mimeType"].trim() : "";
25675
+ return [
25676
+ {
25677
+ path,
25678
+ ...name.length > 0 ? { name } : {},
25679
+ ...mimeType.length > 0 ? { mimeType } : {}
25680
+ }
25681
+ ];
25682
+ }
25683
+ function acpArtifactEvent(input2) {
25684
+ if (input2.artifacts.length === 0) return void 0;
25685
+ const { toolCallId } = input2;
25686
+ return {
25687
+ ...input2.base,
25688
+ type: "assistant.artifact.produced",
25689
+ payload: {
25690
+ artifacts: input2.artifacts.map((artifact) => ({
25691
+ ...artifact,
25692
+ ...toolCallId !== void 0 ? { toolCallId } : {}
25693
+ }))
25694
+ }
25695
+ };
25696
+ }
25697
+ function makeArtifactEmitter(input2) {
25698
+ return (artifacts, toolCallId) => {
25699
+ const turnId = input2.turnId();
25700
+ const event = acpArtifactEvent({
25701
+ artifacts,
25702
+ toolCallId,
25703
+ base: {
25704
+ ...input2.stamp(),
25705
+ provider: input2.options.provider,
25706
+ threadId: input2.options.threadId,
25707
+ ...turnId === void 0 ? {} : { turnId }
25708
+ }
25709
+ });
25710
+ if (event !== void 0) input2.emit(event);
25711
+ };
25712
+ }
25713
+
25660
25714
  // ../../packages/ycodium-acp-executor/src/event-stream.ts
25661
25715
  var UnboundedEventStream = class {
25662
25716
  subscribers = /* @__PURE__ */ new Set();
@@ -27147,9 +27201,8 @@ function createAcpExecutor(options2) {
27147
27201
  options2.originBindingGeneration === void 0 ? event : { ...event, originBindingGeneration: options2.originBindingGeneration }
27148
27202
  );
27149
27203
  };
27150
- const emit = (event) => {
27151
- publish(event);
27152
- };
27204
+ const emit = publish;
27205
+ const emitArtifacts = makeArtifactEmitter({ emit, stamp, options: options2, turnId: () => activeTurnId });
27153
27206
  const failIfDisposed = () => {
27154
27207
  if (disposed) {
27155
27208
  throw new AcpExecutorDisposedError();
@@ -27252,6 +27305,8 @@ function createAcpExecutor(options2) {
27252
27305
  payload: taskEvent.payload
27253
27306
  });
27254
27307
  }
27308
+ if (nextToolCall.status === "completed" && hookResult && "artifacts" in hookResult)
27309
+ emitArtifacts(hookResult.artifacts ?? [], nextToolCall.toolCallId);
27255
27310
  if (handledByHook || !decision.emit) {
27256
27311
  continue;
27257
27312
  }
@@ -27271,6 +27326,10 @@ function createAcpExecutor(options2) {
27271
27326
  );
27272
27327
  continue;
27273
27328
  }
27329
+ if (event._tag === "AssistantContentBlock") {
27330
+ emitArtifacts(resourceLinkArtifacts(event.content));
27331
+ continue;
27332
+ }
27274
27333
  if (event._tag === "CompactionUpdated") {
27275
27334
  applyCompactionUpdate(event);
27276
27335
  continue;
@@ -28334,7 +28393,7 @@ import { nodeStreamsFromHandle } from "@ycodium-ai/plugin-api/process-stdin";
28334
28393
  import * as NodeCrypto2 from "node:crypto";
28335
28394
  import * as NodeFSP from "node:fs/promises";
28336
28395
  import * as NodeOS from "node:os";
28337
- import * as NodePath from "node:path";
28396
+ import * as NodePath2 from "node:path";
28338
28397
  import { mergeLaunchEnv } from "@ycodium-ai/plugin-api/executor";
28339
28398
 
28340
28399
  // src/hostPlatform.ts
@@ -28350,7 +28409,7 @@ function sha256Hex(value) {
28350
28409
  function expandHomePath(value) {
28351
28410
  if (value === "~") return NodeOS.homedir();
28352
28411
  if (value.startsWith("~/") || value.startsWith("~\\")) {
28353
- return NodePath.join(NodeOS.homedir(), value.slice(2));
28412
+ return NodePath2.join(NodeOS.homedir(), value.slice(2));
28354
28413
  }
28355
28414
  return value;
28356
28415
  }
@@ -28358,12 +28417,12 @@ function resolveAntigravityDirectories(input2) {
28358
28417
  const key = sha256Hex(input2.instanceId);
28359
28418
  const homePath = input2.homePath.trim();
28360
28419
  const custom2 = homePath.length > 0;
28361
- const profile = custom2 ? NodePath.resolve(expandHomePath(homePath)) : NodePath.join(input2.dataDir, "profiles", key);
28420
+ const profile = custom2 ? NodePath2.resolve(expandHomePath(homePath)) : NodePath2.join(input2.dataDir, "profiles", key);
28362
28421
  const continuationSource = custom2 ? `home\0${(input2.platform ?? HOST_PLATFORM) === "win32" ? profile.toLowerCase() : profile}` : `instance\0${input2.instanceId}`;
28363
28422
  return {
28364
28423
  profile,
28365
- runtimeTempRoot: NodePath.join(input2.dataDir, "tmp", key.slice(0, 12)),
28366
- modelCacheFile: NodePath.join(input2.dataDir, "model-cache", `${key}.json`),
28424
+ runtimeTempRoot: NodePath2.join(input2.dataDir, "tmp", key.slice(0, 12)),
28425
+ modelCacheFile: NodePath2.join(input2.dataDir, "model-cache", `${key}.json`),
28367
28426
  continuationKey: `antigravity:profile:${sha256Hex(continuationSource).slice(0, 16)}`
28368
28427
  };
28369
28428
  }
@@ -28411,10 +28470,10 @@ function antigravityLaunchArgs(platform2 = HOST_PLATFORM) {
28411
28470
  return platform2 === "linux" ? ["--uid="] : [];
28412
28471
  }
28413
28472
  async function prepareAntigravityProfile(profile) {
28414
- const acpDirectory = NodePath.join(profile, "antigravity-acp");
28473
+ const acpDirectory = NodePath2.join(profile, "antigravity-acp");
28415
28474
  await NodeFSP.mkdir(acpDirectory, { recursive: true, mode: 448 });
28416
28475
  await NodeFSP.writeFile(
28417
- NodePath.join(acpDirectory, "settings.json"),
28476
+ NodePath2.join(acpDirectory, "settings.json"),
28418
28477
  `${JSON.stringify({ auth: { type: "oauth-personal" } })}
28419
28478
  `,
28420
28479
  "utf8"
@@ -28423,13 +28482,13 @@ async function prepareAntigravityProfile(profile) {
28423
28482
  var liveRuntimeTempDirs = /* @__PURE__ */ new Set();
28424
28483
  async function createRuntimeTempDir(root) {
28425
28484
  await NodeFSP.mkdir(root, { recursive: true, mode: 448 });
28426
- const directory = await NodeFSP.mkdtemp(NodePath.join(root, RUN_DIR_PREFIX));
28485
+ const directory = await NodeFSP.mkdtemp(NodePath2.join(root, RUN_DIR_PREFIX));
28427
28486
  liveRuntimeTempDirs.add(directory);
28428
28487
  return directory;
28429
28488
  }
28430
28489
  async function removeRuntimeTempDir(directory) {
28431
28490
  liveRuntimeTempDirs.delete(directory);
28432
- if (!NodePath.isAbsolute(directory) || !NodePath.basename(directory).startsWith(RUN_DIR_PREFIX)) {
28491
+ if (!NodePath2.isAbsolute(directory) || !NodePath2.basename(directory).startsWith(RUN_DIR_PREFIX)) {
28433
28492
  return false;
28434
28493
  }
28435
28494
  try {
@@ -28449,7 +28508,7 @@ async function sweepRuntimeTempDirs(root) {
28449
28508
  let removed = 0;
28450
28509
  for (const name of names) {
28451
28510
  if (!name.startsWith(RUN_DIR_PREFIX)) continue;
28452
- const directory = NodePath.join(root, name);
28511
+ const directory = NodePath2.join(root, name);
28453
28512
  if (liveRuntimeTempDirs.has(directory)) continue;
28454
28513
  if (await removeRuntimeTempDir(directory)) removed += 1;
28455
28514
  }
@@ -28881,16 +28940,16 @@ function createBackgroundCommandTracker(input2) {
28881
28940
 
28882
28941
  // src/clientFiles.ts
28883
28942
  import * as NodeFSP2 from "node:fs/promises";
28884
- import * as NodePath2 from "node:path";
28943
+ import * as NodePath3 from "node:path";
28885
28944
  var CLIENT_FILE_MAX_BYTES = 8 * 1024 * 1024;
28886
28945
  function isRecord9(value) {
28887
28946
  return typeof value === "object" && value !== null && !Array.isArray(value);
28888
28947
  }
28889
28948
  function isInside(root, candidate) {
28890
- const relative2 = NodePath2.relative(root, candidate);
28949
+ const relative2 = NodePath3.relative(root, candidate);
28891
28950
  if (relative2 === "") return true;
28892
- const escapes = relative2 === ".." || relative2.startsWith(`..${NodePath2.sep}`);
28893
- return !escapes && !NodePath2.isAbsolute(relative2);
28951
+ const escapes = relative2 === ".." || relative2.startsWith(`..${NodePath3.sep}`);
28952
+ return !escapes && !NodePath3.isAbsolute(relative2);
28894
28953
  }
28895
28954
  async function realpathOrSelf(target) {
28896
28955
  try {
@@ -28903,13 +28962,13 @@ async function realTarget(resolved) {
28903
28962
  try {
28904
28963
  return await NodeFSP2.realpath(resolved);
28905
28964
  } catch {
28906
- const parent = NodePath2.dirname(resolved);
28965
+ const parent = NodePath3.dirname(resolved);
28907
28966
  if (parent === resolved) return resolved;
28908
- return NodePath2.join(await realTarget(parent), NodePath2.basename(resolved));
28967
+ return NodePath3.join(await realTarget(parent), NodePath3.basename(resolved));
28909
28968
  }
28910
28969
  }
28911
28970
  async function resolveInside(requestPath, cwd, roots) {
28912
- const target = await realTarget(NodePath2.resolve(cwd, requestPath));
28971
+ const target = await realTarget(NodePath3.resolve(cwd, requestPath));
28913
28972
  const realRoots = await Promise.all(roots.map(realpathOrSelf));
28914
28973
  if (!realRoots.some((root) => isInside(root, target))) {
28915
28974
  throw RequestError.invalidParams(
@@ -28971,7 +29030,7 @@ async function writeTextFile(params, roots) {
28971
29030
  const content = requireString(params, "content");
28972
29031
  const filePath = await resolveInside(requestPath, roots.cwd, [roots.cwd]);
28973
29032
  try {
28974
- await NodeFSP2.mkdir(NodePath2.dirname(filePath), { recursive: true });
29033
+ await NodeFSP2.mkdir(NodePath3.dirname(filePath), { recursive: true });
28975
29034
  await NodeFSP2.writeFile(filePath, content, "utf8");
28976
29035
  } catch {
28977
29036
  throw RequestError.internalError(void 0, `Could not write '${requestPath}'.`);
@@ -29140,7 +29199,7 @@ function forwardCallback(callback, timeoutMs = FORWARD_TIMEOUT_MS) {
29140
29199
 
29141
29200
  // src/modelCache.ts
29142
29201
  import * as NodeFSP3 from "node:fs/promises";
29143
- import * as NodePath3 from "node:path";
29202
+ import * as NodePath4 from "node:path";
29144
29203
  var SCHEMA_VERSION = 1;
29145
29204
  function isRecord11(value) {
29146
29205
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -29216,7 +29275,7 @@ function updateAntigravityModelCache(file2, patch) {
29216
29275
  ...currentModel === void 0 ? {} : { currentModel },
29217
29276
  models: catalog?.models ?? existing?.models ?? []
29218
29277
  };
29219
- await NodeFSP3.mkdir(NodePath3.dirname(file2), { recursive: true });
29278
+ await NodeFSP3.mkdir(NodePath4.dirname(file2), { recursive: true });
29220
29279
  const temporary = `${file2}.${String(process.pid)}.tmp`;
29221
29280
  await NodeFSP3.writeFile(temporary, `${JSON.stringify(merged)}
29222
29281
  `, "utf8");
@@ -29236,12 +29295,12 @@ function updateAntigravityModelCache(file2, patch) {
29236
29295
 
29237
29296
  // src/runtime.ts
29238
29297
  import * as NodeFSP5 from "node:fs/promises";
29239
- import * as NodePath5 from "node:path";
29298
+ import * as NodePath6 from "node:path";
29240
29299
 
29241
29300
  // src/managedRuntime.ts
29242
29301
  import * as NodeCrypto4 from "node:crypto";
29243
29302
  import * as NodeFSP4 from "node:fs/promises";
29244
- import * as NodePath4 from "node:path";
29303
+ import * as NodePath5 from "node:path";
29245
29304
  var RELEASE_RECORD_FILE = ".install-complete.json";
29246
29305
  var RELEASE_ID_PATTERN = /^[a-f0-9]{64}$/u;
29247
29306
  var RECORD_MAX_BYTES = 8 * 1024;
@@ -29249,15 +29308,15 @@ var ManagedRuntimeInvalidError = class extends Error {
29249
29308
  name = "ManagedRuntimeInvalidError";
29250
29309
  };
29251
29310
  function managedLayout(dataDir, platform2, arch2) {
29252
- const root = NodePath4.join(dataDir, "runtime", `${platform2}-${arch2}`);
29311
+ const root = NodePath5.join(dataDir, "runtime", `${platform2}-${arch2}`);
29253
29312
  return {
29254
29313
  root,
29255
- versionsDir: NodePath4.join(root, "versions"),
29256
- activeFile: NodePath4.join(root, "active.json")
29314
+ versionsDir: NodePath5.join(root, "versions"),
29315
+ activeFile: NodePath5.join(root, "active.json")
29257
29316
  };
29258
29317
  }
29259
29318
  function versionDirectoryOf(layout, releaseId) {
29260
- return NodePath4.join(layout.versionsDir, releaseId);
29319
+ return NodePath5.join(layout.versionsDir, releaseId);
29261
29320
  }
29262
29321
  function isRecord12(value) {
29263
29322
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -29315,7 +29374,7 @@ async function readCompletedRelease(input2) {
29315
29374
  const directory = versionDirectoryOf(input2.layout, input2.releaseId);
29316
29375
  let parsed;
29317
29376
  try {
29318
- parsed = await readSmallJson(NodePath4.join(directory, RELEASE_RECORD_FILE));
29377
+ parsed = await readSmallJson(NodePath5.join(directory, RELEASE_RECORD_FILE));
29319
29378
  } catch (error62) {
29320
29379
  if (isMissing(error62)) throw incomplete;
29321
29380
  throw error62;
@@ -29327,8 +29386,8 @@ async function readCompletedRelease(input2) {
29327
29386
  if (parsed["releaseId"] !== input2.releaseId || executable === void 0 || harness === void 0 || typeof version2 !== "string" || version2.trim().length === 0 || executable.name !== input2.names.executable || harness.name !== input2.names.harness) {
29328
29387
  throw incomplete;
29329
29388
  }
29330
- const executablePath = NodePath4.join(directory, executable.name);
29331
- const harnessPath = NodePath4.join(directory, harness.name);
29389
+ const executablePath = NodePath5.join(directory, executable.name);
29390
+ const harnessPath = NodePath5.join(directory, harness.name);
29332
29391
  if (!await isExecutableFile(executablePath, executable.bytes, input2.platform) || !await isExecutableFile(harnessPath, harness.bytes, input2.platform)) {
29333
29392
  throw incomplete;
29334
29393
  }
@@ -29347,7 +29406,7 @@ async function readActiveRelease(input2) {
29347
29406
  }
29348
29407
  async function writeReleaseRecord(directory, record2) {
29349
29408
  await NodeFSP4.writeFile(
29350
- NodePath4.join(directory, RELEASE_RECORD_FILE),
29409
+ NodePath5.join(directory, RELEASE_RECORD_FILE),
29351
29410
  `${JSON.stringify(record2)}
29352
29411
  `,
29353
29412
  { flag: "wx", mode: 384 }
@@ -29355,7 +29414,7 @@ async function writeReleaseRecord(directory, record2) {
29355
29414
  }
29356
29415
  async function writeActiveRelease(layout, releaseId) {
29357
29416
  await NodeFSP4.mkdir(layout.root, { recursive: true });
29358
- const pending = NodePath4.join(
29417
+ const pending = NodePath5.join(
29359
29418
  layout.root,
29360
29419
  `active.json.${NodeCrypto4.randomBytes(6).toString("hex")}.tmp`
29361
29420
  );
@@ -29403,14 +29462,14 @@ function readPathValue(instanceEnvironment, processEnv, platform2) {
29403
29462
  return lookup(instanceEnvironment) ?? lookup(processEnv) ?? "";
29404
29463
  }
29405
29464
  function pathCandidates(binary, pathValue) {
29406
- return pathValue.split(NodePath5.delimiter).map((directory) => directory.trim().replace(/^"|"$/gu, "")).filter((directory) => directory.length > 0).map((directory) => NodePath5.resolve(directory, binary));
29465
+ return pathValue.split(NodePath6.delimiter).map((directory) => directory.trim().replace(/^"|"$/gu, "")).filter((directory) => directory.length > 0).map((directory) => NodePath6.resolve(directory, binary));
29407
29466
  }
29408
29467
  async function managedDirectoryOf(executablePath, managed) {
29409
29468
  if (managed === void 0) return null;
29410
29469
  try {
29411
29470
  const realVersions = await NodeFSP5.realpath(managed.versionsDir);
29412
- const directory = NodePath5.dirname(executablePath);
29413
- return NodePath5.dirname(directory) === realVersions && RELEASE_ID_PATTERN.test(NodePath5.basename(directory)) ? directory : null;
29471
+ const directory = NodePath6.dirname(executablePath);
29472
+ return NodePath6.dirname(directory) === realVersions && RELEASE_ID_PATTERN.test(NodePath6.basename(directory)) ? directory : null;
29414
29473
  } catch {
29415
29474
  return null;
29416
29475
  }
@@ -29423,7 +29482,7 @@ async function resolveAntigravityExecutable(input2) {
29423
29482
  const accept = async (candidate, source) => {
29424
29483
  if (!await isExecutableFile2(candidate, platform2)) return void 0;
29425
29484
  const executablePath = await NodeFSP5.realpath(candidate);
29426
- const harnessPath = NodePath5.join(NodePath5.dirname(executablePath), names.harness);
29485
+ const harnessPath = NodePath6.join(NodePath6.dirname(executablePath), names.harness);
29427
29486
  if (!await isExecutableFile2(harnessPath, platform2)) return void 0;
29428
29487
  return {
29429
29488
  executablePath,
@@ -29434,7 +29493,7 @@ async function resolveAntigravityExecutable(input2) {
29434
29493
  };
29435
29494
  };
29436
29495
  if (configured.length > 0) {
29437
- const candidates = NodePath5.isAbsolute(configured) || configured.includes("/") || configured.includes("\\") ? [NodePath5.resolve(configured)] : pathCandidates(configured, pathValue);
29496
+ const candidates = NodePath6.isAbsolute(configured) || configured.includes("/") || configured.includes("\\") ? [NodePath6.resolve(configured)] : pathCandidates(configured, pathValue);
29438
29497
  for (const candidate of candidates) {
29439
29498
  const found = await accept(candidate, "configured");
29440
29499
  if (found !== void 0) return found;
@@ -29473,10 +29532,10 @@ async function resolveAntigravityExecutable(input2) {
29473
29532
 
29474
29533
  // src/signedInMarker.ts
29475
29534
  import * as NodeFSP6 from "node:fs/promises";
29476
- import * as NodePath6 from "node:path";
29535
+ import * as NodePath7 from "node:path";
29477
29536
  var SCHEMA_VERSION2 = 1;
29478
29537
  function signedInMarkerFile(profile) {
29479
- return NodePath6.join(profile, "antigravity-acp", "ycodium-signed-in.json");
29538
+ return NodePath7.join(profile, "antigravity-acp", "ycodium-signed-in.json");
29480
29539
  }
29481
29540
  async function readSignedInMarker(file2) {
29482
29541
  try {
@@ -29487,7 +29546,7 @@ async function readSignedInMarker(file2) {
29487
29546
  }
29488
29547
  }
29489
29548
  async function writeSignedInMarker(file2) {
29490
- await NodeFSP6.mkdir(NodePath6.dirname(file2), { recursive: true, mode: 448 });
29549
+ await NodeFSP6.mkdir(NodePath7.dirname(file2), { recursive: true, mode: 448 });
29491
29550
  const temporary = `${file2}.${String(process.pid)}.tmp`;
29492
29551
  await NodeFSP6.writeFile(
29493
29552
  temporary,
@@ -30260,14 +30319,14 @@ import { nodeStreamsFromHandle as nodeStreamsFromHandle2 } from "@ycodium-ai/plu
30260
30319
 
30261
30320
  // src/sessionFiles.ts
30262
30321
  import * as NodeFSP7 from "node:fs/promises";
30263
- import * as NodePath7 from "node:path";
30322
+ import * as NodePath8 from "node:path";
30264
30323
  var UUID_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;
30265
30324
  var SESSION_FILE_SUFFIXES = [".db", ".db-wal", ".db-shm", ".db-journal", ".meta"];
30266
30325
  async function removeTemporarySessionFiles(input2) {
30267
30326
  const { sessionId } = input2;
30268
30327
  if (sessionId === void 0 || !UUID_V4.test(sessionId)) return false;
30269
- const acpDirectory = NodePath7.join(input2.profile, "antigravity-acp");
30270
- const base = NodePath7.join(acpDirectory, "conversations", sessionId);
30328
+ const acpDirectory = NodePath8.join(input2.profile, "antigravity-acp");
30329
+ const base = NodePath8.join(acpDirectory, "conversations", sessionId);
30271
30330
  try {
30272
30331
  const meta3 = JSON.parse(await NodeFSP7.readFile(`${base}.meta`, "utf8"));
30273
30332
  const cwd = typeof meta3 === "object" && meta3 !== null ? meta3.cwd : null;
@@ -30275,7 +30334,7 @@ async function removeTemporarySessionFiles(input2) {
30275
30334
  for (const suffix of SESSION_FILE_SUFFIXES) {
30276
30335
  await NodeFSP7.rm(`${base}${suffix}`, { force: true });
30277
30336
  }
30278
- await NodeFSP7.rm(NodePath7.join(acpDirectory, "brain", sessionId), {
30337
+ await NodeFSP7.rm(NodePath8.join(acpDirectory, "brain", sessionId), {
30279
30338
  recursive: true,
30280
30339
  force: true
30281
30340
  });
@@ -30287,7 +30346,7 @@ async function removeTemporarySessionFiles(input2) {
30287
30346
 
30288
30347
  // src/textGenerationAvailability.ts
30289
30348
  import * as NodeFSP8 from "node:fs/promises";
30290
- import * as NodePath8 from "node:path";
30349
+ import * as NodePath9 from "node:path";
30291
30350
  var MAX_CONFIG_BYTES = 64e3;
30292
30351
  var CONFIG_FILES = [
30293
30352
  { name: "hooks.json", key: "hooks" },
@@ -30308,7 +30367,7 @@ async function configIsEmpty(file2, key) {
30308
30367
  }
30309
30368
  async function isTextGenerationAvailable(profile) {
30310
30369
  for (const { name, key } of CONFIG_FILES) {
30311
- const file2 = NodePath8.join(profile, "config", name);
30370
+ const file2 = NodePath9.join(profile, "config", name);
30312
30371
  try {
30313
30372
  await NodeFSP8.lstat(file2);
30314
30373
  } catch (error62) {
@@ -31052,7 +31111,7 @@ function antigravityPermissionUserInput(request2) {
31052
31111
  // src/userSkills.ts
31053
31112
  import * as NodeFSP10 from "node:fs/promises";
31054
31113
  import * as NodeOS2 from "node:os";
31055
- import * as NodePath9 from "node:path";
31114
+ import * as NodePath10 from "node:path";
31056
31115
  var ANTIGRAVITY_SKILL_SCAN_LIMITS = {
31057
31116
  maxSkillBytes: 1e6,
31058
31117
  maxScanBytes: 8e6,
@@ -31070,24 +31129,24 @@ function resolveAntigravityUserHome(platform2, environment) {
31070
31129
  }
31071
31130
  function antigravityUserSkillDirectories(geminiHome) {
31072
31131
  return [
31073
- NodePath9.join(geminiHome, "config", "skills"),
31074
- NodePath9.join(geminiHome, "antigravity-cli", "skills")
31132
+ NodePath10.join(geminiHome, "config", "skills"),
31133
+ NodePath10.join(geminiHome, "antigravity-cli", "skills")
31075
31134
  ];
31076
31135
  }
31077
31136
  var sameFilePath = (platform2, left, right) => platform2 === "win32" ? left.toLowerCase() === right.toLowerCase() : left === right;
31078
31137
  async function linkOne(link, target, platform2) {
31079
- if (sameFilePath(platform2, NodePath9.resolve(link), target)) return "kept";
31138
+ if (sameFilePath(platform2, NodePath10.resolve(link), target)) return "kept";
31080
31139
  const existing = await NodeFSP10.lstat(link).catch((error62) => {
31081
31140
  if (error62.code === "ENOENT") return void 0;
31082
31141
  throw error62;
31083
31142
  });
31084
31143
  if (existing !== void 0) {
31085
31144
  if (!existing.isSymbolicLink()) return "kept";
31086
- const current = NodePath9.resolve(NodePath9.dirname(link), await NodeFSP10.readlink(link));
31145
+ const current = NodePath10.resolve(NodePath10.dirname(link), await NodeFSP10.readlink(link));
31087
31146
  if (sameFilePath(platform2, current, target)) return "already";
31088
31147
  await NodeFSP10.unlink(link);
31089
31148
  }
31090
- await NodeFSP10.mkdir(NodePath9.dirname(link), { recursive: true });
31149
+ await NodeFSP10.mkdir(NodePath10.dirname(link), { recursive: true });
31091
31150
  try {
31092
31151
  await NodeFSP10.symlink(target, link, platform2 === "win32" ? "junction" : "dir");
31093
31152
  } catch (error62) {
@@ -31098,7 +31157,7 @@ async function linkOne(link, target, platform2) {
31098
31157
  async function linkAntigravityUserSkills(input2) {
31099
31158
  const links = antigravityUserSkillDirectories(input2.profile);
31100
31159
  const targets = antigravityUserSkillDirectories(
31101
- NodePath9.resolve(NodePath9.join(input2.userHome, ".gemini"))
31160
+ NodePath10.resolve(NodePath10.join(input2.userHome, ".gemini"))
31102
31161
  );
31103
31162
  const results = [];
31104
31163
  for (const [index, link] of links.entries()) {
@@ -31231,7 +31290,7 @@ async function readSkillFile(skillPath, budget, maxSkillBytes) {
31231
31290
  }
31232
31291
  }
31233
31292
  async function discoverAntigravityUserSkills(userHome, limits = ANTIGRAVITY_SKILL_SCAN_LIMITS) {
31234
- const roots = antigravityUserSkillDirectories(NodePath9.join(userHome, ".gemini"));
31293
+ const roots = antigravityUserSkillDirectories(NodePath10.join(userHome, ".gemini"));
31235
31294
  const budget = {
31236
31295
  remainingBytes: limits.maxScanBytes,
31237
31296
  remainingEntries: limits.maxScanEntries
@@ -31255,7 +31314,7 @@ async function discoverAntigravityUserSkills(userHome, limits = ANTIGRAVITY_SKIL
31255
31314
  const skillFileName = sorted.find((entry) => entry.toLowerCase() === "skill.md");
31256
31315
  if (skillFileName !== void 0) {
31257
31316
  if (!skillFileName.endsWith(".md")) return;
31258
- const skillPath = NodePath9.join(directory, skillFileName);
31317
+ const skillPath = NodePath10.join(directory, skillFileName);
31259
31318
  const contents = await readSkillFile(skillPath, budget, limits.maxSkillBytes);
31260
31319
  if (contents === void 0) return;
31261
31320
  const skill = parseSkillFile(contents, skillFileName);
@@ -31271,7 +31330,7 @@ async function discoverAntigravityUserSkills(userHome, limits = ANTIGRAVITY_SKIL
31271
31330
  }
31272
31331
  if (!scanChildren) return;
31273
31332
  for (const entry of sorted.toSorted(compareSkillEntries)) {
31274
- await scanDirectory(NodePath9.join(directory, entry), false);
31333
+ await scanDirectory(NodePath10.join(directory, entry), false);
31275
31334
  }
31276
31335
  };
31277
31336
  for (const root of roots) await scanDirectory(root, true);
@@ -31996,7 +32055,7 @@ function registerRuntimeCommands(ctx, manager) {
31996
32055
 
31997
32056
  // src/runtimeManager.ts
31998
32057
  import * as NodeFSP12 from "node:fs/promises";
31999
- import * as NodePath12 from "node:path";
32058
+ import * as NodePath13 from "node:path";
32000
32059
 
32001
32060
  // src/release.ts
32002
32061
  var ANTIGRAVITY_RELEASE_VERSION = "agy_acp_server_1.1.1";
@@ -32066,7 +32125,7 @@ var Yauzl = __toESM(require_yauzl(), 1);
32066
32125
  import * as NodeCrypto6 from "node:crypto";
32067
32126
  import * as NodeFS from "node:fs";
32068
32127
  import * as NodeFSP11 from "node:fs/promises";
32069
- import * as NodePath10 from "node:path";
32128
+ import * as NodePath11 from "node:path";
32070
32129
  import * as NodeStream2 from "node:stream";
32071
32130
  import * as NodeStreamPromises from "node:stream/promises";
32072
32131
  var DOWNLOAD_TIMEOUT_MS = 45 * 60 * 1e3;
@@ -32106,7 +32165,7 @@ async function sweepStaging(versionsDir) {
32106
32165
  }
32107
32166
  for (const name of names) {
32108
32167
  if (!name.startsWith(STAGING_PREFIX)) continue;
32109
- await removeTree(NodePath10.join(versionsDir, name)).catch(() => void 0);
32168
+ await removeTree(NodePath11.join(versionsDir, name)).catch(() => void 0);
32110
32169
  }
32111
32170
  }
32112
32171
  async function downloadArchive(input2, archivePath) {
@@ -32273,7 +32332,7 @@ async function extractPair(archivePath, outDirectory, asset) {
32273
32332
  await NodeStreamPromises.pipeline(
32274
32333
  await openEntry(zip, entry),
32275
32334
  limiter,
32276
- NodeFS.createWriteStream(NodePath10.join(outDirectory, entry.fileName), {
32335
+ NodeFS.createWriteStream(NodePath11.join(outDirectory, entry.fileName), {
32277
32336
  flags: "wx",
32278
32337
  mode: 448
32279
32338
  })
@@ -32315,8 +32374,8 @@ async function validateOrThrow(input2, executable) {
32315
32374
  }
32316
32375
  function executableOf(directory, input2, names) {
32317
32376
  return {
32318
- executablePath: NodePath10.join(directory, names.executable),
32319
- harnessPath: NodePath10.join(directory, names.harness),
32377
+ executablePath: NodePath11.join(directory, names.executable),
32378
+ harnessPath: NodePath11.join(directory, names.harness),
32320
32379
  source: "managed",
32321
32380
  version: input2.asset.version,
32322
32381
  managedVersionDirectory: directory
@@ -32362,10 +32421,10 @@ async function installManagedRelease(input2) {
32362
32421
  `Antigravity needs at least ${String(Math.ceil(needed / 1024 / 1024))} MiB of free space to install.`
32363
32422
  );
32364
32423
  }
32365
- const staging = await NodeFSP11.mkdtemp(NodePath10.join(layout.versionsDir, STAGING_PREFIX));
32424
+ const staging = await NodeFSP11.mkdtemp(NodePath11.join(layout.versionsDir, STAGING_PREFIX));
32366
32425
  try {
32367
- const archivePath = NodePath10.join(staging, "download.zip");
32368
- const pairDirectory = NodePath10.join(staging, "runtime");
32426
+ const archivePath = NodePath11.join(staging, "download.zip");
32427
+ const pairDirectory = NodePath11.join(staging, "runtime");
32369
32428
  await NodeFSP11.mkdir(pairDirectory);
32370
32429
  const downloaded = await downloadArchive(input2, archivePath);
32371
32430
  if (downloaded.bytes !== asset.archiveBytes || downloaded.sha256 !== asset.sha256) {
@@ -32378,8 +32437,8 @@ async function installManagedRelease(input2) {
32378
32437
  await extractPair(archivePath, pairDirectory, asset);
32379
32438
  await NodeFSP11.rm(archivePath, { force: true });
32380
32439
  if (platform2 !== "win32") {
32381
- await NodeFSP11.chmod(NodePath10.join(pairDirectory, asset.executable.name), 493);
32382
- await NodeFSP11.chmod(NodePath10.join(pairDirectory, asset.harness.name), 493);
32440
+ await NodeFSP11.chmod(NodePath11.join(pairDirectory, asset.executable.name), 493);
32441
+ await NodeFSP11.chmod(NodePath11.join(pairDirectory, asset.harness.name), 493);
32383
32442
  }
32384
32443
  await validateOrThrow(input2, executableOf(pairDirectory, input2, names));
32385
32444
  await writeReleaseRecord(pairDirectory, {
@@ -32412,7 +32471,7 @@ async function installManagedRelease(input2) {
32412
32471
 
32413
32472
  // src/runtimeValidate.ts
32414
32473
  import { nodeStreamsFromHandle as nodeStreamsFromHandle4 } from "@ycodium-ai/plugin-api/process-stdin";
32415
- import * as NodePath11 from "node:path";
32474
+ import * as NodePath12 from "node:path";
32416
32475
  var VALIDATE_REQUEST_TIMEOUT_MS = 9e4;
32417
32476
  var EXIT_WAIT_MS = 1e4;
32418
32477
  var VALIDATE_CLIENT_INFO = { name: "ycodium-agent-antigravity", version: "0.1.0" };
@@ -32448,8 +32507,8 @@ async function waitForExit2(handle) {
32448
32507
  }
32449
32508
  async function validateInstalledRuntime(input2) {
32450
32509
  const platform2 = input2.platform ?? HOST_PLATFORM;
32451
- const profileRoot = NodePath11.join(input2.dataDir, "tmp", "validate-profile");
32452
- const tempRoot = NodePath11.join(input2.dataDir, "tmp", "validate");
32510
+ const profileRoot = NodePath12.join(input2.dataDir, "tmp", "validate-profile");
32511
+ const tempRoot = NodePath12.join(input2.dataDir, "tmp", "validate");
32453
32512
  await sweepRuntimeTempDirs(profileRoot);
32454
32513
  await sweepRuntimeTempDirs(tempRoot);
32455
32514
  const profile = await createRuntimeTempDir(profileRoot);
@@ -32662,8 +32721,8 @@ function createRuntimeManager(deps) {
32662
32721
  if (!(error62 instanceof AntigravityRuntimeError)) throw error62;
32663
32722
  }
32664
32723
  if (realRoot !== void 0) {
32665
- const real = await NodeFSP12.realpath(configured).catch(() => NodePath12.resolve(configured));
32666
- if (real.startsWith(`${realRoot}${NodePath12.sep}`)) return true;
32724
+ const real = await NodeFSP12.realpath(configured).catch(() => NodePath13.resolve(configured));
32725
+ if (real.startsWith(`${realRoot}${NodePath13.sep}`)) return true;
32667
32726
  }
32668
32727
  }
32669
32728
  return false;
@@ -32707,8 +32766,8 @@ function createRuntimeManager(deps) {
32707
32766
  for (const entry of instances) {
32708
32767
  const configured = entry.binaryPath.trim();
32709
32768
  if (configured.length === 0) continue;
32710
- const target = await NodeFSP12.realpath(configured).catch(() => NodePath12.resolve(configured));
32711
- if (target.startsWith(`${real}${NodePath12.sep}`)) return true;
32769
+ const target = await NodeFSP12.realpath(configured).catch(() => NodePath13.resolve(configured));
32770
+ if (target.startsWith(`${real}${NodePath13.sep}`)) return true;
32712
32771
  }
32713
32772
  return false;
32714
32773
  };
@@ -32723,11 +32782,11 @@ function createRuntimeManager(deps) {
32723
32782
  try {
32724
32783
  await removeDirectory(directory);
32725
32784
  deps.log.info("removed an old antigravity runtime version", {
32726
- releaseId: NodePath12.basename(directory)
32785
+ releaseId: NodePath13.basename(directory)
32727
32786
  });
32728
32787
  } catch (error62) {
32729
32788
  deps.log.warn("could not remove an old antigravity runtime version", {
32730
- releaseId: NodePath12.basename(directory),
32789
+ releaseId: NodePath13.basename(directory),
32731
32790
  error: error62 instanceof Error ? error62.message : String(error62)
32732
32791
  });
32733
32792
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-antigravity",
3
- "version": "0.2.2882",
3
+ "version": "0.2.2892",
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-acp-executor": "0.2.2882",
35
- "ycodium-executor-testing": "0.0.0",
36
- "@ycodium-ai/plugin-api": "0.2.2882"
34
+ "ycodium-acp-executor": "0.2.2892",
35
+ "@ycodium-ai/plugin-api": "0.2.2892",
36
+ "ycodium-executor-testing": "0.0.0"
37
37
  },
38
38
  "ycodium": {
39
39
  "plugin": "./dist/index.js",