@moxt-ai/mobius 0.0.460 → 0.0.461

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.
@@ -5,7 +5,7 @@ import {
5
5
  __toESM,
6
6
  __using,
7
7
  package_default
8
- } from "./chunk-WOA2UFZO.js";
8
+ } from "./chunk-M25NRHCV.js";
9
9
 
10
10
  // ../../node_modules/.pnpm/ignore@7.0.9/node_modules/ignore/index.js
11
11
  var require_ignore = __commonJS({
@@ -85788,7 +85788,7 @@ async function readAntigravityStoredCredentials(environment) {
85788
85788
  } catch {
85789
85789
  }
85790
85790
  }
85791
- return { kind: "unauthenticated" };
85791
+ return { kind: "no_file_credentials" };
85792
85792
  }
85793
85793
 
85794
85794
  // src/engine/util/network/environment-proxy.ts
@@ -85846,7 +85846,7 @@ var DAILY_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
85846
85846
  var PROD_ENDPOINT = "https://cloudcode-pa.googleapis.com";
85847
85847
  var OAUTH_TOKEN_URL = "https://oauth2.googleapis.com/token";
85848
85848
  var HTTP_TIMEOUT_MILLISECONDS = 1e4;
85849
- var TOKEN_REFRESH_CLI_TIMEOUT_MILLISECONDS = 15e3;
85849
+ var AGY_CLI_TIMEOUT_MILLISECONDS = 15e3;
85850
85850
  var TOKEN_EXPIRY_MARGIN_MILLISECONDS = 6e4;
85851
85851
  var SESSION_WINDOW_MINUTES3 = 5 * 60;
85852
85852
  var WEEKLY_WINDOW_MINUTES3 = 7 * 24 * 60;
@@ -85875,6 +85875,30 @@ var summarySchema = external_exports.object({
85875
85875
  ).optional(),
85876
85876
  buckets: external_exports.array(bucketSchema).optional()
85877
85877
  });
85878
+ var cliUsageSchema = external_exports.object({
85879
+ status: external_exports.literal("SUCCESS"),
85880
+ command: external_exports.object({
85881
+ name: external_exports.literal("usage"),
85882
+ data: external_exports.object({
85883
+ groups: external_exports.array(
85884
+ external_exports.object({
85885
+ name: external_exports.string().optional(),
85886
+ buckets: external_exports.array(
85887
+ external_exports.object({
85888
+ id: external_exports.string().min(1),
85889
+ name: external_exports.string().optional(),
85890
+ window: external_exports.string().optional(),
85891
+ description: external_exports.string().optional(),
85892
+ disabled: external_exports.boolean().optional(),
85893
+ remaining_fraction: external_exports.number().optional(),
85894
+ reset_time: external_exports.string().optional()
85895
+ })
85896
+ )
85897
+ })
85898
+ )
85899
+ })
85900
+ })
85901
+ });
85878
85902
  var availableModelsSchema = external_exports.object({
85879
85903
  models: external_exports.record(
85880
85904
  external_exports.string(),
@@ -86045,10 +86069,7 @@ async function refreshAgyOAuthViaCli(options) {
86045
86069
  stdio: ["ignore", "ignore", "ignore"]
86046
86070
  });
86047
86071
  const processTreePromise = captureProcessTree(child).catch(() => []);
86048
- const timeoutSignal = AbortSignal.any([
86049
- options.signal,
86050
- AbortSignal.timeout(TOKEN_REFRESH_CLI_TIMEOUT_MILLISECONDS)
86051
- ]);
86072
+ const timeoutSignal = AbortSignal.any([options.signal, AbortSignal.timeout(AGY_CLI_TIMEOUT_MILLISECONDS)]);
86052
86073
  await new Promise((resolve21, reject2) => {
86053
86074
  let settled = false;
86054
86075
  const finish = (outcome) => {
@@ -86141,6 +86162,50 @@ async function fetchMergedWindows(params) {
86141
86162
  }
86142
86163
  return { windows: [...merged.values()], unauthorized: unauthorized && merged.size === 0 };
86143
86164
  }
86165
+ async function readCliManagedUsage(options, checkedAt) {
86166
+ const base = { agentId: "antigravity", checkedAt };
86167
+ try {
86168
+ const { stdout } = await runBoundedProcess({
86169
+ ...options,
86170
+ arguments: ["-p", "/usage", "--output-format", "json"],
86171
+ environment: { ...process.env, ...options.environment },
86172
+ outputLimitBytes: 256 * 1024,
86173
+ timeoutMilliseconds: AGY_CLI_TIMEOUT_MILLISECONDS
86174
+ });
86175
+ const { command } = cliUsageSchema.parse(JSON.parse(stdout));
86176
+ const groups = command.data.groups.map((group) => ({
86177
+ displayName: group.name,
86178
+ buckets: group.buckets.map((bucket) => ({
86179
+ bucketId: bucket.id,
86180
+ displayName: bucket.name,
86181
+ window: bucket.window,
86182
+ description: bucket.description,
86183
+ disabled: bucket.disabled,
86184
+ remainingFraction: bucket.remaining_fraction,
86185
+ resetTime: bucket.reset_time
86186
+ }))
86187
+ }));
86188
+ const windows = parseSummaryWindows({ groups }, Date.parse(checkedAt));
86189
+ if (windows.length > 0) {
86190
+ return { ...base, status: "available", windows };
86191
+ }
86192
+ } catch (error62) {
86193
+ options.signal.throwIfAborted();
86194
+ if (error62 instanceof ProcessExecutionError && error62.code === "process_exit_failed" && await options.requiresAuthentication()) {
86195
+ return {
86196
+ ...base,
86197
+ status: "unauthenticated",
86198
+ message: "Sign in to Antigravity on this computer to view subscription quotas."
86199
+ };
86200
+ }
86201
+ }
86202
+ return {
86203
+ ...base,
86204
+ status: "unavailable",
86205
+ errorCode: "antigravity_usage_probe_failed",
86206
+ errorMessage: "Could not read Antigravity usage quotas."
86207
+ };
86208
+ }
86144
86209
  async function readAntigravityUsageQuota(options) {
86145
86210
  options.signal.throwIfAborted();
86146
86211
  const checkedAt = (/* @__PURE__ */ new Date()).toISOString();
@@ -86154,13 +86219,8 @@ async function readAntigravityUsageQuota(options) {
86154
86219
  message: credentials.message
86155
86220
  };
86156
86221
  }
86157
- if (credentials.kind === "unauthenticated") {
86158
- return {
86159
- agentId: "antigravity",
86160
- status: "unauthenticated",
86161
- checkedAt,
86162
- message: "Sign in to Antigravity on this computer to view subscription quotas."
86163
- };
86222
+ if (credentials.kind === "no_file_credentials") {
86223
+ return await readCliManagedUsage(options, checkedAt);
86164
86224
  }
86165
86225
  let accessToken = null;
86166
86226
  let accountLabel;
@@ -88012,6 +88072,22 @@ var AntigravityAdapter = class {
88012
88072
  return { kind: "unsupported" };
88013
88073
  };
88014
88074
  readUsageQuota = async (params) => await readAntigravityUsageQuota({
88075
+ // Print mode uses the same exit code for a missing login and an upstream outage.
88076
+ requiresAuthentication: async () => {
88077
+ try {
88078
+ await probeAcpReadiness(
88079
+ new AntigravityAgentSpecification(),
88080
+ params.agent,
88081
+ process.env,
88082
+ params.cwd,
88083
+ params.signal
88084
+ );
88085
+ return false;
88086
+ } catch (error62) {
88087
+ params.signal.throwIfAborted();
88088
+ return error62 instanceof AgentProbeError && error62.code === "authentication_required";
88089
+ }
88090
+ },
88015
88091
  command: params.agent.command,
88016
88092
  cwd: params.cwd,
88017
88093
  environment: params.agent.environment,
@@ -105507,4 +105583,4 @@ export {
105507
105583
  * MIT Licensed
105508
105584
  *)
105509
105585
  */
105510
- //# sourceMappingURL=chunk-APGZM3B3.js.map
105586
+ //# sourceMappingURL=chunk-FI4KLIFX.js.map