@moda-ai/cli 1.2.0 → 1.3.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/dist/cli.js CHANGED
@@ -5,7 +5,9 @@ import { callDataAPI, ApiError, getApiRequestCount, resetApiRequestCount, } from
5
5
  import { OverviewSchema, ClustersSchema, ClusterConversationsSchema, ConversationsSchema, ContextSchema, FrustrationsSchema, ToolFailuresSchema, ToolFailureDetailSchema, WorkflowsSchema, RunsSchema, RunDetailSchema, LoopsSchema, LoopDetailSchema, } from './schemas.js';
6
6
  import { withFrustrationAnchors, withToolFailureAnchors, embeddedWindowSize, asRecord, asString, asNumber } from './transforms.js';
7
7
  import { runPromptsCommand } from './prompts.js';
8
- import { runHooksInstall, runSparkCommand, runWorkspaceCommand } from './workspace.js';
8
+ // Coding-agent capture (shadow workspace / Shadow Spark / trace hooks) is temporarily
9
+ // disabled while the feature is finished — see the commented-out command registrations below.
10
+ // import { runHooksInstall, runSparkCommand, runWorkspaceCommand } from './workspace.js';
9
11
  import { runSkillsCommand } from './skills.js';
10
12
  import { runHarnessCommand } from './harness.js';
11
13
  import { runSyncCommand } from './sync.js';
@@ -154,25 +156,6 @@ Commands:
154
156
  prompts sync --watch Upload again when prompt files change
155
157
  prompts promote <key> Move a dev/staging/prod label
156
158
 
157
- Shadow workspace:
158
- spark status Show Shadow Spark workspace state
159
- spark explain Explain what Shadow Spark captures and posts
160
- spark snapshot Manual / hook-invoked Shadow Spark snapshot
161
- spark snapshot --dry-run Show file inventory without copy/commit/post
162
- spark log Show Shadow Spark history
163
- spark bundle Bundle a shadow commit range for replay
164
- spark remove --yes Delete this repo's local shadow workspace
165
- workspace init Create shadow workspace for current repo
166
- workspace snapshot Manual / hook-invoked sync + shadow commit
167
- workspace status Show shadow workspace state
168
- workspace explain Explain shadow workspace behavior
169
- workspace log Show Moda shadow history (not user git log)
170
- workspace bundle Bundle a shadow commit range for replay
171
- hooks install Install Claude Code shadow-workspace hooks
172
- hooks install --agent=codex Install Codex hooks
173
- hooks install --agent=cursor Install Cursor hooks
174
- hooks install --agent=all Install Claude Code, Codex, and Cursor hooks
175
-
176
159
  Skills:
177
160
  skills gen Kick off tenant-wide skill generation
178
161
  skills pull Pull tenant-generated skills into .claude/skills (and .cursor/rules)
@@ -207,8 +190,6 @@ Init flags:
207
190
  Choose harness analyst adapter
208
191
  --tui Show full-screen analyst dashboard in human TTYs
209
192
  --no-tui Show raw external analyst output
210
- --coding-agent-traces Install Claude/Codex/Cursor trace hooks
211
- --no-coding-agent-traces Skip Claude/Codex/Cursor trace hook installation
212
193
  --sdk-guide Write .moda/SDK_INTEGRATION.md
213
194
  --no-sdk-guide Skip SDK integration guide creation
214
195
  --ci-cd Create GitHub Actions Moda validation workflow
@@ -241,8 +222,6 @@ Examples:
241
222
  moda sync harness --profile=prod
242
223
  moda harness scan --json
243
224
  moda harness explain --agent=agent_support
244
- moda init --coding-agent-traces
245
- moda init --no-coding-agent-traces
246
225
  moda init --ci-cd
247
226
  moda overview --days-back=30
248
227
  moda clusters --time-range=7d
@@ -258,11 +237,6 @@ Examples:
258
237
  moda prompts status
259
238
  moda prompts sync
260
239
  moda prompts promote support.triage --label=prod --version=pver_abc123
261
- moda spark explain
262
- moda spark snapshot --dry-run --json
263
- moda workspace snapshot --json
264
- moda hooks install
265
- moda hooks install --agent=all
266
240
  moda skills pull`);
267
241
  }
268
242
  // --- Command Handlers ---
@@ -870,57 +844,60 @@ export const commandRegistry = createCommandRegistry([
870
844
  resetApiRequestCountBeforeRun: true,
871
845
  telemetry: 'result-and-error',
872
846
  }),
873
- {
874
- name: 'workspace',
875
- description: 'Manage Moda shadow workspace snapshots',
876
- examples: ['moda workspace init', 'moda workspace snapshot --json', 'moda workspace explain'],
877
- auth: 'none',
878
- outputModes: ['human', 'json', 'agent'],
879
- mutability: 'write',
880
- validateConfigBeforeRun: false,
881
- resetApiRequestCountBeforeRun: false,
882
- telemetry: 'none',
883
- handler: async (context) => ({
884
- exitCode: await runWorkspaceCommand({
885
- command: context.command,
886
- positional: context.positional,
887
- positionals: context.positionals,
888
- flags: context.flags,
889
- }),
890
- }),
891
- },
892
- {
893
- name: 'spark',
894
- aliases: ['shadow'],
895
- description: 'Manage Shadow Spark workspace snapshots',
896
- examples: ['moda spark status', 'moda spark explain', 'moda spark snapshot --dry-run --json'],
897
- auth: 'none',
898
- outputModes: ['human', 'json', 'agent'],
899
- mutability: 'write',
900
- validateConfigBeforeRun: false,
901
- resetApiRequestCountBeforeRun: false,
902
- telemetry: 'none',
903
- handler: runSparkCommand,
904
- },
905
- {
906
- name: 'hooks',
907
- description: 'Install coding-agent trace hooks',
908
- examples: ['moda hooks install', 'moda hooks install --agent=all'],
909
- auth: 'none',
910
- outputModes: ['human', 'json', 'agent'],
911
- mutability: 'write',
912
- validateConfigBeforeRun: false,
913
- resetApiRequestCountBeforeRun: false,
914
- telemetry: 'none',
915
- handler: async (context) => ({
916
- exitCode: await runHooksInstall({
917
- command: context.command,
918
- positional: context.positional,
919
- positionals: context.positionals,
920
- flags: context.flags,
921
- }),
922
- }),
923
- },
847
+ // Coding-agent capture commands disabled until the feature is production-ready.
848
+ // Re-enable by restoring these registrations, the workspace.js import above, the
849
+ // "Shadow workspace" help section, the init hooks phase, and the doctor spark/hook checks.
850
+ // {
851
+ // name: 'workspace',
852
+ // description: 'Manage Moda shadow workspace snapshots',
853
+ // examples: ['moda workspace init', 'moda workspace snapshot --json', 'moda workspace explain'],
854
+ // auth: 'none',
855
+ // outputModes: ['human', 'json', 'agent'],
856
+ // mutability: 'write',
857
+ // validateConfigBeforeRun: false,
858
+ // resetApiRequestCountBeforeRun: false,
859
+ // telemetry: 'none',
860
+ // handler: async (context) => ({
861
+ // exitCode: await runWorkspaceCommand({
862
+ // command: context.command,
863
+ // positional: context.positional,
864
+ // positionals: context.positionals,
865
+ // flags: context.flags,
866
+ // }),
867
+ // }),
868
+ // },
869
+ // {
870
+ // name: 'spark',
871
+ // aliases: ['shadow'],
872
+ // description: 'Manage Shadow Spark workspace snapshots',
873
+ // examples: ['moda spark status', 'moda spark explain', 'moda spark snapshot --dry-run --json'],
874
+ // auth: 'none',
875
+ // outputModes: ['human', 'json', 'agent'],
876
+ // mutability: 'write',
877
+ // validateConfigBeforeRun: false,
878
+ // resetApiRequestCountBeforeRun: false,
879
+ // telemetry: 'none',
880
+ // handler: runSparkCommand,
881
+ // },
882
+ // {
883
+ // name: 'hooks',
884
+ // description: 'Install coding-agent trace hooks',
885
+ // examples: ['moda hooks install', 'moda hooks install --agent=all'],
886
+ // auth: 'none',
887
+ // outputModes: ['human', 'json', 'agent'],
888
+ // mutability: 'write',
889
+ // validateConfigBeforeRun: false,
890
+ // resetApiRequestCountBeforeRun: false,
891
+ // telemetry: 'none',
892
+ // handler: async (context) => ({
893
+ // exitCode: await runHooksInstall({
894
+ // command: context.command,
895
+ // positional: context.positional,
896
+ // positionals: context.positionals,
897
+ // flags: context.flags,
898
+ // }),
899
+ // }),
900
+ // },
924
901
  {
925
902
  name: 'skills',
926
903
  description: 'Generate and pull Moda skills',
package/dist/doctor.js CHANGED
@@ -162,9 +162,12 @@ export async function buildDoctorReport(context, options) {
162
162
  '__tests__',
163
163
  ]));
164
164
  checks.push(sdkInitializationCheck(context.cwd));
165
- checks.push(shadowSparkWorkspaceCheck(context.cwd, context.env));
166
- checks.push(hookCheck(context.env));
167
- checks.push(...hookTelemetryChecks(context.env, ingestUrl));
165
+ // Coding-agent capture (Shadow Spark + trace hooks) is temporarily disabled, so doctor
166
+ // must not recommend its commands. `shadowSpark` in the status payload falls back to
167
+ // 'skipped' via checkStatus.
168
+ // checks.push(shadowSparkWorkspaceCheck(context.cwd, context.env));
169
+ // checks.push(hookCheck(context.env));
170
+ // checks.push(...hookTelemetryChecks(context.env, ingestUrl));
168
171
  checks.push(validationEventPathCheck(ingestUrl));
169
172
  if (options.offline || !apiKey) {
170
173
  checks.push(...offlineCloudChecks(options.offline));
@@ -519,6 +522,8 @@ function sdkInitializationCheck(cwd) {
519
522
  nextCommand: 'moda init',
520
523
  };
521
524
  }
525
+ // Unused while coding-agent capture is disabled; kept for re-enablement.
526
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
522
527
  function shadowSparkWorkspaceCheck(cwd, env) {
523
528
  const repo = detectGitRepo(cwd);
524
529
  if (!repo) {
@@ -552,6 +557,8 @@ function shadowSparkWorkspaceCheck(cwd, env) {
552
557
  nextCommand: healthy ? undefined : 'moda spark snapshot --json',
553
558
  };
554
559
  }
560
+ // Unused while coding-agent capture is disabled; kept for re-enablement.
561
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
555
562
  function hookCheck(env) {
556
563
  const paths = getModaPaths({ env });
557
564
  const hookCandidates = [
@@ -571,6 +578,8 @@ function hookCheck(env) {
571
578
  nextCommand: found.length > 0 ? undefined : 'moda hooks install --agent=all',
572
579
  };
573
580
  }
581
+ // Unused while coding-agent capture is disabled; kept for re-enablement.
582
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
574
583
  function hookTelemetryChecks(env, ingestUrl) {
575
584
  const configs = agentTelemetryConfigs(env);
576
585
  return [
@@ -8,7 +8,8 @@ import { detectAgents } from './mcp.js';
8
8
  import { installRules } from './rules.js';
9
9
  import { initPrompts } from '../prompts.js';
10
10
  import { pullSkills } from '../skills.js';
11
- import { runHooksInstall } from '../workspace.js';
11
+ // Coding-agent capture is temporarily disabled — see the hooks phase below.
12
+ // import { runHooksInstall } from '../workspace.js';
12
13
  import { SDK_GUIDE_PATH, writeSdkIntegrationGuide } from './sdk-guide.js';
13
14
  import { createCommandContext } from '../command-context.js';
14
15
  import { CliInputError } from '../errors.js';
@@ -29,7 +30,9 @@ export async function runInit(flags, options = {}) {
29
30
  if (human)
30
31
  console.log(message);
31
32
  };
32
- const warn = (message) => {
33
+ // `warn` is only used by the temporarily-disabled hooks phase below; keep the
34
+ // underscore-prefixed binding so re-enabling it is a rename away.
35
+ const _warn = (message) => {
33
36
  if (human)
34
37
  console.error(message);
35
38
  };
@@ -103,7 +106,9 @@ export async function runInit(flags, options = {}) {
103
106
  // Step 5: Setup plan
104
107
  log(renderInitStep(5, 7, 'Setup Plan', 'Every write/sync action is explicit before it is applied.'));
105
108
  const setupPlan = buildSetupPlan({
106
- installHooks: await shouldIngestCodingAgentTraces(flags, yes),
109
+ // Coding-agent capture is temporarily disabled; never prompt for or install trace hooks.
110
+ // installHooks: await shouldIngestCodingAgentTraces(flags, yes),
111
+ installHooks: false,
107
112
  installSdkGuide: await shouldCreateSdkGuide(flags, yes),
108
113
  configureCiCd: await shouldConfigureCiCd(flags, yes),
109
114
  });
@@ -113,25 +118,25 @@ export async function runInit(flags, options = {}) {
113
118
  // Step 6: Apply approved setup changes.
114
119
  log(renderInitStep(6, 7, 'Apply Approved Changes'));
115
120
  emit('apply', 'Applying approved setup changes.');
116
- const ingestCodingAgentTraces = setupPlan.find((action) => action.category === 'hooks')?.approved === true;
117
- if (ingestCodingAgentTraces) {
118
- try {
119
- await runHooksInstall({
120
- command: 'hooks',
121
- positional: 'install',
122
- positionals: ['install'],
123
- flags: { agent: 'all', ...(human ? {} : { json: 'true' }) },
124
- });
125
- }
126
- catch (err) {
127
- const message = err instanceof Error ? err.message : String(err);
128
- warn(renderInitNote(`hook/telemetry install failed: ${message}`, 'warning'));
129
- warn(' Run `moda hooks install --agent=all` manually to enable traces.');
130
- }
131
- }
132
- else {
133
- log(renderInitNote('Skipped coding-agent trace ingestion', 'skipped'));
134
- }
121
+ // Coding-agent capture is temporarily disabled; the hooks phase never runs.
122
+ // const ingestCodingAgentTraces = setupPlan.find((action) => action.category === 'hooks')?.approved === true;
123
+ const ingestCodingAgentTraces = false;
124
+ // if (ingestCodingAgentTraces) {
125
+ // try {
126
+ // await runHooksInstall({
127
+ // command: 'hooks',
128
+ // positional: 'install',
129
+ // positionals: ['install'],
130
+ // flags: { agent: 'all', ...(human ? {} : { json: 'true' }) },
131
+ // });
132
+ // } catch (err) {
133
+ // const message = err instanceof Error ? err.message : String(err);
134
+ // warn(renderInitNote(`hook/telemetry install failed: ${message}`, 'warning'));
135
+ // warn(' Run `moda hooks install --agent=all` manually to enable traces.');
136
+ // }
137
+ // } else {
138
+ // log(renderInitNote('Skipped coding-agent trace ingestion', 'skipped'));
139
+ // }
135
140
  const agents = detectAgents();
136
141
  if (agents.length > 0) {
137
142
  log(renderInitNote(`Detected coding agents: ${agents.join(', ')}`));
@@ -172,7 +177,7 @@ export async function runInit(flags, options = {}) {
172
177
  }
173
178
  log(renderInitNote('Reusing approved Step 4 harness report; no second analyst run needed'));
174
179
  markApplied(setupPlan, 'harness');
175
- markApplied(setupPlan, 'hooks', ingestCodingAgentTraces ? undefined : 'User skipped coding-agent trace hooks.');
180
+ markApplied(setupPlan, 'hooks', ingestCodingAgentTraces ? undefined : 'Coding-agent trace capture is temporarily unavailable.');
176
181
  markApplied(setupPlan, 'prompts');
177
182
  markApplied(setupPlan, 'skills');
178
183
  emit('apply', 'Approved changes applied.', 'completed');
@@ -226,7 +231,7 @@ function buildSetupPlan(options) {
226
231
  approved: options.installHooks,
227
232
  files: ['~/.claude/settings.json', '~/.codex/hooks.json', '~/.cursor/hooks.json'],
228
233
  command: 'moda hooks install --agent=all',
229
- reason: options.installHooks ? undefined : 'Not approved during init.',
234
+ reason: options.installHooks ? undefined : 'Coding-agent trace capture is temporarily unavailable.',
230
235
  },
231
236
  {
232
237
  category: 'prompts',
@@ -351,19 +356,20 @@ function commandFlags(flags) {
351
356
  function stringFlag(value) {
352
357
  return typeof value === 'string' && value.trim().length > 0 ? value : undefined;
353
358
  }
354
- async function shouldIngestCodingAgentTraces(flags, yes) {
355
- const explicit = parseOptionalBoolean(flagValue(flags, 'coding-agent-traces', 'coding_agent_traces'));
356
- if (explicit !== undefined)
357
- return explicit;
358
- if (isTruthyFlag(flagValue(flags, 'no-coding-agent-traces', 'no_coding_agent_traces')))
359
- return false;
360
- if (yes)
361
- return true;
362
- return confirm({
363
- message: 'Ingest coding-agent traces for Claude Code, Codex, and Cursor?',
364
- default: true,
365
- });
366
- }
359
+ // Coding-agent capture is temporarily disabled; restore this prompt with the hooks phase.
360
+ // async function shouldIngestCodingAgentTraces(
361
+ // flags: Record<string, unknown>,
362
+ // yes: boolean,
363
+ // ): Promise<boolean> {
364
+ // const explicit = parseOptionalBoolean(flagValue(flags, 'coding-agent-traces', 'coding_agent_traces'));
365
+ // if (explicit !== undefined) return explicit;
366
+ // if (isTruthyFlag(flagValue(flags, 'no-coding-agent-traces', 'no_coding_agent_traces'))) return false;
367
+ // if (yes) return true;
368
+ // return confirm({
369
+ // message: 'Ingest coding-agent traces for Claude Code, Codex, and Cursor?',
370
+ // default: true,
371
+ // });
372
+ // }
367
373
  async function shouldConfigureCiCd(flags, yes) {
368
374
  const explicit = parseOptionalBoolean(flagValue(flags, 'ci-cd', 'ci_cd', 'ci'));
369
375
  if (explicit !== undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda-ai/cli",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "CLI for Moda - AI agent analytics and observability",
5
5
  "type": "module",
6
6
  "bin": {