glimmervoid 0.52.2-next.676 → 0.52.2-next.677
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 +19 -14
- package/dist/chunks/{adapters-D3Jz5ubD.js → adapters-Cc8ALffl.js} +6 -6
- package/dist/chunks/{adapters-BR9uXgFY.js → adapters-DjtWvxmJ.js} +1 -1
- package/dist/chunks/{agent-api-cli-CdspB0dx.js → agent-api-cli-7xxfflVL.js} +3 -3
- package/dist/chunks/agent-api-cli-ivGOfIyv.js +1 -0
- package/dist/chunks/{agent-api-core-BVqCeZzP.js → agent-api-core-BxJOL6Ye.js} +27 -2
- package/dist/chunks/{agent-setup-cli-D5_viu2B.js → agent-setup-cli-DWGQIduP.js} +1 -1
- package/dist/chunks/{config-62c4QXQt.js → config-C43Ovt64.js} +5 -1
- package/dist/chunks/config-store-BopqXIii.js +1 -0
- package/dist/chunks/{config-store-3MDjeSxI.js → config-store-Bqag5_2n.js} +50 -14
- package/dist/chunks/{grok-9XjPCcq0.js → grok-CstIMQXr.js} +1 -1
- package/dist/chunks/kimi-DgpeyWvz.js +1 -0
- package/dist/chunks/{kimi-BcpjSEBw.js → kimi-DjNUuBkC.js} +2 -2
- package/dist/chunks/{main-15MNtLEZ.js → main-mQr6p3Ev.js} +203 -32
- package/dist/chunks/{pair-cli-DX6XERYG.js → pair-cli-rFzuZV0h.js} +2 -2
- package/dist/chunks/{pr-flows-cli-BCB9p1ex.js → pr-flows-cli-Bdt0p04k.js} +117 -4
- package/dist/chunks/{pr-flows-external-CgzY34kz.js → pr-flows-external-CbLPEQzZ.js} +470 -30
- package/dist/chunks/{remote-config-DuHGnyrW.js → remote-config-C3nVcK84.js} +1 -1
- package/dist/chunks/{session-d-TA-Vaa.js → session-D0gNPAv6.js} +102 -7
- package/dist/chunks/{settings-cli-DlsLA8Zz.js → settings-cli-Bp7SFXNh.js} +5 -5
- package/dist/chunks/{settings-readout-core-CdqNElBs.js → settings-readout-core-DhpeT094.js} +2 -2
- package/dist/chunks/{shown-files-core-DKEbS44S.js → shown-files-core-DJ4Uu8g4.js} +1 -1
- package/dist/chunks/{spawn-env-BEQeEK4h.js → spawn-env-gxqKNJaO.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-CgDEJU9V.js → ssh-sign-cli-B8sdxV3y.js} +2 -2
- package/dist/client/assets/{action-status-DXlvWNQ7.js → action-status-B0E-UYey.js} +1 -1
- package/dist/client/assets/action-status-B0E-UYey.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-Dt3vGyms.js → benchmark-panel-Dzhmjdmr.js} +1 -1
- package/dist/client/assets/benchmark-panel-Dzhmjdmr.js.br +0 -0
- package/dist/client/assets/{boards-view-BeZKxEeC.js → boards-view-Cz0vbt34.js} +1 -1
- package/dist/client/assets/boards-view-Cz0vbt34.js.br +0 -0
- package/dist/client/assets/button-Cnom-MQM.js +1 -0
- package/dist/client/assets/button-Cnom-MQM.js.br +0 -0
- package/dist/client/assets/{card-actions-xWiBLo91.js → card-actions-unth0mGA.js} +1 -1
- package/dist/client/assets/{card-registry-D1vs5tMh.js → card-registry-W9ss4JHS.js} +1 -1
- package/dist/client/assets/card-registry-W9ss4JHS.js.br +0 -0
- package/dist/client/assets/{community-panel-Cs7qRZIs.js → community-panel-BlEfUgu7.js} +1 -1
- package/dist/client/assets/community-panel-BlEfUgu7.js.br +0 -0
- package/dist/client/assets/{control-ws-XKBNUN2v.js → control-ws-t9cKDDGy.js} +1 -1
- package/dist/client/assets/control-ws-t9cKDDGy.js.br +0 -0
- package/dist/client/assets/{dialogs-i4MvWfcJ.js → dialogs-CvazD02b.js} +1 -1
- package/dist/client/assets/dialogs-CvazD02b.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-CRHea59O.js → doc-editor-ui-7FVQ5FEn.js} +1 -1
- package/dist/client/assets/doc-editor-ui-7FVQ5FEn.js.br +0 -0
- package/dist/client/assets/{feature-hint-BUbxqM6i.js → feature-hint-BuFmpFSY.js} +1 -1
- package/dist/client/assets/feature-hint-BuFmpFSY.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-CmyO-Hst.js → first-run-checklist-CnlRPXrW.js} +1 -1
- package/dist/client/assets/first-run-checklist-CnlRPXrW.js.br +0 -0
- package/dist/client/assets/{hooks-panel-CG3S0SRu.js → hooks-panel-CHcww_jI.js} +1 -1
- package/dist/client/assets/hooks-panel-CHcww_jI.js.br +0 -0
- package/dist/client/assets/{index-Q9jU5kU4.js → index-CiJEE2GW.js} +24 -24
- package/dist/client/assets/index-CiJEE2GW.js.br +0 -0
- package/dist/client/assets/{issues-panel-DMIurtjb.js → issues-panel-C-WU_OpW.js} +1 -1
- package/dist/client/assets/issues-panel-C-WU_OpW.js.br +0 -0
- package/dist/client/assets/{lane-read-token-step-CoeCjZG1.js → lane-read-token-step-Bl2wOyl9.js} +6 -6
- package/dist/client/assets/lane-read-token-step-Bl2wOyl9.js.br +0 -0
- package/dist/client/assets/{menu-D9GiYN6D.js → menu-DK4rQWp6.js} +1 -1
- package/dist/client/assets/menu-DK4rQWp6.js.br +0 -0
- package/dist/client/assets/{modal-B1bP8CnK.js → modal-C-Lb5-jJ.js} +1 -1
- package/dist/client/assets/modal-C-Lb5-jJ.js.br +0 -0
- package/dist/client/assets/my-prs-panel-rsZ0yjXe.js +1 -0
- package/dist/client/assets/my-prs-panel-rsZ0yjXe.js.br +0 -0
- package/dist/client/assets/{nyan-cat-BJJIa95f.js → nyan-cat-DzIDMDM4.js} +1 -1
- package/dist/client/assets/nyan-cat-DzIDMDM4.js.br +0 -0
- package/dist/client/assets/{phone-shell-CAEfiwKo.js → phone-shell-BjFYeULh.js} +1 -1
- package/dist/client/assets/phone-shell-BjFYeULh.js.br +0 -0
- package/dist/client/assets/{plan-face-CosMfmeH.js → plan-face-ttBdxmdT.js} +1 -1
- package/dist/client/assets/plan-face-ttBdxmdT.js.br +0 -0
- package/dist/client/assets/{plan-render-COb_RToy.js → plan-render-DcEs6x-w.js} +1 -1
- package/dist/client/assets/plan-render-DcEs6x-w.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-Cvq0YbUw.js → pr-queue-columns-Dno6qOMY.js} +1 -1
- package/dist/client/assets/pr-queue-columns-Dno6qOMY.js.br +10 -0
- package/dist/client/assets/{pr-status-icon-BPdB3x-u.js → pr-status-icon-D1RIxNiH.js} +1 -1
- package/dist/client/assets/pr-status-icon-D1RIxNiH.js.br +0 -0
- package/dist/client/assets/{radar-panel-DplX3jhC.js → radar-panel-BaC23VCe.js} +1 -1
- package/dist/client/assets/radar-panel-BaC23VCe.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-BIUsOw3v.js → repo-roots-adder-DcY8QZax.js} +1 -1
- package/dist/client/assets/repo-roots-adder-DcY8QZax.js.br +0 -0
- package/dist/client/assets/{resume-dialog-1NN1elB8.js → resume-dialog-CvC8QV7Y.js} +1 -1
- package/dist/client/assets/resume-dialog-CvC8QV7Y.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-DIr1VGtt.js → review-queue-panel-CNKVV6RH.js} +1 -1
- package/dist/client/assets/review-queue-panel-CNKVV6RH.js.br +0 -0
- package/dist/client/assets/{session-actions-D9RGL-qn.js → session-actions-HPImbYVb.js} +2 -2
- package/dist/client/assets/session-actions-HPImbYVb.js.br +0 -0
- package/dist/client/assets/{session-row-C8fi8nZv.js → session-row-CNI0g3fQ.js} +1 -1
- package/dist/client/assets/session-row-CNI0g3fQ.js.br +0 -0
- package/dist/client/assets/{session-tick-COTMmIoE.js → session-tick-CY_ByGke.js} +1 -1
- package/dist/client/assets/session-tick-CY_ByGke.js.br +0 -0
- package/dist/client/assets/settings-panel-BvXNdZZu.js +4 -0
- package/dist/client/assets/settings-panel-BvXNdZZu.js.br +0 -0
- package/dist/client/assets/{setup-step-C7wDcLSD.js → setup-step-DTtM5S-5.js} +1 -1
- package/dist/client/assets/setup-step-DTtM5S-5.js.br +0 -0
- package/dist/client/assets/{shown-face-B55zt8_T.js → shown-face-DD4AnY8c.js} +1 -1
- package/dist/client/assets/shown-face-DD4AnY8c.js.br +0 -0
- package/dist/client/assets/{trace-panel-BrUZR4UO.js → trace-panel-BfPys80r.js} +1 -1
- package/dist/client/assets/trace-panel-BfPys80r.js.br +0 -0
- package/dist/client/assets/{usage-panel-CVPMCuPf.js → usage-panel-Dt93pqYo.js} +1 -1
- package/dist/client/assets/usage-panel-Dt93pqYo.js.br +0 -0
- package/dist/client/assets/{your-day-tip-CjQ6fqIw.js → your-day-tip-CUTVfQI4.js} +1 -1
- package/dist/client/assets/your-day-tip-CUTVfQI4.js.br +0 -0
- package/dist/client/index.html +12 -12
- package/dist/client/index.html.br +0 -0
- package/dist/schema/pr-pack.v1.json +272 -0
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/agent-api-cli-BowH6sQb.js +0 -1
- package/dist/chunks/config-store-B8yJlCWU.js +0 -1
- package/dist/chunks/kimi-C_c8wPl5.js +0 -1
- package/dist/client/assets/action-status-DXlvWNQ7.js.br +0 -0
- package/dist/client/assets/benchmark-panel-Dt3vGyms.js.br +0 -0
- package/dist/client/assets/boards-view-BeZKxEeC.js.br +0 -0
- package/dist/client/assets/button-DyD4Mzjw.js +0 -1
- package/dist/client/assets/button-DyD4Mzjw.js.br +0 -0
- package/dist/client/assets/card-registry-D1vs5tMh.js.br +0 -0
- package/dist/client/assets/community-panel-Cs7qRZIs.js.br +0 -0
- package/dist/client/assets/control-ws-XKBNUN2v.js.br +0 -0
- package/dist/client/assets/dialogs-i4MvWfcJ.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-CRHea59O.js.br +0 -0
- package/dist/client/assets/feature-hint-BUbxqM6i.js.br +0 -0
- package/dist/client/assets/first-run-checklist-CmyO-Hst.js.br +0 -0
- package/dist/client/assets/hooks-panel-CG3S0SRu.js.br +0 -0
- package/dist/client/assets/index-Q9jU5kU4.js.br +0 -0
- package/dist/client/assets/issues-panel-DMIurtjb.js.br +0 -0
- package/dist/client/assets/lane-read-token-step-CoeCjZG1.js.br +0 -0
- package/dist/client/assets/menu-D9GiYN6D.js.br +0 -0
- package/dist/client/assets/modal-B1bP8CnK.js.br +0 -0
- package/dist/client/assets/my-prs-panel-BlzzWsq0.js +0 -1
- package/dist/client/assets/my-prs-panel-BlzzWsq0.js.br +0 -0
- package/dist/client/assets/nyan-cat-BJJIa95f.js.br +0 -0
- package/dist/client/assets/phone-shell-CAEfiwKo.js.br +0 -0
- package/dist/client/assets/plan-face-CosMfmeH.js.br +0 -0
- package/dist/client/assets/plan-render-COb_RToy.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-Cvq0YbUw.js.br +0 -0
- package/dist/client/assets/pr-status-icon-BPdB3x-u.js.br +0 -0
- package/dist/client/assets/radar-panel-DplX3jhC.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-BIUsOw3v.js.br +0 -0
- package/dist/client/assets/resume-dialog-1NN1elB8.js.br +0 -0
- package/dist/client/assets/review-queue-panel-DIr1VGtt.js.br +0 -0
- package/dist/client/assets/session-actions-D9RGL-qn.js.br +0 -0
- package/dist/client/assets/session-row-C8fi8nZv.js.br +0 -0
- package/dist/client/assets/session-tick-COTMmIoE.js.br +0 -0
- package/dist/client/assets/settings-panel-bZNhVPcC.js +0 -4
- package/dist/client/assets/settings-panel-bZNhVPcC.js.br +0 -0
- package/dist/client/assets/setup-step-C7wDcLSD.js.br +0 -0
- package/dist/client/assets/shown-face-B55zt8_T.js.br +0 -0
- package/dist/client/assets/trace-panel-BrUZR4UO.js.br +0 -0
- package/dist/client/assets/usage-panel-CVPMCuPf.js.br +0 -0
- package/dist/client/assets/your-day-tip-CjQ6fqIw.js.br +0 -0
|
@@ -2,10 +2,10 @@ import { a as showHomeAsTilde, i as sanitizeOneLine, n as requireExecutableSpawn
|
|
|
2
2
|
import { a as isMissingFileError, r as errorMessage, t as errorCode } from "./text-DoirglWV.js";
|
|
3
3
|
import { a as packageRoot, c as resolvePackageBin, d as isPathInside, f as safePathSegment, i as clientDir, l as caseFoldedPathKey, n as bundled, o as relayPath, p as sanitizeWorktreeName, r as cliPath, s as resolveFfmpegPath, t as assetRoot, u as equalsIgnoringCaseOnWindows } from "./runtime-paths-CYwF658V.js";
|
|
4
4
|
import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
5
|
-
import { $ as Panel, $t as TeamReviewStatus, A as SESSION_NAME_RULE_TEXT, Bt as PrDetail, Cn as
|
|
5
|
+
import { $ as Panel, $t as TeamReviewStatus, A as SESSION_NAME_RULE_TEXT, Bt as PrDetail, Cn as PrFlowsSettings, D as SESSION_DOC_BODY_CAP_BYTES, Dn as PrThreadUnresolveResponse, Dt as MyPrsState, En as PrThreadReplyResponse, Et as MyPrsSnapshot, Fn as NODE_ID_RE, Ft as FindingSeverity, G as Board, Gn as RESTARTABLE_STATES, Gt as ReviewResult, Hn as BADGE_LABELS, Ht as ReviewComment, In as REPO_SLUG_RE, Jt as TeamReviewActionRequest, K as BoardRecord, Kn as STATES, Kt as ReviewThreadId, L as ShownFile, Ln as repoParts, Lt as GithubReviewState, M as SIGN_URL_ENV, Mn as HEX_SHA_RE, Mt as CommitSha$1, N as SSH_SIGN_BODY_CAP_BYTES, Nn as shortSha, Nt as DECIDING_REVIEW_STATES, Pn as GH_SEGMENT, Pt as EarlierReview, Q as Op, Qt as TeamReviewStateEntry, Rt as PostedReviewEvent, S as CONVERSATION_TOOL_RESULT_HOOK_EVENT, Tt as MyPrThreadsResponse, U as BOARD_MEDIA_MAX_EDGE_PX, Un as KILLABLE_STATES, Ut as ReviewDraft, V as TaskTitle, Wn as MERGEABLE_LIVE_STATES, Wt as ReviewFinding, X as Frame, Xt as TeamReviewCompareFiles, Y as Box, Z as Note, Zt as TeamReviewResolveResponse, _ as AgentSpawnRequest, _n as PrFlowItemRequest, _t as MyPrMergeMethod, b as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, bn as PrFlowRule, bt as MyPrMergeStateResponse, c as AgentCloseRequest, cn as PR_ACTION_REPORT_ROUTE, ct as sparseBoardReply, d as AgentPullRequestRequest, dn as PrActionReportBody, dt as MyPrAutoRebase, en as TeamReviewThreadCommentsResponse, fn as PrActionRunRequest, ft as MyPrCheckContext, g as AgentSettingsRequest, gt as MyPrLaneEntry, hn as PrFlowDisposeRequest, i as ASK_USER_QUESTION_TOOL_NAME, in as decisionAsIfApprovalRequired, j as SHOWN_FILE_CAP_BYTES, k as SESSION_NAME_PATTERN, kn as prActionReportPath, l as AgentEditRequest, ln as PR_ACTION_REPORT_URL_ENV, lt as LinkedPr, mt as MyPrKeepMergeableRequest, nn as TeamReviewThreadsRepository, nt as WHITEBOARD_ASSET_ROUTE, o as AgentAttentionRequest, on as hasStandingViewerApproval, ot as Wire, pn as PrFlowApproveRequest, pt as MyPrCheckContextsResponse, qt as ReviewVerdict, r as AGENT_URL_ENV, rn as canApproveAfterComment, rt as WHITEBOARD_LIMITS, sn as PR_ACTION_REPORT_BODY_CAP_BYTES, st as sparseBoardRecord, tn as TeamReviewThreadResult, tt as Unit, un as PR_ACTION_TOKEN_ENV, ut as MyPr, v as AgentWhyRequest, vt as MyPrMergeRequest, w as ConversationQuestion, wn as PrFlowsState, wt as MyPrThreadNode, x as CONVERSATION_PERMISSION_HOOK_EVENT, xn as PrFlowSaveRuleRequest, xt as MyPrMergeWhenReadyRequest, y as COHERENCE_HOOKS_INACTIVE, z as SshSignRequest, zt as PostingPlan } from "./session-D0gNPAv6.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 PlanDecision, A as PrCheckoutCaseInput, At as CoherenceJournalOutput, B as GithubPrLightSearchNode, C as BenchmarkJudgement, Ct as issuePullRequestStateFromGithub, D as CommitComparison, Dt as MAX_RAW_LINE_CHARS, E as BenchmarkSuite, Et as SessionSetup, F as CommunityVerdict, Ft as CLIENT_LOG_TEXT_MAX_CHARS, G as WorkflowsSettings, H as comparablePrKey, I as DISCORD_CHANNEL_NAME_RE, It as CONTROL_FRAME_MAX_BYTES, Jt as PLAN_BODY_CAP_BYTES, K as WorkflowsState, L as SKILL_NAME_RE, M as CommunityDraft, Mt as changeMapFactId, N as CommunityItem, Nt as CHANGES_POLL_INTERVAL_MS, O as MergedPrListing, Ot as TraceCheckpoint, P as CommunityState, Q as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, Qt as PLAN_TOOL_NAME, R as GithubPrDetailNode, Rt as GithubTeam, S as BenchmarkId, St as IssuesStatus, T as BenchmarkStatus, Tt as HookEnvelope, U as WorkflowCommentBody, V as GithubPrsFrame, W as WorkflowLabelName, Wt as pullRequestKeyFromReference, Xt as PLAN_HOOK_OUTPUT_MAX_CHARS, Yt as PLAN_HOOK_EVENT, Zt as PLAN_RESULT_HOOK_EVENT, _ as HINT_FEATURES, _t as GithubIssueResponse, a as ConfigUpdate, b as BenchmarkActionRequest, bt as IssuesSearchResponse, c as SHELL_AGENT_ID, dt as USAGE_INTEGER_RANGES, en as PlanRevision, f as USAGE_COST_MODES, g as FeatureHintState, gt as GithubIssuePullRequestsRepository, h as ClientMessage, j as CommunityActionRequest, jt as ChangeMap, k as MinedPrReviewData, kt as TraceRecord, n as BUILTIN_AGENT_IDS, nn as planTitle, p as USAGE_VENDOR_KEYS, qt as UpdateJournal, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, tn as parseExitPlanModeHookPayload, u as configIssueMessage, v as HINT_VIEW_BY_FEATURE, vt as IssueKey, w as BenchmarkRun, x as BenchmarkCase, xt as IssuesState, yt as IssueUpdate, z as GithubPrKey } from "./config-
|
|
8
|
-
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-
|
|
7
|
+
import { $t as PlanDecision, A as PrCheckoutCaseInput, At as CoherenceJournalOutput, B as GithubPrLightSearchNode, C as BenchmarkJudgement, Ct as issuePullRequestStateFromGithub, D as CommitComparison, Dt as MAX_RAW_LINE_CHARS, E as BenchmarkSuite, Et as SessionSetup, F as CommunityVerdict, Ft as CLIENT_LOG_TEXT_MAX_CHARS, G as WorkflowsSettings, H as comparablePrKey, I as DISCORD_CHANNEL_NAME_RE, It as CONTROL_FRAME_MAX_BYTES, Jt as PLAN_BODY_CAP_BYTES, K as WorkflowsState, L as SKILL_NAME_RE, M as CommunityDraft, Mt as changeMapFactId, N as CommunityItem, Nt as CHANGES_POLL_INTERVAL_MS, O as MergedPrListing, Ot as TraceCheckpoint, P as CommunityState, Q as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, Qt as PLAN_TOOL_NAME, R as GithubPrDetailNode, Rt as GithubTeam, S as BenchmarkId, St as IssuesStatus, T as BenchmarkStatus, Tt as HookEnvelope, U as WorkflowCommentBody, V as GithubPrsFrame, W as WorkflowLabelName, Wt as pullRequestKeyFromReference, Xt as PLAN_HOOK_OUTPUT_MAX_CHARS, Yt as PLAN_HOOK_EVENT, Zt as PLAN_RESULT_HOOK_EVENT, _ as HINT_FEATURES, _t as GithubIssueResponse, a as ConfigUpdate, b as BenchmarkActionRequest, bt as IssuesSearchResponse, c as SHELL_AGENT_ID, dt as USAGE_INTEGER_RANGES, en as PlanRevision, f as USAGE_COST_MODES, g as FeatureHintState, gt as GithubIssuePullRequestsRepository, h as ClientMessage, j as CommunityActionRequest, jt as ChangeMap, k as MinedPrReviewData, kt as TraceRecord, n as BUILTIN_AGENT_IDS, nn as planTitle, p as USAGE_VENDOR_KEYS, qt as UpdateJournal, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, tn as parseExitPlanModeHookPayload, u as configIssueMessage, v as HINT_VIEW_BY_FEATURE, vt as IssueKey, w as BenchmarkRun, x as BenchmarkCase, xt as IssuesState, yt as IssueUpdate, z as GithubPrKey } from "./config-C43Ovt64.js";
|
|
8
|
+
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-BxJOL6Ye.js";
|
|
9
9
|
import { a as rawTextOr, i as positiveNumberOr, n as isRecord$1, o as textOr, r as numberOr, t as coercedNumberOr } from "./coerce-oz_Z_6E7.js";
|
|
10
10
|
import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-BfOQqktJ.js";
|
|
11
11
|
import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
|
|
@@ -13,19 +13,19 @@ import { n as promptContextReplyOf, o as toolHookContextReplyOf, r as refocusRep
|
|
|
13
13
|
import { n as parseJsonRecord, t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
|
|
14
14
|
import { a as saneYoloFiles } from "./sane-yolo-BjUkqIoH.js";
|
|
15
15
|
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-
|
|
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-DJ4Uu8g4.js";
|
|
17
17
|
import { a as mcpLaunchFor, o as parsePresentedCredential } from "./agent-config-DDpOIcFv.js";
|
|
18
18
|
import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
|
|
19
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 buildAiGenerationEvents, Ct as isSameDirectoryPath, D as settingsBlockSpecFor, E as mergeSettingsBlock, G as LOGGED_FAST_CLOSE_COUNTS, H as isExperimentalSetting, J as parseDataClientMessage, K as describeDataAttach, O as validateSettingsBlock, Q as adapterBucket, St as comparableDirectoryPath, U as DEEP_HISTORY_SCROLLBACK_LINES, X as TELEMETRY_BATCH_URL, Y as FIRST_RUN_NOTICE, Z as TELEMETRY_FLAGS_URL, _ as sessionIdFromBranch, a as generateProjectId, at as codexUserIdOf, b as DEFAULT_TIMER_FNS, ct as decideTelemetryConsent, d as DEFAULT_CONFIG, dt as parsePosthogReleaseId, et as buildBrowserExceptionProperties, f as DEFAULT_BRANCH_GC_PREFIXES, ft as resolveProjectToken, g as planWorktreeGc, gt as TelemetryState, h as planBranchGc, ht as TELEMETRY_EVENT_SCHEMAS, i as ensureProjectIds, it as claudeAccountUuidOf, k as SETTINGS_INDEX, lt as exceptionFingerprint, m as matchedPrefix, mt as PendingCrashReport, n as createConfigStore, nt as buildPersonProperties, o as glimmervoidHomeDir$1, ot as decideIsDevInstall, p as isGcCandidateWorktree, pt as DashboardTelemetryReport, q as parseDataAttach, r as ABORT_CONFIG_SAVE, rt as classifySessionExit, st as decideRemoteTelemetryState, tt as buildExceptionProperties, ut as nodeMajorVersion, v as usablePrefixes, x as unrefTimer, xt as canonicalizePath, y as worktreeIntegrationTips, yt as stableConfigKey, z as valueAtPath } from "./config-store-
|
|
21
|
-
import { i as resolveArgvCommandMatches } 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, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes, zt as rawStoredHooks } from "./adapters-
|
|
20
|
+
import { $ as buildAiGenerationEvents, Ct as isSameDirectoryPath, D as settingsBlockSpecFor, E as mergeSettingsBlock, G as LOGGED_FAST_CLOSE_COUNTS, H as isExperimentalSetting, J as parseDataClientMessage, K as describeDataAttach, O as validateSettingsBlock, Q as adapterBucket, St as comparableDirectoryPath, U as DEEP_HISTORY_SCROLLBACK_LINES, X as TELEMETRY_BATCH_URL, Y as FIRST_RUN_NOTICE, Z as TELEMETRY_FLAGS_URL, _ as sessionIdFromBranch, a as generateProjectId, at as codexUserIdOf, b as DEFAULT_TIMER_FNS, ct as decideTelemetryConsent, d as DEFAULT_CONFIG, dt as parsePosthogReleaseId, et as buildBrowserExceptionProperties, f as DEFAULT_BRANCH_GC_PREFIXES, ft as resolveProjectToken, g as planWorktreeGc, gt as TelemetryState, h as planBranchGc, ht as TELEMETRY_EVENT_SCHEMAS, i as ensureProjectIds, it as claudeAccountUuidOf, k as SETTINGS_INDEX, lt as exceptionFingerprint, m as matchedPrefix, mt as PendingCrashReport, n as createConfigStore, nt as buildPersonProperties, o as glimmervoidHomeDir$1, ot as decideIsDevInstall, p as isGcCandidateWorktree, pt as DashboardTelemetryReport, q as parseDataAttach, r as ABORT_CONFIG_SAVE, rt as classifySessionExit, st as decideRemoteTelemetryState, tt as buildExceptionProperties, ut as nodeMajorVersion, v as usablePrefixes, x as unrefTimer, xt as canonicalizePath, y as worktreeIntegrationTips, yt as stableConfigKey, z as valueAtPath } from "./config-store-Bqag5_2n.js";
|
|
21
|
+
import { i as resolveArgvCommandMatches } from "./kimi-DjNUuBkC.js";
|
|
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, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes, zt as rawStoredHooks } from "./adapters-Cc8ALffl.js";
|
|
23
23
|
import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-BGvFYDNV.js";
|
|
24
24
|
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
25
|
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 {
|
|
28
|
-
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-
|
|
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-C3nVcK84.js";
|
|
27
|
+
import { A as withPrActionRun, C as teammateThreadItems, D as withHandled, E as visibleRun, M as withRuleRun, O as withInterruptedRuns, S as sourceCandidates$1, T as unknownActionWarnings, a as branchMovedNote, b as savedRuleFor, c as fixLocallyPrompt, d as mergeItems, g as prActionsForRepo, h as prActionRunAfterExit, i as acceptReport, j as withReopened, k as withOnlyOpenPrs, l as flaggingReviewers, m as plannedActions, n as loadPacks, o as commandFingerprint, p as packPathsOf, t as createPrFlowsExternal, u as itemLocation, v as prFlowRules, w as threadCandidates, x as shouldTellBranchMoved, y as prFlowSetup } from "./pr-flows-external-CbLPEQzZ.js";
|
|
28
|
+
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-DhpeT094.js";
|
|
29
29
|
import { createRequire } from "node:module";
|
|
30
30
|
import fs, { readFileSync } from "node:fs";
|
|
31
31
|
import path, { join, resolve } from "node:path";
|
|
@@ -3054,6 +3054,51 @@ function mountCommitSigningRoute(app, { getSession, sshSigner, logger }) {
|
|
|
3054
3054
|
});
|
|
3055
3055
|
});
|
|
3056
3056
|
}
|
|
3057
|
+
var PR_ACTION_REPORT_ERRORS = {
|
|
3058
|
+
401: "the token does not match this run",
|
|
3059
|
+
404: "no PR action run has that id",
|
|
3060
|
+
409: "this run already has a final outcome"
|
|
3061
|
+
};
|
|
3062
|
+
function mountPrActionReportRoute(app, { getPrActionReports, logger }) {
|
|
3063
|
+
app.post(PR_ACTION_REPORT_ROUTE, (req, res) => {
|
|
3064
|
+
const overCap = (declaredBytes) => {
|
|
3065
|
+
logger.warn(`[pr-action] a ${declaredBytes} byte report is over the ${PR_ACTION_REPORT_BODY_CAP_BYTES} byte cap and was refused`);
|
|
3066
|
+
};
|
|
3067
|
+
readCappedBody(req, PR_ACTION_REPORT_BODY_CAP_BYTES, overCap).then(async (bodyText) => {
|
|
3068
|
+
if (bodyText === null) return;
|
|
3069
|
+
const reports = getPrActionReports();
|
|
3070
|
+
const token = presentedToken(req);
|
|
3071
|
+
if (!isLoopbackRequest(req) || !reports) {
|
|
3072
|
+
refuseAgentRequest(res);
|
|
3073
|
+
return;
|
|
3074
|
+
}
|
|
3075
|
+
if (token === null) {
|
|
3076
|
+
res.status(401).json({
|
|
3077
|
+
ok: false,
|
|
3078
|
+
error: PR_ACTION_REPORT_ERRORS[401]
|
|
3079
|
+
});
|
|
3080
|
+
return;
|
|
3081
|
+
}
|
|
3082
|
+
const report = PrActionReportBody.safeParse(parseJsonBody(bodyText));
|
|
3083
|
+
if (!report.success) {
|
|
3084
|
+
res.status(400).json({
|
|
3085
|
+
ok: false,
|
|
3086
|
+
error: report.error.issues[0]?.message ?? "invalid report"
|
|
3087
|
+
});
|
|
3088
|
+
return;
|
|
3089
|
+
}
|
|
3090
|
+
const status = await reports.acceptPrActionReport(req.params.runId ?? "", token, report.data);
|
|
3091
|
+
if (status === 200) {
|
|
3092
|
+
res.status(200).json({ ok: true });
|
|
3093
|
+
return;
|
|
3094
|
+
}
|
|
3095
|
+
res.status(status).json({
|
|
3096
|
+
ok: false,
|
|
3097
|
+
error: PR_ACTION_REPORT_ERRORS[status]
|
|
3098
|
+
});
|
|
3099
|
+
});
|
|
3100
|
+
});
|
|
3101
|
+
}
|
|
3057
3102
|
function createAgentIngressApp(dependencies) {
|
|
3058
3103
|
const app = express();
|
|
3059
3104
|
mountHostAllowList(app, dependencies.allowedHosts);
|
|
@@ -3094,6 +3139,10 @@ function createBackendHttpApp(dependencies) {
|
|
|
3094
3139
|
});
|
|
3095
3140
|
});
|
|
3096
3141
|
mountAgentIngressRoutes(app, dependencies);
|
|
3142
|
+
mountPrActionReportRoute(app, {
|
|
3143
|
+
getPrActionReports: dependencies.getPrActionReports ?? (() => null),
|
|
3144
|
+
logger
|
|
3145
|
+
});
|
|
3097
3146
|
const uploadsRoot = configSiblingPath(configStore.configPath, "uploads");
|
|
3098
3147
|
app.post("/upload/:sessionId", (req, res) => {
|
|
3099
3148
|
const declaredBytes = declaredContentLength(req);
|
|
@@ -39406,16 +39455,21 @@ var NO_EXTERNAL_RUNNER = {
|
|
|
39406
39455
|
};
|
|
39407
39456
|
var FAILED_SOURCE_RETRY_MS = 3e5;
|
|
39408
39457
|
var BRANCH_MOVED_WINDOW_MS = 6e5;
|
|
39409
|
-
function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile, appendRule, github, external = NO_EXTERNAL_RUNNER, broadcast, log,
|
|
39458
|
+
function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile, appendRule, github, external = NO_EXTERNAL_RUNNER, broadcast, log, reportUrlFor = () => null, loadPacks = () => ({
|
|
39459
|
+
packs: [],
|
|
39460
|
+
warnings: []
|
|
39461
|
+
}), now = Date.now }) {
|
|
39410
39462
|
let state = {
|
|
39411
39463
|
handledByPr: {},
|
|
39412
39464
|
reopenedByPr: {},
|
|
39413
39465
|
approvedFingerprints: [],
|
|
39414
|
-
ruleRunsByPr: {}
|
|
39466
|
+
ruleRunsByPr: {},
|
|
39467
|
+
prActionRunByPr: {}
|
|
39415
39468
|
};
|
|
39416
39469
|
let warnings = [];
|
|
39417
39470
|
let approvals = [];
|
|
39418
39471
|
let runnableActions = [];
|
|
39472
|
+
let approvedPrActions = [];
|
|
39419
39473
|
const actionRunsByPr = /* @__PURE__ */ new Map();
|
|
39420
39474
|
let lastFrameText = "";
|
|
39421
39475
|
const sourceRunsByPr = /* @__PURE__ */ new Map();
|
|
@@ -39425,7 +39479,7 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39425
39479
|
filePath: statePath,
|
|
39426
39480
|
parse: (raw) => PrFlowsState.safeParse(raw).data ?? null,
|
|
39427
39481
|
adopt: (loadedState) => {
|
|
39428
|
-
state = loadedState
|
|
39482
|
+
state = loadedState ? withInterruptedRuns(loadedState) : state;
|
|
39429
39483
|
},
|
|
39430
39484
|
warn: (message, fields) => log.warn(`[pr-flows] ${message} ${JSON.stringify(fields)}`)
|
|
39431
39485
|
});
|
|
@@ -39442,7 +39496,16 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39442
39496
|
const sourceRunsByPrKey = {};
|
|
39443
39497
|
const reviewItemsByPr = {};
|
|
39444
39498
|
const actionRunsByPrKey = {};
|
|
39499
|
+
const prActionsByPr = {};
|
|
39500
|
+
const prActionRunsByPr = {};
|
|
39445
39501
|
for (const pr of openPrs()) {
|
|
39502
|
+
const prActionChoices = prActionsForRepo(approvedPrActions, pr.repo).map(({ id, label }) => ({
|
|
39503
|
+
id,
|
|
39504
|
+
label
|
|
39505
|
+
}));
|
|
39506
|
+
if (prActionChoices.length > 0) prActionsByPr[pr.key] = prActionChoices;
|
|
39507
|
+
const prActionRuns = Object.values(state.prActionRunByPr[pr.key] ?? {}).flatMap((run) => visibleRun(run, pr) ?? []);
|
|
39508
|
+
if (prActionRuns.length > 0) prActionRunsByPr[pr.key] = prActionRuns;
|
|
39446
39509
|
const actionRuns = actionRunsByPr.get(pr.key) ?? [];
|
|
39447
39510
|
if (actionRuns.length > 0) actionRunsByPrKey[pr.key] = actionRuns.map(({ itemKey, actionId, label, state: runState, message }) => ({
|
|
39448
39511
|
itemKey,
|
|
@@ -39468,7 +39531,9 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39468
39531
|
sourceRunsByPr: sourceRunsByPrKey,
|
|
39469
39532
|
reviewItemsByPr,
|
|
39470
39533
|
actions: runnableActions,
|
|
39471
|
-
actionRunsByPr: actionRunsByPrKey
|
|
39534
|
+
actionRunsByPr: actionRunsByPrKey,
|
|
39535
|
+
prActionsByPr,
|
|
39536
|
+
prActionRunsByPr
|
|
39472
39537
|
};
|
|
39473
39538
|
}
|
|
39474
39539
|
function broadcastIfChanged() {
|
|
@@ -39547,10 +39612,17 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39547
39612
|
await recordHandled(disposal, item);
|
|
39548
39613
|
return { ok: true };
|
|
39549
39614
|
}
|
|
39550
|
-
async function
|
|
39615
|
+
async function currentSetup() {
|
|
39551
39616
|
await loaded;
|
|
39552
|
-
const
|
|
39553
|
-
return
|
|
39617
|
+
const configFile = await readConfigFile();
|
|
39618
|
+
return {
|
|
39619
|
+
configFile,
|
|
39620
|
+
setup: prFlowSetup(configFile, loadPacks(configFile), state.approvedFingerprints)
|
|
39621
|
+
};
|
|
39622
|
+
}
|
|
39623
|
+
async function runnableActionCommands() {
|
|
39624
|
+
const { setup } = await currentSetup();
|
|
39625
|
+
return setup.commands.actions.filter((action) => setup.approved.has(commandFingerprint("action", action)));
|
|
39554
39626
|
}
|
|
39555
39627
|
async function finishActionRun(disposal, item, run, output) {
|
|
39556
39628
|
run.finishedAt = now();
|
|
@@ -39591,6 +39663,65 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39591
39663
|
external.runAction(action, pr, item).then((output) => finishActionRun(disposal, item, run, output));
|
|
39592
39664
|
return { ok: true };
|
|
39593
39665
|
}
|
|
39666
|
+
async function finishPrActionRun(prKey, startedRun, output) {
|
|
39667
|
+
const current = state.prActionRunByPr[prKey]?.[startedRun.actionId];
|
|
39668
|
+
if (current?.runId !== startedRun.runId || current.state !== "running") return;
|
|
39669
|
+
await persist(withPrActionRun(state, prKey, prActionRunAfterExit(current, output, now())));
|
|
39670
|
+
}
|
|
39671
|
+
async function runPrAction(request) {
|
|
39672
|
+
const { setup } = await currentSetup();
|
|
39673
|
+
const pr = openPrs().find((candidate) => candidate.repo.toLowerCase() === request.repo.toLowerCase() && candidate.number === request.number);
|
|
39674
|
+
if (!pr) return {
|
|
39675
|
+
ok: false,
|
|
39676
|
+
error: "That pull request is no longer open."
|
|
39677
|
+
};
|
|
39678
|
+
if (pr.headRefOid !== request.head) return {
|
|
39679
|
+
ok: false,
|
|
39680
|
+
error: "The pull request has a new head since this view loaded; check it and click again."
|
|
39681
|
+
};
|
|
39682
|
+
const action = prActionsForRepo(setup.commands.prActions, pr.repo).find((candidate) => candidate.id === request.actionId && setup.approved.has(commandFingerprint("pr-action", candidate)));
|
|
39683
|
+
if (!action) return {
|
|
39684
|
+
ok: false,
|
|
39685
|
+
error: "That action is not in prFlows.prActions for this repository, or it waits for your approval in My PRs."
|
|
39686
|
+
};
|
|
39687
|
+
if (state.prActionRunByPr[pr.key]?.[action.id]?.state === "running") return {
|
|
39688
|
+
ok: false,
|
|
39689
|
+
error: `${action.label} is already running on this pull request.`
|
|
39690
|
+
};
|
|
39691
|
+
const runId = crypto.randomUUID();
|
|
39692
|
+
const reportUrl = reportUrlFor(runId);
|
|
39693
|
+
const reportToken = reportUrl === null ? null : crypto.randomBytes(32).toString("base64url");
|
|
39694
|
+
const run = {
|
|
39695
|
+
runId,
|
|
39696
|
+
actionId: action.id,
|
|
39697
|
+
label: action.label,
|
|
39698
|
+
head: pr.headRefOid,
|
|
39699
|
+
startedAt: now(),
|
|
39700
|
+
finishedAt: null,
|
|
39701
|
+
state: "running",
|
|
39702
|
+
message: "",
|
|
39703
|
+
reportToken
|
|
39704
|
+
};
|
|
39705
|
+
await persist(withPrActionRun(state, pr.key, run));
|
|
39706
|
+
const reportEnv = reportUrl === null || reportToken === null ? {} : {
|
|
39707
|
+
[PR_ACTION_REPORT_URL_ENV]: reportUrl,
|
|
39708
|
+
[PR_ACTION_TOKEN_ENV]: reportToken
|
|
39709
|
+
};
|
|
39710
|
+
external.runAction(action, pr, void 0, reportEnv).then((output) => finishPrActionRun(pr.key, run, output));
|
|
39711
|
+
return { ok: true };
|
|
39712
|
+
}
|
|
39713
|
+
async function acceptPrActionReport(runId, presentedToken, body) {
|
|
39714
|
+
await loaded;
|
|
39715
|
+
const reported = Object.entries(state.prActionRunByPr).flatMap(([prKey, runsByAction]) => Object.values(runsByAction).filter((run) => run.runId === runId).map((run) => ({
|
|
39716
|
+
prKey,
|
|
39717
|
+
run
|
|
39718
|
+
})))[0];
|
|
39719
|
+
if (!reported) return 404;
|
|
39720
|
+
const verdict = acceptReport(reported.run, presentedToken, body, now());
|
|
39721
|
+
if (!verdict.ok) return verdict.status;
|
|
39722
|
+
await persist(withPrActionRun(state, reported.prKey, verdict.run));
|
|
39723
|
+
return 200;
|
|
39724
|
+
}
|
|
39594
39725
|
function tellBranchMoved(pr) {
|
|
39595
39726
|
const dueRuns = (actionRunsByPr.get(pr.key) ?? []).filter((run) => !run.isBranchMoveTold && shouldTellBranchMoved(run, pr.headRefOid, now(), BRANCH_MOVED_WINDOW_MS));
|
|
39596
39727
|
if (dueRuns.length === 0) return;
|
|
@@ -39673,16 +39804,14 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39673
39804
|
};
|
|
39674
39805
|
}
|
|
39675
39806
|
async function approve(request) {
|
|
39676
|
-
await
|
|
39677
|
-
|
|
39678
|
-
const approved = new Set(state.approvedFingerprints);
|
|
39679
|
-
if (!pendingApprovals(commands, approved).some((pending) => pending.fingerprint === request.fingerprint)) return {
|
|
39807
|
+
const { setup } = await currentSetup();
|
|
39808
|
+
if (!setup.approvals.some((pending) => pending.fingerprint === request.fingerprint)) return {
|
|
39680
39809
|
ok: false,
|
|
39681
39810
|
error: "That entry changed or is already approved; check the list again."
|
|
39682
39811
|
};
|
|
39683
39812
|
await persist({
|
|
39684
39813
|
...state,
|
|
39685
|
-
approvedFingerprints: [...
|
|
39814
|
+
approvedFingerprints: [...state.approvedFingerprints, request.fingerprint]
|
|
39686
39815
|
});
|
|
39687
39816
|
applyRules();
|
|
39688
39817
|
return { ok: true };
|
|
@@ -39747,14 +39876,13 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39747
39876
|
}
|
|
39748
39877
|
}
|
|
39749
39878
|
async function applyRulesOnce() {
|
|
39750
|
-
await
|
|
39751
|
-
const
|
|
39752
|
-
const commands = prFlowCommands(configFile);
|
|
39753
|
-
const approved = new Set(state.approvedFingerprints);
|
|
39879
|
+
const { configFile, setup } = await currentSetup();
|
|
39880
|
+
const { commands, approved } = setup;
|
|
39754
39881
|
const nextWarnings = new Set(commands.warnings);
|
|
39755
39882
|
const prs = openPrs();
|
|
39756
39883
|
forgetUnconfiguredSourceRuns(new Set(prs.map((pr) => pr.key)), commands.sources, approved);
|
|
39757
|
-
approvals =
|
|
39884
|
+
approvals = setup.approvals;
|
|
39885
|
+
approvedPrActions = commands.prActions.filter((action) => approved.has(commandFingerprint("pr-action", action)));
|
|
39758
39886
|
runnableActions = commands.actions.filter((action) => approved.has(commandFingerprint("action", action))).map(({ id, label }) => ({
|
|
39759
39887
|
id,
|
|
39760
39888
|
label
|
|
@@ -39763,7 +39891,8 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39763
39891
|
for (const pr of prs) {
|
|
39764
39892
|
startDueSources(pr, commands.sources, approved);
|
|
39765
39893
|
tellBranchMoved(pr);
|
|
39766
|
-
const { rules, warnings: ruleWarnings } = prFlowRules(configFile, pr.repo);
|
|
39894
|
+
const { rules: personalRules, warnings: ruleWarnings } = prFlowRules(configFile, pr.repo);
|
|
39895
|
+
const rules = [...personalRules, ...setup.packRules];
|
|
39767
39896
|
for (const warning of [...ruleWarnings, ...unknownActionWarnings(rules, new Set(commands.actions.map((action) => action.id)))]) nextWarnings.add(warning);
|
|
39768
39897
|
for (const planned of plannedActions(pr.key, reviewItemsFor(pr), rules, state, runnableActionIds)) {
|
|
39769
39898
|
if (planned.action.startsWith("run:") && hasActionRunAtHead(pr, planned.item.key, planned.action)) continue;
|
|
@@ -39788,7 +39917,9 @@ function createPrFlowsWiring({ statePath, openPrs, linkedSession, readConfigFile
|
|
|
39788
39917
|
undo,
|
|
39789
39918
|
saveRule,
|
|
39790
39919
|
approve,
|
|
39791
|
-
applyRules
|
|
39920
|
+
applyRules,
|
|
39921
|
+
runPrAction,
|
|
39922
|
+
acceptPrActionReport
|
|
39792
39923
|
};
|
|
39793
39924
|
}
|
|
39794
39925
|
//#endregion
|
|
@@ -47300,7 +47431,7 @@ function createCommitSessions({ storeRoot, runGitFn = runGit, logger, nowFn = Da
|
|
|
47300
47431
|
//#endregion
|
|
47301
47432
|
//#region server/backend/backend-lanes.ts
|
|
47302
47433
|
function createBackendLanes(dependencies) {
|
|
47303
|
-
const { claudeCredentials, config, configStore, sessions, agentSessions, reviewSessions, investigationSessions, closeSessionDataClients, hookRouter, getHookPort, broadcastControl, controlWss, options, notificationManager, telemetry, logger, provenanceWriterId } = dependencies;
|
|
47434
|
+
const { claudeCredentials, config, configStore, sessions, agentSessions, reviewSessions, investigationSessions, closeSessionDataClients, hookRouter, getHookPort, dashboardPort, broadcastControl, controlWss, options, notificationManager, telemetry, logger, provenanceWriterId } = dependencies;
|
|
47304
47435
|
const memoryAdmission = createMemoryAdmission({
|
|
47305
47436
|
readHeadroom: () => readMemoryHeadroom(),
|
|
47306
47437
|
reserveBytesFor: (kind) => memoryReserveBytes(configStore.config, kind),
|
|
@@ -47532,7 +47663,13 @@ function createBackendLanes(dependencies) {
|
|
|
47532
47663
|
github,
|
|
47533
47664
|
external: createPrFlowsExternal({ homeDir: glimmervoidHome }),
|
|
47534
47665
|
broadcast: broadcastControl,
|
|
47535
|
-
log: logger
|
|
47666
|
+
log: logger,
|
|
47667
|
+
reportUrlFor: (runId) => `http://127.0.0.1:${dashboardPort}${prActionReportPath(runId)}`,
|
|
47668
|
+
loadPacks: (configFile) => loadPacks({
|
|
47669
|
+
homeDir: glimmervoidHome,
|
|
47670
|
+
configPaths: packPathsOf(configFile),
|
|
47671
|
+
env: process.env
|
|
47672
|
+
})
|
|
47536
47673
|
});
|
|
47537
47674
|
const issues = createIssuesWiring({
|
|
47538
47675
|
config,
|
|
@@ -49485,6 +49622,31 @@ function createGithubHandlers(context, deps) {
|
|
|
49485
49622
|
}
|
|
49486
49623
|
reply(await prFlows.approve(parsed.data));
|
|
49487
49624
|
}
|
|
49625
|
+
async function handlePrActionRun(msg, ws) {
|
|
49626
|
+
const reply = (outcome) => replyTo(ws, msg, "pr-flow-dispose-result", outcome);
|
|
49627
|
+
const parsed = PrActionRunRequest.safeParse({
|
|
49628
|
+
repo: msg.repo,
|
|
49629
|
+
number: msg.number,
|
|
49630
|
+
actionId: msg.actionId,
|
|
49631
|
+
head: msg.head
|
|
49632
|
+
});
|
|
49633
|
+
if (!parsed.success) {
|
|
49634
|
+
reply({
|
|
49635
|
+
ok: false,
|
|
49636
|
+
error: configIssueMessage(parsed.error)
|
|
49637
|
+
});
|
|
49638
|
+
return;
|
|
49639
|
+
}
|
|
49640
|
+
captureOperatorAction("reviews", "pr-flow-run");
|
|
49641
|
+
if (!prFlows) {
|
|
49642
|
+
reply({
|
|
49643
|
+
ok: false,
|
|
49644
|
+
error: "My pull requests is not running"
|
|
49645
|
+
});
|
|
49646
|
+
return;
|
|
49647
|
+
}
|
|
49648
|
+
reply(await prFlows.runPrAction(parsed.data));
|
|
49649
|
+
}
|
|
49488
49650
|
function connectFrames() {
|
|
49489
49651
|
const frames = [];
|
|
49490
49652
|
const teamReviewStatus = typeof getTeamReviewStatus === "function" ? getTeamReviewStatus() : null;
|
|
@@ -49516,7 +49678,8 @@ function createGithubHandlers(context, deps) {
|
|
|
49516
49678
|
"pr-flow-dispose": handlePrFlowDispose,
|
|
49517
49679
|
"pr-flow-undo": handlePrFlowUndo,
|
|
49518
49680
|
"pr-flow-save-rule": handlePrFlowSaveRule,
|
|
49519
|
-
"pr-flow-approve": handlePrFlowApprove
|
|
49681
|
+
"pr-flow-approve": handlePrFlowApprove,
|
|
49682
|
+
"pr-action-run": handlePrActionRun
|
|
49520
49683
|
},
|
|
49521
49684
|
invalidReplies: {
|
|
49522
49685
|
"list-github-teams": (_msg, requestId, message) => ({
|
|
@@ -49609,6 +49772,12 @@ function createGithubHandlers(context, deps) {
|
|
|
49609
49772
|
requestId,
|
|
49610
49773
|
ok: false,
|
|
49611
49774
|
error: message
|
|
49775
|
+
}),
|
|
49776
|
+
"pr-action-run": (_msg, requestId, message) => ({
|
|
49777
|
+
type: "pr-flow-dispose-result",
|
|
49778
|
+
requestId,
|
|
49779
|
+
ok: false,
|
|
49780
|
+
error: message
|
|
49612
49781
|
})
|
|
49613
49782
|
},
|
|
49614
49783
|
connectFrames,
|
|
@@ -57840,6 +58009,7 @@ function createBackend(httpServer, options = {}) {
|
|
|
57840
58009
|
getAgentApi: () => agentApi,
|
|
57841
58010
|
getShownFiles: () => shownFiles,
|
|
57842
58011
|
getWhiteboardAssets: () => whiteboards.assets,
|
|
58012
|
+
getPrActionReports: () => laneAssembly.prFlows,
|
|
57843
58013
|
sshSigner,
|
|
57844
58014
|
recordOutcome,
|
|
57845
58015
|
logger: console
|
|
@@ -57937,6 +58107,7 @@ function createBackend(httpServer, options = {}) {
|
|
|
57937
58107
|
closeSessionDataClients,
|
|
57938
58108
|
hookRouter,
|
|
57939
58109
|
getHookPort,
|
|
58110
|
+
dashboardPort: port,
|
|
57940
58111
|
broadcastControl,
|
|
57941
58112
|
controlWss,
|
|
57942
58113
|
options,
|
|
@@ -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-Bqag5_2n.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-C3nVcK84.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
//#region server/text-format.ts
|
|
6
6
|
function trimIso(iso) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
2
|
import { n as glimmervoidHomeDir, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
3
|
-
import {
|
|
3
|
+
import { dn as PrActionReportBody, h as AgentSettingsReply, ln as PR_ACTION_REPORT_URL_ENV, un as PR_ACTION_TOKEN_ENV, wn as PrFlowsState } from "./session-D0gNPAv6.js";
|
|
4
4
|
import { c as runCommandSafely } from "./child-process-safe-BIh8yQ0I.js";
|
|
5
5
|
import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
|
|
6
|
-
import {
|
|
6
|
+
import { T as unknownActionWarnings, _ as prFlowCommands, f as packApproval, o as commandFingerprint, r as readPackDir, s as expandPlaceholders, t as createPrFlowsExternal, v as prFlowRules } from "./pr-flows-external-CbLPEQzZ.js";
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import os from "node:os";
|
|
@@ -20,8 +20,18 @@ var ACTION_PLACEHOLDERS = [
|
|
|
20
20
|
"itemPath",
|
|
21
21
|
"itemLine"
|
|
22
22
|
];
|
|
23
|
+
var PLACEHOLDERS_BY_KIND = {
|
|
24
|
+
source: SOURCE_PLACEHOLDERS,
|
|
25
|
+
action: ACTION_PLACEHOLDERS,
|
|
26
|
+
"pr-action": [
|
|
27
|
+
...SOURCE_PLACEHOLDERS,
|
|
28
|
+
"headRef",
|
|
29
|
+
"baseRef"
|
|
30
|
+
]
|
|
31
|
+
};
|
|
23
32
|
var GH_TIMEOUT_MS = 3e4;
|
|
24
33
|
var GH_OUTPUT_MAX_BYTES = 65536;
|
|
34
|
+
var REPORT_TIMEOUT_MS = 15e3;
|
|
25
35
|
var PR_FLOWS_SETTING_KEYS = [
|
|
26
36
|
"sources",
|
|
27
37
|
"actions",
|
|
@@ -118,7 +128,7 @@ async function readServerConfig(askSetting) {
|
|
|
118
128
|
};
|
|
119
129
|
}
|
|
120
130
|
async function readConfigFromServer() {
|
|
121
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
131
|
+
const { askAgentApi } = await import("./agent-api-cli-ivGOfIyv.js");
|
|
122
132
|
return readServerConfig((settingPath) => askAgentApi("settings", {
|
|
123
133
|
command: "get",
|
|
124
134
|
path: settingPath
|
|
@@ -213,9 +223,68 @@ async function runPrFlowsCheck(options, io) {
|
|
|
213
223
|
return 1;
|
|
214
224
|
}
|
|
215
225
|
}
|
|
226
|
+
function checkPack(packDir, env, homeDir) {
|
|
227
|
+
const read = readPackDir(packDir, env);
|
|
228
|
+
if (!read.ok) return {
|
|
229
|
+
packDir: path.resolve(packDir),
|
|
230
|
+
name: null,
|
|
231
|
+
isApproved: false,
|
|
232
|
+
errors: read.errors,
|
|
233
|
+
missingRequires: [],
|
|
234
|
+
entries: [],
|
|
235
|
+
rules: []
|
|
236
|
+
};
|
|
237
|
+
const approval = packApproval(read.pack);
|
|
238
|
+
const entries = (approval.pack?.commands ?? []).map((command) => {
|
|
239
|
+
const names = PLACEHOLDERS_BY_KIND[command.kind];
|
|
240
|
+
const expanded = expandPlaceholders(command.command, Object.fromEntries(names.map((name) => [name, `{${name}}`])));
|
|
241
|
+
const error = expanded.ok ? null : `{${expanded.unknown}} is not a placeholder here; use {packDir}, ${names.map((name) => `{${name}}`).join(", ")}`;
|
|
242
|
+
return {
|
|
243
|
+
kind: command.kind,
|
|
244
|
+
id: command.id,
|
|
245
|
+
label: command.label,
|
|
246
|
+
argv: command.command,
|
|
247
|
+
error
|
|
248
|
+
};
|
|
249
|
+
});
|
|
250
|
+
const { pack } = read.pack;
|
|
251
|
+
return {
|
|
252
|
+
packDir: read.pack.dir,
|
|
253
|
+
name: approval.label,
|
|
254
|
+
isApproved: approvedFingerprints(homeDir).has(read.pack.fingerprint),
|
|
255
|
+
errors: unknownActionWarnings(pack.rules, new Set(pack.actions.map((action) => action.id))),
|
|
256
|
+
missingRequires: read.pack.missingRequires,
|
|
257
|
+
entries,
|
|
258
|
+
rules: approval.pack?.rules ?? []
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function packReportText(report) {
|
|
262
|
+
return [
|
|
263
|
+
report.name === null ? `Checked the pack at ${report.packDir}` : `Checked pack ${report.name} at ${report.packDir}, ${report.isApproved ? "approved" : "waits for approval in My PRs"}`,
|
|
264
|
+
...report.entries.map((entry) => `${entry.kind} ${entry.id} (${entry.label}): ${entry.error === null ? `valid\n would run ${JSON.stringify(entry.argv)}` : `invalid, ${entry.error}`}`),
|
|
265
|
+
...report.rules.map((rule) => `rule ${rule}`),
|
|
266
|
+
...report.errors.map((error) => `error: ${error}`),
|
|
267
|
+
...report.missingRequires.map((missing) => `missing on this machine: ${missing}, so the pack stays off here`)
|
|
268
|
+
].join("\n");
|
|
269
|
+
}
|
|
270
|
+
function runPackCheck({ packDir, isJson, env, homeDir }, io) {
|
|
271
|
+
const report = checkPack(packDir, env, homeDir);
|
|
272
|
+
io.writeOutput(`${isJson ? JSON.stringify(report, null, 2) : packReportText(report)}\n`);
|
|
273
|
+
return report.errors.length > 0 || report.missingRequires.length > 0 || report.entries.some((entry) => entry.error !== null) ? 1 : 0;
|
|
274
|
+
}
|
|
216
275
|
async function runPrFlowsCheckCli(parsed) {
|
|
217
276
|
const env = process.env;
|
|
218
277
|
const homeDir = glimmervoidHomeDir(os.homedir(), env);
|
|
278
|
+
const io = {
|
|
279
|
+
writeOutput: (text) => process.stdout.write(text),
|
|
280
|
+
writeError: (text) => process.stderr.write(text)
|
|
281
|
+
};
|
|
282
|
+
if (typeof parsed.values.pack === "string") return runPackCheck({
|
|
283
|
+
packDir: parsed.values.pack,
|
|
284
|
+
isJson: parsed.values.json === true,
|
|
285
|
+
env,
|
|
286
|
+
homeDir
|
|
287
|
+
}, io);
|
|
219
288
|
const readConfig = env["GLIMMERVOID_AGENT_URL"] ? readConfigFromServer : () => readConfigFile(env, homeDir);
|
|
220
289
|
return runPrFlowsCheck({
|
|
221
290
|
prUrl: typeof parsed.values.pr === "string" ? parsed.values.pr : null,
|
|
@@ -224,10 +293,54 @@ async function runPrFlowsCheckCli(parsed) {
|
|
|
224
293
|
homeDir,
|
|
225
294
|
runCommand: runCommandSafely,
|
|
226
295
|
readConfig
|
|
296
|
+
}, io);
|
|
297
|
+
}
|
|
298
|
+
function refusalText(replyText) {
|
|
299
|
+
const reply = parseJsonOrNull(replyText);
|
|
300
|
+
if (reply !== null && typeof reply === "object" && "error" in reply && typeof reply.error === "string") return reply.error;
|
|
301
|
+
return replyText.trim() || "no reply";
|
|
302
|
+
}
|
|
303
|
+
async function runPrActionReport({ outcome, message, env }, io) {
|
|
304
|
+
const reportUrl = env[PR_ACTION_REPORT_URL_ENV];
|
|
305
|
+
const token = env[PR_ACTION_TOKEN_ENV];
|
|
306
|
+
if (!reportUrl || !token) {
|
|
307
|
+
io.writeError(`pr-action report runs from a PR action command or a process it started: ${PR_ACTION_REPORT_URL_ENV} and ${PR_ACTION_TOKEN_ENV} are not set\n`);
|
|
308
|
+
return 1;
|
|
309
|
+
}
|
|
310
|
+
const body = PrActionReportBody.safeParse({
|
|
311
|
+
outcome,
|
|
312
|
+
...message === null ? {} : { message }
|
|
313
|
+
});
|
|
314
|
+
if (!body.success) {
|
|
315
|
+
io.writeError("--outcome must be started, done, failed or refused, and --message at most 500 characters\n");
|
|
316
|
+
return 1;
|
|
317
|
+
}
|
|
318
|
+
const { postToAgentIngress } = await import("./agent-api-cli-ivGOfIyv.js");
|
|
319
|
+
const reply = await postToAgentIngress({
|
|
320
|
+
endpoint: new URL(reportUrl),
|
|
321
|
+
token,
|
|
322
|
+
body: body.data,
|
|
323
|
+
deadline: AbortSignal.timeout(REPORT_TIMEOUT_MS)
|
|
324
|
+
}).catch((error) => ({
|
|
325
|
+
hasSuccessStatus: false,
|
|
326
|
+
text: JSON.stringify({ error: `could not reach Glimmervoid: ${errorMessage(error)}` })
|
|
327
|
+
}));
|
|
328
|
+
if (!reply.hasSuccessStatus) {
|
|
329
|
+
io.writeError(`Glimmervoid did not take the report: ${refusalText(reply.text)}\n`);
|
|
330
|
+
return 1;
|
|
331
|
+
}
|
|
332
|
+
io.writeOutput(`Reported ${body.data.outcome}\n`);
|
|
333
|
+
return 0;
|
|
334
|
+
}
|
|
335
|
+
async function runPrActionReportCli(parsed) {
|
|
336
|
+
return runPrActionReport({
|
|
337
|
+
outcome: typeof parsed.values.outcome === "string" ? parsed.values.outcome : null,
|
|
338
|
+
message: typeof parsed.values.message === "string" ? parsed.values.message : null,
|
|
339
|
+
env: process.env
|
|
227
340
|
}, {
|
|
228
341
|
writeOutput: (text) => process.stdout.write(text),
|
|
229
342
|
writeError: (text) => process.stderr.write(text)
|
|
230
343
|
});
|
|
231
344
|
}
|
|
232
345
|
//#endregion
|
|
233
|
-
export { runPrFlowsCheckCli };
|
|
346
|
+
export { runPrActionReportCli, runPrFlowsCheckCli };
|