glimmervoid 0.52.2-next.682 → 0.52.2-next.683
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 +17 -17
- package/dist/chunks/{adapters-BVZYqHuD.js → adapters-B33MPRTY.js} +1 -1
- package/dist/chunks/{adapters-CIL6g9R2.js → adapters-CuQ_RvlA.js} +7 -7
- package/dist/chunks/agent-api-cli-CRUTYJQq.js +1 -0
- package/dist/chunks/{agent-api-cli-7xxfflVL.js → agent-api-cli-D4CfxnZM.js} +7 -3
- package/dist/chunks/{agent-api-core-BxJOL6Ye.js → agent-api-core-BeeBFOwI.js} +12 -3
- package/dist/chunks/{agent-setup-cli-DWGQIduP.js → agent-setup-cli-CEU_RVfh.js} +1 -1
- package/dist/chunks/{config-C43Ovt64.js → config-C8KXay7k.js} +64 -3
- package/dist/chunks/{config-store-Co0IYv_B.js → config-store-1YxK7Fcc.js} +11 -9
- package/dist/chunks/config-store-C_U_TeZA.js +1 -0
- package/dist/chunks/{grok-CstIMQXr.js → grok-TfN6HhpF.js} +2 -2
- package/dist/chunks/kimi-8LeTccgZ.js +1 -0
- package/dist/chunks/{kimi-DjNUuBkC.js → kimi-CVxsh_Id.js} +3 -3
- package/dist/chunks/{main-7iEQ-1lZ.js → main-2BCXYvF3.js} +495 -33
- package/dist/chunks/pack-bridge-DifQHfqf.js +152 -0
- package/dist/chunks/{pair-cli-Dy0bFL9m.js → pair-cli-Bo-NjR4Z.js} +2 -2
- package/dist/chunks/{pr-flows-cli-Bdt0p04k.js → pr-flows-cli-D5gjtXla.js} +14 -72
- package/dist/chunks/{pr-flows-external-CbLPEQzZ.js → pr-flows-external-BRtHbSYM.js} +372 -94
- package/dist/chunks/{remote-config-qbb1pXRE.js → remote-config-JwAqVJzu.js} +2 -2
- package/dist/chunks/{runtime-paths-CYwF658V.js → runtime-paths-DfoHzN15.js} +3 -2
- package/dist/chunks/runtime-paths-j5rMoZKx.js +1 -0
- package/dist/chunks/{session-D0gNPAv6.js → session-BrX33men.js} +17 -4
- package/dist/chunks/{settings-cli-BTzrqRKC.js → settings-cli-BG8y7lry.js} +5 -5
- package/dist/chunks/{settings-readout-core-Be3O8D0x.js → settings-readout-core-D737OjDD.js} +2 -2
- package/dist/chunks/{shown-files-core-DJ4Uu8g4.js → shown-files-core-Dw46r34m.js} +1 -1
- package/dist/chunks/{spawn-env-gxqKNJaO.js → spawn-env-C9TqrBFa.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-B8sdxV3y.js → ssh-sign-cli-TniUat4i.js} +2 -2
- package/dist/client/assets/{action-status-B0E-UYey.js → action-status-CZYIePIi.js} +1 -1
- package/dist/client/assets/action-status-CZYIePIi.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-CeADmzc1.js → benchmark-panel-Bw8N6GK2.js} +1 -1
- package/dist/client/assets/benchmark-panel-Bw8N6GK2.js.br +0 -0
- package/dist/client/assets/boards-view-qc5Ngfb3.js +1 -0
- package/dist/client/assets/boards-view-qc5Ngfb3.js.br +0 -0
- package/dist/client/assets/button-DmPsawUI.js +1 -0
- package/dist/client/assets/button-DmPsawUI.js.br +0 -0
- package/dist/client/assets/{card-actions-unth0mGA.js → card-actions-DqN_LeXp.js} +1 -1
- package/dist/client/assets/{card-registry-W9ss4JHS.js → card-registry-Cv71lBTz.js} +1 -1
- package/dist/client/assets/card-registry-Cv71lBTz.js.br +0 -0
- package/dist/client/assets/community-panel-CWjsICRJ.js +1 -0
- package/dist/client/assets/community-panel-CWjsICRJ.js.br +0 -0
- package/dist/client/assets/{control-ws-t9cKDDGy.js → control-ws-DPZ9etoz.js} +3 -3
- package/dist/client/assets/control-ws-DPZ9etoz.js.br +0 -0
- package/dist/client/assets/dialogs-DDJIQOLH.js +62 -0
- package/dist/client/assets/dialogs-DDJIQOLH.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-CUmnGPuA.js → doc-editor-ui-CgjO3Lnt.js} +1 -1
- package/dist/client/assets/doc-editor-ui-CgjO3Lnt.js.br +0 -0
- package/dist/client/assets/{feature-hint-CSxFk4_I.js → feature-hint-DK-4CryY.js} +1 -1
- package/dist/client/assets/feature-hint-DK-4CryY.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-Cvy09PVe.js → first-run-checklist-DhoHWVJq.js} +1 -1
- package/dist/client/assets/first-run-checklist-DhoHWVJq.js.br +0 -0
- package/dist/client/assets/{hooks-panel--CPyMcai.js → hooks-panel-Yq_L-te7.js} +1 -1
- package/dist/client/assets/hooks-panel-Yq_L-te7.js.br +0 -0
- package/dist/client/assets/{index-BCYtNn4q.css → index-DuILhRN2.css} +1 -1
- package/dist/client/assets/index-DuILhRN2.css.br +0 -0
- package/dist/client/assets/index-Yn1u5uR-.js +75 -0
- package/dist/client/assets/index-Yn1u5uR-.js.br +0 -0
- package/dist/client/assets/issues-panel-6Gxf7cee.js +1 -0
- package/dist/client/assets/issues-panel-6Gxf7cee.js.br +0 -0
- package/dist/client/assets/lane-read-token-step-DOv8AcER.js +10 -0
- package/dist/client/assets/lane-read-token-step-DOv8AcER.js.br +0 -0
- package/dist/client/assets/{menu-DK4rQWp6.js → menu-Bmp-V2w9.js} +1 -1
- package/dist/client/assets/menu-Bmp-V2w9.js.br +0 -0
- package/dist/client/assets/{modal-C-Lb5-jJ.js → modal-DAKyfQs6.js} +1 -1
- package/dist/client/assets/modal-DAKyfQs6.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-BxhBLlrC.js → my-prs-panel-C5dGa_OW.js} +1 -1
- package/dist/client/assets/my-prs-panel-C5dGa_OW.js.br +0 -0
- package/dist/client/assets/{nyan-cat-C0SuX0Ul.js → nyan-cat-Cw67zd4C.js} +1 -1
- package/dist/client/assets/nyan-cat-Cw67zd4C.js.br +0 -0
- package/dist/client/assets/phone-shell-bUqLE2_q.js +1 -0
- package/dist/client/assets/phone-shell-bUqLE2_q.js.br +0 -0
- package/dist/client/assets/{plan-face-DOHTjQIm.js → plan-face-DBr_qpxa.js} +2 -2
- package/dist/client/assets/plan-face-DBr_qpxa.js.br +0 -0
- package/dist/client/assets/{plan-render-BxqPQmb3.js → plan-render-ysX1IWmF.js} +1 -1
- package/dist/client/assets/plan-render-ysX1IWmF.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-DUXJglbf.js → pr-queue-columns-BOCHpq03.js} +1 -1
- package/dist/client/assets/pr-queue-columns-BOCHpq03.js.br +5 -0
- package/dist/client/assets/{pr-status-icon-D1RIxNiH.js → pr-status-icon-tznMLhQo.js} +1 -1
- package/dist/client/assets/pr-status-icon-tznMLhQo.js.br +0 -0
- package/dist/client/assets/radar-panel-wqAgTOI3.js +1 -0
- package/dist/client/assets/radar-panel-wqAgTOI3.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-Bja_yxRQ.js → repo-roots-adder-K4WcaTgy.js} +1 -1
- package/dist/client/assets/repo-roots-adder-K4WcaTgy.js.br +0 -0
- package/dist/client/assets/{resume-dialog-DbmQjZ54.js → resume-dialog-Cqd2khFs.js} +1 -1
- package/dist/client/assets/resume-dialog-Cqd2khFs.js.br +0 -0
- package/dist/client/assets/review-queue-panel-DF9DcX9y.js +1 -0
- package/dist/client/assets/review-queue-panel-DF9DcX9y.js.br +0 -0
- package/dist/client/assets/{session-actions-Cpe0WcNw.js → session-actions-DSNLKleZ.js} +2 -2
- package/dist/client/assets/session-actions-DSNLKleZ.js.br +0 -0
- package/dist/client/assets/{session-row-Bx0e1IqT.js → session-row-CXMMlw0t.js} +2 -2
- package/dist/client/assets/session-row-CXMMlw0t.js.br +0 -0
- package/dist/client/assets/{session-tick-CY_ByGke.js → session-tick-DuSCNqbg.js} +1 -1
- package/dist/client/assets/session-tick-DuSCNqbg.js.br +0 -0
- package/dist/client/assets/settings-panel-BQr7kr-A.js +4 -0
- package/dist/client/assets/settings-panel-BQr7kr-A.js.br +0 -0
- package/dist/client/assets/{setup-step-DTtM5S-5.js → setup-step-CriQNZxc.js} +1 -1
- package/dist/client/assets/setup-step-CriQNZxc.js.br +0 -0
- package/dist/client/assets/shown-face-BXtBnUOJ.js +1 -0
- package/dist/client/assets/shown-face-BXtBnUOJ.js.br +0 -0
- package/dist/client/assets/trace-panel-GIXoh7_b.js +2 -0
- package/dist/client/assets/trace-panel-GIXoh7_b.js.br +0 -0
- package/dist/client/assets/usage-panel-BtWL4_uZ.js +1 -0
- package/dist/client/assets/usage-panel-BtWL4_uZ.js.br +0 -0
- package/dist/client/assets/your-day-tip-BPaWavzg.js +1 -0
- package/dist/client/assets/your-day-tip-BPaWavzg.js.br +0 -0
- package/dist/client/index.html +13 -13
- package/dist/client/index.html.br +0 -0
- package/dist/examples/packs/night-shift/pack.json +42 -0
- package/dist/examples/packs/pr-radar/icon.svg +1 -0
- package/dist/examples/packs/pr-radar/pack.json +17 -0
- package/dist/examples/packs/pr-radar/panel/bridge.js +23 -0
- package/dist/examples/packs/pr-radar/panel/index.html +17 -0
- package/dist/examples/packs/pr-radar/panel/panel.css +12 -0
- package/dist/examples/packs/pr-radar/panel/panel.js +37 -0
- package/dist/examples/packs/pr-radar/review-checklist.mjs +11 -0
- package/dist/examples/packs/session-board/icon.svg +1 -0
- package/dist/examples/packs/session-board/pack.json +11 -0
- package/dist/examples/packs/session-board/panel/bridge.js +23 -0
- package/dist/examples/packs/session-board/panel/index.html +15 -0
- package/dist/examples/packs/session-board/panel/panel.css +12 -0
- package/dist/examples/packs/session-board/panel/panel.js +36 -0
- package/dist/schema/pack.v1.json +502 -0
- package/dist/server/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/agent-api-cli-ivGOfIyv.js +0 -1
- package/dist/chunks/config-store-CuPthoVo.js +0 -1
- package/dist/chunks/kimi-DgpeyWvz.js +0 -1
- package/dist/chunks/runtime-paths-CKqE4LXP.js +0 -1
- package/dist/client/assets/action-status-B0E-UYey.js.br +0 -0
- package/dist/client/assets/benchmark-panel-CeADmzc1.js.br +0 -0
- package/dist/client/assets/boards-view-B72AQTO3.js +0 -1
- package/dist/client/assets/boards-view-B72AQTO3.js.br +0 -0
- package/dist/client/assets/button-Cnom-MQM.js +0 -1
- package/dist/client/assets/button-Cnom-MQM.js.br +0 -0
- package/dist/client/assets/card-registry-W9ss4JHS.js.br +0 -0
- package/dist/client/assets/community-panel-DqzC7L9D.js +0 -1
- package/dist/client/assets/community-panel-DqzC7L9D.js.br +0 -0
- package/dist/client/assets/control-ws-t9cKDDGy.js.br +0 -0
- package/dist/client/assets/dialogs-CYxttI_-.js +0 -62
- package/dist/client/assets/dialogs-CYxttI_-.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-CUmnGPuA.js.br +0 -0
- package/dist/client/assets/feature-hint-CSxFk4_I.js.br +0 -0
- package/dist/client/assets/first-run-checklist-Cvy09PVe.js.br +0 -0
- package/dist/client/assets/hooks-panel--CPyMcai.js.br +0 -0
- package/dist/client/assets/index-BCYtNn4q.css.br +0 -0
- package/dist/client/assets/index-BJ91HtGW.js +0 -75
- package/dist/client/assets/index-BJ91HtGW.js.br +0 -0
- package/dist/client/assets/issues-panel-DUcdzzVj.js +0 -1
- package/dist/client/assets/issues-panel-DUcdzzVj.js.br +0 -0
- package/dist/client/assets/lane-read-token-step-DafWgu6v.js +0 -10
- package/dist/client/assets/lane-read-token-step-DafWgu6v.js.br +0 -0
- package/dist/client/assets/menu-DK4rQWp6.js.br +0 -0
- package/dist/client/assets/modal-C-Lb5-jJ.js.br +0 -0
- package/dist/client/assets/my-prs-panel-BxhBLlrC.js.br +0 -0
- package/dist/client/assets/nyan-cat-C0SuX0Ul.js.br +0 -0
- package/dist/client/assets/phone-shell-DVuMA67-.js +0 -1
- package/dist/client/assets/phone-shell-DVuMA67-.js.br +0 -0
- package/dist/client/assets/plan-face-DOHTjQIm.js.br +0 -0
- package/dist/client/assets/plan-render-BxqPQmb3.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-DUXJglbf.js.br +0 -0
- package/dist/client/assets/pr-status-icon-D1RIxNiH.js.br +0 -0
- package/dist/client/assets/radar-panel-do7jZZzb.js +0 -1
- package/dist/client/assets/radar-panel-do7jZZzb.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-Bja_yxRQ.js.br +0 -0
- package/dist/client/assets/resume-dialog-DbmQjZ54.js.br +0 -0
- package/dist/client/assets/review-queue-panel-Bj94aFOM.js +0 -1
- package/dist/client/assets/review-queue-panel-Bj94aFOM.js.br +0 -0
- package/dist/client/assets/sandboxed-frame-DDgtJ2Ng.js +0 -1
- package/dist/client/assets/session-actions-Cpe0WcNw.js.br +0 -0
- package/dist/client/assets/session-row-Bx0e1IqT.js.br +0 -0
- package/dist/client/assets/session-tick-CY_ByGke.js.br +0 -0
- package/dist/client/assets/settings-panel-DLFX7wgj.js +0 -4
- package/dist/client/assets/settings-panel-DLFX7wgj.js.br +0 -0
- package/dist/client/assets/setup-step-DTtM5S-5.js.br +0 -0
- package/dist/client/assets/shown-face-Dg0-lsQK.js +0 -1
- package/dist/client/assets/shown-face-Dg0-lsQK.js.br +0 -0
- package/dist/client/assets/trace-panel-CMGxUa6n.js +0 -2
- package/dist/client/assets/trace-panel-CMGxUa6n.js.br +0 -0
- package/dist/client/assets/usage-panel-CH5ByEKC.js +0 -1
- package/dist/client/assets/usage-panel-CH5ByEKC.js.br +0 -0
- package/dist/client/assets/your-day-tip-BX7i62Mj.js +0 -1
- package/dist/client/assets/your-day-tip-BX7i62Mj.js.br +0 -0
- package/dist/schema/pr-pack.v1.json +0 -272
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { a as showHomeAsTilde, i as sanitizeOneLine, n as requireExecutableSpawnHelper, r as firstLine$2 } from "./node-pty-preflight-DbfWP9Rc.js";
|
|
2
2
|
import { a as isMissingFileError, r as errorMessage, t as errorCode } from "./text-DoirglWV.js";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as examplePacksDir, c as resolveFfmpegPath, d as equalsIgnoringCaseOnWindows, f as isPathInside, i as clientDir, l as resolvePackageBin, m as sanitizeWorktreeName, n as bundled, o as packageRoot, p as safePathSegment, r as cliPath, s as relayPath, t as assetRoot, u as caseFoldedPathKey } from "./runtime-paths-DfoHzN15.js";
|
|
4
4
|
import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
5
|
-
import { $ as
|
|
5
|
+
import { $ as Op, $t as TeamReviewStateEntry, A as SESSION_NAME_PATTERN, B as SshSignRequest, Bt as PostingPlan, C as CONVERSATION_TOOL_RESULT_HOOK_EVENT, Cn as PrFlowSaveRuleRequest, Dt as MyPrsSnapshot, En as PrFlowsState, Et as MyPrThreadsResponse, Fn as shortSha, Ft as EarlierReview, Gn as KILLABLE_STATES, Gt as ReviewFinding, H as TaskTitle, In as GH_SEGMENT, It as FindingSeverity, Jn as STATES, Jt as ReviewVerdict, K as Board, Kn as MERGEABLE_LIVE_STATES, Kt as ReviewResult, Ln as NODE_ID_RE, M as SHOWN_FILE_CAP_BYTES, N as SIGN_URL_ENV, Nt as CommitSha$1, O as SESSION_DOC_BODY_CAP_BYTES, On as PrThreadReplyResponse, Ot as MyPrsState, P as SSH_SIGN_BODY_CAP_BYTES, Pn as HEX_SHA_RE, Pt as DECIDING_REVIEW_STATES, Q as Note, Qt as TeamReviewResolveResponse, R as ShownFile, Rn as REPO_SLUG_RE, Rt as GithubReviewState, S as CONVERSATION_PERMISSION_HOOK_EVENT, Sn as PrFlowRule, St as MyPrMergeWhenReadyRequest, T as ConversationQuestion, Tn as PrFlowsSettings, Tt as MyPrThreadNode, Ut as ReviewComment, Vt as PrDetail, W as BOARD_MEDIA_MAX_EDGE_PX, Wn as BADGE_LABELS, Wt as ReviewDraft, X as Box, Yt as TeamReviewActionRequest, Z as Frame, Zt as TeamReviewCompareFiles, _ as AgentSettingsRequest, _t as MyPrLaneEntry, an as decisionAsIfApprovalRequired, b as COHERENCE_HOOKS_INACTIVE, c as AgentCloseRequest, cn as PR_ACTION_REPORT_BODY_CAP_BYTES, ct as sparseBoardRecord, d as AgentPacksRequest, dn as PR_ACTION_TOKEN_ENV, dt as MyPr, en as TeamReviewStatus, et as Panel, f as AgentPullRequestRequest, fn as PrActionReportBody, ft as MyPrAutoRebase, gn as PrFlowDisposeRequest, ht as MyPrKeepMergeableRequest, i as ASK_USER_QUESTION_TOOL_NAME, in as canApproveAfterComment, it as WHITEBOARD_LIMITS, j as SESSION_NAME_RULE_TEXT, jn as prActionReportPath, kn as PrThreadUnresolveResponse, l as AgentEditRequest, ln as PR_ACTION_REPORT_ROUTE, lt as sparseBoardReply, mn as PrFlowApproveRequest, mt as MyPrCheckContextsResponse, nn as TeamReviewThreadResult, nt as Unit, o as AgentAttentionRequest, pn as PrActionRunRequest, pt as MyPrCheckContext, q as BoardRecord, qn as RESTARTABLE_STATES, qt as ReviewThreadId, r as AGENT_URL_ENV, rn as TeamReviewThreadsRepository, rt as WHITEBOARD_ASSET_ROUTE, sn as hasStandingViewerApproval, st as Wire, tn as TeamReviewThreadCommentsResponse, un as PR_ACTION_REPORT_URL_ENV, ut as LinkedPr, v as AgentSpawnRequest, vn as PrFlowItemRequest, vt as MyPrMergeMethod, x as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, xt as MyPrMergeStateResponse, y as AgentWhyRequest, yt as MyPrMergeRequest, zn as repoParts, zt as PostedReviewEvent } from "./session-BrX33men.js";
|
|
6
6
|
import { c as runCommandSafely$1, i as execFileSync, l as spawn, n as execFile, r as execFileAsync, s as refuseLaunchesOf, t as assertLaunchable } from "./child-process-safe-BIh8yQ0I.js";
|
|
7
|
-
import { $t as
|
|
8
|
-
import {
|
|
7
|
+
import { $ as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, $t as PLAN_TOOL_NAME, A as MinedPrReviewData, At as TraceRecord, B as GithubPrKey, C as BenchmarkId, Ct as IssuesStatus, D as BenchmarkSuite, Dt as SessionSetup, E as BenchmarkStatus, Et as HookEnvelope, F as CommunityState, G as WorkflowLabelName, Gt as pullRequestKeyFromReference, H as GithubPrsFrame, I as CommunityVerdict, It as CLIENT_LOG_TEXT_MAX_CHARS, Jt as UpdateJournal, K as WorkflowsSettings, L as DISCORD_CHANNEL_NAME_RE, Lt as CONTROL_FRAME_MAX_BYTES, M as CommunityActionRequest, Mt as ChangeMap, N as CommunityDraft, Nt as changeMapFactId, O as CommitComparison, Ot as MAX_RAW_LINE_CHARS, P as CommunityItem, Pt as CHANGES_POLL_INTERVAL_MS, Qt as PLAN_RESULT_HOOK_EVENT, R as SKILL_NAME_RE, S as BenchmarkCase, St as IssuesState, T as BenchmarkRun, U as comparablePrKey, V as GithubPrLightSearchNode, W as WorkflowCommentBody, Xt as PLAN_HOOK_EVENT, Yt as PLAN_BODY_CAP_BYTES, Zt as PLAN_HOOK_OUTPUT_MAX_CHARS, _ as FeatureHintState, _t as GithubIssuePullRequestsRepository, a as ConfigUpdate, bt as IssueUpdate, c as SHELL_AGENT_ID, en as PlanDecision, f as USAGE_COST_MODES, ft as USAGE_INTEGER_RANGES, g as PackApproveRequest, h as ClientMessage, j as PrCheckoutCaseInput, jt as CoherenceJournalOutput, k as MergedPrListing, kt as TraceCheckpoint, n as BUILTIN_AGENT_IDS, nn as parseExitPlanModeHookPayload, p as USAGE_VENDOR_KEYS, q as WorkflowsState, r as BrowserConfig, rn as planTitle, s as RUNTIME_CONFIG_SCALAR_KEYS, tn as PlanRevision, u as configIssueMessage, v as HINT_FEATURES, vt as GithubIssueResponse, w as BenchmarkJudgement, wt as issuePullRequestStateFromGithub, x as BenchmarkActionRequest, xt as IssuesSearchResponse, y as HINT_VIEW_BY_FEATURE, yt as IssueKey, z as GithubPrDetailNode, zt as GithubTeam } from "./config-C8KXay7k.js";
|
|
8
|
+
import { n as packBridgeJsonSchemaText } from "./pack-bridge-DifQHfqf.js";
|
|
9
|
+
import { $ as supervisionLine, A as parseRefinedSessionName, B as resumePromptFor, C as decideTaskTitleRefinement, D as extractPromptTaskTitle, E as extractOscTaskTitle, F as AUTO_CONTINUE_PROMPT, G as isAutoNameOf, H as claudeProjectsDir, I as RESUME_ID_RE, K as nextSuggestedName, L as isConversationReplacedAtStartup, M as resolveRefocusTaskTitle, N as resolveTaskTitle, O as isSelfWakePrompt, P as seedTaskTitleSources, Q as routeAgentNotes, R as pickAutoResume, S as cleanTaskPrompt, T as extractHookTaskTitle, U as listRepoConversations, V as shouldAdoptReportedResumeId, W as listRepoWorktreePaths, X as permitsHelpCommand, Y as hintFor, Z as promptHintFor, _ as projectReviewDetail, a as checkAgentReply, b as buildTaskTitleRefinementPrompt, c as deriveChildSessionName, d as describePushLanding, et as toolHookFactsOf, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as parseRefinedTaskTitle, k as isSubstantivePrompt, l as describeChildEndNote, n as REFUSAL_REASON, o as decideAgentRequest, p as describeUnpushedCloseRefusal, q as describeSessionLimits, s as decideSpawnAllowance, u as describeKeptChildAttention, v as projectReviews, w as extractAiTitle, x as chooseRefinedSessionName, y as buildPersistedTaskTitle, z as resolveResumeTarget } from "./agent-api-core-BeeBFOwI.js";
|
|
9
10
|
import { a as rawTextOr, i as positiveNumberOr, n as isRecord$2, o as textOr, r as numberOr, t as coercedNumberOr } from "./coerce-oz_Z_6E7.js";
|
|
10
11
|
import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-BfOQqktJ.js";
|
|
11
12
|
import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
|
|
@@ -13,19 +14,19 @@ import { n as promptContextReplyOf, o as toolHookContextReplyOf, r as refocusRep
|
|
|
13
14
|
import { n as parseJsonRecord, t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
|
|
14
15
|
import { a as saneYoloFiles } from "./sane-yolo-BjUkqIoH.js";
|
|
15
16
|
import { r as knownWriteHookInput } from "./posthog-read-gate-core-CeSY56AB.js";
|
|
16
|
-
import { _ as findDependencyCycle, a as filesAfterRetention, c as readPageTitle, d as thumbnailOwnerIdOf, f as thumbnailRecipeFor, g as cappedWarnings, h as layoutBoard, i as describeOverCap, l as shownMimeForFilename, m as escapeMarkup, n as SHOWN_SNIFF_BYTES, o as isShownPageMime, p as boardSvgDocument, r as decideShownKind, s as leavesVisibleRawTextOpen, t as SHOWN_PAGE_ZOOM_BRIDGE, u as thumbnailFilenameOf, v as planSteps$1, y as unitsOf } from "./shown-files-core-
|
|
17
|
+
import { _ as findDependencyCycle, a as filesAfterRetention, c as readPageTitle, d as thumbnailOwnerIdOf, f as thumbnailRecipeFor, g as cappedWarnings, h as layoutBoard, i as describeOverCap, l as shownMimeForFilename, m as escapeMarkup, n as SHOWN_SNIFF_BYTES, o as isShownPageMime, p as boardSvgDocument, r as decideShownKind, s as leavesVisibleRawTextOpen, t as SHOWN_PAGE_ZOOM_BRIDGE, u as thumbnailFilenameOf, v as planSteps$1, y as unitsOf } from "./shown-files-core-Dw46r34m.js";
|
|
17
18
|
import { a as mcpLaunchFor, o as parsePresentedCredential } from "./agent-config-DDpOIcFv.js";
|
|
18
19
|
import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
|
|
19
|
-
import { C as parseCgroupBytes, D as DEFAULT_MAX_MS, E as DEFAULT_BASE_MS, O as nextBackoffMs, S as memoryReserveBytes, T as parseMemAvailableBytes, _ as createSpawnGate, a as jsonStateLoadError, b as cgroupLimitBytes, c as loadedJsonValue, d as writeJsonAtomicSync, 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-AKRVPqG1.js";
|
|
20
|
-
import { $ as TELEMETRY_BATCH_URL, D as settingsBlockSpecFor, E as mergeSettingsBlock, Et as isSameDirectoryPath, G as EFFORT_OPTION_ID, H as isExperimentalSetting, J as LOGGED_FAST_CLOSE_COUNTS, K as DEEP_HISTORY_SCROLLBACK_LINES, O as validateSettingsBlock, Q as FIRST_RUN_NOTICE, St as stableConfigKey, Tt as comparableDirectoryPath, U as CATALOG_AGENT_IDS, W as DEFAULT_MODELS, X as parseDataAttach, Y as describeDataAttach, Z as parseDataClientMessage, _ as sessionIdFromBranch, _t as PendingCrashReport, a as generateProjectId, at as buildPersonProperties, b as DEFAULT_TIMER_FNS, ct as codexUserIdOf, d as DEFAULT_CONFIG, dt as decideTelemetryConsent, et as TELEMETRY_FLAGS_URL, f as DEFAULT_BRANCH_GC_PREFIXES, ft as exceptionFingerprint, g as planWorktreeGc, gt as DashboardTelemetryReport, h as planBranchGc, ht as resolveProjectToken, i as ensureProjectIds, it as buildExceptionProperties, k as SETTINGS_INDEX, lt as decideIsDevInstall, m as matchedPrefix, mt as parsePosthogReleaseId, n as createConfigStore, nt as buildAiGenerationEvents, o as glimmervoidHomeDir$1, ot as classifySessionExit, p as isGcCandidateWorktree, pt as nodeMajorVersion, r as ABORT_CONFIG_SAVE, rt as buildBrowserExceptionProperties, st as claudeAccountUuidOf, tt as adapterBucket, ut as decideRemoteTelemetryState, v as usablePrefixes, vt as TELEMETRY_EVENT_SCHEMAS, wt as canonicalizePath, x as unrefTimer, y as worktreeIntegrationTips, yt as TelemetryState, z as valueAtPath } from "./config-store-
|
|
21
|
-
import { i as resolveArgvCommandMatches, t as kimi } from "./kimi-
|
|
22
|
-
import { $ as grokHomes, A as decideUploadType, At as generateToken, B as containmentRefusalReason, Bt as readStoredHooks, C as parseRegistryLatest, Ct as shouldReplace, D as openContainedFile, Dt as HOOK_EVENTS, E as shortSha$1, Et as claudeCode, F as planUploadRetention, Ft as agentHookGroupOf, G as codexFallbackRoots, Gt as sweepOrphanedHostScratch, H as planContiguousRead, Ht as upsertHook, I as MAX_TRANSCRIPT_READ_BYTES, It as appendUserHooks, J as codexSessionIdFromPath, Jt as recordSweptPath, K as codexHomes, Kt as appendRemovalRecord, L as TRACE_TAIL_SCAN_BYTES, Lt as hooksForProject, M as framePathPaste, Mt as writeSessionSettings, N as imageMimeForUploadFilename, Nt as HOOK_EVENT_CATALOG, O as MAX_UPLOAD_BYTES, Ot as PLAN_HOLD_RELEASE_MS, P as isSafePathSegment, Pt as ID_RE, Q as expandTilde, R as committedOffsetFromTraceTailOrNull, Rt as normalizeHook, S as parseRegistryDeprecation, St as parseUsageLine, T as pickNewestPublished, Tt as vendorUsageEntry, U as resumeOffsetFrom, Ut as HOOK_TOOLS, V as isOversizedPartialLine, Vt as removeHook, W as withCommittedOffset, Wt as makeHostScratchDirectory, X as decideFileRead, Y as continuationDelayMs, Yt as removalsJournalPath, Z as dedupeCodexFiles, _ as decideInstallFlavor, _t as foldReplacementIntoGenerationRollup, a as describeAgentResolvability, at as scopedClaudeRoots, b as normalizeSha, bt as mergeGenerationRollups, c as isKnownAgentId, ct as shouldPersistWarehouse, d as resolveAdapter, dt as parseKimiUsageLine, et as isUsageFile, f as setCustomAgents, ft as addEntryToTotals, g as NODE_PTY_INSTALL_SCRIPT_FLAG, gt as foldEntryIntoGenerationRollup, h as requestCodexAppServer, ht as expandAdvisorIterations, i as customAgentFingerprint, it as resolveProjectsDirs, j as exceedsUploadCap, jt as sweepOrphans, k as buildUploadFilename, kt as buildHookSettings, l as listAgentIds, lt as splitLines, m as readHostCodexVersion, mt as emptyTotals, n as cachedAgentResolvability, nt as passOutcome, o as getAdapter, ot as sessionsRootCandidates, p as codex, pt as dedupKeys, q as codexRootCandidates, qt as appendRemovalRecordSync, r as commandFor, rt as projectDirCandidates, s as hookProfileOf, st as shouldEvaluateDespiteIoFailures, t as DEFAULT_AGENT_ID$1, tt as kimiHomes, u as resetCommandCache, ut as kimiDedupIdentity, v as decideUpdateStatus, vt as identityFromRelPath, w as parseResolvedSha, wt as totalTokensOf$1, x as normalizeUpdateChannel, xt as parseJsonLine$1, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes, zt as rawStoredHooks } from "./adapters-
|
|
20
|
+
import { C as parseCgroupBytes, D as DEFAULT_MAX_MS, E as DEFAULT_BASE_MS, O as nextBackoffMs, 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-AKRVPqG1.js";
|
|
21
|
+
import { $ as TELEMETRY_BATCH_URL, D as settingsBlockSpecFor, E as mergeSettingsBlock, Et as isSameDirectoryPath, G as EFFORT_OPTION_ID, H as isExperimentalSetting, J as LOGGED_FAST_CLOSE_COUNTS, K as DEEP_HISTORY_SCROLLBACK_LINES, O as validateSettingsBlock, Q as FIRST_RUN_NOTICE, St as stableConfigKey, Tt as comparableDirectoryPath, U as CATALOG_AGENT_IDS, W as DEFAULT_MODELS, X as parseDataAttach, Y as describeDataAttach, Z as parseDataClientMessage, _ as sessionIdFromBranch, _t as PendingCrashReport, a as generateProjectId, at as buildPersonProperties, b as DEFAULT_TIMER_FNS, ct as codexUserIdOf, d as DEFAULT_CONFIG, dt as decideTelemetryConsent, et as TELEMETRY_FLAGS_URL, f as DEFAULT_BRANCH_GC_PREFIXES, ft as exceptionFingerprint, g as planWorktreeGc, gt as DashboardTelemetryReport, h as planBranchGc, ht as resolveProjectToken, i as ensureProjectIds, it as buildExceptionProperties, k as SETTINGS_INDEX, lt as decideIsDevInstall, m as matchedPrefix, mt as parsePosthogReleaseId, n as createConfigStore, nt as buildAiGenerationEvents, o as glimmervoidHomeDir$1, ot as classifySessionExit, p as isGcCandidateWorktree, pt as nodeMajorVersion, r as ABORT_CONFIG_SAVE, rt as buildBrowserExceptionProperties, st as claudeAccountUuidOf, tt as adapterBucket, ut as decideRemoteTelemetryState, v as usablePrefixes, vt as TELEMETRY_EVENT_SCHEMAS, wt as canonicalizePath, x as unrefTimer, y as worktreeIntegrationTips, yt as TelemetryState, z as valueAtPath } from "./config-store-1YxK7Fcc.js";
|
|
22
|
+
import { i as resolveArgvCommandMatches, t as kimi } from "./kimi-CVxsh_Id.js";
|
|
23
|
+
import { $ as grokHomes, A as decideUploadType, At as generateToken, B as containmentRefusalReason, Bt as readStoredHooks, C as parseRegistryLatest, Ct as shouldReplace, D as openContainedFile, Dt as HOOK_EVENTS, E as shortSha$1, Et as claudeCode, F as planUploadRetention, Ft as agentHookGroupOf, G as codexFallbackRoots, Gt as sweepOrphanedHostScratch, H as planContiguousRead, Ht as upsertHook, I as MAX_TRANSCRIPT_READ_BYTES, It as appendUserHooks, J as codexSessionIdFromPath, Jt as recordSweptPath, K as codexHomes, Kt as appendRemovalRecord, L as TRACE_TAIL_SCAN_BYTES, Lt as hooksForProject, M as framePathPaste, Mt as writeSessionSettings, N as imageMimeForUploadFilename, Nt as HOOK_EVENT_CATALOG, O as MAX_UPLOAD_BYTES, Ot as PLAN_HOLD_RELEASE_MS, P as isSafePathSegment, Pt as ID_RE, Q as expandTilde, R as committedOffsetFromTraceTailOrNull, Rt as normalizeHook, S as parseRegistryDeprecation, St as parseUsageLine, T as pickNewestPublished, Tt as vendorUsageEntry, U as resumeOffsetFrom, Ut as HOOK_TOOLS, V as isOversizedPartialLine, Vt as removeHook, W as withCommittedOffset, Wt as makeHostScratchDirectory, X as decideFileRead, Y as continuationDelayMs, Yt as removalsJournalPath, Z as dedupeCodexFiles, _ as decideInstallFlavor, _t as foldReplacementIntoGenerationRollup, a as describeAgentResolvability, at as scopedClaudeRoots, b as normalizeSha, bt as mergeGenerationRollups, c as isKnownAgentId, ct as shouldPersistWarehouse, d as resolveAdapter, dt as parseKimiUsageLine, et as isUsageFile, f as setCustomAgents, ft as addEntryToTotals, g as NODE_PTY_INSTALL_SCRIPT_FLAG, gt as foldEntryIntoGenerationRollup, h as requestCodexAppServer, ht as expandAdvisorIterations, i as customAgentFingerprint, it as resolveProjectsDirs, j as exceedsUploadCap, jt as sweepOrphans, k as buildUploadFilename, kt as buildHookSettings, l as listAgentIds, lt as splitLines, m as readHostCodexVersion, mt as emptyTotals, n as cachedAgentResolvability, nt as passOutcome, o as getAdapter, ot as sessionsRootCandidates, p as codex, pt as dedupKeys, q as codexRootCandidates, qt as appendRemovalRecordSync, r as commandFor, rt as projectDirCandidates, s as hookProfileOf, st as shouldEvaluateDespiteIoFailures, t as DEFAULT_AGENT_ID$1, tt as kimiHomes, u as resetCommandCache, ut as kimiDedupIdentity, v as decideUpdateStatus, vt as identityFromRelPath, w as parseResolvedSha, wt as totalTokensOf$1, x as normalizeUpdateChannel, xt as parseJsonLine$1, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes, zt as rawStoredHooks } from "./adapters-CuQ_RvlA.js";
|
|
23
24
|
import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-BGvFYDNV.js";
|
|
24
25
|
import { d as releaseSessionLock, f as sessionIdOfLockFile, l as releaseUnheldAgentHomeSecrets, n as generatedAgentHomePath, p as trashSessionTempFolderOnceUnheld, s as realAgentHome, u as createHeldSessionTempFolder } from "./agent-home-Bt3Itm9c.js";
|
|
25
26
|
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, u as wellKnownAgentSocketPaths } from "./ssh-signing-core-BbhBpAhR.js";
|
|
26
|
-
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-
|
|
27
|
-
import { A as
|
|
28
|
-
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-
|
|
27
|
+
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-JwAqVJzu.js";
|
|
28
|
+
import { A as prActionRunAfterExit, B as unknownActionWarnings, D as mergeItems, E as itemLocation, F as savedRuleFor, G as withPrActionRun, H as withHandled, I as shouldTellBranchMoved, K as withReopened, L as sourceCandidates$1, N as prFlowRules, O as packPathsOf, P as prFlowSetup, R as teammateThreadItems, S as commandFingerprint, T as flaggingReviewers, U as withInterruptedRuns, V as visibleRun, W as withOnlyOpenPrs, _ as packFileMime, a as packReportText, b as acceptReport, c as packsStatePath, d as PackHeader, f as PacksState, g as approvedPackThemes, h as approvedPackPanels, i as packCheckHasProblem, j as prActionsForRepo, k as plannedActions, l as readPackDir, m as PACK_PANEL_CONTENT_POLICY, o as PACKS_DIR_NAME, p as packJsonSchemaText, q as withRuleRun, r as checkPack, s as packDirsUnder, t as createPrFlowsExternal, u as PACK_FILE_NAME, v as packRow, w as fixLocallyPrompt, x as branchMovedNote, y as pendingPackNote, z as threadCandidates } from "./pr-flows-external-BRtHbSYM.js";
|
|
29
|
+
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-D737OjDD.js";
|
|
29
30
|
import { createRequire } from "node:module";
|
|
30
31
|
import fs, { readFileSync } from "node:fs";
|
|
31
32
|
import path, { join, resolve } from "node:path";
|
|
@@ -1120,6 +1121,42 @@ var SETTINGS_TOOL = {
|
|
|
1120
1121
|
}
|
|
1121
1122
|
}
|
|
1122
1123
|
};
|
|
1124
|
+
var PACKS_TOOL = {
|
|
1125
|
+
name: "packs",
|
|
1126
|
+
title: "Glimmervoid packs",
|
|
1127
|
+
description: "Build Glimmervoid packs: folders that add color themes, sandboxed HTML dashboard panels and My PRs commands. guide returns how packs work, the pack.json and panel bridge JSON Schemas and example packs to copy; read it before writing a pack. check validates a pack folder and lists what it adds; list names the packs installed here and their approval state. Only the operator approves a pack, in Settings, Packs.",
|
|
1128
|
+
loadsUpfront: false,
|
|
1129
|
+
fields: { path: AgentPacksRequest.shape.path.describe("check: the pack folder, absolute or relative to this session's directory") },
|
|
1130
|
+
actions: {
|
|
1131
|
+
guide: {
|
|
1132
|
+
verb: "packs",
|
|
1133
|
+
presenter: "reply-text",
|
|
1134
|
+
required: [],
|
|
1135
|
+
accepts: [],
|
|
1136
|
+
hints: READS,
|
|
1137
|
+
toPayload: () => ({ command: "guide" })
|
|
1138
|
+
},
|
|
1139
|
+
check: {
|
|
1140
|
+
verb: "packs",
|
|
1141
|
+
presenter: "reply-text",
|
|
1142
|
+
required: ["path"],
|
|
1143
|
+
accepts: ["path"],
|
|
1144
|
+
hints: READS,
|
|
1145
|
+
toPayload: (toolArguments) => ({
|
|
1146
|
+
command: "check",
|
|
1147
|
+
...definedEntries(toolArguments, ["path"])
|
|
1148
|
+
})
|
|
1149
|
+
},
|
|
1150
|
+
list: {
|
|
1151
|
+
verb: "packs",
|
|
1152
|
+
presenter: "reply-text",
|
|
1153
|
+
required: [],
|
|
1154
|
+
accepts: [],
|
|
1155
|
+
hints: READS,
|
|
1156
|
+
toPayload: () => ({ command: "list" })
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1123
1160
|
var WHY_TOOL = {
|
|
1124
1161
|
name: "why",
|
|
1125
1162
|
title: "Glimmervoid why",
|
|
@@ -1139,6 +1176,7 @@ var GROUPED_TOOLS = Object.freeze([
|
|
|
1139
1176
|
PUSH_TOOL,
|
|
1140
1177
|
ATTENTION_TOOL,
|
|
1141
1178
|
SETTINGS_TOOL,
|
|
1179
|
+
PACKS_TOOL,
|
|
1142
1180
|
WHY_TOOL
|
|
1143
1181
|
]);
|
|
1144
1182
|
function allowedActionNames(tool, isVerbAllowed) {
|
|
@@ -1234,7 +1272,14 @@ var PRESENTERS = {
|
|
|
1234
1272
|
"board-picture": ({ session, agentApi, getWhiteboardAssets }, _verb, payload) => boardPictureResult(session, agentApi, getWhiteboardAssets(), payload),
|
|
1235
1273
|
"spawn-reply": reshapedReply(spawnReplyForMcp),
|
|
1236
1274
|
"board-without-command-guide": reshapedReply(boardReplyWithoutCommandGuide),
|
|
1237
|
-
"settings-list": reshapedReply(settingsListForMcp)
|
|
1275
|
+
"settings-list": reshapedReply(settingsListForMcp),
|
|
1276
|
+
"reply-text": async ({ session, agentApi }, verb, payload) => {
|
|
1277
|
+
const reply = await agentApi.handle(session, verb, payload);
|
|
1278
|
+
return reply.body.ok === true && typeof reply.body.text === "string" ? { content: [{
|
|
1279
|
+
type: "text",
|
|
1280
|
+
text: reply.body.text
|
|
1281
|
+
}] } : reply;
|
|
1282
|
+
}
|
|
1238
1283
|
};
|
|
1239
1284
|
function toolResultOf(presented) {
|
|
1240
1285
|
return "content" in presented ? presented : toolResultFromReply(presented);
|
|
@@ -2605,6 +2650,27 @@ function serveShownFile(req, res, shownFiles) {
|
|
|
2605
2650
|
pipeline(fs.createReadStream(servable.path), res, () => {});
|
|
2606
2651
|
}
|
|
2607
2652
|
//#endregion
|
|
2653
|
+
//#region server/backend/http/backend-http-pack-files.ts
|
|
2654
|
+
function requestedFilePath(splat) {
|
|
2655
|
+
if (!Array.isArray(splat) || splat.length === 0) return null;
|
|
2656
|
+
return splat.every((segment) => typeof segment === "string") ? splat.join("/") : null;
|
|
2657
|
+
}
|
|
2658
|
+
function servePackFile(req, res, packFileSource) {
|
|
2659
|
+
const filePath = requestedFilePath(req.params.filePath);
|
|
2660
|
+
const bytes = filePath === null ? null : packFileSource?.(String(req.params.packName), String(req.params.accessKey), filePath) ?? null;
|
|
2661
|
+
if (filePath === null || bytes === null) {
|
|
2662
|
+
res.status(404).end();
|
|
2663
|
+
return;
|
|
2664
|
+
}
|
|
2665
|
+
res.setHeader("Content-Security-Policy", PACK_PANEL_CONTENT_POLICY);
|
|
2666
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
2667
|
+
res.setHeader("Referrer-Policy", "no-referrer");
|
|
2668
|
+
res.setHeader("Cache-Control", "private, max-age=604800, immutable");
|
|
2669
|
+
res.setHeader("Content-Type", packFileMime(filePath));
|
|
2670
|
+
res.setHeader("Content-Length", String(bytes.byteLength));
|
|
2671
|
+
res.end(bytes);
|
|
2672
|
+
}
|
|
2673
|
+
//#endregion
|
|
2608
2674
|
//#region server/backend/http/backend-http-static.ts
|
|
2609
2675
|
var HASHED_ASSET_PREFIX = "/assets/";
|
|
2610
2676
|
var ONE_YEAR_MS = 31536e6;
|
|
@@ -2762,6 +2828,7 @@ function answerOpenExternal({ req, res, remoteListenerPort, listenerPortsFor, to
|
|
|
2762
2828
|
}
|
|
2763
2829
|
var BOARD_PAGE_SANDBOX_POLICY = "sandbox allow-scripts allow-popups allow-modals allow-forms";
|
|
2764
2830
|
var BOARD_MEDIA_SANDBOX_POLICY = "default-src 'none'; sandbox";
|
|
2831
|
+
var DASHBOARD_FRAME_POLICY = "frame-src 'self' blob: data:";
|
|
2765
2832
|
function sendBoardAssetBytes(req, res, servable, sizeBytes) {
|
|
2766
2833
|
res.setHeader("Content-Security-Policy", servable.contentType.startsWith("text/html") ? BOARD_PAGE_SANDBOX_POLICY : BOARD_MEDIA_SANDBOX_POLICY);
|
|
2767
2834
|
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
@@ -3114,6 +3181,13 @@ function createBackendHttpApp(dependencies) {
|
|
|
3114
3181
|
const { staticDir, customSoundsDir = resolveCustomSoundsDir(glimmervoidHomeDir$1()), configStore, remote, remoteAuth, allowedHosts, listenerPortsFor, pageToken, remoteListenerPort = null, tokenMatches = () => false, openUrlOnHost = async () => "unsupported-platform", getSession, logger = console } = dependencies;
|
|
3115
3182
|
const app = express();
|
|
3116
3183
|
mountHostAllowList(app, allowedHosts);
|
|
3184
|
+
app.use((_req, res, next) => {
|
|
3185
|
+
res.setHeader("Content-Security-Policy", DASHBOARD_FRAME_POLICY);
|
|
3186
|
+
next();
|
|
3187
|
+
});
|
|
3188
|
+
app.get("/packs/:packName/:accessKey/files/*filePath", (req, res) => {
|
|
3189
|
+
servePackFile(req, res, dependencies.getPackFile ?? null);
|
|
3190
|
+
});
|
|
3117
3191
|
if (remoteAuth) {
|
|
3118
3192
|
app.use(remoteAuth.httpMiddleware);
|
|
3119
3193
|
remoteAuth.mountPairRoutes(app);
|
|
@@ -7116,6 +7190,21 @@ function createAgentVerbHandlers(runtime, channels, { spawn }) {
|
|
|
7116
7190
|
body: reply
|
|
7117
7191
|
};
|
|
7118
7192
|
}
|
|
7193
|
+
async function packs(session, request) {
|
|
7194
|
+
if (!operatorState) return refusal(503, "packs are not available in this Glimmervoid");
|
|
7195
|
+
if (request.command === "check" && session.remoteWorkspace) return refusal(409, "this session runs in a Coder workspace, so its pack folder is not on this machine to check");
|
|
7196
|
+
const packPath = request.path === void 0 ? void 0 : path.resolve(session.effectiveCwd(), request.path);
|
|
7197
|
+
return {
|
|
7198
|
+
status: 200,
|
|
7199
|
+
body: {
|
|
7200
|
+
ok: true,
|
|
7201
|
+
...await operatorState.readPacks({
|
|
7202
|
+
command: request.command,
|
|
7203
|
+
...packPath === void 0 ? {} : { path: packPath }
|
|
7204
|
+
})
|
|
7205
|
+
}
|
|
7206
|
+
};
|
|
7207
|
+
}
|
|
7119
7208
|
async function why(session, target) {
|
|
7120
7209
|
if (!lookupWhy) return refusal(503, "why is not available in this Glimmervoid");
|
|
7121
7210
|
const lookup = await lookupWhy({
|
|
@@ -7335,6 +7424,7 @@ function createAgentVerbHandlers(runtime, channels, { spawn }) {
|
|
|
7335
7424
|
settings: (_session, request) => settings(request),
|
|
7336
7425
|
why: (session, { target }) => why(session, target),
|
|
7337
7426
|
checkout,
|
|
7427
|
+
packs,
|
|
7338
7428
|
whiteboard: (session, request) => whiteboards ? whiteboards.handleAgent({
|
|
7339
7429
|
id: session.id,
|
|
7340
7430
|
name: session.name,
|
|
@@ -10384,6 +10474,69 @@ function createRemoteSetupWiring({ config, agentSessions, makeSession, wireSessi
|
|
|
10384
10474
|
return { start };
|
|
10385
10475
|
}
|
|
10386
10476
|
//#endregion
|
|
10477
|
+
//#region server/packs/pack-agent.ts
|
|
10478
|
+
async function exampleLines(examplePacksDir) {
|
|
10479
|
+
const entries = await fs.promises.readdir(examplePacksDir, { withFileTypes: true }).catch(() => []);
|
|
10480
|
+
const lines = await Promise.all(entries.filter((entry) => entry.isDirectory()).map(async (entry) => {
|
|
10481
|
+
const manifestText = await fs.promises.readFile(path.join(examplePacksDir, entry.name, PACK_FILE_NAME), "utf8").catch(() => "");
|
|
10482
|
+
const header = PackHeader.safeParse(parseJsonOrNull(manifestText));
|
|
10483
|
+
return `- ${path.join(examplePacksDir, entry.name)}${header.success && header.data.description ? `: ${header.data.description}` : ""}`;
|
|
10484
|
+
}));
|
|
10485
|
+
return lines.length === 0 ? ["(this install ships no example packs)"] : lines.sort();
|
|
10486
|
+
}
|
|
10487
|
+
async function guideText({ homeDir, examplePacksDir }) {
|
|
10488
|
+
return [
|
|
10489
|
+
"Glimmervoid packs",
|
|
10490
|
+
"",
|
|
10491
|
+
`A pack is a folder holding a ${PACK_FILE_NAME} and the files it names, at most 1 MiB in all and without symlinks. Install one by placing its folder under ${path.join(homeDir, PACKS_DIR_NAME)}, or by listing its path under "packs" in Glimmervoid's config.json.`,
|
|
10492
|
+
"Nothing in a pack runs or shows until the operator approves it in Settings, Packs, and any change to any file in it asks again. Never approve a pack for the operator; check it, then tell them it waits for approval.",
|
|
10493
|
+
"",
|
|
10494
|
+
"Sections of pack.json, each checked on its own:",
|
|
10495
|
+
"- prFlows: commands My PRs runs on pull requests (prActions, sources, actions, rules).",
|
|
10496
|
+
"- ui.themes: color themes for the Theme picker; every chrome and state color is a #rrggbb hex.",
|
|
10497
|
+
"- ui.panels: HTML pages shown as dashboard tabs. A panel runs sandboxed in an opaque origin: no network (connect-src none), no cookies, no storage, no popups or navigation (a link in a panel opens nothing), no access to the dashboard page. Put every script, style and image in the pack, or inline.",
|
|
10498
|
+
"",
|
|
10499
|
+
"Panel bridge: a panel lists the topics it reads under reads, then posts {\"v\":1,\"kind\":\"subscribe\",\"topics\":[...]} to window.parent. It receives {\"v\":1,\"kind\":\"hello\",\"granted\":[...]} with the topics it was granted, then {\"v\":1,\"kind\":\"topic\",\"topic\":...,\"data\":...} for each one now and whenever it changes. Accept messages only when event.source === window.parent. Restyle from the theme topic, whose colors are CSS custom properties such as --bg and --text.",
|
|
10500
|
+
"",
|
|
10501
|
+
"Examples to copy and adapt:",
|
|
10502
|
+
...await exampleLines(examplePacksDir),
|
|
10503
|
+
"",
|
|
10504
|
+
"Check a pack folder before handing it over: glimmervoid packs check <folder>, or the packs tool with action check.",
|
|
10505
|
+
"",
|
|
10506
|
+
`${PACK_FILE_NAME} JSON Schema:`,
|
|
10507
|
+
packJsonSchemaText(),
|
|
10508
|
+
"Panel bridge messages JSON Schema:",
|
|
10509
|
+
packBridgeJsonSchemaText()
|
|
10510
|
+
].join("\n");
|
|
10511
|
+
}
|
|
10512
|
+
function rowLines(row) {
|
|
10513
|
+
return [
|
|
10514
|
+
`${row.name}${row.version === null ? "" : ` v${row.version}`}: ${row.state} at ${row.dir}`,
|
|
10515
|
+
...row.panels.map((panel) => ` panel ${panel.id} (${panel.label})${panel.reads.length === 0 ? "" : `, reads ${panel.reads.join(", ")}`}`),
|
|
10516
|
+
...row.themes.map((theme) => ` theme ${theme.id} (${theme.label}, ${theme.mode})`),
|
|
10517
|
+
...row.missingRequires.map((missing) => ` missing on this machine: ${missing}`),
|
|
10518
|
+
...row.errors.map((error) => ` error: ${error}`)
|
|
10519
|
+
];
|
|
10520
|
+
}
|
|
10521
|
+
async function readPacksForAgent(request, deps) {
|
|
10522
|
+
if (request.command === "guide") return {
|
|
10523
|
+
text: await guideText(deps),
|
|
10524
|
+
hasProblem: false
|
|
10525
|
+
};
|
|
10526
|
+
if (request.command === "list") {
|
|
10527
|
+
const rows = deps.packRows();
|
|
10528
|
+
return {
|
|
10529
|
+
text: rows.length === 0 ? `No packs are installed; ${path.join(deps.homeDir, PACKS_DIR_NAME)} holds none and config.json lists none.` : rows.flatMap(rowLines).join("\n"),
|
|
10530
|
+
hasProblem: rows.some((row) => row.errors.length > 0)
|
|
10531
|
+
};
|
|
10532
|
+
}
|
|
10533
|
+
const report = await checkPack(request.path ?? "", deps.env, deps.isApproved);
|
|
10534
|
+
return {
|
|
10535
|
+
text: packReportText(report),
|
|
10536
|
+
hasProblem: packCheckHasProblem(report)
|
|
10537
|
+
};
|
|
10538
|
+
}
|
|
10539
|
+
//#endregion
|
|
10387
10540
|
//#region server/core/control-replay-core.ts
|
|
10388
10541
|
var REPLAYABLE_EXACT = /* @__PURE__ */ new Set(["notify", "session-error"]);
|
|
10389
10542
|
function isReplayable(type) {
|
|
@@ -11168,6 +11321,7 @@ function createBackendShutdown(dependencies) {
|
|
|
11168
11321
|
const teamReview = dependencies.teamReview;
|
|
11169
11322
|
if (teamReview) stoppers.add("team-review", () => teamReview.stopPoller());
|
|
11170
11323
|
if (dependencies.myPrs) stoppers.add("my-prs", () => dependencies.myPrs?.stopPoller());
|
|
11324
|
+
if (dependencies.packStore) stoppers.add("packs", () => dependencies.packStore?.stop());
|
|
11171
11325
|
if (dependencies.issues) stoppers.add("issues", () => dependencies.issues?.stopPoller());
|
|
11172
11326
|
if (dependencies.community) stoppers.add("community", () => dependencies.community?.stopPoller());
|
|
11173
11327
|
const workflows = dependencies.workflows;
|
|
@@ -39625,7 +39779,7 @@ var NO_EXTERNAL_RUNNER = {
|
|
|
39625
39779
|
};
|
|
39626
39780
|
var FAILED_SOURCE_RETRY_MS = 3e5;
|
|
39627
39781
|
var BRANCH_MOVED_WINDOW_MS = 6e5;
|
|
39628
|
-
function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile, appendRule, github, external = NO_EXTERNAL_RUNNER, broadcast, log, reportUrlFor = () => null, loadPacks = () => ({
|
|
39782
|
+
function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile, appendRule, github, external = NO_EXTERNAL_RUNNER, broadcast, log, reportUrlFor = () => null, loadPacks = async () => ({
|
|
39629
39783
|
packs: [],
|
|
39630
39784
|
warnings: []
|
|
39631
39785
|
}), now = Date.now }) {
|
|
@@ -39787,7 +39941,7 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39787
39941
|
const configFile = await readConfigFile();
|
|
39788
39942
|
return {
|
|
39789
39943
|
configFile,
|
|
39790
|
-
setup: prFlowSetup(configFile, loadPacks(configFile), state.approvedFingerprints)
|
|
39944
|
+
setup: prFlowSetup(configFile, await loadPacks(configFile), state.approvedFingerprints)
|
|
39791
39945
|
};
|
|
39792
39946
|
}
|
|
39793
39947
|
async function runnableActionCommands() {
|
|
@@ -40028,22 +40182,25 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
40028
40182
|
}
|
|
40029
40183
|
for (const prKey of actionRunsByPr.keys()) if (!openPrKeys.has(prKey)) actionRunsByPr.delete(prKey);
|
|
40030
40184
|
}
|
|
40031
|
-
let
|
|
40185
|
+
let runningApply = null;
|
|
40032
40186
|
let isApplyRequested = false;
|
|
40033
|
-
async function
|
|
40034
|
-
if (isApplyingRules) {
|
|
40035
|
-
isApplyRequested = true;
|
|
40036
|
-
return;
|
|
40037
|
-
}
|
|
40038
|
-
isApplyingRules = true;
|
|
40187
|
+
async function applyRulesUntilSettled() {
|
|
40039
40188
|
try {
|
|
40040
40189
|
do {
|
|
40041
40190
|
isApplyRequested = false;
|
|
40042
40191
|
await applyRulesOnce();
|
|
40043
40192
|
} while (isApplyRequested);
|
|
40044
40193
|
} finally {
|
|
40045
|
-
|
|
40194
|
+
runningApply = null;
|
|
40195
|
+
}
|
|
40196
|
+
}
|
|
40197
|
+
function applyRules() {
|
|
40198
|
+
if (runningApply) {
|
|
40199
|
+
isApplyRequested = true;
|
|
40200
|
+
return runningApply;
|
|
40046
40201
|
}
|
|
40202
|
+
runningApply = applyRulesUntilSettled();
|
|
40203
|
+
return runningApply;
|
|
40047
40204
|
}
|
|
40048
40205
|
async function applyRulesOnce() {
|
|
40049
40206
|
const { configFile, setup } = await currentSetup();
|
|
@@ -40093,6 +40250,248 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
40093
40250
|
};
|
|
40094
40251
|
}
|
|
40095
40252
|
//#endregion
|
|
40253
|
+
//#region server/packs/pack-store.ts
|
|
40254
|
+
var PACK_RELOAD_DEBOUNCE_MS = 300;
|
|
40255
|
+
function createPackStore({ homeDir, statePath, env, log, reloadDebounceMs = PACK_RELOAD_DEBOUNCE_MS }) {
|
|
40256
|
+
const emitter = new EventEmitter();
|
|
40257
|
+
const accessKeySecret = crypto.randomBytes(32);
|
|
40258
|
+
let approvedFingerprints = /* @__PURE__ */ new Set();
|
|
40259
|
+
let approvalsLoadError = null;
|
|
40260
|
+
let approvalWrites = Promise.resolve();
|
|
40261
|
+
const packsDir = path.join(homeDir, PACKS_DIR_NAME);
|
|
40262
|
+
const readsByDir = /* @__PURE__ */ new Map();
|
|
40263
|
+
const reloadTimersByDir = /* @__PURE__ */ new Map();
|
|
40264
|
+
const listedWatchersByDir = /* @__PURE__ */ new Map();
|
|
40265
|
+
let homePackDirs = [];
|
|
40266
|
+
let homeWarning = null;
|
|
40267
|
+
let homeWatcher = null;
|
|
40268
|
+
let isStopped = false;
|
|
40269
|
+
function watchQuietly(target, onChange, isRecursive) {
|
|
40270
|
+
try {
|
|
40271
|
+
const watcher = fs.watch(canonicalizePath(target), { recursive: isRecursive }, (_event, changedName) => onChange(changedName === null ? null : String(changedName)));
|
|
40272
|
+
watcher.on("error", (error) => log.warn(`[packs] stopped watching ${target}: ${errorMessage(error)}`));
|
|
40273
|
+
return watcher;
|
|
40274
|
+
} catch (error) {
|
|
40275
|
+
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) log.warn(`[packs] could not watch ${target}: ${errorMessage(error)}`);
|
|
40276
|
+
return null;
|
|
40277
|
+
}
|
|
40278
|
+
}
|
|
40279
|
+
async function rereadPack(packDir) {
|
|
40280
|
+
const isListed = listedWatchersByDir.has(packDir);
|
|
40281
|
+
const isUnderHome = path.dirname(packDir) === packsDir;
|
|
40282
|
+
const hasManifest = await fs.promises.access(path.join(packDir, PACK_FILE_NAME)).then(() => true, () => false);
|
|
40283
|
+
if (isStopped) return;
|
|
40284
|
+
if (isUnderHome) homePackDirs = hasManifest ? [.../* @__PURE__ */ new Set([...homePackDirs, packDir])].sort() : homePackDirs.filter((dir) => dir !== packDir);
|
|
40285
|
+
if (!hasManifest && !isListed) {
|
|
40286
|
+
readsByDir.delete(packDir);
|
|
40287
|
+
emitter.emit("changed");
|
|
40288
|
+
return;
|
|
40289
|
+
}
|
|
40290
|
+
readsByDir.set(packDir, await readPackDir(packDir, env));
|
|
40291
|
+
if (!isStopped) emitter.emit("changed");
|
|
40292
|
+
}
|
|
40293
|
+
function scheduleReread(packDir) {
|
|
40294
|
+
const pending = reloadTimersByDir.get(packDir);
|
|
40295
|
+
if (pending) clearTimeout(pending);
|
|
40296
|
+
reloadTimersByDir.set(packDir, setTimeout(() => {
|
|
40297
|
+
reloadTimersByDir.delete(packDir);
|
|
40298
|
+
rereadPack(packDir);
|
|
40299
|
+
}, reloadDebounceMs));
|
|
40300
|
+
}
|
|
40301
|
+
async function refresh() {
|
|
40302
|
+
const found = await packDirsUnder(homeDir);
|
|
40303
|
+
const knownDirs = [.../* @__PURE__ */ new Set([...found.packDirs, ...listedWatchersByDir.keys()])];
|
|
40304
|
+
const freshReads = await Promise.all(knownDirs.map(async (packDir) => [packDir, await readPackDir(packDir, env)]));
|
|
40305
|
+
if (isStopped) return;
|
|
40306
|
+
homeWarning = found.warning;
|
|
40307
|
+
homePackDirs = found.packDirs;
|
|
40308
|
+
readsByDir.clear();
|
|
40309
|
+
for (const [packDir, read] of freshReads) readsByDir.set(packDir, read);
|
|
40310
|
+
}
|
|
40311
|
+
async function rescanHomePacks() {
|
|
40312
|
+
await refresh();
|
|
40313
|
+
if (!isStopped) emitter.emit("changed");
|
|
40314
|
+
}
|
|
40315
|
+
function onHomePacksChange(changedName) {
|
|
40316
|
+
const topSegment = changedName?.split(/[\\/]/)[0] ?? "";
|
|
40317
|
+
if (topSegment === "") {
|
|
40318
|
+
rescanHomePacks();
|
|
40319
|
+
return;
|
|
40320
|
+
}
|
|
40321
|
+
scheduleReread(path.join(packsDir, topSegment));
|
|
40322
|
+
}
|
|
40323
|
+
function watchHomePacks() {
|
|
40324
|
+
homeWatcher?.close();
|
|
40325
|
+
homeWatcher = watchQuietly(packsDir, onHomePacksChange, true);
|
|
40326
|
+
if (homeWatcher) return;
|
|
40327
|
+
homeWatcher = watchQuietly(homeDir, (changedName) => {
|
|
40328
|
+
if (changedName !== "packs") return;
|
|
40329
|
+
watchHomePacks();
|
|
40330
|
+
rescanHomePacks();
|
|
40331
|
+
}, false);
|
|
40332
|
+
}
|
|
40333
|
+
function setListedPaths(listedPaths) {
|
|
40334
|
+
const wantedDirs = new Set(listedPaths.map((listedPath) => path.resolve(homeDir, listedPath)));
|
|
40335
|
+
for (const [packDir, watcher] of listedWatchersByDir) {
|
|
40336
|
+
if (wantedDirs.has(packDir)) continue;
|
|
40337
|
+
watcher?.close();
|
|
40338
|
+
listedWatchersByDir.delete(packDir);
|
|
40339
|
+
if (!homePackDirs.includes(packDir)) readsByDir.delete(packDir);
|
|
40340
|
+
emitter.emit("changed");
|
|
40341
|
+
}
|
|
40342
|
+
for (const packDir of wantedDirs) {
|
|
40343
|
+
if (listedWatchersByDir.has(packDir) || isStopped) continue;
|
|
40344
|
+
listedWatchersByDir.set(packDir, watchQuietly(packDir, () => scheduleReread(packDir), true));
|
|
40345
|
+
rereadPack(packDir);
|
|
40346
|
+
}
|
|
40347
|
+
}
|
|
40348
|
+
function currentReads() {
|
|
40349
|
+
const takenNames = /* @__PURE__ */ new Set();
|
|
40350
|
+
return [.../* @__PURE__ */ new Set([...homePackDirs, ...listedWatchersByDir.keys()])].flatMap((packDir) => {
|
|
40351
|
+
const read = readsByDir.get(packDir);
|
|
40352
|
+
if (!read) return [];
|
|
40353
|
+
if (!read.ok) return [{
|
|
40354
|
+
packDir,
|
|
40355
|
+
read
|
|
40356
|
+
}];
|
|
40357
|
+
const name = read.pack.header.name;
|
|
40358
|
+
if (takenNames.has(name)) return [{
|
|
40359
|
+
packDir,
|
|
40360
|
+
read: {
|
|
40361
|
+
ok: false,
|
|
40362
|
+
errors: [`another pack is already named '${name}'`]
|
|
40363
|
+
}
|
|
40364
|
+
}];
|
|
40365
|
+
takenNames.add(name);
|
|
40366
|
+
return [{
|
|
40367
|
+
packDir,
|
|
40368
|
+
read
|
|
40369
|
+
}];
|
|
40370
|
+
});
|
|
40371
|
+
}
|
|
40372
|
+
function rows() {
|
|
40373
|
+
return currentReads().map(({ packDir, read }) => packRow(packDir, read, approvedFingerprints));
|
|
40374
|
+
}
|
|
40375
|
+
function packsInUse() {
|
|
40376
|
+
return currentReads().flatMap(({ read }) => read.ok && approvedFingerprints.has(read.pack.fingerprint) && read.pack.missingRequires.length === 0 ? [read.pack] : []);
|
|
40377
|
+
}
|
|
40378
|
+
function statusFrame() {
|
|
40379
|
+
const inUse = packsInUse();
|
|
40380
|
+
return {
|
|
40381
|
+
type: "packs-status",
|
|
40382
|
+
packs: rows(),
|
|
40383
|
+
themes: approvedPackThemes(inUse),
|
|
40384
|
+
panels: approvedPackPanels(inUse, packAccessKey),
|
|
40385
|
+
warnings: homeWarning === null ? [] : [homeWarning]
|
|
40386
|
+
};
|
|
40387
|
+
}
|
|
40388
|
+
function packAccessKey(pack) {
|
|
40389
|
+
return crypto.createHmac("sha256", accessKeySecret).update(`${pack.header.name}\0${pack.fingerprint}`).digest("hex");
|
|
40390
|
+
}
|
|
40391
|
+
function servableFile(packName, accessKey, filePath) {
|
|
40392
|
+
const offeredKey = Buffer.from(accessKey);
|
|
40393
|
+
return packsInUse().find((candidate) => {
|
|
40394
|
+
const expectedKey = Buffer.from(packAccessKey(candidate));
|
|
40395
|
+
return candidate.header.name === packName && expectedKey.length === offeredKey.length && crypto.timingSafeEqual(expectedKey, offeredKey);
|
|
40396
|
+
})?.filesByPath.get(filePath) ?? null;
|
|
40397
|
+
}
|
|
40398
|
+
async function approvedPacks() {
|
|
40399
|
+
await refresh();
|
|
40400
|
+
const packs = [];
|
|
40401
|
+
const warnings = homeWarning === null ? [] : [homeWarning];
|
|
40402
|
+
for (const { packDir, read } of currentReads()) {
|
|
40403
|
+
if (!read.ok) {
|
|
40404
|
+
warnings.push(`The pack at ${packDir} was skipped: ${read.errors[0] ?? "unreadable"}`);
|
|
40405
|
+
continue;
|
|
40406
|
+
}
|
|
40407
|
+
if (approvedFingerprints.has(read.pack.fingerprint)) {
|
|
40408
|
+
packs.push(read.pack);
|
|
40409
|
+
continue;
|
|
40410
|
+
}
|
|
40411
|
+
warnings.push(pendingPackNote(packRow(packDir, read, approvedFingerprints)));
|
|
40412
|
+
}
|
|
40413
|
+
return {
|
|
40414
|
+
packs,
|
|
40415
|
+
warnings
|
|
40416
|
+
};
|
|
40417
|
+
}
|
|
40418
|
+
async function loadApprovals() {
|
|
40419
|
+
if (!statePath) return;
|
|
40420
|
+
const outcome = await loadJsonStateFile({
|
|
40421
|
+
filePath: statePath,
|
|
40422
|
+
parse: (raw) => PacksState.safeParse(raw).data ?? null
|
|
40423
|
+
});
|
|
40424
|
+
if (outcome.status === "unreadable" || outcome.status === "corrupt") {
|
|
40425
|
+
approvalsLoadError = `${statePath} could not be read: ${errorMessage(outcome.error)}`;
|
|
40426
|
+
log.warn(`[packs] ${approvalsLoadError}`);
|
|
40427
|
+
return;
|
|
40428
|
+
}
|
|
40429
|
+
if (outcome.status === "quarantined") log.warn(`[packs] ${statePath} was unreadable and moved to ${outcome.movedTo}`);
|
|
40430
|
+
approvalsLoadError = null;
|
|
40431
|
+
approvedFingerprints = new Set(outcome.status === "loaded" ? outcome.value.approvedFingerprints : []);
|
|
40432
|
+
}
|
|
40433
|
+
async function persistApproval(fingerprint) {
|
|
40434
|
+
if (!statePath) return {
|
|
40435
|
+
ok: false,
|
|
40436
|
+
error: "Pack approvals have nowhere to be saved."
|
|
40437
|
+
};
|
|
40438
|
+
if (approvalsLoadError) return {
|
|
40439
|
+
ok: false,
|
|
40440
|
+
error: `Approvals were not saved because ${approvalsLoadError}`
|
|
40441
|
+
};
|
|
40442
|
+
const persisted = { approvedFingerprints: [.../* @__PURE__ */ new Set([...approvedFingerprints, fingerprint])] };
|
|
40443
|
+
try {
|
|
40444
|
+
await writeTextAtomic(statePath, `${JSON.stringify(persisted, null, 2)}\n`, { mkdir: true });
|
|
40445
|
+
} catch (error) {
|
|
40446
|
+
return {
|
|
40447
|
+
ok: false,
|
|
40448
|
+
error: `Could not save the approval to ${statePath}: ${errorMessage(error)}`
|
|
40449
|
+
};
|
|
40450
|
+
}
|
|
40451
|
+
approvedFingerprints = new Set(persisted.approvedFingerprints);
|
|
40452
|
+
return { ok: true };
|
|
40453
|
+
}
|
|
40454
|
+
async function approveNow(fingerprint) {
|
|
40455
|
+
await refresh();
|
|
40456
|
+
if (!rows().some((row) => row.state === "pending" && row.fingerprint === fingerprint)) return {
|
|
40457
|
+
ok: false,
|
|
40458
|
+
error: "That pack changed or is already approved; check the list again."
|
|
40459
|
+
};
|
|
40460
|
+
const saved = await persistApproval(fingerprint);
|
|
40461
|
+
if (saved.ok && !isStopped) emitter.emit("changed");
|
|
40462
|
+
return saved;
|
|
40463
|
+
}
|
|
40464
|
+
function approve(fingerprint) {
|
|
40465
|
+
const approval = approvalWrites.then(() => approveNow(fingerprint));
|
|
40466
|
+
approvalWrites = approval.catch(() => void 0);
|
|
40467
|
+
return approval;
|
|
40468
|
+
}
|
|
40469
|
+
async function start() {
|
|
40470
|
+
await loadApprovals();
|
|
40471
|
+
watchHomePacks();
|
|
40472
|
+
await rescanHomePacks();
|
|
40473
|
+
}
|
|
40474
|
+
function stop() {
|
|
40475
|
+
isStopped = true;
|
|
40476
|
+
homeWatcher?.close();
|
|
40477
|
+
for (const watcher of listedWatchersByDir.values()) watcher?.close();
|
|
40478
|
+
for (const timer of reloadTimersByDir.values()) clearTimeout(timer);
|
|
40479
|
+
listedWatchersByDir.clear();
|
|
40480
|
+
reloadTimersByDir.clear();
|
|
40481
|
+
emitter.removeAllListeners();
|
|
40482
|
+
}
|
|
40483
|
+
return Object.assign(emitter, {
|
|
40484
|
+
start,
|
|
40485
|
+
stop,
|
|
40486
|
+
setListedPaths,
|
|
40487
|
+
statusFrame,
|
|
40488
|
+
servableFile,
|
|
40489
|
+
approvedPacks,
|
|
40490
|
+
approve,
|
|
40491
|
+
isApproved: (fingerprint) => approvedFingerprints.has(fingerprint)
|
|
40492
|
+
});
|
|
40493
|
+
}
|
|
40494
|
+
//#endregion
|
|
40096
40495
|
//#region server/github/my-prs-poller.ts
|
|
40097
40496
|
var MY_PRS_RATE_LIMIT_RESOURCES = ["graphql"];
|
|
40098
40497
|
function createMyPrsPoller(dependencies) {
|
|
@@ -47817,6 +48216,20 @@ function createBackendLanes(dependencies) {
|
|
|
47817
48216
|
})
|
|
47818
48217
|
})
|
|
47819
48218
|
});
|
|
48219
|
+
const packStore = createPackStore({
|
|
48220
|
+
homeDir: glimmervoidHome,
|
|
48221
|
+
statePath: packsStatePath(glimmervoidHome),
|
|
48222
|
+
env: process.env,
|
|
48223
|
+
log: logger
|
|
48224
|
+
});
|
|
48225
|
+
let lastPacksFrameText = "";
|
|
48226
|
+
const broadcastPacksIfChanged = () => {
|
|
48227
|
+
const frame = packStore.statusFrame();
|
|
48228
|
+
const frameText = JSON.stringify(frame);
|
|
48229
|
+
if (frameText === lastPacksFrameText) return;
|
|
48230
|
+
lastPacksFrameText = frameText;
|
|
48231
|
+
broadcastControl(frame);
|
|
48232
|
+
};
|
|
47820
48233
|
const prFlows = createPrFlowsWiring({
|
|
47821
48234
|
statePath: path.join(glimmervoidHome, "pr-flows-state.json"),
|
|
47822
48235
|
openPrs: () => myPrs.getStatus().prs.filter((pr) => pr.state === "OPEN"),
|
|
@@ -47835,11 +48248,12 @@ function createBackendLanes(dependencies) {
|
|
|
47835
48248
|
broadcast: broadcastControl,
|
|
47836
48249
|
log: logger,
|
|
47837
48250
|
reportUrlFor: (runId) => `http://127.0.0.1:${dashboardPort}${prActionReportPath(runId)}`,
|
|
47838
|
-
loadPacks: (configFile) =>
|
|
47839
|
-
|
|
47840
|
-
|
|
47841
|
-
|
|
47842
|
-
|
|
48251
|
+
loadPacks: async (configFile) => {
|
|
48252
|
+
packStore.setListedPaths(packPathsOf(configFile));
|
|
48253
|
+
const approvedPacks = await packStore.approvedPacks();
|
|
48254
|
+
broadcastPacksIfChanged();
|
|
48255
|
+
return approvedPacks;
|
|
48256
|
+
}
|
|
47843
48257
|
});
|
|
47844
48258
|
const issues = createIssuesWiring({
|
|
47845
48259
|
config,
|
|
@@ -48019,6 +48433,13 @@ function createBackendLanes(dependencies) {
|
|
|
48019
48433
|
() => community.startPoller(),
|
|
48020
48434
|
() => teamReview.startPoller(),
|
|
48021
48435
|
() => myPrs.startPoller(),
|
|
48436
|
+
() => {
|
|
48437
|
+
packStore.on("changed", () => {
|
|
48438
|
+
broadcastPacksIfChanged();
|
|
48439
|
+
prFlows.applyRules();
|
|
48440
|
+
});
|
|
48441
|
+
packStore.start().catch((error) => logger.warn(`[packs] start failed: ${errorMessage(error)}`));
|
|
48442
|
+
},
|
|
48022
48443
|
() => issues.startPoller(),
|
|
48023
48444
|
() => workflows.startPoller(),
|
|
48024
48445
|
() => void benchmarks.sweepLeftovers().then(() => {
|
|
@@ -48073,6 +48494,7 @@ function createBackendLanes(dependencies) {
|
|
|
48073
48494
|
teamReview,
|
|
48074
48495
|
myPrs,
|
|
48075
48496
|
prFlows,
|
|
48497
|
+
packStore,
|
|
48076
48498
|
issues,
|
|
48077
48499
|
community,
|
|
48078
48500
|
workflows,
|
|
@@ -52328,6 +52750,28 @@ function createSettingsHandlers(_context, deps) {
|
|
|
52328
52750
|
});
|
|
52329
52751
|
console.log(`[control] delete-hook: ${id}`);
|
|
52330
52752
|
}
|
|
52753
|
+
async function handlePackApprove(msg, ws) {
|
|
52754
|
+
const reply = (outcome) => replyTo(ws, msg, "pack-approve-result", outcome);
|
|
52755
|
+
const parsed = PackApproveRequest.safeParse({ fingerprint: msg.fingerprint });
|
|
52756
|
+
if (!parsed.success) {
|
|
52757
|
+
reply({
|
|
52758
|
+
ok: false,
|
|
52759
|
+
error: configIssueMessage(parsed.error)
|
|
52760
|
+
});
|
|
52761
|
+
return;
|
|
52762
|
+
}
|
|
52763
|
+
if (!deps.packs) {
|
|
52764
|
+
reply({
|
|
52765
|
+
ok: false,
|
|
52766
|
+
error: "Packs are not running"
|
|
52767
|
+
});
|
|
52768
|
+
return;
|
|
52769
|
+
}
|
|
52770
|
+
reply(await deps.packs.approve(parsed.data.fingerprint));
|
|
52771
|
+
}
|
|
52772
|
+
function connectFrames() {
|
|
52773
|
+
return deps.packs ? [deps.packs.statusFrame()] : [];
|
|
52774
|
+
}
|
|
52331
52775
|
return {
|
|
52332
52776
|
handlers: {
|
|
52333
52777
|
"get-settings": handleGetSettings,
|
|
@@ -52341,7 +52785,8 @@ function createSettingsHandlers(_context, deps) {
|
|
|
52341
52785
|
"telegram-test": handleTelegramTest,
|
|
52342
52786
|
"request-hooks-report": handleRequestHooksReport,
|
|
52343
52787
|
"save-hook": handleSaveHook,
|
|
52344
|
-
"delete-hook": handleDeleteHook
|
|
52788
|
+
"delete-hook": handleDeleteHook,
|
|
52789
|
+
"pack-approve": handlePackApprove
|
|
52345
52790
|
},
|
|
52346
52791
|
invalidReplies: {
|
|
52347
52792
|
"get-settings": (_msg, requestId, message) => ({
|
|
@@ -52413,8 +52858,15 @@ function createSettingsHandlers(_context, deps) {
|
|
|
52413
52858
|
requestId,
|
|
52414
52859
|
ok: false,
|
|
52415
52860
|
error: message
|
|
52861
|
+
}),
|
|
52862
|
+
"pack-approve": (_msg, requestId, message) => ({
|
|
52863
|
+
type: "pack-approve-result",
|
|
52864
|
+
requestId,
|
|
52865
|
+
ok: false,
|
|
52866
|
+
error: message
|
|
52416
52867
|
})
|
|
52417
|
-
}
|
|
52868
|
+
},
|
|
52869
|
+
connectFrames
|
|
52418
52870
|
};
|
|
52419
52871
|
}
|
|
52420
52872
|
//#endregion
|
|
@@ -52853,6 +53305,7 @@ function createBackendControl(dependencies) {
|
|
|
52853
53305
|
community,
|
|
52854
53306
|
myPrs,
|
|
52855
53307
|
prFlows: laneAssembly.prFlows,
|
|
53308
|
+
packs: laneAssembly.packStore,
|
|
52856
53309
|
issues,
|
|
52857
53310
|
githubStore: laneAssembly.githubStore,
|
|
52858
53311
|
requestIssue: laneAssembly.githubStore.laneStore.requestIssue,
|
|
@@ -58293,7 +58746,8 @@ function createBackend(httpServer, options = {}) {
|
|
|
58293
58746
|
pageToken,
|
|
58294
58747
|
remoteListenerPort,
|
|
58295
58748
|
tokenMatches,
|
|
58296
|
-
openUrlOnHost: createHostUrlOpener()
|
|
58749
|
+
openUrlOnHost: createHostUrlOpener(),
|
|
58750
|
+
getPackFile: (packName, accessKey, filePath) => laneAssembly.packStore.servableFile(packName, accessKey, filePath)
|
|
58297
58751
|
});
|
|
58298
58752
|
agentIngressServer.on("request", createAgentIngressApp(agentIngressDependencies));
|
|
58299
58753
|
agentIngressServer.listen(0, AGENT_INGRESS_HOST);
|
|
@@ -58385,7 +58839,7 @@ function createBackend(httpServer, options = {}) {
|
|
|
58385
58839
|
logger: console,
|
|
58386
58840
|
renameSessionFromTaskTitle
|
|
58387
58841
|
});
|
|
58388
|
-
const { allLiveSessions, branchGc, coderActivity, gitWorkspace: assembledGitWorkspace, gitWorkspaceSync, posthog, recordLane, spawnGate, attachSessionPrLink, teamReview, myPrs, issues, community, traceChangeBroadcast, traceWiring, uploadsWiring, usage } = laneAssembly;
|
|
58842
|
+
const { allLiveSessions, branchGc, coderActivity, gitWorkspace: assembledGitWorkspace, gitWorkspaceSync, posthog, recordLane, spawnGate, attachSessionPrLink, teamReview, myPrs, packStore, issues, community, traceChangeBroadcast, traceWiring, uploadsWiring, usage } = laneAssembly;
|
|
58389
58843
|
gitWorkspace = assembledGitWorkspace;
|
|
58390
58844
|
agentApi = createAgentApiWiring({
|
|
58391
58845
|
config,
|
|
@@ -58404,7 +58858,14 @@ function createBackend(httpServer, options = {}) {
|
|
|
58404
58858
|
requestReview: (reference) => teamReview.requestReview(reference),
|
|
58405
58859
|
teamReviewStatus: () => teamReview.getStatus(),
|
|
58406
58860
|
myPrsStatus: () => myPrs.getStatus(),
|
|
58407
|
-
readSettings: (request) => readSettingsForAgent(request, configFileViewOf(configStore.configPath, config, process.env, configStore.isExperimentalBuild))
|
|
58861
|
+
readSettings: (request) => readSettingsForAgent(request, configFileViewOf(configStore.configPath, config, process.env, configStore.isExperimentalBuild)),
|
|
58862
|
+
readPacks: (request) => readPacksForAgent(request, {
|
|
58863
|
+
homeDir: glimmervoidHomeDir$1(),
|
|
58864
|
+
env: process.env,
|
|
58865
|
+
examplePacksDir,
|
|
58866
|
+
packRows: () => laneAssembly.packStore.statusFrame().packs,
|
|
58867
|
+
isApproved: (fingerprint) => laneAssembly.packStore.isApproved(fingerprint)
|
|
58868
|
+
})
|
|
58408
58869
|
},
|
|
58409
58870
|
whiteboards,
|
|
58410
58871
|
lookupWhy: (request) => lookupWhy({
|
|
@@ -58607,6 +59068,7 @@ function createBackend(httpServer, options = {}) {
|
|
|
58607
59068
|
posthog,
|
|
58608
59069
|
teamReview,
|
|
58609
59070
|
myPrs,
|
|
59071
|
+
packStore,
|
|
58610
59072
|
issues,
|
|
58611
59073
|
community,
|
|
58612
59074
|
workflows: laneAssembly.workflows,
|