@relayflows/surface 2.0.42 → 2.0.43
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/AUTHORING.md +2193 -0
- package/README.md +6 -0
- package/dist/context.d.ts +14 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/memory.d.ts +1 -1
- package/dist/memory.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/context.ts +14 -0
- package/src/memory.ts +1 -1
package/README.md
CHANGED
|
@@ -48,6 +48,12 @@ export default flow<{ base: string }>("release-note", {}, async (f, input) => {
|
|
|
48
48
|
});
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
Commands lease for **30s by default**, **15m maximum**. Pass `{ timeout: '5m' }`
|
|
52
|
+
for longer work, for example `await f.run('git fetch', { timeout: '5m' })`.
|
|
53
|
+
See the shipped [authoring reference](AUTHORING.md) for this package's
|
|
54
|
+
signatures, option fields, completion reasons, named gates and helper
|
|
55
|
+
namespaces. Dependency types, such as helper clients, are named by import.
|
|
56
|
+
|
|
51
57
|
Run it with inline JSON or the path to a JSON file:
|
|
52
58
|
|
|
53
59
|
```sh
|
package/dist/context.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ export interface AgentResult {
|
|
|
16
16
|
* final message is a JSON object (that object is the output, unmodified).
|
|
17
17
|
*/
|
|
18
18
|
artifacts: string[];
|
|
19
|
+
/**
|
|
20
|
+
* The CLI session this step ran as (Claude's session id, Codex's thread
|
|
21
|
+
* id), when the CLI reported one. Pass it as a later step's `resume` to
|
|
22
|
+
* continue the same conversation.
|
|
23
|
+
*/
|
|
24
|
+
sessionId?: string;
|
|
19
25
|
}
|
|
20
26
|
/** Per-step declarations: validated and recorded, not currently enforced (gate 8 / #442).
|
|
21
27
|
* Separate from flow-wide FlowHeader.workspace / tools.fs scopes.
|
|
@@ -49,6 +55,14 @@ export interface AgentOptions {
|
|
|
49
55
|
* `transport: 'relay'`. See docs/SURFACE.md.
|
|
50
56
|
*/
|
|
51
57
|
cwd?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Continue a CLI session instead of starting a new one: an earlier step's
|
|
60
|
+
* `AgentResult.sessionId`. Claude and Codex resume it from their own
|
|
61
|
+
* session store (`~/.claude`, `~/.codex`), so it works only where that
|
|
62
|
+
* store survives — such as a sandbox reused for the same pull request.
|
|
63
|
+
* Other CLIs refuse the step. Not supported with `transport: 'relay'`.
|
|
64
|
+
*/
|
|
65
|
+
resume?: string;
|
|
52
66
|
/**
|
|
53
67
|
* Dispatch transport (flows#385). `'direct'` (default) spawns the CLI as a
|
|
54
68
|
* local subprocess. `'relay'` posts to agent-relay so the agent registers
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,SAAS,GAAG,SAAS,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO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,CAAC,cAAc,CAAC,CAAC;IAC7D;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAChE,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;CACtB"}
|
package/dist/memory.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface MemoryHelper {
|
|
|
13
13
|
recall(query: string, options?: MemoryRecallOptions): Promise<HistoryEntry[]>;
|
|
14
14
|
/** Best matching decision trajectory, or an empty array. No journal step. */
|
|
15
15
|
why(task: string): Promise<TrajectoryEntry[]>;
|
|
16
|
-
/**
|
|
16
|
+
/** Journals the finding on the durable root run, then persists it to this flow's script memory; later runs see it via recall/why. Idempotent per finding. Must be awaited. */
|
|
17
17
|
learn(finding: MemoryFinding): Promise<void>;
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=memory.d.ts.map
|
package/dist/memory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5E,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC7D,0DAA0D;AAC1D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACjE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9E,6EAA6E;IAC7E,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC9C,
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5E,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC7D,0DAA0D;AAC1D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACjE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9E,6EAA6E;IAC7E,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC9C,8KAA8K;IAC9K,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@relayflows/surface",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.43",
|
|
4
4
|
"description": "TypeScript authoring surface for Relayflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"dist",
|
|
32
|
-
"src"
|
|
32
|
+
"src",
|
|
33
|
+
"AUTHORING.md"
|
|
33
34
|
],
|
|
34
35
|
"scripts": {
|
|
35
36
|
"gen": "node ../../scripts/generate-helpers.mjs",
|
|
@@ -39,7 +40,9 @@
|
|
|
39
40
|
"typecheck": "tsc --noEmit",
|
|
40
41
|
"typecheck:regressions": "tsc -p ../../regressions/tsconfig.json && tsc -p tsconfig.test.json && node scripts/check-generated-helpers.mjs",
|
|
41
42
|
"typecheck:examples": "tsc -p ../../examples/tsconfig.json",
|
|
42
|
-
"test": "bun run build && tsc -p tsconfig.test.json && vitest run"
|
|
43
|
+
"test": "bun run build && tsc -p tsconfig.test.json && vitest run",
|
|
44
|
+
"gen:docs": "node ../../scripts/generate-authoring-reference.mjs",
|
|
45
|
+
"check:docs": "node ../../scripts/check-authoring-reference.mjs && node --test ../../scripts/authoring-reference.test.mjs"
|
|
43
46
|
},
|
|
44
47
|
"license": "Apache-2.0",
|
|
45
48
|
"engines": {
|
package/src/context.ts
CHANGED
|
@@ -17,6 +17,12 @@ export interface AgentResult {
|
|
|
17
17
|
* final message is a JSON object (that object is the output, unmodified).
|
|
18
18
|
*/
|
|
19
19
|
artifacts: string[];
|
|
20
|
+
/**
|
|
21
|
+
* The CLI session this step ran as (Claude's session id, Codex's thread
|
|
22
|
+
* id), when the CLI reported one. Pass it as a later step's `resume` to
|
|
23
|
+
* continue the same conversation.
|
|
24
|
+
*/
|
|
25
|
+
sessionId?: string;
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
/** Per-step declarations: validated and recorded, not currently enforced (gate 8 / #442).
|
|
@@ -52,6 +58,14 @@ export interface AgentOptions {
|
|
|
52
58
|
* `transport: 'relay'`. See docs/SURFACE.md.
|
|
53
59
|
*/
|
|
54
60
|
cwd?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Continue a CLI session instead of starting a new one: an earlier step's
|
|
63
|
+
* `AgentResult.sessionId`. Claude and Codex resume it from their own
|
|
64
|
+
* session store (`~/.claude`, `~/.codex`), so it works only where that
|
|
65
|
+
* store survives — such as a sandbox reused for the same pull request.
|
|
66
|
+
* Other CLIs refuse the step. Not supported with `transport: 'relay'`.
|
|
67
|
+
*/
|
|
68
|
+
resume?: string;
|
|
55
69
|
/**
|
|
56
70
|
* Dispatch transport (flows#385). `'direct'` (default) spawns the CLI as a
|
|
57
71
|
* local subprocess. `'relay'` posts to agent-relay so the agent registers
|
package/src/memory.ts
CHANGED
|
@@ -15,6 +15,6 @@ export interface MemoryHelper {
|
|
|
15
15
|
recall(query: string, options?: MemoryRecallOptions): Promise<HistoryEntry[]>;
|
|
16
16
|
/** Best matching decision trajectory, or an empty array. No journal step. */
|
|
17
17
|
why(task: string): Promise<TrajectoryEntry[]>;
|
|
18
|
-
/**
|
|
18
|
+
/** Journals the finding on the durable root run, then persists it to this flow's script memory; later runs see it via recall/why. Idempotent per finding. Must be awaited. */
|
|
19
19
|
learn(finding: MemoryFinding): Promise<void>;
|
|
20
20
|
}
|