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.
Files changed (110) hide show
  1. package/dist/{add-me-membership-ChntsjGm.js → add-me-membership-CmHUjDvu.js} +2 -2
  2. package/dist/{add-me-membership-ChntsjGm.js.map → add-me-membership-CmHUjDvu.js.map} +1 -1
  3. package/dist/{agents-DruPcNSg.js → agents-CNW1dony.js} +9 -9
  4. package/dist/{agents-DruPcNSg.js.map → agents-CNW1dony.js.map} +1 -1
  5. package/dist/{api-client-foundation-CDj_9Rks.js → api-client-foundation-BHjffwwr.js} +1 -1
  6. package/dist/{api-client-foundation-EZpFLGVC.js → api-client-foundation-D6zHrrGV.js} +3 -3
  7. package/dist/{api-client-foundation-EZpFLGVC.js.map → api-client-foundation-D6zHrrGV.js.map} +1 -1
  8. package/dist/auth-session-CCLabxRT.js +4 -0
  9. package/dist/{auth-session-DhSHCYvl.js → auth-session-CjxqNKvh.js} +4 -4
  10. package/dist/{auth-session-DhSHCYvl.js.map → auth-session-CjxqNKvh.js.map} +1 -1
  11. package/dist/{channel-tvFZSSVr.js → channel-BW2_rI6u.js} +4 -4
  12. package/dist/{channel-tvFZSSVr.js.map → channel-BW2_rI6u.js.map} +1 -1
  13. package/dist/{cli-binary-manifest-Bjf6T7Ef.js → cli-binary-manifest-ETxqCzfS.js} +8 -1
  14. package/dist/cli-binary-manifest-ETxqCzfS.js.map +1 -0
  15. package/dist/{command-0yoZa1GT.js → command-9Iorb5GA.js} +16 -16
  16. package/dist/{command-0yoZa1GT.js.map → command-9Iorb5GA.js.map} +1 -1
  17. package/dist/{computer-connection-CoBDorh6.js → computer-connection-LX1R7jD0.js} +2 -2
  18. package/dist/{computer-connection-CoBDorh6.js.map → computer-connection-LX1R7jD0.js.map} +1 -1
  19. package/dist/{computer-connection-review-Dy7p1LXZ.js → computer-connection-review-CeOHkloT.js} +5 -5
  20. package/dist/{computer-connection-review-Dy7p1LXZ.js.map → computer-connection-review-CeOHkloT.js.map} +1 -1
  21. package/dist/{computer-disconnect-4Ks_DVXV.js → computer-disconnect-CXDO8zgT.js} +7 -7
  22. package/dist/{computer-disconnect-4Ks_DVXV.js.map → computer-disconnect-CXDO8zgT.js.map} +1 -1
  23. package/dist/{computer-setup-continuation-ZcQb7MvI.js → computer-setup-continuation-XgvjM0jF.js} +3 -3
  24. package/dist/{computer-setup-continuation-ZcQb7MvI.js.map → computer-setup-continuation-XgvjM0jF.js.map} +1 -1
  25. package/dist/{context-BPIoofMa.js → context-D3GnSqg8.js} +3 -3
  26. package/dist/{context-BPIoofMa.js.map → context-D3GnSqg8.js.map} +1 -1
  27. package/dist/{control-plane-rTE2rHZ5.js → control-plane-QqGL-jtT.js} +2 -2
  28. package/dist/{control-plane-rTE2rHZ5.js.map → control-plane-QqGL-jtT.js.map} +1 -1
  29. package/dist/{daemon-device-id-DDazRZUV.js → daemon-device-id-OMqh2F9_.js} +5 -5
  30. package/dist/{daemon-device-id-DDazRZUV.js.map → daemon-device-id-OMqh2F9_.js.map} +1 -1
  31. package/dist/{daemon-lifecycle-journal-CRxQL9m6.js → daemon-lifecycle-journal-Dq8W9V9C.js} +6 -6
  32. package/dist/{daemon-lifecycle-journal-CRxQL9m6.js.map → daemon-lifecycle-journal-Dq8W9V9C.js.map} +1 -1
  33. package/dist/{daemon-service-runtime-BTzL0w6s.js → daemon-service-runtime-B-x4bBKx.js} +4 -4
  34. package/dist/{daemon-service-runtime-BTzL0w6s.js.map → daemon-service-runtime-B-x4bBKx.js.map} +1 -1
  35. package/dist/{daemon-service-update-coordinator-BDs0p4bA.js → daemon-service-update-coordinator-Brv_30Kn.js} +20 -18
  36. package/dist/{daemon-service-update-coordinator-BDs0p4bA.js.map → daemon-service-update-coordinator-Brv_30Kn.js.map} +1 -1
  37. package/dist/{dispatch-owned-runtime-CK2YJ2Oo.js → dispatch-owned-runtime-Czq270vy.js} +52 -619
  38. package/dist/dispatch-owned-runtime-Czq270vy.js.map +1 -0
  39. package/dist/{dist-Bw6OBFYo.js → dist-CJL7LE-y.js} +203 -362
  40. package/dist/dist-CJL7LE-y.js.map +1 -0
  41. package/dist/{dist--TaSMxQz.js → dist-Ccpvj1tf.js} +3 -3
  42. package/dist/{dist--TaSMxQz.js.map → dist-Ccpvj1tf.js.map} +1 -1
  43. package/dist/{dist-B12upl5l.js → dist-MpN-h8da.js} +1 -1
  44. package/dist/{elapsed-time-C3nfbdd9.js → elapsed-time-BSphCejK.js} +6 -6
  45. package/dist/{elapsed-time-C3nfbdd9.js.map → elapsed-time-BSphCejK.js.map} +1 -1
  46. package/dist/{entry-De__5RVq.js → entry-CDablKgv.js} +7 -7
  47. package/dist/{entry-De__5RVq.js.map → entry-CDablKgv.js.map} +1 -1
  48. package/dist/{installation-inventory-Bq8iZfSa.js → installation-inventory-CRnah3Xf.js} +3 -3
  49. package/dist/{installation-inventory-Bq8iZfSa.js.map → installation-inventory-CRnah3Xf.js.map} +1 -1
  50. package/dist/{installer-C7iSAOSz.js → installer-BYBrLBth.js} +2 -2
  51. package/dist/{installer-C7iSAOSz.js.map → installer-BYBrLBth.js.map} +1 -1
  52. package/dist/{local-components-DleLEzSU.js → local-components-DJiMS67S.js} +36 -3
  53. package/dist/local-components-DJiMS67S.js.map +1 -0
  54. package/dist/{meta-api-BpwJWE22.js → meta-api-ClHCkzZB.js} +4 -4
  55. package/dist/{meta-api-BpwJWE22.js.map → meta-api-ClHCkzZB.js.map} +1 -1
  56. package/dist/{openmeld-C0OSZJtn.js → openmeld-Yz7J0OaB.js} +32 -32
  57. package/dist/{openmeld-C0OSZJtn.js.map → openmeld-Yz7J0OaB.js.map} +1 -1
  58. package/dist/openmeld-dev-environment-DwdvL7jg.js +24 -0
  59. package/dist/openmeld-dev-environment-DwdvL7jg.js.map +1 -0
  60. package/dist/openmeld-dev.js +1 -19
  61. package/dist/openmeld-dev.js.map +1 -1
  62. package/dist/{openmeld-maintenance-worker-DY90mkWW.js → openmeld-maintenance-worker-CVjbc-dv.js} +9 -9
  63. package/dist/{openmeld-maintenance-worker-DY90mkWW.js.map → openmeld-maintenance-worker-CVjbc-dv.js.map} +1 -1
  64. package/dist/{openmeld-tools-update-join-DgzNuaDy.js → openmeld-tools-update-join-Em7DfQt6.js} +4 -4
  65. package/dist/{openmeld-tools-update-join-DgzNuaDy.js.map → openmeld-tools-update-join-Em7DfQt6.js.map} +1 -1
  66. package/dist/{openmeld-tools-update-process-frame-DbEZ3fEh.js → openmeld-tools-update-process-frame-Csy2XKUf.js} +1 -1
  67. package/dist/{openmeld-tools-update-process-frame-BtFKp70p.js → openmeld-tools-update-process-frame-YLOS82E3.js} +2 -2
  68. package/dist/{openmeld-tools-update-process-frame-BtFKp70p.js.map → openmeld-tools-update-process-frame-YLOS82E3.js.map} +1 -1
  69. package/dist/openmeld.js +5 -5
  70. package/dist/{prepare-provider-runtime-BGdfbFyZ.js → prepare-provider-runtime-Bf2GBijn.js} +537 -213
  71. package/dist/prepare-provider-runtime-Bf2GBijn.js.map +1 -0
  72. package/dist/{prepare-session-executor-CA1gq8dR.js → prepare-session-executor-D8Vbyoq4.js} +19 -19
  73. package/dist/{prepare-session-executor-CA1gq8dR.js.map → prepare-session-executor-D8Vbyoq4.js.map} +1 -1
  74. package/dist/{process-channel-C1wRGUmk.js → process-channel-CTPL81j6.js} +2 -2
  75. package/dist/{process-channel-C1wRGUmk.js.map → process-channel-CTPL81j6.js.map} +1 -1
  76. package/dist/{runtime-DFlEdls4.js → runtime-aUrBNKSl.js} +7860 -7249
  77. package/dist/runtime-aUrBNKSl.js.map +1 -0
  78. package/dist/{runtime-agent-controller-reporting-submission-C_xD2A-P.js → runtime-agent-controller-reporting-submission-BJY9cLyh.js} +146 -70
  79. package/dist/runtime-agent-controller-reporting-submission-BJY9cLyh.js.map +1 -0
  80. package/dist/{runtime-transport-DH8Ks-AU.js → runtime-transport-DyBmX7ds.js} +569 -30
  81. package/dist/runtime-transport-DyBmX7ds.js.map +1 -0
  82. package/dist/{service-KHA_Yv8q.js → service-CMNaJrvV.js} +105 -39
  83. package/dist/service-CMNaJrvV.js.map +1 -0
  84. package/dist/{service-account-authorization-BHWs8cRP.js → service-account-authorization-CdyvPbvg.js} +2 -2
  85. package/dist/{service-account-authorization-BHWs8cRP.js.map → service-account-authorization-CdyvPbvg.js.map} +1 -1
  86. package/dist/{service-account-control-BcHjpVid.js → service-account-control-jnKTjLAR.js} +9 -9
  87. package/dist/{service-account-control-BcHjpVid.js.map → service-account-control-jnKTjLAR.js.map} +1 -1
  88. package/dist/{service-control-capabilities-B4433dGT.js → service-control-capabilities-CRsFO-Jf.js} +3 -3
  89. package/dist/{service-control-capabilities-B4433dGT.js.map → service-control-capabilities-CRsFO-Jf.js.map} +1 -1
  90. package/dist/{service-control-capabilities-DTKD2-o0.js → service-control-capabilities-DpJNUd1S.js} +1 -1
  91. package/dist/{state-iJqU2XWw.js → state-CON1kJsS.js} +2 -2
  92. package/dist/{state-iJqU2XWw.js.map → state-CON1kJsS.js.map} +1 -1
  93. package/dist/{runtime-reporting-health-state-_bvJcV1y.js → updates-api-BpWiCpAo.js} +378 -209
  94. package/dist/updates-api-BpWiCpAo.js.map +1 -0
  95. package/dist/{upgrade-DlBDEvs4.js → upgrade-Bdh732dG.js} +8 -8
  96. package/dist/{upgrade-DlBDEvs4.js.map → upgrade-Bdh732dG.js.map} +1 -1
  97. package/dist/upgrade-frLu7pCB.js +4 -0
  98. package/package.json +13 -13
  99. package/dist/auth-session-BOG3gV2K2.js +0 -4
  100. package/dist/cli-binary-manifest-Bjf6T7Ef.js.map +0 -1
  101. package/dist/dispatch-owned-runtime-CK2YJ2Oo.js.map +0 -1
  102. package/dist/dist-Bw6OBFYo.js.map +0 -1
  103. package/dist/local-components-DleLEzSU.js.map +0 -1
  104. package/dist/prepare-provider-runtime-BGdfbFyZ.js.map +0 -1
  105. package/dist/runtime-DFlEdls4.js.map +0 -1
  106. package/dist/runtime-agent-controller-reporting-submission-C_xD2A-P.js.map +0 -1
  107. package/dist/runtime-reporting-health-state-_bvJcV1y.js.map +0 -1
  108. package/dist/runtime-transport-DH8Ks-AU.js.map +0 -1
  109. package/dist/service-KHA_Yv8q.js.map +0 -1
  110. package/dist/upgrade-CuzsgsKh.js +0 -4
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { F as resolveOpenMeldRootDir, P as resolveOpenMeldEnvPreset, a as accountProfileWorkspacePath, b as normalizeOpenMeldProfileId, c as deviceOpenClawProfileBootstrapPath, h as isPublishedOpenMeldHome, l as deviceOpenClawProfileDir, n as accountProfileLocalMetaPath, u as deviceOpenClawProfileWorkspaceDir } from "./paths-De9xdA2h.js";
4
- import { $t as createLocalRuntimeExpectedRoutesApi, Rt as createAgentProfileBindingApi, t as OpenMeldApiClientHttpError, wi as modelCatalogSchema } from "./dist-Bw6OBFYo.js";
4
+ import { $t as createLocalRuntimeExpectedRoutesApi, Rt as createAgentProfileBindingApi, t as OpenMeldApiClientHttpError, wi as modelCatalogSchema } from "./dist-CJL7LE-y.js";
5
+ import { G as isOriginalErrorSafeForMessageDetails, J as openMeldDaemonProviderAccessEvidenceSchema, Nr as agentInteractionResolutionSchema, W as OPENMELD_ORIGINAL_ERROR_MAX_LENGTH, X as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, Y as openMeldDaemonTaskResultEnvelopeWriteSchema, fr as normalizeMessageEnvelope, lr as formatCanonicalMentionLiteral, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, tt as aiUsageObservationSchema, zi as resolveCommandAgentWorkActivity } from "./runtime-transport-DyBmX7ds.js";
6
+ import { C as conversationExecutionStateSchema, D as normalizeOptionalWorkingDirectory, P as profileWorkspaceModeSchema, T as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, o as openMeldDaemonControlPlaneRequestSchema, s as openMeldDaemonControlPlaneResponseSchema, x as providerDispatchRuntimeContextSchema } from "./control-plane-QqGL-jtT.js";
5
7
  import { _ as canonicalizeAgentControllerRef, b as normalizeKnownBuiltinAgentControllerId, d as resolveBuiltinAgentControllerConversationKind, f as HOSTED_CENTER_AGENT_CONTROLLER_REF, g as buildAgentControllerRoutingKey, l as buildAgentControllerConversationRef, m as HOSTED_REMOTE_AGENT_CONTROLLER_REF, p as HOSTED_CENTER_AGENT_CONTROLLER_REF_ID, s as runtimeTransportModeSchema, v as canonicalizeBuiltinAgentControllerRef, x as parseAgentControllerRef$1 } from "./controller-contract-DAOCaefz.js";
6
- import { Ei as resolveCommandAgentWorkActivity, G as isOriginalErrorSafeForMessageDetails, J as openMeldDaemonProviderAccessEvidenceSchema, Qn as normalizeMessageEnvelope, W as OPENMELD_ORIGINAL_ERROR_MAX_LENGTH, X as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, Y as openMeldDaemonTaskResultEnvelopeWriteSchema, Yn as formatCanonicalMentionLiteral, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, yr as agentInteractionResolutionSchema } from "./runtime-transport-DH8Ks-AU.js";
7
- import { d as getAuthSessionState, q as OPENCLAW_CLI_TIMEOUT_MS$1 } from "./auth-session-DhSHCYvl.js";
8
- import { C as conversationExecutionStateSchema, D as normalizeOptionalWorkingDirectory, P as profileWorkspaceModeSchema, T as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, o as openMeldDaemonControlPlaneRequestSchema, s as openMeldDaemonControlPlaneResponseSchema, x as providerDispatchRuntimeContextSchema } from "./control-plane-rTE2rHZ5.js";
8
+ import { J as OPENCLAW_CLI_TIMEOUT_MS$1, d as getAuthSessionState } from "./auth-session-CjxqNKvh.js";
9
9
  import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
10
10
  import { n as agentControllerPermissionModeSchema, r as agentControllerCollaborationModeSchema } from "./open-code-permission-DHFJYc_o.js";
11
- import { $ as touchDaemonCatalogSyncSignal, K as listOpenMeldProfiles, _ as toErrorMessage$20, d as normalizeText$11, g as parseTransportMode$1, gt as DAEMON_ROUTE_CATALOG_CACHE_SCHEMA_NAME, h as parseStreamingMode$1, ht as resolveCurrentOpenMeldAccountContext, m as parseRuntimeTransportMode, p as parseContextIdMappingSpec, s as emitRunLine, u as normalizeOptionalText$51, vt as daemonRouteCatalogCacheSchema } from "./daemon-device-id-DDazRZUV.js";
11
+ import { $ as touchDaemonCatalogSyncSignal, K as listOpenMeldProfiles, _ as toErrorMessage$20, d as normalizeText$11, g as parseTransportMode$1, gt as DAEMON_ROUTE_CATALOG_CACHE_SCHEMA_NAME, h as parseStreamingMode$1, ht as resolveCurrentOpenMeldAccountContext, m as parseRuntimeTransportMode, p as parseContextIdMappingSpec, s as emitRunLine, u as normalizeOptionalText$51, vt as daemonRouteCatalogCacheSchema } from "./daemon-device-id-OMqh2F9_.js";
12
12
  import { c as readWindowsProcessStartFileTime, d as resolveWindowsNativeProcessHelper, f as windowsNativeProcessRequestSchema, l as resolveWindowsPowerShellPath, o as powerShellEncodedArguments, r as isProcessIdentityAlive, t as CURRENT_PROCESS_START_IDENTITY, u as WINDOWS_NATIVE_PROCESS_REQUEST_ENV } from "./process-identity-BRbhGGTM.js";
13
13
  import { a as isOpenMeldOrphanedLockError, d as runWithHeldLock, i as isOpenMeldLockError, t as acquireLock } from "./lock-BMI00i2F.js";
14
14
  import { C as updateConfiguredDeviceRuntimeState, T as updateConfiguredSkillsConfig, a as resolveBaseUrl, d as createDefaultRuntimeAgentControllerSettings, g as getConfiguredSkillsConfig, p as getConfiguredDeviceRuntimeState, v as getRuntimeConfigReadHealth, y as resolveRuntimeSkillsCustomTargetId } from "./base-url-0AoeTi3w.js";
@@ -16,9 +16,9 @@ import { n as normalizeCommandEnvironment } from "./process-environment-BWSFeUu6
16
16
  import { n as writeDaemonLocalStateFile, t as readDaemonLocalStateFile } from "./daemon-local-state-file-jOXuXrky.js";
17
17
  import { m as daemonRuntimeDataPath } from "./daemon-state-Dte9re5V.js";
18
18
  import { i as readDaemonServiceContract } from "./daemon-service-contract-COPKbCy_.js";
19
- import { C as requestLocalSyncRouteCatalog } from "./daemon-lifecycle-journal-CRxQL9m6.js";
19
+ import { C as requestLocalSyncRouteCatalog } from "./daemon-lifecycle-journal-Dq8W9V9C.js";
20
20
  import { i as resolveWindowsCommandPath, n as quoteWindowsProcessArgument, r as resolvePlatformCommand, t as execPlatformFile } from "./process-launch-B0pHlkV_.js";
21
- import { d as buildOpenMeldRequestContextFromProfile, t as createCliApiClientFoundation } from "./api-client-foundation-EZpFLGVC.js";
21
+ import { d as buildOpenMeldRequestContextFromProfile, t as createCliApiClientFoundation } from "./api-client-foundation-D6zHrrGV.js";
22
22
  import { createRequire } from "node:module";
23
23
  import { createHash, randomUUID } from "node:crypto";
24
24
  import { homedir, loadavg, tmpdir } from "node:os";
@@ -760,10 +760,10 @@ function isAgentControllerPermissionModeControllerId(value) {
760
760
  return Object.hasOwn(AGENT_CONTROLLER_PERMISSION_MODE_OPTIONS_BY_CONTROLLER_ID, value);
761
761
  }
762
762
  const AGENT_CONTROLLER_USAGE_LIMIT_SUPPORT_MATRIX = {
763
- antigravity: "native",
764
- "claude-code": "passive",
763
+ antigravity: "unsupported",
764
+ "claude-code": "observational",
765
765
  codex: "native",
766
- cursor: "unsupported",
766
+ cursor: "observational",
767
767
  "grok-build": "native",
768
768
  opencode: "provider_scoped",
769
769
  openclaw: "not_evaluated"
@@ -773,6 +773,13 @@ function resolveAgentControllerUsageLimitSupport(agentControllerRef) {
773
773
  if (parsedRef?.kind !== "builtin") return "not_evaluated";
774
774
  return AGENT_CONTROLLER_USAGE_LIMIT_SUPPORT_MATRIX[parsedRef.id] ?? "not_evaluated";
775
775
  }
776
+ function isAgentControllerUsageRefreshUnavailable(limits) {
777
+ return (limits?.length === 1 ? limits[0] : void 0)?.status === "unavailable" && !isAgentControllerUsageAccountUnavailable(limits);
778
+ }
779
+ function isAgentControllerUsageAccountUnavailable(limits) {
780
+ const limit = limits?.length === 1 ? limits[0] : void 0;
781
+ return limit?.status === "unavailable" && (limit.reason === "not_applicable" || limit.reason === "not_authenticated");
782
+ }
776
783
  const DUPLICATE_REPLY_CONVERSATION_REASON = "This agent shares a reply conversation with another Agent Profile.";
777
784
  function resolveAgentExecutionStatus(input) {
778
785
  const executionFamily = input.executionFamily ?? "workstation";
@@ -5525,8 +5532,11 @@ const PROVIDER_USAGE_LIMIT_LABEL = "Usage limits";
5525
5532
  function createUnsupportedProviderUsageLimits(observedAt, provider) {
5526
5533
  return [createProviderUsageLimitWithoutFacts("unsupported", observedAt, provider)];
5527
5534
  }
5528
- function createUnavailableProviderUsageLimits(observedAt, provider) {
5529
- return [createProviderUsageLimitWithoutFacts("unavailable", observedAt, provider)];
5535
+ function createUnavailableProviderUsageLimits(observedAt, provider, details) {
5536
+ return [{
5537
+ ...createProviderUsageLimitWithoutFacts("unavailable", observedAt, provider),
5538
+ ...details
5539
+ }];
5530
5540
  }
5531
5541
  function createProviderUsageLimitWithoutFacts(status, observedAt, provider) {
5532
5542
  return {
@@ -5675,6 +5685,10 @@ function normalizePermissionKind(value) {
5675
5685
  const normalized = String(value ?? "").trim().toLowerCase().replace(UNSAFE_PERMISSION_KIND_CHARACTER_RE, "_").replace(EDGE_UNDERSCORE_RE, "");
5676
5686
  return normalized.length > 0 ? normalized : null;
5677
5687
  }
5688
+ function readAdapterAiUsageObservation(value) {
5689
+ const result = aiUsageObservationSchema.safeParse(value);
5690
+ return result.success ? result.data : null;
5691
+ }
5678
5692
  const DEFAULT_GRACEFUL_INTERRUPT_TIMEOUT_MS = 1e4;
5679
5693
  const DEFAULT_INTERRUPT_REASON = "service.interrupt";
5680
5694
  const DEFAULT_CANCEL_REASON = "service.cancel";
@@ -5971,9 +5985,14 @@ const extractDispatchTelemetry = (error) => {
5971
5985
  ...isFiniteNumber(telemetry.stdinClosedAtMs) ? { stdinClosedAtMs: telemetry.stdinClosedAtMs } : {},
5972
5986
  ...telemetry.streamingMode === "final" || telemetry.streamingMode === "stream" ? { streamingMode: telemetry.streamingMode } : {},
5973
5987
  ...isFiniteNumber(telemetry.timeoutTriggeredAtMs) ? { timeoutTriggeredAtMs: telemetry.timeoutTriggeredAtMs } : {},
5974
- ...tokenUsage ? { tokenUsage } : {}
5988
+ ...tokenUsage ? { tokenUsage } : {},
5989
+ ...extractAiUsageTelemetry(telemetry.aiUsage)
5975
5990
  };
5976
5991
  };
5992
+ function extractAiUsageTelemetry(value) {
5993
+ const result = aiUsageObservationSchema.array().safeParse(value);
5994
+ return result.success ? { aiUsage: result.data } : {};
5995
+ }
5977
5996
  function extractAdapterTokenUsage(value) {
5978
5997
  const usage = toUnknownRecord(value);
5979
5998
  const last = extractAdapterTokenUsageBreakdown(usage?.last);
@@ -8819,7 +8838,8 @@ async function runActionWriter(input) {
8819
8838
  "pipe",
8820
8839
  "pipe",
8821
8840
  "pipe"
8822
- ]
8841
+ ],
8842
+ windowsHide: true
8823
8843
  });
8824
8844
  let stderr = "";
8825
8845
  child.stderr.setEncoding("utf8");
@@ -9125,37 +9145,6 @@ function normalizeOptionalText$41(value) {
9125
9145
  return normalized.length > 0 ? normalized : null;
9126
9146
  }
9127
9147
  //#endregion
9128
- //#region ../../runtime/adapters/antigravity/dist/usage/antigravity-usage-limits.js
9129
- const LINE_BREAK_PATTERN = /\r?\n/u;
9130
- const USAGE_LINE_PATTERN = /^([^\t]+)\tWeekly Limit Remaining\t(\d{1,3})%\t([^\t]+)$/u;
9131
- function parseAntigravityUsageLimits(input) {
9132
- const limits = input.output.split(LINE_BREAK_PATTERN).map((line) => parseUsageLine(line, input.observedAt)).filter((limit) => limit !== null);
9133
- return limits.length > 0 ? limits : createUnavailableProviderUsageLimits(input.observedAt);
9134
- }
9135
- function parseUsageLine(line, observedAt) {
9136
- const match = line.trim().match(USAGE_LINE_PATTERN);
9137
- if (!match) return null;
9138
- const [, rawLabel, rawRemainingPercent, rawResetsAt] = match;
9139
- const remainingPercent = Number(rawRemainingPercent);
9140
- const resetTime = Date.parse(rawResetsAt ?? "");
9141
- if (!(rawLabel && Number.isFinite(remainingPercent)) || remainingPercent < 0 || remainingPercent > 100 || !Number.isFinite(resetTime)) return null;
9142
- const label = rawLabel.trim();
9143
- const providerId = label.toLowerCase().startsWith("gemini") ? "antigravity-gemini" : "antigravity-other";
9144
- const usedPercent = 100 - remainingPercent;
9145
- return {
9146
- key: `${providerId}:weekly`,
9147
- label: "Weekly usage",
9148
- observedAt,
9149
- provider: {
9150
- displayName: label,
9151
- id: providerId
9152
- },
9153
- resetsAt: new Date(resetTime).toISOString(),
9154
- status: remainingPercent === 0 ? "exhausted" : "available",
9155
- usedPercent
9156
- };
9157
- }
9158
- //#endregion
9159
9148
  //#region ../../runtime/adapters/antigravity/dist/index.js
9160
9149
  const ANTIGRAVITY_CONVERSATION_BRIDGE_SPEC = resolveBuiltinAdapterConversationBridgeSpec("antigravity");
9161
9150
  function createAntigravityAdapter(options = {}) {
@@ -9493,6 +9482,41 @@ const WINDOW_DISPLAY_BY_TYPE = {
9493
9482
  label: "Sonnet weekly usage limit"
9494
9483
  }
9495
9484
  };
9485
+ function projectClaudeCodeAccountUsageLimits(input) {
9486
+ if (input.value.rate_limits_available === false) return createUnavailableProviderUsageLimits(input.observedAt, void 0, { reason: "not_applicable" });
9487
+ if (input.value.rate_limits_available !== true) return createUnavailableProviderUsageLimits(input.observedAt, void 0, { reason: "not_reported" });
9488
+ const windows = input.value.rate_limits;
9489
+ const limits = [];
9490
+ const addWindow = (key, label, window) => {
9491
+ if (!window || limits.length >= 32 || limits.some((limit) => limit.key === key)) return;
9492
+ const value = window.utilization;
9493
+ const usedPercent = typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 100 ? value : null;
9494
+ const resetMs = window.resets_at ? Date.parse(window.resets_at) : NaN;
9495
+ let status = "unavailable";
9496
+ if (usedPercent !== null) status = usedPercent === 100 ? "exhausted" : "available";
9497
+ limits.push({
9498
+ key,
9499
+ label,
9500
+ observedAt: input.observedAt,
9501
+ resetsAt: Number.isFinite(resetMs) ? new Date(resetMs).toISOString() : null,
9502
+ usedPercent,
9503
+ status,
9504
+ ...usedPercent === null ? { reason: "not_reported" } : {}
9505
+ });
9506
+ };
9507
+ for (const type of SUPPORTED_RATE_LIMIT_TYPES) {
9508
+ const display = WINDOW_DISPLAY_BY_TYPE[type];
9509
+ addWindow(display.key, display.label, windows?.[type]);
9510
+ }
9511
+ addWindow("claude-code:seven-day-oauth-apps", "OAuth apps weekly usage limit", windows?.seven_day_oauth_apps);
9512
+ for (const window of windows?.model_scoped ?? []) {
9513
+ const name = window.display_name?.trim();
9514
+ if (!name || name.length > 200) continue;
9515
+ const key = `claude-code:seven-day-${encodeURIComponent(name.toLowerCase())}`;
9516
+ if (key.length <= 256) addWindow(key, `${name} weekly usage limit`, window);
9517
+ }
9518
+ return limits.length > 0 ? limits : createUnavailableProviderUsageLimits(input.observedAt, void 0, { reason: "not_reported" });
9519
+ }
9496
9520
  function projectClaudeCodeUsageLimits(input) {
9497
9521
  const event = toRecord$11(input.event);
9498
9522
  if (event?.type !== "rate_limit_event") return [];
@@ -10802,6 +10826,7 @@ async function invokeClaudeAgentSdkTransport(input) {
10802
10826
  streamingMode: input.streamingMode
10803
10827
  });
10804
10828
  const providerErrorMessages = [];
10829
+ const aiUsage = /* @__PURE__ */ new Map();
10805
10830
  const stderrChunks = [];
10806
10831
  let firstOutputAtMs = null;
10807
10832
  let firstStderrAtMs = null;
@@ -10884,6 +10909,7 @@ async function invokeClaudeAgentSdkTransport(input) {
10884
10909
  resolvedSessionId,
10885
10910
  resultMessage
10886
10911
  });
10912
+ observeClaudeAiUsage(aiUsage, message);
10887
10913
  firstOutputAtMs = nextState.firstOutputAtMs;
10888
10914
  latestInteractionOutput = nextState.latestInteractionOutput;
10889
10915
  latestOutput = nextState.latestOutput;
@@ -10898,6 +10924,7 @@ async function invokeClaudeAgentSdkTransport(input) {
10898
10924
  }
10899
10925
  } catch (error) {
10900
10926
  throw toClaudeAgentSdkTransportError({
10927
+ aiUsage: [...aiUsage.values()],
10901
10928
  error,
10902
10929
  firstOutputAtMs,
10903
10930
  firstStderrAtMs,
@@ -10919,6 +10946,7 @@ async function invokeClaudeAgentSdkTransport(input) {
10919
10946
  await previewEmitter.flush();
10920
10947
  if (!resultMessage) {
10921
10948
  const telemetry = buildClaudeAgentSdkTelemetry({
10949
+ aiUsage: [...aiUsage.values()],
10922
10950
  firstOutputAtMs,
10923
10951
  firstStderrAtMs,
10924
10952
  invokedAtMs,
@@ -10943,6 +10971,7 @@ async function invokeClaudeAgentSdkTransport(input) {
10943
10971
  }
10944
10972
  if (isFailedResultMessage(resultMessage)) {
10945
10973
  const telemetry = buildClaudeAgentSdkTelemetry({
10974
+ aiUsage: [...aiUsage.values()],
10946
10975
  firstOutputAtMs,
10947
10976
  firstStderrAtMs,
10948
10977
  invokedAtMs,
@@ -10975,6 +11004,7 @@ async function invokeClaudeAgentSdkTransport(input) {
10975
11004
  errorType: "adapter",
10976
11005
  message: "runtime.output.empty: claude finished without agent output",
10977
11006
  telemetry: buildClaudeAgentSdkTelemetry({
11007
+ aiUsage: [...aiUsage.values()],
10978
11008
  firstOutputAtMs,
10979
11009
  firstStderrAtMs,
10980
11010
  invokedAtMs,
@@ -10988,6 +11018,7 @@ async function invokeClaudeAgentSdkTransport(input) {
10988
11018
  output,
10989
11019
  sessionId: canonicalRepairSessionId ?? normalizeOptionalText$34(resolvedSessionId),
10990
11020
  telemetry: buildClaudeAgentSdkTelemetry({
11021
+ aiUsage: [...aiUsage.values()],
10991
11022
  firstOutputAtMs,
10992
11023
  firstStderrAtMs,
10993
11024
  invokedAtMs,
@@ -11023,9 +11054,36 @@ async function emitClaudeCodeUsageLimits(input) {
11023
11054
  usageLimits
11024
11055
  });
11025
11056
  }
11057
+ function observeClaudeAiUsage(observations, message) {
11058
+ if (message.type !== "assistant" || !message.message.usage) return;
11059
+ const native = message.message;
11060
+ const usage = native.usage;
11061
+ const eventId = `claude:${message.session_id}:${native.id}`;
11062
+ const cacheRead = usage.cache_read_input_tokens ?? 0;
11063
+ const cacheWrite = usage.cache_creation_input_tokens ?? 0;
11064
+ const inputTokens = usage.input_tokens + cacheRead + cacheWrite;
11065
+ const observation = readAdapterAiUsageObservation({
11066
+ eventId,
11067
+ provider: "anthropic",
11068
+ model: native.model,
11069
+ source: "claude_message",
11070
+ occurredAtMs: observations.get(eventId)?.occurredAtMs ?? Date.now(),
11071
+ tokens: {
11072
+ input: inputTokens,
11073
+ output: usage.output_tokens,
11074
+ cacheRead,
11075
+ cacheWrite,
11076
+ reasoning: null,
11077
+ total: inputTokens + usage.output_tokens
11078
+ },
11079
+ cost: null
11080
+ });
11081
+ if (observation) observations.set(eventId, observation);
11082
+ }
11026
11083
  function buildClaudeAgentSdkTelemetry(input) {
11027
11084
  return {
11028
11085
  completedAtMs: Date.now(),
11086
+ ...input.aiUsage ? { aiUsage: input.aiUsage } : {},
11029
11087
  ...input.firstOutputAtMs === null ? {} : { firstOutputAtMs: input.firstOutputAtMs },
11030
11088
  ...input.firstStderrAtMs === null ? {} : { firstStderrAtMs: input.firstStderrAtMs },
11031
11089
  invokedAtMs: input.invokedAtMs,
@@ -11309,6 +11367,7 @@ function toClaudeAgentSdkTransportError(input) {
11309
11367
  errorType: "timeout",
11310
11368
  message: `${code}: claude timed out after ${input.timeoutMs ?? 0}ms`,
11311
11369
  telemetry: buildClaudeAgentSdkTelemetry({
11370
+ aiUsage: input.aiUsage,
11312
11371
  firstOutputAtMs: input.firstOutputAtMs,
11313
11372
  firstStderrAtMs: input.firstStderrAtMs,
11314
11373
  invokedAtMs: input.invokedAtMs,
@@ -11332,6 +11391,7 @@ function toClaudeAgentSdkTransportError(input) {
11332
11391
  ...projectClaudeOriginalError(classifiedFailure),
11333
11392
  ...classifiedFailure.providerAccessEvidence ? { providerAccessEvidence: classifiedFailure.providerAccessEvidence } : {},
11334
11393
  telemetry: buildClaudeAgentSdkTelemetry({
11394
+ aiUsage: input.aiUsage,
11335
11395
  firstOutputAtMs: input.firstOutputAtMs,
11336
11396
  firstStderrAtMs: input.firstStderrAtMs,
11337
11397
  invokedAtMs: input.invokedAtMs,
@@ -11525,6 +11585,63 @@ function toErrorMessage$16(error) {
11525
11585
  return String(error);
11526
11586
  }
11527
11587
  //#endregion
11588
+ //#region ../../runtime/adapters/claude-code/dist/usage/claude-code-usage-probe.js
11589
+ async function probeClaudeCodeUsageLimits(input) {
11590
+ const controller = new AbortController();
11591
+ const executable = await resolveClaudeAgentSdkExecutable(input);
11592
+ const spawnProcess = executable.spawnProcess;
11593
+ let connection;
11594
+ let timer;
11595
+ try {
11596
+ const deadline = new Promise((_, reject) => {
11597
+ timer = setTimeout(() => {
11598
+ controller.abort();
11599
+ reject(/* @__PURE__ */ new Error("Claude usage control connection timed out."));
11600
+ }, input.timeoutMs ?? 8e3);
11601
+ });
11602
+ connection = (input.queryFn ?? query)({
11603
+ prompt: emptyPrompt(controller.signal),
11604
+ options: {
11605
+ abortController: controller,
11606
+ cwd: input.workingDirectory,
11607
+ pathToClaudeCodeExecutable: executable.pathToClaudeCodeExecutable,
11608
+ ...spawnProcess ? { spawnClaudeCodeProcess: (options) => spawnProcess(options, () => void 0) } : {},
11609
+ persistSession: false,
11610
+ allowedTools: [],
11611
+ strictMcpConfig: true,
11612
+ mcpServers: {},
11613
+ settingSources: ["user"],
11614
+ settings: { disableAllHooks: true },
11615
+ env: {
11616
+ ...process.env,
11617
+ ENABLE_CLAUDEAI_MCP_SERVERS: "false",
11618
+ CLAUDE_CODE_AUTO_CONNECT_IDE: "0",
11619
+ CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL: "1"
11620
+ }
11621
+ }
11622
+ });
11623
+ const activeConnection = connection;
11624
+ return await Promise.race([deadline, (async () => {
11625
+ const { account } = await activeConnection.initializationResult();
11626
+ if (account.apiProvider !== "firstParty" || account.email?.trim().toLowerCase() !== input.expectedEmail.trim().toLowerCase() || account.apiKeySource && account.apiKeySource !== "none") return createUnavailableProviderUsageLimits(input.observedAt, void 0, { reason: "not_applicable" });
11627
+ return projectClaudeCodeAccountUsageLimits({
11628
+ value: await activeConnection.usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET({ skipBehaviors: true }),
11629
+ observedAt: input.observedAt
11630
+ });
11631
+ })()]);
11632
+ } catch {
11633
+ return createUnavailableProviderUsageLimits(input.observedAt, void 0, { reason: "refresh_failed" });
11634
+ } finally {
11635
+ clearTimeout(timer);
11636
+ controller.abort();
11637
+ connection?.close();
11638
+ await executable.cleanup();
11639
+ }
11640
+ }
11641
+ async function* emptyPrompt(signal) {
11642
+ if (!signal.aborted) await new Promise((resolve) => signal.addEventListener("abort", () => resolve(), { once: true }));
11643
+ }
11644
+ //#endregion
11528
11645
  //#region ../../runtime/adapters/claude-code/dist/index.js
11529
11646
  const CLAUDE_CODE_CONVERSATION_BRIDGE_SPEC = resolveBuiltinAdapterConversationBridgeSpec("claude-code");
11530
11647
  const EXPECTED_FORCE_CLOSE_INTERRUPT_ERROR_RE = /query closed before response received/i;
@@ -11874,6 +11991,95 @@ function toRecord$9(value) {
11874
11991
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
11875
11992
  }
11876
11993
  //#endregion
11994
+ //#region ../../runtime/adapters/codex/dist/usage/codex-usage-limits.js
11995
+ const DEFAULT_LIMIT_ID = "codex";
11996
+ const MAX_LIMIT_ID_LENGTH = 160;
11997
+ const MAX_LIMIT_LABEL_LENGTH = 160;
11998
+ const SECONDS_PER_MILLISECOND = 1e3;
11999
+ function projectCodexUsageLimits(input) {
12000
+ const limits = readRateLimitBuckets(input.response).flatMap((bucket) => projectRateLimitBucket({
12001
+ ...bucket,
12002
+ observedAt: input.observedAt
12003
+ }));
12004
+ if (limits.length === 0) return createUnavailableProviderUsageLimits(input.observedAt);
12005
+ const uniqueLimits = /* @__PURE__ */ new Map();
12006
+ for (const limit of limits) if (!uniqueLimits.has(limit.key)) uniqueLimits.set(limit.key, limit);
12007
+ return [...uniqueLimits.values()];
12008
+ }
12009
+ function readRateLimitBuckets(response) {
12010
+ const record = toRecord$8(response);
12011
+ const bucketsById = toRecord$8(record?.rateLimitsByLimitId);
12012
+ if (bucketsById && Object.keys(bucketsById).length > 0) return Object.entries(bucketsById).flatMap(([bucketKey, snapshot]) => {
12013
+ const recordSnapshot = toRecord$8(snapshot);
12014
+ return recordSnapshot ? [{
12015
+ bucketKey,
12016
+ snapshot: recordSnapshot
12017
+ }] : [];
12018
+ });
12019
+ const legacySnapshot = toRecord$8(record?.rateLimits);
12020
+ return legacySnapshot ? [{
12021
+ bucketKey: DEFAULT_LIMIT_ID,
12022
+ snapshot: legacySnapshot
12023
+ }] : [];
12024
+ }
12025
+ function projectRateLimitBucket(input) {
12026
+ const limitId = resolveLimitId(input);
12027
+ const limitName = normalizeLabel(input.snapshot.limitName);
12028
+ return ["primary", "secondary"].flatMap((windowKind) => {
12029
+ const window = toRecord$8(input.snapshot[windowKind]);
12030
+ const usedPercent = normalizeUsedPercent(window?.usedPercent);
12031
+ if (usedPercent === null) return [];
12032
+ const windowLabel = formatWindowLabel({
12033
+ windowDurationMins: normalizePositiveInteger(window?.windowDurationMins),
12034
+ windowKind
12035
+ });
12036
+ return [{
12037
+ key: `${limitId}:${windowKind}`,
12038
+ label: limitName ? `${limitName} ${windowLabel.toLocaleLowerCase("en-US")}` : windowLabel,
12039
+ observedAt: input.observedAt,
12040
+ resetsAt: normalizeResetTime(window?.resetsAt),
12041
+ status: usedPercent >= 100 ? "exhausted" : "available",
12042
+ usedPercent
12043
+ }];
12044
+ });
12045
+ }
12046
+ function resolveLimitId(input) {
12047
+ const providerLimitId = normalizeLimitId(input.snapshot.limitId);
12048
+ const bucketLimitId = normalizeLimitId(input.bucketKey);
12049
+ return providerLimitId ?? bucketLimitId ?? DEFAULT_LIMIT_ID;
12050
+ }
12051
+ function normalizeLimitId(value) {
12052
+ if (typeof value !== "string") return null;
12053
+ return value.trim().toLocaleLowerCase("en-US").replace(/[^a-z0-9._-]+/gu, "-").replace(/^-+|-+$/gu, "").slice(0, MAX_LIMIT_ID_LENGTH) || null;
12054
+ }
12055
+ function normalizeLabel(value) {
12056
+ if (typeof value !== "string") return null;
12057
+ const normalized = value.trim().replace(/\s+/gu, " ");
12058
+ return normalized ? normalized.slice(0, MAX_LIMIT_LABEL_LENGTH) : null;
12059
+ }
12060
+ function normalizeUsedPercent(value) {
12061
+ return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 100 ? value : null;
12062
+ }
12063
+ function normalizePositiveInteger(value) {
12064
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
12065
+ }
12066
+ function normalizeResetTime(value) {
12067
+ const unixSeconds = normalizePositiveInteger(value);
12068
+ if (unixSeconds === null) return null;
12069
+ const date = /* @__PURE__ */ new Date(unixSeconds * SECONDS_PER_MILLISECOND);
12070
+ return Number.isNaN(date.getTime()) ? null : date.toISOString();
12071
+ }
12072
+ function formatWindowLabel(input) {
12073
+ if (input.windowDurationMins === 60) return "Hourly usage";
12074
+ if (input.windowDurationMins === 300) return "5-hour usage";
12075
+ if (input.windowDurationMins === 1440) return "Daily usage";
12076
+ if (input.windowDurationMins === 10080) return "Weekly usage";
12077
+ return input.windowKind === "primary" ? "Short-term usage" : "Long-term usage";
12078
+ }
12079
+ function toRecord$8(value) {
12080
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
12081
+ }
12082
+ //#endregion
11877
12083
  //#region ../../runtime/adapters/codex/dist/transport/codex-app-server-admission.js
11878
12084
  const FAST_METADATA_ADMISSION_TIMEOUT_MS = 15e3;
11879
12085
  const COLD_CONTROLLER_ADMISSION_TIMEOUT_MS = 9e4;
@@ -12142,12 +12348,22 @@ function resolveFileAccess(input) {
12142
12348
  const isRepair = input.executionMode === "repair";
12143
12349
  if (input.boundary.executionContextAccess) {
12144
12350
  if (input.boundary.mode !== "only_selected_folders") throw new Error("execution_context.file_access_unverified");
12351
+ if (input.boundary.gitMetadata && !Object.values(input.boundary.gitMetadata).every((path) => isAbsolute(path) && input.boundary.folders.some((root) => {
12352
+ const child = relative(root, path);
12353
+ return child === "" || !isAbsolute(child) && child !== ".." && !child.startsWith(`..${sep}`);
12354
+ }))) throw new Error("execution_context.file_access_unverified");
12145
12355
  return {
12146
12356
  extendsProfile: null,
12147
12357
  filesystemEntries: [
12148
12358
  "\":root\" = \"deny\"",
12149
12359
  "\":minimal\" = \"read\"",
12150
- ...buildFolderEntries(input.boundary.folders, resolveCodexExecutionContextAccess(input.boundary, input.executionMode) === "workspace" ? "write" : "read")
12360
+ ...buildFolderEntries(input.boundary.folders, resolveCodexExecutionContextAccess(input.boundary, input.executionMode) === "workspace" ? "write" : "read"),
12361
+ ...input.boundary.gitMetadata ? buildFolderEntries([
12362
+ input.boundary.gitMetadata.hooksPath,
12363
+ input.boundary.gitMetadata.worktreeGitPointerPath,
12364
+ input.boundary.gitMetadata.commonDirectoryPointerPath,
12365
+ input.boundary.gitMetadata.gitDirectoryPointerPath
12366
+ ], "read") : []
12151
12367
  ],
12152
12368
  fullNetwork: !isRepair && input.permissionMode === "codex:fullAccess"
12153
12369
  };
@@ -12652,12 +12868,14 @@ async function probeCodexAppServerAccount(input) {
12652
12868
  launchContract: input.launchContract,
12653
12869
  startupTimeoutMs: timeoutMs
12654
12870
  }, async (session, initialized) => {
12655
- const response = toRecord$8(await session.request("account/read", {}));
12871
+ const response = toRecord$7(await session.request("account/read", {}));
12872
+ const account = toRecord$7(response?.account);
12656
12873
  return {
12657
12874
  authStatus: resolveCodexAppServerAuthStatus({
12658
- account: toRecord$8(response?.account),
12875
+ account,
12659
12876
  response
12660
12877
  }),
12878
+ ...typeof account?.email === "string" && account.email.trim() ? { email: account.email.trim() } : {},
12661
12879
  version: parseCodexAppServerVersion(initialized)
12662
12880
  };
12663
12881
  });
@@ -12725,6 +12943,7 @@ async function invokeCodexAppServerTransport(input) {
12725
12943
  });
12726
12944
  session.emitProviderConversationObserved(continuityThreadId);
12727
12945
  session.observeReasoningForThread(executionThreadId);
12946
+ session.observeUsageForThread(executionThreadId, threadContext.model);
12728
12947
  throwIfCodexDispatchCancelled(input.cancellationSignal);
12729
12948
  const completedTurn = await startAndAwaitAppServerTurn({
12730
12949
  cancellationSignal: input.cancellationSignal,
@@ -12954,10 +13173,26 @@ async function forkCodexAppServerThread(input) {
12954
13173
  initialized,
12955
13174
  threadId: sourceThreadId
12956
13175
  });
13176
+ let disableSpaceMcp = false;
13177
+ if (nativeCarrier) {
13178
+ const servers = toRecord$7(toRecord$7(toRecord$7(await session.requestControl("config/read", {
13179
+ cwd: input.targetWorkingDirectory ?? input.codexWorkdir,
13180
+ includeLayers: false
13181
+ }, {
13182
+ code: "runtime.control_timeout",
13183
+ operation: "config/read"
13184
+ }))?.config)?.mcp_servers);
13185
+ if (!servers) throw new CodexAppServerTransportError({
13186
+ code: "context.space_tool_carrier_unverified",
13187
+ errorType: "config",
13188
+ message: "The effective Codex MCP configuration could not be verified."
13189
+ });
13190
+ disableSpaceMcp = Object.hasOwn(servers, OPENMELD_SPACE_ACTION_MCP_SERVER_ID);
13191
+ }
12957
13192
  const threadId = readThreadIdFromResponse(await session.requestControl("thread/fork", {
12958
13193
  excludeTurns: true,
12959
13194
  threadId: sourceThreadId,
12960
- ...nativeCarrier ? { config: { [`mcp_servers.${OPENMELD_SPACE_ACTION_MCP_SERVER_ID}.enabled`]: false } } : {},
13195
+ ...disableSpaceMcp ? { config: { [`mcp_servers.${OPENMELD_SPACE_ACTION_MCP_SERVER_ID}.enabled`]: false } } : {},
12961
13196
  ...input.computerFileAccessBoundary?.executionContextAccess ? {
12962
13197
  permissions: CODEX_FILE_ACCESS_PERMISSION_PROFILE,
12963
13198
  approvalPolicy: "never",
@@ -13083,7 +13318,7 @@ async function resolveCodexAppServerCollaborationMode(input) {
13083
13318
  errorType: "adapter",
13084
13319
  message: "protocol.invalid: Codex Plan collaboration mode requires a resolved model"
13085
13320
  });
13086
- const response = toRecord$8(await input.session.requestControl("collaborationMode/list", {}, {
13321
+ const response = toRecord$7(await input.session.requestControl("collaborationMode/list", {}, {
13087
13322
  code: "runtime.control_timeout",
13088
13323
  operation: "collaborationMode/list"
13089
13324
  }));
@@ -13111,7 +13346,7 @@ async function resolveCodexAppServerTurnCollaborationMode(input) {
13111
13346
  });
13112
13347
  }
13113
13348
  function readCodexAppServerCollaborationModePreset(value) {
13114
- const preset = toRecord$8(value);
13349
+ const preset = toRecord$7(value);
13115
13350
  const mode = normalizeOptionalText$30(preset?.mode);
13116
13351
  if (mode !== "default" && mode !== "plan") return null;
13117
13352
  return {
@@ -13232,6 +13467,11 @@ var CodexAppServerSession = class {
13232
13467
  #interactionFailure = null;
13233
13468
  #lineBuffer = "";
13234
13469
  #latestTokenUsage = null;
13470
+ #usageThreadId = null;
13471
+ #usageModel = null;
13472
+ #usageTurnId = null;
13473
+ #usageTotalByThread = /* @__PURE__ */ new Map();
13474
+ #aiUsage = /* @__PURE__ */ new Map();
13235
13475
  #nextRequestId = 1;
13236
13476
  #processTimeout = null;
13237
13477
  #startupTimeoutMs;
@@ -13460,8 +13700,8 @@ var CodexAppServerSession = class {
13460
13700
  });
13461
13701
  try {
13462
13702
  return await readCodexSpaceDynamicToolCarrier({
13463
- thread: toRecord$8(response)?.thread,
13464
- codexHome: toRecord$8(input.initialized)?.codexHome
13703
+ thread: toRecord$7(response)?.thread,
13704
+ codexHome: toRecord$7(input.initialized)?.codexHome
13465
13705
  });
13466
13706
  } catch {
13467
13707
  throw new CodexAppServerTransportError({
@@ -13494,7 +13734,7 @@ var CodexAppServerSession = class {
13494
13734
  }),
13495
13735
  permissionMode: this.#permissionMode
13496
13736
  });
13497
- if (supported) supported = toRecord$8(await this.requestControl("configRequirements/read", {}, {
13737
+ if (supported) supported = toRecord$7(await this.requestControl("configRequirements/read", {}, {
13498
13738
  code: "runtime.control_timeout",
13499
13739
  operation: "configRequirements/read"
13500
13740
  }))?.requirements === null;
@@ -13532,7 +13772,7 @@ var CodexAppServerSession = class {
13532
13772
  code: "runtime.control_timeout",
13533
13773
  operation: "config/read"
13534
13774
  });
13535
- if (toRecord$8(await this.requestControl("configRequirements/read", {}, {
13775
+ if (toRecord$7(await this.requestControl("configRequirements/read", {}, {
13536
13776
  code: "runtime.control_timeout",
13537
13777
  operation: "configRequirements/read"
13538
13778
  }))?.requirements !== null) throw new CodexAppServerTransportError({
@@ -13582,9 +13822,9 @@ var CodexAppServerSession = class {
13582
13822
  config: {
13583
13823
  ...this.#deliveryConfig,
13584
13824
  ...this.deliveryOnly ? { mcp_servers: {
13585
- ...toRecord$8(this.#deliveryConfig.mcp_servers) ?? {},
13825
+ ...toRecord$7(this.#deliveryConfig.mcp_servers) ?? {},
13586
13826
  [OPENMELD_SPACE_ACTION_MCP_SERVER_ID]: {
13587
- ...toRecord$8(toRecord$8(this.#deliveryConfig.mcp_servers)?.["openmeld_internal_dispatch_space_action"]) ?? {},
13827
+ ...toRecord$7(toRecord$7(this.#deliveryConfig.mcp_servers)?.["openmeld_internal_dispatch_space_action"]) ?? {},
13588
13828
  enabled: false
13589
13829
  }
13590
13830
  } } : { [`mcp_servers.${OPENMELD_SPACE_ACTION_MCP_SERVER_ID}.enabled`]: false }
@@ -13615,11 +13855,11 @@ var CodexAppServerSession = class {
13615
13855
  expectDispatchServer: !this.spaceToolInvocation.enabled && resolveDispatchSpaceActionMcpServer(this.#env) !== null
13616
13856
  });
13617
13857
  else {
13618
- const result = toRecord$8(inventory);
13858
+ const result = toRecord$7(inventory);
13619
13859
  const rows = result?.data;
13620
13860
  if (!Array.isArray(rows) || result?.nextCursor != null || rows.some((row) => {
13621
- const server = toRecord$8(row);
13622
- return server?.name === "openmeld_internal_dispatch_space_action" && (server.runtimeStatus !== "disabled" || Object.keys(toRecord$8(server.tools) ?? {}).length > 0);
13861
+ const server = toRecord$7(row);
13862
+ return server?.name === "openmeld_internal_dispatch_space_action" && (server.runtimeStatus !== "disabled" || Object.keys(toRecord$7(server.tools) ?? {}).length > 0);
13623
13863
  })) throw new CodexAppServerTransportError({
13624
13864
  code: "context.space_tool_carrier_unverified",
13625
13865
  errorType: "config",
@@ -13735,10 +13975,10 @@ var CodexAppServerSession = class {
13735
13975
  });
13736
13976
  }
13737
13977
  async waitForTurnCompleted(input) {
13738
- const turn = toRecord$8(toRecord$8((await this.#waitForNotification((candidate) => {
13978
+ const turn = toRecord$7(toRecord$7((await this.#waitForNotification((candidate) => {
13739
13979
  if (candidate.method !== "turn/completed") return false;
13740
- const params = toRecord$8(candidate.params);
13741
- const turn = toRecord$8(params?.turn);
13980
+ const params = toRecord$7(candidate.params);
13981
+ const turn = toRecord$7(params?.turn);
13742
13982
  return params?.threadId === input.threadId && normalizeOptionalText$30(turn?.id) === input.turnId;
13743
13983
  })).params)?.turn);
13744
13984
  if (!turn) throw new CodexAppServerTransportError({
@@ -13780,7 +14020,8 @@ var CodexAppServerSession = class {
13780
14020
  ...this.#lifecycle.stdinClosedAtMs === null ? {} : { stdinClosedAtMs: this.#lifecycle.stdinClosedAtMs },
13781
14021
  streamingMode: input.streamingMode,
13782
14022
  ...this.#lifecycle.timeoutTriggeredAtMs === null ? {} : { timeoutTriggeredAtMs: this.#lifecycle.timeoutTriggeredAtMs },
13783
- ...this.#latestTokenUsage ? { tokenUsage: this.#latestTokenUsage } : {}
14023
+ ...this.#latestTokenUsage ? { tokenUsage: this.#latestTokenUsage } : {},
14024
+ aiUsage: [...this.#aiUsage.values()]
13784
14025
  };
13785
14026
  }
13786
14027
  readCollectedAgentMessageDeltaText() {
@@ -13840,12 +14081,24 @@ var CodexAppServerSession = class {
13840
14081
  pending.resolve(message.result);
13841
14082
  }
13842
14083
  #handleNotification(message) {
14084
+ if (message.method === "account/rateLimits/updated") {
14085
+ const tsMs = Date.now();
14086
+ const usageLimits = projectCodexUsageLimits({
14087
+ response: message.params,
14088
+ observedAt: new Date(tsMs).toISOString()
14089
+ });
14090
+ this.#emitRuntimeEvent({
14091
+ phase: "provider_usage_limits_observed",
14092
+ tsMs,
14093
+ usageLimits
14094
+ });
14095
+ }
13843
14096
  this.#startupDiagnostics.observeNotification(message.method ?? "", message.params);
13844
14097
  if (message.method === "item/reasoning/summaryTextDelta") {
13845
14098
  this.#observeReasoningSummary(message.params);
13846
14099
  return;
13847
14100
  }
13848
- if (message.method?.startsWith("item/reasoning/") || toRecord$8(toRecord$8(message.params)?.item)?.type === "reasoning") return;
14101
+ if (message.method?.startsWith("item/reasoning/") || toRecord$7(toRecord$7(message.params)?.item)?.type === "reasoning") return;
13849
14102
  this.#notifications.push(message);
13850
14103
  this.#observeContextTelemetry(message);
13851
14104
  this.#collectAgentMessageDelta(message);
@@ -13858,12 +14111,45 @@ var CodexAppServerSession = class {
13858
14111
  }
13859
14112
  }
13860
14113
  #observeContextTelemetry(message) {
14114
+ const params = toRecord$7(message.params);
14115
+ if (message.method === "turn/started" && params?.threadId === this.#usageThreadId) this.#usageTurnId = normalizeOptionalText$30(toRecord$7(params.turn)?.id);
14116
+ if (message.method === "model/rerouted" && params?.threadId === this.#usageThreadId) this.#usageModel = normalizeOptionalText$30(params.toModel);
13861
14117
  if (message.method === "thread/tokenUsage/updated") {
13862
- const tokenUsage = readCodexTokenUsage(toRecord$8(message.params)?.tokenUsage);
13863
- if (tokenUsage) this.#latestTokenUsage = tokenUsage;
14118
+ const tokenUsage = readCodexTokenUsage(toRecord$7(message.params)?.tokenUsage);
14119
+ if (tokenUsage) {
14120
+ this.#latestTokenUsage = tokenUsage;
14121
+ this.#observeAiUsage(params, tokenUsage);
14122
+ }
13864
14123
  return;
13865
14124
  }
13866
- if ((message.method === "item/started" || message.method === "item/completed") && toRecord$8(toRecord$8(message.params)?.item)?.type === "contextCompaction") this.#contextCompactionObserved = true;
14125
+ if ((message.method === "item/started" || message.method === "item/completed") && toRecord$7(toRecord$7(message.params)?.item)?.type === "contextCompaction") this.#contextCompactionObserved = true;
14126
+ }
14127
+ #observeAiUsage(params, tokenUsage) {
14128
+ const threadId = normalizeOptionalText$30(params?.threadId);
14129
+ if (!threadId) return;
14130
+ const previousTotal = this.#usageTotalByThread.get(threadId);
14131
+ this.#usageTotalByThread.set(threadId, tokenUsage.total.totalTokens);
14132
+ const turnId = normalizeOptionalText$30(params?.turnId);
14133
+ if (threadId !== this.#usageThreadId || !turnId || turnId !== this.#usageTurnId || previousTotal === tokenUsage.total.totalTokens) return;
14134
+ const eventId = `codex:${threadId}:${turnId}:${tokenUsage.total.totalTokens}`;
14135
+ if (this.#aiUsage.has(eventId)) return;
14136
+ const usage = tokenUsage.last;
14137
+ this.#aiUsage.set(eventId, {
14138
+ eventId,
14139
+ provider: "openai",
14140
+ model: this.#usageModel,
14141
+ source: "codex_event",
14142
+ occurredAtMs: Date.now(),
14143
+ tokens: {
14144
+ input: usage.inputTokens,
14145
+ output: usage.outputTokens,
14146
+ cacheRead: usage.cachedInputTokens,
14147
+ cacheWrite: usage.cacheWriteInputTokens ?? null,
14148
+ reasoning: usage.reasoningOutputTokens,
14149
+ total: usage.totalTokens
14150
+ },
14151
+ cost: null
14152
+ });
13867
14153
  }
13868
14154
  async #handleServerRequest(message) {
13869
14155
  const id = message.id;
@@ -13887,7 +14173,7 @@ var CodexAppServerSession = class {
13887
14173
  const result = this.#onInteractionRequest ? await resolveCodexServerInteraction({
13888
14174
  method: message.method,
13889
14175
  onCancel: async () => {
13890
- const params = toRecord$8(message.params) ?? {};
14176
+ const params = toRecord$7(message.params) ?? {};
13891
14177
  const threadId = readRequiredText(params.threadId, "requestUserInput params.threadId");
13892
14178
  const turnId = readRequiredText(params.turnId, "requestUserInput params.turnId");
13893
14179
  this.#interactionFailure = {
@@ -13932,7 +14218,7 @@ var CodexAppServerSession = class {
13932
14218
  }
13933
14219
  #collectAgentMessageDelta(message) {
13934
14220
  if (message.method !== "item/agentMessage/delta") return;
13935
- const params = toRecord$8(message.params);
14221
+ const params = toRecord$7(message.params);
13936
14222
  const itemId = normalizeOptionalText$30(params?.itemId);
13937
14223
  const delta = readAgentMessageDeltaText(params?.delta);
13938
14224
  if (!(itemId && delta)) return;
@@ -14003,8 +14289,12 @@ var CodexAppServerSession = class {
14003
14289
  observeReasoningForThread(threadId) {
14004
14290
  this.#reasoningThreadId = threadId;
14005
14291
  }
14292
+ observeUsageForThread(threadId, model) {
14293
+ this.#usageThreadId = threadId;
14294
+ this.#usageModel = model;
14295
+ }
14006
14296
  #observeReasoningSummary(payload) {
14007
- const params = toRecord$8(payload);
14297
+ const params = toRecord$7(payload);
14008
14298
  if (!this.#reasoningThreadId || params?.threadId !== this.#reasoningThreadId || typeof params.turnId !== "string" || typeof params.itemId !== "string" || typeof params.summaryIndex !== "number" || typeof params.delta !== "string" || params.delta.length === 0) return;
14009
14299
  this.#emitRuntimeEvent({
14010
14300
  phase: "reasoning",
@@ -14036,10 +14326,10 @@ var CodexAppServerSession = class {
14036
14326
  }
14037
14327
  };
14038
14328
  function readThreadIdFromResponse(value) {
14039
- return readRequiredText(toRecord$8(value)?.thread?.id, "thread response thread.id");
14329
+ return readRequiredText(toRecord$7(value)?.thread?.id, "thread response thread.id");
14040
14330
  }
14041
14331
  function readThreadContextFromResponse(value) {
14042
- const response = toRecord$8(value);
14332
+ const response = toRecord$7(value);
14043
14333
  return {
14044
14334
  permissionResponse: value,
14045
14335
  model: normalizeOptionalText$30(response?.model),
@@ -14048,7 +14338,7 @@ function readThreadContextFromResponse(value) {
14048
14338
  };
14049
14339
  }
14050
14340
  function readLastCompletedTurnId(value) {
14051
- const response = toRecord$8(value);
14341
+ const response = toRecord$7(value);
14052
14342
  const turns = Array.isArray(response?.thread?.turns) ? response.thread.turns : [];
14053
14343
  for (let index = turns.length - 1; index >= 0; index -= 1) {
14054
14344
  const turn = turns[index];
@@ -14059,7 +14349,7 @@ function readLastCompletedTurnId(value) {
14059
14349
  return null;
14060
14350
  }
14061
14351
  function readTurnStartResponse(value) {
14062
- const turn = toRecord$8(value)?.turn;
14352
+ const turn = toRecord$7(value)?.turn;
14063
14353
  if (!turn || typeof turn !== "object") throw new CodexAppServerTransportError({
14064
14354
  code: "protocol.invalid",
14065
14355
  errorType: "adapter",
@@ -14078,7 +14368,7 @@ function readTurnFailureCodexErrorInfo(turn) {
14078
14368
  return normalizeOptionalText$30(turn.error?.codexErrorInfo);
14079
14369
  }
14080
14370
  function readCodexTokenUsage(value) {
14081
- const usage = toRecord$8(value);
14371
+ const usage = toRecord$7(value);
14082
14372
  const last = readCodexTokenUsageBreakdown(usage?.last);
14083
14373
  const total = readCodexTokenUsageBreakdown(usage?.total);
14084
14374
  const rawModelContextWindow = usage?.modelContextWindow;
@@ -14091,7 +14381,7 @@ function readCodexTokenUsage(value) {
14091
14381
  };
14092
14382
  }
14093
14383
  function readCodexTokenUsageBreakdown(value) {
14094
- const usage = toRecord$8(value);
14384
+ const usage = toRecord$7(value);
14095
14385
  const cachedInputTokens = readNonNegativeInteger(usage?.cachedInputTokens);
14096
14386
  const inputTokens = readNonNegativeInteger(usage?.inputTokens);
14097
14387
  const outputTokens = readNonNegativeInteger(usage?.outputTokens);
@@ -14158,7 +14448,7 @@ async function resolveCodexServerInteraction(input) {
14158
14448
  }
14159
14449
  }
14160
14450
  async function resolveCommandApprovalInteraction(input) {
14161
- const params = toRecord$8(input.params) ?? {};
14451
+ const params = toRecord$7(input.params) ?? {};
14162
14452
  const command = normalizeBoundedText$3(input.legacy && Array.isArray(params.command) ? params.command.map(String).join(" ") : params.command, 16e3) ?? "Command details were not provided.";
14163
14453
  const cwd = normalizeBoundedText$3(params.cwd, 4096);
14164
14454
  const mappedOptions = (input.legacy ? [
@@ -14223,7 +14513,7 @@ function presentCommandApprovalDecision(decision) {
14223
14513
  label: "Deny"
14224
14514
  };
14225
14515
  if (decision === "cancel" || decision === "abort") return null;
14226
- const record = toRecord$8(decision);
14516
+ const record = toRecord$7(decision);
14227
14517
  if (record?.acceptWithExecpolicyAmendment) return {
14228
14518
  intent: "allow_always",
14229
14519
  label: "Allow matching commands"
@@ -14235,7 +14525,7 @@ function presentCommandApprovalDecision(decision) {
14235
14525
  return null;
14236
14526
  }
14237
14527
  async function resolveFileChangeApprovalInteraction(input) {
14238
- const params = toRecord$8(input.params) ?? {};
14528
+ const params = toRecord$7(input.params) ?? {};
14239
14529
  const resource = input.legacy ? normalizeBoundedText$3(safeJsonStringify(params.fileChanges), 4096) : normalizeBoundedText$3(params.grantRoot, 4096);
14240
14530
  const options = [
14241
14531
  {
@@ -14279,7 +14569,7 @@ async function resolveFileChangeApprovalInteraction(input) {
14279
14569
  return { decision: input.legacy ? { denied: { rejection: "Denied by the user." } } : "decline" };
14280
14570
  }
14281
14571
  async function resolveUserInputInteraction(input) {
14282
- const params = toRecord$8(input.params) ?? {};
14572
+ const params = toRecord$7(input.params) ?? {};
14283
14573
  const rawQuestions = Array.isArray(params.questions) ? params.questions : [];
14284
14574
  const answers = {};
14285
14575
  for (let offset = 0; offset < rawQuestions.length; offset += 3) {
@@ -14303,12 +14593,12 @@ async function resolveUserInputInteraction(input) {
14303
14593
  return { answers };
14304
14594
  }
14305
14595
  function mapCodexQuestion(value, questionIndex) {
14306
- const question = toRecord$8(value) ?? {};
14596
+ const question = toRecord$7(value) ?? {};
14307
14597
  const questionId = normalizeBoundedText$3(question.id, 256) ?? `codex-question-${questionIndex}`;
14308
14598
  const rawOptions = Array.isArray(question.options) ? question.options.slice(0, 20) : [];
14309
14599
  const optionValueById = /* @__PURE__ */ new Map();
14310
14600
  const options = rawOptions.map((rawOption, optionIndex) => {
14311
- const option = toRecord$8(rawOption) ?? {};
14601
+ const option = toRecord$7(rawOption) ?? {};
14312
14602
  const label = normalizeBoundedText$3(option.label, 240) ?? `Option ${optionIndex + 1}`;
14313
14603
  const optionId = `${questionId}-option-${optionIndex}`;
14314
14604
  optionValueById.set(optionId, label);
@@ -14336,8 +14626,8 @@ async function resolveAdditionalPermissionsInteraction(input) {
14336
14626
  const allowTurnOptionId = "codex-additional-permissions-turn";
14337
14627
  const allowSessionOptionId = "codex-additional-permissions-session";
14338
14628
  const denyOptionId = "codex-additional-permissions-deny";
14339
- const params = toRecord$8(input.params) ?? {};
14340
- const requestedPermissions = toRecord$8(params.permissions) ?? {};
14629
+ const params = toRecord$7(input.params) ?? {};
14630
+ const requestedPermissions = toRecord$7(params.permissions) ?? {};
14341
14631
  const grantedPermissions = Object.fromEntries(Object.entries(requestedPermissions).filter(([, value]) => value !== null));
14342
14632
  const options = [
14343
14633
  {
@@ -14385,7 +14675,7 @@ async function resolveAdditionalPermissionsInteraction(input) {
14385
14675
  };
14386
14676
  }
14387
14677
  async function resolveMcpServerElicitationInteraction(input) {
14388
- const params = toRecord$8(input.params) ?? {};
14678
+ const params = toRecord$7(input.params) ?? {};
14389
14679
  if (params.mode === "url") return await resolveMcpServerUrlElicitation({
14390
14680
  onInteractionRequest: input.onInteractionRequest,
14391
14681
  params
@@ -14397,8 +14687,8 @@ async function resolveMcpServerElicitationInteraction(input) {
14397
14687
  });
14398
14688
  }
14399
14689
  async function resolveMcpServerFormElicitation(input) {
14400
- const requestedSchema = toRecord$8(input.params.requestedSchema);
14401
- const properties = toRecord$8(requestedSchema?.properties);
14690
+ const requestedSchema = toRecord$7(input.params.requestedSchema);
14691
+ const properties = toRecord$7(requestedSchema?.properties);
14402
14692
  if (!properties) return { action: "decline" };
14403
14693
  const requiredNames = new Set(Array.isArray(requestedSchema?.required) ? requestedSchema.required.map(String) : []);
14404
14694
  const fields = Object.entries(properties).map(([name, value], index) => mapCodexMcpElicitationField({
@@ -14460,7 +14750,7 @@ async function resolveMcpServerUrlElicitation(input) {
14460
14750
  return { action: response.kind === "cancel" ? "cancel" : "decline" };
14461
14751
  }
14462
14752
  function mapCodexMcpElicitationField(input) {
14463
- const schema = toRecord$8(input.schema) ?? {};
14753
+ const schema = toRecord$7(input.schema) ?? {};
14464
14754
  const questionId = `codex-mcp-field-${input.fieldIndex}`;
14465
14755
  const skipOptionId = input.required ? null : `${questionId}-skip`;
14466
14756
  const optionValueById = /* @__PURE__ */ new Map();
@@ -14501,12 +14791,12 @@ function listCodexMcpElicitationOptions(schema) {
14501
14791
  label: "No",
14502
14792
  value: false
14503
14793
  }];
14504
- const itemSchema = toRecord$8(schema.items);
14794
+ const itemSchema = toRecord$7(schema.items);
14505
14795
  let titledOptions = null;
14506
14796
  if (Array.isArray(schema.oneOf)) titledOptions = schema.oneOf;
14507
14797
  else if (Array.isArray(itemSchema?.anyOf)) titledOptions = itemSchema.anyOf;
14508
14798
  if (titledOptions) return titledOptions.map((value) => {
14509
- const option = toRecord$8(value) ?? {};
14799
+ const option = toRecord$7(value) ?? {};
14510
14800
  const rawValue = option.const ?? "";
14511
14801
  return {
14512
14802
  label: normalizeBoundedText$3(option.title, 240) ?? String(rawValue).slice(0, 240),
@@ -14657,7 +14947,7 @@ function readRequiredText(value, label) {
14657
14947
  message: `protocol.invalid: missing ${label}`
14658
14948
  });
14659
14949
  }
14660
- function toRecord$8(value) {
14950
+ function toRecord$7(value) {
14661
14951
  if (!value || typeof value !== "object" || Array.isArray(value)) return null;
14662
14952
  return value;
14663
14953
  }
@@ -14677,7 +14967,7 @@ function isProcessGroupAbsent(processId) {
14677
14967
  }
14678
14968
  }
14679
14969
  function parseCodexAppServerVersion(response) {
14680
- return normalizeOptionalText$30(toRecord$8(response)?.userAgent)?.match(CODEX_APP_SERVER_VERSION_PATTERN)?.[1] ?? null;
14970
+ return normalizeOptionalText$30(toRecord$7(response)?.userAgent)?.match(CODEX_APP_SERVER_VERSION_PATTERN)?.[1] ?? null;
14681
14971
  }
14682
14972
  function resolveCodexAppServerAuthStatus(input) {
14683
14973
  if (input.account) return "authenticated";
@@ -15666,95 +15956,6 @@ async function pathExists$2(path) {
15666
15956
  }
15667
15957
  }
15668
15958
  //#endregion
15669
- //#region ../../runtime/adapters/codex/dist/usage/codex-usage-limits.js
15670
- const DEFAULT_LIMIT_ID = "codex";
15671
- const MAX_LIMIT_ID_LENGTH = 160;
15672
- const MAX_LIMIT_LABEL_LENGTH = 160;
15673
- const SECONDS_PER_MILLISECOND = 1e3;
15674
- function projectCodexUsageLimits(input) {
15675
- const limits = readRateLimitBuckets(input.response).flatMap((bucket) => projectRateLimitBucket({
15676
- ...bucket,
15677
- observedAt: input.observedAt
15678
- }));
15679
- if (limits.length === 0) return createUnavailableProviderUsageLimits(input.observedAt);
15680
- const uniqueLimits = /* @__PURE__ */ new Map();
15681
- for (const limit of limits) if (!uniqueLimits.has(limit.key)) uniqueLimits.set(limit.key, limit);
15682
- return [...uniqueLimits.values()];
15683
- }
15684
- function readRateLimitBuckets(response) {
15685
- const record = toRecord$7(response);
15686
- const bucketsById = toRecord$7(record?.rateLimitsByLimitId);
15687
- if (bucketsById && Object.keys(bucketsById).length > 0) return Object.entries(bucketsById).flatMap(([bucketKey, snapshot]) => {
15688
- const recordSnapshot = toRecord$7(snapshot);
15689
- return recordSnapshot ? [{
15690
- bucketKey,
15691
- snapshot: recordSnapshot
15692
- }] : [];
15693
- });
15694
- const legacySnapshot = toRecord$7(record?.rateLimits);
15695
- return legacySnapshot ? [{
15696
- bucketKey: DEFAULT_LIMIT_ID,
15697
- snapshot: legacySnapshot
15698
- }] : [];
15699
- }
15700
- function projectRateLimitBucket(input) {
15701
- const limitId = resolveLimitId(input);
15702
- const limitName = normalizeLabel(input.snapshot.limitName);
15703
- return ["primary", "secondary"].flatMap((windowKind) => {
15704
- const window = toRecord$7(input.snapshot[windowKind]);
15705
- const usedPercent = normalizeUsedPercent(window?.usedPercent);
15706
- if (usedPercent === null) return [];
15707
- const windowLabel = formatWindowLabel({
15708
- windowDurationMins: normalizePositiveInteger(window?.windowDurationMins),
15709
- windowKind
15710
- });
15711
- return [{
15712
- key: `${limitId}:${windowKind}`,
15713
- label: limitName ? `${limitName} ${windowLabel.toLocaleLowerCase("en-US")}` : windowLabel,
15714
- observedAt: input.observedAt,
15715
- resetsAt: normalizeResetTime(window?.resetsAt),
15716
- status: usedPercent >= 100 ? "exhausted" : "available",
15717
- usedPercent
15718
- }];
15719
- });
15720
- }
15721
- function resolveLimitId(input) {
15722
- const providerLimitId = normalizeLimitId(input.snapshot.limitId);
15723
- const bucketLimitId = normalizeLimitId(input.bucketKey);
15724
- return providerLimitId ?? bucketLimitId ?? DEFAULT_LIMIT_ID;
15725
- }
15726
- function normalizeLimitId(value) {
15727
- if (typeof value !== "string") return null;
15728
- return value.trim().toLocaleLowerCase("en-US").replace(/[^a-z0-9._-]+/gu, "-").replace(/^-+|-+$/gu, "").slice(0, MAX_LIMIT_ID_LENGTH) || null;
15729
- }
15730
- function normalizeLabel(value) {
15731
- if (typeof value !== "string") return null;
15732
- const normalized = value.trim().replace(/\s+/gu, " ");
15733
- return normalized ? normalized.slice(0, MAX_LIMIT_LABEL_LENGTH) : null;
15734
- }
15735
- function normalizeUsedPercent(value) {
15736
- return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 100 ? value : null;
15737
- }
15738
- function normalizePositiveInteger(value) {
15739
- return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
15740
- }
15741
- function normalizeResetTime(value) {
15742
- const unixSeconds = normalizePositiveInteger(value);
15743
- if (unixSeconds === null) return null;
15744
- const date = /* @__PURE__ */ new Date(unixSeconds * SECONDS_PER_MILLISECOND);
15745
- return Number.isNaN(date.getTime()) ? null : date.toISOString();
15746
- }
15747
- function formatWindowLabel(input) {
15748
- if (input.windowDurationMins === 60) return "Hourly usage";
15749
- if (input.windowDurationMins === 300) return "5-hour usage";
15750
- if (input.windowDurationMins === 1440) return "Daily usage";
15751
- if (input.windowDurationMins === 10080) return "Weekly usage";
15752
- return input.windowKind === "primary" ? "Short-term usage" : "Long-term usage";
15753
- }
15754
- function toRecord$7(value) {
15755
- return value && typeof value === "object" && !Array.isArray(value) ? value : null;
15756
- }
15757
- //#endregion
15758
15959
  //#region ../../runtime/adapters/codex/dist/index.js
15759
15960
  const CODEX_CONVERSATION_BRIDGE_SPEC = resolveBuiltinAdapterConversationBridgeSpec("codex");
15760
15961
  const TEST_DISABLE_DEFAULT_INVOKE = Symbol.for("openmeld.test.disableDefaultInvoke");
@@ -16294,6 +16495,39 @@ const installCodexAdapter = {
16294
16495
  }
16295
16496
  };
16296
16497
  //#endregion
16498
+ //#region ../../runtime/adapters/cursor/dist/usage/cursor-usage-limits.js
16499
+ function projectCursorUsageLimits(input) {
16500
+ const response = record$4(input.value);
16501
+ const plan = record$4(response?.planUsage);
16502
+ const reset = Number(response?.billingCycleEnd);
16503
+ const resetDate = new Date(reset);
16504
+ const resetsAt = reset > 0 && Number.isFinite(resetDate.getTime()) ? resetDate.toISOString() : null;
16505
+ const limits = [
16506
+ ["totalPercentUsed", "Plan usage"],
16507
+ ["autoPercentUsed", "Auto usage"],
16508
+ ["apiPercentUsed", "API usage"]
16509
+ ].flatMap(([key, label]) => {
16510
+ const value = plan?.[key];
16511
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0) return [];
16512
+ const usedPercent = Math.min(value, 100);
16513
+ return [{
16514
+ key: `cursor:${key}`,
16515
+ label,
16516
+ observedAt: input.observedAt,
16517
+ resetsAt,
16518
+ usedPercent,
16519
+ status: usedPercent === 100 ? "exhausted" : "available"
16520
+ }];
16521
+ });
16522
+ return limits.length ? limits : createUnavailableProviderUsageLimits(input.observedAt, void 0, {
16523
+ reason: "not_reported",
16524
+ resetsAt
16525
+ });
16526
+ }
16527
+ function record$4(value) {
16528
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
16529
+ }
16530
+ //#endregion
16297
16531
  //#region ../../runtime/adapters/cursor/dist/config/cursor-runtime-config.js
16298
16532
  const DEFAULT_CURSOR_COMMAND = "cursor-agent";
16299
16533
  const PATH_SEGMENT_SPLIT_RE = /[/\\]/u;
@@ -17849,18 +18083,35 @@ function normalizeOptionalText$22(value) {
17849
18083
  const GROK_BUILD_USAGE_LIMIT_KEY = "grok-build:included-credits";
17850
18084
  function projectGrokBuildUsageLimits(input) {
17851
18085
  const config = toRecord$4(toRecord$4(input.response)?.config);
17852
- const usedPercent = readUsedPercent(config?.creditUsagePercent);
17853
- if (usedPercent === null) return createUnavailableProviderUsageLimits(input.observedAt);
17854
18086
  const currentPeriod = toRecord$4(config?.currentPeriod);
18087
+ const resetsAt = readResetTime(currentPeriod?.end);
18088
+ const usedPercent = config && !("creditUsagePercent" in config) && config.isUnifiedBillingUser === true && isActiveBillingPeriod(currentPeriod, input.observedAt) ? 0 : readUsedPercent(config?.creditUsagePercent);
18089
+ if (usedPercent === null) return createUnavailableProviderUsageLimits(input.observedAt, void 0, {
18090
+ reason: "not_reported",
18091
+ resetsAt
18092
+ });
17855
18093
  return [{
17856
18094
  key: GROK_BUILD_USAGE_LIMIT_KEY,
17857
18095
  label: resolvePeriodLabel(currentPeriod?.type),
17858
18096
  observedAt: input.observedAt,
17859
- resetsAt: readResetTime(currentPeriod?.end),
18097
+ resetsAt,
17860
18098
  status: usedPercent === 100 ? "exhausted" : "available",
17861
18099
  usedPercent
17862
18100
  }];
17863
18101
  }
18102
+ function isActiveBillingPeriod(period, observedAt) {
18103
+ const start = readResetTime(period?.start);
18104
+ const end = readResetTime(period?.end);
18105
+ const type = typeof period?.type === "string" ? period.type.toLowerCase() : "";
18106
+ const knownType = [
18107
+ "weekly",
18108
+ "monthly",
18109
+ "usage_period_type_weekly",
18110
+ "usage_period_type_monthly"
18111
+ ].includes(type);
18112
+ const nowMs = Date.parse(observedAt);
18113
+ return Boolean(knownType && start && end && Number.isFinite(nowMs) && Date.parse(start) <= nowMs && nowMs < Date.parse(end));
18114
+ }
17864
18115
  function readUsedPercent(value) {
17865
18116
  return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 100 ? value : null;
17866
18117
  }
@@ -19013,8 +19264,8 @@ async function prepareGrokBuildDeliveryScope(input) {
19013
19264
  GROK_HOME: scopedHome
19014
19265
  });
19015
19266
  assertGrokBuildDeliveryInspection(scopedInspection);
19016
- const previous = record$2(record$2(inspection)?.permissions)?.sources;
19017
- const current = record$2(record$2(scopedInspection)?.permissions)?.sources;
19267
+ const previous = record$3(record$3(inspection)?.permissions)?.sources;
19268
+ const current = record$3(record$3(scopedInspection)?.permissions)?.sources;
19018
19269
  if (!(Array.isArray(previous) && Array.isArray(current)) || previous.some((source) => typeof source !== "string" || !current.includes(source.replace(originalHome, scopedHome)))) throw scopeError$2("The correction config did not retain every original native policy source.");
19019
19270
  await writeFile(profilePath, [
19020
19271
  "---",
@@ -19074,7 +19325,7 @@ async function createGrokBuildDeliveryHome(input) {
19074
19325
  if (error.code === "ENOENT") return "";
19075
19326
  throw error;
19076
19327
  }));
19077
- const permission = record$2(config.permission) ?? {};
19328
+ const permission = record$3(config.permission) ?? {};
19078
19329
  const denied = permission.deny ?? [];
19079
19330
  if (!(Array.isArray(denied) && denied.every((rule) => typeof rule === "string"))) throw scopeError$2("The native deny rules cannot be preserved.");
19080
19331
  config.permission = {
@@ -19107,7 +19358,7 @@ function nativePermissionMode(value) {
19107
19358
  }
19108
19359
  /** Native `grok inspect --json`, captured from Grok 1.0.40. */
19109
19360
  function assertGrokBuildDeliveryInspection(value) {
19110
- const report = record$2(value);
19361
+ const report = record$3(value);
19111
19362
  const version = typeof report?.grokVersion === "string" ? report.grokVersion.match(NATIVE_VERSION) : null;
19112
19363
  if (!version || Number(version[1]) < 40 || report?.projectTrusted !== true) throw scopeError$2("This Grok installation has not verified the required native scope.");
19113
19364
  for (const key of [
@@ -19117,7 +19368,7 @@ function assertGrokBuildDeliveryInspection(value) {
19117
19368
  "lspServers"
19118
19369
  ]) if (!Array.isArray(report[key]) || report[key].length !== 0) throw scopeError$2("Ambient hooks, plugins or external servers prevent isolated correction.");
19119
19370
  for (const key of ["loadErrors", "warnings"]) if (report[key] !== void 0 && (!Array.isArray(report[key]) || report[key].length !== 0)) throw scopeError$2("The native configuration has unresolved diagnostics.");
19120
- const policy = record$2(report.permissions);
19371
+ const policy = record$3(report.permissions);
19121
19372
  if (!policy || policy.managedSettingsActive !== false || !Array.isArray(policy.skipped) || policy.skipped.length !== 0) throw scopeError$2("The effective native policy could not be preserved.");
19122
19373
  }
19123
19374
  async function verifyGrokBuildDeliveryScope(input) {
@@ -19126,7 +19377,7 @@ async function verifyGrokBuildDeliveryScope(input) {
19126
19377
  if (!Array.isArray(hooks?.hooks) || hooks.hooks.length !== 0 || hooks.loadErrors != null) throw scopeError$2("The correction session did not confirm an empty native hook scope.");
19127
19378
  await waitForGrokBuildDeliveryTools(input);
19128
19379
  const info = unwrap(await input.request("_x.ai/session/info", params));
19129
- if (info?.sessionId !== input.sessionId || info.agentName !== input.scope.profileName || record$2(info.context)?.toolDefinitionsCount !== 2) throw scopeError$2("Grok did not apply the restricted native agent definition.");
19380
+ if (info?.sessionId !== input.sessionId || info.agentName !== input.scope.profileName || record$3(info.context)?.toolDefinitionsCount !== 2) throw scopeError$2("Grok did not apply the restricted native agent definition.");
19130
19381
  }
19131
19382
  async function waitForGrokBuildDeliveryTools(input) {
19132
19383
  const params = { sessionId: input.sessionId };
@@ -19134,12 +19385,12 @@ async function waitForGrokBuildDeliveryTools(input) {
19134
19385
  while (true) {
19135
19386
  const mcp = unwrap(await input.request("_x.ai/mcp/list", params));
19136
19387
  if (!Array.isArray(mcp?.servers) || mcp.servers.length !== 1) throw scopeError$2("The correction session has an unexpected MCP inventory.");
19137
- const server = record$2(mcp.servers[0]);
19138
- const session = record$2(server?.session);
19388
+ const server = record$3(mcp.servers[0]);
19389
+ const session = record$3(server?.session);
19139
19390
  if (server?.name !== "openmeld_internal_dispatch_space_action" || session?.enabled !== true) throw scopeError$2("The current dispatch MCP server is unavailable.");
19140
19391
  if (mcp.sessionMcpResolved === true) {
19141
19392
  const tools = Array.isArray(session.tools) ? session.tools : [];
19142
- if (session.status !== "ready" || JSON.stringify(tools.map((tool) => record$2(tool)?.name).sort()) !== JSON.stringify(FINAL_TOOLS)) throw scopeError$2("Native tool startup did not confirm the delivery catalog.");
19393
+ if (session.status !== "ready" || JSON.stringify(tools.map((tool) => record$3(tool)?.name).sort()) !== JSON.stringify(FINAL_TOOLS)) throw scopeError$2("Native tool startup did not confirm the delivery catalog.");
19143
19394
  break;
19144
19395
  }
19145
19396
  if (session.status !== "initializing" || Date.now() >= deadline) throw scopeError$2("The dispatch tools did not become ready for correction.");
@@ -19147,9 +19398,9 @@ async function waitForGrokBuildDeliveryTools(input) {
19147
19398
  }
19148
19399
  }
19149
19400
  function unwrap(value) {
19150
- return record$2(record$2(value)?.result);
19401
+ return record$3(record$3(value)?.result);
19151
19402
  }
19152
- function record$2(value) {
19403
+ function record$3(value) {
19153
19404
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
19154
19405
  }
19155
19406
  function scopeError$2(message) {
@@ -19435,7 +19686,10 @@ var GrokBuildAcpSession = class {
19435
19686
  return await this.request("_x.ai/billing", {}).then((response) => projectGrokBuildUsageLimits({
19436
19687
  observedAt: (/* @__PURE__ */ new Date()).toISOString(),
19437
19688
  response
19438
- }), () => createUnavailableProviderUsageLimits((/* @__PURE__ */ new Date()).toISOString()));
19689
+ }), () => createUnavailableProviderUsageLimits((/* @__PURE__ */ new Date()).toISOString(), void 0, {
19690
+ reason: "refresh_failed",
19691
+ resetsAt: null
19692
+ }));
19439
19693
  }
19440
19694
  async readUsageLimitsSafe() {
19441
19695
  try {
@@ -21420,7 +21674,7 @@ function resolveOpenClawConfigPath(env) {
21420
21674
  return join(env[OPENCLAW_STATE_DIR_ENV]?.trim() ?? join(env.HOME?.trim() || homedir(), ".openclaw"), "openclaw.json");
21421
21675
  }
21422
21676
  function resolveDisabledPluginEntries(plugins, deliveryOnly) {
21423
- const entries = record$1(plugins.entries) ?? {};
21677
+ const entries = record$2(plugins.entries) ?? {};
21424
21678
  const allow = Array.isArray(plugins.allow) ? plugins.allow : [];
21425
21679
  if (Object.hasOwn(entries, OPENCLAW_PLUGIN_ID) || allow.includes(OPENCLAW_PLUGIN_ID)) throw scopeError$1("The native configuration already uses the reserved dispatch plugin identity. Its existing policy was not overwritten.");
21426
21680
  if (!deliveryOnly) return {};
@@ -21461,12 +21715,12 @@ async function readNativePlugins(launchContract, env, args = [
21461
21715
  maxBuffer: 1024 * 1024,
21462
21716
  windowsHide: true
21463
21717
  });
21464
- const value = record$1(JSON.parse(stdout));
21718
+ const value = record$2(JSON.parse(stdout));
21465
21719
  if (value) return value;
21466
21720
  } catch {}
21467
21721
  throw scopeError$1("OpenClaw's effective plugin scope could not be verified. No correction turn was started.");
21468
21722
  }
21469
- function record$1(value) {
21723
+ function record$2(value) {
21470
21724
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
21471
21725
  }
21472
21726
  //#endregion
@@ -22349,9 +22603,9 @@ async function prepareOpenCodeDeliveryOnlyTurn(input) {
22349
22603
  }, options)
22350
22604
  ]);
22351
22605
  requireOpenCodeDeliveryOnlyVersion(health);
22352
- const config = record(configResponse);
22353
- const source = record(sourceResponse);
22354
- const mcp = config?.mcp === void 0 ? {} : record(config.mcp);
22606
+ const config = record$1(configResponse);
22607
+ const source = record$1(sourceResponse);
22608
+ const mcp = config?.mcp === void 0 ? {} : record$1(config.mcp);
22355
22609
  if (!(config && source && mcp) || source.id !== (input.sourceSessionId ?? input.sessionId) || !Array.isArray(toolIds) || toolIds.length > 4096 || !toolIds.every((name) => typeof name === "string" && SAFE_TOOL_ID.test(name))) throw scopeError("The native tool inventory or original permission rules could not be verified.");
22356
22610
  const original = source.permission ?? [];
22357
22611
  if (!(Array.isArray(original) && original.every(isPermissionRule))) throw scopeError("The original conversation's permission rules are invalid.");
@@ -22371,27 +22625,27 @@ async function prepareOpenCodeDeliveryOnlyTurn(input) {
22371
22625
  sessionID: input.sessionId,
22372
22626
  permission
22373
22627
  }, options);
22374
- const verified = record(await input.client.session.get({
22628
+ const verified = record$1(await input.client.session.get({
22375
22629
  directory: input.directory,
22376
22630
  sessionID: input.sessionId
22377
22631
  }, options));
22378
22632
  if (verified?.id !== input.sessionId || JSON.stringify(verified.permission) !== JSON.stringify(permission)) throw scopeError("OpenCode did not confirm the correction session's restricted tool permissions.");
22379
22633
  }
22380
22634
  function requireOpenCodeDeliveryOnlyVersion(health) {
22381
- const version = record(health)?.version;
22635
+ const version = record$1(health)?.version;
22382
22636
  const match = typeof version === "string" ? VERSION.exec(version) : null;
22383
22637
  if (match && (Number(match[1]) > 1 || Number(match[1]) === 1 && (Number(match[2]) > 18 || Number(match[2]) === 18 && Number(match[3]) >= 31))) return;
22384
22638
  throw scopeError("This OpenCode installation cannot verify delivery-only execution.");
22385
22639
  }
22386
22640
  function isPermissionRule(value) {
22387
- const rule = record(value);
22641
+ const rule = record$1(value);
22388
22642
  return Boolean(rule && typeof rule.permission === "string" && typeof rule.pattern === "string" && [
22389
22643
  "allow",
22390
22644
  "ask",
22391
22645
  "deny"
22392
22646
  ].includes(String(rule.action)));
22393
22647
  }
22394
- function record(value) {
22648
+ function record$1(value) {
22395
22649
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
22396
22650
  }
22397
22651
  function scopeError(message) {
@@ -22592,6 +22846,7 @@ const SERVER_PROCESS_KILL_GRACE_MS = 1e3;
22592
22846
  const SERVER_PROCESS_CLOSE_TIMEOUT_MS = 2e3;
22593
22847
  const SERVER_READY_LINE_PATTERN = /^opencode server listening on (https?:\/\/[^\s]+)$/;
22594
22848
  var OpenCodeServerTransportError = class extends Error {
22849
+ telemetry;
22595
22850
  code;
22596
22851
  errorType;
22597
22852
  originalError;
@@ -22648,7 +22903,14 @@ async function invokeOpenCodeServerTransport(input) {
22648
22903
  streamingMode: input.streamingMode ?? "final"
22649
22904
  });
22650
22905
  } catch (error) {
22651
- throw toOpenCodeServerTransportError(error, server.readStderr());
22906
+ const failure = toOpenCodeServerTransportError(error, server.readStderr());
22907
+ failure.telemetry = server.buildTelemetry({
22908
+ invokedAtMs,
22909
+ previewEmitted: false,
22910
+ resumedContext: normalizeOptionalText$9(input.sessionId) !== null,
22911
+ streamingMode: input.streamingMode ?? "final"
22912
+ });
22913
+ throw failure;
22652
22914
  } finally {
22653
22915
  await server.close();
22654
22916
  }
@@ -22889,6 +23151,7 @@ async function runOpenCodeServerTurn(input) {
22889
23151
  const eventFailure = createDeferred();
22890
23152
  const turnCompletion = createDeferred();
22891
23153
  const turnState = {
23154
+ observeUsage: (message) => input.server.observeUsage(message),
22892
23155
  acceptedSessionIds: /* @__PURE__ */ new Set([sessionId]),
22893
23156
  assistantMessageIds: /* @__PURE__ */ new Set(),
22894
23157
  promptAccepted: false,
@@ -23147,6 +23410,7 @@ function observeOpenCodeTurnLifecycle(turnState, eventType, properties) {
23147
23410
  if (turnState.promptDispatchStarted && turnState.promptMessageId === null && message?.role === "user" && messageSessionId === turnState.rootSessionId && messageId) turnState.promptMessageId = messageId;
23148
23411
  if (messageId === turnState.promptMessageId) turnState.promptMessageObserved = true;
23149
23412
  if (message?.role === "assistant" && normalizeOptionalText$9(message.parentID) === turnState.promptMessageId && messageId) turnState.assistantMessageIds.add(messageId);
23413
+ if (message?.role === "assistant" && (normalizeOptionalText$9(message.parentID) === turnState.promptMessageId || messageSessionId !== turnState.rootSessionId && messageSessionId !== null && turnState.acceptedSessionIds.has(messageSessionId))) turnState.observeUsage(message);
23150
23414
  return;
23151
23415
  }
23152
23416
  const isRootSession = normalizeOptionalText$9(properties.sessionID) === turnState.rootSessionId;
@@ -23265,6 +23529,7 @@ function throwInteractionFailure(failure) {
23265
23529
  });
23266
23530
  }
23267
23531
  var OpenCodeServerProcess = class {
23532
+ #aiUsage = /* @__PURE__ */ new Map();
23268
23533
  #env;
23269
23534
  #failure = createDeferred();
23270
23535
  #launchContract;
@@ -23528,8 +23793,38 @@ var OpenCodeServerProcess = class {
23528
23793
  });
23529
23794
  });
23530
23795
  }
23796
+ observeUsage(message) {
23797
+ const completedAt = toRecord$1(message.time)?.completed;
23798
+ if (typeof completedAt !== "number") return;
23799
+ const tokens = toRecord$1(message.tokens);
23800
+ const cache = toRecord$1(tokens?.cache);
23801
+ if (!(tokens && typeof tokens.input === "number" && typeof tokens.output === "number" && typeof tokens.reasoning === "number" && typeof cache?.read === "number" && typeof cache.write === "number")) return;
23802
+ const inputTokens = tokens.input + cache.read + cache.write;
23803
+ const outputTokens = tokens.output + tokens.reasoning;
23804
+ const observation = readAdapterAiUsageObservation({
23805
+ eventId: `opencode:${message.sessionID}:${message.id}`,
23806
+ provider: message.providerID,
23807
+ model: message.modelID,
23808
+ source: "opencode_message",
23809
+ occurredAtMs: completedAt,
23810
+ tokens: {
23811
+ input: inputTokens,
23812
+ output: outputTokens,
23813
+ cacheRead: cache.read,
23814
+ cacheWrite: cache.write,
23815
+ reasoning: tokens.reasoning,
23816
+ total: tokens.total ?? inputTokens + outputTokens
23817
+ },
23818
+ cost: typeof message.cost === "number" ? {
23819
+ nanoUsd: Math.round(message.cost * 1e9),
23820
+ kind: "provider_estimate"
23821
+ } : null
23822
+ });
23823
+ if (observation) this.#aiUsage.set(observation.eventId, observation);
23824
+ }
23531
23825
  buildTelemetry(input) {
23532
23826
  return {
23827
+ aiUsage: [...this.#aiUsage.values()],
23533
23828
  completedAtMs: Date.now(),
23534
23829
  ...this.#lifecycle.exitCode === null ? {} : { exitCode: this.#lifecycle.exitCode },
23535
23830
  ...this.#lifecycle.exitObservedAtMs === null ? {} : { exitObservedAtMs: this.#lifecycle.exitObservedAtMs },
@@ -23889,6 +24184,36 @@ function toRecord(value) {
23889
24184
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
23890
24185
  }
23891
24186
  //#endregion
24187
+ //#region ../../runtime/adapters/opencode/dist/usage/openrouter-usage-limits.js
24188
+ const PROVIDER = {
24189
+ id: "openrouter",
24190
+ displayName: "OpenRouter"
24191
+ };
24192
+ function parseOpenRouterUsageResponse(input) {
24193
+ const data = record(record(input.value)?.data);
24194
+ const limits = [];
24195
+ const free = record(data?.free_model_daily_requests);
24196
+ const add = (key, label, used, limit) => {
24197
+ if (typeof limit !== "number" || !Number.isFinite(limit) || limit <= 0 || typeof used !== "number" || !Number.isFinite(used) || used < 0) return;
24198
+ const usedPercent = Math.min(100, used / limit * 100);
24199
+ limits.push({
24200
+ key: `openrouter:${key}`,
24201
+ label,
24202
+ provider: PROVIDER,
24203
+ observedAt: input.observedAt,
24204
+ resetsAt: null,
24205
+ usedPercent,
24206
+ status: usedPercent === 100 ? "exhausted" : "available"
24207
+ });
24208
+ };
24209
+ add("free-model-daily", "Free models daily requests", free?.used, free?.limit);
24210
+ if (typeof data?.limit === "number" && typeof data.limit_remaining === "number" && data.limit_remaining >= 0 && data.limit_remaining <= data.limit) add("key-budget", "API key budget", data.limit - data.limit_remaining, data.limit);
24211
+ return limits.length ? limits : createUnavailableProviderUsageLimits(input.observedAt, PROVIDER, { reason: "not_reported" });
24212
+ }
24213
+ function record(value) {
24214
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
24215
+ }
24216
+ //#endregion
23892
24217
  //#region ../../runtime/adapters/opencode/dist/index.js
23893
24218
  const OPENCODE_CONVERSATION_BRIDGE_SPEC = resolveBuiltinAdapterConversationBridgeSpec("opencode");
23894
24219
  const OPENCODE_PERMISSION_ENV = "OPENCODE_PERMISSION";
@@ -27960,7 +28285,6 @@ var offline_catalog_default = {
27960
28285
  {
27961
28286
  "id": "z-ai/glm-5.3-flash",
27962
28287
  "displayName": "GLM 5.3 Flash",
27963
- "badgeLabel": "New",
27964
28288
  "hostedRuntime": {
27965
28289
  "provider": "openrouter",
27966
28290
  "inputModalities": ["text", "image"],
@@ -31273,9 +31597,9 @@ function createModelCatalogReadSession(input) {
31273
31597
  async function readModelCatalogOnce(baseUrl) {
31274
31598
  try {
31275
31599
  const [apiClient, baseUrlModule, clientFoundationModule] = await Promise.all([
31276
- import("./dist-B12upl5l.js"),
31600
+ import("./dist-MpN-h8da.js"),
31277
31601
  import("./base-url-Bdjp-5vy.js"),
31278
- import("./api-client-foundation-CDj_9Rks.js")
31602
+ import("./api-client-foundation-BHjffwwr.js")
31279
31603
  ]);
31280
31604
  if (typeof apiClient.createConfigApi !== "function") throw new Error("config api client is unavailable");
31281
31605
  const resolvedBaseUrl = baseUrl ?? await baseUrlModule.resolveBaseUrl();
@@ -33131,6 +33455,6 @@ async function prepareProviderRuntime(input, options = {}) {
33131
33455
  return await preparer(input);
33132
33456
  }
33133
33457
  //#endregion
33134
- export { canManageRegistryAgentSkillTargets as $, DISPATCH_SPACE_ACTION_DELIVERY_ONLY_ENV as $n, mergeOpenClawGatewayVisibility as $t, createExpectedRoutesReadSession as A, runRuntimeTask as An, pruneStaleLeases as Ar, ensureOpenMeldManagedProfileWorkspace as At, reconcileNewRunnableBuiltinAgentsForSetup as B, upsertConversationExecutionState as Bn, createMutableRouteCatalogState as Bt, createModelCatalogReadSession as C, verifyCodexAppServerThread as Cn, resolveSelectableCandidates as Cr, resolveLocalProjectConnectionForPath as Ct, NO_LOCAL_AGENTS_NEED_OPENMELD_SERVICE_REASON as D, emitReconcileCompletedEvidence as Dn, MIN_HEARTBEAT_INTERVAL_MS as Dr, resolveRegistryOriginLaunchCommand as Dt, resolveProfileWorkspaceRuntime as E, emitDriftDetectedEvidence as En, MAX_HEARTBEAT_INTERVAL_MS as Er, listBuiltinAgentsRegistryEntries as Et, listAgentRegistrations as F, loadLedgerState as Fn, resolveConfiguredProfileWorkspacePathForAccount as Ft, updateAgentRegistrations as G, createUnavailableProviderUsageLimits as Gn, syncRuntimeEventToInflightTaskControlRegistry as Gt, resolveAgentTargetState as H, buildAuthenticatedControlPlaneResponse as Hn, summarizeSkippedDaemonProfiles as Ht, listAgentTargetStates as I, removeConversationExecutionState as In, setCustomProfileWorkspace as It, normalizeAgentIds as J, buildCliLaunchInvocation as Jn, isDaemonReconcileInProgressError as Jt, notifyDaemonRouteCatalogChanged as K, createUnsupportedProviderUsageLimits as Kn, SPACE_ACTION_CONTEXT_GUIDANCE_LINES as Kt, manageAgentRegistrationInstallation as L, resolveConversationExecutionStateByLookupKey as Ln, setOpenMeldManagedProfileWorkspace as Lt, addAgentCustomTarget as M, buildTaskResultEnvelope as Mn, resolveCatalogSyncIntervalMs as Mr, readProfileWorkspaceConfig as Mt, createRegistrationFromCatalogTarget as N, appendLedgerHistoryEntry as Nn, compareAgentControllerRefsForDisplay as Nr, readProfileWorkspaceConfigForAccount as Nt, syncDeviceRuntimeStateProjection as O, emitReconcileStartedEvidence as On, applyAcceptedLeases as Or, resolveRegistryRuntimeAdapterCapabilitySnapshot as Ot, listAgentCustomTargets as P, commitResolvedAgentContext as Pn, resolveBuiltinAgentControllerBrand as Pr, resolveConfiguredProfileWorkspacePath as Pt, resolveLocalRegistryAgentIdFromAgentControllerRef as Q, createProviderOriginalError as Qn, createPendingAgentInteractionRegistry as Qt, readAgentRuntimeConfigHealth as R, seedLegacyAgentContext as Rn, validateCustomProfileWorkspacePath as Rt, syncProfileWorkspaceState as S, resolveCodexAppServerCompletedTurn as Sn, resolveNativeAgentControllerPermissionModeForController as Sr, canonicalizeLocalProjectPath as St, resolveEffectiveProfileWorkingFolderRuntime as T, parseAntigravityUsageLimits as Tn, ADAPTIVE_HEARTBEAT_JITTER_RATIO as Tr, withAgentActivityLocalStateLock as Tt, setAgentRegistrationEnabled as U, assertLegacyAgentContextAssociation as Un, syncDaemonRouteCatalogState as Ut, removeAgentCustomTarget as V, withLedgerStateTransaction as Vn, createRouteCatalogFromMutableState as Vt, updateAgentCustomTarget as W, buildAgentContextLookupKey as Wn, normalizeDispatchThreadAction as Wt, sortAgentRegistrations as X, resolveExecutablePathsOnPath as Xn, buildDispatchReplyContextSummary as Xt, parseAgentEnabledOption as Y, materializeCliLaunchCommand as Yn, createSerialAgentInteractionCallback as Yt, repairBuiltinControllerInstall as Z, listAgentControllerSupervisedProcessIds as Zn, normalizeDispatchPostMessageAction as Zt, loadDaemonRouteCatalog as _, resolveInstalledGrokBuildLaunchCandidates as _n, renderWorkingLanguagePrompt as _r, removeProjectConnection as _t, buildOpenClawSpaceSessionKey as a, resolveDispatchContinuityObservation as an, buildWorkingLanguagePromptPlan as ar, isHomebrewCommandPath as at, resolveLocalController as b, resolveInstalledCodexLaunchCandidates as bn, resolveAgentProfileEditCapabilities as br, setDefaultProjectConnection as bt, findOpenClawAgentById as c, resolveLatestScopedConversationExecutionState as cn, createAuthorityOpenMeldServiceRuntimeId as cr, ProjectBindingOperationError as ct, resolveOpenClawAuthStatus as d, createLocalAdapterEntries as dn, isAgentExecutionReadyOrConnecting as dr, isProjectBound as dt, createLocalTaskInterruptSender as en, isDispatchSpaceActionDeliveryOnly as er, detectInstalledSkillsAgents as et, resolveOpenClawProviderRuntimeWorkingDirectory as f, parseOpenCodeGoUsageResponse as fn, listAgentControllerPermissionModeOptions as fr, listProjectBindings as ft, writeDaemonRouteCatalogCache as g, probeGrokBuildAcpInterface as gn, renderInformationProtectionPrompt as gr, removeMissingProjectConnections as gt, readDaemonRouteCatalogCache as h, GrokBuildAcpTransportError as hn, projectPeopleComputersToLegacyLocalRuntimes as hr, removeAgentActivityBindingsWhileDeliveryLocked as ht, listOpenClawGatewayAgents as i, resolveDispatchQueueLogMeta as in, buildInformationProtectionPromptPlan as ir, isBunGlobalCommandPath as it, resolveAgentProfilePrimaryAgentControllerReport as j, buildRuntimeWorkspaceFingerprint as jn, resolveAdaptiveHeartbeatIntervalMs as jr, normalizeCustomProfileWorkspacePath as jt, createPrimaryBindingReadSession as k, DaemonServiceRunError as kn, applyIntervalJitterMs as kr, resolveRegistryRuntimeAdapterContractByAgentControllerRef as kt, findOpenClawAgentsByWorkspace as l, resolveCatalogSyncSkippedProfilesLogState as ln, getAgentControllerPermissionModeDisplayMetadata as lr, ProjectBindingStoreUpdateRequiredError as lt, resolveOpenClawLocalBootstrapPaths as m, resolveInstalledOpenCodeLaunchCandidates as mn, peopleComputerContainsDevice as mr, migrateProjectBindingStore as mt, fetchOpenClawGatewayHealth as n, createLocalExecutionSlots as nn, areAgentControllerInterfaceAccountsSame as nr, EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES as nt, normalizeOpenClawSpaceIdPrefix as o, resolveCompatibleAgentContextMatch as on, createAgentControllerInterfaceDisplayRows as or, isNpmGlobalCommandPath as ot, readOpenClawLocalBootstrapState as p, forkOpenCodeServerSession as pn, parseAgentControllerRef as pr, listProjectConnectionsWithStatus as pt, normalizeAgentId as q, resolveDispatchSpaceActionMcpServer as qn, SPACE_ACTION_TARGET_GUIDANCE_LINES as qt, listOpenClawAgents as r, createInflightTaskControlRegistry as rn, buildAgentControllerRef as rr, resolveBuiltinAgentControllerDefinition as rt, slugifyOpenClawNamePart as s, resolveCompatibleConversationExecutionState as sn, createAgentExecutionStatusDisplayRows as sr, isPnpmGlobalCommandPath as st, prepareProviderRuntime as t, buildLocalServiceDiagnosticsPayload as tn, DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS as tr, resolveSkillsAgentRegistry as tt, matchesExpectedWorkspace as u, createLocalAdapterContainer as un, getAgentControllerPermissionModeFieldLabel as ur, bindProject as ut, buildRuntimeRouteTargets as v, projectCodexUsageLimits as vn, resolveAgentControllerPermissionModeForController as vr, resolveProjectBindingForPath as vt, resolveCurrentEffectiveProfileWorkingFolderRuntime as w, resolveInstalledClaudeCodeLaunchCandidates as wn, resolveRouteRegistrationReconcileDecision as wr, withAgentActivityDeliveryLock as wt, resolveLocalRuntimeControllerSupport as x, forkCodexAppServerThread as xn, resolveEvidenceSyncHealth as xr, unbindProject as xt, readLocalEnabledControllers as y, resolveCodexTimeoutMs as yn, resolveAgentExecutionStatus as yr, runIfAgentActivityBindingGenerationIsCurrent as yt, reconcileNewRunnableBuiltinAgentRegistrations as z, settleInflightTask as zn, describeProfileWorkspacePathValidationFailure as zt };
33458
+ export { canManageRegistryAgentSkillTargets as $, resolveExecutablePathsOnPath as $n, mergeOpenClawGatewayVisibility as $t, createExpectedRoutesReadSession as A, emitReconcileCompletedEvidence as An, ADAPTIVE_HEARTBEAT_JITTER_RATIO as Ar, ensureOpenMeldManagedProfileWorkspace as At, reconcileNewRunnableBuiltinAgentsForSetup as B, resolveConversationExecutionStateByLookupKey as Bn, createMutableRouteCatalogState as Bt, createModelCatalogReadSession as C, probeCodexAppServerAccount as Cn, resolveAgentControllerPermissionModeForController as Cr, resolveLocalProjectConnectionForPath as Ct, NO_LOCAL_AGENTS_NEED_OPENMELD_SERVICE_REASON as D, probeClaudeCodeUsageLimits as Dn, resolveNativeAgentControllerPermissionModeForController as Dr, resolveRegistryOriginLaunchCommand as Dt, resolveProfileWorkspaceRuntime as E, projectCodexUsageLimits as En, resolveEvidenceSyncHealth as Er, listBuiltinAgentsRegistryEntries as Et, listAgentRegistrations as F, buildTaskResultEnvelope as Fn, pruneStaleLeases as Fr, resolveConfiguredProfileWorkspacePathForAccount as Ft, updateAgentRegistrations as G, buildAuthenticatedControlPlaneResponse as Gn, syncRuntimeEventToInflightTaskControlRegistry as Gt, resolveAgentTargetState as H, settleInflightTask as Hn, summarizeSkippedDaemonProfiles as Ht, listAgentTargetStates as I, appendLedgerHistoryEntry as In, resolveAdaptiveHeartbeatIntervalMs as Ir, setCustomProfileWorkspace as It, normalizeAgentIds as J, createUnavailableProviderUsageLimits as Jn, isDaemonReconcileInProgressError as Jt, notifyDaemonRouteCatalogChanged as K, assertLegacyAgentContextAssociation as Kn, SPACE_ACTION_CONTEXT_GUIDANCE_LINES as Kt, manageAgentRegistrationInstallation as L, commitResolvedAgentContext as Ln, resolveCatalogSyncIntervalMs as Lr, setOpenMeldManagedProfileWorkspace as Lt, addAgentCustomTarget as M, DaemonServiceRunError as Mn, MIN_HEARTBEAT_INTERVAL_MS as Mr, readProfileWorkspaceConfig as Mt, createRegistrationFromCatalogTarget as N, runRuntimeTask as Nn, applyAcceptedLeases as Nr, readProfileWorkspaceConfigForAccount as Nt, syncDeviceRuntimeStateProjection as O, resolveInstalledClaudeCodeLaunchCandidates as On, resolveSelectableCandidates as Or, resolveRegistryRuntimeAdapterCapabilitySnapshot as Ot, listAgentCustomTargets as P, buildRuntimeWorkspaceFingerprint as Pn, applyIntervalJitterMs as Pr, resolveConfiguredProfileWorkspacePath as Pt, resolveLocalRegistryAgentIdFromAgentControllerRef as Q, materializeCliLaunchCommand as Qn, createPendingAgentInteractionRegistry as Qt, readAgentRuntimeConfigHealth as R, loadLedgerState as Rn, compareAgentControllerRefsForDisplay as Rr, validateCustomProfileWorkspacePath as Rt, syncProfileWorkspaceState as S, forkCodexAppServerThread as Sn, renderWorkingLanguagePrompt as Sr, canonicalizeLocalProjectPath as St, resolveEffectiveProfileWorkingFolderRuntime as T, verifyCodexAppServerThread as Tn, resolveAgentProfileEditCapabilities as Tr, withAgentActivityLocalStateLock as Tt, setAgentRegistrationEnabled as U, upsertConversationExecutionState as Un, syncDaemonRouteCatalogState as Ut, removeAgentCustomTarget as V, seedLegacyAgentContext as Vn, createRouteCatalogFromMutableState as Vt, updateAgentCustomTarget as W, withLedgerStateTransaction as Wn, normalizeDispatchThreadAction as Wt, sortAgentRegistrations as X, resolveDispatchSpaceActionMcpServer as Xn, buildDispatchReplyContextSummary as Xt, parseAgentEnabledOption as Y, createUnsupportedProviderUsageLimits as Yn, createSerialAgentInteractionCallback as Yt, repairBuiltinControllerInstall as Z, buildCliLaunchInvocation as Zn, normalizeDispatchPostMessageAction as Zt, loadDaemonRouteCatalog as _, probeGrokBuildAcpInterface as _n, listAgentControllerPermissionModeOptions as _r, removeProjectConnection as _t, buildOpenClawSpaceSessionKey as a, resolveDispatchContinuityObservation as an, areAgentControllerInterfaceAccountsSame as ar, isHomebrewCommandPath as at, resolveLocalController as b, resolveCodexTimeoutMs as bn, projectPeopleComputersToLegacyLocalRuntimes as br, setDefaultProjectConnection as bt, findOpenClawAgentById as c, resolveLatestScopedConversationExecutionState as cn, buildWorkingLanguagePromptPlan as cr, ProjectBindingOperationError as ct, resolveOpenClawAuthStatus as d, createLocalAdapterEntries as dn, createAuthorityOpenMeldServiceRuntimeId as dr, isProjectBound as dt, createLocalTaskInterruptSender as en, listAgentControllerSupervisedProcessIds as er, detectInstalledSkillsAgents as et, resolveOpenClawProviderRuntimeWorkingDirectory as f, parseOpenRouterUsageResponse as fn, getAgentControllerPermissionModeDisplayMetadata as fr, listProjectBindings as ft, writeDaemonRouteCatalogCache as g, GrokBuildAcpTransportError as gn, isAgentExecutionReadyOrConnecting as gr, removeMissingProjectConnections as gt, readDaemonRouteCatalogCache as h, resolveInstalledOpenCodeLaunchCandidates as hn, isAgentControllerUsageRefreshUnavailable as hr, removeAgentActivityBindingsWhileDeliveryLocked as ht, listOpenClawGatewayAgents as i, resolveDispatchQueueLogMeta as in, DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS as ir, isBunGlobalCommandPath as it, resolveAgentProfilePrimaryAgentControllerReport as j, emitReconcileStartedEvidence as jn, MAX_HEARTBEAT_INTERVAL_MS as jr, normalizeCustomProfileWorkspacePath as jt, createPrimaryBindingReadSession as k, emitDriftDetectedEvidence as kn, resolveRouteRegistrationReconcileDecision as kr, resolveRegistryRuntimeAdapterContractByAgentControllerRef as kt, findOpenClawAgentsByWorkspace as l, resolveCatalogSyncSkippedProfilesLogState as ln, createAgentControllerInterfaceDisplayRows as lr, ProjectBindingStoreUpdateRequiredError as lt, resolveOpenClawLocalBootstrapPaths as m, forkOpenCodeServerSession as mn, isAgentControllerUsageAccountUnavailable as mr, migrateProjectBindingStore as mt, fetchOpenClawGatewayHealth as n, createLocalExecutionSlots as nn, DISPATCH_SPACE_ACTION_DELIVERY_ONLY_ENV as nr, EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES as nt, normalizeOpenClawSpaceIdPrefix as o, resolveCompatibleAgentContextMatch as on, buildAgentControllerRef as or, isNpmGlobalCommandPath as ot, readOpenClawLocalBootstrapState as p, parseOpenCodeGoUsageResponse as pn, getAgentControllerPermissionModeFieldLabel as pr, listProjectConnectionsWithStatus as pt, normalizeAgentId as q, buildAgentContextLookupKey as qn, SPACE_ACTION_TARGET_GUIDANCE_LINES as qt, listOpenClawAgents as r, createInflightTaskControlRegistry as rn, isDispatchSpaceActionDeliveryOnly as rr, resolveBuiltinAgentControllerDefinition as rt, slugifyOpenClawNamePart as s, resolveCompatibleConversationExecutionState as sn, buildInformationProtectionPromptPlan as sr, isPnpmGlobalCommandPath as st, prepareProviderRuntime as t, buildLocalServiceDiagnosticsPayload as tn, createProviderOriginalError as tr, resolveSkillsAgentRegistry as tt, matchesExpectedWorkspace as u, createLocalAdapterContainer as un, createAgentExecutionStatusDisplayRows as ur, bindProject as ut, buildRuntimeRouteTargets as v, resolveInstalledGrokBuildLaunchCandidates as vn, parseAgentControllerRef as vr, resolveProjectBindingForPath as vt, resolveCurrentEffectiveProfileWorkingFolderRuntime as w, resolveCodexAppServerCompletedTurn as wn, resolveAgentExecutionStatus as wr, withAgentActivityDeliveryLock as wt, resolveLocalRuntimeControllerSupport as x, resolveInstalledCodexLaunchCandidates as xn, renderInformationProtectionPrompt as xr, unbindProject as xt, readLocalEnabledControllers as y, projectCursorUsageLimits as yn, peopleComputerContainsDevice as yr, runIfAgentActivityBindingGenerationIsCurrent as yt, reconcileNewRunnableBuiltinAgentRegistrations as z, removeConversationExecutionState as zn, resolveBuiltinAgentControllerBrand as zr, describeProfileWorkspacePathValidationFailure as zt };
33135
33459
 
33136
- //# sourceMappingURL=prepare-provider-runtime-BGdfbFyZ.js.map
33460
+ //# sourceMappingURL=prepare-provider-runtime-Bf2GBijn.js.map