@vellumai/assistant 0.8.12-dev.202606160320.367ef7c → 0.8.12-dev.202606160816.2670bed

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/assistant",
3
- "version": "0.8.12-dev.202606160320.367ef7c",
3
+ "version": "0.8.12-dev.202606160816.2670bed",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -156,12 +156,18 @@ Use `manage_workflows` to inspect and control runs:
156
156
 
157
157
  | Action | Requires | Purpose |
158
158
  | --------------- | ---------- | ---------------------------------------------------------------- |
159
- | `status` | `run_id` | Status + agent/token counts for one run. |
159
+ | `status` | `run_id` | Status + agent/token counts for one run (NOT the result). |
160
+ | `get_result` | `run_id` | The full result of a finished run. |
160
161
  | `list_runs` | — | Recent runs, newest first. |
161
162
  | `abort` | `run_id` | Signal an in-flight run to abort. |
162
163
  | `resume` | `run_id` | Resume an `interrupted` run (see below). |
163
164
  | `list_profiles` | — | List defined profiles + the active profile (for leaf `profile`).|
164
165
 
166
+ The completion notification injected when a run finishes carries a **truncated**
167
+ preview of the result (large results are cut off). To read the complete result,
168
+ call `manage_workflows` with action `get_result` and the `run_id` — `status`
169
+ deliberately omits the result to stay lightweight.
170
+
165
171
  ### Crash recovery / resume
166
172
 
167
173
  Resume is **not automatic**. If the assistant restarts mid-run, the run is reconciled
@@ -52,7 +52,7 @@
52
52
  },
53
53
  {
54
54
  "name": "manage_workflows",
55
- "description": "Inspect or control workflow runs started by run_workflow: status, abort, resume, list_runs, and list_profiles. See SKILL.md for details.",
55
+ "description": "Inspect or control workflow runs started by run_workflow: status, get_result (the full result of a finished run — the completion notification truncates large results), abort, resume, list_runs, and list_profiles. See SKILL.md for details.",
56
56
  "category": "workflow",
57
57
  "risk": "low",
58
58
  "input_schema": {
@@ -60,12 +60,19 @@
60
60
  "properties": {
61
61
  "action": {
62
62
  "type": "string",
63
- "enum": ["status", "abort", "resume", "list_runs", "list_profiles"],
63
+ "enum": [
64
+ "status",
65
+ "get_result",
66
+ "abort",
67
+ "resume",
68
+ "list_runs",
69
+ "list_profiles"
70
+ ],
64
71
  "description": "What to do."
65
72
  },
66
73
  "run_id": {
67
74
  "type": "string",
68
- "description": "Target run id (required for \"status\", \"abort\", and \"resume\")."
75
+ "description": "Target run id (required for \"status\", \"get_result\", \"abort\", and \"resume\")."
69
76
  }
70
77
  },
71
78
  "required": ["action"]
@@ -65,6 +65,34 @@ export async function executeManageWorkflows(
65
65
  isError: false,
66
66
  };
67
67
  }
68
+ case "get_result": {
69
+ if (!runId) {
70
+ return {
71
+ content: '"run_id" is required for action "get_result".',
72
+ isError: true,
73
+ };
74
+ }
75
+ // The full result payload rides on the run record (journal getRun);
76
+ // `status` omits it to stay lightweight, so this action returns it in
77
+ // full. The completion-summary wake truncates large results and points
78
+ // the assistant here for the complete value.
79
+ const run = manager.status(runId);
80
+ if (!run || !ownsRun(run)) {
81
+ return {
82
+ content: JSON.stringify({ runId, found: false }),
83
+ isError: false,
84
+ };
85
+ }
86
+ return {
87
+ content: JSON.stringify({
88
+ runId: run.id,
89
+ status: run.status,
90
+ result: run.result ?? null,
91
+ error: run.error ?? null,
92
+ }),
93
+ isError: false,
94
+ };
95
+ }
68
96
  case "abort": {
69
97
  if (!runId) {
70
98
  return {
@@ -148,7 +176,7 @@ export async function executeManageWorkflows(
148
176
  default:
149
177
  return {
150
178
  content:
151
- 'Unknown action. Use one of: "status", "abort", "resume", "list_runs", "list_profiles".',
179
+ 'Unknown action. Use one of: "status", "get_result", "abort", "resume", "list_runs", "list_profiles".',
152
180
  isError: true,
153
181
  };
154
182
  }
@@ -276,6 +276,43 @@ describe("manage_workflows", () => {
276
276
  expect(JSON.parse(res.content).found).toBe(false);
277
277
  });
278
278
 
279
+ test("get_result requires run_id and returns the full result", async () => {
280
+ const missing = await executeManageWorkflows(
281
+ { action: "get_result" },
282
+ makeContext(),
283
+ );
284
+ expect(missing.isError).toBe(true);
285
+
286
+ // not-found / not-owned reports cleanly, without leaking a result
287
+ const notFound = await executeManageWorkflows(
288
+ { action: "get_result", run_id: "nope" },
289
+ makeContext(),
290
+ );
291
+ expect(notFound.isError).toBe(false);
292
+ expect(JSON.parse(notFound.content).found).toBe(false);
293
+
294
+ // an owned, finished run returns the full (untruncated) result payload
295
+ statusMock.mockReturnValueOnce({
296
+ id: "r5",
297
+ conversationId: "conv-1",
298
+ status: "completed",
299
+ result: { scores: [1, 2, 3], note: "the full result lives here" },
300
+ error: null,
301
+ } as unknown);
302
+ const ok = await executeManageWorkflows(
303
+ { action: "get_result", run_id: "r5" },
304
+ makeContext(),
305
+ );
306
+ expect(ok.isError).toBe(false);
307
+ const parsed = JSON.parse(ok.content);
308
+ expect(parsed.runId).toBe("r5");
309
+ expect(parsed.status).toBe("completed");
310
+ expect(parsed.result).toEqual({
311
+ scores: [1, 2, 3],
312
+ note: "the full result lives here",
313
+ });
314
+ });
315
+
279
316
  test("resume requires run_id and delegates to resume()", async () => {
280
317
  const missing = await executeManageWorkflows(
281
318
  { action: "resume" },
@@ -540,7 +540,9 @@ function buildCompletionSummary(
540
540
  `Tokens: ${result.inputTokens} in / ${result.outputTokens} out.`,
541
541
  ];
542
542
  if (result.status === "completed") {
543
- lines.push(`Result: ${truncateForSummary(stringifyResult(result.result))}`);
543
+ lines.push(
544
+ `Result: ${truncateForSummary(stringifyResult(result.result), runId)}`,
545
+ );
544
546
  } else {
545
547
  lines.push(`Outcome: ${run?.error ?? result.status}`);
546
548
  }
@@ -557,12 +559,13 @@ function buildCompletionSummary(
557
559
  const MAX_SUMMARY_RESULT_CHARS = 2000;
558
560
 
559
561
  /** Bound a result tail for the summary; the full value stays on the run row. */
560
- function truncateForSummary(s: string): string {
562
+ function truncateForSummary(s: string, runId: string): string {
561
563
  if (s.length <= MAX_SUMMARY_RESULT_CHARS) return s;
562
564
  const omitted = s.length - MAX_SUMMARY_RESULT_CHARS;
563
565
  return (
564
566
  `${s.slice(0, MAX_SUMMARY_RESULT_CHARS)}… ` +
565
- `[truncated ${omitted} chars; full result on the workflow run record]`
567
+ `[truncated ${omitted} chars — fetch the full result with manage_workflows ` +
568
+ `{ action: "get_result", run_id: "${runId}" }]`
566
569
  );
567
570
  }
568
571