@loomhelm/multi-task-flow 0.2.8 → 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 +14 -14
- package/package.json +2 -2
- package/src/cli/flow.ts +13 -4
- package/src/cli/service.ts +26 -0
- package/src/cli.ts +3 -1
- package/toolkit/artifact-manifest.json +69 -73
- package/toolkit/package.json +1 -1
- package/toolkit/skills/bin/check_source_policy.ts +13 -7
- package/toolkit/skills/bin/multi_task_platform_gate.ts +2 -2
- package/toolkit/skills/bin/tests/core/package_scripts.test.ts +1 -1
- package/toolkit/skills/bin/tests/plan/multi-task-flow.test.ts +3 -3
- package/toolkit/skills/catalog.json +0 -1
- package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/data-and-scripts.md +8 -6
- package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/execution.md +1 -1
- package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/plan-revision-and-change-audit.md +1 -1
- package/toolkit/skills/docs/vendor/dot-codex/design/multi-task-flow/web-template.md +1 -1
- package/toolkit/skills/docs/vendor/dot-codex/specs/a4ge9-stable-preview-runtime/IMPLEMENTATION.md +0 -2
- package/toolkit/skills/docs/vendor/dot-codex/specs/a4ge9-stable-preview-runtime/SPEC.md +0 -1
- package/toolkit/skills/docs/vendor/dot-codex/specs/dev-plan-standalone-typescript-finalizer/IMPLEMENTATION.md +1 -1
- package/toolkit/skills/docs/vendor/dot-codex/specs/multi-task-flow/IMPLEMENTATION.md +3 -3
- package/toolkit/skills/docs/vendor/dot-codex/specs/multi-task-flow/SCHEMA.md +4 -4
- package/toolkit/skills/docs/vendor/dot-codex/specs/stable-preview-runtime/IMPLEMENTATION.md +0 -2
- package/toolkit/skills/docs/vendor/dot-codex/specs/stable-preview-runtime/SPEC.md +0 -1
- package/toolkit/skills/multi-task-flow/SKILL.md +65 -47
- package/toolkit/skills/multi-task-flow/dist/app.css +1 -1
- package/toolkit/skills/multi-task-flow/dist/app.js +74 -74
- package/toolkit/skills/multi-task-flow/dist/index.html +3 -3
- package/toolkit/skills/multi-task-flow/lib/atomic-orchestration.ts +1 -0
- package/toolkit/skills/multi-task-flow/lib/engine.ts +65 -7
- package/toolkit/skills/multi-task-flow/lib/package-source.ts +5 -5
- package/toolkit/skills/multi-task-flow/lib/schema.ts +82 -2
- package/toolkit/skills/multi-task-flow/lib/service-pages.ts +1 -26
- package/toolkit/skills/multi-task-flow/lib/view.ts +16 -0
- package/toolkit/skills/multi-task-flow/references/shared-viewer.md +1 -1
- package/toolkit/skills/multi-task-flow/scripts/check-client-skills.ts +7 -4
- package/toolkit/skills/multi-task-flow/scripts/check-skills-installation.ts +14 -8
- package/toolkit/skills/multi-task-flow/scripts/import-client-skills.ts +1 -1
- package/toolkit/skills/multi-task-flow/scripts/package-client-skills.ts +4 -4
- package/toolkit/skills/multi-task-flow/scripts/test-viewer-source.ts +1 -1
- package/toolkit/skills/multi-task-flow/tests/atomic-orchestration-schema.test.ts +5 -0
- package/toolkit/skills/multi-task-flow/tests/browser/README.md +1 -1
- package/toolkit/skills/multi-task-flow/tests/check-skills-installation.test.ts +12 -38
- package/toolkit/skills/multi-task-flow/tests/delivery-topology.test.ts +33 -0
- package/toolkit/skills/multi-task-flow/tests/orchestrate.test.ts +3 -5
- package/toolkit/skills/multi-task-flow/tests/service-fixture.ts +10 -2
- package/toolkit/skills/multi-task-flow/tests/shared-service.test.ts +13 -0
- package/toolkit/skills/multi-task-flow/tests/ui/details-content.test.ts +9 -0
- package/toolkit/skills/multi-task-flow/tests/ui/responsive-width-contract.test.ts +25 -1
- package/toolkit/skills/multi-task-flow/tests/ui/task-context-menu.test.ts +2 -1
- package/toolkit/skills/multi-task-flow/web/app.css +64 -9
- package/toolkit/skills/multi-task-flow/web/app.ts +33 -14
- package/toolkit/skills/multi-task-flow/web/atomic-graph-view.tsx +1 -1
- package/toolkit/skills/multi-task-flow/web/details-content.ts +49 -38
- package/toolkit/skills/multi-task-flow/web/graph-view.tsx +1 -1
- package/toolkit/skills/multi-task-flow/web/index.html +3 -3
- package/toolkit/skills/multi-task-flow/web/model.ts +1 -1
- package/toolkit/skills/multi-task-flow/web/timeline.ts +11 -8
- package/toolkit/skills/package.json +2 -2
- package/toolkit/skills/source-manifest.json +693 -400
- package/toolkit/skills/support-manifest.json +1 -0
- package/toolkit/skills/multi-task-flow/scripts/serve.ts +0 -218
- package/toolkit/skills/multi-task-flow/tests/serve.test.ts +0 -194
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.
|
|
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.
|
|
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.
|
|
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` |
|
|
@@ -45,7 +45,7 @@ npm 发布需要 npm Trusted Publisher 绑定 `IvanLi-CN/Loomhelm` 与 `skill-re
|
|
|
45
45
|
|
|
46
46
|
```sh
|
|
47
47
|
bun install --frozen-lockfile
|
|
48
|
-
bun install --cwd skills/multi-task-flow --frozen-lockfile
|
|
48
|
+
bun install --cwd skills/multi-task-flow-runtime --frozen-lockfile
|
|
49
49
|
bun --no-install run skills:build
|
|
50
50
|
cd clients/typescript
|
|
51
51
|
bun install --frozen-lockfile
|
|
@@ -54,7 +54,7 @@ bun --no-install run test
|
|
|
54
54
|
bun --no-install src/cli.ts --config config.example.json status
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
发布包构建前需要准备 Skill build inputs 与消费者依赖:`bun install --cwd skills --frozen-lockfile --ignore-scripts --backend=copy`、`bun install --cwd skills/multi-task-flow --frozen-lockfile` 和 `bun install --cwd clients/typescript --frozen-lockfile --ignore-scripts --backend=copy`。随后在 `clients/typescript/` 执行 `bun --no-install run build`,构建会拒绝摘要不一致、缺失 consumer dependency、符号链接资源和非法 package identity。
|
|
57
|
+
发布包构建前需要准备 Skill build inputs 与消费者依赖:`bun install --cwd skills --frozen-lockfile --ignore-scripts --backend=copy`、`bun install --cwd skills/multi-task-flow-runtime --frozen-lockfile` 和 `bun install --cwd clients/typescript --frozen-lockfile --ignore-scripts --backend=copy`。随后在 `clients/typescript/` 执行 `bun --no-install run build`,构建会拒绝摘要不一致、缺失 consumer dependency、符号链接资源和非法 package identity。
|
|
58
58
|
|
|
59
59
|
配置路径显式传入;相对 `stateDir` 相对于配置文件所在目录解析。未传配置时使用 `~/.loomhelm`。配置拒绝未知字段、未知版本及尚未实现的 Connected mode。源码从 `client/` 移入本目录后,示例配置使用 `../../client/.loomhelm`,继续读取仓库中原来的 `client/.loomhelm/`,该目录仍被根 Git 忽略规则排除。此兼容目录只保存状态,不放置客户端源码。
|
|
60
60
|
|
|
@@ -108,9 +108,9 @@ bun --no-install src/cli.ts --config config.example.json codex retry DISPATCH_ID
|
|
|
108
108
|
|
|
109
109
|
完整源包位于包内 `toolkit/skills/`,共享支持位于 `toolkit/skills/bin/`,预构建 viewer 资产位于对应的 Multi-task Flow dist 目录。`skills/source-manifest.json` 记录固定源提交、源摘要、安装摘要和迁移差异;`skills/catalog.json` 记录入口、脚本及依赖强度;`artifact-manifest.json` 记录 schema v3 package identity、`path-byte-v2` canonical digest 和逐文件摘要。资源打包将 TS 源码、完整资源和浏览器资产复制到 `toolkit/`,不复制 production `node_modules`,不转译、不搜索全局 dot-codex 执行代码。Skill 文档中的 `LOOMHELM_TOOLKIT_ROOT` 指向该资源根;`skills run` 原样执行 `.ts` 脚本。包的 bin、exports 和类型入口均指向 `src/`。
|
|
110
110
|
|
|
111
|
-
所有随包执行代码、合同资源和构建支持都位于 `skills/`:共享脚本在 `skills/bin/`,上游合同在 `skills/docs/vendor/dot-codex/`,维护与构建入口在 `skills/multi-task-flow/scripts/`。vendor 仅检出 `skills/` 即可保留完整源资源,不需要修改用户的 sparse checkout 或安装配置。安装目录内执行 `bun install --cwd skills --frozen-lockfile --ignore-scripts --backend=copy` 与 `bun install --cwd skills/multi-task-flow --frozen-lockfile` 准备声明的依赖,再执行 `bun --no-install run --cwd skills build` 仅构建浏览器 JS/CSS;本机 TS 无需编译。外部 Git、Codex 宿主工具及条件性 Skills 仍按既有合同检测,不复制到源包中。
|
|
111
|
+
所有随包执行代码、合同资源和构建支持都位于 `skills/`:共享脚本在 `skills/bin/`,上游合同在 `skills/docs/vendor/dot-codex/`,维护与构建入口在 `skills/multi-task-flow-runtime/scripts/`。vendor 仅检出 `skills/` 即可保留完整源资源,不需要修改用户的 sparse checkout 或安装配置。安装目录内执行 `bun install --cwd skills --frozen-lockfile --ignore-scripts --backend=copy` 与 `bun install --cwd skills/multi-task-flow-runtime --frozen-lockfile` 准备声明的依赖,再执行 `bun --no-install run --cwd skills/multi-task-flow-runtime build` 仅构建浏览器 JS/CSS;本机 TS 无需编译。外部 Git、Codex 宿主工具及条件性 Skills 仍按既有合同检测,不复制到源包中。
|
|
112
112
|
|
|
113
|
-
`bun --no-install skills/multi-task-flow/scripts/check-skills-installation.ts --root <installation-root> --probe` 分别报告源码完整性、Bun 运行时及实际入口探测;宿主能力单独验收。该检查不会修改任何用户级安装或运行账本。
|
|
113
|
+
`bun --no-install skills/multi-task-flow-runtime/scripts/check-skills-installation.ts --root <installation-root> --probe` 分别报告源码完整性、Bun 运行时及实际入口探测;宿主能力单独验收。该检查不会修改任何用户级安装或运行账本。
|
|
114
114
|
|
|
115
115
|
```sh
|
|
116
116
|
bun --no-install src/cli.ts skills list
|
|
@@ -145,15 +145,15 @@ viewer 新包采用 v2 清单,覆盖启动 shell、TS、依赖及网页的逐
|
|
|
145
145
|
|
|
146
146
|
## Viewer service 运维
|
|
147
147
|
|
|
148
|
-
viewer service 由单一 loopback gateway 管理,实际 worker 通过 owner-only Unix socket 受控;直接 ledger CLI 不经过 viewer HTTP,也不能借 viewer 路由绕过 ledger owner、revision 或 command identity
|
|
148
|
+
viewer service 由单一 loopback gateway 管理,实际 worker 通过 owner-only Unix socket 受控;直接 ledger CLI 不经过 viewer HTTP,也不能借 viewer 路由绕过 ledger owner、revision 或 command identity。以下命令均通过已发布 npm 包的 `service` 子命令执行,输入必须是一个 JSON 对象并通过 stdin 传入:`multi-task-flow service <command> --input -`。
|
|
149
149
|
|
|
150
150
|
```sh
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
multi-task-flow service status --input - < status.json
|
|
152
|
+
multi-task-flow service doctor --input - < empty.json
|
|
153
|
+
multi-task-flow service ensure --input - < ensure.json
|
|
154
|
+
multi-task-flow service compatibility-check --input - < candidate.json
|
|
155
|
+
multi-task-flow service upgrade --input - < candidate.json
|
|
156
|
+
multi-task-flow service rollback --input - < rollback.json
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
`ensure` 的 actor 至少包含 `{ "run_id": "<run-id>", "thread_id": "<thread-id>", "api_version": 1 }`;它会核对安装 manifest、generation、PID、port 和 health identity,并在旧实例停止后重新建立租约。`status` 或 `doctor` 先确认安装、运行阶段和当前 build;启动失败时保留 runtime 状态并检查配置 user service 的 launchd 记录,不删除 data 或 release 目录。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loomhelm/multi-task-flow",
|
|
3
|
-
"version": "0.2.
|
|
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": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"types": "src/index.ts",
|
|
26
26
|
"scripts": {
|
|
27
|
-
"build": "bun ../../skills/multi-task-flow/scripts/package-client-skills.ts --require-dependencies",
|
|
27
|
+
"build": "bun --cwd ../../skills/multi-task-flow-runtime build && bun ../../skills/multi-task-flow-runtime/scripts/package-client-skills.ts --require-dependencies",
|
|
28
28
|
"check": "bun x --no-install tsc -p tsconfig.json --noEmit",
|
|
29
29
|
"test": "bun run build && bun test test/*.test.ts",
|
|
30
30
|
"pack:check": "bun run build && bun pm pack --dry-run"
|
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
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SkillsRuntime } from '../toolkit.ts';
|
|
2
|
+
|
|
3
|
+
export async function runServiceCommand(args: string[]): Promise<void> {
|
|
4
|
+
if (args[0] === 'help' || !args.length) {
|
|
5
|
+
console.log('service COMMAND --input -');
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (args.length !== 3 || args[1] !== '--input' || args[2] !== '-') {
|
|
9
|
+
throw new Error('SERVICE_INVALID_ARGUMENTS: use COMMAND --input - with one JSON object on stdin');
|
|
10
|
+
}
|
|
11
|
+
if (process.stdin.isTTY) throw new Error('Service requires a JSON request on stdin');
|
|
12
|
+
const chunks: Buffer[] = [];
|
|
13
|
+
let size = 0;
|
|
14
|
+
for await (const chunk of process.stdin) {
|
|
15
|
+
const data = Buffer.from(chunk);
|
|
16
|
+
size += data.length;
|
|
17
|
+
if (size > 256 * 1024 * 1024) throw new Error('Service input too large');
|
|
18
|
+
chunks.push(data);
|
|
19
|
+
}
|
|
20
|
+
const result = await new SkillsRuntime().run('skills/multi-task-flow/scripts/service.ts', [args[0]!, '--input', '-'], {
|
|
21
|
+
input: Buffer.concat(chunks),
|
|
22
|
+
});
|
|
23
|
+
process.stdout.write(result.stdout);
|
|
24
|
+
process.stderr.write(result.stderr);
|
|
25
|
+
process.exitCode = result.code ?? 1;
|
|
26
|
+
}
|
package/src/cli.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { Operation } from './tasks/model.ts';
|
|
|
8
8
|
import { runCodexCommand } from './cli/codex.ts';
|
|
9
9
|
import { runSkillsCommand } from './cli/skills.ts';
|
|
10
10
|
import { runFlowCommand } from './cli/flow.ts';
|
|
11
|
+
import { runServiceCommand } from './cli/service.ts';
|
|
11
12
|
import { runReleaseCommand } from './cli/release.ts';
|
|
12
13
|
import { buildInfoFromArtifact } from './runtime-identity.ts';
|
|
13
14
|
import { SkillsRuntime } from './toolkit.ts';
|
|
@@ -19,11 +20,12 @@ async function main(args: string[]): Promise<void> {
|
|
|
19
20
|
if (args[0] === '--config') { args.shift(); configPath = args.shift(); if (!configPath) throw new Error('Missing config path'); }
|
|
20
21
|
const [command, ...rest] = args;
|
|
21
22
|
if (command === 'help' || !command) {
|
|
22
|
-
console.log('multi-task-flow [--config PATH] status|tasks|receipts|recover-lock TOKEN|apply OPERATION_ID JSON|run OPERATION_ID TASK_ID COMMAND_JSON|git-status PATH|worktree REPO ABS_PATH BRANCH [BASE]|codex COMMAND ...|flow COMMAND ...|skills COMMAND ...|release COMMAND ...|workflow COMMAND ...'); return;
|
|
23
|
+
console.log('multi-task-flow [--config PATH] status|tasks|receipts|recover-lock TOKEN|apply OPERATION_ID JSON|run OPERATION_ID TASK_ID COMMAND_JSON|git-status PATH|worktree REPO ABS_PATH BRANCH [BASE]|codex COMMAND ...|flow COMMAND ...|service COMMAND --input -|skills COMMAND ...|release COMMAND ...|workflow COMMAND ...'); return;
|
|
23
24
|
}
|
|
24
25
|
if (command === 'skills') { await runSkillsCommand(rest); return; }
|
|
25
26
|
if (command === 'codex') { await runCodexCommand(rest, configPath); return; }
|
|
26
27
|
if (command === 'flow') { await runFlowCommand(rest, configPath); return; }
|
|
28
|
+
if (command === 'service') { await runServiceCommand(rest); return; }
|
|
27
29
|
if (command === 'release') { await runReleaseCommand(rest); return; }
|
|
28
30
|
if (command === 'workflow') {
|
|
29
31
|
if (rest[0] === 'verify') throw new Error('WORKFLOW_LEGACY_COMMAND_UNSUPPORTED: use local-verify for local validation only; follow the migrated engineering Skills for delivery gates');
|