@sensigo/realm-cli 0.10.1 → 0.11.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/commands/attempts.d.ts +3 -0
- package/dist/commands/attempts.d.ts.map +1 -0
- package/dist/commands/attempts.js +50 -0
- package/dist/commands/attempts.js.map +1 -0
- package/dist/commands-registry.d.ts.map +1 -1
- package/dist/commands-registry.js +2 -0
- package/dist/commands-registry.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attempts.d.ts","sourceRoot":"","sources":["../../src/commands/attempts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,eAAO,MAAM,eAAe,SAgDxB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// attempts command — prints the durable failed agent-attempt sidecar for a run (observability P3).
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
/** One-line validation summary: "<keyword> <instancePath>" of the first entry, plus a +N suffix. */
|
|
5
|
+
function summarize(rec) {
|
|
6
|
+
const entries = Array.isArray(rec.validation_error_summary) ? rec.validation_error_summary : [];
|
|
7
|
+
if (entries.length === 0)
|
|
8
|
+
return '';
|
|
9
|
+
const first = entries[0];
|
|
10
|
+
const head = `${first.keyword}${first.instancePath ? ` ${first.instancePath}` : ''}`.trim();
|
|
11
|
+
return entries.length > 1 ? `${head} (+${entries.length - 1} more)` : head;
|
|
12
|
+
}
|
|
13
|
+
export const attemptsCommand = new Command('attempts')
|
|
14
|
+
.description('Show failed agent-step validation attempts recorded for a run')
|
|
15
|
+
.argument('<run-id>', 'ID of the run to inspect')
|
|
16
|
+
.option('--json', 'Print the raw records as JSON instead of a table')
|
|
17
|
+
.action(async (runId, opts) => {
|
|
18
|
+
const { JsonFileStore, FailedAttemptStore } = await import('@sensigo/realm');
|
|
19
|
+
const store = new FailedAttemptStore(new JsonFileStore().runsDirPath);
|
|
20
|
+
try {
|
|
21
|
+
const { records, capped } = await store.read(runId);
|
|
22
|
+
if (opts.json === true) {
|
|
23
|
+
console.log(JSON.stringify({ records, capped }, null, 2));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (records.length === 0) {
|
|
27
|
+
console.log(`No failed attempts recorded for run ${runId}.`);
|
|
28
|
+
if (capped) {
|
|
29
|
+
console.log(chalk.yellow('Note: the attempts sidecar reached its size ceiling; later attempts were dropped.'));
|
|
30
|
+
}
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
console.log(`Failed attempts for run ${chalk.bold(runId)} (${records.length}):\n`);
|
|
34
|
+
for (const rec of records) {
|
|
35
|
+
const ts = typeof rec.ts === 'string' ? rec.ts : '';
|
|
36
|
+
const keyCount = typeof rec.submitted_key_count === 'number' ? rec.submitted_key_count : 0;
|
|
37
|
+
console.log(`${chalk.dim(ts)} ${chalk.bold(rec.step_id)} ${chalk.red(rec.error_code)} ` +
|
|
38
|
+
`${keyCount} key(s) ${summarize(rec)}`);
|
|
39
|
+
}
|
|
40
|
+
if (capped) {
|
|
41
|
+
console.log('\n' +
|
|
42
|
+
chalk.yellow('Note: the attempts sidecar reached its size ceiling; later attempts were dropped (append-and-stop keeps the first N).'));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=attempts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attempts.js","sourceRoot":"","sources":["../../src/commands/attempts.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,oGAAoG;AACpG,SA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AAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands-registry.d.ts","sourceRoot":"","sources":["../src/commands-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands-registry.d.ts","sourceRoot":"","sources":["../src/commands-registry.ts"],"names":[],"mappings":"AA0BA,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,+BAQ5B,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,WAAW,+BAWvB,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,+BAM5B,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { resumeCommand } from './commands/resume.js';
|
|
|
8
8
|
import { abandonCommand } from './commands/abandon.js';
|
|
9
9
|
import { cleanupCommand } from './commands/cleanup.js';
|
|
10
10
|
import { reconcileCommand } from './commands/reconcile.js';
|
|
11
|
+
import { attemptsCommand } from './commands/attempts.js';
|
|
11
12
|
import { respondCommand } from './commands/respond.js';
|
|
12
13
|
import { inspectCommand } from './commands/inspect.js';
|
|
13
14
|
import { replayCommand } from './commands/replay.js';
|
|
@@ -43,6 +44,7 @@ export const runCommands = [
|
|
|
43
44
|
respondCommand,
|
|
44
45
|
cleanupCommand,
|
|
45
46
|
reconcileCommand,
|
|
47
|
+
attemptsCommand,
|
|
46
48
|
];
|
|
47
49
|
/** Top-level commands not nested under a subgroup. */
|
|
48
50
|
export const topLevelCommands = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands-registry.js","sourceRoot":"","sources":["../src/commands-registry.ts"],"names":[],"mappings":"AAAA,uE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,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,WAAW;IACX,eAAe;IACf,eAAe;IACf,YAAY;IACZ,UAAU;IACV,WAAW;IACX,cAAc;CACf,CAAC;AAEF,gEAAgE;AAChE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,WAAW;IACX,cAAc;IACd,aAAa;IACb,WAAW;IACX,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,eAAe;CAChB,CAAC;AAEF,sDAAsD;AACtD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,aAAa;CACd,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import 'dotenv/config';
|
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import { workflowCommands, runCommands, topLevelCommands } from './commands-registry.js';
|
|
6
6
|
const program = new Command();
|
|
7
|
-
program.name('realm').description('Realm workflow engine CLI').version('0.
|
|
7
|
+
program.name('realm').description('Realm workflow engine CLI').version('0.11.0');
|
|
8
8
|
// realm workflow — operations on workflow definitions
|
|
9
9
|
const workflowCmd = new Command('workflow').description('Manage workflow definitions');
|
|
10
10
|
for (const cmd of workflowCommands)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sensigo/realm-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"vitest": "^4.1.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@sensigo/realm": "^0.
|
|
65
|
-
"@sensigo/realm-mcp": "^0.
|
|
66
|
-
"@sensigo/realm-testing": "^0.
|
|
64
|
+
"@sensigo/realm": "^0.11.0",
|
|
65
|
+
"@sensigo/realm-mcp": "^0.11.0",
|
|
66
|
+
"@sensigo/realm-testing": "^0.11.0",
|
|
67
67
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
68
68
|
"chalk": "^5.0.0",
|
|
69
69
|
"commander": "^14.0.3",
|