openmeld 0.3.231 → 0.3.233
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.
- package/dist/{add-me-membership-0KyMk1wi.js → add-me-membership-_O3IzRLn.js} +2 -2
- package/dist/{add-me-membership-0KyMk1wi.js.map → add-me-membership-_O3IzRLn.js.map} +1 -1
- package/dist/{agents-Bkx6ldpV.js → agents-B5E7c7sQ.js} +11 -11
- package/dist/{agents-Bkx6ldpV.js.map → agents-B5E7c7sQ.js.map} +1 -1
- package/dist/{api-client-foundation-d4E5XWdJ.js → api-client-foundation-1p1VVFJ_.js} +1 -1
- package/dist/{api-client-foundation-DgTXf3Gb.js → api-client-foundation-C-RPnq_p.js} +3 -3
- package/dist/{api-client-foundation-DgTXf3Gb.js.map → api-client-foundation-C-RPnq_p.js.map} +1 -1
- package/dist/auth-session-CmjjkLiB.js +4 -0
- package/dist/{auth-session-pLaN5cnC.js → auth-session-iXCJO5oB.js} +6 -6
- package/dist/{auth-session-pLaN5cnC.js.map → auth-session-iXCJO5oB.js.map} +1 -1
- package/dist/auth-url-6Bb6YdNm.js +24 -0
- package/dist/auth-url-6Bb6YdNm.js.map +1 -0
- package/dist/{base-url-eck31vC8.js → base-url-0AoeTi3w.js} +3 -3
- package/dist/{base-url-eck31vC8.js.map → base-url-0AoeTi3w.js.map} +1 -1
- package/dist/{base-url-B8eWb2md.js → base-url-Bdjp-5vy.js} +1 -1
- package/dist/{channel-DppbHxHw.js → channel-BciBrA3Y.js} +25 -5
- package/dist/channel-BciBrA3Y.js.map +1 -0
- package/dist/{cli-binary-manifest-Bjf6T7Ef.js → cli-binary-manifest-ETxqCzfS.js} +8 -1
- package/dist/cli-binary-manifest-ETxqCzfS.js.map +1 -0
- package/dist/{command-CBWv24uj.js → command-D0pcAIoE.js} +19 -19
- package/dist/{command-CBWv24uj.js.map → command-D0pcAIoE.js.map} +1 -1
- package/dist/{computer-connection-DMkamVpB.js → computer-connection-CHP1-0rK.js} +2 -2
- package/dist/{computer-connection-DMkamVpB.js.map → computer-connection-CHP1-0rK.js.map} +1 -1
- package/dist/{computer-connection-review-BSPMGVhN.js → computer-connection-review-dHotFqmD.js} +6 -6
- package/dist/{computer-connection-review-BSPMGVhN.js.map → computer-connection-review-dHotFqmD.js.map} +1 -1
- package/dist/{computer-disconnect-BQ_MDeeA.js → computer-disconnect-B2DLDxWx.js} +9 -9
- package/dist/{computer-disconnect-BQ_MDeeA.js.map → computer-disconnect-B2DLDxWx.js.map} +1 -1
- package/dist/{computer-setup-continuation-Cd293Yzi.js → computer-setup-continuation-Cv_c1B-7.js} +3 -3
- package/dist/{computer-setup-continuation-Cd293Yzi.js.map → computer-setup-continuation-Cv_c1B-7.js.map} +1 -1
- package/dist/{context-qbQXVLF5.js → context-BnhlFS8m.js} +5 -5
- package/dist/{context-qbQXVLF5.js.map → context-BnhlFS8m.js.map} +1 -1
- package/dist/{control-plane-rTE2rHZ5.js → control-plane-QqGL-jtT.js} +2 -2
- package/dist/{control-plane-rTE2rHZ5.js.map → control-plane-QqGL-jtT.js.map} +1 -1
- package/dist/{daemon-device-id-B6iDyQEs.js → daemon-device-id-DbSIqHoZ.js} +8 -8
- package/dist/{daemon-device-id-B6iDyQEs.js.map → daemon-device-id-DbSIqHoZ.js.map} +1 -1
- package/dist/{daemon-lifecycle-journal-DrwEygzu.js → daemon-lifecycle-journal-DsVVvKJe.js} +10 -10
- package/dist/{daemon-lifecycle-journal-DrwEygzu.js.map → daemon-lifecycle-journal-DsVVvKJe.js.map} +1 -1
- package/dist/{daemon-runtime-lease-C1wkT4Bi.js → daemon-runtime-lease-Bv6vhqOe.js} +2 -2
- package/dist/{daemon-runtime-lease-C1wkT4Bi.js.map → daemon-runtime-lease-Bv6vhqOe.js.map} +1 -1
- package/dist/{daemon-runtime-lease-DAQyRUc5.js → daemon-runtime-lease-ZjP0urJt.js} +1 -1
- package/dist/{daemon-service-contract-DhEfbzHt.js → daemon-service-contract-COPKbCy_.js} +4 -4
- package/dist/{daemon-service-contract-DhEfbzHt.js.map → daemon-service-contract-COPKbCy_.js.map} +1 -1
- package/dist/{daemon-service-manager-CRnFxPKA.js → daemon-service-manager-BXAp21GH.js} +6 -6
- package/dist/{daemon-service-manager-CRnFxPKA.js.map → daemon-service-manager-BXAp21GH.js.map} +1 -1
- package/dist/{daemon-service-manager-l0unaDGa.js → daemon-service-manager-C_ny0JhB.js} +1 -1
- package/dist/{daemon-service-runtime-B4nWB2Qx.js → daemon-service-runtime-DZI6Ke3_.js} +16 -15
- package/dist/{daemon-service-runtime-B4nWB2Qx.js.map → daemon-service-runtime-DZI6Ke3_.js.map} +1 -1
- package/dist/{daemon-service-update-coordinator-C8cW7Vn_.js → daemon-service-update-coordinator-BgVBlJ4d.js} +29 -24
- package/dist/daemon-service-update-coordinator-BgVBlJ4d.js.map +1 -0
- package/dist/{daemon-state-B6G5xe7f.js → daemon-state-Dte9re5V.js} +4 -4
- package/dist/{daemon-state-B6G5xe7f.js.map → daemon-state-Dte9re5V.js.map} +1 -1
- package/dist/{daemon-frame-transport-xQnNyg6E.js → dispatch-owned-runtime-BeIQetEt.js} +550 -53
- package/dist/dispatch-owned-runtime-BeIQetEt.js.map +1 -0
- package/dist/{dist-CAypwFRu.js → dist-BgYBvEBB.js} +206 -190
- package/dist/dist-BgYBvEBB.js.map +1 -0
- package/dist/{dist-DFhd6JmQ.js → dist-DQS0XYkb.js} +3 -3
- package/dist/{dist-DFhd6JmQ.js.map → dist-DQS0XYkb.js.map} +1 -1
- package/dist/{dist-olOaAWkl.js → dist-z72xYz5Z.js} +1 -1
- package/dist/{elapsed-time-COv3bjEl.js → elapsed-time-C7S-6bWV.js} +6 -6
- package/dist/{elapsed-time-COv3bjEl.js.map → elapsed-time-C7S-6bWV.js.map} +1 -1
- package/dist/{entry-DIjUKIep.js → entry-CX24qHnm.js} +81 -17
- package/dist/entry-CX24qHnm.js.map +1 -0
- package/dist/{installation-inventory-DllgoKT1.js → installation-inventory-B3mwQFEA.js} +5 -5
- package/dist/{installation-inventory-DllgoKT1.js.map → installation-inventory-B3mwQFEA.js.map} +1 -1
- package/dist/{installer-Sc79LhuA.js → installer-DnIJ4y3l.js} +2 -2
- package/dist/{installer-Sc79LhuA.js.map → installer-DnIJ4y3l.js.map} +1 -1
- package/dist/{local-components-DleLEzSU.js → local-components-DJiMS67S.js} +36 -3
- package/dist/local-components-DJiMS67S.js.map +1 -0
- package/dist/{lock-CMH9eoS7.js → lock-BMI00i2F.js} +2 -2
- package/dist/{lock-CMH9eoS7.js.map → lock-BMI00i2F.js.map} +1 -1
- package/dist/meta-api-DgHkiIdr.js +371 -0
- package/dist/meta-api-DgHkiIdr.js.map +1 -0
- package/dist/openmeld-dev.js +17 -9
- package/dist/openmeld-dev.js.map +1 -1
- package/dist/{openmeld-environment-target-Cw3V0WnE.js → openmeld-environment-target-BgYR6ozy.js} +8 -25
- package/dist/openmeld-environment-target-BgYR6ozy.js.map +1 -0
- package/dist/{openmeld-BUYFXSyY.js → openmeld-kYp99hOl.js} +41 -39
- package/dist/{openmeld-BUYFXSyY.js.map → openmeld-kYp99hOl.js.map} +1 -1
- package/dist/{openmeld-maintenance-worker-Br6WIhhe.js → openmeld-maintenance-worker-BqU1Asrm.js} +14 -14
- package/dist/{openmeld-maintenance-worker-Br6WIhhe.js.map → openmeld-maintenance-worker-BqU1Asrm.js.map} +1 -1
- package/dist/{openmeld-tools-update-join-B1l6RER6.js → openmeld-tools-update-join-BKJnGR5h.js} +4 -4
- package/dist/{openmeld-tools-update-join-B1l6RER6.js.map → openmeld-tools-update-join-BKJnGR5h.js.map} +1 -1
- package/dist/{openmeld-tools-update-process-frame-DbEZ3fEh.js → openmeld-tools-update-process-frame-Csy2XKUf.js} +1 -1
- package/dist/{openmeld-tools-update-process-frame-BtFKp70p.js → openmeld-tools-update-process-frame-YLOS82E3.js} +2 -2
- package/dist/{openmeld-tools-update-process-frame-BtFKp70p.js.map → openmeld-tools-update-process-frame-YLOS82E3.js.map} +1 -1
- package/dist/openmeld.js +6 -6
- package/dist/{paths-DSkUuEu3.js → paths-De9xdA2h.js} +11 -6
- package/dist/paths-De9xdA2h.js.map +1 -0
- package/dist/{prepare-provider-runtime-DfsSj_N_.js → prepare-provider-runtime-CD6XRt7X.js} +385 -181
- package/dist/prepare-provider-runtime-CD6XRt7X.js.map +1 -0
- package/dist/{prepare-session-executor-CrYpWljb.js → prepare-session-executor-DY2s4FuY.js} +26 -26
- package/dist/{prepare-session-executor-CrYpWljb.js.map → prepare-session-executor-DY2s4FuY.js.map} +1 -1
- package/dist/{process-channel-DmTb_kO4.js → process-channel-CzgOWiuh.js} +2 -2
- package/dist/{process-channel-DmTb_kO4.js.map → process-channel-CzgOWiuh.js.map} +1 -1
- package/dist/{published-production-safety-CgXxtdMK.js → published-production-safety-zANGAGDI.js} +5 -6
- package/dist/published-production-safety-zANGAGDI.js.map +1 -0
- package/dist/{runtime-ZLBVtFFY.js → runtime-Br4Ga0rJ.js} +77 -23
- package/dist/runtime-Br4Ga0rJ.js.map +1 -0
- package/dist/{runtime-agent-controller-reporting-submission-CbaUsNTF.js → runtime-agent-controller-reporting-submission-CQjbBiHh.js} +146 -37
- package/dist/runtime-agent-controller-reporting-submission-CQjbBiHh.js.map +1 -0
- package/dist/{runtime-reporting-health-state-DOg9iwwO.js → runtime-reporting-health-state-a1FUE1S-.js} +120 -25
- package/dist/runtime-reporting-health-state-a1FUE1S-.js.map +1 -0
- package/dist/{runtime-transport-D4x8_AmR.js → runtime-transport-D4CVffnp.js} +88 -8
- package/dist/runtime-transport-D4CVffnp.js.map +1 -0
- package/dist/{service-B9y1SQlB.js → service-D9QVc4_y.js} +99 -30
- package/dist/service-D9QVc4_y.js.map +1 -0
- package/dist/{service-account-authorization-Di59Cjth.js → service-account-authorization-DLhUgGDb.js} +6 -6
- package/dist/{service-account-authorization-Di59Cjth.js.map → service-account-authorization-DLhUgGDb.js.map} +1 -1
- package/dist/{service-account-control-DALO1USM.js → service-account-control-DIdQILmo.js} +13 -13
- package/dist/{service-account-control-DALO1USM.js.map → service-account-control-DIdQILmo.js.map} +1 -1
- package/dist/{service-control-capabilities-B9ZxDPOJ.js → service-control-capabilities-BvHU_NcX.js} +1 -1
- package/dist/{service-control-capabilities-CKwU9Er5.js → service-control-capabilities-CGv5Cuxo.js} +5 -5
- package/dist/{service-control-capabilities-CKwU9Er5.js.map → service-control-capabilities-CGv5Cuxo.js.map} +1 -1
- package/dist/{state-CdSbKM0J.js → state-AWe5DSV8.js} +3 -3
- package/dist/{state-CdSbKM0J.js.map → state-AWe5DSV8.js.map} +1 -1
- package/dist/upgrade-CLnZ4WBF.js +4 -0
- package/dist/{upgrade-DLJJlkbf.js → upgrade-CcnlL7FH.js} +9 -9
- package/dist/{upgrade-DLJJlkbf.js.map → upgrade-CcnlL7FH.js.map} +1 -1
- package/dist/{windows-preview-channel-DPrYuLyY.js → windows-preview-channel-BPhfSwji.js} +2 -2
- package/dist/{windows-preview-channel-DPrYuLyY.js.map → windows-preview-channel-BPhfSwji.js.map} +1 -1
- package/dist/{windows-user-task-BR-WB7hr.js → windows-user-task-CTsMnmD4.js} +3 -3
- package/dist/{windows-user-task-BR-WB7hr.js.map → windows-user-task-CTsMnmD4.js.map} +1 -1
- package/dist/{windows-user-task-m9eMEUEq.js → windows-user-task-DnxKO3oB.js} +1 -1
- package/package.json +10 -10
- package/dist/auth-session-DExyUwLo.js +0 -4
- package/dist/channel-DppbHxHw.js.map +0 -1
- package/dist/cli-binary-manifest-Bjf6T7Ef.js.map +0 -1
- package/dist/daemon-frame-transport-xQnNyg6E.js.map +0 -1
- package/dist/daemon-service-update-coordinator-C8cW7Vn_.js.map +0 -1
- package/dist/dist-CAypwFRu.js.map +0 -1
- package/dist/entry-DIjUKIep.js.map +0 -1
- package/dist/local-components-DleLEzSU.js.map +0 -1
- package/dist/meta-api-CEw8eOeN.js +0 -845
- package/dist/meta-api-CEw8eOeN.js.map +0 -1
- package/dist/openmeld-environment-target-Cw3V0WnE.js.map +0 -1
- package/dist/paths-DSkUuEu3.js.map +0 -1
- package/dist/prepare-provider-runtime-DfsSj_N_.js.map +0 -1
- package/dist/published-production-safety-CgXxtdMK.js.map +0 -1
- package/dist/runtime-ZLBVtFFY.js.map +0 -1
- package/dist/runtime-agent-controller-reporting-submission-CbaUsNTF.js.map +0 -1
- package/dist/runtime-reporting-health-state-DOg9iwwO.js.map +0 -1
- package/dist/runtime-transport-D4x8_AmR.js.map +0 -1
- package/dist/service-B9y1SQlB.js.map +0 -1
- package/dist/upgrade-BFWUxFpJ.js +0 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { Bn as toStructuredApiClientFailure, fn as createRuntimeReportingApi } from "./dist-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { d as getAuthSessionState } from "./auth-session-
|
|
7
|
-
import {
|
|
8
|
-
import { v as warnDaemonEvent } from "./daemon-device-id-
|
|
9
|
-
import { i as readDaemonServiceContract } from "./daemon-service-contract-
|
|
10
|
-
import { l as canAttachAuthTokenToRequest, t as createCliApiClientFoundation, u as fingerprintRequestAuthorization } from "./api-client-foundation-
|
|
3
|
+
import { Bn as toStructuredApiClientFailure, fn as createRuntimeReportingApi } from "./dist-BgYBvEBB.js";
|
|
4
|
+
import { $n as materializeCliLaunchCommand, Cn as probeCodexAppServerAccount, Dn as probeClaudeCodeUsageLimits, En as projectCodexUsageLimits, I as listAgentTargetStates, Qn as buildCliLaunchInvocation, Xn as createUnsupportedProviderUsageLimits, Yn as createUnavailableProviderUsageLimits, _n as probeGrokBuildAcpInterface, at as isHomebrewCommandPath, fn as parseOpenRouterUsageResponse, gn as GrokBuildAcpTransportError, gr as isAgentControllerUsageRefreshUnavailable, it as isBunGlobalCommandPath, j as resolveAgentProfilePrimaryAgentControllerReport, kn as parseAntigravityUsageLimits, nr as createProviderOriginalError, nt as EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES, or as areAgentControllerInterfaceAccountsSame, ot as isNpmGlobalCommandPath, pn as parseOpenCodeGoUsageResponse, rt as resolveBuiltinAgentControllerDefinition, sr as buildAgentControllerRef, st as isPnpmGlobalCommandPath, x as resolveLocalRuntimeControllerSupport, yn as projectCursorUsageLimits } from "./prepare-provider-runtime-CD6XRt7X.js";
|
|
5
|
+
import { nt as resolvePublicAgentAvailabilityCopy } from "./runtime-transport-D4CVffnp.js";
|
|
6
|
+
import { T as readMacOsNativeKeychainToken, d as getAuthSessionState } from "./auth-session-iXCJO5oB.js";
|
|
7
|
+
import { B as buildAgentControllerInterfaceKeeperKey, G as readLastSuccessfulAgentControllerInterfaceCheckAt, H as didAgentControllerCommandFingerprintRemainStable, J as recordAgentControllerInterfaceProbeSuccess, K as readReusableAgentControllerInterfaceSnapshot, U as readLastKnownAgentControllerAuthSnapshot, W as readLastKnownAgentControllerUsageLimits, X as resolveAgentControllerCommandFingerprint, Y as recordAgentControllerUsageLimitsObservation, q as recordAgentControllerInterfaceProbeFailure, w as resolveOpenCodeAuthPath } from "./dispatch-owned-runtime-BeIQetEt.js";
|
|
8
|
+
import { v as warnDaemonEvent } from "./daemon-device-id-DbSIqHoZ.js";
|
|
9
|
+
import { i as readDaemonServiceContract } from "./daemon-service-contract-COPKbCy_.js";
|
|
10
|
+
import { l as canAttachAuthTokenToRequest, t as createCliApiClientFoundation, u as fingerprintRequestAuthorization } from "./api-client-foundation-C-RPnq_p.js";
|
|
11
11
|
import { homedir, loadavg, tmpdir } from "node:os";
|
|
12
12
|
import { join } from "node:path";
|
|
13
13
|
import { mkdtemp, readFile, realpath, rm } from "node:fs/promises";
|
|
@@ -400,6 +400,60 @@ function parsePlainVersion(body) {
|
|
|
400
400
|
return version.length > 0 ? version : null;
|
|
401
401
|
}
|
|
402
402
|
//#endregion
|
|
403
|
+
//#region src/local-service/inventory/cursor-usage-probe.ts
|
|
404
|
+
const CURSOR_ENDPOINT = "https://api2.cursor.sh";
|
|
405
|
+
const TRAILING_SLASH_RE$1 = /\/$/u;
|
|
406
|
+
async function probeCursorUsageLimits(input) {
|
|
407
|
+
const env = input.environment ?? process.env;
|
|
408
|
+
const platform = input.platform ?? process.platform;
|
|
409
|
+
const unavailable = (reason) => createUnavailableProviderUsageLimits(input.observedAt, void 0, { reason });
|
|
410
|
+
const endpoint = env.CURSOR_API_ENDPOINT?.trim().replace(TRAILING_SLASH_RE$1, "");
|
|
411
|
+
if (endpoint && endpoint !== CURSOR_ENDPOINT) return unavailable("not_applicable");
|
|
412
|
+
let token = env.CURSOR_AUTH_TOKEN?.trim();
|
|
413
|
+
if (!token && (env.CURSOR_API_KEY?.trim() || env.AGENT_CLI_CREDENTIAL_STORE === "memory")) return unavailable("not_applicable");
|
|
414
|
+
try {
|
|
415
|
+
if (!token) token = await readStoredCursorToken({
|
|
416
|
+
...input,
|
|
417
|
+
environment: env,
|
|
418
|
+
platform
|
|
419
|
+
});
|
|
420
|
+
if (!token) return unavailable("not_reported");
|
|
421
|
+
const response = await (input.fetchFn ?? fetch)(`${CURSOR_ENDPOINT}/aiserver.v1.DashboardService/GetCurrentPeriodUsage`, {
|
|
422
|
+
method: "POST",
|
|
423
|
+
redirect: "error",
|
|
424
|
+
signal: AbortSignal.timeout(4e3),
|
|
425
|
+
headers: {
|
|
426
|
+
authorization: `Bearer ${token}`,
|
|
427
|
+
"content-type": "application/json",
|
|
428
|
+
"connect-protocol-version": "1",
|
|
429
|
+
"x-cursor-client-type": "cli"
|
|
430
|
+
},
|
|
431
|
+
body: "{}"
|
|
432
|
+
});
|
|
433
|
+
if (!response.ok) return unavailable(response.status === 401 || response.status === 403 ? "not_applicable" : "refresh_failed");
|
|
434
|
+
return projectCursorUsageLimits({
|
|
435
|
+
observedAt: input.observedAt,
|
|
436
|
+
value: await response.json()
|
|
437
|
+
});
|
|
438
|
+
} catch {
|
|
439
|
+
return unavailable("refresh_failed");
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
async function readStoredCursorToken(input) {
|
|
443
|
+
const env = input.environment;
|
|
444
|
+
if (input.platform === "darwin" && env.AGENT_CLI_CREDENTIAL_STORE !== "file") return (await (input.readKeychain ?? (() => readMacOsNativeKeychainToken({
|
|
445
|
+
service: "cursor-access-token",
|
|
446
|
+
account: "cursor-user"
|
|
447
|
+
})))())?.trim();
|
|
448
|
+
const home = (input.platform === "win32" ? env.USERPROFILE : env.HOME) || homedir();
|
|
449
|
+
let directory = join(env.XDG_CONFIG_HOME || join(home, ".config"), "cursor");
|
|
450
|
+
if (input.platform === "darwin") directory = join(home, ".cursor");
|
|
451
|
+
else if (input.platform === "win32") directory = join(env.APPDATA || join(home, "AppData", "Roaming"), "Cursor");
|
|
452
|
+
const content = await (input.readCredentials ?? ((path) => readFile(path, "utf8")))(join(directory, "auth.json"));
|
|
453
|
+
const credentials = JSON.parse(content);
|
|
454
|
+
return credentials && typeof credentials === "object" && "accessToken" in credentials && typeof credentials.accessToken === "string" ? credentials.accessToken.trim() : void 0;
|
|
455
|
+
}
|
|
456
|
+
//#endregion
|
|
403
457
|
//#region src/local-service/inventory/opencode-readiness-probe.ts
|
|
404
458
|
const DEFAULT_PROBE_TIMEOUT_MS = 8e3;
|
|
405
459
|
const SDK_READ_TIMEOUT_MS = 4e3;
|
|
@@ -411,6 +465,7 @@ const OPENCODE_SERVER_URL_RE = /on\s+(https?:\/\/[^\s]+)/u;
|
|
|
411
465
|
const ANSI_ESCAPE = String.fromCharCode(27);
|
|
412
466
|
const OPENCODE_GO_PROVIDER_ID = "opencode-go";
|
|
413
467
|
const OPENCODE_GO_USAGE_URL = "https://opencode.ai/zen/go/v1/usage";
|
|
468
|
+
const TRAILING_SLASH_RE = /\/$/u;
|
|
414
469
|
async function probeOpenCodeReadiness(input) {
|
|
415
470
|
let server = null;
|
|
416
471
|
try {
|
|
@@ -459,42 +514,54 @@ async function readOpenCodeProviderUsageLimits(input) {
|
|
|
459
514
|
}
|
|
460
515
|
const providers = [...providersById.values()];
|
|
461
516
|
return (await Promise.all(providers.map(async (provider) => {
|
|
462
|
-
if (provider.id !== OPENCODE_GO_PROVIDER_ID) return createUnsupportedProviderUsageLimits(input.observedAt, provider);
|
|
463
|
-
const
|
|
517
|
+
if (provider.id !== OPENCODE_GO_PROVIDER_ID && provider.id !== "openrouter") return createUnsupportedProviderUsageLimits(input.observedAt, provider);
|
|
518
|
+
const config = input.providerList.all.find((item) => item.id === provider.id);
|
|
519
|
+
const defaultBaseUrl = provider.id === "openrouter" ? "https://openrouter.ai/api/v1" : "https://opencode.ai/zen/go/v1";
|
|
520
|
+
if (typeof config?.options.baseURL === "string" && config.options.baseURL.replace(TRAILING_SLASH_RE, "") !== defaultBaseUrl) return createUnavailableProviderUsageLimits(input.observedAt, provider, { reason: "not_applicable" });
|
|
521
|
+
const apiKey = normalizeOptionalText$1(config?.key) ?? await resolveOpenCodeProviderApiKey({
|
|
464
522
|
authContent: input.authContent,
|
|
523
|
+
environment: input.environment,
|
|
465
524
|
providerId: provider.id,
|
|
466
525
|
readAuthFile: input.readAuthFile
|
|
467
526
|
});
|
|
468
|
-
if (!apiKey) return createUnavailableProviderUsageLimits(input.observedAt, provider);
|
|
527
|
+
if (!apiKey) return createUnavailableProviderUsageLimits(input.observedAt, provider, { reason: "not_authenticated" });
|
|
469
528
|
try {
|
|
470
|
-
const response = await (input.fetchFn ?? fetch)(OPENCODE_GO_USAGE_URL, {
|
|
529
|
+
const response = await (input.fetchFn ?? fetch)(provider.id === "openrouter" ? "https://openrouter.ai/api/v1/key" : OPENCODE_GO_USAGE_URL, {
|
|
530
|
+
redirect: "error",
|
|
471
531
|
headers: { authorization: `Bearer ${apiKey}` },
|
|
472
532
|
signal: AbortSignal.timeout(SDK_READ_TIMEOUT_MS)
|
|
473
533
|
});
|
|
474
|
-
if (!response.ok) return createUnavailableProviderUsageLimits(input.observedAt, provider);
|
|
475
|
-
return parseOpenCodeGoUsageResponse({
|
|
534
|
+
if (!response.ok) return createUnavailableProviderUsageLimits(input.observedAt, provider, { reason: usageRequestFailureReason(response.status) });
|
|
535
|
+
return (provider.id === "openrouter" ? parseOpenRouterUsageResponse : parseOpenCodeGoUsageResponse)({
|
|
476
536
|
observedAt: input.observedAt,
|
|
477
537
|
value: await response.json()
|
|
478
538
|
});
|
|
479
539
|
} catch {
|
|
480
|
-
return createUnavailableProviderUsageLimits(input.observedAt, provider);
|
|
540
|
+
return createUnavailableProviderUsageLimits(input.observedAt, provider, { reason: "refresh_failed" });
|
|
481
541
|
}
|
|
482
542
|
}))).flat().slice(0, 32);
|
|
483
543
|
}
|
|
544
|
+
function usageRequestFailureReason(status) {
|
|
545
|
+
if (status === 403) return "not_applicable";
|
|
546
|
+
return status === 401 ? "not_authenticated" : "refresh_failed";
|
|
547
|
+
}
|
|
484
548
|
async function resolveOpenCodeProviderApiKey(input) {
|
|
485
|
-
|
|
549
|
+
const environment = input.environment ?? process.env;
|
|
550
|
+
let authContent = input.authContent ?? environment.OPENCODE_AUTH_CONTENT;
|
|
486
551
|
if (!authContent) try {
|
|
487
552
|
const authPath = resolveOpenCodeAuthPath({
|
|
488
553
|
homeDir: homedir(),
|
|
489
|
-
xdgDataHome:
|
|
554
|
+
xdgDataHome: environment.XDG_DATA_HOME
|
|
490
555
|
});
|
|
491
556
|
authContent = input.readAuthFile ? await input.readAuthFile(authPath) : await readFile(authPath, "utf8");
|
|
492
557
|
} catch {
|
|
493
|
-
|
|
558
|
+
authContent = "{}";
|
|
494
559
|
}
|
|
495
560
|
try {
|
|
496
561
|
const providerAuth = toRecord$1(JSON.parse(authContent)?.[input.providerId]);
|
|
497
|
-
|
|
562
|
+
if (providerAuth?.type === "api") return normalizeOptionalText$1(providerAuth.key);
|
|
563
|
+
if (providerAuth) return null;
|
|
564
|
+
return normalizeOptionalText$1(environment[input.providerId === OPENCODE_GO_PROVIDER_ID ? "OPENCODE_API_KEY" : "OPENROUTER_API_KEY"]);
|
|
498
565
|
} catch {
|
|
499
566
|
return null;
|
|
500
567
|
}
|
|
@@ -519,7 +586,8 @@ async function startOpenCodeProbeServer(input) {
|
|
|
519
586
|
"ignore",
|
|
520
587
|
"pipe",
|
|
521
588
|
"pipe"
|
|
522
|
-
]
|
|
589
|
+
],
|
|
590
|
+
windowsHide: true
|
|
523
591
|
});
|
|
524
592
|
const spawnedAtMs = Date.now();
|
|
525
593
|
let stdout = "";
|
|
@@ -861,11 +929,27 @@ async function resolveAntigravityInterfaceSnapshot(input) {
|
|
|
861
929
|
};
|
|
862
930
|
}
|
|
863
931
|
async function probeAgentControllerUsageObservationAuth(input) {
|
|
932
|
+
if (input.agentId === "codex") try {
|
|
933
|
+
const account = await probeCodexAppServerAccount({
|
|
934
|
+
launchContract: input.launchContract,
|
|
935
|
+
timeoutMs: PROBE_TIMEOUT_MS
|
|
936
|
+
});
|
|
937
|
+
return {
|
|
938
|
+
status: account.authStatus,
|
|
939
|
+
...account.email ? { email: account.email } : {}
|
|
940
|
+
};
|
|
941
|
+
} catch {
|
|
942
|
+
return { status: "unknown" };
|
|
943
|
+
}
|
|
864
944
|
if (input.agentId !== "claude-code") return { status: "unknown" };
|
|
865
945
|
return resolveClaudeAuthSnapshot(await withProbeWorkingDirectory((workingDirectory) => runLaunchContractCommand({
|
|
866
946
|
workingDirectory,
|
|
867
947
|
allowNonZeroExit: true,
|
|
868
|
-
args: [
|
|
948
|
+
args: [
|
|
949
|
+
"auth",
|
|
950
|
+
"status",
|
|
951
|
+
"--json"
|
|
952
|
+
],
|
|
869
953
|
launchContract: input.launchContract
|
|
870
954
|
})));
|
|
871
955
|
}
|
|
@@ -950,8 +1034,7 @@ async function resolveAgentControllerInterfaceSnapshot(input) {
|
|
|
950
1034
|
currentAuth: outcome.snapshot.auth,
|
|
951
1035
|
current: outcome.snapshot.usageLimits,
|
|
952
1036
|
previous: lastKnownUsageLimits,
|
|
953
|
-
previousAuth: lastKnownAuth
|
|
954
|
-
support: controllerDefinition?.usageLimitSupport ?? "not_evaluated"
|
|
1037
|
+
previousAuth: lastKnownAuth
|
|
955
1038
|
});
|
|
956
1039
|
const completedSnapshot = withUsageLimits({
|
|
957
1040
|
...outcome.snapshot,
|
|
@@ -1010,11 +1093,11 @@ function withUsageLimits(snapshot, usageLimits) {
|
|
|
1010
1093
|
}
|
|
1011
1094
|
function resolveUsageLimitsAfterCompletedProbe(input) {
|
|
1012
1095
|
if (!areAgentControllerInterfaceAccountsSame(input.previousAuth, input.currentAuth)) return input.current;
|
|
1013
|
-
if (input.
|
|
1096
|
+
if (!input.current) return input.previous ?? void 0;
|
|
1014
1097
|
return preserveLastKnownUsageLimitsAfterFailure(input);
|
|
1015
1098
|
}
|
|
1016
1099
|
function preserveLastKnownUsageLimitsAfterFailure(input) {
|
|
1017
|
-
const currentIsUnavailable = input.current
|
|
1100
|
+
const currentIsUnavailable = isAgentControllerUsageRefreshUnavailable(input.current);
|
|
1018
1101
|
const previousHasKnownCapacity = input.previous?.some((limit) => limit.status === "available" || limit.status === "exhausted" || limit.status === "stale");
|
|
1019
1102
|
if (!(currentIsUnavailable && previousHasKnownCapacity && input.previous)) return input.current;
|
|
1020
1103
|
return input.previous.map((limit) => limit.usedPercent === null ? limit : {
|
|
@@ -1027,7 +1110,7 @@ function resolveUsageLimitsAfterFailedProbe(input) {
|
|
|
1027
1110
|
return preserveLastKnownUsageLimitsAfterFailure(input);
|
|
1028
1111
|
}
|
|
1029
1112
|
function resolveInitialProviderUsageLimits(input) {
|
|
1030
|
-
if (input.support === "native") return createUnavailableProviderUsageLimits(input.checkedAt);
|
|
1113
|
+
if (input.support === "native" || input.support === "observational") return createUnavailableProviderUsageLimits(input.checkedAt);
|
|
1031
1114
|
if (input.support === "unsupported") return createUnsupportedProviderUsageLimits(input.checkedAt);
|
|
1032
1115
|
}
|
|
1033
1116
|
function resolveLaunchSnapshot(state) {
|
|
@@ -1207,6 +1290,14 @@ async function resolveClaudeCodeInterfaceSnapshot(input) {
|
|
|
1207
1290
|
})]);
|
|
1208
1291
|
const auth = resolveClaudeAuthSnapshot(authProbe);
|
|
1209
1292
|
const version = versionProbe.ok ? parseCliVersion(versionProbe.stdout) : null;
|
|
1293
|
+
let usageLimits = createUnavailableProviderUsageLimits(input.baseSnapshot.checkedAt, void 0, { reason: "not_reported" });
|
|
1294
|
+
if (auth.status !== "authenticated") usageLimits = createUnavailableProviderUsageLimits(input.baseSnapshot.checkedAt, void 0, { reason: auth.status === "unauthenticated" ? "not_authenticated" : "refresh_failed" });
|
|
1295
|
+
else if (auth.email && version && (compareSemverCore(version, "2.1.285") ?? -1) >= 0) usageLimits = await probeClaudeCodeUsageLimits({
|
|
1296
|
+
expectedEmail: auth.email,
|
|
1297
|
+
launchContract: input.launchContract,
|
|
1298
|
+
workingDirectory: input.workingDirectory,
|
|
1299
|
+
observedAt: input.baseSnapshot.checkedAt
|
|
1300
|
+
});
|
|
1210
1301
|
let message = input.baseSnapshot.message;
|
|
1211
1302
|
let status = input.baseSnapshot.status;
|
|
1212
1303
|
if (auth.status === "unauthenticated") {
|
|
@@ -1221,6 +1312,7 @@ async function resolveClaudeCodeInterfaceSnapshot(input) {
|
|
|
1221
1312
|
snapshot: {
|
|
1222
1313
|
...input.baseSnapshot,
|
|
1223
1314
|
auth,
|
|
1315
|
+
usageLimits,
|
|
1224
1316
|
message,
|
|
1225
1317
|
status,
|
|
1226
1318
|
version,
|
|
@@ -1250,6 +1342,7 @@ async function resolveCursorInterfaceSnapshot(input) {
|
|
|
1250
1342
|
})]);
|
|
1251
1343
|
const auth = resolveCursorAuthSnapshot(authProbe);
|
|
1252
1344
|
const version = versionProbe.ok ? parseCliVersion(versionProbe.stdout) : null;
|
|
1345
|
+
const usageLimits = auth.status === "authenticated" ? await probeCursorUsageLimits({ observedAt: input.baseSnapshot.checkedAt }) : createUnavailableProviderUsageLimits(input.baseSnapshot.checkedAt, void 0, { reason: auth.status === "unauthenticated" ? "not_authenticated" : "refresh_failed" });
|
|
1253
1346
|
let message = input.baseSnapshot.message;
|
|
1254
1347
|
let status = input.baseSnapshot.status;
|
|
1255
1348
|
if (auth.status === "unauthenticated") {
|
|
@@ -1264,6 +1357,7 @@ async function resolveCursorInterfaceSnapshot(input) {
|
|
|
1264
1357
|
snapshot: {
|
|
1265
1358
|
...input.baseSnapshot,
|
|
1266
1359
|
auth,
|
|
1360
|
+
usageLimits,
|
|
1267
1361
|
message,
|
|
1268
1362
|
status,
|
|
1269
1363
|
version,
|
|
@@ -1422,7 +1516,8 @@ function runCommand(input) {
|
|
|
1422
1516
|
"ignore",
|
|
1423
1517
|
"pipe",
|
|
1424
1518
|
"pipe"
|
|
1425
|
-
]
|
|
1519
|
+
],
|
|
1520
|
+
windowsHide: true
|
|
1426
1521
|
});
|
|
1427
1522
|
let stdout = "";
|
|
1428
1523
|
let stderr = "";
|
|
@@ -1499,7 +1594,8 @@ function probeCodexAppServer(launchContract, workingDirectory) {
|
|
|
1499
1594
|
"pipe",
|
|
1500
1595
|
"pipe",
|
|
1501
1596
|
"pipe"
|
|
1502
|
-
]
|
|
1597
|
+
],
|
|
1598
|
+
windowsHide: true
|
|
1503
1599
|
});
|
|
1504
1600
|
const pending = /* @__PURE__ */ new Map();
|
|
1505
1601
|
let nextId = 1;
|
|
@@ -1765,11 +1861,15 @@ function resolveCursorAuthSnapshot(probe) {
|
|
|
1765
1861
|
if (!probe.ok) return { status: "unknown" };
|
|
1766
1862
|
const payload = parseJsonRecord(probe.stdout);
|
|
1767
1863
|
if (payload?.status === "unauthenticated") return { status: "unauthenticated" };
|
|
1768
|
-
if (payload?.status === "authenticated")
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1864
|
+
if (payload?.status === "authenticated") {
|
|
1865
|
+
const email = normalizeOptionalText(payload.email);
|
|
1866
|
+
return {
|
|
1867
|
+
...email ? { email } : {},
|
|
1868
|
+
label: email ?? "Signed in",
|
|
1869
|
+
status: "authenticated",
|
|
1870
|
+
type: "cursor_login"
|
|
1871
|
+
};
|
|
1872
|
+
}
|
|
1773
1873
|
return { status: "unknown" };
|
|
1774
1874
|
}
|
|
1775
1875
|
function resolveOpenClawAuthProbe(probe) {
|
|
@@ -2018,10 +2118,19 @@ function projectAgentControllerInterfaceForCloud(snapshot) {
|
|
|
2018
2118
|
skills: [],
|
|
2019
2119
|
status: snapshot.status,
|
|
2020
2120
|
...snapshot.usageLimits ? { usageLimits: snapshot.usageLimits.map((limit) => ({
|
|
2021
|
-
|
|
2022
|
-
|
|
2121
|
+
key: limit.key,
|
|
2122
|
+
label: limit.label,
|
|
2123
|
+
observedAt: limit.observedAt,
|
|
2124
|
+
...limit.reason ? { reason: limit.reason } : {},
|
|
2125
|
+
...limit.provider ? { provider: {
|
|
2126
|
+
displayName: limit.provider.displayName,
|
|
2127
|
+
id: limit.provider.id
|
|
2128
|
+
} } : {},
|
|
2129
|
+
resetsAt: limit.resetsAt,
|
|
2130
|
+
status: limit.status,
|
|
2131
|
+
usedPercent: limit.usedPercent
|
|
2023
2132
|
})) } : {},
|
|
2024
|
-
usageLimitsSupportMatrixVersion:
|
|
2133
|
+
usageLimitsSupportMatrixVersion: 4,
|
|
2025
2134
|
version: snapshot.version,
|
|
2026
2135
|
...snapshot.versionAdvisory ? { versionAdvisory: {
|
|
2027
2136
|
checkedAt: snapshot.versionAdvisory.checkedAt,
|
|
@@ -2666,4 +2775,4 @@ function toErrorMessage(error) {
|
|
|
2666
2775
|
//#endregion
|
|
2667
2776
|
export { submitRuntimeProviderConversationProofs as a, resolveLocalAgentControllerLaunchability as c, resolveAgentControllerInterfaceSnapshot as d, recordRuntimeProviderUsageLimits as f, submitRuntimeAgentControllerReports as i, resolveLocalAgentControllerReportDecision as l, submitProfileRuntimeAgentControllerReport as n, collectLocalAgentControllerInventory as o, submitRuntimeAgentControllerReport as r, resolveLocalAgentControllerBlockerReasonCodes as s, notifyRuntimeReportingAttemptObserver as t, probeAgentControllerUsageObservationAuth as u };
|
|
2668
2777
|
|
|
2669
|
-
//# sourceMappingURL=runtime-agent-controller-reporting-submission-
|
|
2778
|
+
//# sourceMappingURL=runtime-agent-controller-reporting-submission-CQjbBiHh.js.map
|