@integrity-labs/agt-cli 0.28.318 → 0.28.320

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.
@@ -149,6 +149,13 @@ function probeMcpEnvSubstitution(args) {
149
149
 
150
150
  // ../../packages/core/dist/types/agent.js
151
151
  var DEFAULT_FRAMEWORK = "claude-code";
152
+ var FRAMEWORK_DEPRECATION = {
153
+ "claude-code": false,
154
+ "opencode": false
155
+ };
156
+ function isDeprecatedFramework(id) {
157
+ return FRAMEWORK_DEPRECATION[id] === true;
158
+ }
152
159
 
153
160
  // ../../packages/core/dist/types/models.js
154
161
  function claudeModelAlias(primaryModel) {
@@ -5067,7 +5074,12 @@ var INTEGRATION_REGISTRY = [
5067
5074
  },
5068
5075
  // ENG-5857 mints the real session id; default empty so the header
5069
5076
  // resolves cleanly (no profile bound → ephemeral session) until then.
5070
- envDefaults: { ANCHOR_BROWSER_SESSION_ID: "" }
5077
+ envDefaults: { ANCHOR_BROWSER_SESSION_ID: "" },
5078
+ // ENG-7748: route through the stdio remote-MCP proxy so the api-key and
5079
+ // the minted anchor-session-id headers are read LIVE per request. A
5080
+ // re-minted session id then takes effect with no agent respawn (a direct-
5081
+ // HTTP header would be frozen at spawn).
5082
+ liveHeaderRefresh: true
5071
5083
  }
5072
5084
  },
5073
5085
  {
@@ -5763,6 +5775,174 @@ var INSTALLABLE_NATIVE_INTEGRATION_IDS = INSTALLABLE_NATIVE_INTEGRATIONS.map((i)
5763
5775
  var MB2 = 1024 * 1024;
5764
5776
  var DIRECT_CHAT_UPLOAD_MAX_BYTES = 10 * MB2;
5765
5777
 
5778
+ // ../../packages/core/dist/anchor/types.js
5779
+ var ANCHOR_API_BASE_URL = "https://api.anchorbrowser.io/v1";
5780
+ var ANCHOR_API_KEY_HEADER = "anchor-api-key";
5781
+
5782
+ // ../../packages/core/dist/anchor/client.js
5783
+ var AnchorApiError = class extends Error {
5784
+ status;
5785
+ body;
5786
+ constructor(status, message, body) {
5787
+ super(message);
5788
+ this.name = "AnchorApiError";
5789
+ this.status = status;
5790
+ this.body = body;
5791
+ }
5792
+ };
5793
+ function buildCreateSessionBody(input) {
5794
+ const browser = {};
5795
+ if (input.profileName) {
5796
+ browser["profile"] = { name: input.profileName, persist: Boolean(input.persist) };
5797
+ }
5798
+ if (input.dedicatedStickyIp) {
5799
+ browser["dedicated_sticky_ip"] = true;
5800
+ }
5801
+ const timeout = {};
5802
+ if (typeof input.maxDurationMinutes === "number")
5803
+ timeout["max_duration"] = input.maxDurationMinutes;
5804
+ if (typeof input.idleTimeoutMinutes === "number")
5805
+ timeout["idle_timeout"] = input.idleTimeoutMinutes;
5806
+ const body = {};
5807
+ if (Object.keys(browser).length > 0)
5808
+ body["browser"] = browser;
5809
+ if (Object.keys(timeout).length > 0)
5810
+ body["session"] = { timeout };
5811
+ return body;
5812
+ }
5813
+ function extractSessionId(raw) {
5814
+ if (!raw || typeof raw !== "object")
5815
+ return null;
5816
+ const obj = raw;
5817
+ const data = obj["data"];
5818
+ const candidates = [
5819
+ data && typeof data === "object" ? data["id"] : void 0,
5820
+ data && typeof data === "object" ? data["session_id"] : void 0,
5821
+ obj["id"],
5822
+ obj["session_id"],
5823
+ obj["sessionId"]
5824
+ ];
5825
+ for (const c of candidates) {
5826
+ if (typeof c === "string" && c.length > 0)
5827
+ return c;
5828
+ }
5829
+ return null;
5830
+ }
5831
+ function extractLiveViewUrl(raw) {
5832
+ if (!raw || typeof raw !== "object")
5833
+ return null;
5834
+ const obj = raw;
5835
+ const data = obj["data"];
5836
+ const dataObj = data && typeof data === "object" ? data : void 0;
5837
+ const candidates = [
5838
+ dataObj?.["live_view_url"],
5839
+ dataObj?.["liveViewUrl"],
5840
+ obj["live_view_url"],
5841
+ obj["liveViewUrl"]
5842
+ ];
5843
+ for (const c of candidates) {
5844
+ if (typeof c === "string" && c.length > 0)
5845
+ return c;
5846
+ }
5847
+ return null;
5848
+ }
5849
+ var AnchorSessionClient = class {
5850
+ apiKey;
5851
+ baseUrl;
5852
+ timeoutMs;
5853
+ fetchImpl;
5854
+ constructor(opts) {
5855
+ if (!opts.apiKey) {
5856
+ throw new Error("AnchorSessionClient requires an apiKey");
5857
+ }
5858
+ this.apiKey = opts.apiKey;
5859
+ this.baseUrl = (opts.baseUrl ?? ANCHOR_API_BASE_URL).replace(/\/+$/, "");
5860
+ this.timeoutMs = opts.timeoutMs ?? 3e4;
5861
+ this.fetchImpl = opts.fetchImpl ?? fetch;
5862
+ }
5863
+ /**
5864
+ * Mint a session (`POST /sessions`). With a `profileName` the session resumes
5865
+ * that profile's authenticated state; without one it is a fresh stateless
5866
+ * browser. Throws {@link AnchorApiError} on a non-2xx, or a plain Error when
5867
+ * the response carries no locatable session id.
5868
+ */
5869
+ async createSession(input = {}) {
5870
+ const raw = await this.request("POST", "/sessions", buildCreateSessionBody(input));
5871
+ const sessionId = extractSessionId(raw);
5872
+ if (!sessionId) {
5873
+ throw new Error("Anchor createSession returned no locatable session id");
5874
+ }
5875
+ const liveViewUrl = extractLiveViewUrl(raw);
5876
+ return { sessionId, ...liveViewUrl ? { liveViewUrl } : {}, raw };
5877
+ }
5878
+ /**
5879
+ * Snapshot a running session's authenticated state into a named profile
5880
+ * (`POST /profiles` with `source: 'session'`). This is the explicit SAVE step
5881
+ * for onboarding - separating it from `endSession` means an aborted onboarding
5882
+ * can just end the session and persist NOTHING (a persist-on-end session would
5883
+ * flush partial/unauthenticated state and could clobber a good profile).
5884
+ * // anchor-verify: body shape from the ENG-5854 spike (verified live there).
5885
+ */
5886
+ async saveProfileFromSession(name, sessionId, opts = {}) {
5887
+ await this.request("POST", "/profiles", {
5888
+ name,
5889
+ source: "session",
5890
+ session_id: sessionId,
5891
+ ...opts.dedicatedStickyIp ? { dedicated_sticky_ip: true } : {}
5892
+ });
5893
+ }
5894
+ /**
5895
+ * End a session (`DELETE /sessions/:id`). Best-effort by contract: a 404 (the
5896
+ * session already expired) is treated as success - the goal state (no live
5897
+ * session) is reached either way.
5898
+ */
5899
+ async endSession(sessionId) {
5900
+ try {
5901
+ await this.request("DELETE", `/sessions/${encodeURIComponent(sessionId)}`);
5902
+ } catch (err) {
5903
+ if (err instanceof AnchorApiError && err.status === 404)
5904
+ return;
5905
+ throw err;
5906
+ }
5907
+ }
5908
+ // --- internals ----------------------------------------------------------
5909
+ async request(method, path, body) {
5910
+ const url = `${this.baseUrl}${path}`;
5911
+ const controller = new AbortController();
5912
+ const timer = setTimeout(() => controller.abort(), this.timeoutMs);
5913
+ let res;
5914
+ let text;
5915
+ try {
5916
+ res = await this.fetchImpl(url, {
5917
+ method,
5918
+ headers: {
5919
+ [ANCHOR_API_KEY_HEADER]: this.apiKey,
5920
+ ...body !== void 0 ? { "Content-Type": "application/json" } : {}
5921
+ },
5922
+ body: body !== void 0 ? JSON.stringify(body) : void 0,
5923
+ signal: controller.signal
5924
+ });
5925
+ text = await res.text();
5926
+ } catch (err) {
5927
+ const reason = err instanceof Error ? err.message : String(err);
5928
+ throw new AnchorApiError(0, `Anchor request failed: ${reason}`, void 0);
5929
+ } finally {
5930
+ clearTimeout(timer);
5931
+ }
5932
+ let parsed;
5933
+ try {
5934
+ parsed = text ? JSON.parse(text) : void 0;
5935
+ } catch {
5936
+ parsed = text;
5937
+ }
5938
+ if (!res.ok) {
5939
+ const detail = typeof parsed === "object" && parsed !== null && "error" in parsed ? String(parsed.error) : res.statusText;
5940
+ throw new AnchorApiError(res.status, `Anchor returned ${res.status}: ${detail}`, parsed);
5941
+ }
5942
+ return parsed;
5943
+ }
5944
+ };
5945
+
5766
5946
  // ../../packages/core/dist/onboarding/state-machine.js
5767
5947
  var AREA_ORDER = [
5768
5948
  "framing",
@@ -9722,6 +9902,7 @@ export {
9722
9902
  wrapScheduledTaskPrompt,
9723
9903
  buildScheduledTaskContextBlocks,
9724
9904
  DEFAULT_FRAMEWORK,
9905
+ isDeprecatedFramework,
9725
9906
  registerFramework,
9726
9907
  getFramework,
9727
9908
  MAX_AVATAR_ENV_URL_BYTES,
@@ -9760,6 +9941,7 @@ export {
9760
9941
  probeComposioAccount,
9761
9942
  probeComposioMcpToolCall,
9762
9943
  probeHttpProvider,
9944
+ AnchorSessionClient,
9763
9945
  isOnboardingArea,
9764
9946
  describeOnboardingChannel,
9765
9947
  coerceOnboardingState,
@@ -9845,4 +10027,4 @@ export {
9845
10027
  stopAllSessionsAndWait,
9846
10028
  getProjectDir
9847
10029
  };
9848
- //# sourceMappingURL=chunk-4DHYHNCV.js.map
10030
+ //# sourceMappingURL=chunk-NAS4DZNG.js.map