owenloop 0.5.18 → 0.5.19

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project are documented here. The format is based on
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5
5
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.5.19](https://github.com/typicalday/owenloop/compare/v0.5.18...v0.5.19) (2026-08-22)
8
+
9
+
10
+ ### Features
11
+
12
+ * **work:** submit an artifact by file reference ([#283](https://github.com/typicalday/owenloop/issues/283)) ([8f0f988](https://github.com/typicalday/owenloop/commit/8f0f988f5a05952340014e40a8aefd4353efa46c))
13
+
7
14
  ## [0.5.18](https://github.com/typicalday/owenloop/compare/v0.5.17...v0.5.18) (2026-08-22)
8
15
 
9
16
 
@@ -48,6 +48,8 @@ export interface HoldMcpDeps {
48
48
  hub: HubClient;
49
49
  workflow: string;
50
50
  run: string;
51
+ /** Sole containment root for submit value files. */
52
+ workdir: string;
51
53
  /** Positive registration list. Absent exposes the full three-tool server. */
52
54
  tools?: readonly HoldMcpToolName[];
53
55
  /** Hub origin used to resolve the local machine signing key. */
@@ -37,6 +37,7 @@
37
37
  */
38
38
  import { textResult } from "../mcp/server.js";
39
39
  import { buildSubmitProof } from "../submit-proof.js";
40
+ import { readSubmitValueFile } from "../submit-file.js";
40
41
  import { normalizeSubmitValue } from "../submit-value.js";
41
42
  import { createHoldLoop } from "./loop.js";
42
43
  export const HOLD_MCP_TOOL_NAMES = ['get_order', 'submit', 'reject', 'ask'];
@@ -160,15 +161,20 @@ export function createHoldMcp(deps) {
160
161
  };
161
162
  const submitTool = {
162
163
  name: 'submit',
163
- description: 'Submit a receipt for one owed output path of this order. Set done=true when this is the final value for the path. When the hub reports the run has closed, the holder releases and exits.',
164
+ description: 'Submit a receipt for one owed output path of this order. Provide exactly one of value or valueFile. valueFile names a UTF-8 JSON document inside the run working directory. Set done=true when this is the final value for the path. When the hub reports the run has closed, the holder releases and exits.',
164
165
  inputSchema: {
165
166
  type: 'object',
166
- required: ['path', 'value'],
167
+ required: ['path'],
167
168
  properties: {
168
169
  path: { type: 'string', description: 'The owed output path to submit a receipt for.' },
169
170
  value: { description: 'The receipt value (any JSON).' },
171
+ valueFile: { type: 'string', description: 'A UTF-8 JSON file inside the run working directory.' },
170
172
  done: { type: 'boolean', description: 'Mark this the final submit for the path.' },
171
173
  },
174
+ oneOf: [
175
+ { required: ['value'] },
176
+ { required: ['valueFile'] },
177
+ ],
172
178
  additionalProperties: false,
173
179
  },
174
180
  handler: async (args) => {
@@ -179,8 +185,14 @@ export function createHoldMcp(deps) {
179
185
  if (typeof path !== 'string' || path === '') {
180
186
  return textResult({ error: 'submit requires a non-empty string "path"' }, true);
181
187
  }
182
- if (!('value' in args)) {
183
- return textResult({ error: 'submit requires a "value"' }, true);
188
+ const hasValue = Object.prototype.hasOwnProperty.call(args, 'value');
189
+ const hasValueFile = Object.prototype.hasOwnProperty.call(args, 'valueFile');
190
+ if (hasValue === hasValueFile) {
191
+ return textResult({ error: 'submit-value-source-invalid: provide exactly one of value or valueFile' }, true);
192
+ }
193
+ const valueFile = args['valueFile'];
194
+ if (hasValueFile && (typeof valueFile !== 'string' || valueFile.trim() === '')) {
195
+ return textResult({ error: 'submit-value-file-invalid: valueFile must be a non-empty string' }, true);
184
196
  }
185
197
  const done = args['done'];
186
198
  // Normalize a JSON-encoded string value to the object the hub would
@@ -188,8 +200,11 @@ export function createHoldMcp(deps) {
188
200
  // the proof (it stores normalized bytes the signature does not cover),
189
201
  // silently, on both sides — see `../submit-value.ts`. One value is used
190
202
  // for both the proof and the wire so the two can never diverge.
191
- const value = normalizeSubmitValue(args['value']);
192
203
  try {
204
+ const rawValue = hasValue
205
+ ? args['value']
206
+ : await readSubmitValueFile(deps.workdir, valueFile);
207
+ const value = normalizeSubmitValue(rawValue);
193
208
  // Submit is also a dynamic-data boundary. Fetch and gate the bound
194
209
  // packet even when no origin was supplied for submit-proof signing;
195
210
  // otherwise a direct submit call could bypass MCP consume-side
@@ -320,6 +320,7 @@ export async function run(args, deps = {}) {
320
320
  hub,
321
321
  workflow: target.workflow,
322
322
  run: target.run,
323
+ workdir: process.cwd(),
323
324
  ...(parsed.mcpTools !== undefined ? { tools: parsed.mcpTools } : {}),
324
325
  origin,
325
326
  env,
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Read a submit value from a JSON document contained in a run worktree.
3
+ *
4
+ * The lexical check rejects traversal before probing the filesystem. The
5
+ * canonical check rejects symlinks whose target leaves the worktree.
6
+ */
7
+ export declare function readSubmitValueFile(workdir: string, valueFile: unknown): Promise<unknown>;
@@ -0,0 +1,47 @@
1
+ import { readFile, realpath } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
3
+ import { isInside } from "./harness/gatekeeper.js";
4
+ function errorMessage(error) {
5
+ return error instanceof Error ? error.message : String(error);
6
+ }
7
+ /**
8
+ * Read a submit value from a JSON document contained in a run worktree.
9
+ *
10
+ * The lexical check rejects traversal before probing the filesystem. The
11
+ * canonical check rejects symlinks whose target leaves the worktree.
12
+ */
13
+ export async function readSubmitValueFile(workdir, valueFile) {
14
+ if (typeof valueFile !== 'string' || valueFile.trim() === '') {
15
+ throw new Error(`submit-value-file-invalid: valueFile must be a non-empty string: ${String(valueFile)}`);
16
+ }
17
+ const candidate = resolve(workdir, valueFile);
18
+ if (!isInside(workdir, candidate)) {
19
+ throw new Error(`submit-value-file-outside-workdir: ${valueFile} is outside the run workdir`);
20
+ }
21
+ let canonicalCandidate;
22
+ try {
23
+ const canonicalWorkdir = await realpath(workdir);
24
+ canonicalCandidate = await realpath(candidate);
25
+ if (!isInside(canonicalWorkdir, canonicalCandidate)) {
26
+ throw new Error(`submit-value-file-outside-workdir: ${valueFile} is outside the run workdir`);
27
+ }
28
+ }
29
+ catch (error) {
30
+ if (error instanceof Error && error.message.startsWith('submit-value-file-outside-workdir:'))
31
+ throw error;
32
+ throw new Error(`submit-value-file-read-failed: could not read ${valueFile}: ${errorMessage(error)}`);
33
+ }
34
+ let text;
35
+ try {
36
+ text = await readFile(canonicalCandidate, 'utf8');
37
+ }
38
+ catch (error) {
39
+ throw new Error(`submit-value-file-read-failed: could not read ${valueFile}: ${errorMessage(error)}`);
40
+ }
41
+ try {
42
+ return JSON.parse(text);
43
+ }
44
+ catch (error) {
45
+ throw new Error(`submit-value-file-invalid-json: could not parse ${valueFile}: ${errorMessage(error)}`);
46
+ }
47
+ }
package/docs/cli.md CHANGED
@@ -703,6 +703,20 @@ mint or log credentials. If the stored human credential is an expiring OAuth
703
703
  credential, the decision path may refresh it and persist a rotated token under
704
704
  the shared credential lock before answering the hub.
705
705
 
706
+ ### `work hold --mcp` — machine-attached MCP holder
707
+
708
+ `owenloop work hold --order <workflow>/<run> --mcp` keeps the order lease warm
709
+ and exposes the holder's MCP tools over stdio. Its `submit` tool requires
710
+ exactly one of `value` or `valueFile`, along with the owed `path`; `done: true`
711
+ marks the final receipt for that path.
712
+
713
+ `valueFile` is a UTF-8 JSON document resolved inside the holder's run working
714
+ directory. Traversal, outside absolute paths, and symlinks that escape that
715
+ directory are refused. The file is parsed as JSON before the normal submit
716
+ value normalization, so the parsed value is the one sent to the hub and used
717
+ for any submit proof. There is no client-side artifact-size limit; the hub's
718
+ existing size policy still applies.
719
+
706
720
  ### `util modifier-init`
707
721
 
708
722
  `owenloop util modifier-init --default <value>` is a deterministic helper for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owenloop",
3
- "version": "0.5.18",
3
+ "version": "0.5.19",
4
4
  "description": "Deterministic rails for agentic workflows. Declare steps and dependencies; the engine guarantees order, redoes what changes invalidate, and stops what keeps failing — instead of hoping the agent follows through.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "typicalday",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owenloop",
3
- "version": "0.5.18",
3
+ "version": "0.5.19",
4
4
  "description": "Claude Code driver for owenloop — cross-harness shift and conduct skills driven by the owenloop CLI, plus one hub control-plane MCP server backing an author skill and a fallback worker, for conducting and authoring workflows against your hosted owenloop server.",
5
5
  "author": {
6
6
  "name": "Typical Day"
@@ -7,7 +7,7 @@
7
7
  "mcp"
8
8
  ],
9
9
  "env": {
10
- "OWENLOOP_PLUGIN_VERSION": "0.5.18"
10
+ "OWENLOOP_PLUGIN_VERSION": "0.5.19"
11
11
  }
12
12
  }
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owenloop",
3
- "version": "0.5.18",
3
+ "version": "0.5.19",
4
4
  "description": "Codex plugin for the owenloop workflow engine.",
5
5
  "skills": "./skills/",
6
6
  "mcpServers": "./.mcp.json"
@@ -6,7 +6,7 @@
6
6
  "mcp"
7
7
  ],
8
8
  "env": {
9
- "OWENLOOP_PLUGIN_VERSION": "0.5.18"
9
+ "OWENLOOP_PLUGIN_VERSION": "0.5.19"
10
10
  },
11
11
  "env_vars": [
12
12
  "HOME",