openmeld 0.3.211 → 0.3.213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-me-membership-CNgO595N.js → add-me-membership-GbaxKxz-.js} +2 -2
- package/dist/{add-me-membership-CNgO595N.js.map → add-me-membership-GbaxKxz-.js.map} +1 -1
- package/dist/agents-BNoz9DA5.js +4153 -0
- package/dist/agents-BNoz9DA5.js.map +1 -0
- package/dist/{api-client-foundation-CtQTtA4m.js → api-client-foundation-TEBOwWl1.js} +1 -1
- package/dist/{api-client-foundation-MJK8vWfn.js → api-client-foundation-km8Ol1P4.js} +3 -3
- package/dist/{api-client-foundation-MJK8vWfn.js.map → api-client-foundation-km8Ol1P4.js.map} +1 -1
- package/dist/auth-session-D6UDl3r3.js +4 -0
- package/dist/{auth-session-CB7m-csh.js → auth-session-DgHvRt5i.js} +99 -21
- package/dist/auth-session-DgHvRt5i.js.map +1 -0
- package/dist/{command-oQK6PG6b.js → command-Dsa8gaFe.js} +10 -9
- package/dist/{command-oQK6PG6b.js.map → command-Dsa8gaFe.js.map} +1 -1
- package/dist/computer-connection-D8tX14R_.js +120 -0
- package/dist/computer-connection-D8tX14R_.js.map +1 -0
- package/dist/{computer-connection-review-CiIyTeDw.js → computer-connection-review-CjOXBWiV.js} +6 -6
- package/dist/{computer-connection-review-CiIyTeDw.js.map → computer-connection-review-CjOXBWiV.js.map} +1 -1
- package/dist/computer-disconnect-k6UVCsVF.js +47 -0
- package/dist/computer-disconnect-k6UVCsVF.js.map +1 -0
- package/dist/{computer-setup-continuation-CeFPluYv.js → computer-setup-continuation-DhY_sJis.js} +4 -4
- package/dist/{computer-setup-continuation-CeFPluYv.js.map → computer-setup-continuation-DhY_sJis.js.map} +1 -1
- package/dist/{control-plane-D9jDcbMZ.js → control-plane-Bpu7g9Av.js} +3 -547
- package/dist/control-plane-Bpu7g9Av.js.map +1 -0
- package/dist/{daemon-service-runtime-D8KrOfSV.js → daemon-service-runtime-CY6wdBe1.js} +381 -54
- package/dist/daemon-service-runtime-CY6wdBe1.js.map +1 -0
- package/dist/{openmeld-tools-update-coordinator-qrZLtDMv.js → daemon-service-update-coordinator-BcbbIDzC.js} +25953 -25662
- package/dist/daemon-service-update-coordinator-BcbbIDzC.js.map +1 -0
- package/dist/{dist-DajKOXDk.js → dist-Bsz_wafH.js} +1 -1
- package/dist/{dist-DtykdMlN.js → dist-CAx_kxvt.js} +971 -929
- package/dist/dist-CAx_kxvt.js.map +1 -0
- package/dist/{elapsed-time-BE9NPM-x.js → elapsed-time-Do3uIV__.js} +47 -78
- package/dist/elapsed-time-Do3uIV__.js.map +1 -0
- package/dist/{installation-inventory-CLBwkIf6.js → installation-inventory-C92AkQkA.js} +3 -3
- package/dist/{installation-inventory-CLBwkIf6.js.map → installation-inventory-C92AkQkA.js.map} +1 -1
- package/dist/local-components-B6SCXZf9.js +575 -0
- package/dist/local-components-B6SCXZf9.js.map +1 -0
- package/dist/{openmeld-LADiOJ3_.js → openmeld-I4pLxQsY.js} +55 -154
- package/dist/openmeld-I4pLxQsY.js.map +1 -0
- package/dist/{openmeld-maintenance-worker-B-u1CItK.js → openmeld-maintenance-worker-D5VAO9GD.js} +5 -5
- package/dist/{openmeld-maintenance-worker-B-u1CItK.js.map → openmeld-maintenance-worker-D5VAO9GD.js.map} +1 -1
- package/dist/openmeld-tools-update-join-DsQdgYNw.js +56 -0
- package/dist/openmeld-tools-update-join-DsQdgYNw.js.map +1 -0
- package/dist/openmeld-tools-update-process-frame-0X-t0Kjv.js +93 -0
- package/dist/openmeld-tools-update-process-frame-0X-t0Kjv.js.map +1 -0
- package/dist/openmeld-tools-update-process-frame-DX1Dc8VI.js +4 -0
- package/dist/openmeld.js +7 -3
- package/dist/openmeld.js.map +1 -1
- package/dist/{prepare-session-executor-B5aD6Fx_.js → prepare-session-executor-BEzlM0hJ.js} +171 -16
- package/dist/prepare-session-executor-BEzlM0hJ.js.map +1 -0
- package/dist/{runtime-transport-VcPSvVY1.js → runtime-transport-DxISZdzf.js} +34 -4
- package/dist/runtime-transport-DxISZdzf.js.map +1 -0
- package/dist/{agents-CGBELT4J.js → service-Cev-7yAJ.js} +703 -4620
- package/dist/service-Cev-7yAJ.js.map +1 -0
- package/dist/{service-account-authorization-D1Wp-91j.js → service-account-authorization-AbowIr6n.js} +3 -3
- package/dist/{service-account-authorization-D1Wp-91j.js.map → service-account-authorization-AbowIr6n.js.map} +1 -1
- package/dist/service-account-control-BV_tBiio.js +145 -0
- package/dist/service-account-control-BV_tBiio.js.map +1 -0
- package/dist/{service-control-capabilities-CP1XCSVm.js → service-control-capabilities-BGXPenm1.js} +1 -1
- package/dist/{service-control-capabilities-COkZ1Ceh.js → service-control-capabilities-DUudAKoj.js} +2 -2
- package/dist/{service-control-capabilities-COkZ1Ceh.js.map → service-control-capabilities-DUudAKoj.js.map} +1 -1
- package/dist/{upgrade-DJLqTfBA.js → upgrade-9h70HCQP.js} +40 -18
- package/dist/upgrade-9h70HCQP.js.map +1 -0
- package/dist/upgrade-CXgHeEKK.js +4 -0
- package/package.json +2 -2
- package/dist/agents-CGBELT4J.js.map +0 -1
- package/dist/auth-session-CB7m-csh.js.map +0 -1
- package/dist/auth-session-DXJq5arz.js +0 -4
- package/dist/computer-connection-51dg6Tq0.js +0 -54
- package/dist/computer-connection-51dg6Tq0.js.map +0 -1
- package/dist/control-plane-D9jDcbMZ.js.map +0 -1
- package/dist/daemon-service-runtime-D8KrOfSV.js.map +0 -1
- package/dist/dist-DtykdMlN.js.map +0 -1
- package/dist/elapsed-time-BE9NPM-x.js.map +0 -1
- package/dist/openmeld-LADiOJ3_.js.map +0 -1
- package/dist/openmeld-tools-update-coordinator-qrZLtDMv.js.map +0 -1
- package/dist/prepare-session-executor-B5aD6Fx_.js.map +0 -1
- package/dist/runtime-transport-VcPSvVY1.js.map +0 -1
- package/dist/upgrade-BMh_CLJL.js +0 -4
- package/dist/upgrade-DJLqTfBA.js.map +0 -1
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { A as isLocalMachineFailureError, T as LocalMachineFailureError, _t as skillsDir, rt as openMeldRootDir } from "./lock-Dxp6o_t_.js";
|
|
4
|
-
import { zt as createCurrentDeviceApi } from "./dist-
|
|
5
|
-
import {
|
|
6
|
-
import { at as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { zt as createCurrentDeviceApi } from "./dist-CAx_kxvt.js";
|
|
5
|
+
import { $t as resolveCurrentDaemonExpectedVersion, Bn as resolveSkillsAgentRegistry, Bt as toStartBackgroundHelperExecutionCompatibility, Dn as reconcileNewRunnableBuiltinAgentsForSetup, J as getSetupFlowCopy, Rn as canManageRegistryAgentSkillTargets, St as readOpenMeldToolsUpdateContextFromEnv, Xa as resolveOpenMeldProfile, Zn as notifyDaemonRouteCatalogChanged, ea as buildLocalAgentCatalogFromReadiness, jt as inspectDaemonServiceInventory, n as scheduleDaemonServiceUpdate, si as buildAgentControllerRef, za as resolveRuntimeContext, zn as detectInstalledSkillsAgents, zt as resolveDaemonRuntimeContractCompatibility } from "./daemon-service-update-coordinator-BcbbIDzC.js";
|
|
6
|
+
import { at as prepareSessionStreamServerFrameSchema, b as recordInterruptedComputerAuthSessionRecoveryFailure, c as completeInterruptedComputerAuthSessionRecovery, ct as prepareStepDiagnosticsBundleSchema, d as getAuthSessionState, dt as redactPrepareStepDiagnosticsValue, h as markInterruptedComputerAuthSessionRecovery, lt as redactPrepareStepDiagnosticsBundle, ot as prepareSessionWithTokenResponseSchema, p as getInterruptedComputerAuthSessionRecovery, rt as prepareSessionResponseSchema, st as prepareSetupBootstrapWriteSchema, tt as PREPARE_STEP_DIAGNOSTICS_MAX_CHARS, ut as redactPrepareStepDiagnosticsText } from "./auth-session-DgHvRt5i.js";
|
|
7
|
+
import { T as resolveOpenMeldToolsUpdateTargetVersions } from "./local-components-B6SCXZf9.js";
|
|
8
|
+
import { a as mergeTargetsByDir, b as withSkillsInstallLock, c as summarizeSkillState, d as resolveSkillsInstallStates, f as ensureLocalSkills, i as filterTargetsWithInstalledOpenMeldSkills, l as installSkillsToTargets, m as readOpenMeldSkillMarker, n as collectSkillsReadinessSnapshot, o as persistDetectedInstallStateFromCheck, p as isOpenMeldManagedSkillDir, r as compareInstallRecords, s as resolveTrackedInstallTargets, t as buildAgentTargets } from "./installation-inventory-C92AkQkA.js";
|
|
9
|
+
import { $n as runInteractivePrompt, D as createDelayedSpinner, Jn as renderInfoCard, L as readDaemonIncidentLogTail, M as buildHumanErrorCopy, N as renderHumanErrorCard, Qn as isReturnKeypress, Yn as renderTextInfoCard, Zn as promptTextEntry, ar as extractAuthApiErrorMessage, cr as resolveDeviceAuthClientId, dt as collectLocalAgentControllerInventory, fn as connectWebSocket, ft as resolveLocalAgentControllerBlockerReasonCodes, lr as resolveDeviceTokenExpiresAt, mt as resolveLocalAgentControllerReportDecision, or as fetchAuthUserSnapshot, pt as resolveLocalAgentControllerLaunchability, sr as requestDeviceToken, t as bestEffortStopCurrentLaneDaemonService, ur as revokeAuthAccessToken, ut as submitRuntimeAgentControllerReports } from "./service-Cev-7yAJ.js";
|
|
10
|
+
import { G as readRecentDaemonLifecycleEvents, Ht as upsertDaemonServiceContract, Vt as readDaemonServiceContract, Y as collectLocalOperationFailure, i as readCurrentObservedDaemonRuntimeStatus, lt as compareSemver, nt as OPENMELD_VERSION, st as readPendingDaemonServiceUpdate } from "./daemon-service-runtime-CY6wdBe1.js";
|
|
11
|
+
import { At as getCliVersionInfo, Bt as buildAgentOverviewFromContract, C as createSkillsActionGuideError, Et as getSkillsTargetSelectionRequiredArguments, Gt as createPresenter, Kt as sanitizeTerminalDisplayText, Ot as validateSkillsTargetSelectionInput, Tt as getSkillsTargetSelectionOptionalArguments, Wt as formatAgentOverviewPayload, Xt as outLine, g as canUseInteractivePrompts, ht as getCommandEntryContract, n as resolveElapsedTimeMs, t as formatElapsedTime, wt as buildSkillsTargetSelectionExamples } from "./elapsed-time-Do3uIV__.js";
|
|
11
12
|
import { S as setConfiguredSkillsConfig, T as updateConfiguredSkillsConfig, g as getConfiguredSkillsConfig, y as resolveRuntimeSkillsCustomTargetId } from "./base-url-C6sHRNGu.js";
|
|
12
13
|
import { A as getDaemonStatus } from "./daemon-state-C37ZtIZK.js";
|
|
13
14
|
import { S as resolveDaemonServiceManager, _ as readDaemonServiceJobCrashExitCode, d as isDaemonServiceJobNeverSpawned } from "./daemon-service-manager-GiMCiTmu.js";
|
|
14
15
|
import { a as formatOpenMeldCliCommand, c as formatOpenMeldCliTextBlock, i as formatInlineOpenMeldCliCommands, r as resolveAuthBaseUrl } from "./openmeld-environment-target-NtJYJe1D.js";
|
|
15
16
|
import { t as sleep } from "./dist-o3UL1EGQ.js";
|
|
16
|
-
import { d as buildOpenMeldRequestContextFromProfile, n as fetchSpaceRequestWithTimeout, t as createCliApiClientFoundation } from "./api-client-foundation-
|
|
17
|
+
import { d as buildOpenMeldRequestContextFromProfile, n as fetchSpaceRequestWithTimeout, t as createCliApiClientFoundation } from "./api-client-foundation-km8Ol1P4.js";
|
|
18
|
+
import { n as waitForExternalOpenMeldToolsUpdate, r as waitForOpenMeldToolsUpdateCompletion, t as resolveExternalOpenMeldToolsUpdate } from "./openmeld-tools-update-join-DsQdgYNw.js";
|
|
19
|
+
import { C as resolveGatewayWebOrigin, T as runDaemonServiceParticipationGate, _ as promptSearchSelect, f as runAgentsRepair, h as promptSearchMultiselect, l as runAgentsEnable, x as computeRetryDelayMs } from "./agents-BNoz9DA5.js";
|
|
17
20
|
import os, { hostname, release } from "node:os";
|
|
18
21
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
19
22
|
import { lstat, readFile, readlink, rm, stat } from "node:fs/promises";
|
|
@@ -132,9 +135,26 @@ function normalizeOptionalString$1(value) {
|
|
|
132
135
|
//#region src/commands/computer-auth-handoff-recovery.ts
|
|
133
136
|
const UNUSED_SETUP_SESSION_CLEANUP_SUFFIX = " OpenMeld also could not revoke the unused setup session.";
|
|
134
137
|
async function recoverInterruptedComputerAuthHandoff(input) {
|
|
138
|
+
try {
|
|
139
|
+
return await runInterruptedComputerAuthHandoffRecovery(input);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
emitComputerAuthHandoffRecoveryProgress(input, {
|
|
142
|
+
code: "setup.computer_handoff_recovery.failed",
|
|
143
|
+
state: "failed",
|
|
144
|
+
text: error instanceof Error && error.message.trim() ? error.message : "The previous computer connection could not be restored."
|
|
145
|
+
});
|
|
146
|
+
throw error;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
async function runInterruptedComputerAuthHandoffRecovery(input) {
|
|
135
150
|
await waitForOpenMeldToolsUpdateBeforeComputerHandoff(input);
|
|
136
151
|
const recovery = await getInterruptedComputerAuthSessionRecovery();
|
|
137
152
|
if (!recovery) return "none";
|
|
153
|
+
emitComputerAuthHandoffRecoveryProgress(input, {
|
|
154
|
+
code: "setup.computer_handoff_recovery.started",
|
|
155
|
+
state: "active",
|
|
156
|
+
text: "Restoring the previous computer connection."
|
|
157
|
+
});
|
|
138
158
|
const previousOwnerUserId = normalizeOptionalString(recovery.previousSession?.user?.id);
|
|
139
159
|
if (!recovery.serviceReconciled) {
|
|
140
160
|
const stopped = await stopCurrentLaneDaemonServiceAfterToolsUpdate(input);
|
|
@@ -205,6 +225,11 @@ async function recoverInterruptedComputerAuthHandoff(input) {
|
|
|
205
225
|
transitionId: recovery.id
|
|
206
226
|
});
|
|
207
227
|
emitUnusedSetupSessionCleanupWarning(input.presenter, revoked.error);
|
|
228
|
+
emitComputerAuthHandoffRecoveryProgress(input, {
|
|
229
|
+
code: "setup.computer_handoff_recovery.deferred",
|
|
230
|
+
state: "failed",
|
|
231
|
+
text: "The previous computer connection has not been fully restored."
|
|
232
|
+
});
|
|
208
233
|
return "deferred";
|
|
209
234
|
}
|
|
210
235
|
await markInterruptedComputerAuthSessionRecovery({
|
|
@@ -212,7 +237,29 @@ async function recoverInterruptedComputerAuthHandoff(input) {
|
|
|
212
237
|
phase: "remote_session"
|
|
213
238
|
});
|
|
214
239
|
}
|
|
215
|
-
|
|
240
|
+
const completed = await completeInterruptedComputerAuthSessionRecovery(recovery.id);
|
|
241
|
+
emitComputerAuthHandoffRecoveryProgress(input, {
|
|
242
|
+
code: completed ? "setup.computer_handoff_recovery.completed" : "setup.computer_handoff_recovery.deferred",
|
|
243
|
+
state: completed ? "completed" : "failed",
|
|
244
|
+
text: completed ? "Restored the previous computer connection." : "The previous computer connection has not been fully restored."
|
|
245
|
+
});
|
|
246
|
+
return completed ? "completed" : "deferred";
|
|
247
|
+
}
|
|
248
|
+
function emitComputerAuthHandoffRecoveryProgress(input, progress) {
|
|
249
|
+
input.presenter.line({
|
|
250
|
+
code: progress.code,
|
|
251
|
+
text: progress.text,
|
|
252
|
+
data: {
|
|
253
|
+
phase: "restoring",
|
|
254
|
+
state: progress.state
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
try {
|
|
258
|
+
input.onProgress?.({
|
|
259
|
+
...progress,
|
|
260
|
+
phase: "restoring"
|
|
261
|
+
});
|
|
262
|
+
} catch {}
|
|
216
263
|
}
|
|
217
264
|
async function stopCurrentLaneDaemonServiceAfterToolsUpdate(input) {
|
|
218
265
|
let stopped = await bestEffortStopCurrentLaneDaemonService({ runtime: input.runtime });
|
|
@@ -3635,8 +3682,10 @@ function shouldForceSetupServiceRefresh() {
|
|
|
3635
3682
|
function resolveSetupServiceUpdateTruth(input) {
|
|
3636
3683
|
const operation = input.operation;
|
|
3637
3684
|
if (!operation) return { status: "ready" };
|
|
3685
|
+
const target = resolveOpenMeldToolsUpdateTargetVersions(operation);
|
|
3686
|
+
const currentInstallationSatisfiesTarget = input.currentServiceVerified === true && input.installedServiceVersion !== null && compareSemver(input.currentCliVersion, target.cliVersion) >= 0 && compareSemver(input.installedServiceVersion, target.serviceVersion) >= 0;
|
|
3638
3687
|
if (operation.phase === "restored" || operation.phase === "needs_help") {
|
|
3639
|
-
if (
|
|
3688
|
+
if (currentInstallationSatisfiesTarget) return { status: "ready" };
|
|
3640
3689
|
return {
|
|
3641
3690
|
message: "OpenMeld Service update failed. Run `openmeld service update`.",
|
|
3642
3691
|
status: "failed"
|
|
@@ -3646,8 +3695,7 @@ function resolveSetupServiceUpdateTruth(input) {
|
|
|
3646
3695
|
message: "OpenMeld Service is updating in the background. Setup will continue automatically when it finishes.",
|
|
3647
3696
|
status: "updating"
|
|
3648
3697
|
};
|
|
3649
|
-
if (
|
|
3650
|
-
if (input.currentServiceVerified && input.currentCliVersion === operation.targetVersion && input.installedServiceVersion === operation.targetVersion) return { status: "ready" };
|
|
3698
|
+
if (currentInstallationSatisfiesTarget) return { status: "ready" };
|
|
3651
3699
|
return {
|
|
3652
3700
|
message: "OpenMeld Service update could not be verified. Run `openmeld service update`.",
|
|
3653
3701
|
status: "verifying"
|
|
@@ -3657,7 +3705,7 @@ async function assertSetupServiceUpdateComplete(input = {}) {
|
|
|
3657
3705
|
const operation = await waitForOpenMeldToolsUpdateCompletion(input);
|
|
3658
3706
|
if (!operation) return;
|
|
3659
3707
|
const inventory = await inspectDaemonServiceInventory({
|
|
3660
|
-
expectedVersion:
|
|
3708
|
+
expectedVersion: await resolveCurrentDaemonExpectedVersion(resolveOpenMeldToolsUpdateTargetVersions(operation).serviceVersion),
|
|
3661
3709
|
intent: "status_cleanup"
|
|
3662
3710
|
});
|
|
3663
3711
|
const truth = resolveSetupServiceUpdateTruth({
|
|
@@ -3798,6 +3846,7 @@ async function runPrepareSessionExecutorOnce(input) {
|
|
|
3798
3846
|
emitHumanSection(input.input, "OpenMeld setup");
|
|
3799
3847
|
const connectionProgress = startPrepareProgressStep(input.input, {
|
|
3800
3848
|
code: "prepare.session.progress.connect_terminal",
|
|
3849
|
+
phase: "connecting_service",
|
|
3801
3850
|
text: "Connecting Terminal to OpenMeld Web..."
|
|
3802
3851
|
});
|
|
3803
3852
|
let stream = null;
|
|
@@ -3807,6 +3856,7 @@ async function runPrepareSessionExecutorOnce(input) {
|
|
|
3807
3856
|
opaqueToken: input.input.startSession,
|
|
3808
3857
|
prepareSessionId: input.initial.prepareSessionId
|
|
3809
3858
|
});
|
|
3859
|
+
input.input.connectedStream = stream;
|
|
3810
3860
|
const connected = await waitForSnapshotWithProgress({
|
|
3811
3861
|
input: input.input,
|
|
3812
3862
|
stream,
|
|
@@ -4022,6 +4072,7 @@ async function reportLocalAgentCatalogForSelection(input) {
|
|
|
4022
4072
|
emitHumanSection(input.input, "Local agents");
|
|
4023
4073
|
const progress = startPrepareProgressStep(input.input, {
|
|
4024
4074
|
code: "prepare.session.progress.local_agents",
|
|
4075
|
+
phase: "confirming",
|
|
4025
4076
|
text: "Checking local agents..."
|
|
4026
4077
|
});
|
|
4027
4078
|
const reconciliation = input.input.localAgentSelection ? null : await reconcileNewRunnableBuiltinAgentsForSetup();
|
|
@@ -4140,6 +4191,7 @@ async function executeSelectedAgentPreparation(input) {
|
|
|
4140
4191
|
async function runTerminalStep(input) {
|
|
4141
4192
|
const progress = startPrepareProgressStep(input.input, {
|
|
4142
4193
|
code: `prepare.session.progress.${input.stepId}`,
|
|
4194
|
+
phase: resolveTerminalStepProgressPhase(input.stepId),
|
|
4143
4195
|
text: input.message
|
|
4144
4196
|
});
|
|
4145
4197
|
const stepStartRevision = input.snapshot.sessionRevision;
|
|
@@ -4764,6 +4816,7 @@ async function waitForSnapshotWithProgress(input) {
|
|
|
4764
4816
|
}
|
|
4765
4817
|
progress = startPrepareProgressStep(input.input, {
|
|
4766
4818
|
code: "prepare.session.waiting",
|
|
4819
|
+
phase: "connecting_service",
|
|
4767
4820
|
text: input.waitingMessage
|
|
4768
4821
|
});
|
|
4769
4822
|
progressStartedByWait = true;
|
|
@@ -4812,6 +4865,10 @@ async function connectPrepareSessionStream(input) {
|
|
|
4812
4865
|
let closedError = null;
|
|
4813
4866
|
let stateWriteSent = false;
|
|
4814
4867
|
let pendingStepWriteFallbackFrame = null;
|
|
4868
|
+
let supportsConnectionProgress = false;
|
|
4869
|
+
const progressOperationId = crypto.randomUUID();
|
|
4870
|
+
const progressStartedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4871
|
+
let progressSequence = 0;
|
|
4815
4872
|
const assertStreamOpen = () => {
|
|
4816
4873
|
if (closedError) throw closedError;
|
|
4817
4874
|
};
|
|
@@ -4848,6 +4905,10 @@ async function connectPrepareSessionStream(input) {
|
|
|
4848
4905
|
handleServerErrorFrame(frame.payload);
|
|
4849
4906
|
return;
|
|
4850
4907
|
}
|
|
4908
|
+
if (frame.type === "server.capabilities") {
|
|
4909
|
+
supportsConnectionProgress = frame.payload.connectionProgress === 1;
|
|
4910
|
+
return;
|
|
4911
|
+
}
|
|
4851
4912
|
if (frame.type !== "snapshot" && frame.type !== "snapshot_changed") return;
|
|
4852
4913
|
pendingStepWriteFallbackFrame = null;
|
|
4853
4914
|
const snapshot = frame.payload.snapshot;
|
|
@@ -4918,6 +4979,29 @@ async function connectPrepareSessionStream(input) {
|
|
|
4918
4979
|
}
|
|
4919
4980
|
});
|
|
4920
4981
|
},
|
|
4982
|
+
writeConnectionProgress: (progress) => {
|
|
4983
|
+
if (!supportsConnectionProgress) return;
|
|
4984
|
+
const snapshot = latestSnapshot;
|
|
4985
|
+
const connectionEpoch = snapshot?.terminalConnection.connectionEpoch;
|
|
4986
|
+
if (!(snapshot && connectionEpoch)) return;
|
|
4987
|
+
sendFrame({
|
|
4988
|
+
type: "terminal.connection_progress.write",
|
|
4989
|
+
payload: {
|
|
4990
|
+
schemaVersion: 1,
|
|
4991
|
+
operationId: progressOperationId,
|
|
4992
|
+
attemptId: progressOperationId,
|
|
4993
|
+
prepareSessionId: snapshot.prepareSessionId,
|
|
4994
|
+
connectionEpoch,
|
|
4995
|
+
sequence: progressSequence++,
|
|
4996
|
+
startedAt: progressStartedAt,
|
|
4997
|
+
observedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4998
|
+
phase: progress.phase,
|
|
4999
|
+
state: progress.state,
|
|
5000
|
+
code: progress.code,
|
|
5001
|
+
...progress.detail ? { detail: progress.detail.slice(0, 512) } : {}
|
|
5002
|
+
}
|
|
5003
|
+
});
|
|
5004
|
+
},
|
|
4921
5005
|
writeTerminalLocalAgentCatalog: (catalog) => {
|
|
4922
5006
|
if (!latestSnapshot) throw new Error("Setup session snapshot is not available yet.");
|
|
4923
5007
|
stateWriteSent = true;
|
|
@@ -5003,6 +5087,12 @@ function emitHumanSection(input, title) {
|
|
|
5003
5087
|
});
|
|
5004
5088
|
}
|
|
5005
5089
|
function emitPrepareProgressLine(input, progress) {
|
|
5090
|
+
writeConnectionProgressObservation(input, {
|
|
5091
|
+
code: progress.code ?? `prepare.session.progress.${progress.state}`,
|
|
5092
|
+
phase: progress.phase ?? "confirming",
|
|
5093
|
+
state: progress.state === "success" ? "completed" : "active",
|
|
5094
|
+
text: progress.text
|
|
5095
|
+
});
|
|
5006
5096
|
createPrepareProgressReporter(input).line({
|
|
5007
5097
|
code: progress.code ?? `prepare.session.progress.${progress.state}`,
|
|
5008
5098
|
data: progress.data,
|
|
@@ -5010,18 +5100,83 @@ function emitPrepareProgressLine(input, progress) {
|
|
|
5010
5100
|
text: progress.text
|
|
5011
5101
|
});
|
|
5012
5102
|
}
|
|
5013
|
-
function emitPrepareProgressDetail(input, text, code) {
|
|
5103
|
+
function emitPrepareProgressDetail(input, text, code, phase = "confirming") {
|
|
5104
|
+
writeConnectionProgressObservation(input, {
|
|
5105
|
+
code: code ?? "prepare.session.progress.detail",
|
|
5106
|
+
phase,
|
|
5107
|
+
state: "active",
|
|
5108
|
+
text
|
|
5109
|
+
});
|
|
5014
5110
|
createPrepareProgressReporter(input).detail({
|
|
5015
5111
|
code: code ?? "prepare.session.progress.detail",
|
|
5016
5112
|
text
|
|
5017
5113
|
});
|
|
5018
5114
|
}
|
|
5019
5115
|
function startPrepareProgressStep(input, progress) {
|
|
5020
|
-
|
|
5116
|
+
writeConnectionProgressObservation(input, {
|
|
5117
|
+
code: progress.code,
|
|
5118
|
+
phase: progress.phase,
|
|
5119
|
+
state: "active",
|
|
5120
|
+
text: progress.text
|
|
5121
|
+
});
|
|
5122
|
+
const handle = createPrepareProgressReporter(input).startStep({
|
|
5021
5123
|
code: progress.code,
|
|
5022
5124
|
data: progress.data,
|
|
5023
5125
|
text: progress.text
|
|
5024
5126
|
});
|
|
5127
|
+
return {
|
|
5128
|
+
cancel: handle.cancel,
|
|
5129
|
+
complete: (message) => {
|
|
5130
|
+
handle.complete(message);
|
|
5131
|
+
writeConnectionProgressObservation(input, {
|
|
5132
|
+
code: `${progress.code}.completed`,
|
|
5133
|
+
phase: progress.phase,
|
|
5134
|
+
state: "completed",
|
|
5135
|
+
text: message ?? progress.text
|
|
5136
|
+
});
|
|
5137
|
+
},
|
|
5138
|
+
detail: (detail) => {
|
|
5139
|
+
handle.detail(detail);
|
|
5140
|
+
writeConnectionProgressObservation(input, {
|
|
5141
|
+
code: detail.code ?? `${progress.code}.detail`,
|
|
5142
|
+
phase: progress.phase,
|
|
5143
|
+
state: "active",
|
|
5144
|
+
text: detail.text
|
|
5145
|
+
});
|
|
5146
|
+
},
|
|
5147
|
+
fail: (message) => {
|
|
5148
|
+
handle.fail(message);
|
|
5149
|
+
writeConnectionProgressObservation(input, {
|
|
5150
|
+
code: `${progress.code}.failed`,
|
|
5151
|
+
phase: "needs_attention",
|
|
5152
|
+
state: "failed",
|
|
5153
|
+
text: message ?? progress.text
|
|
5154
|
+
});
|
|
5155
|
+
}
|
|
5156
|
+
};
|
|
5157
|
+
}
|
|
5158
|
+
function writeConnectionProgressObservation(input, progress) {
|
|
5159
|
+
try {
|
|
5160
|
+
input.connectedStream?.writeConnectionProgress?.({
|
|
5161
|
+
code: progress.code,
|
|
5162
|
+
detail: progress.text,
|
|
5163
|
+
phase: progress.phase,
|
|
5164
|
+
state: progress.state
|
|
5165
|
+
});
|
|
5166
|
+
} catch {}
|
|
5167
|
+
}
|
|
5168
|
+
function resolveTerminalStepProgressPhase(stepId) {
|
|
5169
|
+
switch (stepId) {
|
|
5170
|
+
case "computer":
|
|
5171
|
+
case "connect_terminal":
|
|
5172
|
+
case "refresh_service": return "connecting_service";
|
|
5173
|
+
case "choose_local_agents":
|
|
5174
|
+
case "prepare_selected_agents":
|
|
5175
|
+
case "report_runtime":
|
|
5176
|
+
case "verify_setup": return "confirming";
|
|
5177
|
+
case "ready": return "connected";
|
|
5178
|
+
default: return "connecting_service";
|
|
5179
|
+
}
|
|
5025
5180
|
}
|
|
5026
5181
|
function createPrepareProgressReporter(input) {
|
|
5027
5182
|
return createSetupProgressReporter({
|
|
@@ -5093,4 +5248,4 @@ function errorFromPrepareSessionServerError(input) {
|
|
|
5093
5248
|
//#endregion
|
|
5094
5249
|
export { mintPrepareSessionReconnectToken as A, buildNoLocalAgentsNoticeLines as C, recoverInterruptedComputerAuthHandoff as D, formatComputerAuthCleanupFailureSuffix as E, exchangeComputerAuthorizationGrant as O, buildLocalAgentsGuideUrl as S, emitUnusedSetupSessionCleanupWarning as T, runStartLocalAgentsEnable as _, assertSetupServiceUpdateComplete as a, submitSelectedAgentControllerReports as b, collectObservedDeviceMetadata as c, collectStartLocalReadiness as d, runSkillsCheck as f, runSkillsUpdate as g, runSkillsUninstall as h, runPrepareSessionExecutor as i, writePrepareSessionSetupBootstrapResult as j, revokePreparedAuthSession as k, createSetupProgressReporter as l, runSkillsInstall as m, reportPrepareHandoffStopped as n, shouldForceSetupServiceRefresh as o, runSkillsEnsure as p, resolvePrepareSessionForHandoff as r, syncLocalSetupCurrentDeviceTargetFromServiceContract as s, connectPrepareSessionStream as t, resolveControllingTerminalSession as u, isCliOutputHandledError as v, confirmContinueWithoutLocalAgents as w, appendLocalAgentsGuideUrl as x, assertSelectedAgentControllerReportSubmissionsAccepted as y };
|
|
5095
5250
|
|
|
5096
|
-
//# sourceMappingURL=prepare-session-executor-
|
|
5251
|
+
//# sourceMappingURL=prepare-session-executor-BEzlM0hJ.js.map
|