@rashidee/co2 1.3.13 → 1.3.15
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/.co2-dat/app.db +0 -0
- package/dist/.co2-dat/app.db-shm +0 -0
- package/dist/.co2-dat/app.db-wal +0 -0
- package/dist/index.js +152 -10
- package/package.json +1 -1
- package/plugin/skills/util-gencicdscript/SKILL.md +12 -0
- package/static/assets/{abnfDiagram-VRR7QNED-Qm0Wk_H_.js → abnfDiagram-VRR7QNED-kjS3baPt.js} +1 -1
- package/static/assets/{arc-Cfk6Kt0D.js → arc-CXd0xnDj.js} +1 -1
- package/static/assets/{architectureDiagram-ZJ3FMSHR-DQTlZaUK.js → architectureDiagram-ZJ3FMSHR-5QfnAz_Q.js} +1 -1
- package/static/assets/{blockDiagram-677ZJIJ3-D-4ibdoX.js → blockDiagram-677ZJIJ3-ByICFNDb.js} +1 -1
- package/static/assets/{c4Diagram-LMCZKHZV-CHuqcdJm.js → c4Diagram-LMCZKHZV-C5a0Ubby.js} +1 -1
- package/static/assets/channel-CrYjYK1f.js +1 -0
- package/static/assets/{chunk-2Q5K7J3B-MB9pWQe1.js → chunk-2Q5K7J3B-UucADWxr.js} +1 -1
- package/static/assets/{chunk-32BRIVSS-BttYlwU1.js → chunk-32BRIVSS-WAe17d3N.js} +1 -1
- package/static/assets/{chunk-5VM5RSS4-oyt0Tagd.js → chunk-5VM5RSS4-BQBMOb0f.js} +1 -1
- package/static/assets/{chunk-EX3LRPZG-DaTxdTWl.js → chunk-EX3LRPZG-BzaET0n4.js} +1 -1
- package/static/assets/{chunk-JWPE2WC7-CNgDxPAD.js → chunk-JWPE2WC7-D_tBvbZg.js} +1 -1
- package/static/assets/{chunk-MOJQB5TN-CoAudO3B.js → chunk-MOJQB5TN-CsYb9JBc.js} +1 -1
- package/static/assets/{chunk-RYQCIY6F-BrkDEEha.js → chunk-RYQCIY6F-D5xRlnc7.js} +1 -1
- package/static/assets/{chunk-V7JOEXUC-D14rGvBO.js → chunk-V7JOEXUC-y0cEgq6c.js} +1 -1
- package/static/assets/{chunk-VR4S4FIN-CAtas2vF.js → chunk-VR4S4FIN-CSXJHPXT.js} +1 -1
- package/static/assets/{chunk-XXDRQBXY-DcVAnNUQ.js → chunk-XXDRQBXY-QFNFGLYZ.js} +1 -1
- package/static/assets/classDiagram-OUVF2IWQ-DoLCCqXD.js +1 -0
- package/static/assets/classDiagram-v2-EOCWNBFH-DoLCCqXD.js +1 -0
- package/static/assets/{cose-bilkent-JH36ORCC-B7y4MI6Z.js → cose-bilkent-JH36ORCC-ValIntpZ.js} +1 -1
- package/static/assets/{cynefin-VYW2F7L2-D2mnk-iJ.js → cynefin-VYW2F7L2-BgHVKyAR.js} +1 -1
- package/static/assets/{cynefinDiagram-TSTJHNR4-DNzQJhG7.js → cynefinDiagram-TSTJHNR4-LIZzpkLM.js} +1 -1
- package/static/assets/{dagre-VKFMJZFB-NMSyTo8N.js → dagre-VKFMJZFB-DY9b36A5.js} +1 -1
- package/static/assets/{diagram-FQU43EPY-CdqS5Ike.js → diagram-FQU43EPY-aeuYUUxe.js} +1 -1
- package/static/assets/{diagram-G47NLZAW-Bsb4T5JI.js → diagram-G47NLZAW-BWwcYYCF.js} +1 -1
- package/static/assets/{diagram-NH7WQ7WH-Z-PyzBSC.js → diagram-NH7WQ7WH-BObFlRPR.js} +1 -1
- package/static/assets/{diagram-OA4YK3LP-BZBTYbxg.js → diagram-OA4YK3LP-BUnc8m1-.js} +1 -1
- package/static/assets/{diagram-WEI45ONY-BL2LA5H_.js → diagram-WEI45ONY-DsNxBIuJ.js} +1 -1
- package/static/assets/{ebnfDiagram-CCIWWBDH-BGtukMeo.js → ebnfDiagram-CCIWWBDH-DDL2Id1r.js} +1 -1
- package/static/assets/{erDiagram-Q63AITRT-B6OJ4YCl.js → erDiagram-Q63AITRT-DZZcG2QU.js} +1 -1
- package/static/assets/{flowDiagram-23GEKE2U-BBkMgJ1i.js → flowDiagram-23GEKE2U-C6GvkBFb.js} +1 -1
- package/static/assets/{ganttDiagram-NO4QXBWP-Cv8KHFBD.js → ganttDiagram-NO4QXBWP-C7ydCTnF.js} +1 -1
- package/static/assets/{gitGraphDiagram-IHSO6WYX-hYxDNjWx.js → gitGraphDiagram-IHSO6WYX-C60P6bwf.js} +1 -1
- package/static/assets/{index-DnYGyYET.js → index-CfGMfAGO.js} +93 -93
- package/static/assets/{index-DKI3BgkF.css → index-D58A6Kf1.css} +1 -1
- package/static/assets/{infoDiagram-FWYZ7A6U-WuQIiedv.js → infoDiagram-FWYZ7A6U-CnH7Q2nX.js} +1 -1
- package/static/assets/{ishikawaDiagram-FXEZZL3T-BJGOD-IY.js → ishikawaDiagram-FXEZZL3T-BNEvOQYX.js} +1 -1
- package/static/assets/{journeyDiagram-5HDEW3XC-Ba_NXseS.js → journeyDiagram-5HDEW3XC-BOwGZTfX.js} +1 -1
- package/static/assets/{kanban-definition-HUTT4EX6-C5RMm9uF.js → kanban-definition-HUTT4EX6-BEfHVl-l.js} +1 -1
- package/static/assets/{linear-CLKppNoj.js → linear-BOHPNxBi.js} +1 -1
- package/static/assets/{mindmap-definition-LN4V7U3C-ClSG_qmQ.js → mindmap-definition-LN4V7U3C-B84wfT_w.js} +1 -1
- package/static/assets/{pegDiagram-2B236MQR-C_JEZqk3.js → pegDiagram-2B236MQR-BgEa7yRL.js} +1 -1
- package/static/assets/{pieDiagram-ENE6RG2P-D0lx7wDi.js → pieDiagram-ENE6RG2P-DgA9LQlc.js} +1 -1
- package/static/assets/{quadrantDiagram-ABIIQ3AL-BBKy0PVs.js → quadrantDiagram-ABIIQ3AL-C5K_r0Mx.js} +1 -1
- package/static/assets/{railroadDiagram-RFXS5EU6-C1Badu5q.js → railroadDiagram-RFXS5EU6-Ckh_mLXW.js} +1 -1
- package/static/assets/{requirementDiagram-TGXJPOKE-1j59jBQH.js → requirementDiagram-TGXJPOKE-CtII7Obm.js} +1 -1
- package/static/assets/{sankeyDiagram-HTMAVEWB-BLR5S8aZ.js → sankeyDiagram-HTMAVEWB-DdkySwbL.js} +1 -1
- package/static/assets/{sequenceDiagram-DBY2YBRQ-BlqdK4qm.js → sequenceDiagram-DBY2YBRQ-DEIBg3kY.js} +1 -1
- package/static/assets/{sizeCapture-X5ZJPWSS-C27ndGIT.js → sizeCapture-X5ZJPWSS-D2MM9f6M.js} +1 -1
- package/static/assets/{stateDiagram-2N3HPSRC-DOu4536_.js → stateDiagram-2N3HPSRC-DHmJsAte.js} +1 -1
- package/static/assets/stateDiagram-v2-6OUMAXLB-B6sumoG6.js +1 -0
- package/static/assets/{swimlanes-5IMT3BWC-BpGitR9A.js → swimlanes-5IMT3BWC-BBPvUQvZ.js} +2 -2
- package/static/assets/swimlanesDiagram-G3AALYLV-DH2ts1oT.js +8 -0
- package/static/assets/{timeline-definition-FHXFAJF6-JIvdjH7z.js → timeline-definition-FHXFAJF6-CG_Q0YTD.js} +1 -1
- package/static/assets/{vennDiagram-L72KCM5P-DulnqLWm.js → vennDiagram-L72KCM5P-DlFSe4is.js} +1 -1
- package/static/assets/{wardleyDiagram-EHGQE667--MhZNL8M.js → wardleyDiagram-EHGQE667-BTlvtp2f.js} +1 -1
- package/static/assets/{xychartDiagram-FW5EYKEG-CjnNgnMQ.js → xychartDiagram-FW5EYKEG-Bm14zLxj.js} +1 -1
- package/static/index.html +2 -2
- package/static/assets/channel-H9DRrduO.js +0 -1
- package/static/assets/classDiagram-OUVF2IWQ-DRNPM383.js +0 -1
- package/static/assets/classDiagram-v2-EOCWNBFH-DRNPM383.js +0 -1
- package/static/assets/stateDiagram-v2-6OUMAXLB-DvP1ZCp8.js +0 -1
- package/static/assets/swimlanesDiagram-G3AALYLV-B5cf18Ey.js +0 -8
package/dist/.co2-dat/app.db
CHANGED
|
Binary file
|
package/dist/.co2-dat/app.db-shm
CHANGED
|
Binary file
|
package/dist/.co2-dat/app.db-wal
CHANGED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -6809,7 +6809,7 @@ var {
|
|
|
6809
6809
|
// package.json
|
|
6810
6810
|
var package_default = {
|
|
6811
6811
|
name: "@rashidee/co2",
|
|
6812
|
-
version: "1.3.
|
|
6812
|
+
version: "1.3.15",
|
|
6813
6813
|
description: "Compound Context Studio \u2014 self-hosted team context authoring for CO2 projects",
|
|
6814
6814
|
type: "module",
|
|
6815
6815
|
license: "MIT",
|
|
@@ -22578,7 +22578,13 @@ function requestPlan(db, workspacePath, projectId, userId) {
|
|
|
22578
22578
|
"utf8"
|
|
22579
22579
|
);
|
|
22580
22580
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
22581
|
-
db.update(cicdSetups).set({
|
|
22581
|
+
db.update(cicdSetups).set({
|
|
22582
|
+
status: "planning",
|
|
22583
|
+
planRequestPath: filePath,
|
|
22584
|
+
planRequestedAt: now,
|
|
22585
|
+
configFingerprint: "",
|
|
22586
|
+
updatedAt: now
|
|
22587
|
+
}).where(eq(cicdSetups.id, setup.id)).run();
|
|
22582
22588
|
createNotification(db, userId, "conductor_progress", "CI/CD deployment plan requested", {
|
|
22583
22589
|
body: filename,
|
|
22584
22590
|
relatedEntityType: "cicd_setup",
|
|
@@ -25398,7 +25404,7 @@ function scanProject(db, workspacePath, folderName) {
|
|
|
25398
25404
|
import { join as join22, relative as relative2 } from "path";
|
|
25399
25405
|
|
|
25400
25406
|
// ../server/src/features/workflow/service.ts
|
|
25401
|
-
import { existsSync as existsSync20, mkdirSync as mkdirSync9, readFileSync as readFileSync15, writeFileSync as writeFileSync13 } from "fs";
|
|
25407
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync9, readFileSync as readFileSync15, statSync as statSync6, writeFileSync as writeFileSync13 } from "fs";
|
|
25402
25408
|
import { join as join21, relative, resolve as resolve2, sep } from "path";
|
|
25403
25409
|
var ACTIVE_RUN_STATUSES = ["pending", "in_progress"];
|
|
25404
25410
|
function svcError14(code, status) {
|
|
@@ -25855,6 +25861,125 @@ function rescanWorkflowRun(db, workspacePath, workflowMarkdownId, watcherInterva
|
|
|
25855
25861
|
}
|
|
25856
25862
|
return getWorkflowRun(db, workflowMarkdownId, workspacePath);
|
|
25857
25863
|
}
|
|
25864
|
+
var DISCOVERABLE_CONDUCTOR_TYPES = ["prepare", "develop", "quality"];
|
|
25865
|
+
function rescanProjectWorkflows(db, workspacePath, projectId, user, watcherIntervalMs) {
|
|
25866
|
+
const project = db.select().from(projects).where(eq(projects.id, projectId)).get();
|
|
25867
|
+
if (!project) throw svcError14("PROJECT_NOT_FOUND", 404);
|
|
25868
|
+
const projectDir2 = join21(workspacePath, project.workspaceFolderName);
|
|
25869
|
+
const nonTerminal = db.select({ id: conductorRuns.id, wfmId: conductorRuns.workflowMarkdownId }).from(conductorRuns).where(
|
|
25870
|
+
and(
|
|
25871
|
+
eq(conductorRuns.projectId, projectId),
|
|
25872
|
+
inArray(conductorRuns.status, [...ACTIVE_RUN_STATUSES])
|
|
25873
|
+
)
|
|
25874
|
+
).all();
|
|
25875
|
+
const rescannedRuns = nonTerminal.length;
|
|
25876
|
+
const wfmIds = new Set(nonTerminal.map((r) => r.wfmId).filter((x) => x !== null));
|
|
25877
|
+
for (const wfmId of wfmIds) rescanWorkflowRun(db, workspacePath, wfmId, watcherIntervalMs);
|
|
25878
|
+
const apps = db.select({ id: applications.id, name: applications.name }).from(applications).where(and(eq(applications.projectId, projectId), eq(applications.isDeleted, 0))).all();
|
|
25879
|
+
const currentVersionId = ensureBaselineVersion(db, projectId, user.id);
|
|
25880
|
+
const semver = db.select({ semver: prdVersions.semver }).from(prdVersions).where(eq(prdVersions.id, currentVersionId)).get()?.semver ?? null;
|
|
25881
|
+
let discoveredRuns = 0;
|
|
25882
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
25883
|
+
for (const app of apps) {
|
|
25884
|
+
for (const conductorType of DISCOVERABLE_CONDUCTOR_TYPES) {
|
|
25885
|
+
const trackingFilePath = resolveRunTrackingFilePath(projectDir2, app.name, conductorType);
|
|
25886
|
+
const fileStatus = parseTrackingStatus(trackingFilePath);
|
|
25887
|
+
if (fileStatus === "unknown") continue;
|
|
25888
|
+
const aliases = conductorType === "quality" ? ["quality", "defect"] : [conductorType];
|
|
25889
|
+
const known = db.select({
|
|
25890
|
+
status: conductorRuns.status,
|
|
25891
|
+
prdVersionId: conductorRuns.prdVersionId,
|
|
25892
|
+
createdAt: conductorRuns.createdAt,
|
|
25893
|
+
completedAt: conductorRuns.completedAt
|
|
25894
|
+
}).from(conductorRuns).where(
|
|
25895
|
+
and(
|
|
25896
|
+
eq(conductorRuns.applicationId, app.id),
|
|
25897
|
+
inArray(conductorRuns.conductorType, aliases)
|
|
25898
|
+
)
|
|
25899
|
+
).all();
|
|
25900
|
+
const knownForVersion = known.filter(
|
|
25901
|
+
(r) => r.prdVersionId === null || r.prdVersionId === currentVersionId
|
|
25902
|
+
);
|
|
25903
|
+
if (fileStatus === "COMPLETED" && knownForVersion.some((r) => r.status === "completed"))
|
|
25904
|
+
continue;
|
|
25905
|
+
if (fileStatus === "IN PROGRESS" && known.some((r) => r.status === "pending" || r.status === "in_progress"))
|
|
25906
|
+
continue;
|
|
25907
|
+
if (fileStatus === "FAILED" && knownForVersion.some((r) => r.status === "failed")) continue;
|
|
25908
|
+
let mtimeMs;
|
|
25909
|
+
try {
|
|
25910
|
+
mtimeMs = statSync6(trackingFilePath).mtimeMs;
|
|
25911
|
+
} catch {
|
|
25912
|
+
continue;
|
|
25913
|
+
}
|
|
25914
|
+
const latestKnownMs = known.reduce(
|
|
25915
|
+
(acc, r) => Math.max(
|
|
25916
|
+
acc,
|
|
25917
|
+
Date.parse(r.createdAt) || 0,
|
|
25918
|
+
r.completedAt ? Date.parse(r.completedAt) || 0 : 0
|
|
25919
|
+
),
|
|
25920
|
+
0
|
|
25921
|
+
);
|
|
25922
|
+
if (latestKnownMs > 0 && mtimeMs <= latestKnownMs) continue;
|
|
25923
|
+
const mtimeIso = new Date(mtimeMs).toISOString();
|
|
25924
|
+
const wfm = db.insert(workflowMarkdowns).values({
|
|
25925
|
+
projectId,
|
|
25926
|
+
conductorType,
|
|
25927
|
+
// The master the discovery was read from — Run History's path link previews it.
|
|
25928
|
+
filePath: relative(projectDir2, trackingFilePath).replace(/\\/g, "/"),
|
|
25929
|
+
versionLabel: semver,
|
|
25930
|
+
createdBy: user.id,
|
|
25931
|
+
createdByName: user.username,
|
|
25932
|
+
createdAt: now,
|
|
25933
|
+
updatedAt: now
|
|
25934
|
+
}).returning({ id: workflowMarkdowns.id }).get();
|
|
25935
|
+
const run = db.insert(conductorRuns).values({
|
|
25936
|
+
projectId,
|
|
25937
|
+
applicationId: app.id,
|
|
25938
|
+
conductorType,
|
|
25939
|
+
prdVersionId: currentVersionId,
|
|
25940
|
+
trackingFilePath,
|
|
25941
|
+
status: fileStatus === "COMPLETED" ? "completed" : fileStatus === "FAILED" ? "failed" : "in_progress",
|
|
25942
|
+
startedBy: user.id,
|
|
25943
|
+
startedAt: mtimeIso,
|
|
25944
|
+
completedAt: fileStatus === "IN PROGRESS" ? null : mtimeIso,
|
|
25945
|
+
workflowMarkdownId: wfm.id,
|
|
25946
|
+
priorPhaseSatisfied: 1,
|
|
25947
|
+
gitOperationStatus: "skipped",
|
|
25948
|
+
// terminal execution — the user owns its git flow
|
|
25949
|
+
createdAt: now
|
|
25950
|
+
}).returning({ id: conductorRuns.id }).get();
|
|
25951
|
+
discoveredRuns++;
|
|
25952
|
+
if (fileStatus === "COMPLETED") {
|
|
25953
|
+
try {
|
|
25954
|
+
registerConductorArtifacts(db, workspacePath, run.id);
|
|
25955
|
+
} catch {
|
|
25956
|
+
}
|
|
25957
|
+
syncDefectRunStatuses(db, run.id);
|
|
25958
|
+
} else if (fileStatus === "IN PROGRESS") {
|
|
25959
|
+
const appName = app.name;
|
|
25960
|
+
startWatcher(
|
|
25961
|
+
db,
|
|
25962
|
+
run.id,
|
|
25963
|
+
() => resolveRunTrackingFilePath(projectDir2, appName, conductorType),
|
|
25964
|
+
user.id,
|
|
25965
|
+
watcherIntervalMs,
|
|
25966
|
+
(id, terminalStatus) => {
|
|
25967
|
+
lastArtifactSweepAt.delete(id);
|
|
25968
|
+
if (terminalStatus === "COMPLETED") {
|
|
25969
|
+
try {
|
|
25970
|
+
registerConductorArtifacts(db, workspacePath, id);
|
|
25971
|
+
} catch {
|
|
25972
|
+
}
|
|
25973
|
+
syncDefectRunStatuses(db, id);
|
|
25974
|
+
}
|
|
25975
|
+
},
|
|
25976
|
+
(id) => sweepRunArtifactsThrottled(db, workspacePath, id)
|
|
25977
|
+
);
|
|
25978
|
+
}
|
|
25979
|
+
}
|
|
25980
|
+
}
|
|
25981
|
+
return { rescannedRuns, discoveredRuns };
|
|
25982
|
+
}
|
|
25858
25983
|
function getWorkflowRun(db, workflowMarkdownId, workspacePath) {
|
|
25859
25984
|
const wfm = db.select().from(workflowMarkdowns).where(eq(workflowMarkdowns.id, workflowMarkdownId)).get();
|
|
25860
25985
|
if (!wfm) throw svcError14("RUN_NOT_FOUND", 404);
|
|
@@ -25952,7 +26077,9 @@ function toDetail(db, projectFolder, wfm, workspacePath) {
|
|
|
25952
26077
|
status: rollupStatus(runs.map((r) => r.status)),
|
|
25953
26078
|
applications: appBreakdown,
|
|
25954
26079
|
filePath: wfm.filePath,
|
|
25955
|
-
|
|
26080
|
+
// Only generated markdowns (workflow/<user>/<ts>.md) carry an Execute prompt — a row
|
|
26081
|
+
// discovered from a tracking master (rescanProjectWorkflows) has nothing to re-run.
|
|
26082
|
+
executeCommand: wfm.filePath.startsWith("workflow/") ? buildExecuteCommand(projectFolder, wfm.filePath) : "",
|
|
25956
26083
|
versionLabel: wfm.versionLabel,
|
|
25957
26084
|
gitOperationStatus: git4?.gitOperationStatus ?? "not_started",
|
|
25958
26085
|
gitBranchCreated: git4?.gitBranchCreated ?? null,
|
|
@@ -26469,7 +26596,7 @@ function projectRoutes(db, workspacePath) {
|
|
|
26469
26596
|
}
|
|
26470
26597
|
|
|
26471
26598
|
// ../server/src/features/shared-context/service.ts
|
|
26472
|
-
import { existsSync as existsSync21, mkdirSync as mkdirSync10, readFileSync as readFileSync16, readdirSync as readdirSync4, statSync as
|
|
26599
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync10, readFileSync as readFileSync16, readdirSync as readdirSync4, statSync as statSync7, writeFileSync as writeFileSync14 } from "fs";
|
|
26473
26600
|
import { join as join23, resolve as resolve3, sep as sep2 } from "path";
|
|
26474
26601
|
function svcError16(code, status) {
|
|
26475
26602
|
return Object.assign(new Error(code), { code, status });
|
|
@@ -26527,7 +26654,7 @@ function walk(dir, relBase) {
|
|
|
26527
26654
|
children: walk(join23(dir, entry.name), rel)
|
|
26528
26655
|
});
|
|
26529
26656
|
} else if (entry.isFile()) {
|
|
26530
|
-
const stat =
|
|
26657
|
+
const stat = statSync7(join23(dir, entry.name));
|
|
26531
26658
|
nodes.push({
|
|
26532
26659
|
name: entry.name,
|
|
26533
26660
|
path: rel,
|
|
@@ -26566,7 +26693,7 @@ function uploadFile(db, workspacePath, projectId, folder, file) {
|
|
|
26566
26693
|
function getFileContent(db, workspacePath, projectId, relPath) {
|
|
26567
26694
|
const root = resolveSharedRoot(db, workspacePath, projectId);
|
|
26568
26695
|
const full = safeResolve(root, relPath);
|
|
26569
|
-
if (!existsSync21(full) || !
|
|
26696
|
+
if (!existsSync21(full) || !statSync7(full).isFile()) throw svcError16("NOT_FOUND", 404);
|
|
26570
26697
|
const name = relPath.split("/").pop() ?? relPath;
|
|
26571
26698
|
return { mimeType: mimeForName(name), bytes: readFileSync16(full), name };
|
|
26572
26699
|
}
|
|
@@ -26574,7 +26701,7 @@ function saveMarkdown(db, workspacePath, projectId, relPath, content) {
|
|
|
26574
26701
|
if (mimeForName(relPath) !== "text/markdown") throw svcError16("NOT_MARKDOWN", 400);
|
|
26575
26702
|
const root = resolveSharedRoot(db, workspacePath, projectId);
|
|
26576
26703
|
const full = safeResolve(root, relPath);
|
|
26577
|
-
if (!existsSync21(full) || !
|
|
26704
|
+
if (!existsSync21(full) || !statSync7(full).isFile()) throw svcError16("NOT_FOUND", 404);
|
|
26578
26705
|
writeFileSync14(full, content, "utf8");
|
|
26579
26706
|
}
|
|
26580
26707
|
|
|
@@ -27149,6 +27276,21 @@ function workflowRoutes(db, workspacePath) {
|
|
|
27149
27276
|
return errorResponse16(c, e);
|
|
27150
27277
|
}
|
|
27151
27278
|
});
|
|
27279
|
+
app.post("/rescan-all", (c) => {
|
|
27280
|
+
const projectId = Number(c.req.query("projectId"));
|
|
27281
|
+
if (Number.isNaN(projectId)) return c.json({ code: "INVALID_ID" }, 400);
|
|
27282
|
+
const user = c.get("user");
|
|
27283
|
+
try {
|
|
27284
|
+
return c.json(
|
|
27285
|
+
rescanProjectWorkflows(db, workspacePath, projectId, {
|
|
27286
|
+
id: user.id,
|
|
27287
|
+
username: user.username
|
|
27288
|
+
})
|
|
27289
|
+
);
|
|
27290
|
+
} catch (e) {
|
|
27291
|
+
return errorResponse16(c, e);
|
|
27292
|
+
}
|
|
27293
|
+
});
|
|
27152
27294
|
app.post("/runs/:id/rescan", (c) => {
|
|
27153
27295
|
const id = Number(c.req.param("id"));
|
|
27154
27296
|
if (Number.isNaN(id)) return c.json({ code: "INVALID_ID" }, 400);
|
|
@@ -27663,7 +27805,7 @@ function loggerMiddleware() {
|
|
|
27663
27805
|
}
|
|
27664
27806
|
|
|
27665
27807
|
// ../server/src/lib/static.ts
|
|
27666
|
-
import { existsSync as existsSync24, readFileSync as readFileSync19, statSync as
|
|
27808
|
+
import { existsSync as existsSync24, readFileSync as readFileSync19, statSync as statSync8 } from "fs";
|
|
27667
27809
|
import { extname, join as join26, normalize, resolve as resolve4, sep as sep3 } from "path";
|
|
27668
27810
|
var MIME = {
|
|
27669
27811
|
".html": "text/html; charset=utf-8",
|
|
@@ -27701,7 +27843,7 @@ function serveSpa(staticDir) {
|
|
|
27701
27843
|
}
|
|
27702
27844
|
const rel = path === "/" ? "/index.html" : decodeURIComponent(path);
|
|
27703
27845
|
const filePath = safeResolve2(staticDir, rel);
|
|
27704
|
-
if (filePath && existsSync24(filePath) &&
|
|
27846
|
+
if (filePath && existsSync24(filePath) && statSync8(filePath).isFile()) {
|
|
27705
27847
|
const body = readFileSync19(filePath);
|
|
27706
27848
|
return c.body(body, 200, {
|
|
27707
27849
|
"Content-Type": MIME[extname(filePath)] ?? "application/octet-stream"
|
package/package.json
CHANGED
|
@@ -111,6 +111,18 @@ port, application count) and STOP — the studio starts/embeds the app.
|
|
|
111
111
|
once at boot). Never cache the parsed config in a top-level `const`.
|
|
112
112
|
- The page is bare: no header, sidebar or footer (it is iframed by the studio). Light theme,
|
|
113
113
|
one nav tab per application; the tab body is that application's live log.
|
|
114
|
+
- **Path-prefix proxy awareness (MANDATORY)**: the studio embeds the page through its
|
|
115
|
+
same-origin reverse proxy at `/api/cicd/<projectId>/app-proxy/` — root-absolute client URLs
|
|
116
|
+
(`fetch('/api/state')`, `href="/infra"`, `ws://host/ws`) escape the prefix, hit the studio
|
|
117
|
+
instead of this app and render an empty page. The client script MUST derive a base path once —
|
|
118
|
+
`const BASE = location.pathname.endsWith('/') ? location.pathname.slice(0,-1) : location.pathname`
|
|
119
|
+
(on the `/infra` page additionally strip the trailing `/infra`) — and prefix EVERY fetch
|
|
120
|
+
(`fetch(BASE+'/api/state')`), the Infrastructure link (`BASE+'/infra'`) and the log WebSocket.
|
|
121
|
+
The WebSocket URL must also follow the page scheme:
|
|
122
|
+
`(location.protocol==='https:'?'wss://':'ws://')+location.host+BASE+'/ws?app=...'` — a
|
|
123
|
+
hardcoded `ws://` is blocked as mixed content when the studio is served over HTTPS.
|
|
124
|
+
Server-side routes stay unprefixed (`/api/state`, `/ws`, `/infra`) — the studio proxy strips
|
|
125
|
+
the prefix before forwarding.
|
|
114
126
|
- Infrastructure page: when `infra` is non-empty the main page shows an "Infrastructure" link
|
|
115
127
|
that opens the separate `/infra` page in a new tab — a status-only list of supporting
|
|
116
128
|
3rd-party services, each with a live TCP-reachability dot (polled) and a console link when a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-CsYb9JBc.js";import{p as f}from"./chunk-JWPE2WC7-D_tBvbZg.js";import{_ as n,l as o}from"./index-CfGMfAGO.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-BgHVKyAR.js";var v=d().RailroadAbnf.parser.LangiumParser,l=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),i=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:i,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return l(e.element);case"AbnfOptionalGroup":return{type:"optional",element:l(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:l(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},w={parser:R,db:a,renderer:u,styles:p};export{w as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as ln,$ as an,a0 as y,a1 as tn,a2 as F,a3 as q,a4 as _,a5 as un,a6 as rn,a7 as J,a8 as o,a9 as j,aa as sn,ab as on,ac as fn}from"./index-
|
|
1
|
+
import{Y as ln,$ as an,a0 as y,a1 as tn,a2 as F,a3 as q,a4 as _,a5 as un,a6 as rn,a7 as J,a8 as o,a9 as j,aa as sn,ab as on,ac as fn}from"./index-CfGMfAGO.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(fn(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,B=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<rn)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(on((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|