@loomhelm/multi-task-flow 0.2.9 → 0.2.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/README.md CHANGED
@@ -17,16 +17,16 @@ bunx --bun --package @loomhelm/multi-task-flow@compat-v1 multi-task-flow flow vi
17
17
  可重复的生产安装必须固定 package version;`@compat-v1` 只用于接收同一兼容线内经过门禁的最新版本,`latest` 不构成身份或兼容性证明。运行前置条件是 `bun --version` 返回 `1.4.4`;Bun 由宿主提供,包不会替换或升级它。
18
18
 
19
19
  ```sh
20
- bunx --bun --package @loomhelm/multi-task-flow@0.2.9 multi-task-flow skills list
20
+ bunx --bun --package @loomhelm/multi-task-flow@0.2.10 multi-task-flow skills list
21
21
  bunx --bun --package @loomhelm/multi-task-flow@compat-v1 multi-task-flow skills list
22
- bunx --bun --package @loomhelm/multi-task-flow@0.2.9 multi-task-flow flow view --input - < view-request.json
22
+ bunx --bun --package @loomhelm/multi-task-flow@0.2.10 multi-task-flow flow view --input - < view-request.json
23
23
  ```
24
24
 
25
25
  当前源码投影的内部合同矩阵如下;`source_sha`、`merge_sha`、`build_id`、`canonicalDigestAlgorithm=path-byte-v2`、canonical digest 和 raw npm integrity 是每个候选构建的独立身份字段,不能由这张静态表推断。
26
26
 
27
27
  | 维度 | 当前值 |
28
28
  | - | - |
29
- | package | `@loomhelm/multi-task-flow@0.2.9` |
29
+ | package | `@loomhelm/multi-task-flow@0.2.10` |
30
30
  | compatibility line | `compat-v1` |
31
31
  | Skill | `2.7.6` |
32
32
  | ledger contract | `3` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhelm/multi-task-flow",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Versioned Bun CLI and complete Multi-task Flow Skill runtime for Loomhelm",
5
5
  "type": "module",
6
6
  "engines": {
package/src/cli/flow.ts CHANGED
@@ -1,6 +1,18 @@
1
1
  import { loadConfig } from '../config.ts';
2
+ import type { ClientConfig } from '../config.ts';
3
+ import type { ProcessOptions } from '../runtime/process.ts';
2
4
  import { SkillsRuntime } from '../toolkit.ts';
3
5
 
6
+ export function flowProcessOptions(config: Pick<ClientConfig, 'processTimeoutMs' | 'maxOutputBytes'>, input: Uint8Array, socket?: string): ProcessOptions {
7
+ return {
8
+ input,
9
+ cwd: process.cwd(),
10
+ timeoutMs: config.processTimeoutMs,
11
+ maxOutputBytes: config.maxOutputBytes,
12
+ env: { ...process.env, ...(socket ? { LOOMHELM_CODEX_APP_SERVER_SOCKET: socket } : {}) },
13
+ };
14
+ }
15
+
4
16
  export async function runFlowCommand(args: string[], configPath?: string): Promise<void> {
5
17
  if (args[0] === 'help' || !args.length) {
6
18
  console.log('flow COMMAND --input - [--socket PATH]; original Multi-task Flow JSON contract, schema_version=2 / contract_version=2'); return;
@@ -22,10 +34,7 @@ export async function runFlowCommand(args: string[], configPath?: string): Promi
22
34
  chunks.push(data);
23
35
  }
24
36
  const selected = socket ?? config.codexAppServerSocket;
25
- const result = await new SkillsRuntime().run('skills/multi-task-flow/scripts/orchestrate.ts', args, {
26
- input: Buffer.concat(chunks), timeoutMs: config.processTimeoutMs, maxOutputBytes: config.maxOutputBytes,
27
- env: { ...process.env, ...(selected ? { LOOMHELM_CODEX_APP_SERVER_SOCKET: selected } : {}) },
28
- });
37
+ const result = await new SkillsRuntime().run('skills/multi-task-flow/scripts/orchestrate.ts', args, flowProcessOptions(config, Buffer.concat(chunks), selected));
29
38
  process.stdout.write(result.stdout); process.stderr.write(result.stderr);
30
39
  process.exitCode = result.code ?? 1;
31
40
  }
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "schemaVersion": 3,
3
3
  "packageName": "@loomhelm/multi-task-flow",
4
- "packageVersion": "0.2.9",
4
+ "packageVersion": "0.2.10",
5
5
  "compatibilityLine": "compat-v1",
6
6
  "skillVersion": "2.7.6",
7
7
  "sourceCommit": "505961771a0d2496155d23132a8c0bd8beac0a24",
8
- "sourceSha": "afcad89d3a44aff119a6f68e475c1fb33020ca4e",
9
- "mergeSha": "afcad89d3a44aff119a6f68e475c1fb33020ca4e",
10
- "candidateSha": "afcad89d3a44aff119a6f68e475c1fb33020ca4e",
8
+ "sourceSha": "a1e8bab5609cb8c5336f6cf77a4c9d8832ca05d2",
9
+ "mergeSha": "a1e8bab5609cb8c5336f6cf77a4c9d8832ca05d2",
10
+ "candidateSha": "a1e8bab5609cb8c5336f6cf77a4c9d8832ca05d2",
11
11
  "dirty": false,
12
12
  "runtime": "bun@1.4.4",
13
13
  "identity": {
14
14
  "packageName": "@loomhelm/multi-task-flow",
15
- "packageVersion": "0.2.9",
15
+ "packageVersion": "0.2.10",
16
16
  "compatibilityLine": "compat-v1",
17
17
  "skillVersion": "2.7.6",
18
- "sourceSha": "afcad89d3a44aff119a6f68e475c1fb33020ca4e",
19
- "mergeSha": "afcad89d3a44aff119a6f68e475c1fb33020ca4e",
18
+ "sourceSha": "a1e8bab5609cb8c5336f6cf77a4c9d8832ca05d2",
19
+ "mergeSha": "a1e8bab5609cb8c5336f6cf77a4c9d8832ca05d2",
20
20
  "dirty": false,
21
21
  "contracts": {
22
22
  "ledgerContract": 3,
@@ -25,14 +25,14 @@
25
25
  "viewerContract": 5,
26
26
  "serviceVersion": "1"
27
27
  },
28
- "tarballDigest": "2f359477fac55d89ffc30f362d2fc7b08bf14ac5157e6c1b26d647fdbaab8a95",
29
- "gitTag": "multi-task-flow-v0.2.9",
28
+ "tarballDigest": "23997425b1418dc09ff217757fb44782b312fb053428501a4bf4e2915dc70bbc",
29
+ "gitTag": "multi-task-flow-v0.2.10",
30
30
  "canonicalDigestAlgorithm": "path-byte-v2",
31
- "buildId": "1936720e35441f4c31520c46c183f7fa58780b39d9c78c273fc4a6c7219a2ad6"
31
+ "buildId": "6cb3600e36e891988af1941a26d4716e96b8c141aa1b2998c55d234c6b631356"
32
32
  },
33
- "buildId": "1936720e35441f4c31520c46c183f7fa58780b39d9c78c273fc4a6c7219a2ad6",
34
- "tarballDigest": "2f359477fac55d89ffc30f362d2fc7b08bf14ac5157e6c1b26d647fdbaab8a95",
35
- "gitTag": "multi-task-flow-v0.2.9",
33
+ "buildId": "6cb3600e36e891988af1941a26d4716e96b8c141aa1b2998c55d234c6b631356",
34
+ "tarballDigest": "23997425b1418dc09ff217757fb44782b312fb053428501a4bf4e2915dc70bbc",
35
+ "gitTag": "multi-task-flow-v0.2.10",
36
36
  "canonicalDigestAlgorithm": "path-byte-v2",
37
37
  "dependenciesBundled": false,
38
38
  "dependencies": [
@@ -7873,7 +7873,7 @@
7873
7873
  },
7874
7874
  {
7875
7875
  "path": "skills/multi-task-flow/tests/service-fixture.ts",
7876
- "sha256": "45f14b79125c35268ec84df5d524f405f291ba023b3407fdd063d705e1a620e6"
7876
+ "sha256": "fecb2f9836d4a205c197b907595a8ba069678e35cb78d70fe325179c88e20aa0"
7877
7877
  },
7878
7878
  {
7879
7879
  "path": "skills/multi-task-flow/tests/service-lifecycle.test.ts",
@@ -7885,7 +7885,7 @@
7885
7885
  },
7886
7886
  {
7887
7887
  "path": "skills/multi-task-flow/tests/shared-service.test.ts",
7888
- "sha256": "1be51ad28b3861045bdfd30616bc8184698242ebdb5a74a12a960d25b28bbb92"
7888
+ "sha256": "b7db4898f8c40a6b7b9b04107335e8111719e38bca863f02734c106ca50e4922"
7889
7889
  },
7890
7890
  {
7891
7891
  "path": "skills/multi-task-flow/tests/single-delivery-unit.test.ts",
@@ -8285,7 +8285,7 @@
8285
8285
  },
8286
8286
  {
8287
8287
  "path": "skills/source-manifest.json",
8288
- "sha256": "04d61df340491f6b8a6d57b8dc12a58d5104336d631c0c2f1a95ad43475e2444"
8288
+ "sha256": "11684970f6b691895384012c153b0d69fbacf85c8a51548dbb1a5358146c0a01"
8289
8289
  },
8290
8290
  {
8291
8291
  "path": "skills/spec-sync/SKILL.md",
@@ -2,7 +2,7 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "packageName": "@loomhelm/multi-task-flow",
5
- "packageVersion": "0.2.9",
5
+ "packageVersion": "0.2.10",
6
6
  "compatibilityLine": "compat-v1",
7
7
  "skillVersion": "2.7.6",
8
8
  "repository": {
@@ -27,11 +27,19 @@ export function fixtureRelease(root: string, name = "bundle", options: { readOnl
27
27
  writeFileSync(join(source, "manifest.json"), JSON.stringify(result));
28
28
  return { source, manifest: result };
29
29
  }
30
- export function fixtureRun(root: string, id = "demo-run") {
30
+ export function fixtureRun(root: string, id = "demo-run", contract: 2 | 3 = 2) {
31
31
  const run = createDemoLedger(); run.orchestration_id = id;
32
32
  run.schema_version = 2;
33
33
  run.source_schema_version = null;
34
- run.contract_version = 2;
34
+ run.contract_version = contract;
35
+ if (contract === 3) {
36
+ run.version = versionEnvelope;
37
+ const sharedTask = run.tasks.find((task) => task.kind === "contribution");
38
+ if (!sharedTask) throw new Error("Contract-3 fixture needs a contribution task");
39
+ sharedTask.execution_owner = "delivery_agent";
40
+ sharedTask.conversation_policy = "delivery_owned";
41
+ sharedTask.delivery_policy = "shared_delivery_unit";
42
+ }
35
43
  const store = new LedgerStore(root, id); store.create(run);
36
44
  return { run, store };
37
45
  }
@@ -79,6 +79,19 @@ test("multi-run routing has one listener, authenticated APIs and lazy watchers",
79
79
  expect(viewer.watcherCount).toBe(0);
80
80
  expect((await fetch(base + "/api/v1/lease", { method: "POST", headers: { ...headers, origin: "https://foreign.example" }, body: "{}" })).status).toBe(403);
81
81
  });
82
+ test("one worker serves consecutive contract-3 run pages", async () => {
83
+ const { root, state } = fixture(); const release = fixtureRelease(root);
84
+ fixtureRun(state.paths.data, "contract3-first", 3); fixtureRun(state.paths.data, "contract3-second", 3);
85
+ const viewer = await startSharedViewer(state, release.manifest, join(release.source, "skills/multi-task-flow/dist"), 0); servers.push(viewer);
86
+ const base = `http://127.0.0.1:${viewer.port}`;
87
+ const headers = { authorization: "Bearer " + new ServiceAuth(state).credential() };
88
+ const responses = await Promise.all([
89
+ fetch(base + "/runs/contract3-first/api/view", { headers }),
90
+ fetch(base + "/runs/contract3-second/api/view", { headers }),
91
+ ]);
92
+ expect(responses.map((response) => response.status)).toEqual([200, 200]);
93
+ for (const response of responses) expect((await response.json()).view.orchestration.contract_version).toBe(3);
94
+ });
82
95
  test("target tickets authenticate on the run route and recover safely", async () => {
83
96
  const { root, state } = fixture(); const release = fixtureRelease(root); fixtureRun(state.paths.data);
84
97
  const viewer = await startSharedViewer(state, release.manifest, join(release.source, "skills/multi-task-flow/dist"), 0); servers.push(viewer);
@@ -14839,7 +14839,7 @@
14839
14839
  "path": "skills/multi-task-flow/tests/service-fixture.ts",
14840
14840
  "sourceBlob": "7ad70a1feb5391af9b326c8a20db52e3f14a901b",
14841
14841
  "sourceSha256": "2059550a06f6ba196e4665eac1e93f1b561ccf4041b4fc8b816f18b106d53b80",
14842
- "installedSha256": "45f14b79125c35268ec84df5d524f405f291ba023b3407fdd063d705e1a620e6",
14842
+ "installedSha256": "fecb2f9836d4a205c197b907595a8ba069678e35cb78d70fe325179c88e20aa0",
14843
14843
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation",
14844
14844
  "sourcePath": "skills/multi-task-flow-runtime/tests/service-fixture.ts"
14845
14845
  },
@@ -14848,7 +14848,7 @@
14848
14848
  "path": "skills/multi-task-flow/tests/shared-service.test.ts",
14849
14849
  "sourceBlob": "ec1f11437aae62a1a95ee37da6aba33726b4095b",
14850
14850
  "sourceSha256": "ec28a45c302aaa4acfa4b8cf25a8e7fbf6079b72ab7afdc38e1bc5280d17bba7",
14851
- "installedSha256": "1be51ad28b3861045bdfd30616bc8184698242ebdb5a74a12a960d25b28bbb92",
14851
+ "installedSha256": "b7db4898f8c40a6b7b9b04107335e8111719e38bca863f02734c106ca50e4922",
14852
14852
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation",
14853
14853
  "sourcePath": "skills/multi-task-flow-runtime/tests/shared-service.test.ts"
14854
14854
  },