@moda-ai/cli 1.1.1 → 1.2.0
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/README.md +36 -0
- package/dist/agent.d.ts +5 -0
- package/dist/agent.js +477 -0
- package/dist/analyst-tui.d.ts +81 -0
- package/dist/analyst-tui.js +314 -0
- package/dist/api-client.d.ts +4 -0
- package/dist/api-client.js +20 -3
- package/dist/auth.d.ts +22 -3
- package/dist/auth.js +230 -66
- package/dist/cli.d.ts +20 -3
- package/dist/cli.js +768 -93
- package/dist/command-context.d.ts +34 -0
- package/dist/command-context.js +38 -0
- package/dist/command-registry.d.ts +22 -0
- package/dist/command-registry.js +15 -0
- package/dist/config.d.ts +40 -1
- package/dist/config.js +70 -3
- package/dist/doctor.d.ts +79 -0
- package/dist/doctor.js +1102 -0
- package/dist/errors.d.ts +5 -0
- package/dist/errors.js +9 -0
- package/dist/harness-report.d.ts +138 -0
- package/dist/harness-report.js +1464 -0
- package/dist/harness.d.ts +233 -0
- package/dist/harness.js +3264 -0
- package/dist/init/index.d.ts +30 -1
- package/dist/init/index.js +383 -23
- package/dist/init/rules.d.ts +5 -1
- package/dist/init/rules.js +22 -16
- package/dist/init/sdk-guide.d.ts +3 -0
- package/dist/init/sdk-guide.js +397 -0
- package/dist/init/tenant.js +12 -3
- package/dist/keys.d.ts +47 -0
- package/dist/keys.js +136 -0
- package/dist/output.d.ts +118 -0
- package/dist/output.js +228 -0
- package/dist/production-intelligence.d.ts +134 -0
- package/dist/production-intelligence.js +1113 -0
- package/dist/profile-commands.d.ts +10 -0
- package/dist/profile-commands.js +252 -0
- package/dist/profiles.d.ts +90 -0
- package/dist/profiles.js +432 -0
- package/dist/prompts.d.ts +6 -0
- package/dist/prompts.js +368 -0
- package/dist/schemas.d.ts +4 -4
- package/dist/skills.d.ts +25 -0
- package/dist/skills.js +468 -0
- package/dist/sync.d.ts +5 -0
- package/dist/sync.js +27 -0
- package/dist/telemetry.d.ts +18 -0
- package/dist/telemetry.js +63 -0
- package/dist/tui.d.ts +40 -0
- package/dist/tui.js +387 -0
- package/dist/workspace.d.ts +12 -0
- package/dist/workspace.js +1294 -0
- package/hooks/moda-snapshot.sh +41 -0
- package/package.json +10 -7
- package/skills/moda-cli/SKILL.md +48 -4
- package/skills/integrate-moda/SKILL.md +0 -63
package/dist/output.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export type CliOutputMode = 'human' | 'json' | 'agent' | 'agent-stream';
|
|
2
|
+
export declare const AGENT_SCHEMA_VERSION = "moda.agent.v1";
|
|
3
|
+
export declare const AGENT_EVENT_SCHEMA_VERSION = "moda.agent_event.v1";
|
|
4
|
+
export type AgentStatus = 'ok' | 'error';
|
|
5
|
+
export type AgentConfidence = 'high' | 'medium' | 'low' | 'unknown';
|
|
6
|
+
export interface AgentSummary {
|
|
7
|
+
text: string;
|
|
8
|
+
confidence: AgentConfidence;
|
|
9
|
+
}
|
|
10
|
+
export interface AgentFinding {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
status?: string;
|
|
14
|
+
severity?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
evidence_ref_ids?: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface AgentEvidenceRef {
|
|
19
|
+
id: string;
|
|
20
|
+
kind: string;
|
|
21
|
+
label: string;
|
|
22
|
+
path?: string;
|
|
23
|
+
line?: number;
|
|
24
|
+
status?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface AgentRecommendedAction {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
rationale?: string;
|
|
30
|
+
command?: string;
|
|
31
|
+
mutability: 'read' | 'write' | 'sync' | 'unknown';
|
|
32
|
+
requires_approval: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface AgentNextCommand {
|
|
35
|
+
command: string;
|
|
36
|
+
purpose: string;
|
|
37
|
+
mutability: 'read' | 'write' | 'sync' | 'unknown';
|
|
38
|
+
requires_approval: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface AgentArtifact {
|
|
41
|
+
kind: string;
|
|
42
|
+
path: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface AgentError {
|
|
46
|
+
code: string;
|
|
47
|
+
message: string;
|
|
48
|
+
cause?: string;
|
|
49
|
+
suggested_commands?: string[];
|
|
50
|
+
blocking: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface AgentEnvelope {
|
|
53
|
+
schema_version: typeof AGENT_SCHEMA_VERSION;
|
|
54
|
+
command: string;
|
|
55
|
+
status: AgentStatus;
|
|
56
|
+
generated_at: string;
|
|
57
|
+
profile?: string;
|
|
58
|
+
summary: AgentSummary;
|
|
59
|
+
findings: AgentFinding[];
|
|
60
|
+
evidence_refs: AgentEvidenceRef[];
|
|
61
|
+
recommended_actions: AgentRecommendedAction[];
|
|
62
|
+
next_commands: AgentNextCommand[];
|
|
63
|
+
artifacts: AgentArtifact[];
|
|
64
|
+
warnings: string[];
|
|
65
|
+
errors: AgentError[];
|
|
66
|
+
data: unknown;
|
|
67
|
+
meta?: Record<string, unknown>;
|
|
68
|
+
truncation?: Record<string, unknown>;
|
|
69
|
+
}
|
|
70
|
+
export interface AgentEvent {
|
|
71
|
+
schema_version: typeof AGENT_EVENT_SCHEMA_VERSION;
|
|
72
|
+
event: 'started' | 'progress' | 'artifact' | 'approval_required' | 'completed' | 'error';
|
|
73
|
+
command: string;
|
|
74
|
+
generated_at: string;
|
|
75
|
+
status?: AgentStatus;
|
|
76
|
+
phase?: string;
|
|
77
|
+
message?: string;
|
|
78
|
+
elapsed_ms?: number;
|
|
79
|
+
artifact?: AgentArtifact;
|
|
80
|
+
result?: AgentEnvelope;
|
|
81
|
+
error?: AgentError;
|
|
82
|
+
}
|
|
83
|
+
export interface AgentWriteOptions {
|
|
84
|
+
summary?: string | Partial<AgentSummary>;
|
|
85
|
+
findings?: AgentFinding[];
|
|
86
|
+
evidenceRefs?: AgentEvidenceRef[];
|
|
87
|
+
recommendedActions?: AgentRecommendedAction[];
|
|
88
|
+
nextCommands?: Array<string | AgentNextCommand>;
|
|
89
|
+
artifacts?: AgentArtifact[];
|
|
90
|
+
warnings?: string[];
|
|
91
|
+
errors?: AgentError[];
|
|
92
|
+
}
|
|
93
|
+
export interface CliOutput {
|
|
94
|
+
mode: CliOutputMode;
|
|
95
|
+
quiet: boolean;
|
|
96
|
+
writeData(data: unknown, options?: {
|
|
97
|
+
status?: 'success' | 'error';
|
|
98
|
+
meta?: Record<string, unknown>;
|
|
99
|
+
} & AgentWriteOptions): void;
|
|
100
|
+
writeEvent(event: Omit<AgentEvent, 'schema_version' | 'command' | 'generated_at'>): void;
|
|
101
|
+
}
|
|
102
|
+
export declare function outputModeFromFlags(flags: Record<string, string>): CliOutputMode;
|
|
103
|
+
export declare function createCliOutput(options: {
|
|
104
|
+
command: string;
|
|
105
|
+
mode: CliOutputMode;
|
|
106
|
+
quiet?: boolean;
|
|
107
|
+
}): CliOutput;
|
|
108
|
+
export declare function createAgentEnvelope(options: {
|
|
109
|
+
command: string;
|
|
110
|
+
status: AgentStatus;
|
|
111
|
+
data: unknown;
|
|
112
|
+
profile?: string;
|
|
113
|
+
meta?: Record<string, unknown>;
|
|
114
|
+
} & AgentWriteOptions): AgentEnvelope;
|
|
115
|
+
export declare function createAgentErrorEnvelope(command: string, error: AgentError): AgentEnvelope;
|
|
116
|
+
export declare function createAgentEvent(command: string, event: Omit<AgentEvent, 'schema_version' | 'command' | 'generated_at'>): AgentEvent;
|
|
117
|
+
export declare function errorToAgentError(error: unknown): AgentError;
|
|
118
|
+
//# sourceMappingURL=output.d.ts.map
|
package/dist/output.js
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
export const AGENT_SCHEMA_VERSION = 'moda.agent.v1';
|
|
2
|
+
export const AGENT_EVENT_SCHEMA_VERSION = 'moda.agent_event.v1';
|
|
3
|
+
export function outputModeFromFlags(flags) {
|
|
4
|
+
if (flags.agent === 'true' && (flags.stream === 'true' || flags.format === 'ndjson'))
|
|
5
|
+
return 'agent-stream';
|
|
6
|
+
if (flags.agent === 'true')
|
|
7
|
+
return 'agent';
|
|
8
|
+
if (flags.json === 'true')
|
|
9
|
+
return 'json';
|
|
10
|
+
return 'human';
|
|
11
|
+
}
|
|
12
|
+
export function createCliOutput(options) {
|
|
13
|
+
return {
|
|
14
|
+
mode: options.mode,
|
|
15
|
+
quiet: options.quiet === true,
|
|
16
|
+
writeData(data, writeOptions = {}) {
|
|
17
|
+
if (options.quiet)
|
|
18
|
+
return;
|
|
19
|
+
if (options.mode === 'agent' || options.mode === 'agent-stream') {
|
|
20
|
+
const envelope = createAgentEnvelope({
|
|
21
|
+
command: options.command,
|
|
22
|
+
status: writeOptions.status === 'error' ? 'error' : 'ok',
|
|
23
|
+
data,
|
|
24
|
+
meta: writeOptions.meta,
|
|
25
|
+
summary: writeOptions.summary,
|
|
26
|
+
findings: writeOptions.findings,
|
|
27
|
+
evidenceRefs: writeOptions.evidenceRefs,
|
|
28
|
+
recommendedActions: writeOptions.recommendedActions,
|
|
29
|
+
nextCommands: writeOptions.nextCommands,
|
|
30
|
+
artifacts: writeOptions.artifacts,
|
|
31
|
+
warnings: writeOptions.warnings,
|
|
32
|
+
errors: writeOptions.errors,
|
|
33
|
+
});
|
|
34
|
+
if (options.mode === 'agent-stream') {
|
|
35
|
+
console.log(JSON.stringify(createAgentEvent(options.command, {
|
|
36
|
+
event: envelope.status === 'error' ? 'error' : 'completed',
|
|
37
|
+
status: envelope.status,
|
|
38
|
+
result: envelope,
|
|
39
|
+
})));
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
console.log(JSON.stringify(envelope));
|
|
43
|
+
}
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
console.log(JSON.stringify(data, null, 2));
|
|
47
|
+
},
|
|
48
|
+
writeEvent(event) {
|
|
49
|
+
if (options.quiet)
|
|
50
|
+
return;
|
|
51
|
+
if (options.mode !== 'agent-stream')
|
|
52
|
+
return;
|
|
53
|
+
console.log(JSON.stringify(createAgentEvent(options.command, event)));
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export function createAgentEnvelope(options) {
|
|
58
|
+
const bounded = boundForAgent(options.data);
|
|
59
|
+
return {
|
|
60
|
+
schema_version: AGENT_SCHEMA_VERSION,
|
|
61
|
+
command: options.command,
|
|
62
|
+
status: options.status,
|
|
63
|
+
generated_at: new Date().toISOString(),
|
|
64
|
+
...(options.profile ? { profile: options.profile } : {}),
|
|
65
|
+
summary: normalizeSummary(options.summary, options.command, options.status, options.data),
|
|
66
|
+
findings: options.findings ?? [],
|
|
67
|
+
evidence_refs: options.evidenceRefs ?? [],
|
|
68
|
+
recommended_actions: options.recommendedActions ?? [],
|
|
69
|
+
next_commands: normalizeNextCommands(options.nextCommands ?? []),
|
|
70
|
+
artifacts: options.artifacts ?? [],
|
|
71
|
+
warnings: options.warnings ?? inferWarnings(options.data),
|
|
72
|
+
errors: options.errors ?? [],
|
|
73
|
+
data: bounded.data,
|
|
74
|
+
...(options.meta ? { meta: options.meta } : {}),
|
|
75
|
+
...(bounded.truncation ? { truncation: bounded.truncation } : {}),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export function createAgentErrorEnvelope(command, error) {
|
|
79
|
+
return createAgentEnvelope({
|
|
80
|
+
command,
|
|
81
|
+
status: 'error',
|
|
82
|
+
data: null,
|
|
83
|
+
summary: {
|
|
84
|
+
text: error.message,
|
|
85
|
+
confidence: 'high',
|
|
86
|
+
},
|
|
87
|
+
errors: [error],
|
|
88
|
+
nextCommands: (error.suggested_commands ?? []).map((commandText) => ({
|
|
89
|
+
command: commandText,
|
|
90
|
+
purpose: 'Suggested recovery command.',
|
|
91
|
+
mutability: commandText.includes(' sync') || commandText.startsWith('moda sync') ? 'sync' : 'read',
|
|
92
|
+
requires_approval: commandText.includes(' --yes') || commandText.includes(' sync'),
|
|
93
|
+
})),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
export function createAgentEvent(command, event) {
|
|
97
|
+
return {
|
|
98
|
+
schema_version: AGENT_EVENT_SCHEMA_VERSION,
|
|
99
|
+
command,
|
|
100
|
+
generated_at: new Date().toISOString(),
|
|
101
|
+
...event,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export function errorToAgentError(error) {
|
|
105
|
+
if (error instanceof Error) {
|
|
106
|
+
return {
|
|
107
|
+
code: error.name === 'CliInputError' ? 'input_error' : 'command_error',
|
|
108
|
+
message: error.message,
|
|
109
|
+
cause: 'usage' in error && typeof error.usage === 'string' ? error.usage : undefined,
|
|
110
|
+
suggested_commands: 'usage' in error && typeof error.usage === 'string'
|
|
111
|
+
? extractSuggestedCommands(error.usage)
|
|
112
|
+
: undefined,
|
|
113
|
+
blocking: true,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
code: 'unknown_error',
|
|
118
|
+
message: String(error),
|
|
119
|
+
blocking: true,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function normalizeSummary(summary, command, status, data) {
|
|
123
|
+
if (typeof summary === 'string') {
|
|
124
|
+
return { text: summary, confidence: 'high' };
|
|
125
|
+
}
|
|
126
|
+
if (summary?.text) {
|
|
127
|
+
return {
|
|
128
|
+
text: summary.text,
|
|
129
|
+
confidence: summary.confidence ?? 'high',
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
return inferSummary(command, status, data);
|
|
133
|
+
}
|
|
134
|
+
function inferSummary(command, status, data) {
|
|
135
|
+
const record = asRecord(data);
|
|
136
|
+
if (status === 'error') {
|
|
137
|
+
return { text: `${command} failed.`, confidence: 'high' };
|
|
138
|
+
}
|
|
139
|
+
const summary = asRecord(record?.summary);
|
|
140
|
+
if (summary) {
|
|
141
|
+
const statusValue = typeof summary.status === 'string' ? summary.status : undefined;
|
|
142
|
+
const fail = typeof summary.fail === 'number' ? summary.fail : undefined;
|
|
143
|
+
const warning = typeof summary.warning === 'number' ? summary.warning : undefined;
|
|
144
|
+
if (statusValue && fail !== undefined && warning !== undefined) {
|
|
145
|
+
return {
|
|
146
|
+
text: `${command} completed with status ${statusValue}: ${fail} failing checks and ${warning} warnings.`,
|
|
147
|
+
confidence: 'high',
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const runtimeAgentCount = typeof summary.runtimeAgentCount === 'number'
|
|
151
|
+
? summary.runtimeAgentCount
|
|
152
|
+
: undefined;
|
|
153
|
+
if (runtimeAgentCount !== undefined) {
|
|
154
|
+
return {
|
|
155
|
+
text: `${command} completed. Harness summary includes ${runtimeAgentCount} runtime agent(s).`,
|
|
156
|
+
confidence: 'high',
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (typeof record?.status === 'string') {
|
|
161
|
+
return { text: `${command} completed with status ${record.status}.`, confidence: 'high' };
|
|
162
|
+
}
|
|
163
|
+
return { text: `${command} completed.`, confidence: 'medium' };
|
|
164
|
+
}
|
|
165
|
+
function normalizeNextCommands(commands) {
|
|
166
|
+
return commands.map((command) => {
|
|
167
|
+
if (typeof command !== 'string')
|
|
168
|
+
return command;
|
|
169
|
+
return {
|
|
170
|
+
command,
|
|
171
|
+
purpose: 'Suggested next Moda command.',
|
|
172
|
+
mutability: inferMutability(command),
|
|
173
|
+
requires_approval: command.includes(' --yes') || command.includes(' sync'),
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function inferMutability(command) {
|
|
178
|
+
if (/\b(sync|approve|init|install|pull|gen|remove|promote)\b/.test(command)) {
|
|
179
|
+
if (/\bsync\b/.test(command))
|
|
180
|
+
return 'sync';
|
|
181
|
+
return 'write';
|
|
182
|
+
}
|
|
183
|
+
return 'read';
|
|
184
|
+
}
|
|
185
|
+
function inferWarnings(data) {
|
|
186
|
+
const record = asRecord(data);
|
|
187
|
+
const direct = record?.warnings;
|
|
188
|
+
if (Array.isArray(direct))
|
|
189
|
+
return direct.filter((item) => typeof item === 'string');
|
|
190
|
+
const validation = asRecord(record?.validation);
|
|
191
|
+
if (Array.isArray(validation?.warnings)) {
|
|
192
|
+
return validation.warnings.filter((item) => typeof item === 'string');
|
|
193
|
+
}
|
|
194
|
+
return [];
|
|
195
|
+
}
|
|
196
|
+
function boundForAgent(data) {
|
|
197
|
+
const maxBytes = Number(process.env.MODA_AGENT_MAX_OUTPUT_BYTES ?? 200_000);
|
|
198
|
+
const serialized = JSON.stringify(data);
|
|
199
|
+
const bytes = Buffer.byteLength(serialized, 'utf8');
|
|
200
|
+
if (bytes <= maxBytes)
|
|
201
|
+
return { data };
|
|
202
|
+
const preview = serialized.slice(0, Math.max(0, maxBytes - 256));
|
|
203
|
+
return {
|
|
204
|
+
data: {
|
|
205
|
+
truncated: true,
|
|
206
|
+
original_bytes: bytes,
|
|
207
|
+
max_bytes: maxBytes,
|
|
208
|
+
preview,
|
|
209
|
+
},
|
|
210
|
+
truncation: {
|
|
211
|
+
data: {
|
|
212
|
+
original_bytes: bytes,
|
|
213
|
+
max_bytes: maxBytes,
|
|
214
|
+
reason: 'agent_output_byte_limit',
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function asRecord(value) {
|
|
220
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
221
|
+
? value
|
|
222
|
+
: undefined;
|
|
223
|
+
}
|
|
224
|
+
function extractSuggestedCommands(text) {
|
|
225
|
+
const commands = [...text.matchAll(/`(moda [^`]+)`/g)].map((match) => match[1]);
|
|
226
|
+
return commands.length > 0 ? commands : undefined;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { CommandContext } from './command-context.js';
|
|
2
|
+
import type { AgentConfidence } from './output.js';
|
|
3
|
+
declare const INVESTIGATION_SCHEMA_VERSION = "production_investigation.v0.1";
|
|
4
|
+
declare const OVERVIEW_SCHEMA_VERSION = "production_overview.v0.1";
|
|
5
|
+
declare const ASK_SCHEMA_VERSION = "production_ask.v0.1";
|
|
6
|
+
type Severity = 'critical' | 'high' | 'medium' | 'low' | 'info';
|
|
7
|
+
type FindingKind = 'tool_failure' | 'loop' | 'frustration' | 'partial_run' | 'prompt_regression' | 'skill_gap' | 'insufficient_data';
|
|
8
|
+
export interface ProductionEvidenceRef {
|
|
9
|
+
id: string;
|
|
10
|
+
kind: 'data_api' | 'tool_failure' | 'frustration' | 'loop' | 'run' | 'harness' | 'ask';
|
|
11
|
+
label: string;
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
conversationId?: string;
|
|
14
|
+
runId?: string;
|
|
15
|
+
detectionId?: string;
|
|
16
|
+
toolName?: string;
|
|
17
|
+
path?: string;
|
|
18
|
+
line?: number;
|
|
19
|
+
value?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface LikelyLocation {
|
|
22
|
+
kind: 'tool' | 'prompt' | 'skill' | 'entrypoint' | 'harness' | 'unknown';
|
|
23
|
+
path?: string;
|
|
24
|
+
label: string;
|
|
25
|
+
confidence: AgentConfidence;
|
|
26
|
+
reason: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ProductionAction {
|
|
29
|
+
id: string;
|
|
30
|
+
title: string;
|
|
31
|
+
rationale: string;
|
|
32
|
+
command: string;
|
|
33
|
+
mutability: 'read' | 'write' | 'sync' | 'unknown';
|
|
34
|
+
requiresApproval: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface ProductionFinding {
|
|
37
|
+
id: string;
|
|
38
|
+
kind: FindingKind;
|
|
39
|
+
title: string;
|
|
40
|
+
severity: Severity;
|
|
41
|
+
confidence: AgentConfidence;
|
|
42
|
+
impactScore: number;
|
|
43
|
+
rankReason: string;
|
|
44
|
+
summary: string;
|
|
45
|
+
evidenceRefIds: string[];
|
|
46
|
+
likelyLocations: LikelyLocation[];
|
|
47
|
+
recommendedActions: ProductionAction[];
|
|
48
|
+
}
|
|
49
|
+
export interface ProductionInvestigation {
|
|
50
|
+
schemaVersion: typeof INVESTIGATION_SCHEMA_VERSION;
|
|
51
|
+
generatedAt: string;
|
|
52
|
+
daysBack: number;
|
|
53
|
+
scope: {
|
|
54
|
+
runId?: string;
|
|
55
|
+
conversationId?: string;
|
|
56
|
+
toolName?: string;
|
|
57
|
+
loopId?: string;
|
|
58
|
+
question?: string;
|
|
59
|
+
};
|
|
60
|
+
summary: {
|
|
61
|
+
text: string;
|
|
62
|
+
confidence: AgentConfidence;
|
|
63
|
+
};
|
|
64
|
+
findings: ProductionFinding[];
|
|
65
|
+
evidenceRefs: ProductionEvidenceRef[];
|
|
66
|
+
nextCommands: string[];
|
|
67
|
+
warnings: string[];
|
|
68
|
+
sourceStatus: Record<string, 'ok' | 'unavailable'>;
|
|
69
|
+
}
|
|
70
|
+
export interface ProductionOverviewBriefing {
|
|
71
|
+
schemaVersion: typeof OVERVIEW_SCHEMA_VERSION;
|
|
72
|
+
generatedAt: string;
|
|
73
|
+
daysBack: number;
|
|
74
|
+
status: 'healthy' | 'attention' | 'quiet' | 'unknown';
|
|
75
|
+
dataFlow: {
|
|
76
|
+
status: 'flowing' | 'quiet' | 'unknown';
|
|
77
|
+
conversations: number;
|
|
78
|
+
lastEvent?: {
|
|
79
|
+
summary: string;
|
|
80
|
+
timestamp?: string;
|
|
81
|
+
conversationId?: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
harnessSync: SyncBrief;
|
|
85
|
+
promptSync: SyncBrief;
|
|
86
|
+
skillSync: SyncBrief;
|
|
87
|
+
metrics: Record<string, unknown>;
|
|
88
|
+
topFinding: ProductionFinding | null;
|
|
89
|
+
evidenceRefs: ProductionEvidenceRef[];
|
|
90
|
+
nextCommand: string;
|
|
91
|
+
rawOverview: unknown;
|
|
92
|
+
}
|
|
93
|
+
interface SyncBrief {
|
|
94
|
+
status: 'synced' | 'present' | 'missing' | 'unknown';
|
|
95
|
+
summary: string;
|
|
96
|
+
path?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface ProductionAskResult {
|
|
99
|
+
schemaVersion: typeof ASK_SCHEMA_VERSION;
|
|
100
|
+
generatedAt: string;
|
|
101
|
+
source: 'cloud' | 'local_fallback';
|
|
102
|
+
question: string;
|
|
103
|
+
answer: string;
|
|
104
|
+
confidence: AgentConfidence;
|
|
105
|
+
evidenceRefs: ProductionEvidenceRef[];
|
|
106
|
+
findings: ProductionFinding[];
|
|
107
|
+
nextCommands: string[];
|
|
108
|
+
warnings: string[];
|
|
109
|
+
}
|
|
110
|
+
export declare function runProductionCommand(context: CommandContext): Promise<{
|
|
111
|
+
exitCode: number;
|
|
112
|
+
}>;
|
|
113
|
+
export declare function loadOverviewBriefing(options: {
|
|
114
|
+
daysBack: number;
|
|
115
|
+
cwd: string;
|
|
116
|
+
}): Promise<ProductionOverviewBriefing>;
|
|
117
|
+
export declare function investigateProduction(options: {
|
|
118
|
+
daysBack: number;
|
|
119
|
+
cwd: string;
|
|
120
|
+
runId?: string;
|
|
121
|
+
conversationId?: string;
|
|
122
|
+
toolName?: string;
|
|
123
|
+
loopId?: string;
|
|
124
|
+
question?: string;
|
|
125
|
+
failureOnly?: boolean;
|
|
126
|
+
}): Promise<ProductionInvestigation>;
|
|
127
|
+
export declare function askModa(options: {
|
|
128
|
+
question: string;
|
|
129
|
+
daysBack: number;
|
|
130
|
+
cwd: string;
|
|
131
|
+
profile?: string;
|
|
132
|
+
}): Promise<ProductionAskResult>;
|
|
133
|
+
export {};
|
|
134
|
+
//# sourceMappingURL=production-intelligence.d.ts.map
|