@moda-ai/cli 1.55.16 → 1.55.17
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-a2xwfeeh.js → agent-cha3kg9d.js} +9 -9
- package/dist/{cli-86q35fpq.js → cli-0e8bfvn7.js} +8 -8
- package/dist/{cli-3gwbg0xp.js → cli-1exddmc0.js} +2 -2
- package/dist/{cli-b3cxcxgn.js → cli-3ezzeqcy.js} +669 -37
- package/dist/{cli-kf3d6y8c.js → cli-5hq827jt.js} +8 -2
- package/dist/{cli-xy6zn80e.js → cli-5q1gyvxn.js} +5 -5
- package/dist/{cli-7fc44hhq.js → cli-a1mv0ypm.js} +5 -5
- package/dist/{cli-zdeywyn9.js → cli-av3dqgj5.js} +4 -4
- package/dist/cli-bb7133m7.js +144 -0
- package/dist/{cli-2ars875d.js → cli-c8p69n55.js} +2 -2
- package/dist/{cli-atx672xv.js → cli-eazeanvt.js} +1 -1
- package/dist/{cli-53mvsfgn.js → cli-kg0kz05e.js} +3 -3
- package/dist/{cli-6ca1sz0a.js → cli-qmjnh4z9.js} +1 -1
- package/dist/cli.js +94 -47
- package/dist/{doctor-e2xrbpmp.js → doctor-kg0yq1wf.js} +9 -9
- package/dist/{fix-v8xka487.js → fix-q8er8egx.js} +7 -7
- package/dist/{harness-github-actions-301nak95.js → harness-github-actions-ver6cprq.js} +6 -6
- package/dist/{harness-28wbzncq.js → harness-v9s0k9s7.js} +6 -6
- package/dist/{index-ccdpy9ma.js → index-7zqa7t5c.js} +11 -11
- package/dist/{production-intelligence-0wqcvvxk.js → production-intelligence-k36jsvqx.js} +13 -13
- package/dist/{profile-commands-f5kysjrv.js → profile-commands-88sdwzbg.js} +3 -3
- package/dist/prompt-source-mcp.js +6 -6
- package/dist/{prompts-jg0stjfb.js → prompts-2r756vtd.js} +7 -7
- package/dist/{provision-25bw5rd7.js → provision-n3r7yway.js} +4 -4
- package/dist/{registry-39xzetsc.js → registry-5v63ga01.js} +4 -4
- package/dist/{skills-gjesa81c.js → skills-fed17et3.js} +6 -6
- package/dist/{sync-7ts9psky.js → sync-r4tncne4.js} +8 -8
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
- package/skills/moda-cli/SKILL.md +20 -8
- package/dist/cli-438g4nwh.js +0 -465
package/dist/cli-438g4nwh.js
DELETED
|
@@ -1,465 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CliInputError
|
|
3
|
-
} from "./cli-b3cxcxgn.js";
|
|
4
|
-
|
|
5
|
-
// src/batch-reads.ts
|
|
6
|
-
import { readFile } from "node:fs/promises";
|
|
7
|
-
var BATCH_MAX_TARGETS = 25;
|
|
8
|
-
var BATCH_CONCURRENCY = 4;
|
|
9
|
-
var ANCHOR_SUFFIX = /^(.+)@(\d+)$/;
|
|
10
|
-
function parseBatchTarget(text, anchors, usage) {
|
|
11
|
-
const raw = text.trim();
|
|
12
|
-
if (raw.startsWith("{")) {
|
|
13
|
-
let parsed;
|
|
14
|
-
try {
|
|
15
|
-
parsed = JSON.parse(raw);
|
|
16
|
-
} catch {
|
|
17
|
-
throw new CliInputError(`Could not parse the JSON target ${JSON.stringify(raw)}.`, usage, "bad_batch_target");
|
|
18
|
-
}
|
|
19
|
-
const record = parsed;
|
|
20
|
-
const id = record?.id ?? record?.conversation_id ?? record?.trace_id;
|
|
21
|
-
if (typeof id !== "string" || id.trim() === "") {
|
|
22
|
-
throw new CliInputError(`JSON target ${JSON.stringify(raw)} has no "id" string.`, usage, "bad_batch_target");
|
|
23
|
-
}
|
|
24
|
-
const index = record.msg_index ?? record.message_index;
|
|
25
|
-
if (index !== undefined && index !== null) {
|
|
26
|
-
if (!anchors) {
|
|
27
|
-
throw new CliInputError(`JSON target ${JSON.stringify(raw)} has a msg_index, which this command does not take.`, usage, "bad_batch_target");
|
|
28
|
-
}
|
|
29
|
-
if (typeof index !== "number" || !Number.isSafeInteger(index) || index < 0) {
|
|
30
|
-
throw new CliInputError(`JSON target ${JSON.stringify(raw)} has an invalid msg_index (want an integer >= 0).`, usage, "bad_batch_target");
|
|
31
|
-
}
|
|
32
|
-
return { raw, id, msgIndex: index };
|
|
33
|
-
}
|
|
34
|
-
return { raw, id };
|
|
35
|
-
}
|
|
36
|
-
if (anchors) {
|
|
37
|
-
const match = ANCHOR_SUFFIX.exec(raw);
|
|
38
|
-
if (match) {
|
|
39
|
-
const msgIndex = Number(match[2]);
|
|
40
|
-
if (!Number.isSafeInteger(msgIndex)) {
|
|
41
|
-
throw new CliInputError(`Target ${JSON.stringify(raw)} has an @msg_index past ${Number.MAX_SAFE_INTEGER}. ` + 'If the id itself ends in @<digits>, pass it as {"id": "..."}.', usage, "bad_batch_target");
|
|
42
|
-
}
|
|
43
|
-
return { raw, id: match[1], msgIndex };
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return { raw, id: raw };
|
|
47
|
-
}
|
|
48
|
-
function parseTargetLines(text, anchors, usage) {
|
|
49
|
-
return text.split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "").map((line) => parseBatchTarget(line, anchors, usage));
|
|
50
|
-
}
|
|
51
|
-
async function readStdinText() {
|
|
52
|
-
if (process.stdin.isTTY) {
|
|
53
|
-
throw new CliInputError("--ids-from=- reads targets from stdin, but stdin is a terminal. Pipe ids in (one per line) or pass a file path.", undefined, "ids_from_tty");
|
|
54
|
-
}
|
|
55
|
-
const chunks = [];
|
|
56
|
-
for await (const chunk of process.stdin)
|
|
57
|
-
chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
58
|
-
return Buffer.concat(chunks).toString("utf8");
|
|
59
|
-
}
|
|
60
|
-
async function readIdsFrom(source, usage) {
|
|
61
|
-
if (source === "" || source === "true") {
|
|
62
|
-
throw new CliInputError("--ids-from needs a value: - (stdin) or a file path.", usage, "missing_flag_value");
|
|
63
|
-
}
|
|
64
|
-
if (source === "-")
|
|
65
|
-
return readStdinText();
|
|
66
|
-
try {
|
|
67
|
-
return await readFile(source, "utf8");
|
|
68
|
-
} catch (error) {
|
|
69
|
-
const code = error.code;
|
|
70
|
-
throw new CliInputError(`Could not read --ids-from file ${JSON.stringify(source)}${typeof code === "string" ? ` (${code})` : ""}.`, usage, "ids_from_unreadable");
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async function collectBatchTargets(positionals, idsFrom, options) {
|
|
74
|
-
const targets = positionals.map((value) => parseBatchTarget(value, options.anchors, options.usage));
|
|
75
|
-
if (idsFrom !== undefined) {
|
|
76
|
-
targets.push(...parseTargetLines(await readIdsFrom(idsFrom, options.usage), options.anchors, options.usage));
|
|
77
|
-
}
|
|
78
|
-
const seen = new Set;
|
|
79
|
-
const unique = targets.filter((target) => {
|
|
80
|
-
const key = `${target.id}\x00${target.msgIndex ?? ""}`;
|
|
81
|
-
if (seen.has(key))
|
|
82
|
-
return false;
|
|
83
|
-
seen.add(key);
|
|
84
|
-
return true;
|
|
85
|
-
});
|
|
86
|
-
if (unique.length === 0) {
|
|
87
|
-
throw new CliInputError(`No targets: --ids-from gave no ids (one per line).`, options.usage, "missing_positional");
|
|
88
|
-
}
|
|
89
|
-
if (unique.length > BATCH_MAX_TARGETS) {
|
|
90
|
-
throw new CliInputError(`Got ${unique.length} targets; 'moda ${options.command}' reads at most ${BATCH_MAX_TARGETS} per call, so nothing was read. ` + `Split the ids into calls of ${BATCH_MAX_TARGETS} or fewer.`, options.usage, "batch_too_large");
|
|
91
|
-
}
|
|
92
|
-
return unique;
|
|
93
|
-
}
|
|
94
|
-
async function mapWithConcurrency(items, limit, fn) {
|
|
95
|
-
const results = new Array(items.length);
|
|
96
|
-
let next = 0;
|
|
97
|
-
let failure;
|
|
98
|
-
const worker = async () => {
|
|
99
|
-
while (!failure && next < items.length) {
|
|
100
|
-
const index = next++;
|
|
101
|
-
try {
|
|
102
|
-
results[index] = await fn(items[index], index);
|
|
103
|
-
} catch (error) {
|
|
104
|
-
failure ??= { error };
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
await Promise.all(Array.from({ length: Math.max(1, Math.min(limit, items.length)) }, worker));
|
|
109
|
-
if (failure)
|
|
110
|
-
throw failure.error;
|
|
111
|
-
return results;
|
|
112
|
-
}
|
|
113
|
-
function idNeedsJsonTarget(id) {
|
|
114
|
-
return ANCHOR_SUFFIX.test(id);
|
|
115
|
-
}
|
|
116
|
-
function contextTarget(id) {
|
|
117
|
-
const verbatim = id === id.trim() && !id.startsWith("{") && !idNeedsJsonTarget(id);
|
|
118
|
-
return verbatim ? id : JSON.stringify({ id });
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// src/transforms.ts
|
|
122
|
-
function asRecord(value) {
|
|
123
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
124
|
-
return value;
|
|
125
|
-
}
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
function asString(value) {
|
|
129
|
-
return typeof value === "string" ? value : null;
|
|
130
|
-
}
|
|
131
|
-
function asNumber(value) {
|
|
132
|
-
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
133
|
-
}
|
|
134
|
-
function frustrationAnchorIndex(row) {
|
|
135
|
-
if (!row)
|
|
136
|
-
return null;
|
|
137
|
-
const userQuotes = Array.isArray(row.user_quotes) ? row.user_quotes : [];
|
|
138
|
-
const firstQuote = asRecord(userQuotes[0]);
|
|
139
|
-
const resolved = asNumber(firstQuote?.msg_index) ?? asNumber(row.anchor_msg_index);
|
|
140
|
-
if (resolved !== null)
|
|
141
|
-
return resolved;
|
|
142
|
-
const keyTurns = Array.isArray(row.key_turns) ? row.key_turns : [];
|
|
143
|
-
const firstTurn = keyTurns.find((t) => typeof t === "number");
|
|
144
|
-
if (firstTurn !== undefined)
|
|
145
|
-
return firstTurn;
|
|
146
|
-
return asNumber(firstQuote?.turn);
|
|
147
|
-
}
|
|
148
|
-
function buildFrustrationAnchor(row) {
|
|
149
|
-
const conversation_id = asString(row.conversation_id) ?? "";
|
|
150
|
-
const userQuotes = Array.isArray(row.user_quotes) ? row.user_quotes : [];
|
|
151
|
-
const firstQuote = asRecord(userQuotes[0]);
|
|
152
|
-
const keyTurnsRaw = Array.isArray(row.key_turns) ? row.key_turns : [];
|
|
153
|
-
const all_turns = keyTurnsRaw.filter((t) => typeof t === "number");
|
|
154
|
-
const msg_index = frustrationAnchorIndex(row);
|
|
155
|
-
let signal = null;
|
|
156
|
-
let quote_preview = null;
|
|
157
|
-
if (firstQuote) {
|
|
158
|
-
signal = asString(firstQuote.signal);
|
|
159
|
-
const quote = asString(firstQuote.quote);
|
|
160
|
-
if (quote !== null) {
|
|
161
|
-
let end = 0;
|
|
162
|
-
let points = 0;
|
|
163
|
-
for (const ch of quote) {
|
|
164
|
-
if (points++ === 200)
|
|
165
|
-
break;
|
|
166
|
-
end += ch.length;
|
|
167
|
-
}
|
|
168
|
-
quote_preview = quote.slice(0, end);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return {
|
|
172
|
-
kind: "frustration",
|
|
173
|
-
conversation_id,
|
|
174
|
-
msg_index,
|
|
175
|
-
signal,
|
|
176
|
-
quote_preview,
|
|
177
|
-
all_turns,
|
|
178
|
-
no_anchor: msg_index === null
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function buildToolFailureAnchor(row, toolName) {
|
|
182
|
-
const conversation_id = asString(row.conversation_id) ?? "";
|
|
183
|
-
const msg_index = asNumber(row.msg_index);
|
|
184
|
-
const tool_use_id = asString(row.tool_use_id);
|
|
185
|
-
const error_subtype = asString(row.error_subtype);
|
|
186
|
-
return {
|
|
187
|
-
kind: "tool_failure",
|
|
188
|
-
conversation_id,
|
|
189
|
-
msg_index,
|
|
190
|
-
tool_name: toolName,
|
|
191
|
-
tool_use_id,
|
|
192
|
-
error_subtype,
|
|
193
|
-
no_anchor: msg_index === null
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
function frustrationsFromEmotions(response) {
|
|
197
|
-
if (!Array.isArray(response.detections) || Array.isArray(response.frustrations))
|
|
198
|
-
return response;
|
|
199
|
-
const summary = asRecord(response.summary) ?? {};
|
|
200
|
-
const pagination = asRecord(response.pagination) ?? {};
|
|
201
|
-
const byFamily = asRecord(summary.by_family) ?? {};
|
|
202
|
-
const totalAnalyzed = asNumber(summary.conversations_analyzed) ?? 0;
|
|
203
|
-
const byFamilyConversations = asRecord(summary.conversations_by_family);
|
|
204
|
-
const frustrated = asNumber(byFamilyConversations?.frustration) ?? asNumber(byFamily.frustration) ?? 0;
|
|
205
|
-
const frustrations = response.detections.map((item) => asRecord(item)).filter((row) => row !== null && (row.family === undefined || row.family === "frustration")).map(({ conversation_context, score, is_detected, ...row }) => ({
|
|
206
|
-
...row,
|
|
207
|
-
is_frustrated: is_detected === true,
|
|
208
|
-
frustration_score: score,
|
|
209
|
-
target: row.elicitor === "bot" || row.elicitor === "external" ? row.elicitor : "ambiguous",
|
|
210
|
-
conversation: conversation_context ?? null
|
|
211
|
-
}));
|
|
212
|
-
const atRisk = asNumber(pagination.at_risk) ?? Math.max(0, (asNumber(pagination.total) ?? 0) - frustrated);
|
|
213
|
-
const signalBreakdown = {};
|
|
214
|
-
for (const item of Array.isArray(response.signal_breakdown) ? response.signal_breakdown : []) {
|
|
215
|
-
const row = asRecord(item);
|
|
216
|
-
if (row?.family === "frustration" && typeof row.signal === "string") {
|
|
217
|
-
signalBreakdown[row.signal] = asNumber(row.count) ?? 0;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
const { detections: _detections, ...rest } = response;
|
|
221
|
-
return {
|
|
222
|
-
...rest,
|
|
223
|
-
summary: {
|
|
224
|
-
total_analyzed: totalAnalyzed,
|
|
225
|
-
frustrated_count: frustrated,
|
|
226
|
-
at_risk_count: atRisk,
|
|
227
|
-
frustration_rate_pct: totalAnalyzed > 0 ? Math.round(frustrated / totalAnalyzed * 1000) / 10 : 0
|
|
228
|
-
},
|
|
229
|
-
signal_breakdown: signalBreakdown,
|
|
230
|
-
frustrations,
|
|
231
|
-
source: "emotion_detections"
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
function withFrustrationAnchors(response) {
|
|
235
|
-
if (!Array.isArray(response.frustrations))
|
|
236
|
-
return response;
|
|
237
|
-
const frustrations = response.frustrations.map((item) => {
|
|
238
|
-
const row = asRecord(item);
|
|
239
|
-
if (!row)
|
|
240
|
-
return item;
|
|
241
|
-
const anchor = buildFrustrationAnchor(row);
|
|
242
|
-
return { ...row, anchor };
|
|
243
|
-
});
|
|
244
|
-
return { ...response, frustrations };
|
|
245
|
-
}
|
|
246
|
-
var TOOL_FAILURE_CONTEXT_RADIUS = 2;
|
|
247
|
-
function shellWord(value) {
|
|
248
|
-
return /^[\w@%+=:,./-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
|
|
249
|
-
}
|
|
250
|
-
function trimFailureWindow(value, radius, fallbackCenter) {
|
|
251
|
-
const conv = asRecord(value);
|
|
252
|
-
if (!conv)
|
|
253
|
-
return value ?? null;
|
|
254
|
-
const { coverage: _coverage, context, ...convRest } = conv;
|
|
255
|
-
const ctx = asRecord(context);
|
|
256
|
-
if (!ctx)
|
|
257
|
-
return convRest;
|
|
258
|
-
const center = asNumber(ctx.center_index) ?? fallbackCenter;
|
|
259
|
-
const messages = (Array.isArray(ctx.messages) ? ctx.messages : []).map((message) => asRecord(message)).filter((message) => {
|
|
260
|
-
const index = asNumber(message?.index);
|
|
261
|
-
return message !== null && (center === null || index === null || Math.abs(index - center) <= radius);
|
|
262
|
-
}).map(({ content_blocks, ...message }) => {
|
|
263
|
-
const covered = typeof message.content === "string" && message.content.length > 0 || Array.isArray(message.tool_calls) && message.tool_calls.length > 0 || Array.isArray(message.tool_results) && message.tool_results.length > 0;
|
|
264
|
-
return covered || content_blocks === undefined ? message : { ...message, content_blocks };
|
|
265
|
-
});
|
|
266
|
-
const indexes = messages.map((message) => asNumber(message.index)).filter((index) => index !== null);
|
|
267
|
-
return {
|
|
268
|
-
...convRest,
|
|
269
|
-
context: {
|
|
270
|
-
...ctx,
|
|
271
|
-
...indexes.length > 0 ? { from_index: Math.min(...indexes), to_index: Math.max(...indexes) } : {},
|
|
272
|
-
messages
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
function trimToolFailureConversations(response, opts) {
|
|
277
|
-
if (!Array.isArray(response.examples))
|
|
278
|
-
return response;
|
|
279
|
-
const examples = response.examples.map((item) => {
|
|
280
|
-
const row = asRecord(item);
|
|
281
|
-
if (!row)
|
|
282
|
-
return item;
|
|
283
|
-
const { conversation, window, ...rest } = row;
|
|
284
|
-
const conversationId = asString(row.conversation_id);
|
|
285
|
-
const msgIndex = asNumber(asRecord(row.anchor)?.msg_index) ?? asNumber(row.msg_index);
|
|
286
|
-
return {
|
|
287
|
-
...rest,
|
|
288
|
-
...conversationId && msgIndex !== null ? { context_command: `moda context ${shellWord(contextTarget(conversationId))} --msg-index=${msgIndex} --window=${TOOL_FAILURE_CONTEXT_RADIUS}` } : {},
|
|
289
|
-
...opts.drop ? {} : { conversation: trimFailureWindow(conversation, TOOL_FAILURE_CONTEXT_RADIUS, msgIndex) },
|
|
290
|
-
..."window" in row ? { window: trimFailureWindow(window, opts.windowRadius ?? TOOL_FAILURE_CONTEXT_RADIUS, msgIndex) } : {}
|
|
291
|
-
};
|
|
292
|
-
});
|
|
293
|
-
return { ...response, examples };
|
|
294
|
-
}
|
|
295
|
-
function withToolFailureAnchors(response) {
|
|
296
|
-
if (!Array.isArray(response.examples))
|
|
297
|
-
return response;
|
|
298
|
-
const toolName = asString(response.tool_name) ?? "";
|
|
299
|
-
const examples = response.examples.map((item) => {
|
|
300
|
-
const row = asRecord(item);
|
|
301
|
-
if (!row)
|
|
302
|
-
return item;
|
|
303
|
-
const anchor = buildToolFailureAnchor(row, toolName);
|
|
304
|
-
return { ...row, anchor };
|
|
305
|
-
});
|
|
306
|
-
return { ...response, examples };
|
|
307
|
-
}
|
|
308
|
-
function embeddedWindowSize(conversation) {
|
|
309
|
-
if (!conversation)
|
|
310
|
-
return null;
|
|
311
|
-
const ctx = asRecord(conversation.context);
|
|
312
|
-
if (!ctx)
|
|
313
|
-
return null;
|
|
314
|
-
const center = asNumber(ctx.center_index);
|
|
315
|
-
const from = asNumber(ctx.from_index);
|
|
316
|
-
const to = asNumber(ctx.to_index);
|
|
317
|
-
if (center === null || from === null || to === null)
|
|
318
|
-
return null;
|
|
319
|
-
return Math.min(center - from, to - center);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// src/intelligence-schema.ts
|
|
323
|
-
var INTELLIGENCE_SCHEMA_VERSION = "moda.intelligence.v1";
|
|
324
|
-
var provenanceSchema = { type: "string", enum: ["measured", "inferred"] };
|
|
325
|
-
var mutabilitySchema = {
|
|
326
|
-
type: "string",
|
|
327
|
-
enum: ["read", "write", "sync", "unknown"]
|
|
328
|
-
};
|
|
329
|
-
var confidenceSchema = {
|
|
330
|
-
type: "string",
|
|
331
|
-
enum: ["high", "medium", "low", "unknown"]
|
|
332
|
-
};
|
|
333
|
-
var MODA_INTELLIGENCE_V1_JSON_SCHEMA = {
|
|
334
|
-
$schema: "http://json-schema.org/draft-07/schema#",
|
|
335
|
-
$id: "moda.intelligence.v1",
|
|
336
|
-
title: "Moda Intelligence v1",
|
|
337
|
-
type: "object",
|
|
338
|
-
additionalProperties: false,
|
|
339
|
-
required: [
|
|
340
|
-
"schema_version",
|
|
341
|
-
"generated_at",
|
|
342
|
-
"command",
|
|
343
|
-
"source",
|
|
344
|
-
"degraded",
|
|
345
|
-
"question",
|
|
346
|
-
"summary",
|
|
347
|
-
"answer_markdown",
|
|
348
|
-
"answer_claims",
|
|
349
|
-
"findings",
|
|
350
|
-
"evidence_refs",
|
|
351
|
-
"next_commands",
|
|
352
|
-
"warnings"
|
|
353
|
-
],
|
|
354
|
-
properties: {
|
|
355
|
-
schema_version: { const: "moda.intelligence.v1" },
|
|
356
|
-
generated_at: { type: "string", format: "date-time" },
|
|
357
|
-
command: { type: "string" },
|
|
358
|
-
source: { type: "string", enum: ["cloud", "local_fallback"] },
|
|
359
|
-
degraded: { type: "boolean" },
|
|
360
|
-
question: { type: "string" },
|
|
361
|
-
summary: {
|
|
362
|
-
type: "object",
|
|
363
|
-
additionalProperties: false,
|
|
364
|
-
required: ["text", "confidence"],
|
|
365
|
-
properties: { text: { type: "string" }, confidence: confidenceSchema }
|
|
366
|
-
},
|
|
367
|
-
answer_markdown: { type: "string" },
|
|
368
|
-
answer_claims: {
|
|
369
|
-
type: "array",
|
|
370
|
-
items: {
|
|
371
|
-
type: "object",
|
|
372
|
-
additionalProperties: false,
|
|
373
|
-
required: ["text", "kind", "status", "evidence_ref_ids"],
|
|
374
|
-
properties: {
|
|
375
|
-
text: { type: "string" },
|
|
376
|
-
value: { type: "number" },
|
|
377
|
-
kind: { type: "string", enum: ["percentage", "count", "qualitative"] },
|
|
378
|
-
status: {
|
|
379
|
-
type: "string",
|
|
380
|
-
enum: ["grounded", "ungrounded", "unverifiable"]
|
|
381
|
-
},
|
|
382
|
-
evidence_ref_ids: { type: "array", items: { type: "string" } },
|
|
383
|
-
matched_path: { type: "string" }
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
findings: {
|
|
388
|
-
type: "array",
|
|
389
|
-
items: {
|
|
390
|
-
type: "object",
|
|
391
|
-
additionalProperties: false,
|
|
392
|
-
required: ["id", "title", "evidence_ref_ids", "recommended_actions"],
|
|
393
|
-
properties: {
|
|
394
|
-
id: { type: "string" },
|
|
395
|
-
title: { type: "string" },
|
|
396
|
-
severity: {
|
|
397
|
-
type: "string",
|
|
398
|
-
enum: ["critical", "high", "medium", "low", "info"]
|
|
399
|
-
},
|
|
400
|
-
description: { type: "string" },
|
|
401
|
-
evidence_ref_ids: { type: "array", items: { type: "string" } },
|
|
402
|
-
recommended_actions: {
|
|
403
|
-
type: "array",
|
|
404
|
-
items: {
|
|
405
|
-
type: "object",
|
|
406
|
-
additionalProperties: false,
|
|
407
|
-
required: ["id", "title", "mutability", "requires_approval"],
|
|
408
|
-
properties: {
|
|
409
|
-
id: { type: "string" },
|
|
410
|
-
title: { type: "string" },
|
|
411
|
-
rationale: { type: "string" },
|
|
412
|
-
command: { type: "string" },
|
|
413
|
-
mutability: mutabilitySchema,
|
|
414
|
-
requires_approval: { type: "boolean" }
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
},
|
|
421
|
-
evidence_refs: {
|
|
422
|
-
type: "array",
|
|
423
|
-
items: {
|
|
424
|
-
type: "object",
|
|
425
|
-
additionalProperties: false,
|
|
426
|
-
required: ["id", "kind", "label", "grounding"],
|
|
427
|
-
properties: {
|
|
428
|
-
id: { type: "string" },
|
|
429
|
-
kind: { type: "string" },
|
|
430
|
-
label: { type: "string" },
|
|
431
|
-
anchor: {
|
|
432
|
-
type: "object",
|
|
433
|
-
additionalProperties: false,
|
|
434
|
-
properties: {
|
|
435
|
-
conversation_id: { type: "string" },
|
|
436
|
-
message_index: { type: "number" },
|
|
437
|
-
run_id: { type: "string" },
|
|
438
|
-
tool_name: { type: "string" }
|
|
439
|
-
}
|
|
440
|
-
},
|
|
441
|
-
snippet: { type: "string" },
|
|
442
|
-
grounding: provenanceSchema
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
next_commands: {
|
|
447
|
-
type: "array",
|
|
448
|
-
items: {
|
|
449
|
-
type: "object",
|
|
450
|
-
additionalProperties: false,
|
|
451
|
-
required: ["command", "mutability", "requires_approval"],
|
|
452
|
-
properties: {
|
|
453
|
-
command: { type: "string" },
|
|
454
|
-
purpose: { type: "string" },
|
|
455
|
-
mutability: mutabilitySchema,
|
|
456
|
-
requires_approval: { type: "boolean" }
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
},
|
|
460
|
-
warnings: { type: "array", items: { type: "string" } },
|
|
461
|
-
meta: { type: "object" }
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
export { BATCH_MAX_TARGETS, BATCH_CONCURRENCY, parseBatchTarget, collectBatchTargets, mapWithConcurrency, contextTarget, asRecord, asString, asNumber, frustrationAnchorIndex, frustrationsFromEmotions, withFrustrationAnchors, shellWord, trimToolFailureConversations, withToolFailureAnchors, embeddedWindowSize, INTELLIGENCE_SCHEMA_VERSION, MODA_INTELLIGENCE_V1_JSON_SCHEMA };
|