qlogicagent 2.12.15 → 2.13.1

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.
@@ -12,6 +12,13 @@ export interface PortDef {
12
12
  name: string;
13
13
  type?: PortType;
14
14
  }
15
+ /**
16
+ * Port-type compatibility — the SINGLE truth for connection validation (R5 手动连线)。
17
+ * add_edge 拿它兜底;画布的即时拒绝只是这条规则的前端镜像。
18
+ * 规则:any 通配两侧;同型相通;媒体(image/video/audio)可入 binary(媒体 ⊆ 二进制,
19
+ * 例如"存文件"节点收任意二进制)。其余不通。
20
+ */
21
+ export declare function portTypesCompatible(src: PortType | undefined, dst: PortType | undefined): boolean;
15
22
  /** Declarative workflow node (persisted; may carry `{{ }}` expressions in params). */
16
23
  export interface WorkflowNodeDef {
17
24
  id: string;
@@ -21,6 +28,12 @@ export interface WorkflowNodeDef {
21
28
  params?: Record<string, unknown>;
22
29
  /** Output ports; default ["default"]. if→["true","false"], loop→["loop","done"]. */
23
30
  outPorts?: string[];
31
+ /**
32
+ * Out-port data types(端口名 → 类型;缺省 "any")。与 outPorts(名字,控制流)刻意分离:
33
+ * DagScheduler 只关心端口名,类型只参与连线校验(add_edge)与画布 Handle 配色 —— 改
34
+ * outPorts 为混合型会波及全部调度消费方,不值得。
35
+ */
36
+ outPortTypes?: Record<string, PortType>;
24
37
  /** Input ports (for type-checked routing); default ["default"]. */
25
38
  inPorts?: PortDef[];
26
39
  joinPolicy?: "all" | "any";
@@ -64,5 +64,14 @@ export interface QlaExecutorHostDeps {
64
64
  resolveCredentialHeaders?: (credentialId: string) => Record<string, string>;
65
65
  /** fetch impl; defaults to global fetch. Injectable for tests. */
66
66
  fetchImpl?: typeof fetch;
67
+ /**
68
+ * Owning workflow root (multi-root, R5):tool 节点的 cwd 必须钉在所属项目工作区。
69
+ * in-process 工具注册表跟随 agent 的"活动项目"全局 cwd —— 不钉的话,项目 A 的
70
+ * tool 节点会在项目 B 的目录里动文件(跨项目写,真机踩过:产物落错工作区)。
71
+ * 注入方式 = exec 工具既有的 `workdir` 参数(作者显式指定时尊重);其余工具无
72
+ * per-call cwd 通道,仍循全局 cwd —— 工作流里写文件的正路是 agent 节点(子进程
73
+ * 带根 cwd)与 exec;若需全工具 cwd 线程化,另立决策改 RuntimeToolContract。
74
+ */
75
+ workspaceCwd?: string;
67
76
  }
68
77
  export declare function createQlaExecutorHost(deps: QlaExecutorHostDeps): ExecutorHost;
@@ -44,6 +44,13 @@ export interface RunContext {
44
44
  signal?: AbortSignal;
45
45
  /** The record's unattended capability grant at run start (D30; feeds the permission gate). */
46
46
  permissionScope?: WorkflowRecord["permissionScope"];
47
+ /**
48
+ * R5 媒体工作室(D44):跨 run 内容寻址缓存 —— 本 run 从工作流级共享 checkpoint seed,
49
+ * 完成后保留(不清),下次"改参数只重跑下游"(ComfyUI 语义:未变节点命中缓存被跳过)。
50
+ * 默认关:自动化的副作用节点(发消息/HTTP POST)绝不能因"没变"被静默跳过;
51
+ * 工作室画布的"运行"显式带上(纯数据流面,跳过未变工序正是期望)。
52
+ */
53
+ reuseCache?: boolean;
47
54
  }
48
55
  /** Per-node lifecycle status surfaced for live canvas coloring (not durable; fire-and-forget). */
49
56
  export type NodeRunStatus = "running" | "completed" | "failed";
@@ -142,6 +149,7 @@ export declare class WorkflowController {
142
149
  /** Trigger a run, honoring the workflow's concurrency policy (spec §B5). */
143
150
  run(id: string, trigger?: TriggerEvent, opts?: {
144
151
  recordHistory?: boolean;
152
+ reuseCache?: boolean;
145
153
  }): Promise<RunOutcome>;
146
154
  /**
147
155
  * Wrap a run with durable history recording (when wired). Lives at this choke point —
@@ -89,6 +89,12 @@ export interface WorkflowRuntimeOptions {
89
89
  signal?: AbortSignal;
90
90
  /** Durable run checkpoint for crash-restart recovery (plan §M3). */
91
91
  checkpoint?: RunCheckpoint;
92
+ /**
93
+ * R5 跨 run 缓存(reuseCache):完成后不清 checkpoint 而是整表回写 —— 同一工作流的
94
+ * 下一个 run seed 它,未变节点(同 kind+params+inputs 签名)命中跳过(ComfyUI 语义)。
95
+ * 默认 false = 既有崩溃恢复语义(完成即清)。
96
+ */
97
+ preserveCheckpoint?: boolean;
92
98
  /** Per-node lifecycle callback for live status (canvas coloring). Fire-and-forget, not durable. */
93
99
  onNodeStatus?: (nodeId: string, status: "running" | "completed" | "failed") => void;
94
100
  }
@@ -104,6 +110,7 @@ export declare class WorkflowRuntime {
104
110
  private readonly abortController?;
105
111
  private readonly signal;
106
112
  private readonly checkpoint?;
113
+ private readonly preserveCheckpoint;
107
114
  private readonly onNodeStatus?;
108
115
  private dag;
109
116
  private readonly nodeDefs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.12.15",
3
+ "version": "2.13.1",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -89,7 +89,7 @@
89
89
  "@agentclientprotocol/sdk": "^0.25.0",
90
90
  "@napi-rs/canvas": "0.1.100",
91
91
  "@xiaozhiclaw/pet-core": "0.1.1",
92
- "@xiaozhiclaw/provider-core": "^0.1.9",
92
+ "@xiaozhiclaw/provider-core": "^0.1.11",
93
93
  "better-sqlite3": "^12.10.0",
94
94
  "dotenv": "^17.3.1",
95
95
  "ioredis": "^5.11.1",