@moda-ai/cli 1.55.56 → 1.55.58
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-j0syymez.js → agent-921q6yvy.js} +4 -4
- package/dist/{cli-jrf8annc.js → cli-4zdem6xd.js} +3 -3
- package/dist/{cli-7epk27vq.js → cli-a821bf9p.js} +3 -3
- package/dist/{cli-xq45etg1.js → cli-k0vxtzxb.js} +7 -7
- package/dist/{cli-p7856v3b.js → cli-tp48x76x.js} +150 -10
- package/dist/cli.js +7 -7
- package/dist/{doctor-q8khayre.js → doctor-m6v07zc7.js} +3 -3
- package/dist/{harness-2vkcwm85.js → harness-2jb52s8r.js} +2 -2
- package/dist/{harness-github-actions-yev2yrkr.js → harness-github-actions-4q0nkvxb.js} +2 -2
- package/dist/{index-k6xec97f.js → index-2crvn108.js} +4 -4
- package/dist/{prompt-attribution-2h9vertk.js → prompt-attribution-ndw4jvew.js} +2 -2
- package/dist/prompt-source-mcp.js +2 -2
- package/dist/{prompts-y35emwj0.js → prompts-2z3cdc52.js} +1 -1
- package/dist/{sync-ydfxfjs5.js → sync-y4tcnmg6.js} +3 -3
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildDoctorReport
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-a821bf9p.js";
|
|
4
4
|
import"./cli-94r5x9bg.js";
|
|
5
|
-
import"./cli-
|
|
5
|
+
import"./cli-4zdem6xd.js";
|
|
6
6
|
import"./cli-mm48br00.js";
|
|
7
7
|
import {
|
|
8
8
|
readHarnessSyncState
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-k0vxtzxb.js";
|
|
10
10
|
import"./cli-v2h21cgf.js";
|
|
11
11
|
import"./cli-e0kbye4s.js";
|
|
12
12
|
import"./cli-31ybq5f2.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-2jb52s8r.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),
|
|
@@ -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-2jb52s8r.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-ndw4jvew.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-2jb52s8r.js");
|
|
6106
6106
|
const result = await analyzeHarnessPrompts({
|
|
6107
6107
|
rootDir: root,
|
|
6108
6108
|
existing: manifest.sources,
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./cli-94r5x9bg.js";
|
|
5
5
|
import {
|
|
6
6
|
inspectPromptManifest
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-4zdem6xd.js";
|
|
8
8
|
import {
|
|
9
9
|
readHarnessSyncState,
|
|
10
10
|
renderDoctorHuman,
|
|
11
11
|
renderStatusHuman
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-k0vxtzxb.js";
|
|
13
13
|
import {
|
|
14
14
|
callDataAPI
|
|
15
15
|
} from "./cli-hawwf30b.js";
|
|
@@ -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-2jb52s8r.js");
|
|
399
399
|
const current = scanHarness({
|
|
400
400
|
rootDir: cwd,
|
|
401
401
|
scannerVersion: "doctor",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// ../../packages/messaging/messaging.json
|
|
2
2
|
var messaging_default = {
|
|
3
3
|
$schema: "./messaging.schema.json",
|
|
4
|
-
version: "1.0.
|
|
5
|
-
locked_on: "2026-10-
|
|
4
|
+
version: "1.0.5",
|
|
5
|
+
locked_on: "2026-10-20",
|
|
6
6
|
approved_by: "mo",
|
|
7
|
-
source: "Branding project docs/positioning.md v1.0.
|
|
7
|
+
source: "Branding project docs/positioning.md v1.0.5",
|
|
8
8
|
canonical_strings: {
|
|
9
|
-
version: "1.0.
|
|
10
|
-
locked_on: "2026-10-
|
|
9
|
+
version: "1.0.5",
|
|
10
|
+
locked_on: "2026-10-20",
|
|
11
11
|
approved_by: "mo",
|
|
12
12
|
strings: [
|
|
13
13
|
{
|
|
@@ -212,7 +212,7 @@ var messaging_default = {
|
|
|
212
212
|
]
|
|
213
213
|
},
|
|
214
214
|
banned_phrases: {
|
|
215
|
-
version: "1.0.
|
|
215
|
+
version: "1.0.5",
|
|
216
216
|
phrases: [
|
|
217
217
|
{
|
|
218
218
|
id: "fixes_your_agent",
|
|
@@ -389,7 +389,7 @@ var messaging_default = {
|
|
|
389
389
|
]
|
|
390
390
|
},
|
|
391
391
|
terminology: {
|
|
392
|
-
version: "1.0.
|
|
392
|
+
version: "1.0.5",
|
|
393
393
|
terms: [
|
|
394
394
|
{
|
|
395
395
|
use: "trace",
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
renderHarnessAnalystPreflight,
|
|
10
10
|
renderHarnessAnalyzeHumanResult,
|
|
11
11
|
renderHarnessProgress
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-k0vxtzxb.js";
|
|
13
13
|
import {
|
|
14
14
|
createCommandContext,
|
|
15
15
|
stringOption
|
|
@@ -12145,6 +12145,14 @@ var LINE_PATTERNS = [
|
|
|
12145
12145
|
pattern: /^\s*(?:export\s+)?(?:(?:const|let|var)\s+)?(?:(?:[A-Za-z_$][\w$]*)?(?:prompt|instructions|system|template)[\w$]*)\s*(?::[^=]+)?=/i,
|
|
12146
12146
|
extensions: [...JS, ...PY]
|
|
12147
12147
|
},
|
|
12148
|
+
{
|
|
12149
|
+
kind: "prompt_literal",
|
|
12150
|
+
signal: "code.system_injection",
|
|
12151
|
+
confidence: "high",
|
|
12152
|
+
pattern: /["'`]\s*\[SYSTEM:/,
|
|
12153
|
+
extensions: [...JS, ...PY],
|
|
12154
|
+
maxPerFile: 200
|
|
12155
|
+
},
|
|
12148
12156
|
{
|
|
12149
12157
|
kind: "prompt_literal",
|
|
12150
12158
|
signal: "code.prompt_builder_definition",
|
|
@@ -12311,7 +12319,13 @@ var LINE_PATTERNS = [
|
|
|
12311
12319
|
kind: "model_config",
|
|
12312
12320
|
signal: "model.assignment",
|
|
12313
12321
|
confidence: "high",
|
|
12314
|
-
pattern: /\b(model|model_name|model_id|modelName|modelId|MODEL[A-Z_]*)\s*[:=]\s*["'`][\w.:/-]*(gpt-|o[134](-mini)?\b|claude|gemini|llama|mistral|mixtral|deepseek|qwen|grok|sonnet|opus|haiku|command-r|glm|gemma)[\w.:/-]*["'`]/i
|
|
12322
|
+
pattern: /\b(model|model_name|model_id|modelName|modelId|[A-Z_]*MODEL[A-Z_]*)\s*[:=]\s*["'`][\w.:/-]*(gpt-|o[134](-mini)?\b|claude|gemini|llama|mistral|mixtral|deepseek|qwen|grok|sonnet|opus|haiku|command-r|glm|gemma)[\w.:/-]*["'`]/i
|
|
12323
|
+
},
|
|
12324
|
+
{
|
|
12325
|
+
kind: "model_config",
|
|
12326
|
+
signal: "model.registry_key",
|
|
12327
|
+
confidence: "high",
|
|
12328
|
+
pattern: /^\s*["'`](?:openai|anthropic|google|meta-llama|mistralai|deepseek|qwen|x-ai|cohere|z-ai|moonshotai)\/[\w.:-]+["'`]\s*:/i
|
|
12315
12329
|
},
|
|
12316
12330
|
{
|
|
12317
12331
|
kind: "model_config",
|
|
@@ -12396,7 +12410,7 @@ function detectLinePatterns(file, out) {
|
|
|
12396
12410
|
if (!pattern.pattern.test(line))
|
|
12397
12411
|
continue;
|
|
12398
12412
|
const seen = perSignal.get(pattern.signal) ?? 0;
|
|
12399
|
-
if (seen >= MAX_CANDIDATES_PER_FILE_PER_SIGNAL)
|
|
12413
|
+
if (seen >= (pattern.maxPerFile ?? MAX_CANDIDATES_PER_FILE_PER_SIGNAL) && pattern.kind !== "model_config")
|
|
12400
12414
|
break;
|
|
12401
12415
|
perSignal.set(pattern.signal, seen + 1);
|
|
12402
12416
|
out.push({
|
|
@@ -13560,7 +13574,7 @@ function applyPromptDiscovery(graph, discovery) {
|
|
|
13560
13574
|
}
|
|
13561
13575
|
|
|
13562
13576
|
// src/harness-candidate-promotion.ts
|
|
13563
|
-
import { readFileSync as readFileSync11 } from "node:fs";
|
|
13577
|
+
import { readFileSync as readFileSync11, statSync as statSync3 } from "node:fs";
|
|
13564
13578
|
import { extname as extname7, posix, resolve as resolve9 } from "node:path";
|
|
13565
13579
|
|
|
13566
13580
|
// src/harness-js-source.ts
|
|
@@ -13714,6 +13728,34 @@ var PROMPT_NAME = /prompt|instruction|system|template|rubric|persona|backstory|c
|
|
|
13714
13728
|
function comparable(text) {
|
|
13715
13729
|
return text.replace(/\\/g, "").replace(/\s+/g, " ").trim();
|
|
13716
13730
|
}
|
|
13731
|
+
function jsSystemInjectionLiteralAt(source, startLine) {
|
|
13732
|
+
let found;
|
|
13733
|
+
const visit = (node) => {
|
|
13734
|
+
if (found || lineOf(source, node.getEnd()) < startLine || lineOf(source, node.getStart(source)) > startLine)
|
|
13735
|
+
return;
|
|
13736
|
+
if ((import_typescript2.default.isStringLiteral(node) || import_typescript2.default.isNoSubstitutionTemplateLiteral(node) || import_typescript2.default.isTemplateExpression(node)) && lineOf(source, node.getStart(source)) === startLine) {
|
|
13737
|
+
let outer = node;
|
|
13738
|
+
for (;; ) {
|
|
13739
|
+
const parent = outer.parent;
|
|
13740
|
+
if (import_typescript2.default.isBinaryExpression(parent) && parent.operatorToken.kind === import_typescript2.default.SyntaxKind.PlusToken && parent.left === outer) {
|
|
13741
|
+
outer = parent;
|
|
13742
|
+
} else if (import_typescript2.default.isArrayLiteralExpression(parent) && parent.elements[0] === outer && import_typescript2.default.isPropertyAccessExpression(parent.parent) && parent.parent.name.text === "join" && import_typescript2.default.isCallExpression(parent.parent.parent) && parent.parent.parent.expression === parent.parent) {
|
|
13743
|
+
outer = parent.parent.parent;
|
|
13744
|
+
} else {
|
|
13745
|
+
break;
|
|
13746
|
+
}
|
|
13747
|
+
}
|
|
13748
|
+
const text = stringValueOf(outer, source) ?? stringValueOf(node, source);
|
|
13749
|
+
if (text !== undefined && /^\s*\[SYSTEM:/.test(text)) {
|
|
13750
|
+
found = { text, line: startLine };
|
|
13751
|
+
return;
|
|
13752
|
+
}
|
|
13753
|
+
}
|
|
13754
|
+
import_typescript2.default.forEachChild(node, visit);
|
|
13755
|
+
};
|
|
13756
|
+
visit(source);
|
|
13757
|
+
return found;
|
|
13758
|
+
}
|
|
13717
13759
|
function lineOf(source, position) {
|
|
13718
13760
|
return source.getLineAndCharacterOfPosition(position).line + 1;
|
|
13719
13761
|
}
|
|
@@ -13886,7 +13928,28 @@ var JS_ASSIGNMENT_NAME = /(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=/;
|
|
|
13886
13928
|
var JS_PROPERTY_NAME = /^\s*(?:public\s+|readonly\s+)?([A-Za-z_$][\w$]*)\s*:\s*(?:new\s+)?(?:[\w.$]*\.)?(?:tool|functionTool|createTool|dynamicTool|DynamicStructuredTool)\s*\(/;
|
|
13887
13929
|
var JS_TRAILING_ASSIGNMENT_NAME = /(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:new\s+)?$/;
|
|
13888
13930
|
var REGISTRY_CALL_NAME = /\b(?:register_tool|registerTool|add_tool)\s*\(\s*["']?([A-Za-z_$][\w$]*)/;
|
|
13931
|
+
var MODEL_FAMILY_ALIAS = /^(?:opus|sonnet|haiku)(?:[-.]?(?:\d[\w.]*|low|medium|high|xhigh|max|none|fast))*$/i;
|
|
13932
|
+
var MODEL_ASSIGNMENT_VALUE = /["']?\b(model|model_name|model_id|modelName|modelId|[A-Z_]*MODEL[A-Z_]*)["']?\s*[:=]\s*(["'`][^"'`]+["'`])/i;
|
|
13933
|
+
var MODEL_PREFERENCE_FIELD = /model\w*(?:preference|choice|option|label)|(?:preferred|selected|chosen)\w*model/i;
|
|
13934
|
+
var REGISTRY_KEY = /^\s*["'`]([\w-]+\/[\w.:-]+)["'`]\s*:/;
|
|
13935
|
+
var FULL_MODEL_ID = /[\w-]+\/[\w.:-]+|\d{8}/;
|
|
13889
13936
|
var MODEL_STRING = /["'`]([\w.:/-]*(?:gpt-|o[134](?:-mini)?\b|claude|gemini|llama|mistral|mixtral|deepseek|qwen|grok|sonnet|opus|haiku|command-r|glm|gemma)[\w.:/-]*)["'`]/i;
|
|
13937
|
+
var SIGNAL_DESCRIPTIONS = {
|
|
13938
|
+
"python.tool_decorator": "a tool decorator on the function",
|
|
13939
|
+
"python.base_tool_subclass": "a BaseTool subclass",
|
|
13940
|
+
"js.ai_sdk_tool": "a tool() factory call",
|
|
13941
|
+
"tool_registry.registration": "a tool registry call",
|
|
13942
|
+
"prompt_file.name_hint": "a document named like a prompt",
|
|
13943
|
+
"prompt_file.prompts_dir": "a document under a prompts/ directory",
|
|
13944
|
+
"prompt_file.agent_dir_instruction_text": "instruction-like text in an agent directory",
|
|
13945
|
+
"prompt_file.loader_reference": "a file loaded as a prompt by code",
|
|
13946
|
+
"prompt_file.template_loader_reference": "a file loaded as a prompt template by code",
|
|
13947
|
+
"model.assignment": "a model id assigned in code"
|
|
13948
|
+
};
|
|
13949
|
+
function detectorConfidenceReason(candidate) {
|
|
13950
|
+
const what = SIGNAL_DESCRIPTIONS[candidate.signal] ?? `the ${candidate.signal} pattern`;
|
|
13951
|
+
return `Deterministic: found by ${what} at ${candidate.path}:${candidate.startLine} (${candidate.confidence}-confidence detector); not checked by the analyst.`;
|
|
13952
|
+
}
|
|
13890
13953
|
function candidateEvidence(candidate) {
|
|
13891
13954
|
return [{
|
|
13892
13955
|
path: candidate.path,
|
|
@@ -13952,6 +14015,7 @@ function promoteToolCandidate(candidate, rootDir, confidence2, fileCache) {
|
|
|
13952
14015
|
sourcePath: candidate.path,
|
|
13953
14016
|
usedByAgentIds: [],
|
|
13954
14017
|
confidence: confidence2,
|
|
14018
|
+
confidenceReason: detectorConfidenceReason(candidate),
|
|
13955
14019
|
evidence: candidateEvidence(candidate),
|
|
13956
14020
|
body: extractToolBody({ path: candidate.path, rootDir }, { name, reason: candidate.signal })
|
|
13957
14021
|
};
|
|
@@ -14001,6 +14065,7 @@ function promotePromptFileCandidate(candidate, confidence2) {
|
|
|
14001
14065
|
sourcePath: candidate.path,
|
|
14002
14066
|
usedByAgentIds: [],
|
|
14003
14067
|
confidence: confidence2,
|
|
14068
|
+
confidenceReason: detectorConfidenceReason(candidate),
|
|
14004
14069
|
evidence: candidateEvidence(candidate)
|
|
14005
14070
|
};
|
|
14006
14071
|
}
|
|
@@ -14058,6 +14123,9 @@ var MIN_UNNAMED_REFERENCED_PROMPT_CHARS = 200;
|
|
|
14058
14123
|
var UNUSED_PROMPT_CONFIDENCE = 0.6;
|
|
14059
14124
|
var REFERENCED_PROMPT_CONFIDENCE = 0.7;
|
|
14060
14125
|
var MIN_RESOLVED_PROMPT_CHARS = 20;
|
|
14126
|
+
var SYSTEM_INJECTION = /^\s*\[SYSTEM:/;
|
|
14127
|
+
var BARE_SYSTEM_TAG = /^\s*\[SYSTEM:[\sA-Z0-9_-]*\]\s*$/;
|
|
14128
|
+
var SYSTEM_INJECTION_LITERAL = /["'`]\s*\[SYSTEM:/;
|
|
14061
14129
|
var MIN_CONFIG_PROMPT_CHARS = 40;
|
|
14062
14130
|
var MAX_BUILDER_LOOKBEHIND_LINES = 40;
|
|
14063
14131
|
var DEFINITION_HEAD = /^\s*(?:export\s+)?(?:(?:const|let|var|readonly|static|public|private)\s+)*["']?([A-Za-z_$][\w$]*)["']?\s*(?:(?::\s*[\w$.<>[\]|, ]+?)?\s*(=)(?![=>])|(:))\s*(.*)$/;
|
|
@@ -14706,11 +14774,38 @@ var PROMPT_CONFIG_KEYS = new Set([
|
|
|
14706
14774
|
"system_instruction",
|
|
14707
14775
|
"backstory"
|
|
14708
14776
|
]);
|
|
14777
|
+
function systemInjectionLiteralAt(lines, startLine, jsSource) {
|
|
14778
|
+
if (jsSource)
|
|
14779
|
+
return jsSystemInjectionLiteralAt(jsSource, startLine);
|
|
14780
|
+
const line = lines[startLine - 1];
|
|
14781
|
+
if (line === undefined || /^\s*(?:\/\/|\*(?!\/)|#)/.test(line))
|
|
14782
|
+
return;
|
|
14783
|
+
const match = SYSTEM_INJECTION_LITERAL.exec(line);
|
|
14784
|
+
if (!match || endsInComment(line.slice(0, match.index)) || opensInsideString(line.slice(0, match.index)))
|
|
14785
|
+
return;
|
|
14786
|
+
const text = readStringValue(lines.join(`
|
|
14787
|
+
`), textOffsetOfLine(lines, startLine - 1) + match.index);
|
|
14788
|
+
return text === undefined ? undefined : { text, line: startLine };
|
|
14789
|
+
}
|
|
14790
|
+
function opensInsideString(prefix) {
|
|
14791
|
+
let quote;
|
|
14792
|
+
for (let i = 0;i < prefix.length; i += 1) {
|
|
14793
|
+
const char = prefix[i];
|
|
14794
|
+
if (char === "\\")
|
|
14795
|
+
i += 1;
|
|
14796
|
+
else if (quote) {
|
|
14797
|
+
if (char === quote)
|
|
14798
|
+
quote = undefined;
|
|
14799
|
+
} else if (char === '"' || char === "'" || char === "`")
|
|
14800
|
+
quote = char;
|
|
14801
|
+
}
|
|
14802
|
+
return quote !== undefined;
|
|
14803
|
+
}
|
|
14709
14804
|
function promotePromptLiteralCandidate(candidate, rootDir, confidence2, fileCache, files) {
|
|
14710
14805
|
const lines = readFileLines(rootDir, candidate.path, fileCache);
|
|
14711
14806
|
if (!lines)
|
|
14712
14807
|
return;
|
|
14713
|
-
const definition = resolvePromptLiteralDefinition(lines, candidate.startLine, jsSources.get(`${rootDir}::${candidate.path}`), candidate.excerpt);
|
|
14808
|
+
const definition = resolvePromptLiteralDefinition(lines, candidate.startLine, jsSources.get(`${rootDir}::${candidate.path}`), candidate.excerpt) ?? (candidate.signal === "code.system_injection" ? systemInjectionLiteralAt(lines, candidate.startLine, jsSources.get(`${rootDir}::${candidate.path}`)) : undefined);
|
|
14714
14809
|
if (!definition)
|
|
14715
14810
|
return;
|
|
14716
14811
|
const value = definition.text.trim();
|
|
@@ -14722,8 +14817,11 @@ function promotePromptLiteralCandidate(candidate, rootDir, confidence2, fileCach
|
|
|
14722
14817
|
return;
|
|
14723
14818
|
const key = definition.key ?? (definition.identifier && DIRECT_PROMPT_KEYS.has(definition.identifier) ? definition.identifier : undefined);
|
|
14724
14819
|
let use;
|
|
14820
|
+
if (SYSTEM_INJECTION.test(value) && !BARE_SYSTEM_TAG.test(value)) {
|
|
14821
|
+
use = { path: candidate.path, line: definition.line, key: "system-injection" };
|
|
14822
|
+
}
|
|
14725
14823
|
const jsSource = jsSources.get(`${rootDir}::${candidate.path}`);
|
|
14726
|
-
if (definition.key && !PROMPT_CONFIG_KEYS.has(definition.key) && !CONFIG_EXTENSIONS.has(extname7(candidate.path).toLowerCase())) {
|
|
14824
|
+
if (!use && definition.key && !PROMPT_CONFIG_KEYS.has(definition.key) && !CONFIG_EXTENSIONS.has(extname7(candidate.path).toLowerCase())) {
|
|
14727
14825
|
const exportUsed = () => modelFileImports(candidate.path, rootDir, files.model, fileCache);
|
|
14728
14826
|
if (jsSource) {
|
|
14729
14827
|
const consumer = keyedValueConsumer(jsSource, definition.line, definition.key, definition.column);
|
|
@@ -14735,7 +14833,7 @@ function promotePromptLiteralCandidate(candidate, rootDir, confidence2, fileCach
|
|
|
14735
14833
|
return;
|
|
14736
14834
|
}
|
|
14737
14835
|
}
|
|
14738
|
-
if (key && isDirectModelInput(key, value, candidate.path, lines, definition.line, files.model)) {
|
|
14836
|
+
if (!use && key && isDirectModelInput(key, value, candidate.path, lines, definition.line, files.model)) {
|
|
14739
14837
|
use = { path: candidate.path, line: definition.line, key };
|
|
14740
14838
|
}
|
|
14741
14839
|
if (!use && definition.identifier) {
|
|
@@ -14768,7 +14866,7 @@ function promotePromptLiteralCandidate(candidate, rootDir, confidence2, fileCach
|
|
|
14768
14866
|
scope: "shared",
|
|
14769
14867
|
usedByAgentIds: [],
|
|
14770
14868
|
confidence: unused ? Math.min(confidence2, UNUSED_PROMPT_CONFIDENCE) : use.referenceOnly ? Math.min(confidence2, REFERENCED_PROMPT_CONFIDENCE) : confidence2,
|
|
14771
|
-
confidenceReason: unused ? `Deterministic: instruction-like literal ${name} at ${candidate.path}:${definition.line}; no model call using it was found, so it may be unused.` : use.referenceOnly ? `Deterministic: instruction-like literal ${name} is referenced at ${use.path}:${use.line} through ${use.via}, but no prompt key (system, instructions, content) was found at the call.` : sameSite ? `Deterministic: string literal written under the ${use.key} key at ${candidate.path}:${definition.line}.` : `Deterministic: string literal ${name} passed to a model call as ${use.key} at ${use.path}:${use.line}.`,
|
|
14869
|
+
confidenceReason: unused ? `Deterministic: instruction-like literal ${name} at ${candidate.path}:${definition.line}; no model call using it was found, so it may be unused.` : use.referenceOnly ? `Deterministic: instruction-like literal ${name} is referenced at ${use.path}:${use.line} through ${use.via}, but no prompt key (system, instructions, content) was found at the call.` : use.key === "system-injection" ? `Deterministic: literal at ${candidate.path}:${definition.line} opens with [SYSTEM:, a message injected into the agent's conversation.` : sameSite ? `Deterministic: string literal written under the ${use.key} key at ${candidate.path}:${definition.line}.` : `Deterministic: string literal ${name} passed to a model call as ${use.key} at ${use.path}:${use.line}.`,
|
|
14772
14870
|
evidence,
|
|
14773
14871
|
body: definition.text
|
|
14774
14872
|
};
|
|
@@ -14776,9 +14874,18 @@ function promotePromptLiteralCandidate(candidate, rootDir, confidence2, fileCach
|
|
|
14776
14874
|
function promoteModelConfigCandidate(candidate, rootDir, confidence2, fileCache) {
|
|
14777
14875
|
const lines = readFileLines(rootDir, candidate.path, fileCache);
|
|
14778
14876
|
const sourceLine = lines?.[candidate.startLine - 1] ?? "";
|
|
14779
|
-
const
|
|
14877
|
+
const assignment = MODEL_ASSIGNMENT_VALUE.exec(sourceLine);
|
|
14878
|
+
const [field, assigned] = [assignment?.[1], assignment?.[2]];
|
|
14879
|
+
if (field && MODEL_PREFERENCE_FIELD.test(field) && !FULL_MODEL_ID.test(assigned ?? ""))
|
|
14880
|
+
return;
|
|
14881
|
+
const registryKey = candidate.signal === "model.registry_key" ? REGISTRY_KEY.exec(sourceLine)?.[1] : undefined;
|
|
14882
|
+
const model = (assigned && MODEL_STRING.exec(assigned)?.[1]) ?? registryKey ?? MODEL_STRING.exec(sourceLine)?.[1] ?? MODEL_STRING.exec(candidate.excerpt)?.[1];
|
|
14780
14883
|
if (!model)
|
|
14781
14884
|
return;
|
|
14885
|
+
if (MODEL_FAMILY_ALIAS.test(model.split("/").pop() ?? model))
|
|
14886
|
+
return;
|
|
14887
|
+
if (TEST_PATH2.test(candidate.path) && !usedOutsideTests(rootDir, model))
|
|
14888
|
+
return;
|
|
14782
14889
|
return {
|
|
14783
14890
|
id: stableId("model_config", `${pathStem(candidate.path)}:L${candidate.startLine}`),
|
|
14784
14891
|
type: "model_config",
|
|
@@ -14786,9 +14893,42 @@ function promoteModelConfigCandidate(candidate, rootDir, confidence2, fileCache)
|
|
|
14786
14893
|
scope: "shared",
|
|
14787
14894
|
usedByAgentIds: [],
|
|
14788
14895
|
confidence: confidence2,
|
|
14896
|
+
confidenceReason: detectorConfidenceReason(candidate),
|
|
14789
14897
|
evidence: candidateEvidence(candidate)
|
|
14790
14898
|
};
|
|
14791
14899
|
}
|
|
14900
|
+
var nonTestSourcePaths = new Map;
|
|
14901
|
+
var modelUsedOutsideTests = new Map;
|
|
14902
|
+
var MAX_MODEL_SOURCE_BYTES = 1024 * 1024;
|
|
14903
|
+
var MODEL_SOURCE_FILE = /\.(?:[cm]?[jt]sx?|py|json|jsonc|ya?ml|toml)$/i;
|
|
14904
|
+
var NON_SOURCE_DIR = /(^|\/)(?:docs?|\.moda)\//i;
|
|
14905
|
+
function usedOutsideTests(rootDir, modelId) {
|
|
14906
|
+
let results = modelUsedOutsideTests.get(rootDir);
|
|
14907
|
+
if (!results) {
|
|
14908
|
+
results = new Map;
|
|
14909
|
+
modelUsedOutsideTests.set(rootDir, results);
|
|
14910
|
+
}
|
|
14911
|
+
const cached = results.get(modelId);
|
|
14912
|
+
if (cached !== undefined)
|
|
14913
|
+
return cached;
|
|
14914
|
+
let paths = nonTestSourcePaths.get(rootDir);
|
|
14915
|
+
if (!paths) {
|
|
14916
|
+
paths = inventoryFiles(rootDir, [], { includeFile: (path) => MODEL_SOURCE_FILE.test(path) }).map((file) => file.path).filter((path) => !TEST_PATH2.test(path) && MODEL_SOURCE_FILE.test(path) && !NON_SOURCE_DIR.test(path));
|
|
14917
|
+
nonTestSourcePaths.set(rootDir, paths);
|
|
14918
|
+
}
|
|
14919
|
+
const used = paths.some((path) => {
|
|
14920
|
+
try {
|
|
14921
|
+
const absolute = resolve9(rootDir, path);
|
|
14922
|
+
if (statSync3(absolute).size > MAX_MODEL_SOURCE_BYTES)
|
|
14923
|
+
return false;
|
|
14924
|
+
return readFileSync11(absolute, "utf8").includes(modelId);
|
|
14925
|
+
} catch {
|
|
14926
|
+
return false;
|
|
14927
|
+
}
|
|
14928
|
+
});
|
|
14929
|
+
results.set(modelId, used);
|
|
14930
|
+
return used;
|
|
14931
|
+
}
|
|
14792
14932
|
function mergePromotedDuplicate(existing, next) {
|
|
14793
14933
|
for (const entry of next.evidence) {
|
|
14794
14934
|
const already = existing.evidence.some((candidate) => candidate.path === entry.path && candidate.line === entry.line && candidate.reason === entry.reason);
|
|
@@ -15185,7 +15325,7 @@ async function runHarnessCommand(context) {
|
|
|
15185
15325
|
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.");
|
|
15186
15326
|
}
|
|
15187
15327
|
if (context.flags["github-actions"] === "true") {
|
|
15188
|
-
const { runGithubActionsAnalyze } = await import("./harness-github-actions-
|
|
15328
|
+
const { runGithubActionsAnalyze } = await import("./harness-github-actions-4q0nkvxb.js");
|
|
15189
15329
|
const result = await runGithubActionsAnalyze(rootDir, {
|
|
15190
15330
|
writeReport: (report2) => {
|
|
15191
15331
|
const normalized = normalizeHarnessReport(report2);
|
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-2z3cdc52.js")).runPromptsCommand(...args);
|
|
2972
2972
|
}
|
|
2973
2973
|
async function runSkillsCommand(...args) {
|
|
2974
2974
|
return (await import("./skills-etzcqhp8.js")).runSkillsCommand(...args);
|
|
2975
2975
|
}
|
|
2976
2976
|
async function runHarnessCommand(...args) {
|
|
2977
|
-
return (await import("./harness-
|
|
2977
|
+
return (await import("./harness-2jb52s8r.js")).runHarnessCommand(...args);
|
|
2978
2978
|
}
|
|
2979
2979
|
async function runSyncCommand(...args) {
|
|
2980
|
-
return (await import("./sync-
|
|
2980
|
+
return (await import("./sync-y4tcnmg6.js")).runSyncCommand(...args);
|
|
2981
2981
|
}
|
|
2982
2982
|
async function runRegistryCommand(...args) {
|
|
2983
2983
|
return (await import("./registry-wv1zzyce.js")).runRegistryCommand(...args);
|
|
2984
2984
|
}
|
|
2985
2985
|
async function runDoctorCommand(...args) {
|
|
2986
|
-
return (await import("./doctor-
|
|
2986
|
+
return (await import("./doctor-m6v07zc7.js")).runDoctorCommand(...args);
|
|
2987
2987
|
}
|
|
2988
2988
|
async function runStatusCommand(...args) {
|
|
2989
|
-
return (await import("./doctor-
|
|
2989
|
+
return (await import("./doctor-m6v07zc7.js")).runStatusCommand(...args);
|
|
2990
2990
|
}
|
|
2991
2991
|
async function runAuthCommand(...args) {
|
|
2992
2992
|
return (await import("./profile-commands-yvpe4d8y.js")).runAuthCommand(...args);
|
|
@@ -2998,7 +2998,7 @@ async function runProfilesCommand(...args) {
|
|
|
2998
2998
|
return (await import("./profile-commands-yvpe4d8y.js")).runProfilesCommand(...args);
|
|
2999
2999
|
}
|
|
3000
3000
|
async function runAgentCommand(...args) {
|
|
3001
|
-
return (await import("./agent-
|
|
3001
|
+
return (await import("./agent-921q6yvy.js")).runAgentCommand(...args);
|
|
3002
3002
|
}
|
|
3003
3003
|
async function runProductionCommand(...args) {
|
|
3004
3004
|
return (await import("./production-intelligence-fqvhzq6s.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-2crvn108.js");
|
|
6766
6766
|
if (context.outputMode === "agent-stream") {
|
|
6767
6767
|
context.output.writeEvent({
|
|
6768
6768
|
event: "started",
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
promptsDiscoveredCheck,
|
|
4
4
|
runDoctorCommand,
|
|
5
5
|
runStatusCommand
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-a821bf9p.js";
|
|
7
7
|
import"./cli-94r5x9bg.js";
|
|
8
|
-
import"./cli-
|
|
8
|
+
import"./cli-4zdem6xd.js";
|
|
9
9
|
import"./cli-mm48br00.js";
|
|
10
|
-
import"./cli-
|
|
10
|
+
import"./cli-k0vxtzxb.js";
|
|
11
11
|
import"./cli-v2h21cgf.js";
|
|
12
12
|
import"./cli-e0kbye4s.js";
|
|
13
13
|
import"./cli-31ybq5f2.js";
|
|
@@ -43,9 +43,9 @@ import {
|
|
|
43
43
|
writeHarnessAnalyzeResult,
|
|
44
44
|
writeHarnessArtifacts,
|
|
45
45
|
writeHumanProgress
|
|
46
|
-
} from "./cli-
|
|
46
|
+
} from "./cli-tp48x76x.js";
|
|
47
47
|
import"./cli-97fnztpy.js";
|
|
48
|
-
import"./cli-
|
|
48
|
+
import"./cli-k0vxtzxb.js";
|
|
49
49
|
import"./cli-v2h21cgf.js";
|
|
50
50
|
import"./cli-e0kbye4s.js";
|
|
51
51
|
import"./cli-31ybq5f2.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildSourceSnapshot
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-tp48x76x.js";
|
|
4
4
|
import"./cli-97fnztpy.js";
|
|
5
|
-
import"./cli-
|
|
5
|
+
import"./cli-k0vxtzxb.js";
|
|
6
6
|
import"./cli-v2h21cgf.js";
|
|
7
7
|
import"./cli-e0kbye4s.js";
|
|
8
8
|
import"./cli-31ybq5f2.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./cli-hcwdz9sd.js";
|
|
22
22
|
import {
|
|
23
23
|
buildDoctorReport
|
|
24
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-a821bf9p.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-4zdem6xd.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-tp48x76x.js";
|
|
50
50
|
import {
|
|
51
51
|
stripAnsi
|
|
52
52
|
} from "./cli-97fnztpy.js";
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
renderInitNote,
|
|
58
58
|
renderInitSetupPlan,
|
|
59
59
|
renderInitStep
|
|
60
|
-
} from "./cli-
|
|
60
|
+
} from "./cli-k0vxtzxb.js";
|
|
61
61
|
import {
|
|
62
62
|
createCommandContext
|
|
63
63
|
} from "./cli-v2h21cgf.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inventoryFiles,
|
|
3
3
|
safePromptEvidencePath
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-tp48x76x.js";
|
|
5
5
|
import"./cli-97fnztpy.js";
|
|
6
|
-
import"./cli-
|
|
6
|
+
import"./cli-k0vxtzxb.js";
|
|
7
7
|
import"./cli-v2h21cgf.js";
|
|
8
8
|
import"./cli-e0kbye4s.js";
|
|
9
9
|
import"./cli-31ybq5f2.js";
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
checkPromptMapping,
|
|
4
4
|
discoverHarnessPromptSources,
|
|
5
5
|
safePromptEvidencePath
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-tp48x76x.js";
|
|
7
7
|
import"./cli-97fnztpy.js";
|
|
8
|
-
import"./cli-
|
|
8
|
+
import"./cli-k0vxtzxb.js";
|
|
9
9
|
import"./cli-v2h21cgf.js";
|
|
10
10
|
import"./cli-e0kbye4s.js";
|
|
11
11
|
import"./cli-31ybq5f2.js";
|
|
@@ -6,13 +6,13 @@ import"./cli-rjav0vj1.js";
|
|
|
6
6
|
import"./cli-hcwdz9sd.js";
|
|
7
7
|
import {
|
|
8
8
|
runPromptsCommand
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-4zdem6xd.js";
|
|
10
10
|
import"./cli-mm48br00.js";
|
|
11
11
|
import {
|
|
12
12
|
runHarnessCommand
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-tp48x76x.js";
|
|
14
14
|
import"./cli-97fnztpy.js";
|
|
15
|
-
import"./cli-
|
|
15
|
+
import"./cli-k0vxtzxb.js";
|
|
16
16
|
import"./cli-v2h21cgf.js";
|
|
17
17
|
import"./cli-e0kbye4s.js";
|
|
18
18
|
import"./cli-31ybq5f2.js";
|
package/package.json
CHANGED