@almyty/agents 1.5.9 → 1.5.10

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/format.d.ts CHANGED
@@ -81,6 +81,21 @@ export declare function routingOfStep(step: RunStep | undefined): RoutingAttribu
81
81
  * Returns null for a step with nothing worth showing.
82
82
  */
83
83
  export declare function formatStep(step: RunStep | undefined, index?: number): string | null;
84
+ /** What a pass means, said once wherever the CLI shows one. */
85
+ export declare const CHECK_PASS_EXPLANATION = "the check compared the answer's names, dates, versions, ids, counts and labels with what the tools returned and found no mismatch; it can't confirm everything the answer says";
86
+ /**
87
+ * A check's outcome in plain words. A pass is "no errors found", never
88
+ * "passed" or "verified": it means no mismatch with the tool results, not
89
+ * that the answer is right.
90
+ */
91
+ export declare function formatCheck(verdict: {
92
+ verdict?: string;
93
+ unavailable?: boolean;
94
+ reason?: string;
95
+ failures?: Array<{
96
+ rule?: unknown;
97
+ }>;
98
+ } | undefined | null): string;
84
99
  /**
85
100
  * The closing line of a run: status, what it cost, and which models
86
101
  * answered. Someone reading a CI log should not have to open the UI to
@@ -127,6 +142,16 @@ export declare function formatRunDetail(run: {
127
142
  output?: unknown;
128
143
  steps?: RunStep[];
129
144
  limits?: Record<string, unknown>;
145
+ metadata?: {
146
+ verify?: {
147
+ verdict?: string;
148
+ unavailable?: boolean;
149
+ reason?: string;
150
+ failures?: Array<{
151
+ rule?: unknown;
152
+ }>;
153
+ };
154
+ } | null;
130
155
  }): string;
131
156
  /**
132
157
  * The hop-by-hop trace the backend assembles at
package/dist/format.js CHANGED
@@ -131,10 +131,38 @@ export function formatStep(step, index) {
131
131
  return ` ${n}sub_agent_call → ${step.input?.agentId ?? '?'}${suffix}`;
132
132
  case 'error':
133
133
  return ` ${n}error: ${step.error ?? 'unknown'}${suffix}`;
134
+ case 'verify': {
135
+ const midRun = step.output?.advisory === true || step.input?.mode === 'mid_loop';
136
+ return ` ${n}${midRun ? 'mid-run check' : 'check'}: ${formatCheck(step.output)}${suffix}`;
137
+ }
134
138
  default:
135
139
  return step.type ? ` ${n}${step.type}${suffix}` : null;
136
140
  }
137
141
  }
142
+ /** What a pass means, said once wherever the CLI shows one. */
143
+ export const CHECK_PASS_EXPLANATION = "the check compared the answer's names, dates, versions, ids, counts and labels with what the tools returned and found no mismatch; it can't confirm everything the answer says";
144
+ /**
145
+ * A check's outcome in plain words. A pass is "no errors found", never
146
+ * "passed" or "verified": it means no mismatch with the tool results, not
147
+ * that the answer is right.
148
+ */
149
+ export function formatCheck(verdict) {
150
+ if (!verdict)
151
+ return 'not checked';
152
+ if (verdict.verdict === 'pass')
153
+ return 'no errors found';
154
+ if (verdict.unavailable === true)
155
+ return 'not checked: no checker gave a verdict';
156
+ const reasons = typeof verdict.reason === 'string' && verdict.reason.trim()
157
+ ? [verdict.reason.trim()]
158
+ : (Array.isArray(verdict.failures) ? verdict.failures : [])
159
+ .map((f) => (typeof f?.rule === 'string' ? f.rule.trim() : ''))
160
+ .filter((r) => r.length > 0);
161
+ if (!reasons.length)
162
+ return 'errors found';
163
+ const more = reasons.length - 3;
164
+ return `errors found: ${reasons.slice(0, 3).join('; ')}${more > 0 ? `; and ${more} more` : ''}`;
165
+ }
138
166
  /**
139
167
  * The closing line of a run: status, what it cost, and which models
140
168
  * answered. Someone reading a CI log should not have to open the UI to
@@ -251,6 +279,13 @@ export function formatRunDetail(run) {
251
279
  }
252
280
  if (models.size > 0)
253
281
  lines.push(` models: ${[...models].join(', ')}`);
282
+ // The final answer's check, as the run recorded it (`metadata.verify`).
283
+ const verdict = run.metadata?.verify;
284
+ if (verdict && typeof verdict.verdict === 'string') {
285
+ lines.push(` check: ${formatCheck(verdict)}`);
286
+ if (verdict.verdict === 'pass')
287
+ lines.push(` (${CHECK_PASS_EXPLANATION})`);
288
+ }
254
289
  if (run.error) {
255
290
  lines.push('');
256
291
  lines.push(` error: ${run.error}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almyty/agents",
3
- "version": "1.5.9",
3
+ "version": "1.5.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -28,7 +28,7 @@
28
28
  "author": "almyty",
29
29
  "license": "Apache-2.0",
30
30
  "dependencies": {
31
- "@almyty/client": "^1.5.9"
31
+ "@almyty/client": "^1.5.10"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^26.6.6",