glimmervoid 0.52.2-next.706 → 0.52.2-next.708
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 +16 -16
- package/dist/chunks/{adapters-w5GOkhlK.js → adapters-BX-ML3PF.js} +1 -1
- package/dist/chunks/{adapters-FEi1xOts.js → adapters-Bk606HYU.js} +7 -6
- package/dist/chunks/agent-api-cli-CN904-o8.js +1 -0
- package/dist/chunks/{agent-api-cli-BLyR79E3.js → agent-api-cli-D5i6Aaxk.js} +3 -3
- package/dist/chunks/{agent-api-core-Cnkg8Qam.js → agent-api-core-Bxc1V6IS.js} +10 -5
- package/dist/chunks/{agent-setup-cli-DAEX4Z0H.js → agent-setup-cli-CNfGVi5N.js} +1 -1
- package/dist/chunks/{config-DiPt3I6q.js → config-BmJ9RqVi.js} +2 -2
- package/dist/chunks/{config-store-Dl4nSG10.js → config-store-6XipBvYu.js} +2 -2
- package/dist/chunks/config-store-VDlYwv_U.js +1 -0
- package/dist/chunks/{grok-DWvNECgc.js → grok-BXZnhs-i.js} +1 -1
- package/dist/chunks/kimi-DRku5Zt9.js +1 -0
- package/dist/chunks/{kimi-BcXGiuND.js → kimi-DU7pXLJd.js} +2 -2
- package/dist/chunks/{main-BV_28mSY.js → main-fJ2P1CXK.js} +64 -18
- package/dist/chunks/{pack-agent-DmA2Vt3T.js → pack-agent-kPL1_C11.js} +92 -46
- package/dist/chunks/{pack-bridge-CBJNhZ1u.js → pack-bridge-DT97V0M_.js} +2 -2
- package/dist/chunks/packs-cli-BGjPjwjC.js +1 -0
- package/dist/chunks/{packs-cli-DC4Rgn1_.js → packs-cli-wE9e0PRp.js} +38 -21
- package/dist/chunks/{pair-cli-BEwh_FPN.js → pair-cli-2uiU5BkX.js} +2 -2
- package/dist/chunks/{pr-flows-cli-BzxqbfoY.js → pr-flows-cli-CC5XrR6y.js} +6 -6
- package/dist/chunks/{pr-flows-external-nV8Twsr3.js → pr-flows-external-DoqZWZkV.js} +3 -3
- package/dist/chunks/{remote-config-DTMfaggb.js → remote-config-F5lysUVX.js} +1 -1
- package/dist/chunks/{session-HrWPtZq1.js → session-Ctzyy3sF.js} +40 -3
- package/dist/chunks/{settings-cli-Cd2kd5Wg.js → settings-cli-DDupUmFE.js} +5 -5
- package/dist/chunks/{settings-readout-core-CbuMpDHd.js → settings-readout-core-Dx_X8p0M.js} +2 -2
- package/dist/chunks/{shown-files-core-CfDLqQo9.js → shown-files-core-AKNIXRfL.js} +1 -1
- package/dist/chunks/{spawn-env-BEzcqK8w.js → spawn-env-D9Gtgndb.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-EAue_bXT.js → ssh-sign-cli-DSCqRc-5.js} +2 -2
- package/dist/client/assets/{action-status-BQU6d-0z.js → action-status-rxc5WGWV.js} +1 -1
- package/dist/client/assets/action-status-rxc5WGWV.js.br +0 -0
- package/dist/client/assets/{arena-panel-AjJoLggu.js → arena-panel-CgwxuLWb.js} +2 -2
- package/dist/client/assets/arena-panel-CgwxuLWb.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-CW7jbdMX.js → benchmark-panel-BIcVedub.js} +1 -1
- package/dist/client/assets/benchmark-panel-BIcVedub.js.br +0 -0
- package/dist/client/assets/{boards-view-DT8i2XJk.js → boards-view-C1u-KlqJ.js} +1 -1
- package/dist/client/assets/boards-view-C1u-KlqJ.js.br +0 -0
- package/dist/client/assets/button-D4yLJK3N.js +1 -0
- package/dist/client/assets/button-D4yLJK3N.js.br +0 -0
- package/dist/client/assets/{card-actions-DZRZp3KM.js → card-actions-DOYXIR7t.js} +1 -1
- package/dist/client/assets/{card-registry-D77jxFPD.js → card-registry-DY8mP3KR.js} +1 -1
- package/dist/client/assets/card-registry-DY8mP3KR.js.br +0 -0
- package/dist/client/assets/{community-panel-DtyJrApz.js → community-panel-CRvvVI2B.js} +1 -1
- package/dist/client/assets/community-panel-CRvvVI2B.js.br +0 -0
- package/dist/client/assets/{control-ws-BzcRTVte.js → control-ws-CtahMJLs.js} +1 -1
- package/dist/client/assets/control-ws-CtahMJLs.js.br +0 -0
- package/dist/client/assets/{dialogs-L__wqQUK.js → dialogs-QpWe8tYR.js} +1 -1
- package/dist/client/assets/dialogs-QpWe8tYR.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-Ct-3PA3w.js → doc-editor-ui-CWYq9l3O.js} +1 -1
- package/dist/client/assets/doc-editor-ui-CWYq9l3O.js.br +0 -0
- package/dist/client/assets/{feature-hint-DO_DvoKz.js → feature-hint-CPruSUQQ.js} +1 -1
- package/dist/client/assets/feature-hint-CPruSUQQ.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-B8upa8oo.js → first-run-checklist-CrmMbDto.js} +1 -1
- package/dist/client/assets/first-run-checklist-CrmMbDto.js.br +0 -0
- package/dist/client/assets/{hooks-panel-DXlObkii.js → hooks-panel-CRi-pBko.js} +1 -1
- package/dist/client/assets/hooks-panel-CRi-pBko.js.br +0 -0
- package/dist/client/assets/{index-BxFSLYlN.js → index-DF_ZqCN9.js} +5 -5
- package/dist/client/assets/index-DF_ZqCN9.js.br +0 -0
- package/dist/client/assets/{issues-panel-D2cJ3cqU.js → issues-panel-aNzgk8Qi.js} +1 -1
- package/dist/client/assets/issues-panel-aNzgk8Qi.js.br +0 -0
- package/dist/client/assets/{lane-read-token-step-F5zq469Q.js → lane-read-token-step-Dx0p5ncV.js} +1 -1
- package/dist/client/assets/lane-read-token-step-Dx0p5ncV.js.br +0 -0
- package/dist/client/assets/{menu-BL0J9l3S.js → menu-CHluFLPe.js} +1 -1
- package/dist/client/assets/menu-CHluFLPe.js.br +0 -0
- package/dist/client/assets/{modal-CnO3B835.js → modal-C1JTHud7.js} +1 -1
- package/dist/client/assets/modal-C1JTHud7.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-CVGpeiwd.js → my-prs-panel-CnrlE63z.js} +1 -1
- package/dist/client/assets/my-prs-panel-CnrlE63z.js.br +0 -0
- package/dist/client/assets/{nyan-cat-DQRca_5t.js → nyan-cat-mPnve7BB.js} +1 -1
- package/dist/client/assets/nyan-cat-mPnve7BB.js.br +0 -0
- package/dist/client/assets/{phone-shell-LTYn4b4i.js → phone-shell-CTFOZGGW.js} +1 -1
- package/dist/client/assets/phone-shell-CTFOZGGW.js.br +0 -0
- package/dist/client/assets/{plan-face-TtPyLtNT.js → plan-face-CF_QCsCU.js} +1 -1
- package/dist/client/assets/plan-face-CF_QCsCU.js.br +0 -0
- package/dist/client/assets/{plan-render-Caz0lc1C.js → plan-render-0rzZFxUD.js} +1 -1
- package/dist/client/assets/plan-render-0rzZFxUD.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-DL1gIz6A.js → pr-queue-columns-BsZuoV92.js} +1 -1
- package/dist/client/assets/pr-queue-columns-BsZuoV92.js.br +0 -0
- package/dist/client/assets/{pr-status-icon-BL8wzUBO.js → pr-status-icon-CZbk4RGh.js} +1 -1
- package/dist/client/assets/pr-status-icon-CZbk4RGh.js.br +0 -0
- package/dist/client/assets/{radar-panel-D91HsOd5.js → radar-panel-_JSo56D3.js} +1 -1
- package/dist/client/assets/radar-panel-_JSo56D3.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-CkSWCkOO.js → repo-roots-adder-M_SovKoK.js} +1 -1
- package/dist/client/assets/repo-roots-adder-M_SovKoK.js.br +0 -0
- package/dist/client/assets/{resume-dialog-W-Vtr8To.js → resume-dialog-D6diNkLk.js} +1 -1
- package/dist/client/assets/resume-dialog-D6diNkLk.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-B7IW6EHG.js → review-queue-panel-BImDcTcl.js} +1 -1
- package/dist/client/assets/review-queue-panel-BImDcTcl.js.br +0 -0
- package/dist/client/assets/{session-actions-CPzKt0MK.js → session-actions-DZTeFJNl.js} +2 -2
- package/dist/client/assets/session-actions-DZTeFJNl.js.br +0 -0
- package/dist/client/assets/{session-row-ly74TkCe.js → session-row-DQP4Da-K.js} +1 -1
- package/dist/client/assets/session-row-DQP4Da-K.js.br +0 -0
- package/dist/client/assets/{session-tick-CbiHcZQf.js → session-tick-BqAW_8XQ.js} +1 -1
- package/dist/client/assets/session-tick-BqAW_8XQ.js.br +0 -0
- package/dist/client/assets/{settings-panel-CXvPbm4F.js → settings-panel-BYqmKxyz.js} +2 -2
- package/dist/client/assets/settings-panel-BYqmKxyz.js.br +0 -0
- package/dist/client/assets/{setup-step-D6yDe11H.js → setup-step-ChXUUNTF.js} +1 -1
- package/dist/client/assets/setup-step-ChXUUNTF.js.br +0 -0
- package/dist/client/assets/{shown-face-DULqlLhV.js → shown-face-BmNrB5U7.js} +1 -1
- package/dist/client/assets/shown-face-BmNrB5U7.js.br +0 -0
- package/dist/client/assets/{trace-panel-DBnYJgFw.js → trace-panel-CvQlfT_x.js} +1 -1
- package/dist/client/assets/trace-panel-CvQlfT_x.js.br +0 -0
- package/dist/client/assets/{usage-panel-Cip2a7Fe.js → usage-panel-ChL8RmsD.js} +1 -1
- package/dist/client/assets/usage-panel-ChL8RmsD.js.br +0 -0
- package/dist/client/assets/{your-day-tip-CrJzhb9V.js → your-day-tip-BeTm3C4g.js} +1 -1
- package/dist/client/assets/your-day-tip-BeTm3C4g.js.br +0 -0
- package/dist/client/index.html +12 -12
- package/dist/client/index.html.br +0 -0
- package/dist/schema/pack.v1.json +6 -3
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/agent-api-cli-DVs4BeP_.js +0 -1
- package/dist/chunks/config-store-C9ynPe9J.js +0 -1
- package/dist/chunks/kimi-C74ElgUz.js +0 -1
- package/dist/chunks/packs-cli-p3uDBJco.js +0 -1
- package/dist/client/assets/action-status-BQU6d-0z.js.br +0 -0
- package/dist/client/assets/arena-panel-AjJoLggu.js.br +0 -0
- package/dist/client/assets/benchmark-panel-CW7jbdMX.js.br +0 -0
- package/dist/client/assets/boards-view-DT8i2XJk.js.br +0 -0
- package/dist/client/assets/button-B30QfKTN.js +0 -1
- package/dist/client/assets/button-B30QfKTN.js.br +0 -0
- package/dist/client/assets/card-registry-D77jxFPD.js.br +0 -0
- package/dist/client/assets/community-panel-DtyJrApz.js.br +0 -0
- package/dist/client/assets/control-ws-BzcRTVte.js.br +0 -0
- package/dist/client/assets/dialogs-L__wqQUK.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-Ct-3PA3w.js.br +0 -0
- package/dist/client/assets/feature-hint-DO_DvoKz.js.br +0 -0
- package/dist/client/assets/first-run-checklist-B8upa8oo.js.br +0 -0
- package/dist/client/assets/hooks-panel-DXlObkii.js.br +0 -0
- package/dist/client/assets/index-BxFSLYlN.js.br +0 -0
- package/dist/client/assets/issues-panel-D2cJ3cqU.js.br +0 -0
- package/dist/client/assets/lane-read-token-step-F5zq469Q.js.br +0 -0
- package/dist/client/assets/menu-BL0J9l3S.js.br +0 -0
- package/dist/client/assets/modal-CnO3B835.js.br +0 -0
- package/dist/client/assets/my-prs-panel-CVGpeiwd.js.br +0 -0
- package/dist/client/assets/nyan-cat-DQRca_5t.js.br +0 -0
- package/dist/client/assets/phone-shell-LTYn4b4i.js.br +0 -0
- package/dist/client/assets/plan-face-TtPyLtNT.js.br +0 -0
- package/dist/client/assets/plan-render-Caz0lc1C.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-DL1gIz6A.js.br +0 -3
- package/dist/client/assets/pr-status-icon-BL8wzUBO.js.br +0 -0
- package/dist/client/assets/radar-panel-D91HsOd5.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-CkSWCkOO.js.br +0 -0
- package/dist/client/assets/resume-dialog-W-Vtr8To.js.br +0 -0
- package/dist/client/assets/review-queue-panel-B7IW6EHG.js.br +0 -0
- package/dist/client/assets/session-actions-CPzKt0MK.js.br +0 -0
- package/dist/client/assets/session-row-ly74TkCe.js.br +0 -0
- package/dist/client/assets/session-tick-CbiHcZQf.js.br +0 -0
- package/dist/client/assets/settings-panel-CXvPbm4F.js.br +0 -0
- package/dist/client/assets/setup-step-D6yDe11H.js.br +0 -2
- package/dist/client/assets/shown-face-DULqlLhV.js.br +0 -0
- package/dist/client/assets/trace-panel-DBnYJgFw.js.br +0 -0
- package/dist/client/assets/usage-panel-Cip2a7Fe.js.br +0 -0
- package/dist/client/assets/your-day-tip-CrJzhb9V.js.br +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
|
-
import { En as
|
|
3
|
-
import { i as ThemePalette, n as packBridgeJsonSchemaText, t as PackBridgeTopic } from "./pack-bridge-
|
|
2
|
+
import { Cn as PrFlowPrAction, En as PrFlowScopedCommand, In as prFlowRulesJsonSchema, Nn as RepoScope, On as PrFlowsSettings, fn as PR_FLOW_PLACEHOLDERS_BY_KIND, gn as PrFlowCommand, wn as PrFlowRule, xn as PrFlowPackRequires, yn as PrFlowItemAction } from "./session-Ctzyy3sF.js";
|
|
3
|
+
import { i as ThemePalette, n as packBridgeJsonSchemaText, t as PackBridgeTopic } from "./pack-bridge-DT97V0M_.js";
|
|
4
4
|
import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
|
|
5
|
-
import { n as withoutGlimmervoidSecrets } from "./spawn-env-
|
|
5
|
+
import { n as withoutGlimmervoidSecrets } from "./spawn-env-D9Gtgndb.js";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { z } from "zod";
|
|
@@ -741,13 +741,19 @@ var PACK_PANEL_CONTENT_POLICY = [
|
|
|
741
741
|
function packFileMime(filePath) {
|
|
742
742
|
return PACK_FILE_MIME_BY_EXTENSION[path.posix.extname(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
743
743
|
}
|
|
744
|
-
|
|
745
|
-
|
|
744
|
+
var OPAQUE_ORIGIN = "null";
|
|
745
|
+
function packFileHeaders(filePath, requestOrigin) {
|
|
746
|
+
const headers = {
|
|
746
747
|
"Content-Security-Policy": PACK_PANEL_CONTENT_POLICY,
|
|
747
748
|
"X-Content-Type-Options": "nosniff",
|
|
748
749
|
"Referrer-Policy": "no-referrer",
|
|
749
|
-
"Content-Type": packFileMime(filePath)
|
|
750
|
+
"Content-Type": packFileMime(filePath),
|
|
751
|
+
Vary: "Origin"
|
|
750
752
|
};
|
|
753
|
+
return requestOrigin === OPAQUE_ORIGIN ? {
|
|
754
|
+
...headers,
|
|
755
|
+
"Access-Control-Allow-Origin": OPAQUE_ORIGIN
|
|
756
|
+
} : headers;
|
|
751
757
|
}
|
|
752
758
|
function uiSectionErrors(pack) {
|
|
753
759
|
return pack.ui && !pack.ui.ok ? pack.ui.errors : [];
|
|
@@ -823,10 +829,54 @@ function attributeUrls(attributeName, value) {
|
|
|
823
829
|
if (!attributeName.toLowerCase().endsWith("srcset")) return [value];
|
|
824
830
|
return value.split(",").map((candidate) => candidate.trim().split(/\s+/)[0] ?? "");
|
|
825
831
|
}
|
|
826
|
-
|
|
832
|
+
var JS_IMPORT_PATTERN = new RegExp(`\\b(?:import|export)\\b[^;'"]{0,${MAX_REFERENCE_LENGTH}}?\\bfrom\\s{0,64}["']([^"']{1,${MAX_REFERENCE_LENGTH}})["']|\\bimport\\s{0,64}\\(?\\s{0,64}["']([^"']{1,${MAX_REFERENCE_LENGTH}})["']`, "g");
|
|
833
|
+
var LINE_COMMENT_PATTERN = /^[ \t]*\/\/.*$/gm;
|
|
834
|
+
var RELATIVE_IMPORT_PATTERN = /^\.{1,2}\//;
|
|
835
|
+
function isScriptFile(filePath) {
|
|
836
|
+
return filePath.endsWith(".js") || filePath.endsWith(".mjs");
|
|
837
|
+
}
|
|
838
|
+
function jsImportsIn(text) {
|
|
839
|
+
return [...withoutDelimited(text, "/*", "*/").replace(LINE_COMMENT_PATTERN, "").matchAll(JS_IMPORT_PATTERN)].map((match) => ({
|
|
840
|
+
url: match[1] ?? match[2] ?? "",
|
|
841
|
+
isImport: true
|
|
842
|
+
}));
|
|
843
|
+
}
|
|
844
|
+
function linkReferences(urls) {
|
|
845
|
+
return urls.map((url) => ({
|
|
846
|
+
url,
|
|
847
|
+
isImport: false
|
|
848
|
+
}));
|
|
849
|
+
}
|
|
850
|
+
function inlineScriptsIn(html) {
|
|
851
|
+
const scriptBodies = [];
|
|
852
|
+
const lowerHtml = html.toLowerCase();
|
|
853
|
+
let cursor = 0;
|
|
854
|
+
while (cursor < html.length) {
|
|
855
|
+
const openAt = lowerHtml.indexOf("<script", cursor);
|
|
856
|
+
const bodyStart = openAt === -1 ? -1 : lowerHtml.indexOf(">", openAt);
|
|
857
|
+
const closeAt = bodyStart === -1 ? -1 : lowerHtml.indexOf("<\/script", bodyStart);
|
|
858
|
+
if (closeAt === -1) return scriptBodies;
|
|
859
|
+
scriptBodies.push(html.slice(bodyStart + 1, closeAt));
|
|
860
|
+
cursor = closeAt;
|
|
861
|
+
}
|
|
862
|
+
return scriptBodies;
|
|
863
|
+
}
|
|
864
|
+
function rawReferencesIn(filePath, text) {
|
|
865
|
+
if (isScriptFile(filePath)) return jsImportsIn(text);
|
|
827
866
|
const withoutComments = withoutDelimited(withoutDelimited(text, "<!--", "-->"), "/*", "*/");
|
|
828
|
-
const cssReferences = [...withoutComments.matchAll(CSS_REFERENCE_PATTERN)].map((match) => match[1] ?? match[2] ?? "");
|
|
829
|
-
|
|
867
|
+
const cssReferences = linkReferences([...withoutComments.matchAll(CSS_REFERENCE_PATTERN)].map((match) => match[1] ?? match[2] ?? ""));
|
|
868
|
+
if (!filePath.endsWith(".html")) return cssReferences;
|
|
869
|
+
return [
|
|
870
|
+
...linkReferences([...withoutComments.matchAll(HTML_REFERENCE_PATTERN)].flatMap((match) => attributeUrls(match[1] ?? "", match[2] ?? match[3] ?? match[4] ?? ""))),
|
|
871
|
+
...inlineScriptsIn(withoutComments).flatMap(jsImportsIn),
|
|
872
|
+
...cssReferences
|
|
873
|
+
];
|
|
874
|
+
}
|
|
875
|
+
function referencesIn(filePath, text) {
|
|
876
|
+
return rawReferencesIn(filePath, text).map((reference) => ({
|
|
877
|
+
...reference,
|
|
878
|
+
url: reference.url.trim()
|
|
879
|
+
})).filter((reference) => reference.url !== "" && !INERT_REFERENCE_PATTERN.test(reference.url));
|
|
830
880
|
}
|
|
831
881
|
function decodedPath(reference) {
|
|
832
882
|
try {
|
|
@@ -835,22 +885,39 @@ function decodedPath(reference) {
|
|
|
835
885
|
return reference;
|
|
836
886
|
}
|
|
837
887
|
}
|
|
838
|
-
function referenceError(filePath, reference, filesByPath) {
|
|
888
|
+
function referenceError(filePath, { url: reference, isImport }, filesByPath) {
|
|
839
889
|
if (REMOTE_REFERENCE_PATTERN.test(reference)) return `${filePath} loads ${reference}, but a panel has no network; put that file in the pack`;
|
|
840
890
|
if (reference.startsWith("/")) return `${filePath} refers to ${reference}, an absolute path that leaves the pack; use a path relative to ${filePath}`;
|
|
841
|
-
|
|
891
|
+
if (isImport && !RELATIVE_IMPORT_PATTERN.test(reference)) return `${filePath} imports ${reference}, but a panel has no package resolver; import a file in the pack by a path starting with ./ or ../`;
|
|
892
|
+
const referencedPath = referencedPackPath(filePath, reference);
|
|
842
893
|
if (referencedPath.startsWith("../")) return `${filePath} refers to ${reference}, which is outside the pack`;
|
|
843
894
|
return filesByPath.has(referencedPath) ? null : `${filePath} refers to ${reference}, which is not a file in the pack`;
|
|
844
895
|
}
|
|
896
|
+
function referencedPackPath(filePath, reference) {
|
|
897
|
+
return path.posix.normalize(path.posix.join(path.posix.dirname(filePath), decodedPath(reference.replace(/[?#].*$/, ""))));
|
|
898
|
+
}
|
|
845
899
|
function panelReferenceErrors(filesByPath) {
|
|
846
|
-
return [...filesByPath].filter(([filePath]) => filePath.endsWith(".html") || filePath.endsWith(".css")).flatMap(([filePath, bytes]) => referencesIn(filePath, bytes.toString("utf8")).map((reference) => referenceError(filePath, reference, filesByPath)).filter((error) => error !== null));
|
|
900
|
+
return [...filesByPath].filter(([filePath]) => filePath.endsWith(".html") || filePath.endsWith(".css") || isScriptFile(filePath)).flatMap(([filePath, bytes]) => referencesIn(filePath, bytes.toString("utf8")).map((reference) => referenceError(filePath, reference, filesByPath)).filter((error) => error !== null));
|
|
847
901
|
}
|
|
848
902
|
var SUBSCRIBED_TOPICS_PATTERN = /subscribe\(\s*\[([^\]]{0,500})\]|kind\s*:\s*['"]subscribe['"][^}]{0,500}?topics\s*:\s*\[([^\]]{0,500})\]/g;
|
|
849
|
-
function
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
903
|
+
function filesLoadedFrom(entry, filesByPath) {
|
|
904
|
+
const loadedPaths = /* @__PURE__ */ new Set();
|
|
905
|
+
const pendingPaths = [entry];
|
|
906
|
+
while (pendingPaths.length > 0) {
|
|
907
|
+
const filePath = pendingPaths.pop() ?? "";
|
|
908
|
+
const bytes = filesByPath.get(filePath);
|
|
909
|
+
if (loadedPaths.has(filePath) || bytes === void 0) continue;
|
|
910
|
+
loadedPaths.add(filePath);
|
|
911
|
+
if (!filePath.endsWith(".html") && !isScriptFile(filePath)) continue;
|
|
912
|
+
pendingPaths.push(...referencesIn(filePath, bytes.toString("utf8")).filter(({ url }) => !REMOTE_REFERENCE_PATTERN.test(url) && !url.startsWith("/")).map(({ url }) => referencedPackPath(filePath, url)));
|
|
913
|
+
}
|
|
914
|
+
return [...loadedPaths].filter((filePath) => filePath.endsWith(".html") || isScriptFile(filePath));
|
|
915
|
+
}
|
|
916
|
+
function subscribedTopicsIn(text) {
|
|
917
|
+
return [...text.matchAll(SUBSCRIBED_TOPICS_PATTERN)].flatMap((match) => [...(match[1] ?? match[2] ?? "").matchAll(/['"]([^'"]+)['"]/g)].map((topic) => topic[1] ?? ""));
|
|
918
|
+
}
|
|
919
|
+
function undeclaredSubscriptionErrors(filesByPath, panels) {
|
|
920
|
+
return panels.flatMap((panel) => filesLoadedFrom(panel.entry, filesByPath).flatMap((filePath) => [...new Set(subscribedTopicsIn(filesByPath.get(filePath)?.toString("utf8") ?? ""))].filter((topic) => !panel.reads.includes(topic)).map((topic) => `${filePath} subscribes to '${topic}', which panel ${panel.id} does not list under reads, so it never arrives there; add it to that panel's reads or drop it`)));
|
|
854
921
|
}
|
|
855
922
|
//#endregion
|
|
856
923
|
//#region shared/contracts/pack.ts
|
|
@@ -873,7 +940,7 @@ var PackPrFlows = z.strictObject({
|
|
|
873
940
|
repos: RepoScope.describe("The default owner/name repositories for every prAction, source and rule of this pack that lists no repos of its own; every repository when absent"),
|
|
874
941
|
prActions: z.array(PrFlowPrAction).default([]),
|
|
875
942
|
sources: z.array(PrFlowScopedCommand).default([]),
|
|
876
|
-
actions: z.array(
|
|
943
|
+
actions: z.array(PrFlowItemAction).default([]),
|
|
877
944
|
rules: z.array(PrFlowRule).default([])
|
|
878
945
|
}).superRefine((section, context) => {
|
|
879
946
|
for (const kind of [
|
|
@@ -1012,9 +1079,8 @@ function rawPanels(rawUi) {
|
|
|
1012
1079
|
if (rawUi === null || typeof rawUi !== "object" || !("panels" in rawUi) || !Array.isArray(rawUi.panels)) return [];
|
|
1013
1080
|
return rawUi.panels;
|
|
1014
1081
|
}
|
|
1015
|
-
function
|
|
1016
|
-
|
|
1017
|
-
return panels.length === rawPanels(rawUi).length ? new Set(panels.flatMap(({ panel }) => panel.reads)) : null;
|
|
1082
|
+
function declaredPanels(rawUi) {
|
|
1083
|
+
return validRawPanels(rawUi).map(({ panel }) => panel);
|
|
1018
1084
|
}
|
|
1019
1085
|
function validRawPanels(rawUi) {
|
|
1020
1086
|
return rawPanels(rawUi).flatMap((rawPanel, index) => {
|
|
@@ -1167,28 +1233,8 @@ async function packDirsUnder(homeDir) {
|
|
|
1167
1233
|
}
|
|
1168
1234
|
//#endregion
|
|
1169
1235
|
//#region server/packs/pack-check.ts
|
|
1170
|
-
var SOURCE_PLACEHOLDERS = [
|
|
1171
|
-
"prUrl",
|
|
1172
|
-
"repo",
|
|
1173
|
-
"number",
|
|
1174
|
-
"head"
|
|
1175
|
-
];
|
|
1176
|
-
var PR_FLOW_PLACEHOLDERS_BY_KIND = {
|
|
1177
|
-
source: SOURCE_PLACEHOLDERS,
|
|
1178
|
-
action: [
|
|
1179
|
-
...SOURCE_PLACEHOLDERS,
|
|
1180
|
-
"itemPath",
|
|
1181
|
-
"itemLine"
|
|
1182
|
-
],
|
|
1183
|
-
"pr-action": [
|
|
1184
|
-
...SOURCE_PLACEHOLDERS,
|
|
1185
|
-
"headRef",
|
|
1186
|
-
"baseRef"
|
|
1187
|
-
]
|
|
1188
|
-
};
|
|
1189
1236
|
function pageErrors(filesByPath, header) {
|
|
1190
|
-
|
|
1191
|
-
return [...panelReferenceErrors(filesByPath), ...declaredReads ? undeclaredSubscriptionErrors(filesByPath, declaredReads) : []];
|
|
1237
|
+
return [...panelReferenceErrors(filesByPath), ...undeclaredSubscriptionErrors(filesByPath, header ? declaredPanels(header.ui) : [])];
|
|
1192
1238
|
}
|
|
1193
1239
|
async function checkPack(packDir, env, isApprovedFingerprint) {
|
|
1194
1240
|
const read = await readPackDir(packDir, env);
|
|
@@ -1251,7 +1297,7 @@ async function checkPack(packDir, env, isApprovedFingerprint) {
|
|
|
1251
1297
|
};
|
|
1252
1298
|
}
|
|
1253
1299
|
function packCheckHasProblem(report) {
|
|
1254
|
-
return report.errors.length > 0 || report.
|
|
1300
|
+
return report.errors.length > 0 || report.entries.some((entry) => entry.error !== null);
|
|
1255
1301
|
}
|
|
1256
1302
|
function reportHeading(report) {
|
|
1257
1303
|
const checked = report.name === null ? `Checked the pack at ${report.packDir}` : `Checked pack ${report.name} at ${report.packDir}`;
|
|
@@ -1266,7 +1312,7 @@ function packReportText(report) {
|
|
|
1266
1312
|
...report.entries.map((entry) => `${entry.kind} ${entry.id} (${entry.label}): ${entry.error === null ? `valid\n would run ${JSON.stringify(entry.argv)}` : `invalid, ${entry.error}`}`),
|
|
1267
1313
|
...report.rules.map((rule) => `rule ${rule}`),
|
|
1268
1314
|
...report.errors.map((error) => `error: ${error}`),
|
|
1269
|
-
...report.missingRequires.map((missing) => `missing on this machine: ${missing}, so the pack stays off here`)
|
|
1315
|
+
...report.missingRequires.map((missing) => `missing on this machine: ${missing}, so the pack stays off here until it has it; not a problem in the pack`)
|
|
1270
1316
|
].join("\n");
|
|
1271
1317
|
}
|
|
1272
1318
|
//#endregion
|
|
@@ -1290,7 +1336,7 @@ async function packGuideText({ homeDir, examplePacksDir }, schemaLines) {
|
|
|
1290
1336
|
"Sections of pack.json, each checked on its own:",
|
|
1291
1337
|
"- prFlows: commands My PRs runs on pull requests (prActions, sources, actions, rules).",
|
|
1292
1338
|
"- ui.themes: color themes for the Theme picker; every chrome and state color is a #rrggbb hex.",
|
|
1293
|
-
"- ui.panels: HTML pages shown as dashboard tabs. A panel runs sandboxed in an opaque origin: no network, 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, image and font in the pack; inline <script> and <style> work
|
|
1339
|
+
"- ui.panels: HTML pages shown as dashboard tabs. A panel runs sandboxed in an opaque origin: no network, 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, image and font in the pack and refer to it by a relative path; ES module scripts with relative imports, fonts, inline <script> and <style> all work. localStorage, sessionStorage and cookies throw a SecurityError, so a panel keeps its state in memory and loses it on reload. Every panel file is served with this Content-Security-Policy:",
|
|
1294
1340
|
` ${PACK_PANEL_CONTENT_POLICY}`,
|
|
1295
1341
|
"",
|
|
1296
1342
|
"Panel bridge: list the topics a panel needs under its reads in pack.json; the operator sees them before approving. The panel posts {\"v\":1,\"kind\":\"subscribe\",\"topics\":[...]} to window.parent and gets {\"v\":1,\"kind\":\"hello\",\"granted\":[...]}: the subscribed topics that are also in reads, so a topic left out of reads never arrives. Then a {\"v\":1,\"kind\":\"topic\",\"topic\":...,\"data\":...} message comes for each granted topic, right away and again whenever it changes. Accept messages only when event.source === window.parent. The descriptions in the bridge JSON Schema below give each field's units and meaning.",
|
|
@@ -1337,4 +1383,4 @@ async function readPacksForAgent(request, deps) {
|
|
|
1337
1383
|
};
|
|
1338
1384
|
}
|
|
1339
1385
|
//#endregion
|
|
1340
|
-
export {
|
|
1386
|
+
export { prActionRunAfterExit as A, unknownActionWarnings as B, fixLocallyPrompt as C, packPathsOf as D, mergeItems as E, scopedToRepo as F, withPrActionRun as G, withHandled as H, shouldTellBranchMoved as I, decideHostAllowed as J, withReopened as K, sourceCandidates as L, prFlowRules as M, prFlowSetup as N, plannedActions as O, savedRuleFor as P, teammateThreadItems as R, expandPlaceholders as S, itemLocation as T, withInterruptedRuns as U, visibleRun as V, withOnlyOpenPrs as W, packRow as _, packReportText as a, branchMovedNote as b, packsStatePath as c, PACK_FILE_NAME as d, PacksState as f, packFileHeaders as g, approvedPackThemes as h, packCheckHasProblem as i, prFlowCommands as j, prActionPlaceholderValues as k, readApprovedPackFingerprints as l, approvedPackPanels as m, readPacksForAgent as n, PACKS_DIR_NAME as o, packJsonSchemaText as p, withRuleRun as q, checkPack as r, packDirsUnder as s, packGuideText as t, readPackDir as u, pendingPackNote as v, flaggingReviewers as w, commandFingerprint as x, acceptReport as y, threadCandidates as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as STATES } from "./session-Ctzyy3sF.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region shared/contracts/theme-palette.ts
|
|
4
|
-
var HexColor = z.string().regex(/^#[0-9a-fA-F]{6}$/, { error: (issue) => `a color is #rrggbb, not ${JSON.stringify(issue.input)}` });
|
|
4
|
+
var HexColor = z.string().regex(/^#[0-9a-fA-F]{6}$/, { error: (issue) => issue.input === void 0 ? "missing; a theme sets every color as #rrggbb" : `a color is #rrggbb, not ${JSON.stringify(issue.input)}` });
|
|
5
5
|
var ThemeStates = z.strictObject({
|
|
6
6
|
running: HexColor,
|
|
7
7
|
waiting: HexColor,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as runPacksCli } from "./packs-cli-wE9e0PRp.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
2
|
import { a as examplePacksDir } from "./runtime-paths-DfoHzN15.js";
|
|
3
3
|
import { n as glimmervoidHomeDir } from "./config-path-core-DUWk0Lui.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as packBridgeJsonSchemaText, r as THEME_STATE_NAMES, t as PackBridgeTopic } from "./pack-bridge-
|
|
6
|
-
import {
|
|
4
|
+
import { $n as STATES, Ln as prFlowsOutputJsonSchemaText, n as AGENT_REPLY_SCHEMAS } from "./session-Ctzyy3sF.js";
|
|
5
|
+
import { n as packBridgeJsonSchemaText, r as THEME_STATE_NAMES, t as PackBridgeTopic } from "./pack-bridge-DT97V0M_.js";
|
|
6
|
+
import { J as decideHostAllowed, a as packReportText, g as packFileHeaders, i as packCheckHasProblem, l as readApprovedPackFingerprints, p as packJsonSchemaText, r as checkPack, t as packGuideText, u as readPackDir } from "./pack-agent-kPL1_C11.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
import http from "node:http";
|
|
@@ -61,7 +61,16 @@ var SAMPLE_PULL_REQUEST = {
|
|
|
61
61
|
url: "https://github.com/acme/app/pull/42",
|
|
62
62
|
author: "sample-author"
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
var SAMPLE_REVIEW_NEEDING_ATTENTION = {
|
|
65
|
+
key: "acme/api#9",
|
|
66
|
+
title: "Retry webhook deliveries",
|
|
67
|
+
url: "https://github.com/acme/api/pull/9",
|
|
68
|
+
author: "other-author"
|
|
69
|
+
};
|
|
70
|
+
var PREVIEW_FRAME_MS = 5e3;
|
|
71
|
+
function previewSampleTopics(nowMs, frameIndex = 0) {
|
|
72
|
+
const isLoginBugWaiting = frameIndex % 2 === 0;
|
|
73
|
+
const loginBugSinceMs = isLoginBugWaiting ? nowMs - 9e4 : nowMs + frameIndex * PREVIEW_FRAME_MS - PREVIEW_FRAME_MS;
|
|
65
74
|
return {
|
|
66
75
|
sessions: { sessions: [
|
|
67
76
|
{
|
|
@@ -76,8 +85,8 @@ function previewSampleTopics(nowMs) {
|
|
|
76
85
|
id: "sample-2",
|
|
77
86
|
name: "login bug",
|
|
78
87
|
agent: "codex",
|
|
79
|
-
state: STATES.WAITING,
|
|
80
|
-
stateSinceMs:
|
|
88
|
+
state: isLoginBugWaiting ? STATES.WAITING : STATES.RUNNING,
|
|
89
|
+
stateSinceMs: loginBugSinceMs,
|
|
81
90
|
taskTitle: "Fix the login redirect"
|
|
82
91
|
},
|
|
83
92
|
{
|
|
@@ -180,7 +189,7 @@ function previewSampleTopics(nowMs) {
|
|
|
180
189
|
{
|
|
181
190
|
vendor: "claude",
|
|
182
191
|
fiveHour: {
|
|
183
|
-
pct: 42,
|
|
192
|
+
pct: 42 + frameIndex * 3,
|
|
184
193
|
resetsAtMs: nowMs + 2 * HOUR_MS
|
|
185
194
|
},
|
|
186
195
|
sevenDay: {
|
|
@@ -209,13 +218,13 @@ function previewSampleTopics(nowMs) {
|
|
|
209
218
|
}
|
|
210
219
|
] },
|
|
211
220
|
attention: {
|
|
212
|
-
waiting: 1,
|
|
221
|
+
waiting: isLoginBugWaiting ? 1 : 0,
|
|
213
222
|
finished: 1,
|
|
214
223
|
failed: 1
|
|
215
224
|
},
|
|
216
225
|
"team-reviews": {
|
|
217
226
|
ready: [SAMPLE_PULL_REQUEST],
|
|
218
|
-
needsAttention: [],
|
|
227
|
+
needsAttention: [SAMPLE_REVIEW_NEEDING_ATTENTION],
|
|
219
228
|
inReviewCount: 1,
|
|
220
229
|
queuedCount: 3
|
|
221
230
|
}
|
|
@@ -258,8 +267,9 @@ addOptions(themeSelect, preview.themes);
|
|
|
258
267
|
function currentPanel() {
|
|
259
268
|
return preview.panels.find((panel) => panel.id === panelSelect.value);
|
|
260
269
|
}
|
|
270
|
+
let frameIndex = 0;
|
|
261
271
|
function topicData(topic) {
|
|
262
|
-
if (topic !== 'theme') return preview.
|
|
272
|
+
if (topic !== 'theme') return preview.frames[frameIndex][topic];
|
|
263
273
|
const theme = preview.themes.find((candidate) => candidate.id === themeSelect.value);
|
|
264
274
|
return { id: theme.id, colors: theme.colors };
|
|
265
275
|
}
|
|
@@ -306,6 +316,10 @@ window.addEventListener('message', (event) => {
|
|
|
306
316
|
post({ v: 1, kind: 'hello', granted: grantedTopics });
|
|
307
317
|
for (const topic of grantedTopics) postTopic(topic);
|
|
308
318
|
});
|
|
319
|
+
setInterval(() => {
|
|
320
|
+
frameIndex = (frameIndex + 1) % preview.frames.length;
|
|
321
|
+
for (const topic of grantedTopics.filter((granted) => granted !== 'theme')) postTopic(topic);
|
|
322
|
+
}, ${PREVIEW_FRAME_MS});
|
|
309
323
|
panelSelect.addEventListener('change', openPanel);
|
|
310
324
|
themeSelect.addEventListener('change', () => {
|
|
311
325
|
if (grantedTopics.includes('theme')) postTopic('theme');
|
|
@@ -316,12 +330,13 @@ openPanel();
|
|
|
316
330
|
function scriptJson(value) {
|
|
317
331
|
return JSON.stringify(value).replace(/</g, "\\u003c");
|
|
318
332
|
}
|
|
319
|
-
function previewHostPage({ title, report, pack, nowMs }) {
|
|
333
|
+
function previewHostPage({ title, report, hasProblem, pack, nowMs }) {
|
|
334
|
+
const frames = Array.from({ length: 6 }, (_, frameIndex) => previewSampleTopics(nowMs, frameIndex));
|
|
320
335
|
const preview = {
|
|
321
336
|
report,
|
|
322
337
|
panels: previewPanels(pack),
|
|
323
338
|
themes: previewThemes(pack),
|
|
324
|
-
|
|
339
|
+
frames,
|
|
325
340
|
knownTopics: PackBridgeTopic.options,
|
|
326
341
|
bridgeVersion: 1
|
|
327
342
|
};
|
|
@@ -339,8 +354,8 @@ iframe[hidden] { display: none; }
|
|
|
339
354
|
.swatch { padding: 10px; border-radius: 6px; background: var(--swatch); color: #fff; text-shadow: 0 1px 2px #000; font: 12px ui-monospace, monospace; }
|
|
340
355
|
</style></head>
|
|
341
356
|
<body>
|
|
342
|
-
<header><strong>Pack preview</strong><label>Panel <select id="panel"></select></label><label>Theme <select id="theme"></select></label><span id="status"></span><span>Sample data, not your dashboard. Reload after editing the pack.</span></header>
|
|
343
|
-
<pre id="report"></pre>
|
|
357
|
+
<header><strong>Pack preview</strong><label>Panel <select id="panel"></select></label><label>Theme <select id="theme"></select></label><span id="status"></span><span>Sample data that changes every 5 seconds, not your dashboard. Reload after editing the pack.</span></header>
|
|
358
|
+
<details${hasProblem ? " open" : ""}><summary>Check report: ${hasProblem ? "problems to fix" : "no problems"}</summary><pre id="report"></pre></details>
|
|
344
359
|
<iframe id="frame" title="Panel" sandbox="allow-scripts allow-forms"></iframe>
|
|
345
360
|
<div id="swatches" hidden></div>
|
|
346
361
|
<script>const preview = ${scriptJson(preview)};${HOST_SCRIPT}<\/script>
|
|
@@ -359,19 +374,20 @@ async function runPackCheckCli({ packDir, isJson, env, homeDir }) {
|
|
|
359
374
|
}
|
|
360
375
|
var SCHEMA_TEXT_BY_NAME = {
|
|
361
376
|
pack: packJsonSchemaText,
|
|
362
|
-
bridge: packBridgeJsonSchemaText
|
|
377
|
+
bridge: packBridgeJsonSchemaText,
|
|
378
|
+
"pr-flows": prFlowsOutputJsonSchemaText
|
|
363
379
|
};
|
|
364
380
|
async function runGuide(homeDir, schemaName) {
|
|
365
381
|
if (schemaName === null) {
|
|
366
382
|
process.stdout.write(`${await packGuideText({
|
|
367
383
|
homeDir,
|
|
368
384
|
examplePacksDir
|
|
369
|
-
}, ["The JSON Schemas, with what each field means: glimmervoid packs guide --schema pack (pack.json)
|
|
385
|
+
}, ["The JSON Schemas, with what each field means: glimmervoid packs guide --schema pack (pack.json), --schema bridge (panel bridge messages) and --schema pr-flows (what a prFlows command prints)."])}\n`);
|
|
370
386
|
return 0;
|
|
371
387
|
}
|
|
372
388
|
const schemaText = SCHEMA_TEXT_BY_NAME[schemaName];
|
|
373
389
|
if (!schemaText) {
|
|
374
|
-
process.stderr.write(`glimmervoid packs guide: --schema is pack or
|
|
390
|
+
process.stderr.write(`glimmervoid packs guide: --schema is pack, bridge or pr-flows, not ${schemaName}\n`);
|
|
375
391
|
return 1;
|
|
376
392
|
}
|
|
377
393
|
process.stdout.write(schemaText());
|
|
@@ -382,7 +398,7 @@ async function runList() {
|
|
|
382
398
|
process.stderr.write("glimmervoid packs list reads the running Glimmervoid, so it works inside a Glimmervoid session; the operator sees the same list in Settings, Packs\n");
|
|
383
399
|
return 1;
|
|
384
400
|
}
|
|
385
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
401
|
+
const { askAgentApi } = await import("./agent-api-cli-CN904-o8.js");
|
|
386
402
|
const reply = AGENT_REPLY_SCHEMAS.packs.safeParse(await askAgentApi("packs", { command: "list" }));
|
|
387
403
|
if (!reply.success) {
|
|
388
404
|
process.stderr.write("glimmervoid packs list: Glimmervoid did not answer with a pack list\n");
|
|
@@ -402,7 +418,7 @@ function decodedFilePath(urlPath) {
|
|
|
402
418
|
return null;
|
|
403
419
|
}
|
|
404
420
|
}
|
|
405
|
-
async function previewResponse(packDir, requestUrl, env, homeDir) {
|
|
421
|
+
async function previewResponse(packDir, requestUrl, requestOrigin, env, homeDir) {
|
|
406
422
|
const urlPath = new URL(requestUrl, `http://${PREVIEW_HOST}`).pathname;
|
|
407
423
|
const read = await readPackDir(packDir, env);
|
|
408
424
|
const pack = read.ok ? read.pack : null;
|
|
@@ -417,7 +433,7 @@ async function previewResponse(packDir, requestUrl, env, homeDir) {
|
|
|
417
433
|
return {
|
|
418
434
|
status: 200,
|
|
419
435
|
headers: {
|
|
420
|
-
...packFileHeaders(filePath),
|
|
436
|
+
...packFileHeaders(filePath, requestOrigin),
|
|
421
437
|
"Cache-Control": "no-store"
|
|
422
438
|
},
|
|
423
439
|
body: bytes
|
|
@@ -439,6 +455,7 @@ async function previewResponse(packDir, requestUrl, env, homeDir) {
|
|
|
439
455
|
body: previewHostPage({
|
|
440
456
|
title: `Pack preview: ${report.name ?? path.basename(packDir)}`,
|
|
441
457
|
report: packReportText(report),
|
|
458
|
+
hasProblem: packCheckHasProblem(report),
|
|
442
459
|
pack,
|
|
443
460
|
nowMs: Date.now()
|
|
444
461
|
})
|
|
@@ -455,7 +472,7 @@ async function runPreview(packDir, portText, env, homeDir) {
|
|
|
455
472
|
response.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" }).end("Host not allowed");
|
|
456
473
|
return;
|
|
457
474
|
}
|
|
458
|
-
previewResponse(packDir, request.url ?? "/", env, homeDir).then(({ status, headers, body }) => response.writeHead(status, headers).end(body), (error) => response.writeHead(500, { "Content-Type": "text/plain; charset=utf-8" }).end(errorMessage(error)));
|
|
475
|
+
previewResponse(packDir, request.url ?? "/", request.headers.origin, env, homeDir).then(({ status, headers, body }) => response.writeHead(status, headers).end(body), (error) => response.writeHead(500, { "Content-Type": "text/plain; charset=utf-8" }).end(errorMessage(error)));
|
|
459
476
|
});
|
|
460
477
|
const listening = await new Promise((resolve) => {
|
|
461
478
|
server.once("error", (error) => resolve({
|
|
@@ -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-6XipBvYu.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-F5lysUVX.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
//#region server/text-format.ts
|
|
6
6
|
function trimIso(iso) {
|
|
@@ -1,11 +1,11 @@
|
|
|
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 PR_ACTION_TOKEN_ENV, fn as PR_FLOW_PLACEHOLDERS_BY_KIND, g as AgentSettingsReply, kn as PrFlowsState, pn as PrActionReportBody, un as PR_ACTION_REPORT_URL_ENV } from "./session-Ctzyy3sF.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 {
|
|
7
|
-
import { t as createPrFlowsExternal } from "./pr-flows-external-
|
|
8
|
-
import { t as runPackCheckCli } from "./packs-cli-
|
|
6
|
+
import { B as unknownActionWarnings, F as scopedToRepo, M as prFlowRules, S as expandPlaceholders, j as prFlowCommands, x as commandFingerprint } from "./pack-agent-kPL1_C11.js";
|
|
7
|
+
import { t as createPrFlowsExternal } from "./pr-flows-external-DoqZWZkV.js";
|
|
8
|
+
import { t as runPackCheckCli } from "./packs-cli-wE9e0PRp.js";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import os from "node:os";
|
|
@@ -100,7 +100,7 @@ async function readServerConfig(askSetting) {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
async function readConfigFromServer() {
|
|
103
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
103
|
+
const { askAgentApi } = await import("./agent-api-cli-CN904-o8.js");
|
|
104
104
|
return readServerConfig((settingPath) => askAgentApi("settings", {
|
|
105
105
|
command: "get",
|
|
106
106
|
path: settingPath
|
|
@@ -241,7 +241,7 @@ async function runPrActionReport({ outcome, message, env }, io) {
|
|
|
241
241
|
io.writeError("--outcome must be started, done, failed or refused, and --message at most 500 characters\n");
|
|
242
242
|
return 1;
|
|
243
243
|
}
|
|
244
|
-
const { postToAgentIngress } = await import("./agent-api-cli-
|
|
244
|
+
const { postToAgentIngress } = await import("./agent-api-cli-CN904-o8.js");
|
|
245
245
|
const reply = await postToAgentIngress({
|
|
246
246
|
endpoint: new URL(reportUrl),
|
|
247
247
|
token,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dn as PrFlowSourceOutput, Pn as ReportedPrFlowActionOutcome } from "./session-Ctzyy3sF.js";
|
|
2
2
|
import { c as runCommandSafely } from "./child-process-safe-BIh8yQ0I.js";
|
|
3
3
|
import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
|
|
4
|
-
import { n as withoutGlimmervoidSecrets } from "./spawn-env-
|
|
5
|
-
import {
|
|
4
|
+
import { n as withoutGlimmervoidSecrets } from "./spawn-env-D9Gtgndb.js";
|
|
5
|
+
import { S as expandPlaceholders, k as prActionPlaceholderValues } from "./pack-agent-kPL1_C11.js";
|
|
6
6
|
//#region server/github/pr-flows-external.ts
|
|
7
7
|
var OUTPUT_MAX_BYTES = 1048576;
|
|
8
8
|
var ACTION_OUTPUT_MAX_BYTES = 67108864;
|
|
@@ -2,7 +2,7 @@ import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { d as equalsIgnoringCaseOnWindows } from "./runtime-paths-DfoHzN15.js";
|
|
3
3
|
import { n as isRecord } from "./coerce-oz_Z_6E7.js";
|
|
4
4
|
import { a as jsonStateLoadError, d as writeJsonAtomicSync, l as sleepSync, s as loadJsonStateFileSync, u as writeJsonAtomic } from "./json-file-AKRVPqG1.js";
|
|
5
|
-
import { b as DEFAULT_TIMER_FNS, o as glimmervoidHomeDir, x as unrefTimer, xt as canonicalizePath } from "./config-store-
|
|
5
|
+
import { b as DEFAULT_TIMER_FNS, o as glimmervoidHomeDir, x as unrefTimer, xt as canonicalizePath } from "./config-store-6XipBvYu.js";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import crypto from "node:crypto";
|
|
@@ -161,14 +161,45 @@ function prFlowRulesJsonSchema(rulesSchema) {
|
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
+
var SOURCE_PLACEHOLDERS = [
|
|
165
|
+
"prUrl",
|
|
166
|
+
"repo",
|
|
167
|
+
"number",
|
|
168
|
+
"head"
|
|
169
|
+
];
|
|
170
|
+
var PR_FLOW_PLACEHOLDERS_BY_KIND = {
|
|
171
|
+
source: SOURCE_PLACEHOLDERS,
|
|
172
|
+
action: [
|
|
173
|
+
...SOURCE_PLACEHOLDERS,
|
|
174
|
+
"itemPath",
|
|
175
|
+
"itemLine"
|
|
176
|
+
],
|
|
177
|
+
"pr-action": [
|
|
178
|
+
...SOURCE_PLACEHOLDERS,
|
|
179
|
+
"headRef",
|
|
180
|
+
"baseRef"
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
function commandDescription(kind, runsWith) {
|
|
184
|
+
return `The program and its arguments, run without a shell from the Glimmervoid home folder; an argument may hold ${PR_FLOW_PLACEHOLDERS_BY_KIND[kind].map((placeholderName) => `{${placeholderName}}`).join(", ")}, and in a pack also {packDir}, the pack's folder. ${runsWith}`;
|
|
185
|
+
}
|
|
164
186
|
var PrFlowCommand = z.strictObject({
|
|
165
187
|
id: z.string().regex(PR_FLOW_ID, { error: "an id is lowercase letters, digits and dashes" }),
|
|
166
188
|
label: z.string().trim().min(1).max(24),
|
|
167
189
|
command: z.array(z.string().min(1)).min(1, { error: "a command needs at least the program to run" }),
|
|
168
190
|
timeoutSeconds: z.number().int().positive().max(3600).default(120)
|
|
169
191
|
});
|
|
170
|
-
var
|
|
171
|
-
var
|
|
192
|
+
var COMMAND_ENV = "Its environment has GLIMMERVOID_PR_URL, GLIMMERVOID_PR_REPO, GLIMMERVOID_PR_NUMBER and GLIMMERVOID_PR_HEAD";
|
|
193
|
+
var ACTION_OUTCOME = "Exit 0 means done and any other exit failed, unless stdout prints the action outcome JSON (glimmervoid packs guide --schema pr-flows)";
|
|
194
|
+
var PrFlowScopedCommand = PrFlowCommand.extend({
|
|
195
|
+
command: PrFlowCommand.shape.command.describe(commandDescription("source", `${COMMAND_ENV}. It must print the source output JSON (glimmervoid packs guide --schema pr-flows) on stdout; anything else shows as an error on the pull request`)),
|
|
196
|
+
repos: RepoScope
|
|
197
|
+
});
|
|
198
|
+
var PrFlowItemAction = PrFlowCommand.extend({ command: PrFlowCommand.shape.command.describe(commandDescription("action", `${COMMAND_ENV}, and the review item as GLIMMERVOID_ITEM_JSON. ${ACTION_OUTCOME}`)) });
|
|
199
|
+
var PrFlowPrAction = PrFlowCommand.extend({
|
|
200
|
+
command: PrFlowCommand.shape.command.describe(commandDescription("pr-action", `${COMMAND_ENV}, GLIMMERVOID_PR_HEAD_REF, GLIMMERVOID_PR_BASE_REF and the pull request as GLIMMERVOID_PR_JSON. ${ACTION_OUTCOME}`)),
|
|
201
|
+
repos: RepoScope
|
|
202
|
+
});
|
|
172
203
|
var PrFlowSourceFinding = z.strictObject({
|
|
173
204
|
path: z.string().min(1).max(500).regex(ONE_PRINTABLE_LINE, { error: "a finding path must be one line with no control characters" }),
|
|
174
205
|
lineStart: z.number().int().positive().nullable(),
|
|
@@ -194,6 +225,12 @@ var PrFlowActionOutput = z.strictObject({
|
|
|
194
225
|
]),
|
|
195
226
|
message: z.string().max(200).default("")
|
|
196
227
|
});
|
|
228
|
+
function prFlowsOutputJsonSchemaText() {
|
|
229
|
+
return `${JSON.stringify({
|
|
230
|
+
sourceOutput: z.toJSONSchema(PrFlowSourceOutput, { io: "input" }),
|
|
231
|
+
actionOutcome: z.toJSONSchema(PrFlowActionOutput, { io: "input" })
|
|
232
|
+
}, null, 2)}\n`;
|
|
233
|
+
}
|
|
197
234
|
var ReportedPrFlowActionOutcome = z.looseObject({
|
|
198
235
|
outcome: PrFlowActionOutput.shape.outcome,
|
|
199
236
|
message: z.string().optional().catch(void 0)
|
|
@@ -1911,4 +1948,4 @@ var AGENT_REPLY_SCHEMAS = Object.freeze({
|
|
|
1911
1948
|
answer: z.union([AgentOkReply, AgentRefusal])
|
|
1912
1949
|
});
|
|
1913
1950
|
//#endregion
|
|
1914
|
-
export { Op as $, TeamReviewStateEntry as $t, SESSION_NAME_PATTERN as A,
|
|
1951
|
+
export { Op as $, STATES as $n, TeamReviewStateEntry as $t, SESSION_NAME_PATTERN as A, PrFlowsStatus as An, SessionPrLinks as At, SshSignRequest as B, shortSha as Bn, PostingPlan as Bt, CONVERSATION_TOOL_RESULT_HOOK_EVENT as C, PrFlowPrAction as Cn, MyPrMergeWhenReadyResult as Ct, SESSION_COMMANDS as D, PrFlowSourceOutput as Dn, MyPrsSnapshot as Dt, RefinedTaskTitle as E, PrFlowScopedCommand as En, MyPrThreadsResponse as Et, SessionDoc as F, prActionReportPath as Fn, EarlierReview as Ft, BOX_CHANGES as G, GithubPollingRefreshRequest as Gn, ReviewFinding as Gt, TaskTitle as H, NODE_ID_RE as Hn, ReviewChecksState as Ht, SessionSnapshot as I, prFlowRulesJsonSchema as In, FindingSeverity as It, BoardReview as J, githubPollingShape as Jn, ReviewVerdict as Jt, Board as K, GithubPollingRefreshResult as Kn, ReviewResult as Kt, SessionState as L, prFlowsOutputJsonSchemaText as Ln, GithubReviewDecision as Lt, SHOWN_FILE_CAP_BYTES as M, PrThreadUnresolveResponse as Mn, repositoryName as Mt, SIGN_URL_ENV as N, RepoScope as Nn, CommitSha as Nt, SESSION_DOC_BODY_CAP_BYTES as O, PrFlowsSettings as On, MyPrsState as Ot, SSH_SIGN_BODY_CAP_BYTES as P, ReportedPrFlowActionOutcome as Pn, DECIDING_REVIEW_STATES as Pt, Note as Q, RESTARTABLE_STATES as Qn, TeamReviewResolveResponse as Qt, ShownFile as R, FULL_SHA_RE as Rn, GithubReviewState as Rt, CONVERSATION_PERMISSION_HOOK_EVENT as S, PrFlowPendingApproval as Sn, MyPrMergeWhenReadyRequest as St, ConversationQuestion as T, PrFlowSaveRuleRequest as Tn, MyPrThreadNode as Tt, UnseenOutcome as U, REPO_SLUG_RE as Un, ReviewComment as Ut, TASK_TITLE_CONTROL_CHARACTERS as V, GH_SEGMENT as Vn, PrDetail as Vt, BOARD_MEDIA_MAX_EDGE_PX as W, repoParts as Wn, ReviewDraft as Wt, Box as X, KILLABLE_STATES as Xn, TeamReviewActionResult as Xt, BoardSummary as Y, BADGE_LABELS as Yn, TeamReviewActionRequest as Yt, Frame as Z, MERGEABLE_LIVE_STATES as Zn, TeamReviewCompareFiles as Zt, AgentSettingsRequest as _, PrFlowDisposeRequest as _n, MyPrLaneEntry as _t, AgentAnswerRequest as a, decisionAsIfApprovalRequired as an, WhiteboardAgentReply as at, COHERENCE_HOOKS_INACTIVE as b, PrFlowItemRequest as bn, MyPrMergeResult as bt, AgentCloseRequest as c, PR_ACTION_REPORT_BODY_CAP_BYTES as cn, sparseBoardRecord as ct, AgentPacksRequest as d, PR_ACTION_TOKEN_ENV as dn, MyPr as dt, TeamReviewStatus as en, Panel as et, AgentPullRequestRequest as f, PR_FLOW_PLACEHOLDERS_BY_KIND as fn, MyPrAutoRebase as ft, AgentSettingsReply as g, PrFlowCommand as gn, MyPrKeepMergeableResult as gt, AgentSendRequest as h, PrFlowApproveRequest as hn, MyPrKeepMergeableRequest as ht, ASK_USER_QUESTION_TOOL_NAME as i, canApproveAfterComment as in, WHITEBOARD_LIMITS as it, SESSION_NAME_RULE_TEXT as j, PrThreadReplyResponse as jn, pullRequestKeyFormat as jt, SESSION_DOC_PATH_MAX_CHARS as k, PrFlowsState as kn, MyPrsStatus as kt, AgentEditRequest as l, PR_ACTION_REPORT_ROUTE as ln, sparseBoardReply as lt, AgentReviewsRequest as m, PrActionRunRequest as mn, MyPrCheckContextsResponse as mt, AGENT_REPLY_SCHEMAS as n, TeamReviewThreadResult as nn, Unit as nt, AgentAttentionRequest as o, hasRequiredActionHead as on, WhiteboardAgentRequest as ot, AgentReadRequest as p, PrActionReportBody as pn, MyPrCheckContext as pt, BoardRecord as q, GithubPrsFreshness as qn, ReviewThreadId as qt, AGENT_URL_ENV as r, TeamReviewThreadsRepository as rn, WHITEBOARD_ASSET_ROUTE as rt, AgentCheckoutRequest as s, hasStandingViewerApproval as sn, Wire as st, AGENT_API_VERBS as t, TeamReviewThreadCommentsResponse as tn, UNIT_STATUSES as tt, AgentLimitsReply as u, PR_ACTION_REPORT_URL_ENV as un, LinkedPr as ut, AgentSpawnRequest as v, PrFlowDisposeResult as vn, MyPrMergeMethod as vt, CoherenceHooksState as w, PrFlowRule as wn, MyPrSearchNode as wt, CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS as x, PrFlowPackRequires as xn, MyPrMergeStateResponse as xt, AgentWhyRequest as y, PrFlowItemAction as yn, MyPrMergeRequest as yt, SshSignReply as z, HEX_SHA_RE as zn, PostedReviewEvent as zt };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as errorMessage, t as errorCode } from "./text-DoirglWV.js";
|
|
2
2
|
import { n as glimmervoidHomeDir, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
3
|
-
import { g as AgentSettingsReply } from "./session-
|
|
4
|
-
import { r as BrowserConfig } from "./config-
|
|
3
|
+
import { g as AgentSettingsReply } from "./session-Ctzyy3sF.js";
|
|
4
|
+
import { r as BrowserConfig } from "./config-BmJ9RqVi.js";
|
|
5
5
|
import { n as isRecord } from "./coerce-oz_Z_6E7.js";
|
|
6
6
|
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
7
|
-
import { A as cloneValue, F as scoreSettingsSearch, I as setValueAtPath, P as parsePosthogProjectSelection, V as SETTINGS_REGISTRY, _t as ENV_SECRET_BINDINGS, bt as withEnvSecrets, j as deleteValueAtPath, l as saveConfigFileOnce, s as loadConfigFile, t as IS_EXPERIMENTAL_BUILD, u as validateConfig, vt as readEnvSecrets, w as isSettingAvailable, z as valueAtPath } from "./config-store-
|
|
8
|
-
import { a as fail, c as listSettings, d as renderSectionTables, f as requireConfigFileSetting, g as valueText, h as succeed, i as describeSetting, l as readSetting, m as settingsRequestForServer, n as configFileViewOf, o as fitColumn, p as sectionOf, r as defaultText, s as getSetting, t as availableSettings } from "./settings-readout-core-
|
|
7
|
+
import { A as cloneValue, F as scoreSettingsSearch, I as setValueAtPath, P as parsePosthogProjectSelection, V as SETTINGS_REGISTRY, _t as ENV_SECRET_BINDINGS, bt as withEnvSecrets, j as deleteValueAtPath, l as saveConfigFileOnce, s as loadConfigFile, t as IS_EXPERIMENTAL_BUILD, u as validateConfig, vt as readEnvSecrets, w as isSettingAvailable, z as valueAtPath } from "./config-store-6XipBvYu.js";
|
|
8
|
+
import { a as fail, c as listSettings, d as renderSectionTables, f as requireConfigFileSetting, g as valueText, h as succeed, i as describeSetting, l as readSetting, m as settingsRequestForServer, n as configFileViewOf, o as fitColumn, p as sectionOf, r as defaultText, s as getSetting, t as availableSettings } from "./settings-readout-core-Dx_X8p0M.js";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
//#region server/settings-cli.ts
|
|
@@ -320,7 +320,7 @@ function runParsedSettingsCommand(parsed, io) {
|
|
|
320
320
|
async function runParsedSettingsCli(parsed, io = processIo()) {
|
|
321
321
|
const serverRequest = settingsRequestForServer(parsed, process.env);
|
|
322
322
|
if (!serverRequest) return runParsedSettingsCommand(parsed, io);
|
|
323
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
323
|
+
const { askAgentApi } = await import("./agent-api-cli-CN904-o8.js");
|
|
324
324
|
const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
|
|
325
325
|
ok: false,
|
|
326
326
|
error: errorMessage(error)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as AgentSettingsRequest } from "./session-
|
|
1
|
+
import { _ as AgentSettingsRequest } from "./session-Ctzyy3sF.js";
|
|
2
2
|
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
3
|
-
import { A as cloneValue, B as FILE_ONLY_GROUPS, L as settingsGroupOf, M as displayText, N as hasScaledUnit, R as settingsOf, V as SETTINGS_REGISTRY, k as SETTINGS_INDEX, vt as readEnvSecrets, w as isSettingAvailable, z as valueAtPath } from "./config-store-
|
|
3
|
+
import { A as cloneValue, B as FILE_ONLY_GROUPS, L as settingsGroupOf, M as displayText, N as hasScaledUnit, R as settingsOf, V as SETTINGS_REGISTRY, k as SETTINGS_INDEX, vt as readEnvSecrets, w as isSettingAvailable, z as valueAtPath } from "./config-store-6XipBvYu.js";
|
|
4
4
|
//#region server/core/settings-readout-core.ts
|
|
5
5
|
var VALUE_COLUMN_WIDTH = 40;
|
|
6
6
|
var SECTION_BY_SETTING_ID = new Map([...SETTINGS_REGISTRY.sections.flatMap((section) => section.settings.map((setting) => [setting.id, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as BOX_CHANGES, M as SHOWN_FILE_CAP_BYTES, it as WHITEBOARD_LIMITS, tt as UNIT_STATUSES } from "./session-
|
|
1
|
+
import { G as BOX_CHANGES, M as SHOWN_FILE_CAP_BYTES, it as WHITEBOARD_LIMITS, tt as UNIT_STATUSES } from "./session-Ctzyy3sF.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
//#region shared/whiteboard-plan-core.ts
|
|
4
4
|
var LETTERS_IN_ALPHABET = 26;
|