@moda-ai/cli 1.55.38 → 1.55.40
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-9r58v0bc.js → agent-ck6y31n2.js} +8 -8
- package/dist/{cli-3n040fp2.js → cli-0xc5htv7.js} +1 -1
- package/dist/{cli-tdcx8yz9.js → cli-1z1sx8dg.js} +3 -3
- package/dist/{cli-dmnayt2r.js → cli-4tg0hkbz.js} +8 -8
- package/dist/{cli-9g5kzsg6.js → cli-77ekrx7d.js} +1 -1
- package/dist/{cli-93926afn.js → cli-7bn406mt.js} +4 -4
- package/dist/{cli-xtyszvq1.js → cli-a8nxbtpk.js} +5 -5
- package/dist/{cli-skvvwp2q.js → cli-azage7s0.js} +5 -5
- package/dist/{cli-xk630wjq.js → cli-daqkdnm1.js} +1 -1
- package/dist/{cli-xheg54qc.js → cli-f1jfrqgf.js} +39 -7
- package/dist/{cli-n311b8g0.js → cli-gt3yq1y5.js} +2 -2
- package/dist/{cli-sk1p71wr.js → cli-pmzh2qjy.js} +1 -1
- package/dist/{cli-rcjhfts4.js → cli-t0pb7qbs.js} +66 -16
- package/dist/{cli-b7nyw498.js → cli-xddtv3yn.js} +1 -1
- package/dist/{cli-nh23q6ay.js → cli-ypqwcf9n.js} +5 -5
- package/dist/cli.js +587 -52
- package/dist/{doctor-xq5bjvpq.js → doctor-p8sp6cbk.js} +7 -7
- package/dist/{fix-kvszavm1.js → fix-0r974yge.js} +4 -4
- package/dist/{harness-qatnwxrz.js → harness-72ejenza.js} +5 -5
- package/dist/{harness-github-actions-drbkcb8d.js → harness-github-actions-2qc4gg2w.js} +5 -5
- package/dist/{index-y5jnz2t2.js → index-w7v472w4.js} +11 -11
- package/dist/{production-intelligence-j55vaw6t.js → production-intelligence-hs2sm8t5.js} +3 -3
- package/dist/{profile-commands-skdxe17v.js → profile-commands-se9947c1.js} +3 -3
- package/dist/{prompt-attribution-zq38actx.js → prompt-attribution-3987hhqz.js} +5 -5
- package/dist/prompt-source-mcp.js +5 -5
- package/dist/{prompts-ab-yd2dawe3.js → prompts-ab-gmd10n5d.js} +7 -7
- package/dist/{prompts-propose-11dj9ked.js → prompts-propose-q626zmm4.js} +7 -7
- package/dist/{prompts-cwqn8a57.js → prompts-ysm9ra72.js} +5 -5
- package/dist/{provision-ghca9d54.js → provision-cya5rpxa.js} +5 -5
- package/dist/{registry-76sngjw6.js → registry-7xz09ry0.js} +3 -3
- package/dist/{skills-btn9r48v.js → skills-x6yszxxn.js} +5 -5
- package/dist/{sync-ye7nxeen.js → sync-trjzvam9.js} +7 -7
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
- package/skills/moda-cli/SKILL.md +7 -3
- package/skills/moda-cli/references/commands.md +3 -2
- package/skills/moda-cli/references/dashboard-parity.md +2 -0
- package/skills/moda-cli/references/detections.md +29 -0
- package/skills/moda-cli/references/production-intelligence.md +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildDoctorReport
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-
|
|
3
|
+
} from "./cli-a8nxbtpk.js";
|
|
4
|
+
import"./cli-pmzh2qjy.js";
|
|
5
|
+
import"./cli-4tg0hkbz.js";
|
|
6
6
|
import"./cli-mm48br00.js";
|
|
7
7
|
import {
|
|
8
8
|
readHarnessSyncState
|
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
readHarnessReport,
|
|
16
16
|
validateHarnessReport
|
|
17
17
|
} from "./cli-cesds766.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
18
|
+
import"./cli-xddtv3yn.js";
|
|
19
|
+
import"./cli-f1jfrqgf.js";
|
|
20
|
+
import"./cli-0xc5htv7.js";
|
|
21
21
|
import {
|
|
22
22
|
resolveApiKey,
|
|
23
23
|
resolveIngestUrl,
|
|
24
24
|
resolveModaBaseUrl,
|
|
25
25
|
resolveTenantId
|
|
26
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-t0pb7qbs.js";
|
|
27
27
|
import {
|
|
28
28
|
CliInputError
|
|
29
29
|
} from "./cli-k4tqwah4.js";
|
|
@@ -94,7 +94,7 @@ async function buildAgentContext(context) {
|
|
|
94
94
|
const graph = readHarnessGraphIfPresent(context.cwd);
|
|
95
95
|
const reportState = readHarnessReportState(context.cwd);
|
|
96
96
|
const syncState = readHarnessSyncState(context.cwd);
|
|
97
|
-
const harness = graph ? await import("./harness-
|
|
97
|
+
const harness = graph ? await import("./harness-72ejenza.js") : undefined;
|
|
98
98
|
const topFindings = doctor.checks.filter((check) => check.status === "fail" || check.status === "warning").slice(0, 12).map(checkToFinding);
|
|
99
99
|
const evidenceRefs = [
|
|
100
100
|
...doctor.checks.map(checkToEvidenceRef),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchApiKeyProbe
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-77ekrx7d.js";
|
|
4
4
|
import {
|
|
5
5
|
authFetch,
|
|
6
6
|
getCachedLoginContext
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-pmzh2qjy.js";
|
|
8
8
|
import {
|
|
9
9
|
embeddedTenantIdFromApiKey,
|
|
10
10
|
getModaDir,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
resolveTenantIdFromActiveProfile,
|
|
16
16
|
saveCliConfig,
|
|
17
17
|
writeSecretJsonFile
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-t0pb7qbs.js";
|
|
19
19
|
import {
|
|
20
20
|
CliAccessError,
|
|
21
21
|
CliInputError,
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./cli-mm48br00.js";
|
|
5
5
|
import {
|
|
6
6
|
createCommandContext
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-xddtv3yn.js";
|
|
8
8
|
import {
|
|
9
9
|
assertFlags,
|
|
10
10
|
assertPositionals
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-f1jfrqgf.js";
|
|
12
12
|
import {
|
|
13
13
|
callControlAPI
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-0xc5htv7.js";
|
|
15
15
|
import {
|
|
16
16
|
CliInputError
|
|
17
17
|
} from "./cli-k4tqwah4.js";
|
|
@@ -5725,9 +5725,9 @@ async function runPromptsCommand(input, legacyFlags, legacyProfileOptions) {
|
|
|
5725
5725
|
await promotePrompt(positionals, flags, profileOptions, context);
|
|
5726
5726
|
break;
|
|
5727
5727
|
case "ab":
|
|
5728
|
-
return (await import("./prompts-ab-
|
|
5728
|
+
return (await import("./prompts-ab-gmd10n5d.js")).runPromptAb(flags, profileOptions, context);
|
|
5729
5729
|
case "propose":
|
|
5730
|
-
await (await import("./prompts-propose-
|
|
5730
|
+
await (await import("./prompts-propose-q626zmm4.js")).runPromptPropose(positionals, flags, profileOptions, context);
|
|
5731
5731
|
break;
|
|
5732
5732
|
case "list":
|
|
5733
5733
|
case "show":
|
|
@@ -5830,7 +5830,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
|
|
|
5830
5830
|
const analyzedDefinitions = new Map;
|
|
5831
5831
|
if (flags["no-analyze"] !== "true") {
|
|
5832
5832
|
options.onProgress?.("Analyzing prompt sources before sync.");
|
|
5833
|
-
const { analyzeHarnessPrompts } = await import("./harness-
|
|
5833
|
+
const { analyzeHarnessPrompts } = await import("./harness-72ejenza.js");
|
|
5834
5834
|
const result = await analyzeHarnessPrompts({
|
|
5835
5835
|
rootDir: process.cwd(),
|
|
5836
5836
|
existing: established.flatMap((prompt) => prompt.sourceDefinition ? [prompt.sourceDefinition.source] : []),
|
|
@@ -5858,7 +5858,7 @@ async function runPromptSyncExclusive(flags, profileOptions, options) {
|
|
|
5858
5858
|
const mergedSources = mergePromptSources(manifest.sources, extraSources);
|
|
5859
5859
|
const manifestUpdate = stableJson(mergedSources) === stableJson(mergePromptSources(manifest.sources, [])) ? undefined : $stringify({ version: 2, prompt_paths: manifest.promptPaths, sources: mergedSources });
|
|
5860
5860
|
const prompts = await discoverPrompts(extraSources);
|
|
5861
|
-
const { checkPromptAttribution } = await import("./prompt-attribution-
|
|
5861
|
+
const { checkPromptAttribution } = await import("./prompt-attribution-3987hhqz.js");
|
|
5862
5862
|
const attribution = checkPromptAttribution(process.cwd(), prompts.map((prompt) => prompt.key));
|
|
5863
5863
|
const brokenAttribution = attribution.references.filter((reference) => reference.status === "missing");
|
|
5864
5864
|
if (brokenAttribution.length) {
|
|
@@ -6164,7 +6164,7 @@ async function migratePromptManifest(options = {}) {
|
|
|
6164
6164
|
let addedSources = [];
|
|
6165
6165
|
let pendingSources = [];
|
|
6166
6166
|
if (options.discover) {
|
|
6167
|
-
const { analyzeHarnessPrompts } = await import("./harness-
|
|
6167
|
+
const { analyzeHarnessPrompts } = await import("./harness-72ejenza.js");
|
|
6168
6168
|
const result = await analyzeHarnessPrompts({
|
|
6169
6169
|
rootDir: root,
|
|
6170
6170
|
existing: manifest.sources,
|
|
@@ -13,22 +13,22 @@ import {
|
|
|
13
13
|
} from "./cli-hcwdz9sd.js";
|
|
14
14
|
import {
|
|
15
15
|
createCommandContext
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-xddtv3yn.js";
|
|
17
17
|
import {
|
|
18
18
|
assertFlags,
|
|
19
19
|
assertPositionals,
|
|
20
20
|
writeDryRun
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-f1jfrqgf.js";
|
|
22
22
|
import {
|
|
23
23
|
callControlAPI
|
|
24
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-0xc5htv7.js";
|
|
25
25
|
import {
|
|
26
26
|
recordApiRequest,
|
|
27
27
|
resolveApiKey,
|
|
28
28
|
resolveIngestUrl,
|
|
29
29
|
resolveTenantId,
|
|
30
30
|
shellArg
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-t0pb7qbs.js";
|
|
32
32
|
import {
|
|
33
33
|
CliInputError
|
|
34
34
|
} from "./cli-k4tqwah4.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAuthSessionValid,
|
|
3
3
|
loadAuthSession
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-pmzh2qjy.js";
|
|
5
5
|
import {
|
|
6
6
|
inspectPromptManifest
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-4tg0hkbz.js";
|
|
8
8
|
import {
|
|
9
9
|
readHarnessSyncState,
|
|
10
10
|
renderDoctorHuman,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./cli-xq45etg1.js";
|
|
13
13
|
import {
|
|
14
14
|
callDataAPI
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-0xc5htv7.js";
|
|
16
16
|
import {
|
|
17
17
|
ensureSecretFilePermissions,
|
|
18
18
|
getActiveProfile,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
resolveSecretReference,
|
|
27
27
|
resolveTenantId,
|
|
28
28
|
secretFilePathFromRef
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-t0pb7qbs.js";
|
|
30
30
|
import {
|
|
31
31
|
__require
|
|
32
32
|
} from "./cli-0v6na3yp.js";
|
|
@@ -376,7 +376,7 @@ async function harnessCurrentCheck(cwd, manifestPath, manifestExists, tenantId)
|
|
|
376
376
|
};
|
|
377
377
|
}
|
|
378
378
|
try {
|
|
379
|
-
const { scanHarness } = await import("./harness-
|
|
379
|
+
const { scanHarness } = await import("./harness-72ejenza.js");
|
|
380
380
|
const current = scanHarness({
|
|
381
381
|
rootDir: cwd,
|
|
382
382
|
scannerVersion: "doctor",
|
|
@@ -44,16 +44,16 @@ import {
|
|
|
44
44
|
import {
|
|
45
45
|
createCommandContext,
|
|
46
46
|
stringOption
|
|
47
|
-
} from "./cli-
|
|
47
|
+
} from "./cli-xddtv3yn.js";
|
|
48
48
|
import {
|
|
49
49
|
assertFlags,
|
|
50
50
|
assertPositionals,
|
|
51
51
|
requireTenant
|
|
52
|
-
} from "./cli-
|
|
52
|
+
} from "./cli-f1jfrqgf.js";
|
|
53
53
|
import {
|
|
54
54
|
ApiError,
|
|
55
55
|
callControlAPI
|
|
56
|
-
} from "./cli-
|
|
56
|
+
} from "./cli-0xc5htv7.js";
|
|
57
57
|
import {
|
|
58
58
|
embeddedTenantIdFromApiKey,
|
|
59
59
|
getActiveProfile,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
resolveModaBaseUrl,
|
|
64
64
|
resolveTenantId,
|
|
65
65
|
shellArg
|
|
66
|
-
} from "./cli-
|
|
66
|
+
} from "./cli-t0pb7qbs.js";
|
|
67
67
|
import {
|
|
68
68
|
CliInputError,
|
|
69
69
|
CliInputRequiredError
|
|
@@ -14048,7 +14048,7 @@ async function runHarnessCommand(context) {
|
|
|
14048
14048
|
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.");
|
|
14049
14049
|
}
|
|
14050
14050
|
if (context.flags["github-actions"] === "true") {
|
|
14051
|
-
const { runGithubActionsAnalyze } = await import("./harness-github-actions-
|
|
14051
|
+
const { runGithubActionsAnalyze } = await import("./harness-github-actions-2qc4gg2w.js");
|
|
14052
14052
|
const result = await runGithubActionsAnalyze(rootDir, {
|
|
14053
14053
|
writeReport: (report2) => {
|
|
14054
14054
|
const normalized = normalizeHarnessReport(report2);
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ApiError,
|
|
3
3
|
callControlAPI,
|
|
4
4
|
callDataAPI
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-0xc5htv7.js";
|
|
6
6
|
import {
|
|
7
7
|
continuationCommand,
|
|
8
8
|
embeddedTenantIdFromApiKey,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
resolveApiTenantId,
|
|
12
12
|
setPlatformTenantOverride,
|
|
13
13
|
shellArg
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-t0pb7qbs.js";
|
|
15
15
|
import {
|
|
16
16
|
CliAccessError,
|
|
17
17
|
CliInputError
|
|
@@ -131,6 +131,9 @@ var TRACE_GRAIN_FLAGS = {
|
|
|
131
131
|
frustrations: ["search", "status", "elicitor", "trajectory", "signal", "sort", "order"],
|
|
132
132
|
hallucinations: ["search", "status", "rule", "source", "sort", "order"]
|
|
133
133
|
};
|
|
134
|
+
var MAX_CONVERSATION_IDS_FILTER = 50;
|
|
135
|
+
var conversationIdsFlag = () => z.string().min(1).max(MAX_CONVERSATION_IDS_FILTER * 257).optional().describe(`Scope everything to several trace IDs, comma-separated (up to ${MAX_CONVERSATION_IDS_FILTER}; or --ids-from)`);
|
|
136
|
+
var idsFromFilterFlag = () => z.string().min(1).optional().describe(`Read the trace IDs to scope to from a file, or - for stdin, one per line (up to ${MAX_CONVERSATION_IDS_FILTER})`);
|
|
134
137
|
var FrustrationsSchema = z.object({
|
|
135
138
|
days_back: daysBackFlag(7),
|
|
136
139
|
limit: z.number().int().min(1).max(20).default(10).optional().describe("Maximum detections to return"),
|
|
@@ -139,14 +142,28 @@ var FrustrationsSchema = z.object({
|
|
|
139
142
|
window: z.number().int().min(1).max(5).default(1).optional().describe("Messages on each side with --include-window"),
|
|
140
143
|
user_id: z.string().min(1).max(256).optional().describe("Scope everything to one end user"),
|
|
141
144
|
conversation_id: z.string().min(1).max(256).optional().describe("Scope everything to one trace ID"),
|
|
142
|
-
...emotionTraceFilters
|
|
145
|
+
...emotionTraceFilters,
|
|
146
|
+
conversation_ids: conversationIdsFlag(),
|
|
147
|
+
ids_from: idsFromFilterFlag()
|
|
143
148
|
});
|
|
144
149
|
var ToolFailuresSchema = z.object({
|
|
145
150
|
days_back: daysBackFlag(7)
|
|
146
151
|
});
|
|
152
|
+
var PROBLEM_LIST_VIEWS = ["auto", "book", "dream"];
|
|
153
|
+
var BOOK_PROBLEM_SORTS = ["rank", "users", "signals", "problems"];
|
|
154
|
+
var DREAM_PROBLEM_SORTS = ["severity", "users", "silent"];
|
|
155
|
+
var PROBLEMS_MAX_LIMIT = 200;
|
|
156
|
+
var PROBLEMS_DEFAULT_LIMIT = 10;
|
|
157
|
+
var COHORT_REF = /^(all|builtin:[a-z_]{1,64}|[a-z_]{1,64}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
147
158
|
var ProblemsSchema = z.object({
|
|
148
|
-
|
|
149
|
-
|
|
159
|
+
view: z.enum(PROBLEM_LIST_VIEWS).default("auto").optional().describe("auto: what the dashboard shows (the dream grouping when published, else the Book); book or dream to force one"),
|
|
160
|
+
days_back: daysBackFlag().describe("Whole days to look back (Book default 30; the dream view defaults to its run window)"),
|
|
161
|
+
limit: z.number().int().min(1).max(PROBLEMS_MAX_LIMIT).default(PROBLEMS_DEFAULT_LIMIT).optional().describe("Problems per page (Book: per partition, problems and untrusted)"),
|
|
162
|
+
offset: z.number().int().min(0).max(1e4).optional().describe("Row to start at: next_offset from the previous page"),
|
|
163
|
+
list_version: z.string().regex(/^[0-9a-f]{1,64}$/, "must be the list_version of a previous page").optional().describe("list_version of the first page, passed with every later --offset"),
|
|
164
|
+
sort: z.string().regex(/^(rank|severity|users|signals|problems|silent|signal:[a-z_]{1,64})$/, "must be rank, severity, users, silent (dream), signals, problems or signal:<family> (Book)").optional().describe("Order: rank (default), users; dream: severity, silent; Book: signals, problems, signal:<family>"),
|
|
165
|
+
dir: z.enum(["desc", "asc"]).optional().describe("Sort direction (default desc)"),
|
|
166
|
+
cohort: z.string().regex(COHORT_REF, "must be builtin:<key> or a saved cohort id").optional().describe("Only the Problems this cohort hit (builtin:<key> or a saved cohort id), with its counts")
|
|
150
167
|
});
|
|
151
168
|
var REMAINDER_FAMILIES = [
|
|
152
169
|
"tool_failure",
|
|
@@ -200,7 +217,10 @@ var ProblemSchema = z.object({
|
|
|
200
217
|
limit: z.number().int().min(1).max(50).optional().describe("Page size for a sub-resource page"),
|
|
201
218
|
cursor: z.string().optional().describe("next_cursor from the previous page, verbatim"),
|
|
202
219
|
family: z.enum(PROBLEM_FAMILIES).optional().describe("With --traces: only this signal family"),
|
|
203
|
-
door: z.enum(PROBLEM_DOORS).optional().describe("With --traces: only this attribution door")
|
|
220
|
+
door: z.enum(PROBLEM_DOORS).optional().describe("With --traces: only this attribution door"),
|
|
221
|
+
view: z.enum(["book", "dream"]).optional().describe("dream: the dream view of the problem (definition, severity, incidents with verdicts); default the dossier"),
|
|
222
|
+
offset: z.number().int().min(0).max(1e4).optional().describe("With --view=dream: first incident to return"),
|
|
223
|
+
days_back: daysBackFlag().describe("With --view=dream: whole days to count (default the dream run window)")
|
|
204
224
|
});
|
|
205
225
|
var PROBLEM_FEEDBACK_ACTIONS = [
|
|
206
226
|
"mark_fixed",
|
|
@@ -303,6 +323,8 @@ var EmotionsSchema = z.object({
|
|
|
303
323
|
family: z.enum(EMOTION_FAMILIES).optional().describe("Only this family in the detections list (summary covers all)"),
|
|
304
324
|
user_id: z.string().min(1).max(256).optional().describe("Scope everything to one end user"),
|
|
305
325
|
conversation_id: z.string().min(1).max(256).optional().describe("Scope everything to one trace ID"),
|
|
326
|
+
conversation_ids: conversationIdsFlag(),
|
|
327
|
+
ids_from: idsFromFilterFlag(),
|
|
306
328
|
include_window: boolFlag().describe("Keep each detection's conversation context (agent output omits it by default)"),
|
|
307
329
|
...emotionTraceFilters
|
|
308
330
|
});
|
|
@@ -311,6 +333,8 @@ var HallucinationsSchema = z.object({
|
|
|
311
333
|
limit: z.number().int().min(1).max(20).default(10).optional().describe("Maximum detections to return"),
|
|
312
334
|
offset: z.number().int().min(0).max(1e4).optional().describe("Number of detections to skip"),
|
|
313
335
|
conversation_id: z.string().max(200).optional().describe("Scope summary and list to one trace ID"),
|
|
336
|
+
conversation_ids: conversationIdsFlag(),
|
|
337
|
+
ids_from: idsFromFilterFlag(),
|
|
314
338
|
kind: z.enum(["contradicted", "verified"]).optional().describe("Only this kind in the detections list"),
|
|
315
339
|
group_by: z.enum(["message", "trace"]).optional().describe("message (default): one row per scored message. trace: one row per trace, totals count traces as the dashboard does"),
|
|
316
340
|
search: z.string().trim().min(1).max(200).optional().describe("Trace ID substring; needs --group-by=trace"),
|
|
@@ -346,6 +370,8 @@ var LazinessSchema = z.object({
|
|
|
346
370
|
limit: z.number().int().min(1).max(50).default(10).optional().describe("Maximum detections to return"),
|
|
347
371
|
offset: z.number().int().min(0).max(1e4).optional().describe("Number of detections to skip"),
|
|
348
372
|
conversation_id: z.string().max(200).optional().describe("One trace's detections"),
|
|
373
|
+
conversation_ids: conversationIdsFlag(),
|
|
374
|
+
ids_from: idsFromFilterFlag(),
|
|
349
375
|
family: z.enum(LAZINESS_FAMILIES).optional().describe("Only this laziness family"),
|
|
350
376
|
group_by: z.enum(["trace"]).optional().describe("Accepted for symmetry: laziness rows are always one per trace"),
|
|
351
377
|
search: z.string().trim().min(1).max(200).optional().describe("Trace ID substring"),
|
|
@@ -430,6 +456,11 @@ var AskSchema = z.object({
|
|
|
430
456
|
days_back: daysBackFlag(7),
|
|
431
457
|
stream: boolFlag().describe("Stream live progress (default in a terminal; --no-stream turns it off)")
|
|
432
458
|
});
|
|
459
|
+
var TraceFindingsSchema = z.object({
|
|
460
|
+
conversation_id: z.string().min(1).max(255).describe("Trace ID"),
|
|
461
|
+
limit: z.number().int().min(1).max(50).default(3).optional().describe("Detections shown per family (counts always cover every detection)"),
|
|
462
|
+
ids_from: z.string().min(1).optional().describe("Read several trace ids, one per line, from a file or - for stdin (batch mode, up to 25)")
|
|
463
|
+
});
|
|
433
464
|
var TraceSignalsSchema = z.object({
|
|
434
465
|
conversation_id: z.string().min(1).describe("Trace ID")
|
|
435
466
|
});
|
|
@@ -670,6 +701,7 @@ var COMMAND_FLAG_SPECS = {
|
|
|
670
701
|
signals: { schema: SignalsListSchema, handParsed: true },
|
|
671
702
|
signal: { schema: SignalSchema, positionals: [{ name: "signal_id", key: "id", required: true }] },
|
|
672
703
|
"trace-signals": { schema: TraceSignalsSchema, handParsed: true, positionals: [TRACE_ID] },
|
|
704
|
+
"trace-findings": { schema: TraceFindingsSchema, positionals: [TRACE_ID] },
|
|
673
705
|
"signal-label": { schema: SignalLabelSchema, extra: DRY_RUN, handParsed: true, positionals: [{ name: "signal_id", key: "id", required: true }] },
|
|
674
706
|
emotions: { schema: EmotionsSchema },
|
|
675
707
|
laziness: { schema: LazinessSchema },
|
|
@@ -1415,4 +1447,4 @@ function unknownSignalsSubcommandError(sub, args = []) {
|
|
|
1415
1447
|
${SIGNAL_USAGE}`);
|
|
1416
1448
|
}
|
|
1417
1449
|
|
|
1418
|
-
export { TRACE_GRAIN_FLAGS, ProblemsRemainderSchema, UUID_RE, ProblemImpactSchema, PROBLEM_FEEDBACK_ACTIONS, ProblemFeedbackSchema, ProblemLinearFileSchema, SignalLabelSchema, DETECTION_VERDICTS, DetectionReviewSchema, FALSE_POSITIVE_KINDS, FalsePositiveSchema, EMOTION_FAMILIES, LAZINESS_FAMILIES, StepScoresSchema, AuditSchema, FEEDBACK_USAGE, isFeedbackRefFlag, buildFeedbackRequest, writeDryRun, COMMAND_FLAG_SPECS, flagSpecFor, kebabFlag, schemaShape, describeField, specFlagKeys, specFlagNames, describeSpecFlags, closestMatches, usageLine, renderFlagHelp, subcommandHelpFlags, manifestFlagFields, requireTenant, assertFlags, assertPositionals, runUsersCommand, runUserCommand, runProblemReopenCommand, runSignalsManagementCommand, SIGNALS_MANAGEMENT_SUBCOMMANDS, unknownSignalsSubcommandError };
|
|
1450
|
+
export { TRACE_GRAIN_FLAGS, MAX_CONVERSATION_IDS_FILTER, BOOK_PROBLEM_SORTS, DREAM_PROBLEM_SORTS, PROBLEMS_MAX_LIMIT, PROBLEMS_DEFAULT_LIMIT, ProblemsRemainderSchema, UUID_RE, ProblemImpactSchema, PROBLEM_FEEDBACK_ACTIONS, ProblemFeedbackSchema, ProblemLinearFileSchema, SignalLabelSchema, DETECTION_VERDICTS, DetectionReviewSchema, FALSE_POSITIVE_KINDS, FalsePositiveSchema, EMOTION_FAMILIES, LAZINESS_FAMILIES, StepScoresSchema, AuditSchema, TraceFindingsSchema, FEEDBACK_USAGE, isFeedbackRefFlag, buildFeedbackRequest, writeDryRun, COMMAND_FLAG_SPECS, flagSpecFor, kebabFlag, schemaShape, describeField, specFlagKeys, specFlagNames, describeSpecFlags, closestMatches, usageLine, renderFlagHelp, subcommandHelpFlags, manifestFlagFields, requireTenant, assertFlags, assertPositionals, runUsersCommand, runUserCommand, runProblemReopenCommand, runSignalsManagementCommand, SIGNALS_MANAGEMENT_SUBCOMMANDS, unknownSignalsSubcommandError };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
shellArg
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-t0pb7qbs.js";
|
|
4
4
|
import {
|
|
5
5
|
CliInputError
|
|
6
6
|
} from "./cli-k4tqwah4.js";
|
|
@@ -676,4 +676,4 @@ var MODA_INTELLIGENCE_V1_JSON_SCHEMA = {
|
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
678
|
|
|
679
|
-
export { BATCH_MAX_TARGETS, BATCH_CONCURRENCY, parseBatchTarget, collectBatchTargets, mapWithConcurrency, contextTarget, asRecord, asString, asNumber, frustrationAnchorIndex, frustrationsFromEmotions, withFrustrationAnchors, trimToolFailureConversations, withToolFailureAnchors, embeddedWindowSize, withoutDetectionWindows, compactProblemDossier, toolFailureExamplesCommand, toolCatalogGetCommand, shapeToolCatalogDetail, INTELLIGENCE_SCHEMA_VERSION, MODA_INTELLIGENCE_V1_JSON_SCHEMA };
|
|
679
|
+
export { BATCH_MAX_TARGETS, BATCH_CONCURRENCY, parseBatchTarget, parseTargetLines, readIdsFrom, collectBatchTargets, mapWithConcurrency, contextTarget, asRecord, asString, asNumber, frustrationAnchorIndex, frustrationsFromEmotions, withFrustrationAnchors, trimToolFailureConversations, withToolFailureAnchors, embeddedWindowSize, withoutDetectionWindows, compactProblemDossier, toolFailureExamplesCommand, toolCatalogGetCommand, shapeToolCatalogDetail, INTELLIGENCE_SCHEMA_VERSION, MODA_INTELLIGENCE_V1_JSON_SCHEMA };
|
|
@@ -668,6 +668,7 @@ var LEGACY_NAMES = [
|
|
|
668
668
|
{ legacy: "world-state", use: "moda traces state <conversation_id>", canonical: { command: "traces", subcommand: "state" } },
|
|
669
669
|
{ legacy: "audit", use: "moda traces spans <conversation_id|trace_id>", canonical: { command: "traces", subcommand: "spans" } },
|
|
670
670
|
{ legacy: "trace", use: "moda traces spans <conversation_id|trace_id>", canonical: { command: "traces", subcommand: "spans" } },
|
|
671
|
+
{ legacy: "trace-findings", use: "moda traces findings <conversation_id>", canonical: { command: "traces", subcommand: "findings" }, silent: true },
|
|
671
672
|
{ legacy: "problem", use: "moda problems get <problem_id>", canonical: { command: "problems", subcommand: "get" } },
|
|
672
673
|
{ legacy: "problems remainder", use: "moda problems unexplained", canonical: { command: "problems", subcommand: "unexplained" } },
|
|
673
674
|
{ legacy: "problem-impact", use: "moda problems impact", canonical: { command: "problems", subcommand: "impact" } },
|
|
@@ -1277,7 +1278,10 @@ function createAgentEnvelope(options) {
|
|
|
1277
1278
|
findings: text.findings,
|
|
1278
1279
|
evidence_refs: text.evidence_refs,
|
|
1279
1280
|
recommended_actions: text.recommended_actions,
|
|
1280
|
-
next_commands: [
|
|
1281
|
+
next_commands: [
|
|
1282
|
+
...withoutSupersededPaging(text.next_commands, bounded.supersededPaging).filter((command) => !(command.nextPage && bounded.nextCommands?.length)).map(({ nextPage: _nextPage, ...command }) => command),
|
|
1283
|
+
...canonicalSuggestions(bounded.nextCommands ?? [])
|
|
1284
|
+
],
|
|
1281
1285
|
artifacts: [
|
|
1282
1286
|
...options.artifacts ?? [],
|
|
1283
1287
|
...bounded.fullOutputPath ? [{ kind: "full_output", path: bounded.fullOutputPath, description: "Complete command output (the same JSON --json prints); data in this envelope was bounded." }] : [],
|
|
@@ -1925,6 +1929,7 @@ var PAGED_LIST_BY_COMMAND = {
|
|
|
1925
1929
|
emotions: ["detections", "traces"],
|
|
1926
1930
|
frustrations: ["frustrations", "traces"],
|
|
1927
1931
|
laziness: "conversations",
|
|
1932
|
+
problems: ["problems", "untrusted"],
|
|
1928
1933
|
"problems remainder": "groups",
|
|
1929
1934
|
"problem remainder": "groups"
|
|
1930
1935
|
};
|
|
@@ -1936,7 +1941,7 @@ function pagedListsFor(invocation) {
|
|
|
1936
1941
|
}
|
|
1937
1942
|
var MAX_PAGE_OFFSET = 1e4;
|
|
1938
1943
|
function rewritePagination(list, isTopLevel, invocation) {
|
|
1939
|
-
const { parent, array
|
|
1944
|
+
const { parent, array } = list;
|
|
1940
1945
|
if (!parent)
|
|
1941
1946
|
return;
|
|
1942
1947
|
const nested = asRecord(parent.pagination);
|
|
@@ -1946,32 +1951,40 @@ function rewritePagination(list, isTopLevel, invocation) {
|
|
|
1946
1951
|
return;
|
|
1947
1952
|
const listKey = list.path.split(".").pop() ?? list.path;
|
|
1948
1953
|
const arrayKeys = Object.keys(parent).filter((key) => Array.isArray(parent[key]));
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
}
|
|
1954
|
-
if (typeof pagination.returned === "number" ? pagination.returned !== originalLength : typeof pagination.limit === "number" && originalLength > pagination.limit) {
|
|
1954
|
+
const paged = invocation ? pagedListsFor(invocation) : [];
|
|
1955
|
+
if (arrayKeys.length > 1 && !paged.includes(listKey))
|
|
1956
|
+
return;
|
|
1957
|
+
if (typeof pagination.returned === "number" ? pagination.returned !== list.originalLength : typeof pagination.limit === "number" && list.originalLength > pagination.limit) {
|
|
1955
1958
|
return;
|
|
1956
1959
|
}
|
|
1957
|
-
const kept = array.length;
|
|
1960
|
+
const kept = list.page?.kept ?? array.length;
|
|
1961
|
+
const originalLength = list.page?.original ?? list.originalLength;
|
|
1958
1962
|
const omitted = originalLength - kept;
|
|
1963
|
+
const requested = typeof pagination.limit === "number" ? pagination.limit : undefined;
|
|
1964
|
+
const step = requested !== undefined ? Math.min(kept, requested) : kept;
|
|
1965
|
+
const ranked = requested !== undefined ? Math.min(requested, originalLength) : originalLength;
|
|
1966
|
+
const nextLimit = ranked > step ? ranked - step : requested ?? omitted;
|
|
1959
1967
|
const offset = typeof pagination.offset === "number" && Number.isFinite(pagination.offset) ? pagination.offset : undefined;
|
|
1960
1968
|
const hadCursor = typeof pagination.next_cursor === "string" && pagination.next_cursor.length > 0 || typeof pagination.nextCursor === "string" && pagination.nextCursor.length > 0;
|
|
1961
1969
|
if (typeof pagination.limit === "number") {
|
|
1962
1970
|
pagination.requested_limit = pagination.limit;
|
|
1963
1971
|
pagination.limit = kept;
|
|
1964
1972
|
}
|
|
1965
|
-
pagination.returned =
|
|
1973
|
+
pagination.returned = array.length;
|
|
1974
|
+
for (const key of paged.slice(1)) {
|
|
1975
|
+
if (typeof pagination[`${key}_returned`] === "number" && Array.isArray(parent[key])) {
|
|
1976
|
+
pagination[`${key}_returned`] = parent[key].length;
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1966
1979
|
pagination.omitted_for_byte_limit = omitted;
|
|
1967
1980
|
pagination.has_more = true;
|
|
1968
1981
|
if ("hasMore" in pagination)
|
|
1969
1982
|
pagination.hasMore = true;
|
|
1970
1983
|
if ("nextCursor" in pagination && typeof pagination.nextCursor === "string" && pagination.nextCursor)
|
|
1971
1984
|
pagination.nextCursor = null;
|
|
1972
|
-
const pastOffsetCap = offset !== undefined && offset +
|
|
1985
|
+
const pastOffsetCap = offset !== undefined && offset + step > MAX_PAGE_OFFSET;
|
|
1973
1986
|
if (offset !== undefined && !pastOffsetCap)
|
|
1974
|
-
pagination.next_offset = offset +
|
|
1987
|
+
pagination.next_offset = offset + step;
|
|
1975
1988
|
if (hadCursor)
|
|
1976
1989
|
pagination.next_cursor = null;
|
|
1977
1990
|
const where = `data.${list.path}`;
|
|
@@ -1984,12 +1997,15 @@ function rewritePagination(list, isTopLevel, invocation) {
|
|
|
1984
1997
|
return { note: `${where} holds ${kept} of ${originalLength} row(s)` };
|
|
1985
1998
|
}
|
|
1986
1999
|
if (offset !== undefined) {
|
|
1987
|
-
const
|
|
2000
|
+
const overrides = { offset: offset + step, limit: nextLimit };
|
|
2001
|
+
if (typeof pagination.list_version === "string")
|
|
2002
|
+
overrides["list-version"] = pagination.list_version;
|
|
2003
|
+
const command = continuationCommand(invocation, overrides);
|
|
1988
2004
|
return {
|
|
1989
|
-
note: `${where} holds ${kept} of ${originalLength} row(s); pagination.next_offset=${offset +
|
|
2005
|
+
note: `${where} holds ${kept} of ${originalLength} row(s); pagination.next_offset=${offset + step}. Fetch the ${omitted} omitted row(s) with: ${command}`,
|
|
1990
2006
|
nextCommand: {
|
|
1991
2007
|
command,
|
|
1992
|
-
purpose: `
|
|
2008
|
+
purpose: `Continue from the first row of this page that was left out to fit the agent byte limit.`,
|
|
1993
2009
|
mutability: "read",
|
|
1994
2010
|
requires_approval: false
|
|
1995
2011
|
},
|
|
@@ -2066,6 +2082,10 @@ function boundForAgent(data, maxBytes = agentMaxOutputBytes(), options = {}) {
|
|
|
2066
2082
|
boundedBytes = sizeOf(bounded);
|
|
2067
2083
|
}
|
|
2068
2084
|
}
|
|
2085
|
+
const root = asRecord(bounded);
|
|
2086
|
+
if (root && options.invocation && alignPagedLists(root, pagedListsFor(options.invocation), droppedLists, droppedItems)) {
|
|
2087
|
+
boundedBytes = sizeOf(bounded);
|
|
2088
|
+
}
|
|
2069
2089
|
const dropped = Object.entries(droppedItems);
|
|
2070
2090
|
const whereIsTheRest = fullOutputPath ? `The complete output (every item, no text shortened) is in ${fullOutputPath}; read it in line ranges or query it with jq. ` : "The complete output could not be saved to a file. ";
|
|
2071
2091
|
const howToGetMore = whereIsTheRest + "Alternatively narrow the query (a smaller --limit, with --offset or --cursor paging where the command supports it), " + "rerun with --json (no byte limit), or raise MODA_AGENT_MAX_OUTPUT_BYTES.";
|
|
@@ -2081,7 +2101,6 @@ function boundForAgent(data, maxBytes = agentMaxOutputBytes(), options = {}) {
|
|
|
2081
2101
|
fullOutputPath
|
|
2082
2102
|
};
|
|
2083
2103
|
}
|
|
2084
|
-
const root = asRecord(bounded);
|
|
2085
2104
|
const notes = [];
|
|
2086
2105
|
const nextCommands = [];
|
|
2087
2106
|
const supersededPaging = new Set;
|
|
@@ -2129,6 +2148,37 @@ function withoutSupersededPaging(commands, superseded) {
|
|
|
2129
2148
|
const flags = superseded.map((flag) => new RegExp(`(^|\\s)--${flag}=`));
|
|
2130
2149
|
return commands.filter((next) => !flags.some((flag) => flag.test(next.command)));
|
|
2131
2150
|
}
|
|
2151
|
+
function alignPagedLists(root, lists, droppedLists, droppedItems) {
|
|
2152
|
+
if (lists.length < 2)
|
|
2153
|
+
return false;
|
|
2154
|
+
const cut = lists.flatMap((key) => {
|
|
2155
|
+
const list = droppedLists.get(key);
|
|
2156
|
+
return list && list.parent === root ? [list] : [];
|
|
2157
|
+
});
|
|
2158
|
+
if (cut.length === 0)
|
|
2159
|
+
return false;
|
|
2160
|
+
const kept = Math.min(...cut.map((list) => list.array.length));
|
|
2161
|
+
let aligned = false;
|
|
2162
|
+
let primary;
|
|
2163
|
+
let original = 0;
|
|
2164
|
+
for (const key of lists) {
|
|
2165
|
+
const array = root[key];
|
|
2166
|
+
if (!Array.isArray(array))
|
|
2167
|
+
continue;
|
|
2168
|
+
const length = droppedLists.get(key)?.originalLength ?? array.length;
|
|
2169
|
+
original = Math.max(original, length);
|
|
2170
|
+
if (array.length > kept) {
|
|
2171
|
+
droppedItems[key] = (droppedItems[key] ?? 0) + array.length - kept;
|
|
2172
|
+
array.splice(kept);
|
|
2173
|
+
aligned = true;
|
|
2174
|
+
}
|
|
2175
|
+
droppedLists.delete(key);
|
|
2176
|
+
primary ??= { path: key, parent: root, array, originalLength: length };
|
|
2177
|
+
}
|
|
2178
|
+
if (primary)
|
|
2179
|
+
droppedLists.set(primary.path, { ...primary, page: { kept, original } });
|
|
2180
|
+
return aligned;
|
|
2181
|
+
}
|
|
2132
2182
|
function asRecord(value) {
|
|
2133
2183
|
return value && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
2134
2184
|
}
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
parsePromptFileForAb,
|
|
5
5
|
readPromptLock,
|
|
6
6
|
runPromptSync
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-4tg0hkbz.js";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_POLL_INTERVAL_MS,
|
|
10
10
|
DEFAULT_WAIT_TIMEOUT_MS,
|
|
11
11
|
fetchLatestRun
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-daqkdnm1.js";
|
|
13
13
|
import {
|
|
14
14
|
UUID_RE
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-f1jfrqgf.js";
|
|
16
16
|
import {
|
|
17
17
|
callControlAPI,
|
|
18
18
|
callDataAPI
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-0xc5htv7.js";
|
|
20
20
|
import {
|
|
21
21
|
EXIT_ERROR,
|
|
22
22
|
EXIT_OK,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
setPlatformTenantOverride,
|
|
25
25
|
shellArg,
|
|
26
26
|
validateConfig
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-t0pb7qbs.js";
|
|
28
28
|
import {
|
|
29
29
|
CliInputError
|
|
30
30
|
} from "./cli-k4tqwah4.js";
|