@skrr-ai/cli 0.1.142 → 0.1.144

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 (156) hide show
  1. package/README.md +8 -0
  2. package/dist/base-command.d.ts +4 -2
  3. package/dist/base-command.js +46 -13
  4. package/dist/commands/agenda/trigger/create.js +4 -2
  5. package/dist/commands/agenda/trigger/list.js +7 -7
  6. package/dist/commands/agent/message/approve.d.ts +17 -0
  7. package/dist/commands/agent/message/approve.js +72 -0
  8. package/dist/commands/agent/message/decline.d.ts +17 -0
  9. package/dist/commands/agent/message/decline.js +72 -0
  10. package/dist/commands/agent/message/pending.d.ts +18 -0
  11. package/dist/commands/agent/message/pending.js +79 -0
  12. package/dist/commands/agents/always-on/disable.js +9 -1
  13. package/dist/commands/agents/always-on/enable.js +9 -1
  14. package/dist/commands/agents/always-on/status.js +14 -1
  15. package/dist/commands/agents/create.js +10 -1
  16. package/dist/commands/agents/delete.d.ts +51 -0
  17. package/dist/commands/agents/delete.js +163 -2
  18. package/dist/commands/agents/intuitions/list.js +1 -1
  19. package/dist/commands/agents/plan-day.d.ts +39 -7
  20. package/dist/commands/agents/plan-day.js +254 -65
  21. package/dist/commands/agents/proactive-audit.d.ts +22 -0
  22. package/dist/commands/agents/proactive-audit.js +86 -0
  23. package/dist/commands/agents/schedule-overview.d.ts +7 -0
  24. package/dist/commands/agents/schedule-overview.js +43 -5
  25. package/dist/commands/agents/schedule-trace.js +30 -19
  26. package/dist/commands/agents/spawn.d.ts +51 -0
  27. package/dist/commands/agents/spawn.js +212 -9
  28. package/dist/commands/agents/todos/cancel.js +3 -0
  29. package/dist/commands/agents/todos/edit.js +1 -1
  30. package/dist/commands/agents/todos/list.d.ts +5 -0
  31. package/dist/commands/agents/todos/list.js +19 -5
  32. package/dist/commands/agents/triggers/create.js +1 -1
  33. package/dist/commands/agents/triggers/policy.js +7 -0
  34. package/dist/commands/agents/triggers/update.js +1 -1
  35. package/dist/commands/commitments/create.js +13 -3
  36. package/dist/commands/commitments/preflight.js +31 -5
  37. package/dist/commands/daemon/index.js +1 -0
  38. package/dist/commands/daemon/logs.d.ts +8 -1
  39. package/dist/commands/daemon/logs.js +32 -22
  40. package/dist/commands/daemon/profile.d.ts +15 -0
  41. package/dist/commands/daemon/profile.js +51 -0
  42. package/dist/commands/goals/briefing/status.js +1 -1
  43. package/dist/commands/initiatives/worker/deactivate.d.ts +23 -0
  44. package/dist/commands/initiatives/worker/deactivate.js +78 -0
  45. package/dist/commands/login.js +8 -2
  46. package/dist/commands/logout.d.ts +20 -0
  47. package/dist/commands/logout.js +110 -5
  48. package/dist/commands/machines/profiles/disconnect.d.ts +23 -0
  49. package/dist/commands/machines/profiles/disconnect.js +102 -0
  50. package/dist/commands/machines/profiles/index.d.ts +15 -0
  51. package/dist/commands/machines/profiles/index.js +33 -0
  52. package/dist/commands/machines/profiles/label.d.ts +24 -0
  53. package/dist/commands/machines/profiles/label.js +85 -0
  54. package/dist/commands/machines/profiles/list.d.ts +16 -0
  55. package/dist/commands/machines/profiles/list.js +87 -0
  56. package/dist/commands/memory/maintain.js +16 -2
  57. package/dist/commands/profiles/list.js +17 -2
  58. package/dist/commands/spaces/delete.js +6 -1
  59. package/dist/commands/spaces/workflows/archive.js +6 -1
  60. package/dist/commands/spaces/workflows/publish.js +3 -1
  61. package/dist/commands/spaces/workflows/run.d.ts +1 -0
  62. package/dist/commands/spaces/workflows/run.js +17 -1
  63. package/dist/commands/spaces/workflows/triggers/create.js +3 -1
  64. package/dist/commands/tasks/workflow-context.js +3 -1
  65. package/dist/commands/triggers/authorization.js +1 -1
  66. package/dist/commands/triggers/capabilities.js +17 -1
  67. package/dist/commands/triggers/create.d.ts +2 -0
  68. package/dist/commands/triggers/create.js +23 -7
  69. package/dist/commands/triggers/fire-detail.js +12 -3
  70. package/dist/commands/triggers/list.d.ts +1 -0
  71. package/dist/commands/triggers/list.js +13 -1
  72. package/dist/commands/triggers/preflight.js +18 -0
  73. package/dist/commands/triggers/prune.js +9 -5
  74. package/dist/commands/triggers/update.js +13 -4
  75. package/dist/generated/agent-guides.json +35 -35
  76. package/dist/lib/agent-guides.js +1 -1
  77. package/dist/lib/agent-proactive-baseline.d.ts +6 -0
  78. package/dist/lib/agent-proactive-baseline.js +32 -3
  79. package/dist/lib/always-on-command-result.d.ts +18 -0
  80. package/dist/lib/always-on-command-result.js +52 -0
  81. package/dist/lib/always-on-runtime.d.ts +31 -0
  82. package/dist/lib/always-on-runtime.js +39 -0
  83. package/dist/lib/auth-diagnostics.d.ts +10 -1
  84. package/dist/lib/auth-diagnostics.js +16 -8
  85. package/dist/lib/commitments.d.ts +16 -9
  86. package/dist/lib/commitments.js +65 -4
  87. package/dist/lib/compasses.js +5 -0
  88. package/dist/lib/daemon-binding.js +6 -3
  89. package/dist/lib/daemon-command-hint.d.ts +10 -5
  90. package/dist/lib/daemon-command-hint.js +11 -6
  91. package/dist/lib/daemon-setup.js +9 -3
  92. package/dist/lib/daemonBroker.d.ts +7 -0
  93. package/dist/lib/daemonBroker.js +5 -0
  94. package/dist/lib/daemonHandoff.d.ts +2 -0
  95. package/dist/lib/daemonHandoff.js +16 -3
  96. package/dist/lib/daemonIslandProfile.d.ts +19 -0
  97. package/dist/lib/daemonIslandProfile.js +41 -0
  98. package/dist/lib/drain-stdio.d.ts +22 -0
  99. package/dist/lib/drain-stdio.js +46 -0
  100. package/dist/lib/format.d.ts +32 -0
  101. package/dist/lib/format.js +105 -1
  102. package/dist/lib/initiatives-worker.d.ts +25 -0
  103. package/dist/lib/initiatives-worker.js +13 -0
  104. package/dist/lib/keychain.d.ts +22 -1
  105. package/dist/lib/keychain.js +40 -1
  106. package/dist/lib/local-daemon-readiness.js +4 -6
  107. package/dist/lib/local-skills.js +4 -1
  108. package/dist/lib/login.d.ts +7 -0
  109. package/dist/lib/login.js +5 -0
  110. package/dist/lib/machines.d.ts +68 -0
  111. package/dist/lib/machines.js +67 -0
  112. package/dist/lib/proactive-audit.d.ts +52 -0
  113. package/dist/lib/proactive-audit.js +67 -0
  114. package/dist/lib/proactiveApi.d.ts +23 -0
  115. package/dist/lib/refresh.d.ts +20 -6
  116. package/dist/lib/refresh.js +27 -9
  117. package/dist/lib/roles.d.ts +1 -1
  118. package/dist/lib/runtime-start-verification.js +3 -6
  119. package/dist/lib/schedule.d.ts +189 -9
  120. package/dist/lib/schedule.js +283 -22
  121. package/dist/lib/triggers.d.ts +134 -3
  122. package/dist/lib/triggers.js +370 -17
  123. package/dist/lib/workflow-node-control.js +8 -0
  124. package/dist/lib/workflow-run-view.js +9 -0
  125. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.d.ts +12 -0
  126. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/configRoot.js +10 -2
  127. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +8 -0
  128. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +22 -0
  129. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.d.ts +133 -0
  130. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.js +180 -0
  131. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +5 -3
  132. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +50 -0
  133. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.d.ts +137 -0
  134. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profilePorts.js +328 -0
  135. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.d.ts +63 -0
  136. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileSelection.js +174 -0
  137. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +22 -0
  138. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -4
  139. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.d.ts +12 -0
  140. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/configRoot.js +14 -0
  141. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +8 -0
  142. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +27 -0
  143. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.d.ts +133 -0
  144. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.js +183 -0
  145. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +5 -3
  146. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +11 -3
  147. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.d.ts +137 -0
  148. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.js +333 -0
  149. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.d.ts +63 -0
  150. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileSelection.js +212 -0
  151. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +22 -0
  152. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +22 -4
  153. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  154. package/dist/node_modules/@skrr-ai/data-provider/index.js +7446 -7378
  155. package/oclif.manifest.json +844 -47
  156. package/package.json +1 -1
@@ -26,6 +26,7 @@ __export(index_exports, {
26
26
  AuthHelperUntrustedError: () => import_credentialResolver.AuthHelperUntrustedError,
27
27
  CI_TOKEN_PREFIX: () => import_credentialResolver.CI_TOKEN_PREFIX,
28
28
  CONFIG_DIR_NAME: () => import_localIdentity.CONFIG_DIR_NAME,
29
+ CONFIG_ROOT_ENV_VARS: () => import_configRoot.CONFIG_ROOT_ENV_VARS,
29
30
  CREDENTIAL_PRECEDENCE: () => import_credentialResolver.CREDENTIAL_PRECEDENCE,
30
31
  CRED_ENVELOPE_MAGIC: () => import_credentialEnvelope.ENVELOPE_MAGIC,
31
32
  CRED_KEY_LEN: () => import_credentialEnvelope.KEY_LEN,
@@ -37,6 +38,7 @@ __export(index_exports, {
37
38
  DEFAULT_DAEMON_SCOPES: () => import_daemonScopes.DEFAULT_DAEMON_SCOPES,
38
39
  DEFAULT_FIRST_PARTY_HARNESS_CHANNEL: () => import_firstPartyHarnessChannels.DEFAULT_FIRST_PARTY_HARNESS_CHANNEL,
39
40
  DEFAULT_LOGIN_TIMEOUT_MS: () => import_loginLocalhost.DEFAULT_LOGIN_TIMEOUT_MS,
41
+ DEFAULT_PROFILE: () => import_profileSelection.DEFAULT_PROFILE,
40
42
  DEFAULT_UNREADABLE_CREDENTIAL_HINT: () => import_credentialEnvelopeBridge.DEFAULT_UNREADABLE_CREDENTIAL_HINT,
41
43
  DEVICE_KEY_ALGS: () => import_deviceKey.DEVICE_KEY_ALGS,
42
44
  DEVICE_KEY_UNREADABLE_CREDENTIAL_HINT: () => import_deviceIdentityBridge.DEVICE_KEY_UNREADABLE_CREDENTIAL_HINT,
@@ -48,7 +50,12 @@ __export(index_exports, {
48
50
  DPOP_PROOF_VERIFY_UNAVAILABLE: () => import_dpop.DPOP_PROOF_VERIFY_UNAVAILABLE,
49
51
  EXECUTOR_STOP_RECEIPT_DEFAULT_MAX_AGE_SECONDS: () => import_executorStopReceipt.EXECUTOR_STOP_RECEIPT_DEFAULT_MAX_AGE_SECONDS,
50
52
  EXECUTOR_STOP_RECEIPT_ERASURE_SCOPES: () => import_executorStopReceipt.EXECUTOR_STOP_RECEIPT_ERASURE_SCOPES,
53
+ EXECUTOR_STOP_RECEIPT_REAP_SUPPORT: () => import_executorStopReceiptV2.EXECUTOR_STOP_RECEIPT_REAP_SUPPORT,
51
54
  EXECUTOR_STOP_RECEIPT_TYP: () => import_executorStopReceipt.EXECUTOR_STOP_RECEIPT_TYP,
55
+ EXECUTOR_STOP_RECEIPT_V2_DEFAULT_MAX_AGE_SECONDS: () => import_executorStopReceiptV2.EXECUTOR_STOP_RECEIPT_V2_DEFAULT_MAX_AGE_SECONDS,
56
+ EXECUTOR_STOP_RECEIPT_V2_ERASURE_SCOPE: () => import_executorStopReceiptV2.EXECUTOR_STOP_RECEIPT_V2_ERASURE_SCOPE,
57
+ EXECUTOR_STOP_RECEIPT_V2_TYP: () => import_executorStopReceiptV2.EXECUTOR_STOP_RECEIPT_V2_TYP,
58
+ EXECUTOR_STOP_RECEIPT_WITNESS_PLATFORMS: () => import_executorStopReceiptV2.EXECUTOR_STOP_RECEIPT_WITNESS_PLATFORMS,
52
59
  EXIT_NEEDS_REAUTH: () => import_messages.EXIT_NEEDS_REAUTH,
53
60
  FIRST_PARTY_HARNESS_CHANNELS: () => import_firstPartyHarnessChannels.FIRST_PARTY_HARNESS_CHANNELS,
54
61
  FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX: () => import_firstPartyHarnessHome.FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX,
@@ -100,6 +107,8 @@ __export(index_exports, {
100
107
  PENDING_HARDWARE_KEY_MAX_AGE_MS: () => import_deviceIdentityBridge.PENDING_HARDWARE_KEY_MAX_AGE_MS,
101
108
  PERSONAL_ACCESS_TOKEN_PREFIX: () => import_credentialResolver.PERSONAL_ACCESS_TOKEN_PREFIX,
102
109
  PROFILES_SEGMENT: () => import_profileStateDir.PROFILES_SEGMENT,
110
+ PROFILE_ENV_VAR: () => import_profileSelection.PROFILE_ENV_VAR,
111
+ PROFILE_LOCK_FILENAME: () => import_profileSelection.PROFILE_LOCK_FILENAME,
103
112
  PairBundleError: () => import_daemonPair.PairBundleError,
104
113
  PermanentAuthFailure: () => import_types.PermanentAuthFailure,
105
114
  SCOPES: () => import_daemonScopes.SCOPES,
@@ -145,6 +154,7 @@ __export(index_exports, {
145
154
  assertLoopbackHttpUrl: () => import_loopbackHttp.assertLoopbackHttpUrl,
146
155
  assertMayMutateLiveKeychain: () => import_liveState.assertMayMutateLiveKeychain,
147
156
  assertMayMutateLiveState: () => import_liveState.assertMayMutateLiveState,
157
+ assertValidProfileName: () => import_profileSelection.assertValidProfileName,
148
158
  buildArtifactMessage: () => import_releaseManifest.buildArtifactMessage,
149
159
  buildCredentialAad: () => import_credentialEnvelope.buildCredentialAad,
150
160
  buildDeviceProof: () => import_deviceKey.buildProof,
@@ -184,6 +194,7 @@ __export(index_exports, {
184
194
  describeDeviceKeySplit: () => import_deviceIdentityBridge.describeDeviceKeySplit,
185
195
  describeLegacyState: () => import_legacyStatePreflight.describeLegacyState,
186
196
  describeMachineIdentity: () => import_machineUuid.describeMachineIdentity,
197
+ describeProfileSelection: () => import_profileSelection.describeProfileSelection,
187
198
  describeStoredDeviceKey: () => import_deviceIdentityBridge.describeStoredDeviceKey,
188
199
  discardPendingHardwareKey: () => import_deviceIdentityBridge.discardPendingHardwareKey,
189
200
  emitAuthTelemetry: () => import_runtime.emitAuthTelemetry,
@@ -191,6 +202,8 @@ __export(index_exports, {
191
202
  ensureMachineDaemonId: () => import_machineId.ensureMachineDaemonId,
192
203
  envHasProxy: () => import_spawnEnv.envHasProxy,
193
204
  executorStopReceiptHtu: () => import_executorStopReceipt.executorStopReceiptHtu,
205
+ executorStopReceiptV2Htu: () => import_executorStopReceiptV2.executorStopReceiptV2Htu,
206
+ explicitProfileArgs: () => import_profileSelection.explicitProfileArgs,
194
207
  findLegacyLocalState: () => import_legacyStatePreflight.findLegacyLocalState,
195
208
  firstPartyHarnessBinDir: () => import_firstPartyHarnessHome.firstPartyHarnessBinDir,
196
209
  firstPartyHarnessChannelPrefix: () => import_firstPartyHarnessChannels.firstPartyHarnessChannelPrefix,
@@ -252,6 +265,7 @@ __export(index_exports, {
252
265
  isTestProcess: () => import_liveState.isTestProcess,
253
266
  isTrustedArtifactOrigin: () => import_releaseManifest.isTrustedArtifactOrigin,
254
267
  isUserOwnedSecretKeychainService: () => import_kek.isUserOwnedSecretKeychainService,
268
+ isValidProfileName: () => import_profileSelection.isValidProfileName,
255
269
  isValidRecoveryCode: () => import_recoveryCode.isValidRecoveryCode,
256
270
  jwkThumbprint: () => import_deviceKey.jwkThumbprint,
257
271
  keychainSuffixForDir: () => import_liveState.keychainSuffixForDir,
@@ -276,6 +290,7 @@ __export(index_exports, {
276
290
  pairUint8ArrayToBase64: () => import_daemonPair.uint8ArrayToBase64,
277
291
  pairUint8ArrayToBase64Url: () => import_daemonPair.uint8ArrayToBase64Url,
278
292
  parseExecutorStopReceiptBody: () => import_executorStopReceipt.parseExecutorStopReceiptBody,
293
+ parseExecutorStopReceiptBodyV2: () => import_executorStopReceiptV2.parseExecutorStopReceiptBodyV2,
279
294
  parsePairBundle: () => import_daemonPair.parsePairBundle,
280
295
  parsePairPlaintext: () => import_daemonPair.parsePairPlaintext,
281
296
  parsePairUrl: () => import_daemonPair.parsePairUrl,
@@ -285,6 +300,8 @@ __export(index_exports, {
285
300
  persistReauthState: () => import_refresh.persistReauthState,
286
301
  prepareHardwareKeyCandidate: () => import_deviceIdentityBridge.prepareHardwareKeyCandidate,
287
302
  probeHardwareDeviceKey: () => import_deviceKeyHardware.probeHardwareDeviceKey,
303
+ profileIsImplicit: () => import_profileSelection.profileIsImplicit,
304
+ profileLockPath: () => import_profileSelection.profileLockPath,
288
305
  profileStateDir: () => import_profileStateDir.profileStateDir,
289
306
  profileStateFileLocations: () => import_profileStateDir.profileStateFileLocations,
290
307
  profileStateFilePathsToClear: () => import_profileStateDir.profileStateFilePathsToClear,
@@ -293,6 +310,7 @@ __export(index_exports, {
293
310
  qualifyMachineUuid: () => import_machineUuid.qualifyMachineUuid,
294
311
  readAuthFromFd: () => import_fdToken.readAuthFromFd,
295
312
  readIndependentMachineReservation: () => import_independentMachineReservation.readIndependentMachineReservation,
313
+ readProfileLock: () => import_profileSelection.readProfileLock,
296
314
  readServerDeviceKeyAlgs: () => import_deviceKeyServerSupport.readServerDeviceKeyAlgs,
297
315
  reauthCommand: () => import_messages.reauthCommand,
298
316
  refreshDaemonToken: () => import_refresh.refreshDaemonToken,
@@ -306,16 +324,20 @@ __export(index_exports, {
306
324
  resolveConfigRoot: () => import_configRoot.resolveConfigRoot,
307
325
  resolveFirstPartyHarnessChannel: () => import_firstPartyHarnessChannels.resolveFirstPartyHarnessChannel,
308
326
  resolveHardwareDeviceKeyHelper: () => import_deviceKeyHardware.resolveHardwareDeviceKeyHelper,
327
+ resolveProfileSelection: () => import_profileSelection.resolveProfileSelection,
309
328
  resolveProfileStateDir: () => import_profileStateDir.resolveProfileStateDir,
310
329
  resolveProfileStateFile: () => import_profileStateDir.resolveProfileStateFile,
311
330
  rethrowIfLiveStateRefusal: () => import_liveState.rethrowIfLiveStateRefusal,
312
331
  revokeDaemonRefreshSession: () => import_refresh.revokeDaemonRefreshSession,
332
+ revokeDaemonRefreshSessionReported: () => import_refresh.revokeDaemonRefreshSessionReported,
313
333
  runHeadersHelper: () => import_headers_helper.runHeadersHelper,
314
334
  safeEqual: () => import_pkce.safeEqual,
315
335
  sanitizeSpawnEnv: () => import_spawnEnv.sanitizeSpawnEnv,
316
336
  setMachineUuidProfile: () => import_machineUuid.setMachineUuidProfile,
317
337
  shutdownCredEnvelope: () => import_credentialEnvelopeBridge.shutdownCredEnvelope,
318
338
  signExecutorStopReceipt: () => import_executorStopReceipt.signExecutorStopReceipt,
339
+ signExecutorStopReceiptV2: () => import_executorStopReceiptV2.signExecutorStopReceiptV2,
340
+ signExecutorStopReceiptV2WithDeviceKey: () => import_deviceIdentityBridge.signExecutorStopReceiptV2WithDeviceKey,
319
341
  signExecutorStopReceiptWithDeviceKey: () => import_deviceIdentityBridge.signExecutorStopReceiptWithDeviceKey,
320
342
  signProofWith: () => import_deviceKey.signProofWith,
321
343
  signServerRequest: () => import_deviceIdentityBridge.signServerRequest,
@@ -331,9 +353,11 @@ __export(index_exports, {
331
353
  verifyDeviceProof: () => import_deviceKey.verifyProof,
332
354
  verifyDpopProof: () => import_dpop.verifyDpopProof,
333
355
  verifyExecutorStopReceipt: () => import_executorStopReceipt.verifyExecutorStopReceipt,
356
+ verifyExecutorStopReceiptV2: () => import_executorStopReceiptV2.verifyExecutorStopReceiptV2,
334
357
  verifyIndependentMachineReservation: () => import_independentMachineReservation.verifyIndependentMachineReservation,
335
358
  verifyManifest: () => import_releaseManifest.verifyManifest,
336
359
  withAuthLock: () => import_refresh.withAuthLock,
360
+ withConfigRoot: () => import_configRoot.withConfigRoot,
337
361
  withLoopbackNoProxy: () => import_spawnEnv.withLoopbackNoProxy,
338
362
  zeroizeKekCaches: () => import_kek.zeroizeKekCaches
339
363
  });
@@ -361,6 +385,7 @@ var import_kek = require("./kek/index.js");
361
385
  var import_liveState = require("./liveState.js");
362
386
  var import_deviceKey = require("./deviceKey.js");
363
387
  var import_executorStopReceipt = require("./executorStopReceipt.js");
388
+ var import_executorStopReceiptV2 = require("./executorStopReceiptV2.js");
364
389
  var import_deviceKeyHandle = require("./deviceKeyHandle.js");
365
390
  var import_deviceKeyServerSupport = require("./deviceKeyServerSupport.js");
366
391
  var import_deviceKeyHardware = require("./deviceKeyHardware.js");
@@ -382,6 +407,7 @@ var import_firstPartyHarnessChannels = require("./firstPartyHarnessChannels.js")
382
407
  var import_releaseKeys = require("./releaseKeys.js");
383
408
  var import_releaseManifest = require("./releaseManifest.js");
384
409
  var import_configRoot = require("./configRoot.js");
410
+ var import_profileSelection = require("./profileSelection.js");
385
411
  var import_profileStateDir = require("./profileStateDir.js");
386
412
  __reExport(index_exports, require("./harnessPermissionControls.js"), module.exports);
387
413
  var import_releaseVersions = require("./releaseVersions.js");
@@ -397,6 +423,7 @@ var import_independentMachineReservation = require("./independentMachineReservat
397
423
  AuthHelperUntrustedError,
398
424
  CI_TOKEN_PREFIX,
399
425
  CONFIG_DIR_NAME,
426
+ CONFIG_ROOT_ENV_VARS,
400
427
  CREDENTIAL_PRECEDENCE,
401
428
  CRED_ENVELOPE_MAGIC,
402
429
  CRED_KEY_LEN,
@@ -408,6 +435,7 @@ var import_independentMachineReservation = require("./independentMachineReservat
408
435
  DEFAULT_DAEMON_SCOPES,
409
436
  DEFAULT_FIRST_PARTY_HARNESS_CHANNEL,
410
437
  DEFAULT_LOGIN_TIMEOUT_MS,
438
+ DEFAULT_PROFILE,
411
439
  DEFAULT_UNREADABLE_CREDENTIAL_HINT,
412
440
  DEVICE_KEY_ALGS,
413
441
  DEVICE_KEY_UNREADABLE_CREDENTIAL_HINT,
@@ -419,7 +447,12 @@ var import_independentMachineReservation = require("./independentMachineReservat
419
447
  DPOP_PROOF_VERIFY_UNAVAILABLE,
420
448
  EXECUTOR_STOP_RECEIPT_DEFAULT_MAX_AGE_SECONDS,
421
449
  EXECUTOR_STOP_RECEIPT_ERASURE_SCOPES,
450
+ EXECUTOR_STOP_RECEIPT_REAP_SUPPORT,
422
451
  EXECUTOR_STOP_RECEIPT_TYP,
452
+ EXECUTOR_STOP_RECEIPT_V2_DEFAULT_MAX_AGE_SECONDS,
453
+ EXECUTOR_STOP_RECEIPT_V2_ERASURE_SCOPE,
454
+ EXECUTOR_STOP_RECEIPT_V2_TYP,
455
+ EXECUTOR_STOP_RECEIPT_WITNESS_PLATFORMS,
423
456
  EXIT_NEEDS_REAUTH,
424
457
  FIRST_PARTY_HARNESS_CHANNELS,
425
458
  FIRST_PARTY_HARNESS_PREVIOUS_SUFFIX,
@@ -471,6 +504,8 @@ var import_independentMachineReservation = require("./independentMachineReservat
471
504
  PENDING_HARDWARE_KEY_MAX_AGE_MS,
472
505
  PERSONAL_ACCESS_TOKEN_PREFIX,
473
506
  PROFILES_SEGMENT,
507
+ PROFILE_ENV_VAR,
508
+ PROFILE_LOCK_FILENAME,
474
509
  PairBundleError,
475
510
  PermanentAuthFailure,
476
511
  SCOPES,
@@ -516,6 +551,7 @@ var import_independentMachineReservation = require("./independentMachineReservat
516
551
  assertLoopbackHttpUrl,
517
552
  assertMayMutateLiveKeychain,
518
553
  assertMayMutateLiveState,
554
+ assertValidProfileName,
519
555
  buildArtifactMessage,
520
556
  buildCredentialAad,
521
557
  buildDeviceProof,
@@ -555,6 +591,7 @@ var import_independentMachineReservation = require("./independentMachineReservat
555
591
  describeDeviceKeySplit,
556
592
  describeLegacyState,
557
593
  describeMachineIdentity,
594
+ describeProfileSelection,
558
595
  describeStoredDeviceKey,
559
596
  discardPendingHardwareKey,
560
597
  emitAuthTelemetry,
@@ -562,6 +599,8 @@ var import_independentMachineReservation = require("./independentMachineReservat
562
599
  ensureMachineDaemonId,
563
600
  envHasProxy,
564
601
  executorStopReceiptHtu,
602
+ executorStopReceiptV2Htu,
603
+ explicitProfileArgs,
565
604
  findLegacyLocalState,
566
605
  firstPartyHarnessBinDir,
567
606
  firstPartyHarnessChannelPrefix,
@@ -623,6 +662,7 @@ var import_independentMachineReservation = require("./independentMachineReservat
623
662
  isTestProcess,
624
663
  isTrustedArtifactOrigin,
625
664
  isUserOwnedSecretKeychainService,
665
+ isValidProfileName,
626
666
  isValidRecoveryCode,
627
667
  jwkThumbprint,
628
668
  keychainSuffixForDir,
@@ -647,6 +687,7 @@ var import_independentMachineReservation = require("./independentMachineReservat
647
687
  pairUint8ArrayToBase64,
648
688
  pairUint8ArrayToBase64Url,
649
689
  parseExecutorStopReceiptBody,
690
+ parseExecutorStopReceiptBodyV2,
650
691
  parsePairBundle,
651
692
  parsePairPlaintext,
652
693
  parsePairUrl,
@@ -656,6 +697,8 @@ var import_independentMachineReservation = require("./independentMachineReservat
656
697
  persistReauthState,
657
698
  prepareHardwareKeyCandidate,
658
699
  probeHardwareDeviceKey,
700
+ profileIsImplicit,
701
+ profileLockPath,
659
702
  profileStateDir,
660
703
  profileStateFileLocations,
661
704
  profileStateFilePathsToClear,
@@ -664,6 +707,7 @@ var import_independentMachineReservation = require("./independentMachineReservat
664
707
  qualifyMachineUuid,
665
708
  readAuthFromFd,
666
709
  readIndependentMachineReservation,
710
+ readProfileLock,
667
711
  readServerDeviceKeyAlgs,
668
712
  reauthCommand,
669
713
  refreshDaemonToken,
@@ -677,16 +721,20 @@ var import_independentMachineReservation = require("./independentMachineReservat
677
721
  resolveConfigRoot,
678
722
  resolveFirstPartyHarnessChannel,
679
723
  resolveHardwareDeviceKeyHelper,
724
+ resolveProfileSelection,
680
725
  resolveProfileStateDir,
681
726
  resolveProfileStateFile,
682
727
  rethrowIfLiveStateRefusal,
683
728
  revokeDaemonRefreshSession,
729
+ revokeDaemonRefreshSessionReported,
684
730
  runHeadersHelper,
685
731
  safeEqual,
686
732
  sanitizeSpawnEnv,
687
733
  setMachineUuidProfile,
688
734
  shutdownCredEnvelope,
689
735
  signExecutorStopReceipt,
736
+ signExecutorStopReceiptV2,
737
+ signExecutorStopReceiptV2WithDeviceKey,
690
738
  signExecutorStopReceiptWithDeviceKey,
691
739
  signProofWith,
692
740
  signServerRequest,
@@ -702,9 +750,11 @@ var import_independentMachineReservation = require("./independentMachineReservat
702
750
  verifyDeviceProof,
703
751
  verifyDpopProof,
704
752
  verifyExecutorStopReceipt,
753
+ verifyExecutorStopReceiptV2,
705
754
  verifyIndependentMachineReservation,
706
755
  verifyManifest,
707
756
  withAuthLock,
757
+ withConfigRoot,
708
758
  withLoopbackNoProxy,
709
759
  zeroizeKekCaches,
710
760
  ...require("./firstPartyHarness.js"),
@@ -0,0 +1,137 @@
1
+ export declare const HEALTH_BASE_PORT = 19580;
2
+ export declare const BROWSER_RELAY_BASE_PORT = 18792;
3
+ /** Each kind owns `[base, base + PROFILE_PORT_RANGE)`. */
4
+ export declare const PROFILE_PORT_RANGE = 100;
5
+ export declare const PORT_ALLOCATIONS_FILENAME = "port-allocations.json";
6
+ export declare const PORT_ALLOCATIONS_VERSION = 1;
7
+ /** The kill switch: legacy fixed defaults, no allocation. */
8
+ export declare const STATIC_DEFAULT_PORTS_ENV = "OVERSKY_STATIC_DEFAULT_PORTS";
9
+ export declare const DEFAULT_PORT_PROFILE = "default";
10
+ export declare const PROFILE_PORT_KINDS: readonly ["health", "relay"];
11
+ export type ProfilePortKind = (typeof PROFILE_PORT_KINDS)[number];
12
+ /** Where a profile's port came from. */
13
+ export type ProfilePortSource = 'explicit' | 'allocated' | 'derived' | 'static';
14
+ /**
15
+ * Why an allocation is not the profile's derived port. Recorded when the
16
+ * allocation is made, because the condition (another process holding a port)
17
+ * may be gone by the time anyone reads it.
18
+ */
19
+ export type ProfilePortMoveReason =
20
+ /** The derived port is the `default` profile's, which has priority on it. */
21
+ 'default_priority'
22
+ /** Another profile's record or explicit port holds it. */
23
+ | 'held_by_profile'
24
+ /** A bind probe found something listening there. */
25
+ | 'in_use'
26
+ /** Every slot in the range was taken; the derived port was kept anyway. */
27
+ | 'range_exhausted';
28
+ export interface ProfilePortMove {
29
+ /** The derived port the allocation moved away from. */
30
+ from: number;
31
+ reason: ProfilePortMoveReason;
32
+ /** The profile holding `from`, when `reason` names one. */
33
+ profile?: string;
34
+ at?: string;
35
+ }
36
+ export interface ProfilePortAllocation {
37
+ health?: number;
38
+ relay?: number;
39
+ /** Present only for a kind whose port is not the derived one. */
40
+ moves?: Partial<Record<ProfilePortKind, ProfilePortMove>>;
41
+ updatedAt?: string;
42
+ }
43
+ export interface PortAllocationRecord {
44
+ version: typeof PORT_ALLOCATIONS_VERSION;
45
+ profiles: Record<string, ProfilePortAllocation>;
46
+ }
47
+ export interface ResolvedProfilePort {
48
+ kind: ProfilePortKind;
49
+ port: number;
50
+ source: ProfilePortSource;
51
+ /** What the hash alone would give; shown so a reader can see a move. */
52
+ derived: number;
53
+ /** Set when an allocation moved off `derived`. */
54
+ move?: ProfilePortMove;
55
+ }
56
+ export interface ResolvedProfilePorts {
57
+ profile: string;
58
+ health: ResolvedProfilePort;
59
+ relay: ResolvedProfilePort;
60
+ }
61
+ export declare function profilePortBase(kind: ProfilePortKind): number;
62
+ /** FNV-1a 32-bit over a string's UTF-16 code units. Pure. */
63
+ export declare function fnv1a32(str: string): number;
64
+ export declare function staticDefaultPortsEnabled(env?: NodeJS.ProcessEnv): boolean;
65
+ /**
66
+ * `base + fnv1a32(profile) % 100`, or `base` under the kill switch. The legacy
67
+ * default and the starting point of every allocation; never, on its own, an
68
+ * answer to "which port does this profile listen on".
69
+ */
70
+ export declare function profileDerivedPort(basePort: number, profile: string, env?: NodeJS.ProcessEnv): number;
71
+ export declare function derivedProfilePort(kind: ProfilePortKind, profile: string, env?: NodeJS.ProcessEnv): number;
72
+ export declare function isInProfilePortRange(kind: ProfilePortKind, port: unknown): port is number;
73
+ export declare function portAllocationsPath(root: string): string;
74
+ export declare function emptyPortAllocations(): PortAllocationRecord;
75
+ /**
76
+ * Tolerant parse: an entry that is not a port in its kind's range is dropped,
77
+ * so a hand-edited or truncated record degrades to "derived" for that profile
78
+ * rather than handing a reader a port the allocator would never have chosen.
79
+ */
80
+ export declare function parsePortAllocations(raw: unknown): PortAllocationRecord;
81
+ /** The record under `root`, or an empty one when it is absent or unreadable. */
82
+ export declare function readPortAllocations(root: string): PortAllocationRecord;
83
+ /**
84
+ * A `daemon.json` port that is a real choice, or null. Absent, unparsable and
85
+ * equal-to-derived all read as "no choice" (see the header for why the last).
86
+ * `0` is a choice (an ephemeral bind) and is returned as 0.
87
+ */
88
+ export declare function explicitProfilePort(kind: ProfilePortKind, configured: unknown, profile: string, env?: NodeJS.ProcessEnv): number | null;
89
+ export interface DaemonJsonPortValues {
90
+ health: unknown;
91
+ relay: unknown;
92
+ }
93
+ export declare function profileDaemonJsonPath(root: string, profile: string): string;
94
+ /** The raw port values in a profile's `daemon.json`; both undefined when unreadable. */
95
+ export declare function readDaemonJsonPortValues(root: string, profile: string): DaemonJsonPortValues;
96
+ /** One port, from inputs the caller already holds. */
97
+ export declare function resolveProfilePort(input: {
98
+ kind: ProfilePortKind;
99
+ profile: string;
100
+ configured: unknown;
101
+ allocations: PortAllocationRecord;
102
+ env?: NodeJS.ProcessEnv;
103
+ }): ResolvedProfilePort;
104
+ /**
105
+ * Both ports of `profile` under `root`. Pass `configured` when the caller has
106
+ * already parsed the profile's `daemon.json` (the daemon's `loadConfig` does),
107
+ * so the file is not read twice and the two cannot disagree.
108
+ */
109
+ export declare function resolveProfilePorts(root: string, profile: string, options?: {
110
+ env?: NodeJS.ProcessEnv;
111
+ configured?: DaemonJsonPortValues;
112
+ allocations?: PortAllocationRecord;
113
+ }): ResolvedProfilePorts;
114
+ /** The profile directories under `root/profiles`. */
115
+ export declare function listProfileNames(root: string): string[];
116
+ /** Who else claims a port, and how. */
117
+ export interface ProfilePortClaim {
118
+ profile: string;
119
+ how: 'explicit' | 'allocated' | 'default_priority';
120
+ }
121
+ /**
122
+ * Every OTHER profile's claim on each port of `kind`: its explicit port, else
123
+ * its recorded allocation, plus the `default` profile's derived port, which is
124
+ * reserved for it even before it has a record. This is the set an allocation
125
+ * must avoid, and what a reader shows when a derived port is shared.
126
+ */
127
+ export declare function otherProfilePortClaims(root: string, kind: ProfilePortKind, profile: string, options?: {
128
+ env?: NodeJS.ProcessEnv;
129
+ allocations?: PortAllocationRecord;
130
+ }): Map<number, ProfilePortClaim>;
131
+ /**
132
+ * One sentence: which port, from where, and — when it is not the derived one or
133
+ * might be shared — why. `sharedWith` is a claim another profile holds on this
134
+ * port (from `otherProfilePortClaims`); pass it for a `derived` port, which is
135
+ * the one case where a reader can see a collision the daemon has not resolved.
136
+ */
137
+ export declare function describeProfilePort(resolved: ResolvedProfilePort, sharedWith?: ProfilePortClaim | null): string;