@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.
- package/dist/{cli-5e0rd8mf.js → cli-js4bmw21.js} +37 -4
- package/dist/{cli-3ba4qcpr.js → cli-mq00fkwt.js} +1 -1
- package/dist/cli.js +10 -3
- package/dist/{harness-github-actions-dmy8fz54.js → harness-github-actions-v98snak8.js} +1 -1
- package/dist/{index-nes2m734.js → index-14sr487g.js} +2 -2
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
|
@@ -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-
|
|
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
|
|
3905
|
-
message: progress
|
|
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;
|
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
runPromptsCommand,
|
|
9
9
|
runSkillsCommand,
|
|
10
10
|
runStatusCommand
|
|
11
|
-
} from "./cli-
|
|
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-
|
|
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-
|
|
6524
|
+
const { runInit } = await import("./index-14sr487g.js");
|
|
6518
6525
|
if (context.outputMode === "agent-stream") {
|
|
6519
6526
|
context.output.writeEvent({
|
|
6520
6527
|
event: "started",
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
runPromptSync,
|
|
10
10
|
runSkillSync,
|
|
11
11
|
upsertSkillManifestRecord
|
|
12
|
-
} from "./cli-
|
|
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-
|
|
30
|
+
} from "./cli-js4bmw21.js";
|
|
31
31
|
import {
|
|
32
32
|
selectTenantAndCreateKey
|
|
33
33
|
} from "./cli-pq6rte0w.js";
|
package/package.json
CHANGED