@ycodium-ai/agent-antigravity 0.2.2984 → 0.2.2990

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 -21
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -25033,6 +25033,12 @@ var AcpExecutorDisposedError = class extends AcpExecutorError {
25033
25033
  this.name = "AcpExecutorDisposedError";
25034
25034
  }
25035
25035
  };
25036
+ var AcpExecutorTurnEndedError = class extends AcpExecutorError {
25037
+ constructor(message = "The target turn has ended. The message was not sent.") {
25038
+ super("provider-rejected", message);
25039
+ this.name = "AcpExecutorTurnEndedError";
25040
+ }
25041
+ };
25036
25042
  var AcpExecutorNotStartedError = class extends AcpExecutorError {
25037
25043
  constructor(message = "ACP session has not been started") {
25038
25044
  super("not-started", message);
@@ -25798,6 +25804,12 @@ function asTrimmedString(value) {
25798
25804
  const trimmed = value.trim();
25799
25805
  return trimmed.length > 0 ? trimmed : void 0;
25800
25806
  }
25807
+ var selectPromptTurnId = (input2, activeTurnId, freshTurnId) => {
25808
+ const target = input2.expectedActiveTurnId;
25809
+ if (target === void 0) return input2.turnId ?? activeTurnId ?? freshTurnId();
25810
+ if (activeTurnId !== target) throw new AcpExecutorTurnEndedError();
25811
+ return target;
25812
+ };
25801
25813
 
25802
25814
  // ../../packages/ycodium-acp-executor/src/tool-presentation.ts
25803
25815
  function normalizeCommandValue(value) {
@@ -27967,7 +27979,7 @@ function createAcpExecutor(options2) {
27967
27979
  await threadMutex.acquire();
27968
27980
  try {
27969
27981
  failIfDisposed();
27970
- turnId = input2.turnId ?? (promptsInFlight > 0 ? activeTurnId : void 0) ?? randomId();
27982
+ turnId = selectPromptTurnId(input2, promptsInFlight > 0 ? activeTurnId : void 0, randomId);
27971
27983
  promptsInFlight += 1;
27972
27984
  activeTurnId = turnId;
27973
27985
  status = "running";
@@ -27989,20 +28001,20 @@ function createAcpExecutor(options2) {
27989
28001
  let response;
27990
28002
  try {
27991
28003
  failIfDisposed();
27992
- if (interruptedTurnIds.has(turnId)) {
28004
+ const queuedTurnId = turnId;
28005
+ const isStale = () => interruptedTurnIds.has(queuedTurnId) || input2.expectedActiveTurnId !== void 0 && activeTurnId !== queuedTurnId;
28006
+ if (!isStale()) {
28007
+ modelSelectionState = await applyRequestedModel({
28008
+ state: modelSelectionState,
28009
+ acpSessionId: started.sessionId,
28010
+ requestedModelId: input2.requestedModelId,
28011
+ expectedGeneration: started.generation
28012
+ });
28013
+ }
28014
+ if (isStale()) {
27993
28015
  settle2({ turnId, stopReason: "cancelled", state: "cancelled" });
27994
- return {
27995
- threadId: options2.threadId,
27996
- turnId,
27997
- stopReason: "cancelled"
27998
- };
28016
+ return { threadId: options2.threadId, turnId, stopReason: "cancelled" };
27999
28017
  }
28000
- modelSelectionState = await applyRequestedModel({
28001
- state: modelSelectionState,
28002
- acpSessionId: started.sessionId,
28003
- requestedModelId: input2.requestedModelId,
28004
- expectedGeneration: started.generation
28005
- });
28006
28018
  closeActiveAssistantSegment(turnId);
28007
28019
  let written = false;
28008
28020
  try {
@@ -28132,10 +28144,7 @@ function createAcpExecutor(options2) {
28132
28144
  provider: options2.provider,
28133
28145
  threadId: options2.threadId,
28134
28146
  turnId: targetTurnId,
28135
- payload: {
28136
- state: "cancelled",
28137
- stopReason: "cancelled"
28138
- }
28147
+ payload: { state: "cancelled", stopReason: "cancelled" }
28139
28148
  });
28140
28149
  interruptedTurnIds.delete(targetTurnId);
28141
28150
  }
@@ -29104,9 +29113,6 @@ function parseAntigravityInstanceConfig(config2) {
29104
29113
  };
29105
29114
  }
29106
29115
 
29107
- // src/loginController.ts
29108
- import { ExecutorSpawnRefusedError } from "@ycodium-ai/plugin-api/executor";
29109
-
29110
29116
  // src/loginUrl.ts
29111
29117
  import * as NodeHttp from "node:http";
29112
29118
  var MAX_URL_LENGTH = 16384;
@@ -29584,7 +29590,8 @@ async function clearSignedInMarker(file2) {
29584
29590
  await NodeFSP6.rm(file2, { force: true });
29585
29591
  }
29586
29592
 
29587
- // src/loginController.ts
29593
+ // src/loginAuth.ts
29594
+ import { ExecutorSpawnRefusedError } from "@ycodium-ai/plugin-api/executor";
29588
29595
  var AUTH_DEADLINE_MS = 3e5;
29589
29596
  var AGENT_STARTUP_TIMEOUT_MS = 9e4;
29590
29597
  var OAUTH_PERSONAL = "oauth-personal";
@@ -29640,6 +29647,8 @@ function advertisesLogout(initialized) {
29640
29647
  const auth = isRecord13(capabilities) ? capabilities["auth"] : void 0;
29641
29648
  return isRecord13(auth) && Boolean(auth["logout"]);
29642
29649
  }
29650
+
29651
+ // src/loginController.ts
29643
29652
  function createLoginController(deps) {
29644
29653
  const { host } = deps;
29645
29654
  const authDeadlineMs = deps.authDeadlineMs ?? AUTH_DEADLINE_MS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-antigravity",
3
- "version": "0.2.2984",
3
+ "version": "0.2.2990",
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.2984",
35
- "ycodium-acp-executor": "0.2.2984",
36
- "ycodium-executor-testing": "0.0.0"
34
+ "@ycodium-ai/plugin-api": "0.2.2990",
35
+ "ycodium-executor-testing": "0.0.0",
36
+ "ycodium-acp-executor": "0.2.2990"
37
37
  },
38
38
  "ycodium": {
39
39
  "plugin": "./dist/index.js",