glimmervoid 0.42.0 → 0.42.1
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/bin/glimmervoid.js +8 -8
- package/dist/chunks/{adapters-D2u85MEH.js → adapters-CWIHOfVo.js} +2 -2
- package/dist/chunks/{adapters-C8GfnK2r.js → adapters-DzClvFt5.js} +1 -1
- package/dist/chunks/{agent-api-cli-D7JPxNso.js → agent-api-cli-2FKWf5jj.js} +1 -1
- package/dist/chunks/{agent-api-cli-B-1MqjKc.js → agent-api-cli-Cn-g_ej_.js} +1 -1
- package/dist/chunks/{agent-api-core-PwO7fPoc.js → agent-api-core-CP4J2B39.js} +1 -1
- package/dist/chunks/{config-store-BxCW2IwK.js → config-store-Br2PY4Tg.js} +2 -2
- package/dist/chunks/config-store-DwYjz6h1.js +1 -0
- package/dist/chunks/{contracts-LXlDbl4R.js → contracts-DJqeCtR3.js} +1 -1
- package/dist/chunks/{control-messages-88sdxt-U.js → control-messages-DHDEMTLI.js} +13 -1
- package/dist/chunks/{main-DZzDU4Q4.js → main-ZpBLKI1h.js} +310 -38
- package/dist/chunks/{pair-cli-3KKNhZ22.js → pair-cli-DW5mUBZa.js} +2 -2
- package/dist/chunks/{remote-config-Ce5nN0zL.js → remote-config-DcmhRuRc.js} +1 -1
- package/dist/chunks/{settings-cli-BYY991YC.js → settings-cli-BnM9rg8B.js} +4 -4
- package/dist/chunks/{settings-readout-core-CWAhwZKN.js → settings-readout-core-2XunjdBA.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-BbqYIPwh.js → ssh-sign-cli-CmnA5lFM.js} +1 -1
- package/dist/client/assets/{index-C9wfiVqt.js → index-CBGmkbVV.js} +43 -43
- package/dist/client/assets/{index-PnaYWtoe.css → index-NhlaT6eP.css} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/config-store-BL8LDBuM.js +0 -1
|
@@ -4,9 +4,9 @@ import { a as sanitizeWorktreeName, i as safePathSegment, n as equalsIgnoringCas
|
|
|
4
4
|
import { a as packageRoot, n as cliPath, o as relayPath, r as clientDir, s as resolvePackageBin, t as bundled } from "./runtime-paths-BkeftE60.js";
|
|
5
5
|
import { $t as STATES, A as SIGN_URL_ENV, At as TeamReviewStatus, B as LinkedPr, Bt as shortSha, Ct as ReviewThreadId, Dt as TeamReviewCompareFiles, E as SESSION_DOC_BODY_CAP_BYTES, Ft as decisionAsIfApprovalRequired, G as MyPrKeepMergeableRequest, H as MyPrAutoRebase, Ht as NODE_ID_RE, I as SshSignRequest, J as MyPrMergeMethod, L as TASK_TITLE_CONTROL_CHARACTERS, Lt as hasStandingViewerApproval, Mt as TeamReviewThreadResult, Nt as TeamReviewThreadsRepository, O as SESSION_NAME_PATTERN, Ot as TeamReviewResolveResponse, Pt as canApproveAfterComment, Q as MyPrMergeWhenReadyRequest, Qt as RESTARTABLE_STATES, R as TaskTitle, S as ConversationQuestion, St as ReviewResult, Tt as TeamReviewActionRequest, U as MyPrCheckContext, Ut as REPO_SLUG_RE, V as MyPr, Vt as GH_SEGMENT, W as MyPrCheckContextsResponse, Wt as repoParts, Xt as KILLABLE_STATES, Y as MyPrMergeRequest, Yt as BADGE_LABELS, Z as MyPrMergeStateResponse, Zt as MERGEABLE_LIVE_STATES, _ as CONVERSATION_TOOL_RESULT_HOOK_EVENT, _t as QueuedReview, bt as ReviewDraft, dt as EarlierReview, ft as FindingSeverity, g as CONVERSATION_PERMISSION_HOOK_EVENT, gt as PrDetail, h as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, ht as PostingPlan, it as MyPrsState, j as SSH_SIGN_BODY_CAP_BYTES, jt as TeamReviewThreadCommentsResponse, k as SESSION_NAME_RULE_TEXT, kt as TeamReviewStateEntry, lt as CommitSha, m as COHERENCE_HOOKS_INACTIVE, mt as GithubReviewState, n as AGENT_URL_ENV, nt as MyPrThreadsResponse, q as MyPrLaneEntry, r as ASK_USER_QUESTION_TOOL_NAME, rt as MyPrsSnapshot, tt as MyPrThreadNode, ut as DECIDING_REVIEW_STATES, w as RefinedTaskTitle, wt as ReviewVerdict, xt as ReviewFinding, yt as ReviewComment, zt as HEX_SHA_RE } from "./session-3eSP3t1i.js";
|
|
6
6
|
import { n as execFileAsync, o as spawn, r as execFileSync, t as execFile } from "./child-process-safe-D4hyVIXj.js";
|
|
7
|
-
import { At as planTitle, C as GithubPrsFrame, Ct as PLAN_HOOK_EVENT, D as WorkflowsSettings, Dt as PlanDecision, E as WorkflowLabelName, Et as PLAN_TOOL_NAME, Ft as IssuesSearchResponse, It as IssuesState, L as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, Lt as IssuesStatus, Mt as GithubIssueResponse, Nt as IssueKey, Ot as PlanRevision, Pt as IssueUpdate, Rt as issuePullRequestStateFromGithub, S as GithubPrLightSearchNode, St as PLAN_BODY_CAP_BYTES, T as WorkflowCommentBody, Tt as PLAN_RESULT_HOOK_EVENT, _ as MergedPrListing, _t as TraceCheckpoint, b as GithubPrDetailNode, bt as ChangeMap, c as pullRequestKeyFromReference, d as BenchmarkId, f as BenchmarkJudgement, g as CommitComparison, gt as MAX_RAW_LINE_CHARS, h as BenchmarkSuite, ht as SessionSetup, i as DIFF_ANNOTATION_NOTE_MAX_CHARS, jt as GithubIssuePullRequestsRepository, k as WorkflowsState, kt as parseExitPlanModeHookPayload, l as BenchmarkActionRequest, m as BenchmarkStatus, mt as UpdateJournal, n as ClientMessage, p as BenchmarkRun, rt as USAGE_INTEGER_RANGES, t as CONTROL_FRAME_MAX_BYTES, u as BenchmarkCase, v as MinedPrReviewData, vt as TraceRecord, w as comparablePrKey, wt as PLAN_HOOK_OUTPUT_MAX_CHARS, x as GithubPrKey, xt as changeMapFactId, y as PrCheckoutCaseInput, yt as CoherenceJournalOutput } from "./control-messages-
|
|
7
|
+
import { At as planTitle, C as GithubPrsFrame, Ct as PLAN_HOOK_EVENT, D as WorkflowsSettings, Dt as PlanDecision, E as WorkflowLabelName, Et as PLAN_TOOL_NAME, Ft as IssuesSearchResponse, It as IssuesState, L as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, Lt as IssuesStatus, Mt as GithubIssueResponse, Nt as IssueKey, Ot as PlanRevision, Pt as IssueUpdate, Rt as issuePullRequestStateFromGithub, S as GithubPrLightSearchNode, St as PLAN_BODY_CAP_BYTES, T as WorkflowCommentBody, Tt as PLAN_RESULT_HOOK_EVENT, _ as MergedPrListing, _t as TraceCheckpoint, b as GithubPrDetailNode, bt as ChangeMap, c as pullRequestKeyFromReference, d as BenchmarkId, f as BenchmarkJudgement, g as CommitComparison, gt as MAX_RAW_LINE_CHARS, h as BenchmarkSuite, ht as SessionSetup, i as DIFF_ANNOTATION_NOTE_MAX_CHARS, jt as GithubIssuePullRequestsRepository, k as WorkflowsState, kt as parseExitPlanModeHookPayload, l as BenchmarkActionRequest, m as BenchmarkStatus, mt as UpdateJournal, n as ClientMessage, p as BenchmarkRun, rt as USAGE_INTEGER_RANGES, t as CONTROL_FRAME_MAX_BYTES, u as BenchmarkCase, v as MinedPrReviewData, vt as TraceRecord, w as comparablePrKey, wt as PLAN_HOOK_OUTPUT_MAX_CHARS, x as GithubPrKey, xt as changeMapFactId, y as PrCheckoutCaseInput, yt as CoherenceJournalOutput } from "./control-messages-DHDEMTLI.js";
|
|
8
8
|
import { a as permitsHelpCommand, r as describeSessionLimits } from "./session-routes-B2oSzmQn.js";
|
|
9
|
-
import { a as decideSpawnAllowance, c as describeKeptChildAttention, d as describeUnpushedCloseRefusal, h as projectReviews, i as decideAgentRequest, l as describePushLanding, m as projectMyPrs, n as REFUSAL_REASON, o as deriveChildSessionName, p as parseAgentVerb, s as describeChildEndNote, u as describeRoleRefusal } from "./agent-api-core-
|
|
9
|
+
import { a as decideSpawnAllowance, c as describeKeptChildAttention, d as describeUnpushedCloseRefusal, h as projectReviews, i as decideAgentRequest, l as describePushLanding, m as projectMyPrs, n as REFUSAL_REASON, o as deriveChildSessionName, p as parseAgentVerb, s as describeChildEndNote, u as describeRoleRefusal } from "./agent-api-core-CP4J2B39.js";
|
|
10
10
|
import { n as glimmervoidHomeDir, t as decideConfigPath } from "./config-path-core-DFt-TemS.js";
|
|
11
11
|
import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-DqagvnAZ.js";
|
|
12
12
|
import { n as checkGuardrailsDependencies, t as allowGuardedSpawn } from "./guardrails-deps-BjPzk1rE.js";
|
|
@@ -21,13 +21,13 @@ import { n as DEFAULT_MAX_MS, r as nextBackoffMs, t as DEFAULT_BASE_MS } from ".
|
|
|
21
21
|
import { n as unrefTimer, t as DEFAULT_TIMER_FNS } from "./timer-deps-u2DAQLok.js";
|
|
22
22
|
import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
|
|
23
23
|
import { C as parseCgroupBytes, S as memoryReserveBytes, T as parseMemAvailableBytes, _ as createSpawnGate, a as jsonStateLoadError, b as cgroupLimitBytes, c as loadedJsonValue, d as writeJsonAtomicSync, f as writeTextAtomic, g as createSerialQueue, h as createMemoryAdmission, i as createJsonStateWriter, m as createKeyedSerialQueue, n as appendJsonLines, o as loadJsonStateFile, p as writeTextAtomicSync, r as createJsonStateStore, s as loadJsonStateFileSync, t as appendJsonLine, u as writeJsonAtomic, v as isQueueAdmissionTimeout, w as parseCgroupV2Path, x as headroomFromReadings, y as cgroupAncestorPaths } from "./json-file-DFCTvPjj.js";
|
|
24
|
-
import { $ as DEFAULT_BRANCH_GC_PREFIXES, B as buildExceptionProperties, F as TELEMETRY_BATCH_URL, G as exceptionFingerprint, H as decideIsDevInstall, I as TELEMETRY_FLAGS_URL, J as resolveProjectToken, K as nodeMajorVersion, L as adapterBucket, P as FIRST_RUN_NOTICE, R as buildAiGenerationEvents, U as decideRemoteTelemetryState, V as classifySessionExit, W as decideTelemetryConsent, Z as stableConfigKey, a as generateProjectId, at as worktreeIntegrationTips, b as validateSettingsBlock, ct as isSameDirectoryPath, d as assetForPlatform, et as matchedPrefix, f as decideRtkInstall, g as verifyDigest, h as isRtkBinaryName, i as ensureProjectIds, it as usablePrefixes, m as installTargetPath, n as DEFAULT_CONFIG, nt as planWorktreeGc, o as glimmervoidHomeDir$1, ot as canonicalizePath, p as findEscapingArchiveMember, q as parsePosthogReleaseId, r as createConfigStore, rt as sessionIdFromBranch, st as comparableDirectoryPath, t as ABORT_CONFIG_SAVE, tt as planBranchGc, v as mergeSettingsBlock, y as settingsBlockSpecFor, z as buildBrowserExceptionProperties } from "./config-store-
|
|
25
|
-
import { E as USAGE_VENDOR_KEYS, T as USAGE_COST_MODES, _ as PersistedTaskTitle, a as parseDataClientMessage, b as configIssueMessage, c as PendingCrashReport, d as TelemetryState, g as ConfigUpdate, i as parseDataAttachHistory, l as TELEMETRY_EVENT_SCHEMAS, m as BrowserConfig, n as HookEnvelope, o as DashboardTelemetryReport, r as DEEP_HISTORY_SCROLLBACK_LINES, t as HTTP_URL_RE, v as RUNTIME_CONFIG_SCALAR_KEYS, y as TASK_TITLE_SOURCE_PRIORITY } from "./contracts-
|
|
26
|
-
import { A as dedupeCodexFiles, B as shouldPersistWarehouse, C as shortSha$1, D as codexSessionIdFromPath, E as codexRootCandidates, F as passOutcome, H as claudeCode, I as projectDirCandidates, L as resolveProjectsDirs, M as grokHomes, N as grokRootCandidates, O as continuationDelayMs, P as isUsageFile, R as scopedClaudeRoots, S as parseResolvedSha, T as codexHomes, V as splitLines$1, _ as isCheckFresh, a as describeAgentResolvability, b as parseRegistryDeprecation, c as isKnownAgentId, d as resolveAdapter, f as setCustomAgents, g as decideUpdateStatus, h as decideInstallFlavor, i as customAgentFingerprint, j as expandTilde, k as decideFileRead, l as listAgentIds, m as readHostCodexVersion, n as cachedAgentResolvability, o as getAdapter, p as codex, r as commandFor, s as hookProfileOf, t as DEFAULT_AGENT_ID, u as resetCommandCache, v as normalizeSha, w as codexFallbackRoots, x as parseRegistryLatest, y as normalizeUpdateChannel, z as shouldEvaluateDespiteIoFailures } from "./adapters-
|
|
24
|
+
import { $ as DEFAULT_BRANCH_GC_PREFIXES, B as buildExceptionProperties, F as TELEMETRY_BATCH_URL, G as exceptionFingerprint, H as decideIsDevInstall, I as TELEMETRY_FLAGS_URL, J as resolveProjectToken, K as nodeMajorVersion, L as adapterBucket, P as FIRST_RUN_NOTICE, R as buildAiGenerationEvents, U as decideRemoteTelemetryState, V as classifySessionExit, W as decideTelemetryConsent, Z as stableConfigKey, a as generateProjectId, at as worktreeIntegrationTips, b as validateSettingsBlock, ct as isSameDirectoryPath, d as assetForPlatform, et as matchedPrefix, f as decideRtkInstall, g as verifyDigest, h as isRtkBinaryName, i as ensureProjectIds, it as usablePrefixes, m as installTargetPath, n as DEFAULT_CONFIG, nt as planWorktreeGc, o as glimmervoidHomeDir$1, ot as canonicalizePath, p as findEscapingArchiveMember, q as parsePosthogReleaseId, r as createConfigStore, rt as sessionIdFromBranch, st as comparableDirectoryPath, t as ABORT_CONFIG_SAVE, tt as planBranchGc, v as mergeSettingsBlock, y as settingsBlockSpecFor, z as buildBrowserExceptionProperties } from "./config-store-Br2PY4Tg.js";
|
|
25
|
+
import { E as USAGE_VENDOR_KEYS, T as USAGE_COST_MODES, _ as PersistedTaskTitle, a as parseDataClientMessage, b as configIssueMessage, c as PendingCrashReport, d as TelemetryState, g as ConfigUpdate, i as parseDataAttachHistory, l as TELEMETRY_EVENT_SCHEMAS, m as BrowserConfig, n as HookEnvelope, o as DashboardTelemetryReport, r as DEEP_HISTORY_SCROLLBACK_LINES, t as HTTP_URL_RE, v as RUNTIME_CONFIG_SCALAR_KEYS, y as TASK_TITLE_SOURCE_PRIORITY } from "./contracts-DJqeCtR3.js";
|
|
26
|
+
import { A as dedupeCodexFiles, B as shouldPersistWarehouse, C as shortSha$1, D as codexSessionIdFromPath, E as codexRootCandidates, F as passOutcome, H as claudeCode, I as projectDirCandidates, L as resolveProjectsDirs, M as grokHomes, N as grokRootCandidates, O as continuationDelayMs, P as isUsageFile, R as scopedClaudeRoots, S as parseResolvedSha, T as codexHomes, V as splitLines$1, _ as isCheckFresh, a as describeAgentResolvability, b as parseRegistryDeprecation, c as isKnownAgentId, d as resolveAdapter, f as setCustomAgents, g as decideUpdateStatus, h as decideInstallFlavor, i as customAgentFingerprint, j as expandTilde, k as decideFileRead, l as listAgentIds, m as readHostCodexVersion, n as cachedAgentResolvability, o as getAdapter, p as codex, r as commandFor, s as hookProfileOf, t as DEFAULT_AGENT_ID, u as resetCommandCache, v as normalizeSha, w as codexFallbackRoots, x as parseRegistryLatest, y as normalizeUpdateChannel, z as shouldEvaluateDespiteIoFailures } from "./adapters-CWIHOfVo.js";
|
|
27
27
|
import { t as HOOK_TOOLS } from "./hook-tools-Dl7-r2Eb.js";
|
|
28
28
|
import { a as formatSshPublicKey, c as orderAgentSockets, i as commitSigningShimText, l as parseSshPublicKey, n as NO_AGENT_HOLDS_KEY, o as isForwardedAgentDirName, r as agentListsKey, s as isSignableGitObject, t as COMMIT_SIGNING_SHIM_NAME } from "./ssh-signing-core-CRhVVWNW.js";
|
|
29
|
-
import { a as configSiblingPath, c as defaultPairingsPath, d as decideDeviceAuth, f as deviceNameFromUserAgent, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, p as hashSecret, r as validateRemoteConfig, s as createSeenStore, t as decideBindHost, u as DEFAULT_DEVICE_MAX_AGE_MS } from "./remote-config-
|
|
30
|
-
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-
|
|
29
|
+
import { a as configSiblingPath, c as defaultPairingsPath, d as decideDeviceAuth, f as deviceNameFromUserAgent, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, p as hashSecret, r as validateRemoteConfig, s as createSeenStore, t as decideBindHost, u as DEFAULT_DEVICE_MAX_AGE_MS } from "./remote-config-DcmhRuRc.js";
|
|
30
|
+
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-2XunjdBA.js";
|
|
31
31
|
import { _ as escapeMarkup, g as createLaneLog, n as createVisionsSetup } from "./visions-setup-DB2P8JUL.js";
|
|
32
32
|
import { t as getRtkPath } from "./rtk-resolver-BDHi6RMv.js";
|
|
33
33
|
import { createRequire } from "node:module";
|
|
@@ -20062,6 +20062,10 @@ var Session = class extends EventEmitter {
|
|
|
20062
20062
|
this._output.push(data);
|
|
20063
20063
|
if (this.listenerCount("data") > 0) this.emit("data", data);
|
|
20064
20064
|
}
|
|
20065
|
+
_isExitHeadedForFailure(event) {
|
|
20066
|
+
if (this.state === STATES.FAILED) return false;
|
|
20067
|
+
return TRANSITIONS[this.state]?.[event] === STATES.FAILED;
|
|
20068
|
+
}
|
|
20065
20069
|
_handleSpawnedPtyExit(guardrailsLaunch, exitCode, signal) {
|
|
20066
20070
|
this._disposeGuardrailsLaunch(guardrailsLaunch);
|
|
20067
20071
|
this._stopConversationBridge();
|
|
@@ -20081,6 +20085,11 @@ var Session = class extends EventEmitter {
|
|
|
20081
20085
|
if (pid) this._exitReap = this._reapTreeOnce(pid);
|
|
20082
20086
|
const { event, detail } = decideExitTransition(this.state, exitCode, signal, this._receivedFirstOutput);
|
|
20083
20087
|
const reason = detail.reason || null;
|
|
20088
|
+
const pendingRemoteExitReason = this._isExitHeadedForFailure(event) ? this._getRemoteLaunch()?.describeExit().catch(() => null) : void 0;
|
|
20089
|
+
if (pendingRemoteExitReason) {
|
|
20090
|
+
const remoteExitReason = await pendingRemoteExitReason;
|
|
20091
|
+
if (remoteExitReason && this._isExitHeadedForFailure(event)) this.failureReason = remoteExitReason;
|
|
20092
|
+
}
|
|
20084
20093
|
this.transition(event, detail);
|
|
20085
20094
|
if (this._recorder) {
|
|
20086
20095
|
this._recorder.writeFooter("pty_exit", exitCode);
|
|
@@ -29812,6 +29821,26 @@ function coderErrorDetail(stderr) {
|
|
|
29812
29821
|
function isCoderSignedOutError(stderr) {
|
|
29813
29822
|
return typeof stderr === "string" && stderr.includes("You are signed out or your session has expired");
|
|
29814
29823
|
}
|
|
29824
|
+
function remoteWorkRefusal({ uncommittedStatus, unpushedLog, stashList, branch, workspace }) {
|
|
29825
|
+
if (uncommittedStatus.trim()) return `Branch ${branch} in Coder workspace ${workspace} has uncommitted changes`;
|
|
29826
|
+
if (unpushedLog.trim()) return `Branch ${branch} in Coder workspace ${workspace} has commits that are not pushed`;
|
|
29827
|
+
if (stashList.trim()) return `Branch ${branch} in Coder workspace ${workspace} has stashed changes`;
|
|
29828
|
+
return null;
|
|
29829
|
+
}
|
|
29830
|
+
var describeStoppedExit = (workspace) => `Coder workspace ${workspace} stopped, by its idle stop or its stop-after limit. Restart to start it again.`;
|
|
29831
|
+
var describeDeletedExit = (workspace) => `Coder workspace ${workspace} was deleted. Restart to get a fresh workspace.`;
|
|
29832
|
+
var REMOTE_EXIT_REASON_BY_STATUS = {
|
|
29833
|
+
stopped: describeStoppedExit,
|
|
29834
|
+
stopping: describeStoppedExit,
|
|
29835
|
+
deleting: describeDeletedExit,
|
|
29836
|
+
gone: describeDeletedExit,
|
|
29837
|
+
failed: (workspace) => `Coder workspace ${workspace} failed. Restart to get a fresh workspace.`
|
|
29838
|
+
};
|
|
29839
|
+
function remoteExitReason({ workspace, status }) {
|
|
29840
|
+
const describeExit = status === null ? void 0 : REMOTE_EXIT_REASON_BY_STATUS[status];
|
|
29841
|
+
if (describeExit) return describeExit(workspace);
|
|
29842
|
+
return `The connection to Coder workspace ${workspace} was lost. Restart to reconnect.`;
|
|
29843
|
+
}
|
|
29815
29844
|
function coderNotSignedInReason(failure) {
|
|
29816
29845
|
return `The coder CLI on this host is not signed in. Run coder login, then try again. (${failure})`;
|
|
29817
29846
|
}
|
|
@@ -29904,6 +29933,10 @@ function createCoderEnvPoller({ listWorkspaces, stopWorkspace, deleteWorkspace,
|
|
|
29904
29933
|
//#endregion
|
|
29905
29934
|
//#region server/coder/coder-env-wiring.ts
|
|
29906
29935
|
var CODER_UNAVAILABLE_REASON = "Coder environments are unavailable on this host";
|
|
29936
|
+
var REMOTE_SESSIONS_OFF_REFUSAL = {
|
|
29937
|
+
ok: false,
|
|
29938
|
+
reason: "Remote Coder sessions are off. Turn on Remote Coder sessions (experimental) in Settings."
|
|
29939
|
+
};
|
|
29907
29940
|
function createCoderEnvWiring({ config, persistMapping, onReconciled = () => {}, loadOwnedWorkspaces, saveOwnedWorkspaces, runCoder: executeCoder, env = process.env, platform = process.platform, fetch: fetchReady = globalThis.fetch, createPoller = createCoderEnvPoller, now = Date.now, log = console, ...pollerDeps }) {
|
|
29908
29941
|
let binaryProbe = null;
|
|
29909
29942
|
let isCoderAvailable = false;
|
|
@@ -29914,6 +29947,7 @@ function createCoderEnvWiring({ config, persistMapping, onReconciled = () => {},
|
|
|
29914
29947
|
const lastSeenStatusByWorkspace = /* @__PURE__ */ new Map();
|
|
29915
29948
|
const provisionByProject = /* @__PURE__ */ new Map();
|
|
29916
29949
|
const failedProvisionByProject = /* @__PURE__ */ new Map();
|
|
29950
|
+
const renewalByProject = /* @__PURE__ */ new Map();
|
|
29917
29951
|
const setTimeoutFn = pollerDeps.setTimeoutFn ?? DEFAULT_TIMER_FNS.setTimeoutFn;
|
|
29918
29952
|
let ownedWorkspaces = /* @__PURE__ */ new Set([...loadOwnedWorkspaces(), ...currentMappings().map((mapping) => mapping.workspace)]);
|
|
29919
29953
|
let ownedSaveChain = Promise.resolve();
|
|
@@ -30001,18 +30035,29 @@ function createCoderEnvWiring({ config, persistMapping, onReconciled = () => {},
|
|
|
30001
30035
|
if (workspaces !== null) await pruneOwned(workspaces);
|
|
30002
30036
|
return listingJson;
|
|
30003
30037
|
}
|
|
30004
|
-
async function listWorkspaces() {
|
|
30038
|
+
async function listWorkspaces(timeoutMs) {
|
|
30005
30039
|
const workspaces = recordListing((await command([
|
|
30006
30040
|
"list",
|
|
30007
30041
|
"-o",
|
|
30008
30042
|
"json"
|
|
30009
|
-
])).stdout);
|
|
30043
|
+
], timeoutMs)).stdout);
|
|
30010
30044
|
if (workspaces === null) throw new Error("Invalid Coder workspace listing");
|
|
30011
30045
|
return workspaces;
|
|
30012
30046
|
}
|
|
30013
30047
|
function workspaceStatus(workspace) {
|
|
30014
30048
|
return lastSeenStatusByWorkspace.get(workspace) ?? null;
|
|
30015
30049
|
}
|
|
30050
|
+
async function describeRemoteExit(workspace) {
|
|
30051
|
+
const workspaces = await listWorkspaces(1e4).catch(() => null);
|
|
30052
|
+
if (workspaces === null) return remoteExitReason({
|
|
30053
|
+
workspace,
|
|
30054
|
+
status: null
|
|
30055
|
+
});
|
|
30056
|
+
return remoteExitReason({
|
|
30057
|
+
workspace,
|
|
30058
|
+
status: workspaces.find((candidate) => candidate.name === workspace)?.status ?? "gone"
|
|
30059
|
+
});
|
|
30060
|
+
}
|
|
30016
30061
|
function isConfigured() {
|
|
30017
30062
|
return Boolean(config.coder?.environments?.length) && (platform === "linux" || platform === "darwin");
|
|
30018
30063
|
}
|
|
@@ -30185,10 +30230,7 @@ function createCoderEnvWiring({ config, persistMapping, onReconciled = () => {},
|
|
|
30185
30230
|
};
|
|
30186
30231
|
}
|
|
30187
30232
|
async function reserve({ projectId, environmentName, branch, liveCount }) {
|
|
30188
|
-
if (config.remoteSessions !== true) return
|
|
30189
|
-
ok: false,
|
|
30190
|
-
reason: "Remote Coder sessions are off. Turn on Remote Coder sessions (experimental) in Settings."
|
|
30191
|
-
};
|
|
30233
|
+
if (config.remoteSessions !== true) return REMOTE_SESSIONS_OFF_REFUSAL;
|
|
30192
30234
|
const environment = resolveEnvironment(environmentName);
|
|
30193
30235
|
if (!environment) return {
|
|
30194
30236
|
ok: false,
|
|
@@ -30211,6 +30253,12 @@ function createCoderEnvWiring({ config, persistMapping, onReconciled = () => {},
|
|
|
30211
30253
|
ok: false,
|
|
30212
30254
|
reason: unavailableReason
|
|
30213
30255
|
};
|
|
30256
|
+
return freshMapping({
|
|
30257
|
+
environmentName,
|
|
30258
|
+
branch
|
|
30259
|
+
});
|
|
30260
|
+
}
|
|
30261
|
+
function freshMapping({ environmentName, branch }) {
|
|
30214
30262
|
const workspace = workspaceNameFromHex(randomBytes(6).toString("hex"));
|
|
30215
30263
|
if (workspace === null) return {
|
|
30216
30264
|
ok: false,
|
|
@@ -30226,6 +30274,74 @@ function createCoderEnvWiring({ config, persistMapping, onReconciled = () => {},
|
|
|
30226
30274
|
}
|
|
30227
30275
|
};
|
|
30228
30276
|
}
|
|
30277
|
+
function renew(request) {
|
|
30278
|
+
if (config.remoteSessions !== true) return Promise.resolve(REMOTE_SESSIONS_OFF_REFUSAL);
|
|
30279
|
+
const inFlightRenewal = renewalByProject.get(request.projectId);
|
|
30280
|
+
if (inFlightRenewal) return inFlightRenewal;
|
|
30281
|
+
const renewal = renewUnclaimed(request);
|
|
30282
|
+
renewalByProject.set(request.projectId, renewal);
|
|
30283
|
+
renewal.finally(() => renewalByProject.delete(request.projectId));
|
|
30284
|
+
return renewal;
|
|
30285
|
+
}
|
|
30286
|
+
async function renewUnclaimed({ projectId, repoRemoteUrl, baseBranch, liveCount }) {
|
|
30287
|
+
if (provisionByProject.has(projectId)) return {
|
|
30288
|
+
ok: true,
|
|
30289
|
+
renewed: false
|
|
30290
|
+
};
|
|
30291
|
+
const mapping = config.projects.find((project) => project.id === projectId)?.environment;
|
|
30292
|
+
if (!mapping) return {
|
|
30293
|
+
ok: false,
|
|
30294
|
+
reason: `Project ${projectId} has no Coder workspace mapping`
|
|
30295
|
+
};
|
|
30296
|
+
if (!failedProvisionByProject.has(projectId) && await isWorkspaceListed(mapping.workspace) && workspaceStatus(mapping.workspace) !== "failed") return {
|
|
30297
|
+
ok: true,
|
|
30298
|
+
renewed: false
|
|
30299
|
+
};
|
|
30300
|
+
const environment = resolveEnvironment(mapping.name);
|
|
30301
|
+
if (!environment) return {
|
|
30302
|
+
ok: false,
|
|
30303
|
+
reason: `Unknown Coder environment: ${mapping.name}`
|
|
30304
|
+
};
|
|
30305
|
+
const limitReason = liveLimitRefusal({
|
|
30306
|
+
liveCount,
|
|
30307
|
+
maxLive: environment.maxLive,
|
|
30308
|
+
environmentName: mapping.name
|
|
30309
|
+
});
|
|
30310
|
+
if (limitReason) return {
|
|
30311
|
+
ok: false,
|
|
30312
|
+
reason: limitReason
|
|
30313
|
+
};
|
|
30314
|
+
if (!await ensureAvailable()) return {
|
|
30315
|
+
ok: false,
|
|
30316
|
+
reason: unavailableReason
|
|
30317
|
+
};
|
|
30318
|
+
const fresh = freshMapping({
|
|
30319
|
+
environmentName: mapping.name,
|
|
30320
|
+
branch: mapping.branch
|
|
30321
|
+
});
|
|
30322
|
+
if (!fresh.ok) return fresh;
|
|
30323
|
+
try {
|
|
30324
|
+
await saveMapping(projectId, fresh.mapping);
|
|
30325
|
+
} catch (error) {
|
|
30326
|
+
return {
|
|
30327
|
+
ok: false,
|
|
30328
|
+
reason: `Could not save the new Coder workspace mapping: ${errorMessage(error)}`
|
|
30329
|
+
};
|
|
30330
|
+
}
|
|
30331
|
+
failedProvisionByProject.delete(projectId);
|
|
30332
|
+
provision({
|
|
30333
|
+
projectId,
|
|
30334
|
+
mapping: fresh.mapping,
|
|
30335
|
+
repoRemoteUrl,
|
|
30336
|
+
baseBranch
|
|
30337
|
+
}).then((provisioned) => {
|
|
30338
|
+
if (!provisioned.ok) log.warn(`[coder-env] fresh Coder workspace for project ${projectId} failed: ${provisioned.reason}`);
|
|
30339
|
+
});
|
|
30340
|
+
return {
|
|
30341
|
+
ok: true,
|
|
30342
|
+
renewed: true
|
|
30343
|
+
};
|
|
30344
|
+
}
|
|
30229
30345
|
function provision({ projectId, mapping, repoRemoteUrl, baseBranch }) {
|
|
30230
30346
|
const savedMapping = config.projects.find((candidate) => candidate.id === projectId)?.environment;
|
|
30231
30347
|
if (JSON.stringify(savedMapping) !== JSON.stringify(mapping)) return Promise.resolve({
|
|
@@ -30407,6 +30523,88 @@ function createCoderEnvWiring({ config, persistMapping, onReconciled = () => {},
|
|
|
30407
30523
|
}
|
|
30408
30524
|
});
|
|
30409
30525
|
}
|
|
30526
|
+
async function uncheckedRemoteWorkReason(mapping) {
|
|
30527
|
+
const environment = resolveEnvironment(mapping.name);
|
|
30528
|
+
if (!environment) throw new Error(`Unknown Coder environment: ${mapping.name}`);
|
|
30529
|
+
if (!await ensureAvailable()) throw new Error(unavailableReason);
|
|
30530
|
+
const status = (await listWorkspaces()).find((candidate) => candidate.name === mapping.workspace)?.status ?? "gone";
|
|
30531
|
+
if (status === "gone") return null;
|
|
30532
|
+
if (status !== "running") throw new Error(`Coder workspace ${mapping.workspace} is ${status}`);
|
|
30533
|
+
const checkoutDirectory = remoteCheckoutDirectory({
|
|
30534
|
+
checkoutRoot: environment.checkoutRoot,
|
|
30535
|
+
workspace: mapping.workspace
|
|
30536
|
+
});
|
|
30537
|
+
const uncommittedStatus = (await command([
|
|
30538
|
+
"ssh",
|
|
30539
|
+
mapping.workspace,
|
|
30540
|
+
"--",
|
|
30541
|
+
remoteCommand([
|
|
30542
|
+
"git",
|
|
30543
|
+
"--no-optional-locks",
|
|
30544
|
+
"-C",
|
|
30545
|
+
checkoutDirectory,
|
|
30546
|
+
"status",
|
|
30547
|
+
"--porcelain"
|
|
30548
|
+
])
|
|
30549
|
+
])).stdout;
|
|
30550
|
+
const unpushedLog = (await command([
|
|
30551
|
+
"ssh",
|
|
30552
|
+
mapping.workspace,
|
|
30553
|
+
"--",
|
|
30554
|
+
remoteCommand([
|
|
30555
|
+
"git",
|
|
30556
|
+
"-C",
|
|
30557
|
+
checkoutDirectory,
|
|
30558
|
+
"log",
|
|
30559
|
+
"--branches",
|
|
30560
|
+
"HEAD",
|
|
30561
|
+
"--not",
|
|
30562
|
+
"--remotes",
|
|
30563
|
+
"--oneline"
|
|
30564
|
+
])
|
|
30565
|
+
])).stdout;
|
|
30566
|
+
const stashList = (await command([
|
|
30567
|
+
"ssh",
|
|
30568
|
+
mapping.workspace,
|
|
30569
|
+
"--",
|
|
30570
|
+
remoteCommand([
|
|
30571
|
+
"git",
|
|
30572
|
+
"-C",
|
|
30573
|
+
checkoutDirectory,
|
|
30574
|
+
"stash",
|
|
30575
|
+
"list"
|
|
30576
|
+
])
|
|
30577
|
+
])).stdout;
|
|
30578
|
+
return remoteWorkRefusal({
|
|
30579
|
+
uncommittedStatus,
|
|
30580
|
+
unpushedLog,
|
|
30581
|
+
stashList,
|
|
30582
|
+
branch: mapping.branch,
|
|
30583
|
+
workspace: mapping.workspace
|
|
30584
|
+
});
|
|
30585
|
+
}
|
|
30586
|
+
async function remoteWorkReason(mapping) {
|
|
30587
|
+
try {
|
|
30588
|
+
return await whileWorkspaceBusy(mapping.workspace, () => uncheckedRemoteWorkReason(mapping));
|
|
30589
|
+
} catch (error) {
|
|
30590
|
+
return `Could not check remote work on ${mapping.branch} in Coder workspace ${mapping.workspace}: ${errorMessage(error)}`;
|
|
30591
|
+
}
|
|
30592
|
+
}
|
|
30593
|
+
async function settleRemoval({ projectId, discardRemoteWork }) {
|
|
30594
|
+
await provisionByProject.get(projectId);
|
|
30595
|
+
const mapping = config.projects.find((project) => project.id === projectId)?.environment;
|
|
30596
|
+
if (!mapping) return { ok: true };
|
|
30597
|
+
const keptWorkReason = discardRemoteWork ? null : await remoteWorkReason(mapping);
|
|
30598
|
+
if (keptWorkReason) return {
|
|
30599
|
+
ok: false,
|
|
30600
|
+
reason: keptWorkReason,
|
|
30601
|
+
canDiscardRemoteWork: true
|
|
30602
|
+
};
|
|
30603
|
+
release({ projectId }).then((released) => {
|
|
30604
|
+
if (!released.ok) log.warn(`[coder-env] ${released.reason}; the orphan sweep will stop ${mapping.workspace}`);
|
|
30605
|
+
});
|
|
30606
|
+
return { ok: true };
|
|
30607
|
+
}
|
|
30410
30608
|
async function uploadFile({ workspace, remotePath, contents, mode }) {
|
|
30411
30609
|
if (workspaceNameFromHex(workspace.slice(3)) !== workspace) throw new Error("Invalid Coder workspace name");
|
|
30412
30610
|
const fileMode = typeof mode === "number" ? mode.toString(8) : mode;
|
|
@@ -30436,10 +30634,13 @@ function createCoderEnvWiring({ config, persistMapping, onReconciled = () => {},
|
|
|
30436
30634
|
availableEnvironments,
|
|
30437
30635
|
reserve,
|
|
30438
30636
|
provision,
|
|
30637
|
+
renew,
|
|
30439
30638
|
resume,
|
|
30440
30639
|
release,
|
|
30640
|
+
settleRemoval,
|
|
30441
30641
|
uploadFile,
|
|
30442
|
-
workspaceStatus
|
|
30642
|
+
workspaceStatus,
|
|
30643
|
+
describeRemoteExit
|
|
30443
30644
|
};
|
|
30444
30645
|
}
|
|
30445
30646
|
var DEFAULT_INTERVAL_MS$1 = 216e5;
|
|
@@ -49108,6 +49309,7 @@ function createSessionFactory(dependencies) {
|
|
|
49108
49309
|
}),
|
|
49109
49310
|
nodePath: environment?.nodePath ?? "node",
|
|
49110
49311
|
ensureRunning: async () => coderEnv ? coderEnv.resume({ projectId }) : refusal,
|
|
49312
|
+
describeExit: async () => coderEnv ? coderEnv.describeRemoteExit(mapping.workspace) : null,
|
|
49111
49313
|
uploadFile: async (file) => {
|
|
49112
49314
|
if (!coderEnv) throw new Error(refusal.reason);
|
|
49113
49315
|
await coderEnv.uploadFile({
|
|
@@ -50755,6 +50957,12 @@ function requestValidationErrorReply(msg, message) {
|
|
|
50755
50957
|
ok: false,
|
|
50756
50958
|
error: message
|
|
50757
50959
|
}),
|
|
50960
|
+
"remove-session": () => ({
|
|
50961
|
+
type: "remove-session-result",
|
|
50962
|
+
requestId,
|
|
50963
|
+
ok: false,
|
|
50964
|
+
error: message
|
|
50965
|
+
}),
|
|
50758
50966
|
"delete-hook": () => ({
|
|
50759
50967
|
type: "delete-hook-result",
|
|
50760
50968
|
requestId,
|
|
@@ -50950,9 +51158,56 @@ function registerControlHandlers(controlWss, deps) {
|
|
|
50950
51158
|
console.log(`[control] Added session via UI: ${name}${skipPerms ? " (skip permissions)" : " (permission prompts)"}${remote ? ` (Coder environment ${remote.environment.name})` : ""}`);
|
|
50951
51159
|
return created.project;
|
|
50952
51160
|
}
|
|
50953
|
-
function
|
|
51161
|
+
async function remoteRepoSource(projectPath) {
|
|
51162
|
+
if (!remoteRepoGit) return {
|
|
51163
|
+
ok: false,
|
|
51164
|
+
error: "Coder environments are unavailable on this host"
|
|
51165
|
+
};
|
|
51166
|
+
const repoRemoteUrl = await remoteRepoGit.originUrl({ projectPath });
|
|
51167
|
+
if (!repoRemoteUrl) return {
|
|
51168
|
+
ok: false,
|
|
51169
|
+
error: `${projectPath} has no origin remote, so a Coder workspace cannot clone it.`
|
|
51170
|
+
};
|
|
51171
|
+
const baseBranch = configuredIntegrationBranch(config) ?? await remoteRepoGit.detectDefaultBranch({ projectPath });
|
|
51172
|
+
if (!baseBranch) return {
|
|
51173
|
+
ok: false,
|
|
51174
|
+
error: `Could not find the default branch of ${projectPath} on origin.`
|
|
51175
|
+
};
|
|
51176
|
+
return {
|
|
51177
|
+
ok: true,
|
|
51178
|
+
repoRemoteUrl,
|
|
51179
|
+
baseBranch
|
|
51180
|
+
};
|
|
51181
|
+
}
|
|
51182
|
+
async function restartSession(msg, ws, restart) {
|
|
51183
|
+
const sess = findSession(msg);
|
|
51184
|
+
if (!sess) return;
|
|
51185
|
+
const project = config.projects.find((candidate) => candidate.id === sess.id);
|
|
51186
|
+
if (sess.state !== STATES.FAILED || !project?.environment || !coderEnv) {
|
|
51187
|
+
restart(sess);
|
|
51188
|
+
return;
|
|
51189
|
+
}
|
|
51190
|
+
const source = await remoteRepoSource(project.path);
|
|
51191
|
+
if (!source.ok) {
|
|
51192
|
+
sendError(ws, source.error, { id: sess.id });
|
|
51193
|
+
return;
|
|
51194
|
+
}
|
|
51195
|
+
const renewal = await coderEnv.renew({
|
|
51196
|
+
projectId: project.id,
|
|
51197
|
+
repoRemoteUrl: source.repoRemoteUrl,
|
|
51198
|
+
baseBranch: source.baseBranch,
|
|
51199
|
+
liveCount: liveWorkspaceCount(project.environment.name, project.id)
|
|
51200
|
+
});
|
|
51201
|
+
if (!renewal.ok) {
|
|
51202
|
+
sendError(ws, renewal.reason, { id: sess.id });
|
|
51203
|
+
return;
|
|
51204
|
+
}
|
|
51205
|
+
restart(sess);
|
|
51206
|
+
}
|
|
51207
|
+
function liveWorkspaceCount(environmentName, excludedProjectId) {
|
|
50954
51208
|
return config.projects.filter((project) => {
|
|
50955
51209
|
if (project.environment?.name !== environmentName) return false;
|
|
51210
|
+
if (project.id === excludedProjectId) return false;
|
|
50956
51211
|
const session = sessions.get(project.id);
|
|
50957
51212
|
return session !== void 0 && session.state !== STATES.DORMANT;
|
|
50958
51213
|
}).length;
|
|
@@ -50972,17 +51227,12 @@ function registerControlHandlers(controlWss, deps) {
|
|
|
50972
51227
|
refuseAddSession(msg, ws, { error: "Coder environments are unavailable on this host" });
|
|
50973
51228
|
return;
|
|
50974
51229
|
}
|
|
50975
|
-
const
|
|
50976
|
-
|
|
50977
|
-
|
|
50978
|
-
refuseAddSession(msg, ws, { error: `${projectPath} has no origin remote, so a Coder workspace cannot clone it.` });
|
|
50979
|
-
return;
|
|
50980
|
-
}
|
|
50981
|
-
const baseBranch = configuredIntegrationBranch(config) ?? await remoteRepoGit.detectDefaultBranch({ projectPath });
|
|
50982
|
-
if (!baseBranch) {
|
|
50983
|
-
refuseAddSession(msg, ws, { error: `Could not find the default branch of ${projectPath} on origin.` });
|
|
51230
|
+
const source = await remoteRepoSource(path.resolve((msg.path || "").trim()));
|
|
51231
|
+
if (!source.ok) {
|
|
51232
|
+
refuseAddSession(msg, ws, { error: source.error });
|
|
50984
51233
|
return;
|
|
50985
51234
|
}
|
|
51235
|
+
const { repoRemoteUrl, baseBranch } = source;
|
|
50986
51236
|
const id = generateProjectId();
|
|
50987
51237
|
const reserved = await coderEnv.reserve({
|
|
50988
51238
|
projectId: id,
|
|
@@ -51041,22 +51291,46 @@ function registerControlHandlers(controlWss, deps) {
|
|
|
51041
51291
|
if (sess.state !== STATES.DORMANT) return;
|
|
51042
51292
|
sess.start();
|
|
51043
51293
|
}
|
|
51044
|
-
function
|
|
51294
|
+
async function removeSession(msg) {
|
|
51045
51295
|
const sess = findSession(msg);
|
|
51046
|
-
if (!sess) {
|
|
51047
|
-
|
|
51048
|
-
|
|
51049
|
-
}
|
|
51296
|
+
if (!sess) return {
|
|
51297
|
+
ok: false,
|
|
51298
|
+
error: "Session not found"
|
|
51299
|
+
};
|
|
51050
51300
|
if (agentSessions.get(sess.id) === sess) {
|
|
51051
51301
|
sess.destroy();
|
|
51052
51302
|
console.log(`[control] Removed spawned session via UI: ${sess.name}`);
|
|
51053
|
-
return;
|
|
51303
|
+
return { ok: true };
|
|
51304
|
+
}
|
|
51305
|
+
if (config.projects.some((project) => project.id === sess.id && project.environment) && coderEnv) {
|
|
51306
|
+
sess.killSession();
|
|
51307
|
+
const settlement = await coderEnv.settleRemoval({
|
|
51308
|
+
projectId: sess.id,
|
|
51309
|
+
discardRemoteWork: msg.discardRemoteWork === true
|
|
51310
|
+
});
|
|
51311
|
+
if (!settlement.ok) return {
|
|
51312
|
+
ok: false,
|
|
51313
|
+
error: settlement.reason,
|
|
51314
|
+
canDiscardRemoteWork: settlement.canDiscardRemoteWork
|
|
51315
|
+
};
|
|
51054
51316
|
}
|
|
51055
51317
|
const freshConfig = configStore.save((cfg) => {
|
|
51056
51318
|
cfg.projects = cfg.projects.filter((p) => p.id !== sess.id);
|
|
51057
51319
|
});
|
|
51058
51320
|
if (freshConfig) applyConfigReload(freshConfig);
|
|
51059
51321
|
console.log(`[control] Removed session via UI: ${sess.name}`);
|
|
51322
|
+
return { ok: true };
|
|
51323
|
+
}
|
|
51324
|
+
async function handleRemoveSession(msg, ws) {
|
|
51325
|
+
const removal = await removeSession(msg);
|
|
51326
|
+
if (msg.requestId) {
|
|
51327
|
+
replyTo(ws, msg, "remove-session-result", removal.ok ? {
|
|
51328
|
+
ok: true,
|
|
51329
|
+
error: null
|
|
51330
|
+
} : removal);
|
|
51331
|
+
return;
|
|
51332
|
+
}
|
|
51333
|
+
if (!removal.ok) sendError(ws, removal.error);
|
|
51060
51334
|
}
|
|
51061
51335
|
function handleRenameSession(msg, ws) {
|
|
51062
51336
|
const sess = findSession(msg);
|
|
@@ -52295,14 +52569,12 @@ function registerControlHandlers(controlWss, deps) {
|
|
|
52295
52569
|
if (s) s.killSession();
|
|
52296
52570
|
},
|
|
52297
52571
|
"start-session": handleStartSession,
|
|
52298
|
-
"restart": (msg) => {
|
|
52299
|
-
|
|
52300
|
-
|
|
52301
|
-
|
|
52302
|
-
|
|
52303
|
-
|
|
52304
|
-
if (s) s.forceRestart({ fresh: msg.fresh === true });
|
|
52305
|
-
},
|
|
52572
|
+
"restart": (msg, ws) => restartSession(msg, ws, (s) => {
|
|
52573
|
+
s.restart({ fresh: msg.fresh === true });
|
|
52574
|
+
}),
|
|
52575
|
+
"force-restart": (msg, ws) => restartSession(msg, ws, (s) => {
|
|
52576
|
+
s.forceRestart({ fresh: msg.fresh === true });
|
|
52577
|
+
}),
|
|
52306
52578
|
"dismiss": (msg) => {
|
|
52307
52579
|
const session = findSession(msg);
|
|
52308
52580
|
if (!session) return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
|
-
import { c as resolveConfigPath } from "./config-store-
|
|
3
|
-
import { c as defaultPairingsPath, i as REVOCATION_PROPAGATION_SECONDS, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, s as createSeenStore } from "./remote-config-
|
|
2
|
+
import { c as resolveConfigPath } from "./config-store-Br2PY4Tg.js";
|
|
3
|
+
import { c as defaultPairingsPath, i as REVOCATION_PROPAGATION_SECONDS, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, s as createSeenStore } from "./remote-config-DcmhRuRc.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
//#region server/text-format.ts
|
|
6
6
|
function trimIso(iso) {
|
|
@@ -3,7 +3,7 @@ import { n as equalsIgnoringCaseOnWindows } from "./paths-Bu4eH1Yd.js";
|
|
|
3
3
|
import { n as isRecord } from "./coerce-NSst8oRP.js";
|
|
4
4
|
import { n as unrefTimer, t as DEFAULT_TIMER_FNS } from "./timer-deps-u2DAQLok.js";
|
|
5
5
|
import { a as jsonStateLoadError, d as writeJsonAtomicSync, l as sleepSync, s as loadJsonStateFileSync, u as writeJsonAtomic } from "./json-file-DFCTvPjj.js";
|
|
6
|
-
import { o as glimmervoidHomeDir, ot as canonicalizePath } from "./config-store-
|
|
6
|
+
import { o as glimmervoidHomeDir, ot as canonicalizePath } from "./config-store-Br2PY4Tg.js";
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import crypto from "node:crypto";
|
|
@@ -3,9 +3,9 @@ import { d as AgentSettingsReply } from "./session-3eSP3t1i.js";
|
|
|
3
3
|
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
4
4
|
import { n as glimmervoidHomeDir, t as decideConfigPath } from "./config-path-core-DFt-TemS.js";
|
|
5
5
|
import { n as isRecord } from "./coerce-NSst8oRP.js";
|
|
6
|
-
import { C as deleteValueAtPath, D as scoreSettingsSearch, E as parsePosthogProjectSelection, N as SETTINGS_REGISTRY, O as setValueAtPath, Q as withEnvSecrets, S as cloneValue, X as readEnvSecrets, Y as ENV_SECRET_BINDINGS, j as valueAtPath, l as saveConfigFileOnce, s as loadConfigFile, u as validateConfig } from "./config-store-
|
|
7
|
-
import { m as BrowserConfig } from "./contracts-
|
|
8
|
-
import { a as fail, c as listSettings, d as renderSectionTables, f as requireConfigFileSetting, g as valueText, h as succeed, i as describeSetting, l as readSetting, m as settingsRequestForServer, n as configFileViewOf, o as fitColumn, p as sectionOf, r as defaultText, s as getSetting, t as ALL_SETTINGS } from "./settings-readout-core-
|
|
6
|
+
import { C as deleteValueAtPath, D as scoreSettingsSearch, E as parsePosthogProjectSelection, N as SETTINGS_REGISTRY, O as setValueAtPath, Q as withEnvSecrets, S as cloneValue, X as readEnvSecrets, Y as ENV_SECRET_BINDINGS, j as valueAtPath, l as saveConfigFileOnce, s as loadConfigFile, u as validateConfig } from "./config-store-Br2PY4Tg.js";
|
|
7
|
+
import { m as BrowserConfig } from "./contracts-DJqeCtR3.js";
|
|
8
|
+
import { a as fail, c as listSettings, d as renderSectionTables, f as requireConfigFileSetting, g as valueText, h as succeed, i as describeSetting, l as readSetting, m as settingsRequestForServer, n as configFileViewOf, o as fitColumn, p as sectionOf, r as defaultText, s as getSetting, t as ALL_SETTINGS } from "./settings-readout-core-2XunjdBA.js";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
import { parseArgs } from "node:util";
|
|
@@ -329,7 +329,7 @@ function processIo() {
|
|
|
329
329
|
async function runSettingsCli(commandArguments, io = processIo()) {
|
|
330
330
|
const serverRequest = settingsRequestForServer(commandArguments, process.env);
|
|
331
331
|
if (!serverRequest) return runSettingsCommand(commandArguments, io);
|
|
332
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
332
|
+
const { askAgentApi } = await import("./agent-api-cli-Cn-g_ej_.js");
|
|
333
333
|
const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
|
|
334
334
|
ok: false,
|
|
335
335
|
error: errorMessage(error)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as AgentSettingsRequest } from "./session-3eSP3t1i.js";
|
|
2
2
|
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
3
|
-
import { A as settingsOf, M as FILE_ONLY_GROUPS, N as SETTINGS_REGISTRY, S as cloneValue, T as hasScaledUnit, X as readEnvSecrets, j as valueAtPath, k as settingsGroupOf, w as displayText, x as SETTINGS_INDEX } from "./config-store-
|
|
3
|
+
import { A as settingsOf, M as FILE_ONLY_GROUPS, N as SETTINGS_REGISTRY, S as cloneValue, T as hasScaledUnit, X as readEnvSecrets, j as valueAtPath, k as settingsGroupOf, w as displayText, x as SETTINGS_INDEX } from "./config-store-Br2PY4Tg.js";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
5
|
//#region server/core/settings-readout-core.ts
|
|
6
6
|
var VALUE_COLUMN_WIDTH = 40;
|
|
@@ -2,7 +2,7 @@ import { r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { A as SIGN_URL_ENV, F as SshSignReply } from "./session-3eSP3t1i.js";
|
|
3
3
|
import { n as execFileAsync, o as spawn } from "./child-process-safe-D4hyVIXj.js";
|
|
4
4
|
import { a as isLoopbackHostname } from "./hook-relay-core-DA_bz2KA.js";
|
|
5
|
-
import { n as postToAgentIngress } from "./agent-api-cli-
|
|
5
|
+
import { n as postToAgentIngress } from "./agent-api-cli-2FKWf5jj.js";
|
|
6
6
|
import { l as parseSshPublicKey } from "./ssh-signing-core-CRhVVWNW.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import fsp from "node:fs/promises";
|