pi-ptc-subagents 6.0.3 → 6.1.0

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/dist/worker.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { stripTypeScriptTypes } from "node:module";
2
- import { parentPort, workerData } from "node:worker_threads";
3
2
  import { inspect } from "node:util";
3
+ import { parentPort, workerData } from "node:worker_threads";
4
4
  // ../ptc/src/compile.ts
5
5
  function compileProgram(source) {
6
6
  const stripped = stripTypeScriptTypes(`async function __ptcProgram() {\n${source}\n}`, { mode: "strip" });
@@ -11,7 +11,7 @@ function createWorkflowHelpers(emit) {
11
11
  return {
12
12
  log: (...args) => emit(args.map((a) => typeof a === "string" ? a : JSON.stringify(a)).join(" ")),
13
13
  phase: (name) => emit(`— phase: ${name} —`),
14
- parallel: (items) => Promise.all(items.map((run) => run())),
14
+ parallel: (items) => Promise.allSettled(items.map((run) => run())),
15
15
  pipeline: (items, step) => {
16
16
  const results = [];
17
17
  return items.reduce((chain, item, index) => chain.then(async () => {
@@ -5,7 +5,7 @@
5
5
  - `pi_task_ptc`:PTC 程序内的 binding,程序里 `tools.pi_task_ptc({...})`
6
6
  - `pi_task_codemode`:注册的工具(exposure: codemode,模型不可见),codemode 脚本里 `tools.pi_task_codemode({...})`
7
7
 
8
- 参数:`task`(必填,孩子要干的活)、`label`、`wait`、`why`、`agent`、`agentScope`、`model`、`thinkingLevel`、`readOnly` 均已生效(`cwd` 待接);
8
+ 参数:`task`(必填,孩子要干的活)、`label`、`wait`、`why`、`agent`、`agentScope`、`model`、`thinkingLevel`、`readOnly`;
9
9
  agent 定义里的 `tools / model / thinkingLevel / childReport` 由 frontmatter 钉住。
10
10
 
11
11
  返回 handle:`{ taskId, label?, status: "queued" }`。默认不等;撞闸(随闸门落地)返回
@@ -6,7 +6,7 @@ script 内额外可用(仅 workflow 面注入):
6
6
 
7
7
  - `workflow.log(...)`:阶段内日志
8
8
  - `workflow.phase(name)`:阶段标记
9
- - `workflow.parallel([fn, ...])`:并行执行
9
+ - `workflow.parallel([fn, ...])`:并行执行,返回 `Promise.allSettled` 记录(`{status:"fulfilled", value}` / `{status:"rejected", reason}`)——单边失败不丢兄弟结果(决策 12);要「一错全拒」语义的自己写 `Promise.all`
10
10
  - `workflow.pipeline(items, step)`:顺序流水线
11
11
 
12
12
  args 必须是可 JSON 序列化的值(进 worker 前校验)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ptc-subagents",
3
- "version": "6.0.3",
3
+ "version": "6.1.0",
4
4
  "description": "Programmable tool calling (PTC) and subagent fan-out for pi",
5
5
  "keywords": [
6
6
  "pi",