@moda-ai/cli 1.55.52 → 1.55.53
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/{agent-nxn5df1w.js → agent-0wpfk7ed.js} +4 -4
- package/dist/{cli-wqyrcnm1.js → cli-6hdqp65a.js} +48 -0
- package/dist/{cli-xx73daeb.js → cli-7nghchj8.js} +297 -56
- package/dist/{cli-arze1hgb.js → cli-r4k0yfkt.js} +4 -4
- package/dist/{cli-zgmxsmbt.js → cli-thhggczw.js} +2 -2
- package/dist/cli.js +7 -7
- package/dist/{doctor-66qe8hq9.js → doctor-wstqcfm4.js} +2 -2
- package/dist/{harness-t2xjak6g.js → harness-3bcakwrv.js} +2 -2
- package/dist/{harness-github-actions-p3g8cjf2.js → harness-github-actions-1031t1kt.js} +2 -2
- package/dist/{harness-report-d64517j4.js → harness-report-rjcjbh93.js} +1 -1
- package/dist/{index-tt5rmqyq.js → index-msk4gfn5.js} +4 -4
- package/dist/{prompt-attribution-ey193cg9.js → prompt-attribution-2687ns4k.js} +2 -2
- package/dist/prompt-source-mcp.js +2 -2
- package/dist/{prompts-z2v4k4q7.js → prompts-887e9w1v.js} +1 -1
- package/dist/{sync-tzvrgzqs.js → sync-dxnw1mwa.js} +3 -3
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildDoctorReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-thhggczw.js";
|
|
4
4
|
import"./cli-rdh9jjr2.js";
|
|
5
|
-
import"./cli-
|
|
5
|
+
import"./cli-r4k0yfkt.js";
|
|
6
6
|
import"./cli-mm48br00.js";
|
|
7
7
|
import {
|
|
8
8
|
readHarnessSyncState
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
hashStableJson,
|
|
27
27
|
readHarnessReport,
|
|
28
28
|
validateHarnessReport
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-6hdqp65a.js";
|
|
30
30
|
import {
|
|
31
31
|
CliInputError
|
|
32
32
|
} from "./cli-k4tqwah4.js";
|
|
@@ -95,7 +95,7 @@ async function buildAgentContext(context) {
|
|
|
95
95
|
const graph = readHarnessGraphIfPresent(context.cwd);
|
|
96
96
|
const reportState = readHarnessReportState(context.cwd);
|
|
97
97
|
const syncState = readHarnessSyncState(context.cwd);
|
|
98
|
-
const harness = graph ? await import("./harness-
|
|
98
|
+
const harness = graph ? await import("./harness-3bcakwrv.js") : undefined;
|
|
99
99
|
const topFindings = doctor.checks.filter((check) => check.status === "fail" || check.status === "warning").slice(0, 12).map(checkToFinding);
|
|
100
100
|
const evidenceRefs = [
|
|
101
101
|
...doctor.checks.map(checkToEvidenceRef),
|
|
@@ -882,6 +882,28 @@ function hasEvidenceLine(evidence) {
|
|
|
882
882
|
line: typeof entry.line === "number" ? entry.line : undefined
|
|
883
883
|
}) !== undefined);
|
|
884
884
|
}
|
|
885
|
+
var RUNTIME_AGENT_LINK_FIELDS = [
|
|
886
|
+
"entrypointIds",
|
|
887
|
+
"channelAdapterIds",
|
|
888
|
+
"artifactIds",
|
|
889
|
+
"identityNamespaceIds",
|
|
890
|
+
"deploymentIds",
|
|
891
|
+
"frameworkIds",
|
|
892
|
+
"modelProviderIds",
|
|
893
|
+
"evidence"
|
|
894
|
+
];
|
|
895
|
+
var HARNESS_ARTIFACT_TYPES = new Set([
|
|
896
|
+
"entrypoint",
|
|
897
|
+
"prompt",
|
|
898
|
+
"tool",
|
|
899
|
+
"skill",
|
|
900
|
+
"eval",
|
|
901
|
+
"retrieval_index",
|
|
902
|
+
"memory",
|
|
903
|
+
"guardrail",
|
|
904
|
+
"model_config",
|
|
905
|
+
"unknown"
|
|
906
|
+
]);
|
|
885
907
|
function normalizeGraphItemFieldAliases(collection, item) {
|
|
886
908
|
if (!isRecord(item))
|
|
887
909
|
return;
|
|
@@ -890,6 +912,32 @@ function normalizeGraphItemFieldAliases(collection, item) {
|
|
|
890
912
|
if (typeof item.sourcePath !== "string")
|
|
891
913
|
item.sourcePath = firstEvidencePath(item) ?? ".";
|
|
892
914
|
}
|
|
915
|
+
if (collection === "runtimeAgents") {
|
|
916
|
+
if (typeof item.kind !== "string")
|
|
917
|
+
item.kind = "runtime_agent";
|
|
918
|
+
if (typeof item.root !== "string" || item.root.length === 0)
|
|
919
|
+
item.root = ".";
|
|
920
|
+
for (const key of RUNTIME_AGENT_LINK_FIELDS) {
|
|
921
|
+
if (!Array.isArray(item[key]))
|
|
922
|
+
item[key] = [];
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
if (collection === "artifacts") {
|
|
926
|
+
if (typeof item.type !== "string" || item.type.length === 0) {
|
|
927
|
+
item.type = typeof item.kind === "string" && HARNESS_ARTIFACT_TYPES.has(item.kind) ? item.kind : "unknown";
|
|
928
|
+
}
|
|
929
|
+
if (typeof item.sourcePath !== "string" && typeof item.path === "string" && item.path.length > 0) {
|
|
930
|
+
item.sourcePath = item.path;
|
|
931
|
+
}
|
|
932
|
+
if (typeof item.name !== "string" || item.name.length === 0) {
|
|
933
|
+
item.name = firstEvidencePath(item) ?? (typeof item.id === "string" ? item.id : "unnamed");
|
|
934
|
+
}
|
|
935
|
+
if (typeof item.scope !== "string" || item.scope.length === 0) {
|
|
936
|
+
item.scope = typeof item.ownedByAgentId === "string" ? "agent" : "shared";
|
|
937
|
+
}
|
|
938
|
+
if (!Array.isArray(item.usedByAgentIds))
|
|
939
|
+
item.usedByAgentIds = [];
|
|
940
|
+
}
|
|
893
941
|
if (collection === "channelAdapters" && typeof item.kind !== "string")
|
|
894
942
|
item.kind = "unknown";
|
|
895
943
|
if (collection === "identityNamespaces" && typeof item.kind !== "string")
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
stampRemoteSnapshotTruncation,
|
|
91
91
|
validateHarnessReport,
|
|
92
92
|
writeHarnessReportArtifacts
|
|
93
|
-
} from "./cli-
|
|
93
|
+
} from "./cli-6hdqp65a.js";
|
|
94
94
|
import {
|
|
95
95
|
CliInputError,
|
|
96
96
|
CliInputRequiredError
|
|
@@ -107,15 +107,15 @@ import { homedir, tmpdir as tmpdir2 } from "node:os";
|
|
|
107
107
|
import { fileURLToPath } from "node:url";
|
|
108
108
|
import {
|
|
109
109
|
existsSync as existsSync8,
|
|
110
|
-
lstatSync as
|
|
110
|
+
lstatSync as lstatSync8,
|
|
111
111
|
mkdtempSync as mkdtempSync2,
|
|
112
112
|
mkdirSync as mkdirSync5,
|
|
113
|
-
readFileSync as
|
|
114
|
-
readdirSync as
|
|
113
|
+
readFileSync as readFileSync13,
|
|
114
|
+
readdirSync as readdirSync5,
|
|
115
115
|
writeFileSync as writeFileSync5,
|
|
116
116
|
rmSync as rmSync4
|
|
117
117
|
} from "node:fs";
|
|
118
|
-
import { basename as basename6, delimiter, dirname as dirname7, join as
|
|
118
|
+
import { basename as basename6, delimiter, dirname as dirname7, join as join10, relative as relative7, resolve as resolve10, sep as sep5 } from "node:path";
|
|
119
119
|
import { confirm, select } from "@inquirer/prompts";
|
|
120
120
|
|
|
121
121
|
// src/analyst-tui.ts
|
|
@@ -14497,6 +14497,245 @@ function promoteHarnessCandidates(report, rootDir) {
|
|
|
14497
14497
|
return [...byId.values()];
|
|
14498
14498
|
}
|
|
14499
14499
|
|
|
14500
|
+
// src/harness-wrangler-bindings.ts
|
|
14501
|
+
import { lstatSync as lstatSync7, readdirSync as readdirSync4, readFileSync as readFileSync12 } from "node:fs";
|
|
14502
|
+
import { join as join9, relative as relative6 } from "node:path";
|
|
14503
|
+
var WRANGLER_FILE = /^wrangler\.jsonc?$/;
|
|
14504
|
+
var SKIPPED_DIRS2 = new Set(["node_modules", ".git", ".wrangler", "dist", "build", ".next", ".turbo", "vendor"]);
|
|
14505
|
+
var MAX_DEPTH = 4;
|
|
14506
|
+
var AGENT_CLASS = /Agent(?:V\d+)?$/;
|
|
14507
|
+
function stripJsonc2(text) {
|
|
14508
|
+
let out = "";
|
|
14509
|
+
let inString = false;
|
|
14510
|
+
for (let i = 0;i < text.length; i += 1) {
|
|
14511
|
+
const ch = text[i];
|
|
14512
|
+
if (inString) {
|
|
14513
|
+
out += ch;
|
|
14514
|
+
if (ch === "\\") {
|
|
14515
|
+
out += text[i + 1] ?? "";
|
|
14516
|
+
i += 1;
|
|
14517
|
+
} else if (ch === '"') {
|
|
14518
|
+
inString = false;
|
|
14519
|
+
}
|
|
14520
|
+
continue;
|
|
14521
|
+
}
|
|
14522
|
+
if (ch === '"') {
|
|
14523
|
+
inString = true;
|
|
14524
|
+
out += ch;
|
|
14525
|
+
} else if (ch === "/" && text[i + 1] === "/") {
|
|
14526
|
+
while (i < text.length && text[i] !== `
|
|
14527
|
+
`)
|
|
14528
|
+
i += 1;
|
|
14529
|
+
out += `
|
|
14530
|
+
`;
|
|
14531
|
+
} else if (ch === "/" && text[i + 1] === "*") {
|
|
14532
|
+
i += 2;
|
|
14533
|
+
while (i < text.length && !(text[i] === "*" && text[i + 1] === "/")) {
|
|
14534
|
+
if (text[i] === `
|
|
14535
|
+
`)
|
|
14536
|
+
out += `
|
|
14537
|
+
`;
|
|
14538
|
+
i += 1;
|
|
14539
|
+
}
|
|
14540
|
+
i += 1;
|
|
14541
|
+
} else {
|
|
14542
|
+
out += ch;
|
|
14543
|
+
}
|
|
14544
|
+
}
|
|
14545
|
+
return out.replace(/,(\s*[}\]])/g, "$1");
|
|
14546
|
+
}
|
|
14547
|
+
function findWranglerFiles(rootDir) {
|
|
14548
|
+
const found = [];
|
|
14549
|
+
const walk = (dir, depth) => {
|
|
14550
|
+
let entries;
|
|
14551
|
+
try {
|
|
14552
|
+
entries = readdirSync4(dir);
|
|
14553
|
+
} catch {
|
|
14554
|
+
return;
|
|
14555
|
+
}
|
|
14556
|
+
for (const name of entries) {
|
|
14557
|
+
const abs = join9(dir, name);
|
|
14558
|
+
let stat;
|
|
14559
|
+
try {
|
|
14560
|
+
stat = lstatSync7(abs);
|
|
14561
|
+
} catch {
|
|
14562
|
+
continue;
|
|
14563
|
+
}
|
|
14564
|
+
if (stat.isDirectory()) {
|
|
14565
|
+
if (depth < MAX_DEPTH && !SKIPPED_DIRS2.has(name) && !name.startsWith("."))
|
|
14566
|
+
walk(abs, depth + 1);
|
|
14567
|
+
} else if (stat.isFile() && WRANGLER_FILE.test(name)) {
|
|
14568
|
+
found.push(abs);
|
|
14569
|
+
}
|
|
14570
|
+
}
|
|
14571
|
+
};
|
|
14572
|
+
walk(rootDir, 0);
|
|
14573
|
+
return found.sort();
|
|
14574
|
+
}
|
|
14575
|
+
function lineOf(text, className) {
|
|
14576
|
+
const index = text.search(new RegExp(`"class_name"\\s*:\\s*"${className.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}"`));
|
|
14577
|
+
return index < 0 ? undefined : text.slice(0, index).split(`
|
|
14578
|
+
`).length;
|
|
14579
|
+
}
|
|
14580
|
+
function workerDir(path) {
|
|
14581
|
+
const slash = path.lastIndexOf("/");
|
|
14582
|
+
return slash < 0 ? "" : path.slice(0, slash);
|
|
14583
|
+
}
|
|
14584
|
+
function detectBoundRuntimeClasses(rootDir) {
|
|
14585
|
+
const byClass = new Map;
|
|
14586
|
+
for (const abs of findWranglerFiles(rootDir)) {
|
|
14587
|
+
let text;
|
|
14588
|
+
let config2;
|
|
14589
|
+
try {
|
|
14590
|
+
text = readFileSync12(abs, "utf8");
|
|
14591
|
+
config2 = JSON.parse(stripJsonc2(text));
|
|
14592
|
+
} catch {
|
|
14593
|
+
continue;
|
|
14594
|
+
}
|
|
14595
|
+
if (!config2 || typeof config2 !== "object")
|
|
14596
|
+
continue;
|
|
14597
|
+
const path = relative6(rootDir, abs).split("\\").join("/");
|
|
14598
|
+
const root = config2;
|
|
14599
|
+
const sections2 = [root, ...Object.values(root.env ?? {})];
|
|
14600
|
+
for (const section of sections2) {
|
|
14601
|
+
if (!section || typeof section !== "object")
|
|
14602
|
+
continue;
|
|
14603
|
+
const s = section;
|
|
14604
|
+
const durable = s.durable_objects?.bindings;
|
|
14605
|
+
const entries = [
|
|
14606
|
+
...Array.isArray(durable) ? durable.map((b) => ["durable_object", b]) : [],
|
|
14607
|
+
...Array.isArray(s.workflows) ? s.workflows.map((w) => ["workflow", w]) : []
|
|
14608
|
+
];
|
|
14609
|
+
for (const [kind, raw] of entries) {
|
|
14610
|
+
if (!raw || typeof raw !== "object")
|
|
14611
|
+
continue;
|
|
14612
|
+
const entry = raw;
|
|
14613
|
+
const className = typeof entry.class_name === "string" ? entry.class_name : "";
|
|
14614
|
+
const scriptName = typeof entry.script_name === "string" && entry.script_name ? entry.script_name : undefined;
|
|
14615
|
+
const key = `${className}|${scriptName ? "external" : `config:${path}`}`;
|
|
14616
|
+
if (!className || byClass.has(key))
|
|
14617
|
+
continue;
|
|
14618
|
+
const binding = typeof (kind === "workflow" ? entry.binding : entry.name) === "string" ? String(kind === "workflow" ? entry.binding : entry.name) : className;
|
|
14619
|
+
byClass.set(key, {
|
|
14620
|
+
className,
|
|
14621
|
+
kind,
|
|
14622
|
+
binding,
|
|
14623
|
+
...scriptName ? { scriptName } : {},
|
|
14624
|
+
path,
|
|
14625
|
+
line: lineOf(text, className)
|
|
14626
|
+
});
|
|
14627
|
+
}
|
|
14628
|
+
}
|
|
14629
|
+
}
|
|
14630
|
+
return [...byClass.values()];
|
|
14631
|
+
}
|
|
14632
|
+
function norm(value) {
|
|
14633
|
+
return typeof value === "string" ? value.toLowerCase().replace(/[^a-z0-9]/g, "") : "";
|
|
14634
|
+
}
|
|
14635
|
+
function itemPaths(item) {
|
|
14636
|
+
const paths = [];
|
|
14637
|
+
for (const value of [item.root, item.sourcePath]) {
|
|
14638
|
+
if (typeof value === "string" && value && value !== ".")
|
|
14639
|
+
paths.push(value.replace(/^\.\//, ""));
|
|
14640
|
+
}
|
|
14641
|
+
for (const entry of Array.isArray(item.evidence) ? item.evidence : []) {
|
|
14642
|
+
const path = entry && typeof entry === "object" ? entry.path : undefined;
|
|
14643
|
+
if (typeof path === "string" && path)
|
|
14644
|
+
paths.push(path.replace(/^\.\//, ""));
|
|
14645
|
+
}
|
|
14646
|
+
return paths;
|
|
14647
|
+
}
|
|
14648
|
+
function withinWorker(path, dir, otherDirs) {
|
|
14649
|
+
const inside = (d) => d === "" || path === d || path.startsWith(`${d}/`);
|
|
14650
|
+
return inside(dir) && !otherDirs.some((other) => other.length > dir.length && inside(other));
|
|
14651
|
+
}
|
|
14652
|
+
function graphNamesClass(graph, bound, all) {
|
|
14653
|
+
const target = norm(bound.className);
|
|
14654
|
+
const named = (name) => {
|
|
14655
|
+
if (typeof name !== "string")
|
|
14656
|
+
return false;
|
|
14657
|
+
const bare = name.replace(/\s*\([^)]*\)\s*$/, "");
|
|
14658
|
+
return norm(bare) === target || bare.split(/[^A-Za-z0-9_]+/).some((word) => norm(word) === target);
|
|
14659
|
+
};
|
|
14660
|
+
const sameName = bound.scriptName ? [bound] : all.filter((other) => other.className === bound.className && !other.scriptName);
|
|
14661
|
+
const dir = workerDir(bound.path);
|
|
14662
|
+
const otherDirs = sameName.map((other) => workerDir(other.path)).filter((other) => other !== dir);
|
|
14663
|
+
const covers = (item) => {
|
|
14664
|
+
if (!named(item.name))
|
|
14665
|
+
return false;
|
|
14666
|
+
if (sameName.length < 2)
|
|
14667
|
+
return true;
|
|
14668
|
+
return itemPaths(item).some((path) => withinWorker(path, dir, otherDirs));
|
|
14669
|
+
};
|
|
14670
|
+
return graph.runtimeAgents.some(covers) || graph.artifacts.some(covers);
|
|
14671
|
+
}
|
|
14672
|
+
function bindingReason(bound) {
|
|
14673
|
+
const what = bound.kind === "workflow" ? "Workflow" : "Durable Object";
|
|
14674
|
+
const where = bound.scriptName ? ` served by the external Worker "${bound.scriptName}"` : "";
|
|
14675
|
+
return `${what} binding ${bound.binding} -> class ${bound.className}${where}`;
|
|
14676
|
+
}
|
|
14677
|
+
function uniqueId(base, taken) {
|
|
14678
|
+
let id = base;
|
|
14679
|
+
for (let n = 2;taken.has(id); n += 1)
|
|
14680
|
+
id = `${base}-${n}`;
|
|
14681
|
+
taken.add(id);
|
|
14682
|
+
return id;
|
|
14683
|
+
}
|
|
14684
|
+
function mergeBoundRuntimeClasses(graph, rootDir) {
|
|
14685
|
+
if (process.env.MODA_HARNESS_DETERMINISTIC_MERGE === "0")
|
|
14686
|
+
return { added: 0 };
|
|
14687
|
+
let bound;
|
|
14688
|
+
try {
|
|
14689
|
+
bound = detectBoundRuntimeClasses(rootDir);
|
|
14690
|
+
} catch {
|
|
14691
|
+
return { added: 0 };
|
|
14692
|
+
}
|
|
14693
|
+
const taken = new Set([
|
|
14694
|
+
...graph.runtimeAgents.map((agent) => agent.id),
|
|
14695
|
+
...graph.artifacts.map((artifact) => artifact.id)
|
|
14696
|
+
]);
|
|
14697
|
+
let added = 0;
|
|
14698
|
+
for (const entry of bound) {
|
|
14699
|
+
if (graphNamesClass(graph, entry, bound))
|
|
14700
|
+
continue;
|
|
14701
|
+
const evidence = [{ path: entry.path, ...entry.line ? { line: entry.line } : {}, reason: bindingReason(entry) }];
|
|
14702
|
+
const slug = entry.className.replace(/[^A-Za-z0-9]+/g, "-").toLowerCase();
|
|
14703
|
+
if (entry.kind === "durable_object" && AGENT_CLASS.test(entry.className) && !entry.scriptName) {
|
|
14704
|
+
const agent = {
|
|
14705
|
+
id: uniqueId(`agent.bound.${slug}`, taken),
|
|
14706
|
+
name: entry.className,
|
|
14707
|
+
kind: "runtime_agent",
|
|
14708
|
+
purpose: "Agent class bound as a Durable Object.",
|
|
14709
|
+
root: ".",
|
|
14710
|
+
entrypointIds: [],
|
|
14711
|
+
channelAdapterIds: [],
|
|
14712
|
+
artifactIds: [],
|
|
14713
|
+
identityNamespaceIds: [],
|
|
14714
|
+
deploymentIds: [],
|
|
14715
|
+
frameworkIds: [],
|
|
14716
|
+
modelProviderIds: [],
|
|
14717
|
+
confidence: 0.6,
|
|
14718
|
+
evidence
|
|
14719
|
+
};
|
|
14720
|
+
graph.runtimeAgents.push(agent);
|
|
14721
|
+
} else {
|
|
14722
|
+
const artifact = {
|
|
14723
|
+
id: uniqueId(`entrypoint.bound.${slug}`, taken),
|
|
14724
|
+
type: "entrypoint",
|
|
14725
|
+
name: entry.className,
|
|
14726
|
+
scope: "shared",
|
|
14727
|
+
sourcePath: entry.path,
|
|
14728
|
+
usedByAgentIds: [],
|
|
14729
|
+
confidence: 0.6,
|
|
14730
|
+
evidence
|
|
14731
|
+
};
|
|
14732
|
+
graph.artifacts.push(artifact);
|
|
14733
|
+
}
|
|
14734
|
+
added += 1;
|
|
14735
|
+
}
|
|
14736
|
+
return { added };
|
|
14737
|
+
}
|
|
14738
|
+
|
|
14500
14739
|
// src/harness-sync-limits.ts
|
|
14501
14740
|
var MAX_HARNESS_SYNC_GRAPH_BYTES = 2000000;
|
|
14502
14741
|
function assertHarnessGraphSyncSize(graph) {
|
|
@@ -14515,8 +14754,8 @@ function assertHarnessGraphSyncSize(graph) {
|
|
|
14515
14754
|
}
|
|
14516
14755
|
// src/harness.ts
|
|
14517
14756
|
var MODA_DIR = ".moda";
|
|
14518
|
-
var HARNESS_PATH =
|
|
14519
|
-
var HARNESS_SUMMARY_PATH =
|
|
14757
|
+
var HARNESS_PATH = join10(MODA_DIR, "harness.json");
|
|
14758
|
+
var HARNESS_SUMMARY_PATH = join10(MODA_DIR, "HARNESS.md");
|
|
14520
14759
|
var SCHEMA_VERSION = "harness.v0.1";
|
|
14521
14760
|
var REPORT_JSON_BEGIN = "MODA_HARNESS_REPORT_JSON_BEGIN";
|
|
14522
14761
|
var REPORT_JSON_END = "MODA_HARNESS_REPORT_JSON_END";
|
|
@@ -14682,7 +14921,7 @@ async function runHarnessCommand(context) {
|
|
|
14682
14921
|
report: {
|
|
14683
14922
|
reportId: report.reportId,
|
|
14684
14923
|
reportHash,
|
|
14685
|
-
path: normalizePath2(
|
|
14924
|
+
path: normalizePath2(relative7(rootDir, reportPath)) || ".moda/harness-report.json"
|
|
14686
14925
|
},
|
|
14687
14926
|
validation,
|
|
14688
14927
|
approval: {
|
|
@@ -14828,7 +15067,7 @@ async function runHarnessCommand(context) {
|
|
|
14828
15067
|
throw new CliInputError("Focused remote prompt analysis is not supported yet.", "Use local --analyst=claude|codex|cursor|local-scan, or drop --concern for a full remote report.");
|
|
14829
15068
|
}
|
|
14830
15069
|
if (context.flags["github-actions"] === "true") {
|
|
14831
|
-
const { runGithubActionsAnalyze } = await import("./harness-github-actions-
|
|
15070
|
+
const { runGithubActionsAnalyze } = await import("./harness-github-actions-1031t1kt.js");
|
|
14832
15071
|
const result = await runGithubActionsAnalyze(rootDir, {
|
|
14833
15072
|
writeReport: (report2) => {
|
|
14834
15073
|
const normalized = normalizeHarnessReport(report2);
|
|
@@ -14950,7 +15189,7 @@ async function runHarnessCommand(context) {
|
|
|
14950
15189
|
report: {
|
|
14951
15190
|
reportId: approval.report.reportId,
|
|
14952
15191
|
reportHash: hashHarnessReport(approval.report),
|
|
14953
|
-
path: normalizePath2(
|
|
15192
|
+
path: normalizePath2(relative7(rootDir, reportPath)) || ".moda/harness-report.json"
|
|
14954
15193
|
},
|
|
14955
15194
|
validation: approval.validation,
|
|
14956
15195
|
approval: approval.approval
|
|
@@ -15040,7 +15279,7 @@ async function runHarnessCommand(context) {
|
|
|
15040
15279
|
return { exitCode: 0 };
|
|
15041
15280
|
}
|
|
15042
15281
|
case "status": {
|
|
15043
|
-
const manifestPath =
|
|
15282
|
+
const manifestPath = join10(rootDir, HARNESS_PATH);
|
|
15044
15283
|
const graph = existsSync8(manifestPath) ? readHarnessGraph(manifestPath) : scanHarness({
|
|
15045
15284
|
rootDir,
|
|
15046
15285
|
tenantId: tenant?.tenantId,
|
|
@@ -15181,10 +15420,10 @@ function emitWrittenArtifacts(context, written, description) {
|
|
|
15181
15420
|
}
|
|
15182
15421
|
}
|
|
15183
15422
|
async function runPromptConcernAnalysis(context, rootDir, scanPlan, tenant) {
|
|
15184
|
-
const manifest =
|
|
15423
|
+
const manifest = join10(rootDir, ".moda/prompts.yml");
|
|
15185
15424
|
let existing = [];
|
|
15186
15425
|
if (existsSync8(manifest)) {
|
|
15187
|
-
const document = $parseDocument(
|
|
15426
|
+
const document = $parseDocument(readFileSync13(manifest, "utf8"));
|
|
15188
15427
|
if (document.errors.length)
|
|
15189
15428
|
throw new CliInputError("Invalid prompt manifest.", document.errors[0].message);
|
|
15190
15429
|
existing = document.toJS({ maxAliasCount: 20 })?.sources ?? [];
|
|
@@ -15438,7 +15677,7 @@ function readExternalAnalystReport(rootDir, result, adapter, concern) {
|
|
|
15438
15677
|
result.stderr
|
|
15439
15678
|
].join(`
|
|
15440
15679
|
`));
|
|
15441
|
-
debugHint = `Raw analyst output saved to ${
|
|
15680
|
+
debugHint = `Raw analyst output saved to ${join10(MODA_DIR, "analyst-debug.log")} for debugging.`;
|
|
15442
15681
|
} catch {}
|
|
15443
15682
|
throw new CliInputError(`Harness analyst ${adapter} did not return a harness report.`, [
|
|
15444
15683
|
`Expected ${HARNESS_REPORT_PATH} or final JSON between ${REPORT_JSON_BEGIN} and ${REPORT_JSON_END}.`,
|
|
@@ -15547,6 +15786,8 @@ function repairExternalAnalystReport(report, rootDir, options = {}) {
|
|
|
15547
15786
|
const normalized = normalizeHarnessReport(report);
|
|
15548
15787
|
repairCitationLines(normalized, rootDir);
|
|
15549
15788
|
mergeDeterministicArtifacts(normalized.graph, rootDir, { concern: options.concern });
|
|
15789
|
+
if (!options.concern || options.concern === "topology")
|
|
15790
|
+
mergeBoundRuntimeClasses(normalized.graph, rootDir);
|
|
15550
15791
|
hydratePromptAndToolBodies(normalized.graph, rootDir);
|
|
15551
15792
|
const unverified = new Set;
|
|
15552
15793
|
for (const artifact of normalized.graph.artifacts) {
|
|
@@ -15840,7 +16081,7 @@ function repairCitationLines(report, rootDir) {
|
|
|
15840
16081
|
continue;
|
|
15841
16082
|
let text;
|
|
15842
16083
|
try {
|
|
15843
|
-
text =
|
|
16084
|
+
text = readFileSync13(candidatePath, "utf8");
|
|
15844
16085
|
} catch {
|
|
15845
16086
|
continue;
|
|
15846
16087
|
}
|
|
@@ -16446,14 +16687,14 @@ function createPromptAnalystIsolation(adapter, rootDir) {
|
|
|
16446
16687
|
const serverPath = bundledServer ? bundled : source;
|
|
16447
16688
|
const command = bundledServer ? process.execPath : resolveBunRuntime();
|
|
16448
16689
|
const serverArgs = [serverPath, "--root", rootDir];
|
|
16449
|
-
const tempPath = mkdtempSync2(
|
|
16690
|
+
const tempPath = mkdtempSync2(join10(tmpdir2(), "moda-prompt-analyst-"));
|
|
16450
16691
|
const cleanup = () => {
|
|
16451
16692
|
try {
|
|
16452
16693
|
rmSync4(tempPath, { recursive: true, force: true });
|
|
16453
16694
|
} catch {}
|
|
16454
16695
|
};
|
|
16455
16696
|
if (adapter === "claude") {
|
|
16456
|
-
const configPath =
|
|
16697
|
+
const configPath = join10(tempPath, "claude-mcp.json");
|
|
16457
16698
|
writeFileSync5(configPath, JSON.stringify({ mcpServers: { "moda-prompt-source": { command, args: serverArgs } } }));
|
|
16458
16699
|
return { configPath, cleanup };
|
|
16459
16700
|
}
|
|
@@ -16869,10 +17110,10 @@ function readDirectoryPreflightPaths(rootDir) {
|
|
|
16869
17110
|
const stack = ["."];
|
|
16870
17111
|
while (stack.length > 0 && paths.length < 2000) {
|
|
16871
17112
|
const current = stack.pop() ?? ".";
|
|
16872
|
-
const absolute = current === "." ? rootDir :
|
|
17113
|
+
const absolute = current === "." ? rootDir : join10(rootDir, current);
|
|
16873
17114
|
let entries;
|
|
16874
17115
|
try {
|
|
16875
|
-
entries =
|
|
17116
|
+
entries = readdirSync5(absolute);
|
|
16876
17117
|
} catch {
|
|
16877
17118
|
continue;
|
|
16878
17119
|
}
|
|
@@ -16880,10 +17121,10 @@ function readDirectoryPreflightPaths(rootDir) {
|
|
|
16880
17121
|
const child = current === "." ? entry : `${current}/${entry}`;
|
|
16881
17122
|
if (shouldSkipPreflightPath(child))
|
|
16882
17123
|
continue;
|
|
16883
|
-
const childAbsolute =
|
|
17124
|
+
const childAbsolute = join10(rootDir, child);
|
|
16884
17125
|
let stat;
|
|
16885
17126
|
try {
|
|
16886
|
-
stat =
|
|
17127
|
+
stat = lstatSync8(childAbsolute);
|
|
16887
17128
|
} catch {
|
|
16888
17129
|
continue;
|
|
16889
17130
|
}
|
|
@@ -16945,7 +17186,7 @@ function findOnPath(command) {
|
|
|
16945
17186
|
if (command.includes("/") && existsSync8(command))
|
|
16946
17187
|
return command;
|
|
16947
17188
|
for (const dir of (process.env.PATH ?? "").split(delimiter).filter(Boolean)) {
|
|
16948
|
-
const candidate =
|
|
17189
|
+
const candidate = join10(dir, command);
|
|
16949
17190
|
if (existsSync8(candidate))
|
|
16950
17191
|
return candidate;
|
|
16951
17192
|
}
|
|
@@ -17023,10 +17264,10 @@ function collectSnapshotInputs(rootDir, maxFiles, maxTextBytes) {
|
|
|
17023
17264
|
let inventoryFileCount = 0;
|
|
17024
17265
|
let inventoryTextBytes = 0;
|
|
17025
17266
|
function walk(current) {
|
|
17026
|
-
const path = normalizePath2(
|
|
17267
|
+
const path = normalizePath2(relative7(rootDir, current)) || ".";
|
|
17027
17268
|
let stat;
|
|
17028
17269
|
try {
|
|
17029
|
-
stat =
|
|
17270
|
+
stat = lstatSync8(current);
|
|
17030
17271
|
} catch {
|
|
17031
17272
|
return;
|
|
17032
17273
|
}
|
|
@@ -17037,8 +17278,8 @@ function collectSnapshotInputs(rootDir, maxFiles, maxTextBytes) {
|
|
|
17037
17278
|
if (stat.isDirectory()) {
|
|
17038
17279
|
if (path !== "." && (isSkippedDir(path) || isSkippedPathPrefix(path)))
|
|
17039
17280
|
return;
|
|
17040
|
-
for (const entry of
|
|
17041
|
-
walk(
|
|
17281
|
+
for (const entry of readdirSync5(current).sort())
|
|
17282
|
+
walk(join10(current, entry));
|
|
17042
17283
|
return;
|
|
17043
17284
|
}
|
|
17044
17285
|
if (!stat.isFile())
|
|
@@ -17061,7 +17302,7 @@ function collectSnapshotInputs(rootDir, maxFiles, maxTextBytes) {
|
|
|
17061
17302
|
let text = "";
|
|
17062
17303
|
if (isTextFile(path)) {
|
|
17063
17304
|
try {
|
|
17064
|
-
text =
|
|
17305
|
+
text = readFileSync13(current, "utf8");
|
|
17065
17306
|
inventoryTextBytes += Buffer.byteLength(text, "utf8");
|
|
17066
17307
|
} catch {
|
|
17067
17308
|
return;
|
|
@@ -17080,7 +17321,7 @@ function buildSourceSnapshot(rootDir) {
|
|
|
17080
17321
|
const inputs = collectSnapshotInputs(root, maxFiles, maxTextBytes);
|
|
17081
17322
|
const repo = detectRepo(root, inputs.map((input) => ({
|
|
17082
17323
|
path: input.path,
|
|
17083
|
-
absPath:
|
|
17324
|
+
absPath: join10(root, input.path),
|
|
17084
17325
|
rootDir: root,
|
|
17085
17326
|
text: input.text
|
|
17086
17327
|
})));
|
|
@@ -17094,7 +17335,7 @@ function buildSourceSnapshot(rootDir) {
|
|
|
17094
17335
|
}
|
|
17095
17336
|
function buildCommandScanPlan(context, rootDir) {
|
|
17096
17337
|
const explicitPath = context.flags.path !== undefined;
|
|
17097
|
-
const rel2 = normalizePath2(
|
|
17338
|
+
const rel2 = normalizePath2(relative7(context.cwd, rootDir)) || ".";
|
|
17098
17339
|
const scope = explicitPath && rel2 !== "." ? "narrow" : "broad";
|
|
17099
17340
|
const machineReadable = context.outputMode !== "human";
|
|
17100
17341
|
const approvalRequired = context.positional === "analyze" && scope === "broad" && !context.yes;
|
|
@@ -17179,7 +17420,7 @@ function writeHumanBlock(context, message) {
|
|
|
17179
17420
|
function buildHarnessReadPlan(rootDir, pathWasExplicit) {
|
|
17180
17421
|
return {
|
|
17181
17422
|
scope: pathWasExplicit ? "narrow" : "broad",
|
|
17182
|
-
rootPaths: [normalizePath2(
|
|
17423
|
+
rootPaths: [normalizePath2(relative7(rootDir, rootDir)) || "."],
|
|
17183
17424
|
willRead: [
|
|
17184
17425
|
"package manifests",
|
|
17185
17426
|
"source files under the selected path",
|
|
@@ -17297,7 +17538,7 @@ async function syncHarnessWithRemote(context, body) {
|
|
|
17297
17538
|
}, profileOptions);
|
|
17298
17539
|
}
|
|
17299
17540
|
function writeHarnessSyncState(rootDir, state) {
|
|
17300
|
-
const path =
|
|
17541
|
+
const path = join10(rootDir, SYNC_STATE_PATH);
|
|
17301
17542
|
mkdirSync5(dirname7(path), { recursive: true });
|
|
17302
17543
|
writeFileSync5(path, `${JSON.stringify(state, null, 2)}
|
|
17303
17544
|
`);
|
|
@@ -17311,7 +17552,7 @@ function selectedRuntimeAgentId(flags) {
|
|
|
17311
17552
|
return;
|
|
17312
17553
|
}
|
|
17313
17554
|
function loadOrScanHarness(rootDir, tenant, context) {
|
|
17314
|
-
const manifestPath =
|
|
17555
|
+
const manifestPath = join10(rootDir, HARNESS_PATH);
|
|
17315
17556
|
if (existsSync8(manifestPath))
|
|
17316
17557
|
return readHarnessGraph(manifestPath);
|
|
17317
17558
|
if (context) {
|
|
@@ -17368,7 +17609,7 @@ var FRESHER_REPORT_MAX_DIRS = 4000;
|
|
|
17368
17609
|
function findFresherHarnessReports(rootDir) {
|
|
17369
17610
|
let rootMtimeMs = 0;
|
|
17370
17611
|
try {
|
|
17371
|
-
rootMtimeMs =
|
|
17612
|
+
rootMtimeMs = lstatSync8(join10(rootDir, HARNESS_REPORT_PATH)).mtimeMs;
|
|
17372
17613
|
} catch {
|
|
17373
17614
|
rootMtimeMs = 0;
|
|
17374
17615
|
}
|
|
@@ -17380,19 +17621,19 @@ function findFresherHarnessReports(rootDir) {
|
|
|
17380
17621
|
visited += 1;
|
|
17381
17622
|
let entries;
|
|
17382
17623
|
try {
|
|
17383
|
-
entries =
|
|
17624
|
+
entries = readdirSync5(dir, { withFileTypes: true });
|
|
17384
17625
|
} catch {
|
|
17385
17626
|
return;
|
|
17386
17627
|
}
|
|
17387
17628
|
for (const entry of entries) {
|
|
17388
17629
|
if (!entry.isDirectory() || entry.name.startsWith(".") || SKIPPED_DIRS.has(entry.name))
|
|
17389
17630
|
continue;
|
|
17390
|
-
const child =
|
|
17631
|
+
const child = join10(dir, entry.name);
|
|
17391
17632
|
try {
|
|
17392
|
-
const candidate =
|
|
17633
|
+
const candidate = lstatSync8(join10(child, HARNESS_REPORT_PATH));
|
|
17393
17634
|
if (candidate.isFile() && candidate.mtimeMs > rootMtimeMs) {
|
|
17394
17635
|
fresher.push({
|
|
17395
|
-
path: normalizePath2(
|
|
17636
|
+
path: normalizePath2(relative7(rootDir, join10(child, HARNESS_REPORT_PATH))),
|
|
17396
17637
|
mtimeMs: candidate.mtimeMs
|
|
17397
17638
|
});
|
|
17398
17639
|
}
|
|
@@ -17404,7 +17645,7 @@ function findFresherHarnessReports(rootDir) {
|
|
|
17404
17645
|
return fresher.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
17405
17646
|
}
|
|
17406
17647
|
function warnFresherSubdirHarnessReports(context, rootDir, explicitReport) {
|
|
17407
|
-
const explicitReportPath = explicitReport && explicitReport !== "true" ? normalizePath2(
|
|
17648
|
+
const explicitReportPath = explicitReport && explicitReport !== "true" ? normalizePath2(relative7(rootDir, resolve10(rootDir, explicitReport))) : undefined;
|
|
17408
17649
|
if (explicitReportPath && explicitReportPath !== normalizePath2(HARNESS_REPORT_PATH))
|
|
17409
17650
|
return;
|
|
17410
17651
|
let fresher;
|
|
@@ -17417,16 +17658,16 @@ function warnFresherSubdirHarnessReports(context, rootDir, explicitReport) {
|
|
|
17417
17658
|
return;
|
|
17418
17659
|
const newest = fresher[0];
|
|
17419
17660
|
const subdir = normalizePath2(dirname7(dirname7(newest.path)));
|
|
17420
|
-
const rootState = existsSync8(
|
|
17661
|
+
const rootState = existsSync8(join10(rootDir, HARNESS_REPORT_PATH)) ? `older ${HARNESS_REPORT_PATH}` : `no ${HARNESS_REPORT_PATH}`;
|
|
17421
17662
|
writeHarnessNotice(context, `A fresher harness report exists at ${newest.path} (this directory has ${rootState}). If you meant that report, re-run with --path=${subdir}.`);
|
|
17422
17663
|
}
|
|
17423
17664
|
function readHarnessGraph(manifestPath) {
|
|
17424
|
-
return JSON.parse(
|
|
17665
|
+
return JSON.parse(readFileSync13(manifestPath, "utf8"));
|
|
17425
17666
|
}
|
|
17426
17667
|
function writeHarnessArtifacts(graph, rootDir, options = {}) {
|
|
17427
|
-
const modaDir =
|
|
17668
|
+
const modaDir = join10(rootDir, MODA_DIR);
|
|
17428
17669
|
mkdirSync5(modaDir, { recursive: true });
|
|
17429
|
-
const manifestPath =
|
|
17670
|
+
const manifestPath = join10(rootDir, HARNESS_PATH);
|
|
17430
17671
|
writeFileSync5(manifestPath, `${JSON.stringify(graph, null, 2)}
|
|
17431
17672
|
`);
|
|
17432
17673
|
const written = [HARNESS_PATH];
|
|
@@ -17436,7 +17677,7 @@ function writeHarnessArtifacts(graph, rootDir, options = {}) {
|
|
|
17436
17677
|
return written;
|
|
17437
17678
|
}
|
|
17438
17679
|
function writeHarnessSummary(graph, rootDir) {
|
|
17439
|
-
const summaryPath =
|
|
17680
|
+
const summaryPath = join10(rootDir, HARNESS_SUMMARY_PATH);
|
|
17440
17681
|
mkdirSync5(dirname7(summaryPath), { recursive: true });
|
|
17441
17682
|
writeFileSync5(summaryPath, renderHarnessMarkdown(graph));
|
|
17442
17683
|
return HARNESS_SUMMARY_PATH;
|
|
@@ -17611,10 +17852,10 @@ function inventoryFiles(rootDir, skipped, options = {}) {
|
|
|
17611
17852
|
const maxTextBytes = numericEnv("MODA_HARNESS_MAX_TEXT_BYTES", DEFAULT_MAX_INVENTORY_TEXT_BYTES);
|
|
17612
17853
|
let textBytes = 0;
|
|
17613
17854
|
function walk(current) {
|
|
17614
|
-
const rel2 = normalizePath2(
|
|
17855
|
+
const rel2 = normalizePath2(relative7(rootReal, current)) || ".";
|
|
17615
17856
|
let stat;
|
|
17616
17857
|
try {
|
|
17617
|
-
stat =
|
|
17858
|
+
stat = lstatSync8(current);
|
|
17618
17859
|
} catch {
|
|
17619
17860
|
recordSkipped(skipped, { path: rel2, reason: "stat failed" });
|
|
17620
17861
|
return;
|
|
@@ -17628,8 +17869,8 @@ function inventoryFiles(rootDir, skipped, options = {}) {
|
|
|
17628
17869
|
recordSkipped(skipped, { path: rel2, reason: "ignored directory" });
|
|
17629
17870
|
return;
|
|
17630
17871
|
}
|
|
17631
|
-
for (const entry of
|
|
17632
|
-
walk(
|
|
17872
|
+
for (const entry of readdirSync5(current).sort()) {
|
|
17873
|
+
walk(join10(current, entry));
|
|
17633
17874
|
}
|
|
17634
17875
|
return;
|
|
17635
17876
|
}
|
|
@@ -17660,7 +17901,7 @@ function inventoryFiles(rootDir, skipped, options = {}) {
|
|
|
17660
17901
|
recordSkipped(skipped, { path: rel2, reason: "scan text budget exceeded" });
|
|
17661
17902
|
} else {
|
|
17662
17903
|
try {
|
|
17663
|
-
item.text =
|
|
17904
|
+
item.text = readFileSync13(current, "utf8");
|
|
17664
17905
|
textBytes += Buffer.byteLength(item.text, "utf8");
|
|
17665
17906
|
} catch {
|
|
17666
17907
|
recordSkipped(skipped, { path: rel2, reason: "text read failed" });
|
|
@@ -17967,7 +18208,7 @@ function maybeAddPromptArtifact(graph, file) {
|
|
|
17967
18208
|
if (!isPrompt)
|
|
17968
18209
|
return;
|
|
17969
18210
|
const id = stableId("prompt", file.path);
|
|
17970
|
-
const text = file.text ??
|
|
18211
|
+
const text = file.text ?? readFileSync13(file.absPath, "utf8");
|
|
17971
18212
|
upsertArtifact(graph, {
|
|
17972
18213
|
id,
|
|
17973
18214
|
type: "prompt",
|
|
@@ -18545,10 +18786,10 @@ function computeDeterministicFloor(rootDir) {
|
|
|
18545
18786
|
}
|
|
18546
18787
|
function detectProviderPackagesInManifests(rootDir) {
|
|
18547
18788
|
const present = new Set;
|
|
18548
|
-
const packageJsonPath =
|
|
18789
|
+
const packageJsonPath = join10(rootDir, "package.json");
|
|
18549
18790
|
if (existsSync8(packageJsonPath)) {
|
|
18550
18791
|
try {
|
|
18551
|
-
const deps = packageDependencyNames(
|
|
18792
|
+
const deps = packageDependencyNames(readFileSync13(packageJsonPath, "utf8"));
|
|
18552
18793
|
for (const provider of PROVIDER_CATALOG) {
|
|
18553
18794
|
for (const name of provider.packageNames) {
|
|
18554
18795
|
if (deps.has(name))
|
|
@@ -18557,10 +18798,10 @@ function detectProviderPackagesInManifests(rootDir) {
|
|
|
18557
18798
|
}
|
|
18558
18799
|
} catch {}
|
|
18559
18800
|
}
|
|
18560
|
-
const pyprojectPath =
|
|
18801
|
+
const pyprojectPath = join10(rootDir, "pyproject.toml");
|
|
18561
18802
|
if (existsSync8(pyprojectPath)) {
|
|
18562
18803
|
try {
|
|
18563
|
-
const deps = pyprojectDependencyNames(
|
|
18804
|
+
const deps = pyprojectDependencyNames(readFileSync13(pyprojectPath, "utf8"));
|
|
18564
18805
|
for (const provider of PROVIDER_CATALOG) {
|
|
18565
18806
|
for (const name of provider.packageNames) {
|
|
18566
18807
|
if (deps.has(name.toLowerCase()))
|
|
@@ -18962,12 +19203,12 @@ function contentHashForAnnotatedSource(sourcePath, annotation) {
|
|
|
18962
19203
|
function readSmallTextFileForHash(absPath, rootDir) {
|
|
18963
19204
|
if (!existsSync8(absPath))
|
|
18964
19205
|
return;
|
|
18965
|
-
const rel2 = normalizePath2(
|
|
19206
|
+
const rel2 = normalizePath2(relative7(rootDir, absPath));
|
|
18966
19207
|
if (isSecretishPath(rel2))
|
|
18967
19208
|
return;
|
|
18968
19209
|
let stat;
|
|
18969
19210
|
try {
|
|
18970
|
-
stat =
|
|
19211
|
+
stat = lstatSync8(absPath);
|
|
18971
19212
|
} catch {
|
|
18972
19213
|
return;
|
|
18973
19214
|
}
|
|
@@ -18977,7 +19218,7 @@ function readSmallTextFileForHash(absPath, rootDir) {
|
|
|
18977
19218
|
if (!isTextFile(rel2))
|
|
18978
19219
|
return;
|
|
18979
19220
|
try {
|
|
18980
|
-
return
|
|
19221
|
+
return readFileSync13(absPath, "utf8");
|
|
18981
19222
|
} catch {
|
|
18982
19223
|
return;
|
|
18983
19224
|
}
|
|
@@ -5768,7 +5768,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
|
|
|
5768
5768
|
const analyzedDefinitions = new Map;
|
|
5769
5769
|
if (flags["no-analyze"] !== "true") {
|
|
5770
5770
|
options.onProgress?.("Analyzing prompt sources before sync.");
|
|
5771
|
-
const { analyzeHarnessPrompts } = await import("./harness-
|
|
5771
|
+
const { analyzeHarnessPrompts } = await import("./harness-3bcakwrv.js");
|
|
5772
5772
|
const result = await analyzeHarnessPrompts({
|
|
5773
5773
|
rootDir: process.cwd(),
|
|
5774
5774
|
existing: established.flatMap((prompt) => prompt.sourceDefinition ? [prompt.sourceDefinition.source] : []),
|
|
@@ -5796,7 +5796,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
|
|
|
5796
5796
|
const mergedSources = mergePromptSources(manifest.sources, extraSources);
|
|
5797
5797
|
const manifestUpdate = stableJson(mergedSources) === stableJson(mergePromptSources(manifest.sources, [])) ? undefined : $stringify({ version: 2, prompt_paths: manifest.promptPaths, sources: mergedSources });
|
|
5798
5798
|
const prompts = await discoverPrompts(extraSources);
|
|
5799
|
-
const { checkPromptAttribution } = await import("./prompt-attribution-
|
|
5799
|
+
const { checkPromptAttribution } = await import("./prompt-attribution-2687ns4k.js");
|
|
5800
5800
|
const attribution = checkPromptAttribution(process.cwd(), prompts.map((prompt) => prompt.key));
|
|
5801
5801
|
const brokenAttribution = attribution.references.filter((reference) => reference.status === "missing");
|
|
5802
5802
|
if (brokenAttribution.length) {
|
|
@@ -6102,7 +6102,7 @@ async function migratePromptManifest(options = {}) {
|
|
|
6102
6102
|
let addedSources = [];
|
|
6103
6103
|
let pendingSources = [];
|
|
6104
6104
|
if (options.discover) {
|
|
6105
|
-
const { analyzeHarnessPrompts } = await import("./harness-
|
|
6105
|
+
const { analyzeHarnessPrompts } = await import("./harness-3bcakwrv.js");
|
|
6106
6106
|
const result = await analyzeHarnessPrompts({
|
|
6107
6107
|
rootDir: root,
|
|
6108
6108
|
existing: manifest.sources,
|
|
@@ -6303,7 +6303,7 @@ async function readHarnessSources(reportPath) {
|
|
|
6303
6303
|
if (!graph) {
|
|
6304
6304
|
throw new CliInputError(`${selected} is not a harness report with a graph (schema: ${schemaLabel}). Regenerate it with \`${HARNESS_REANALYZE_COMMAND}\`.`);
|
|
6305
6305
|
}
|
|
6306
|
-
const { normalizeHarnessReport } = await import("./harness-report-
|
|
6306
|
+
const { normalizeHarnessReport } = await import("./harness-report-rjcjbh93.js");
|
|
6307
6307
|
const { backfillPromptSource, resolvePromptSource } = await loadPromptSources();
|
|
6308
6308
|
const report = normalizeHarnessReport(raw);
|
|
6309
6309
|
const artifacts = (report.graph.artifacts ?? []).filter((artifact) => artifact.type === "prompt");
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./cli-rdh9jjr2.js";
|
|
5
5
|
import {
|
|
6
6
|
inspectPromptManifest
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-r4k0yfkt.js";
|
|
8
8
|
import {
|
|
9
9
|
readHarnessSyncState,
|
|
10
10
|
renderDoctorHuman,
|
|
@@ -395,7 +395,7 @@ async function harnessCurrentCheck(cwd, manifestPath, manifestExists, tenantId)
|
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
397
|
try {
|
|
398
|
-
const { scanHarness } = await import("./harness-
|
|
398
|
+
const { scanHarness } = await import("./harness-3bcakwrv.js");
|
|
399
399
|
const current = scanHarness({
|
|
400
400
|
rootDir: cwd,
|
|
401
401
|
scannerVersion: "doctor",
|
package/dist/cli.js
CHANGED
|
@@ -2968,25 +2968,25 @@ function leafManifestFields(leaf, commands) {
|
|
|
2968
2968
|
import { fileURLToPath } from "url";
|
|
2969
2969
|
import { realpathSync } from "fs";
|
|
2970
2970
|
async function runPromptsCommand(...args) {
|
|
2971
|
-
return (await import("./prompts-
|
|
2971
|
+
return (await import("./prompts-887e9w1v.js")).runPromptsCommand(...args);
|
|
2972
2972
|
}
|
|
2973
2973
|
async function runSkillsCommand(...args) {
|
|
2974
2974
|
return (await import("./skills-mwftqzyk.js")).runSkillsCommand(...args);
|
|
2975
2975
|
}
|
|
2976
2976
|
async function runHarnessCommand(...args) {
|
|
2977
|
-
return (await import("./harness-
|
|
2977
|
+
return (await import("./harness-3bcakwrv.js")).runHarnessCommand(...args);
|
|
2978
2978
|
}
|
|
2979
2979
|
async function runSyncCommand(...args) {
|
|
2980
|
-
return (await import("./sync-
|
|
2980
|
+
return (await import("./sync-dxnw1mwa.js")).runSyncCommand(...args);
|
|
2981
2981
|
}
|
|
2982
2982
|
async function runRegistryCommand(...args) {
|
|
2983
2983
|
return (await import("./registry-tv8fktxc.js")).runRegistryCommand(...args);
|
|
2984
2984
|
}
|
|
2985
2985
|
async function runDoctorCommand(...args) {
|
|
2986
|
-
return (await import("./doctor-
|
|
2986
|
+
return (await import("./doctor-wstqcfm4.js")).runDoctorCommand(...args);
|
|
2987
2987
|
}
|
|
2988
2988
|
async function runStatusCommand(...args) {
|
|
2989
|
-
return (await import("./doctor-
|
|
2989
|
+
return (await import("./doctor-wstqcfm4.js")).runStatusCommand(...args);
|
|
2990
2990
|
}
|
|
2991
2991
|
async function runAuthCommand(...args) {
|
|
2992
2992
|
return (await import("./profile-commands-nbaec4y9.js")).runAuthCommand(...args);
|
|
@@ -2998,7 +2998,7 @@ async function runProfilesCommand(...args) {
|
|
|
2998
2998
|
return (await import("./profile-commands-nbaec4y9.js")).runProfilesCommand(...args);
|
|
2999
2999
|
}
|
|
3000
3000
|
async function runAgentCommand(...args) {
|
|
3001
|
-
return (await import("./agent-
|
|
3001
|
+
return (await import("./agent-0wpfk7ed.js")).runAgentCommand(...args);
|
|
3002
3002
|
}
|
|
3003
3003
|
async function runProductionCommand(...args) {
|
|
3004
3004
|
return (await import("./production-intelligence-zek0rkzj.js")).runProductionCommand(...args);
|
|
@@ -6762,7 +6762,7 @@ var commandRegistry = createCommandRegistry([
|
|
|
6762
6762
|
resetApiRequestCountBeforeRun: true,
|
|
6763
6763
|
telemetry: "result-and-error",
|
|
6764
6764
|
handler: async (context) => {
|
|
6765
|
-
const { runInit } = await import("./index-
|
|
6765
|
+
const { runInit } = await import("./index-msk4gfn5.js");
|
|
6766
6766
|
if (context.outputMode === "agent-stream") {
|
|
6767
6767
|
context.output.writeEvent({
|
|
6768
6768
|
event: "started",
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
promptsDiscoveredCheck,
|
|
4
4
|
runDoctorCommand,
|
|
5
5
|
runStatusCommand
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-thhggczw.js";
|
|
7
7
|
import"./cli-rdh9jjr2.js";
|
|
8
|
-
import"./cli-
|
|
8
|
+
import"./cli-r4k0yfkt.js";
|
|
9
9
|
import"./cli-mm48br00.js";
|
|
10
10
|
import"./cli-xq45etg1.js";
|
|
11
11
|
import"./cli-gtke9wrw.js";
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
writeHarnessAnalyzeResult,
|
|
44
44
|
writeHarnessArtifacts,
|
|
45
45
|
writeHumanProgress
|
|
46
|
-
} from "./cli-
|
|
46
|
+
} from "./cli-7nghchj8.js";
|
|
47
47
|
import"./cli-97fnztpy.js";
|
|
48
48
|
import"./cli-xq45etg1.js";
|
|
49
49
|
import"./cli-gtke9wrw.js";
|
|
@@ -56,7 +56,7 @@ import"./cli-9kfxkxmk.js";
|
|
|
56
56
|
import"./cli-c1k20j6e.js";
|
|
57
57
|
import {
|
|
58
58
|
HARNESS_ANALYZE_CONCERNS
|
|
59
|
-
} from "./cli-
|
|
59
|
+
} from "./cli-6hdqp65a.js";
|
|
60
60
|
import"./cli-k4tqwah4.js";
|
|
61
61
|
import"./cli-0v6na3yp.js";
|
|
62
62
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildSourceSnapshot
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-7nghchj8.js";
|
|
4
4
|
import"./cli-97fnztpy.js";
|
|
5
5
|
import"./cli-xq45etg1.js";
|
|
6
6
|
import"./cli-gtke9wrw.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import"./cli-vswckv9g.js";
|
|
14
14
|
import"./cli-9kfxkxmk.js";
|
|
15
15
|
import"./cli-c1k20j6e.js";
|
|
16
|
-
import"./cli-
|
|
16
|
+
import"./cli-6hdqp65a.js";
|
|
17
17
|
import"./cli-k4tqwah4.js";
|
|
18
18
|
import"./cli-0v6na3yp.js";
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./cli-hcwdz9sd.js";
|
|
22
22
|
import {
|
|
23
23
|
buildDoctorReport
|
|
24
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-thhggczw.js";
|
|
25
25
|
import {
|
|
26
26
|
ConnectCodeError,
|
|
27
27
|
connectWithCode,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
initPrompts,
|
|
34
34
|
runPromptSync
|
|
35
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-r4k0yfkt.js";
|
|
36
36
|
import"./cli-mm48br00.js";
|
|
37
37
|
import {
|
|
38
38
|
codingAgentDisplayName,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
runCodingAgent,
|
|
47
47
|
runHarnessCommand,
|
|
48
48
|
startRemoteAnalyze
|
|
49
|
-
} from "./cli-
|
|
49
|
+
} from "./cli-7nghchj8.js";
|
|
50
50
|
import {
|
|
51
51
|
stripAnsi
|
|
52
52
|
} from "./cli-97fnztpy.js";
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
import"./cli-vswckv9g.js";
|
|
75
75
|
import"./cli-9kfxkxmk.js";
|
|
76
76
|
import"./cli-c1k20j6e.js";
|
|
77
|
-
import"./cli-
|
|
77
|
+
import"./cli-6hdqp65a.js";
|
|
78
78
|
import {
|
|
79
79
|
CliAuthError,
|
|
80
80
|
CliInputError
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inventoryFiles,
|
|
3
3
|
safePromptEvidencePath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-7nghchj8.js";
|
|
5
5
|
import"./cli-97fnztpy.js";
|
|
6
6
|
import"./cli-xq45etg1.js";
|
|
7
7
|
import"./cli-gtke9wrw.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./cli-vswckv9g.js";
|
|
15
15
|
import"./cli-9kfxkxmk.js";
|
|
16
16
|
import"./cli-c1k20j6e.js";
|
|
17
|
-
import"./cli-
|
|
17
|
+
import"./cli-6hdqp65a.js";
|
|
18
18
|
import"./cli-k4tqwah4.js";
|
|
19
19
|
import {
|
|
20
20
|
__toESM
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
checkPromptMapping,
|
|
4
4
|
discoverHarnessPromptSources,
|
|
5
5
|
safePromptEvidencePath
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-7nghchj8.js";
|
|
7
7
|
import"./cli-97fnztpy.js";
|
|
8
8
|
import"./cli-xq45etg1.js";
|
|
9
9
|
import"./cli-gtke9wrw.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./cli-vswckv9g.js";
|
|
18
18
|
import"./cli-9kfxkxmk.js";
|
|
19
19
|
import"./cli-c1k20j6e.js";
|
|
20
|
-
import"./cli-
|
|
20
|
+
import"./cli-6hdqp65a.js";
|
|
21
21
|
import"./cli-k4tqwah4.js";
|
|
22
22
|
import {
|
|
23
23
|
__commonJS,
|
|
@@ -6,11 +6,11 @@ import"./cli-rjav0vj1.js";
|
|
|
6
6
|
import"./cli-hcwdz9sd.js";
|
|
7
7
|
import {
|
|
8
8
|
runPromptsCommand
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-r4k0yfkt.js";
|
|
10
10
|
import"./cli-mm48br00.js";
|
|
11
11
|
import {
|
|
12
12
|
runHarnessCommand
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-7nghchj8.js";
|
|
14
14
|
import"./cli-97fnztpy.js";
|
|
15
15
|
import"./cli-xq45etg1.js";
|
|
16
16
|
import"./cli-gtke9wrw.js";
|
|
@@ -21,7 +21,7 @@ import"./cli-40fqk078.js";
|
|
|
21
21
|
import"./cli-vswckv9g.js";
|
|
22
22
|
import"./cli-9kfxkxmk.js";
|
|
23
23
|
import"./cli-c1k20j6e.js";
|
|
24
|
-
import"./cli-
|
|
24
|
+
import"./cli-6hdqp65a.js";
|
|
25
25
|
import {
|
|
26
26
|
CliInputError
|
|
27
27
|
} from "./cli-k4tqwah4.js";
|
package/package.json
CHANGED