@moda-ai/cli 1.22.1 → 1.23.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.
Files changed (118) hide show
  1. package/dist/cli-c4se7a5d.js +762 -0
  2. package/dist/cli-mnqa4rp6.js +1563 -0
  3. package/dist/cli-stmjdgvy.js +2842 -0
  4. package/dist/cli-y55bgg14.js +6980 -0
  5. package/dist/cli-ysegdrm5.js +286 -0
  6. package/dist/cli.js +4779 -1159
  7. package/dist/harness-github-actions-7t3cncnt.js +95 -0
  8. package/dist/index-4ser01zr.js +2769 -0
  9. package/dist/provision-hm1ppwj6.js +74 -0
  10. package/package.json +3 -2
  11. package/skills/integration/index.json +2 -2
  12. package/dist/agent-schemas.d.ts +0 -3
  13. package/dist/agent-schemas.js +0 -358
  14. package/dist/agent.d.ts +0 -5
  15. package/dist/agent.js +0 -477
  16. package/dist/analyst-tui.d.ts +0 -81
  17. package/dist/analyst-tui.js +0 -314
  18. package/dist/api-client.d.ts +0 -46
  19. package/dist/api-client.js +0 -120
  20. package/dist/ask-stream.d.ts +0 -146
  21. package/dist/ask-stream.js +0 -473
  22. package/dist/auth-storage.d.ts +0 -35
  23. package/dist/auth-storage.js +0 -159
  24. package/dist/auth.d.ts +0 -50
  25. package/dist/auth.js +0 -694
  26. package/dist/cli-session.d.ts +0 -26
  27. package/dist/cli-session.js +0 -169
  28. package/dist/cli.d.ts +0 -44
  29. package/dist/command-context.d.ts +0 -62
  30. package/dist/command-context.js +0 -57
  31. package/dist/command-registry.d.ts +0 -22
  32. package/dist/command-registry.js +0 -15
  33. package/dist/config.d.ts +0 -60
  34. package/dist/config.js +0 -110
  35. package/dist/doctor.d.ts +0 -79
  36. package/dist/doctor.js +0 -1182
  37. package/dist/errors.d.ts +0 -50
  38. package/dist/errors.js +0 -64
  39. package/dist/exit-funnel.d.ts +0 -14
  40. package/dist/exit-funnel.js +0 -53
  41. package/dist/harness-artifact-bodies.d.ts +0 -28
  42. package/dist/harness-artifact-bodies.js +0 -276
  43. package/dist/harness-candidates.d.ts +0 -77
  44. package/dist/harness-candidates.js +0 -482
  45. package/dist/harness-remote.d.ts +0 -135
  46. package/dist/harness-remote.js +0 -540
  47. package/dist/harness-report.d.ts +0 -145
  48. package/dist/harness-report.js +0 -1579
  49. package/dist/harness-sync-limits.d.ts +0 -8
  50. package/dist/harness-sync-limits.js +0 -21
  51. package/dist/harness.d.ts +0 -463
  52. package/dist/harness.js +0 -4009
  53. package/dist/init/index.d.ts +0 -78
  54. package/dist/init/index.js +0 -1442
  55. package/dist/init/mcp.d.ts +0 -2
  56. package/dist/init/mcp.js +0 -27
  57. package/dist/init/progress-board.d.ts +0 -80
  58. package/dist/init/progress-board.js +0 -225
  59. package/dist/init/rules.d.ts +0 -6
  60. package/dist/init/rules.js +0 -171
  61. package/dist/init/sdk-catalog.d.ts +0 -10
  62. package/dist/init/sdk-catalog.js +0 -80
  63. package/dist/init/sdk-guide.d.ts +0 -19
  64. package/dist/init/sdk-guide.js +0 -185
  65. package/dist/init/sdk-integration.d.ts +0 -53
  66. package/dist/init/sdk-integration.js +0 -835
  67. package/dist/init/sdk-protocol.d.ts +0 -135
  68. package/dist/init/sdk-protocol.js +0 -152
  69. package/dist/init/sdk-verification.d.ts +0 -27
  70. package/dist/init/sdk-verification.js +0 -123
  71. package/dist/init/tenant.d.ts +0 -67
  72. package/dist/init/tenant.js +0 -421
  73. package/dist/intelligence-schema.d.ts +0 -349
  74. package/dist/intelligence-schema.js +0 -174
  75. package/dist/keys.d.ts +0 -47
  76. package/dist/keys.js +0 -136
  77. package/dist/manifest.d.ts +0 -5
  78. package/dist/manifest.js +0 -114
  79. package/dist/markdown-terminal.d.ts +0 -49
  80. package/dist/markdown-terminal.js +0 -212
  81. package/dist/output.d.ts +0 -191
  82. package/dist/output.js +0 -624
  83. package/dist/production-intelligence.d.ts +0 -175
  84. package/dist/production-intelligence.js +0 -1430
  85. package/dist/profile-commands.d.ts +0 -10
  86. package/dist/profile-commands.js +0 -342
  87. package/dist/profiles.d.ts +0 -112
  88. package/dist/profiles.js +0 -573
  89. package/dist/prompts-ab.d.ts +0 -71
  90. package/dist/prompts-ab.js +0 -313
  91. package/dist/prompts-propose.d.ts +0 -15
  92. package/dist/prompts-propose.js +0 -212
  93. package/dist/prompts.d.ts +0 -58
  94. package/dist/prompts.js +0 -418
  95. package/dist/provision.d.ts +0 -28
  96. package/dist/provision.js +0 -104
  97. package/dist/redact.d.ts +0 -2
  98. package/dist/redact.js +0 -90
  99. package/dist/schemas.d.ts +0 -225
  100. package/dist/schemas.js +0 -126
  101. package/dist/skills-bundled.d.ts +0 -35
  102. package/dist/skills-bundled.js +0 -157
  103. package/dist/skills-manifest.d.ts +0 -33
  104. package/dist/skills-manifest.js +0 -244
  105. package/dist/skills.d.ts +0 -57
  106. package/dist/skills.js +0 -783
  107. package/dist/sync.d.ts +0 -5
  108. package/dist/sync.js +0 -36
  109. package/dist/telemetry.d.ts +0 -56
  110. package/dist/telemetry.js +0 -167
  111. package/dist/transforms.d.ts +0 -25
  112. package/dist/transforms.js +0 -102
  113. package/dist/tui.d.ts +0 -48
  114. package/dist/tui.js +0 -393
  115. package/dist/update-check.d.ts +0 -31
  116. package/dist/update-check.js +0 -141
  117. package/dist/workspace.d.ts +0 -12
  118. package/dist/workspace.js +0 -1294
package/dist/output.d.ts DELETED
@@ -1,191 +0,0 @@
1
- import { type AgentAuthRequest, type AgentInputRequest } from './errors.js';
2
- export type CliOutputMode = 'human' | 'json' | 'agent' | 'agent-stream';
3
- export declare const AGENT_SCHEMA_VERSION = "moda.agent.v1";
4
- export declare const AGENT_EVENT_SCHEMA_VERSION = "moda.agent_event.v1";
5
- /**
6
- * One-line feedback nudge stamped into every non-feedback success envelope's
7
- * `meta.tip` (agents are the CLI's most common callers, and the envelope is
8
- * where they actually look). Deliberately conditional wording so agents flag
9
- * genuine observations instead of habitually running the command. The
10
- * human-TTY twin is printed on stderr by the dispatcher in cli.ts.
11
- */
12
- export declare const FEEDBACK_TIP = "Help us improve! If a result in this response looks wrong or is missing data, flag it: moda feedback \"<describe what looked wrong>\" [--category=...] [--conversation-id=... | --cluster-id=... | --tool-name=...]. Only submit genuine observations.";
13
- /**
14
- * Stable process exit codes that an external agent can branch on:
15
- * 0 ok — grounded answer from Moda Cloud intelligence.
16
- * 3 degraded — answer produced from a local/degraded fallback (lower trust).
17
- * 1 error — command/input/unexpected failure (see envelope `errors[]`).
18
- * 4 auth — login or token renewal required before retrying.
19
- * 5 input — non-interactive caller must choose and re-invoke.
20
- * 130 cancel — interrupted or the output consumer closed the pipe.
21
- * `EXIT_DEGRADED` is intentionally distinct so a caller can tell a degraded
22
- * answer apart from both success and hard failure without parsing the payload.
23
- */
24
- export declare const EXIT_OK = 0;
25
- export declare const EXIT_ERROR = 1;
26
- export declare const EXIT_DEGRADED = 3;
27
- export declare const EXIT_AUTH_REQUIRED = 4;
28
- export declare const EXIT_INPUT_REQUIRED = 5;
29
- export declare const EXIT_CANCELLED = 130;
30
- export declare const AGENT_ERROR_CODES: readonly ["input_error", "api_error", "network_error", "auth_required", "input_required", "cancelled", "command_error", "access_denied", "unknown_error", "cloud_unavailable"];
31
- export type AgentErrorCode = typeof AGENT_ERROR_CODES[number];
32
- export type AgentStatus = 'ok' | 'degraded' | 'error';
33
- export type AgentConfidence = 'high' | 'medium' | 'low' | 'unknown';
34
- export interface AgentSummary {
35
- text: string;
36
- confidence: AgentConfidence;
37
- }
38
- export interface AgentFinding {
39
- id: string;
40
- title: string;
41
- status?: string;
42
- severity?: string;
43
- description?: string;
44
- evidence_ref_ids?: string[];
45
- }
46
- export interface AgentEvidenceRef {
47
- id: string;
48
- kind: string;
49
- label: string;
50
- path?: string;
51
- line?: number;
52
- status?: string;
53
- /** Root-relative dashboard deep-link (prefix the Moda base URL to open). */
54
- href?: string;
55
- }
56
- export interface AgentRecommendedAction {
57
- id: string;
58
- title: string;
59
- rationale?: string;
60
- command?: string;
61
- mutability: 'read' | 'write' | 'sync' | 'unknown';
62
- requires_approval: boolean;
63
- }
64
- export interface AgentNextCommand {
65
- command: string;
66
- purpose: string;
67
- mutability: 'read' | 'write' | 'sync' | 'unknown';
68
- requires_approval: boolean;
69
- }
70
- export interface AgentArtifact {
71
- kind: string;
72
- path: string;
73
- description?: string;
74
- }
75
- export interface AgentError {
76
- code: AgentErrorCode | string;
77
- message: string;
78
- cause?: string;
79
- suggested_commands?: string[];
80
- input_request?: AgentInputRequest;
81
- auth?: AgentAuthRequest;
82
- blocking: boolean;
83
- }
84
- export interface AgentEnvelope {
85
- schema_version: typeof AGENT_SCHEMA_VERSION;
86
- command: string;
87
- status: AgentStatus;
88
- generated_at: string;
89
- profile?: string;
90
- summary: AgentSummary;
91
- findings: AgentFinding[];
92
- evidence_refs: AgentEvidenceRef[];
93
- recommended_actions: AgentRecommendedAction[];
94
- next_commands: AgentNextCommand[];
95
- artifacts: AgentArtifact[];
96
- warnings: string[];
97
- errors: AgentError[];
98
- data: unknown;
99
- meta?: Record<string, unknown>;
100
- truncation?: Record<string, unknown>;
101
- }
102
- export interface AgentEvent {
103
- schema_version: typeof AGENT_EVENT_SCHEMA_VERSION;
104
- event: 'started' | 'progress' | 'artifact' | 'approval_required' | 'completed' | 'error' | 'heartbeat' | 'needs_input' | 'auth_required' | 'cancelled' | 'warning';
105
- command: string;
106
- generated_at: string;
107
- run_id?: string;
108
- seq?: number;
109
- event_version?: number;
110
- status?: AgentStatus;
111
- phase?: string;
112
- message?: string;
113
- elapsed_ms?: number;
114
- artifact?: AgentArtifact;
115
- result?: AgentEnvelope;
116
- error?: AgentError;
117
- input_request?: AgentInputRequest;
118
- auth?: AgentAuthRequest;
119
- }
120
- export interface AgentWriteOptions {
121
- summary?: string | Partial<AgentSummary>;
122
- findings?: AgentFinding[];
123
- evidenceRefs?: AgentEvidenceRef[];
124
- recommendedActions?: AgentRecommendedAction[];
125
- nextCommands?: Array<string | AgentNextCommand>;
126
- artifacts?: AgentArtifact[];
127
- warnings?: string[];
128
- errors?: AgentError[];
129
- }
130
- export interface CliOutput {
131
- mode: CliOutputMode;
132
- quiet: boolean;
133
- writeData(data: unknown, options?: {
134
- status?: 'success' | 'degraded' | 'error';
135
- meta?: Record<string, unknown>;
136
- } & AgentWriteOptions): void;
137
- writeEvent(event: Omit<AgentEvent, 'schema_version' | 'command' | 'generated_at'>): void;
138
- writeError(error: unknown): void;
139
- writeCancelled(reason?: string): void;
140
- hasTerminalOutput(): boolean;
141
- close(): void;
142
- }
143
- interface OutputRunState {
144
- runId: string;
145
- seq: number;
146
- started: boolean;
147
- terminal: boolean;
148
- startedAt: number;
149
- lastEventAt: number;
150
- heartbeat?: NodeJS.Timeout;
151
- }
152
- /**
153
- * True once an EPIPE from a closed stdout/stderr consumer has been observed.
154
- * The stream error listeners above own this state; expose it so callers can
155
- * detect consumer-cancelled runs explicitly instead of sniffing the global
156
- * `process.exitCode`.
157
- */
158
- export declare function wasOutputCancelled(): boolean;
159
- export declare function safeWriteStdout(text: string): boolean;
160
- export declare function safeWriteStderr(text: string): boolean;
161
- /** Flag-only resolution (default human). Kept for callers that only have flags. */
162
- export declare function outputModeFromFlags(flags: Record<string, string>): CliOutputMode;
163
- /**
164
- * Resolve the effective output mode for a real CLI invocation, in priority
165
- * order: explicit flags -> `MODA_FORMAT` -> agent-environment detection ->
166
- * TTY detection (piped/redirected => agent JSON) -> human prose. This is what
167
- * makes the CLI agent-safe: a piped/automated caller gets structured output
168
- * with zero flags, while a human at a terminal still gets prose.
169
- */
170
- export declare function resolveOutputMode(flags: Record<string, string>, opts?: {
171
- isTTY?: boolean;
172
- env?: NodeJS.ProcessEnv;
173
- }): CliOutputMode;
174
- export declare function createCliOutput(options: {
175
- command: string;
176
- mode: CliOutputMode;
177
- quiet?: boolean;
178
- runId?: string;
179
- }): CliOutput;
180
- export declare function createAgentEnvelope(options: {
181
- command: string;
182
- status: AgentStatus;
183
- data: unknown;
184
- profile?: string;
185
- meta?: Record<string, unknown>;
186
- } & AgentWriteOptions): AgentEnvelope;
187
- export declare function createAgentErrorEnvelope(command: string, error: AgentError, runId?: string): AgentEnvelope;
188
- export declare function createAgentEvent(command: string, event: Omit<AgentEvent, 'schema_version' | 'command' | 'generated_at' | 'run_id' | 'seq'>, state?: OutputRunState): AgentEvent;
189
- export declare function errorToAgentError(error: unknown): AgentError;
190
- export {};
191
- //# sourceMappingURL=output.d.ts.map