@moda-ai/cli 1.30.0 → 1.30.1

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.
@@ -3537,7 +3537,7 @@ async function runHarnessCommand(context) {
3537
3537
  elapsed_ms: Date.now() - context.startedAt
3538
3538
  });
3539
3539
  if (context.flags["github-actions"] === "true") {
3540
- const { runGithubActionsAnalyze } = await import("./harness-github-actions-dmy8fz54.js");
3540
+ const { runGithubActionsAnalyze } = await import("./harness-github-actions-v98snak8.js");
3541
3541
  const result = await runGithubActionsAnalyze(rootDir, {
3542
3542
  writeReport: (report2) => {
3543
3543
  const normalized = normalizeHarnessReport(report2);
@@ -3897,12 +3897,15 @@ async function runExternalHarnessAnalyst(options) {
3897
3897
  },
3898
3898
  onAgentEvent: streamAnalystProgress ? (event) => {
3899
3899
  const progress = analystEventProgress(event);
3900
- if (!progress)
3900
+ if (!progress && !event.usage)
3901
3901
  return;
3902
3902
  options.context.output.writeEvent({
3903
3903
  event: "progress",
3904
- phase: progress.phase,
3905
- message: progress.message,
3904
+ phase: progress?.phase ?? "analyst_usage",
3905
+ message: progress?.message ?? "analyst usage update",
3906
+ ...event.usage ? { usage: event.usage } : {},
3907
+ ...event.model ? { model: event.model } : {},
3908
+ ...event.durationMs !== undefined ? { duration_ms: event.durationMs } : {},
3906
3909
  elapsed_ms: Date.now() - options.context.startedAt
3907
3910
  });
3908
3911
  } : undefined
@@ -4442,6 +4445,8 @@ function recordExternalAgentEventLine(line, options) {
4442
4445
  options.onAgentEvent?.(event);
4443
4446
  if (!options.inheritedOutput)
4444
4447
  return;
4448
+ if (event.telemetryOnly)
4449
+ return;
4445
4450
  options.tui?.recordEvent(event);
4446
4451
  if (options.tui)
4447
4452
  return;
@@ -4466,7 +4471,35 @@ function formatExternalAgentDisplayEvent(event, adapter) {
4466
4471
  return ` ${analystDisplayName(adapter)}: ${event.message}
4467
4472
  `;
4468
4473
  }
4474
+ function extractAgentEventTelemetry(event) {
4475
+ const message = isRecord3(event.message) ? event.message : undefined;
4476
+ const usage = isRecord3(event.usage) ? event.usage : isRecord3(message?.usage) ? message.usage : undefined;
4477
+ const modelUsage = isRecord3(event.modelUsage) ? event.modelUsage : undefined;
4478
+ const model = stringValue(event.model) ?? stringValue(message?.model) ?? (modelUsage ? Object.keys(modelUsage)[0] : undefined);
4479
+ const durationValue = (value) => typeof value === "number" && Number.isFinite(value) ? value : undefined;
4480
+ const durationMs = durationValue(event.duration_ms) ?? durationValue(event.durationMs) ?? durationValue(event.duration_api_ms);
4481
+ if (!usage && !model && durationMs === undefined)
4482
+ return;
4483
+ return {
4484
+ ...usage ? { usage } : {},
4485
+ ...model ? { model } : {},
4486
+ ...durationMs !== undefined ? { durationMs } : {}
4487
+ };
4488
+ }
4469
4489
  function parseExternalAgentEvent(event) {
4490
+ const body = parseExternalAgentEventBody(event);
4491
+ if (!isRecord3(event))
4492
+ return body;
4493
+ const telemetry = extractAgentEventTelemetry(event);
4494
+ if (!telemetry)
4495
+ return body;
4496
+ if (body)
4497
+ return { ...body, ...telemetry };
4498
+ if (!telemetry.usage)
4499
+ return;
4500
+ return { kind: "system", message: "usage update", telemetryOnly: true, ...telemetry };
4501
+ }
4502
+ function parseExternalAgentEventBody(event) {
4470
4503
  if (!isRecord3(event))
4471
4504
  return { kind: "agent_text", message: truncateText(String(event), 500) };
4472
4505
  const msg = isRecord3(event.msg) ? event.msg : undefined;
@@ -11,7 +11,7 @@ import {
11
11
  renderStatusHuman,
12
12
  scanHarness,
13
13
  validateHarnessReport
14
- } from "./cli-5e0rd8mf.js";
14
+ } from "./cli-js4bmw21.js";
15
15
  import {
16
16
  isAuthSessionValid,
17
17
  loadAuthSession
package/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  runPromptsCommand,
9
9
  runSkillsCommand,
10
10
  runStatusCommand
11
- } from "./cli-3ba4qcpr.js";
11
+ } from "./cli-mq00fkwt.js";
12
12
  import {
13
13
  ApiError,
14
14
  HARNESS_REPORT_APPROVAL_PATH,
@@ -29,7 +29,7 @@ import {
29
29
  summarizeHarness,
30
30
  terminalStyles,
31
31
  validateHarnessReport
32
- } from "./cli-5e0rd8mf.js";
32
+ } from "./cli-js4bmw21.js";
33
33
  import {
34
34
  authFetch,
35
35
  clearAuthSession,
@@ -2240,6 +2240,13 @@ var agentEventSchema = {
2240
2240
  phase: { type: "string" },
2241
2241
  message: { type: "string" },
2242
2242
  elapsed_ms: { type: "number" },
2243
+ usage: {
2244
+ type: "object",
2245
+ description: "Per-LLM-call token usage passed through verbatim from the underlying coding-agent stream (e.g. input_tokens/output_tokens/cache_* from claude stream-json).",
2246
+ additionalProperties: true
2247
+ },
2248
+ model: { type: "string", description: "Model id reported by the underlying coding-agent stream for this call." },
2249
+ duration_ms: { type: "number", description: "Duration in ms reported by the underlying coding-agent stream (result events)." },
2243
2250
  artifact: agentArtifactSchema,
2244
2251
  result: agentEnvelopeSchema,
2245
2252
  error: agentErrorSchema,
@@ -6514,7 +6521,7 @@ var commandRegistry = createCommandRegistry([
6514
6521
  resetApiRequestCountBeforeRun: true,
6515
6522
  telemetry: "result",
6516
6523
  handler: async (context) => {
6517
- const { runInit } = await import("./index-nes2m734.js");
6524
+ const { runInit } = await import("./index-14sr487g.js");
6518
6525
  if (context.outputMode === "agent-stream") {
6519
6526
  context.output.writeEvent({
6520
6527
  event: "started",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildSourceSnapshot
3
- } from "./cli-5e0rd8mf.js";
3
+ } from "./cli-js4bmw21.js";
4
4
  import"./cli-59yacef3.js";
5
5
 
6
6
  // src/harness-github-actions.ts
@@ -9,7 +9,7 @@ import {
9
9
  runPromptSync,
10
10
  runSkillSync,
11
11
  upsertSkillManifestRecord
12
- } from "./cli-3ba4qcpr.js";
12
+ } from "./cli-mq00fkwt.js";
13
13
  import {
14
14
  codingAgentDisplayName,
15
15
  describeCodingAgentEvent,
@@ -27,7 +27,7 @@ import {
27
27
  runHarnessCommand,
28
28
  startRemoteAnalyze,
29
29
  stripAnsi
30
- } from "./cli-5e0rd8mf.js";
30
+ } from "./cli-js4bmw21.js";
31
31
  import {
32
32
  selectTenantAndCreateKey
33
33
  } from "./cli-pq6rte0w.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda-ai/cli",
3
- "version": "1.30.0",
3
+ "version": "1.30.1",
4
4
  "description": "CLI for Moda - AI agent analytics and observability",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": "moda.skill_index.v1",
3
- "bundled_at": "2026-09-02T01:04:59.515Z",
4
- "cli_version": "1.30.0",
3
+ "bundled_at": "2026-09-02T04:30:52.582Z",
4
+ "cli_version": "1.30.1",
5
5
  "skills": [
6
6
  {
7
7
  "id": "integration-node-anthropic",