openmeld 0.3.232 → 0.3.234
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-ChntsjGm.js → add-me-membership-CmHUjDvu.js} +2 -2
- package/dist/{add-me-membership-ChntsjGm.js.map → add-me-membership-CmHUjDvu.js.map} +1 -1
- package/dist/{agents-DruPcNSg.js → agents-CNW1dony.js} +9 -9
- package/dist/{agents-DruPcNSg.js.map → agents-CNW1dony.js.map} +1 -1
- package/dist/{api-client-foundation-CDj_9Rks.js → api-client-foundation-BHjffwwr.js} +1 -1
- package/dist/{api-client-foundation-EZpFLGVC.js → api-client-foundation-D6zHrrGV.js} +3 -3
- package/dist/{api-client-foundation-EZpFLGVC.js.map → api-client-foundation-D6zHrrGV.js.map} +1 -1
- package/dist/auth-session-CCLabxRT.js +4 -0
- package/dist/{auth-session-DhSHCYvl.js → auth-session-CjxqNKvh.js} +4 -4
- package/dist/{auth-session-DhSHCYvl.js.map → auth-session-CjxqNKvh.js.map} +1 -1
- package/dist/{channel-tvFZSSVr.js → channel-BW2_rI6u.js} +4 -4
- package/dist/{channel-tvFZSSVr.js.map → channel-BW2_rI6u.js.map} +1 -1
- 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-0yoZa1GT.js → command-9Iorb5GA.js} +16 -16
- package/dist/{command-0yoZa1GT.js.map → command-9Iorb5GA.js.map} +1 -1
- package/dist/{computer-connection-CoBDorh6.js → computer-connection-LX1R7jD0.js} +2 -2
- package/dist/{computer-connection-CoBDorh6.js.map → computer-connection-LX1R7jD0.js.map} +1 -1
- package/dist/{computer-connection-review-Dy7p1LXZ.js → computer-connection-review-CeOHkloT.js} +5 -5
- package/dist/{computer-connection-review-Dy7p1LXZ.js.map → computer-connection-review-CeOHkloT.js.map} +1 -1
- package/dist/{computer-disconnect-4Ks_DVXV.js → computer-disconnect-CXDO8zgT.js} +7 -7
- package/dist/{computer-disconnect-4Ks_DVXV.js.map → computer-disconnect-CXDO8zgT.js.map} +1 -1
- package/dist/{computer-setup-continuation-ZcQb7MvI.js → computer-setup-continuation-XgvjM0jF.js} +3 -3
- package/dist/{computer-setup-continuation-ZcQb7MvI.js.map → computer-setup-continuation-XgvjM0jF.js.map} +1 -1
- package/dist/{context-BPIoofMa.js → context-D3GnSqg8.js} +3 -3
- package/dist/{context-BPIoofMa.js.map → context-D3GnSqg8.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-DDazRZUV.js → daemon-device-id-OMqh2F9_.js} +5 -5
- package/dist/{daemon-device-id-DDazRZUV.js.map → daemon-device-id-OMqh2F9_.js.map} +1 -1
- package/dist/{daemon-lifecycle-journal-CRxQL9m6.js → daemon-lifecycle-journal-Dq8W9V9C.js} +6 -6
- package/dist/{daemon-lifecycle-journal-CRxQL9m6.js.map → daemon-lifecycle-journal-Dq8W9V9C.js.map} +1 -1
- package/dist/{daemon-service-runtime-BTzL0w6s.js → daemon-service-runtime-B-x4bBKx.js} +4 -4
- package/dist/{daemon-service-runtime-BTzL0w6s.js.map → daemon-service-runtime-B-x4bBKx.js.map} +1 -1
- package/dist/{daemon-service-update-coordinator-BDs0p4bA.js → daemon-service-update-coordinator-Brv_30Kn.js} +20 -18
- package/dist/{daemon-service-update-coordinator-BDs0p4bA.js.map → daemon-service-update-coordinator-Brv_30Kn.js.map} +1 -1
- package/dist/{dispatch-owned-runtime-CK2YJ2Oo.js → dispatch-owned-runtime-Czq270vy.js} +52 -619
- package/dist/dispatch-owned-runtime-Czq270vy.js.map +1 -0
- package/dist/{dist-Bw6OBFYo.js → dist-CJL7LE-y.js} +203 -362
- package/dist/dist-CJL7LE-y.js.map +1 -0
- package/dist/{dist--TaSMxQz.js → dist-Ccpvj1tf.js} +3 -3
- package/dist/{dist--TaSMxQz.js.map → dist-Ccpvj1tf.js.map} +1 -1
- package/dist/{dist-B12upl5l.js → dist-MpN-h8da.js} +1 -1
- package/dist/{elapsed-time-C3nfbdd9.js → elapsed-time-BSphCejK.js} +6 -6
- package/dist/{elapsed-time-C3nfbdd9.js.map → elapsed-time-BSphCejK.js.map} +1 -1
- package/dist/{entry-De__5RVq.js → entry-CDablKgv.js} +7 -7
- package/dist/{entry-De__5RVq.js.map → entry-CDablKgv.js.map} +1 -1
- package/dist/{installation-inventory-Bq8iZfSa.js → installation-inventory-CRnah3Xf.js} +3 -3
- package/dist/{installation-inventory-Bq8iZfSa.js.map → installation-inventory-CRnah3Xf.js.map} +1 -1
- package/dist/{installer-C7iSAOSz.js → installer-BYBrLBth.js} +2 -2
- package/dist/{installer-C7iSAOSz.js.map → installer-BYBrLBth.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/{meta-api-BpwJWE22.js → meta-api-ClHCkzZB.js} +4 -4
- package/dist/{meta-api-BpwJWE22.js.map → meta-api-ClHCkzZB.js.map} +1 -1
- package/dist/{openmeld-C0OSZJtn.js → openmeld-Yz7J0OaB.js} +32 -32
- package/dist/{openmeld-C0OSZJtn.js.map → openmeld-Yz7J0OaB.js.map} +1 -1
- package/dist/openmeld-dev-environment-DwdvL7jg.js +24 -0
- package/dist/openmeld-dev-environment-DwdvL7jg.js.map +1 -0
- package/dist/openmeld-dev.js +1 -19
- package/dist/openmeld-dev.js.map +1 -1
- package/dist/{openmeld-maintenance-worker-DY90mkWW.js → openmeld-maintenance-worker-CVjbc-dv.js} +9 -9
- package/dist/{openmeld-maintenance-worker-DY90mkWW.js.map → openmeld-maintenance-worker-CVjbc-dv.js.map} +1 -1
- package/dist/{openmeld-tools-update-join-DgzNuaDy.js → openmeld-tools-update-join-Em7DfQt6.js} +4 -4
- package/dist/{openmeld-tools-update-join-DgzNuaDy.js.map → openmeld-tools-update-join-Em7DfQt6.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 +5 -5
- package/dist/{prepare-provider-runtime-BGdfbFyZ.js → prepare-provider-runtime-Bf2GBijn.js} +537 -213
- package/dist/prepare-provider-runtime-Bf2GBijn.js.map +1 -0
- package/dist/{prepare-session-executor-CA1gq8dR.js → prepare-session-executor-D8Vbyoq4.js} +19 -19
- package/dist/{prepare-session-executor-CA1gq8dR.js.map → prepare-session-executor-D8Vbyoq4.js.map} +1 -1
- package/dist/{process-channel-C1wRGUmk.js → process-channel-CTPL81j6.js} +2 -2
- package/dist/{process-channel-C1wRGUmk.js.map → process-channel-CTPL81j6.js.map} +1 -1
- package/dist/{runtime-DFlEdls4.js → runtime-aUrBNKSl.js} +7860 -7249
- package/dist/runtime-aUrBNKSl.js.map +1 -0
- package/dist/{runtime-agent-controller-reporting-submission-C_xD2A-P.js → runtime-agent-controller-reporting-submission-BJY9cLyh.js} +146 -70
- package/dist/runtime-agent-controller-reporting-submission-BJY9cLyh.js.map +1 -0
- package/dist/{runtime-transport-DH8Ks-AU.js → runtime-transport-DyBmX7ds.js} +569 -30
- package/dist/runtime-transport-DyBmX7ds.js.map +1 -0
- package/dist/{service-KHA_Yv8q.js → service-CMNaJrvV.js} +105 -39
- package/dist/service-CMNaJrvV.js.map +1 -0
- package/dist/{service-account-authorization-BHWs8cRP.js → service-account-authorization-CdyvPbvg.js} +2 -2
- package/dist/{service-account-authorization-BHWs8cRP.js.map → service-account-authorization-CdyvPbvg.js.map} +1 -1
- package/dist/{service-account-control-BcHjpVid.js → service-account-control-jnKTjLAR.js} +9 -9
- package/dist/{service-account-control-BcHjpVid.js.map → service-account-control-jnKTjLAR.js.map} +1 -1
- package/dist/{service-control-capabilities-B4433dGT.js → service-control-capabilities-CRsFO-Jf.js} +3 -3
- package/dist/{service-control-capabilities-B4433dGT.js.map → service-control-capabilities-CRsFO-Jf.js.map} +1 -1
- package/dist/{service-control-capabilities-DTKD2-o0.js → service-control-capabilities-DpJNUd1S.js} +1 -1
- package/dist/{state-iJqU2XWw.js → state-CON1kJsS.js} +2 -2
- package/dist/{state-iJqU2XWw.js.map → state-CON1kJsS.js.map} +1 -1
- package/dist/{runtime-reporting-health-state-_bvJcV1y.js → updates-api-BpWiCpAo.js} +378 -209
- package/dist/updates-api-BpWiCpAo.js.map +1 -0
- package/dist/{upgrade-DlBDEvs4.js → upgrade-Bdh732dG.js} +8 -8
- package/dist/{upgrade-DlBDEvs4.js.map → upgrade-Bdh732dG.js.map} +1 -1
- package/dist/upgrade-frLu7pCB.js +4 -0
- package/package.json +13 -13
- package/dist/auth-session-BOG3gV2K2.js +0 -4
- package/dist/cli-binary-manifest-Bjf6T7Ef.js.map +0 -1
- package/dist/dispatch-owned-runtime-CK2YJ2Oo.js.map +0 -1
- package/dist/dist-Bw6OBFYo.js.map +0 -1
- package/dist/local-components-DleLEzSU.js.map +0 -1
- package/dist/prepare-provider-runtime-BGdfbFyZ.js.map +0 -1
- package/dist/runtime-DFlEdls4.js.map +0 -1
- package/dist/runtime-agent-controller-reporting-submission-C_xD2A-P.js.map +0 -1
- package/dist/runtime-reporting-health-state-_bvJcV1y.js.map +0 -1
- package/dist/runtime-transport-DH8Ks-AU.js.map +0 -1
- package/dist/service-KHA_Yv8q.js.map +0 -1
- package/dist/upgrade-CuzsgsKh.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 { nt as
|
|
6
|
-
import { d as getAuthSessionState } from "./auth-session-
|
|
7
|
-
import { B as
|
|
8
|
-
import { v as warnDaemonEvent } from "./daemon-device-id-
|
|
3
|
+
import { Bn as toStructuredApiClientFailure, fn as createRuntimeReportingApi } from "./dist-CJL7LE-y.js";
|
|
4
|
+
import { gt as resolvePublicAgentAvailabilityCopy } from "./runtime-transport-DyBmX7ds.js";
|
|
5
|
+
import { Cn as probeCodexAppServerAccount, Dn as probeClaudeCodeUsageLimits, En as projectCodexUsageLimits, I as listAgentTargetStates, Jn as createUnavailableProviderUsageLimits, Qn as materializeCliLaunchCommand, Yn as createUnsupportedProviderUsageLimits, Zn as buildCliLaunchInvocation, _n as probeGrokBuildAcpInterface, ar as areAgentControllerInterfaceAccountsSame, at as isHomebrewCommandPath, fn as parseOpenRouterUsageResponse, gn as GrokBuildAcpTransportError, hr as isAgentControllerUsageRefreshUnavailable, it as isBunGlobalCommandPath, j as resolveAgentProfilePrimaryAgentControllerReport, nt as EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES, or as buildAgentControllerRef, ot as isNpmGlobalCommandPath, pn as parseOpenCodeGoUsageResponse, rt as resolveBuiltinAgentControllerDefinition, st as isPnpmGlobalCommandPath, tr as createProviderOriginalError, x as resolveLocalRuntimeControllerSupport, yn as projectCursorUsageLimits } from "./prepare-provider-runtime-Bf2GBijn.js";
|
|
6
|
+
import { T as readMacOsNativeKeychainToken, d as getAuthSessionState } from "./auth-session-CjxqNKvh.js";
|
|
7
|
+
import { B as didAgentControllerCommandFingerprintRemainStable, G as recordAgentControllerInterfaceProbeFailure, H as readLastKnownAgentControllerUsageLimits, J as resolveAgentControllerCommandFingerprint, K as recordAgentControllerInterfaceProbeSuccess, R as buildAgentControllerInterfaceKeeperKey, U as readLastSuccessfulAgentControllerInterfaceCheckAt, V as readLastKnownAgentControllerAuthSnapshot, W as readReusableAgentControllerInterfaceSnapshot, q as recordAgentControllerUsageLimitsObservation, x as resolveOpenCodeAuthPath } from "./dispatch-owned-runtime-Czq270vy.js";
|
|
8
|
+
import { v as warnDaemonEvent } from "./daemon-device-id-OMqh2F9_.js";
|
|
9
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-
|
|
10
|
+
import { l as canAttachAuthTokenToRequest, t as createCliApiClientFoundation, u as fingerprintRequestAuthorization } from "./api-client-foundation-D6zHrrGV.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
|
}
|
|
@@ -801,7 +868,6 @@ const CODEX_AUX_INVENTORY_GRACE_MS = 2500;
|
|
|
801
868
|
const PROBE_OUTPUT_LIMIT = 32e3;
|
|
802
869
|
const CODEX_USER_AGENT_VERSION_RE = /\/([^\s]+)/u;
|
|
803
870
|
const CLI_SEMVER_RE = /\b(\d+\.\d+\.\d+(?:[-+][^\s]+)?)\b/u;
|
|
804
|
-
const ANTIGRAVITY_AUTH_FAILURE_RE = /auth(?:entication)? required|not signed in|sign in/iu;
|
|
805
871
|
const SEMVER_CORE_RE = /^v?(\d+)\.(\d+)\.(\d+)/u;
|
|
806
872
|
const WHITESPACE_RE = /\s+/u;
|
|
807
873
|
const CONTROLLER_INTERFACE_SNAPSHOT_RESOLVERS = {
|
|
@@ -814,59 +880,46 @@ const CONTROLLER_INTERFACE_SNAPSHOT_RESOLVERS = {
|
|
|
814
880
|
opencode: resolveOpenCodeInterfaceSnapshot
|
|
815
881
|
};
|
|
816
882
|
async function resolveAntigravityInterfaceSnapshot(input) {
|
|
817
|
-
const
|
|
883
|
+
const versionProbe = await runLaunchContractCommand({
|
|
818
884
|
workingDirectory: input.workingDirectory,
|
|
819
885
|
args: ["--version"],
|
|
820
886
|
launchContract: input.launchContract
|
|
821
|
-
})
|
|
822
|
-
workingDirectory: input.workingDirectory,
|
|
823
|
-
allowNonZeroExit: true,
|
|
824
|
-
args: ["--print", "/usage"],
|
|
825
|
-
launchContract: input.launchContract,
|
|
826
|
-
timeoutMs: 15e3
|
|
827
|
-
})]);
|
|
887
|
+
});
|
|
828
888
|
const version = versionProbe.ok ? parseCliVersion(versionProbe.stdout) : null;
|
|
829
|
-
const observedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
830
|
-
const providerMessage = `${usageProbe.stdout}\n${usageProbe.stderr}`.trim();
|
|
831
|
-
const unauthenticated = usageProbe.code !== 0 && ANTIGRAVITY_AUTH_FAILURE_RE.test(providerMessage);
|
|
832
|
-
const usageLimits = usageProbe.code === 0 ? parseAntigravityUsageLimits({
|
|
833
|
-
observedAt,
|
|
834
|
-
output: usageProbe.stdout
|
|
835
|
-
}) : createUnavailableProviderUsageLimits(observedAt);
|
|
836
|
-
const probeCompleted = usageProbe.code === 0 || unauthenticated;
|
|
837
|
-
let authStatus = "unknown";
|
|
838
|
-
let message = "OpenMeld could not read Antigravity CLI authentication or usage status.";
|
|
839
|
-
let status = "warning";
|
|
840
|
-
if (unauthenticated) {
|
|
841
|
-
authStatus = "unauthenticated";
|
|
842
|
-
message = requireControllerSignInInterfaceDescription("antigravity");
|
|
843
|
-
status = "unavailable";
|
|
844
|
-
} else if (usageProbe.code === 0) {
|
|
845
|
-
authStatus = "authenticated";
|
|
846
|
-
message = null;
|
|
847
|
-
status = "ready";
|
|
848
|
-
}
|
|
849
889
|
return {
|
|
850
|
-
probeCompleted,
|
|
890
|
+
probeCompleted: versionProbe.ok,
|
|
851
891
|
snapshot: {
|
|
852
892
|
...input.baseSnapshot,
|
|
853
|
-
auth: {
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
message,
|
|
858
|
-
status,
|
|
859
|
-
usageLimits,
|
|
893
|
+
auth: { status: "unknown" },
|
|
894
|
+
message: versionProbe.ok ? "Antigravity is installed. OpenMeld cannot safely check its sign-in status or usage limits. Check them directly in Antigravity." : "OpenMeld could not read the Antigravity CLI version.",
|
|
895
|
+
status: "warning",
|
|
896
|
+
usageLimits: createUnsupportedProviderUsageLimits(input.baseSnapshot.checkedAt),
|
|
860
897
|
version
|
|
861
898
|
}
|
|
862
899
|
};
|
|
863
900
|
}
|
|
864
901
|
async function probeAgentControllerUsageObservationAuth(input) {
|
|
902
|
+
if (input.agentId === "codex") try {
|
|
903
|
+
const account = await probeCodexAppServerAccount({
|
|
904
|
+
launchContract: input.launchContract,
|
|
905
|
+
timeoutMs: PROBE_TIMEOUT_MS
|
|
906
|
+
});
|
|
907
|
+
return {
|
|
908
|
+
status: account.authStatus,
|
|
909
|
+
...account.email ? { email: account.email } : {}
|
|
910
|
+
};
|
|
911
|
+
} catch {
|
|
912
|
+
return { status: "unknown" };
|
|
913
|
+
}
|
|
865
914
|
if (input.agentId !== "claude-code") return { status: "unknown" };
|
|
866
915
|
return resolveClaudeAuthSnapshot(await withProbeWorkingDirectory((workingDirectory) => runLaunchContractCommand({
|
|
867
916
|
workingDirectory,
|
|
868
917
|
allowNonZeroExit: true,
|
|
869
|
-
args: [
|
|
918
|
+
args: [
|
|
919
|
+
"auth",
|
|
920
|
+
"status",
|
|
921
|
+
"--json"
|
|
922
|
+
],
|
|
870
923
|
launchContract: input.launchContract
|
|
871
924
|
})));
|
|
872
925
|
}
|
|
@@ -951,8 +1004,7 @@ async function resolveAgentControllerInterfaceSnapshot(input) {
|
|
|
951
1004
|
currentAuth: outcome.snapshot.auth,
|
|
952
1005
|
current: outcome.snapshot.usageLimits,
|
|
953
1006
|
previous: lastKnownUsageLimits,
|
|
954
|
-
previousAuth: lastKnownAuth
|
|
955
|
-
support: controllerDefinition?.usageLimitSupport ?? "not_evaluated"
|
|
1007
|
+
previousAuth: lastKnownAuth
|
|
956
1008
|
});
|
|
957
1009
|
const completedSnapshot = withUsageLimits({
|
|
958
1010
|
...outcome.snapshot,
|
|
@@ -1011,11 +1063,11 @@ function withUsageLimits(snapshot, usageLimits) {
|
|
|
1011
1063
|
}
|
|
1012
1064
|
function resolveUsageLimitsAfterCompletedProbe(input) {
|
|
1013
1065
|
if (!areAgentControllerInterfaceAccountsSame(input.previousAuth, input.currentAuth)) return input.current;
|
|
1014
|
-
if (input.
|
|
1066
|
+
if (!input.current) return input.previous ?? void 0;
|
|
1015
1067
|
return preserveLastKnownUsageLimitsAfterFailure(input);
|
|
1016
1068
|
}
|
|
1017
1069
|
function preserveLastKnownUsageLimitsAfterFailure(input) {
|
|
1018
|
-
const currentIsUnavailable = input.current
|
|
1070
|
+
const currentIsUnavailable = isAgentControllerUsageRefreshUnavailable(input.current);
|
|
1019
1071
|
const previousHasKnownCapacity = input.previous?.some((limit) => limit.status === "available" || limit.status === "exhausted" || limit.status === "stale");
|
|
1020
1072
|
if (!(currentIsUnavailable && previousHasKnownCapacity && input.previous)) return input.current;
|
|
1021
1073
|
return input.previous.map((limit) => limit.usedPercent === null ? limit : {
|
|
@@ -1028,7 +1080,7 @@ function resolveUsageLimitsAfterFailedProbe(input) {
|
|
|
1028
1080
|
return preserveLastKnownUsageLimitsAfterFailure(input);
|
|
1029
1081
|
}
|
|
1030
1082
|
function resolveInitialProviderUsageLimits(input) {
|
|
1031
|
-
if (input.support === "native") return createUnavailableProviderUsageLimits(input.checkedAt);
|
|
1083
|
+
if (input.support === "native" || input.support === "observational") return createUnavailableProviderUsageLimits(input.checkedAt);
|
|
1032
1084
|
if (input.support === "unsupported") return createUnsupportedProviderUsageLimits(input.checkedAt);
|
|
1033
1085
|
}
|
|
1034
1086
|
function resolveLaunchSnapshot(state) {
|
|
@@ -1208,6 +1260,14 @@ async function resolveClaudeCodeInterfaceSnapshot(input) {
|
|
|
1208
1260
|
})]);
|
|
1209
1261
|
const auth = resolveClaudeAuthSnapshot(authProbe);
|
|
1210
1262
|
const version = versionProbe.ok ? parseCliVersion(versionProbe.stdout) : null;
|
|
1263
|
+
let usageLimits = createUnavailableProviderUsageLimits(input.baseSnapshot.checkedAt, void 0, { reason: "not_reported" });
|
|
1264
|
+
if (auth.status !== "authenticated") usageLimits = createUnavailableProviderUsageLimits(input.baseSnapshot.checkedAt, void 0, { reason: auth.status === "unauthenticated" ? "not_authenticated" : "refresh_failed" });
|
|
1265
|
+
else if (auth.email && version && (compareSemverCore(version, "2.1.285") ?? -1) >= 0) usageLimits = await probeClaudeCodeUsageLimits({
|
|
1266
|
+
expectedEmail: auth.email,
|
|
1267
|
+
launchContract: input.launchContract,
|
|
1268
|
+
workingDirectory: input.workingDirectory,
|
|
1269
|
+
observedAt: input.baseSnapshot.checkedAt
|
|
1270
|
+
});
|
|
1211
1271
|
let message = input.baseSnapshot.message;
|
|
1212
1272
|
let status = input.baseSnapshot.status;
|
|
1213
1273
|
if (auth.status === "unauthenticated") {
|
|
@@ -1222,6 +1282,7 @@ async function resolveClaudeCodeInterfaceSnapshot(input) {
|
|
|
1222
1282
|
snapshot: {
|
|
1223
1283
|
...input.baseSnapshot,
|
|
1224
1284
|
auth,
|
|
1285
|
+
usageLimits,
|
|
1225
1286
|
message,
|
|
1226
1287
|
status,
|
|
1227
1288
|
version,
|
|
@@ -1251,6 +1312,7 @@ async function resolveCursorInterfaceSnapshot(input) {
|
|
|
1251
1312
|
})]);
|
|
1252
1313
|
const auth = resolveCursorAuthSnapshot(authProbe);
|
|
1253
1314
|
const version = versionProbe.ok ? parseCliVersion(versionProbe.stdout) : null;
|
|
1315
|
+
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" });
|
|
1254
1316
|
let message = input.baseSnapshot.message;
|
|
1255
1317
|
let status = input.baseSnapshot.status;
|
|
1256
1318
|
if (auth.status === "unauthenticated") {
|
|
@@ -1265,6 +1327,7 @@ async function resolveCursorInterfaceSnapshot(input) {
|
|
|
1265
1327
|
snapshot: {
|
|
1266
1328
|
...input.baseSnapshot,
|
|
1267
1329
|
auth,
|
|
1330
|
+
usageLimits,
|
|
1268
1331
|
message,
|
|
1269
1332
|
status,
|
|
1270
1333
|
version,
|
|
@@ -1768,11 +1831,15 @@ function resolveCursorAuthSnapshot(probe) {
|
|
|
1768
1831
|
if (!probe.ok) return { status: "unknown" };
|
|
1769
1832
|
const payload = parseJsonRecord(probe.stdout);
|
|
1770
1833
|
if (payload?.status === "unauthenticated") return { status: "unauthenticated" };
|
|
1771
|
-
if (payload?.status === "authenticated")
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1834
|
+
if (payload?.status === "authenticated") {
|
|
1835
|
+
const email = normalizeOptionalText(payload.email);
|
|
1836
|
+
return {
|
|
1837
|
+
...email ? { email } : {},
|
|
1838
|
+
label: email ?? "Signed in",
|
|
1839
|
+
status: "authenticated",
|
|
1840
|
+
type: "cursor_login"
|
|
1841
|
+
};
|
|
1842
|
+
}
|
|
1776
1843
|
return { status: "unknown" };
|
|
1777
1844
|
}
|
|
1778
1845
|
function resolveOpenClawAuthProbe(probe) {
|
|
@@ -2021,10 +2088,19 @@ function projectAgentControllerInterfaceForCloud(snapshot) {
|
|
|
2021
2088
|
skills: [],
|
|
2022
2089
|
status: snapshot.status,
|
|
2023
2090
|
...snapshot.usageLimits ? { usageLimits: snapshot.usageLimits.map((limit) => ({
|
|
2024
|
-
|
|
2025
|
-
|
|
2091
|
+
key: limit.key,
|
|
2092
|
+
label: limit.label,
|
|
2093
|
+
observedAt: limit.observedAt,
|
|
2094
|
+
...limit.reason ? { reason: limit.reason } : {},
|
|
2095
|
+
...limit.provider ? { provider: {
|
|
2096
|
+
displayName: limit.provider.displayName,
|
|
2097
|
+
id: limit.provider.id
|
|
2098
|
+
} } : {},
|
|
2099
|
+
resetsAt: limit.resetsAt,
|
|
2100
|
+
status: limit.status,
|
|
2101
|
+
usedPercent: limit.usedPercent
|
|
2026
2102
|
})) } : {},
|
|
2027
|
-
usageLimitsSupportMatrixVersion:
|
|
2103
|
+
usageLimitsSupportMatrixVersion: 5,
|
|
2028
2104
|
version: snapshot.version,
|
|
2029
2105
|
...snapshot.versionAdvisory ? { versionAdvisory: {
|
|
2030
2106
|
checkedAt: snapshot.versionAdvisory.checkedAt,
|
|
@@ -2669,4 +2745,4 @@ function toErrorMessage(error) {
|
|
|
2669
2745
|
//#endregion
|
|
2670
2746
|
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 };
|
|
2671
2747
|
|
|
2672
|
-
//# sourceMappingURL=runtime-agent-controller-reporting-submission-
|
|
2748
|
+
//# sourceMappingURL=runtime-agent-controller-reporting-submission-BJY9cLyh.js.map
|