qlogicagent 2.12.13 → 2.12.14

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.
@@ -55,7 +55,7 @@ export declare class CredentialVault {
55
55
  };
56
56
  delete(id: string): boolean;
57
57
  /** Update the secret payload in place (e.g. oauth2 token refresh / exchange completion). */
58
- updateData(id: string, data: CredentialData): CredentialSummary;
58
+ updateData(id: string, data: CredentialData, metaPatch?: Record<string, unknown>): CredentialSummary;
59
59
  }
60
60
  export declare function validateCredentialData(type: CredentialType, data: CredentialData): void;
61
61
  /** Materialize a credential into HTTP request headers (the engine-side injection point). */
@@ -39,6 +39,15 @@ export interface WorkflowNodeDef {
39
39
  * error routes out the "error" port (wire an error-handler/notify subgraph to it).
40
40
  */
41
41
  onError?: "stop" | "continue" | "errorPort";
42
+ /**
43
+ * Canvas position pinned by a manual drag (set_node_ui patch op). Layout-only — the
44
+ * engine never reads it; absent ⇒ the canvas auto-layouts the node. Travels with the
45
+ * def (Bundle/export/Hub/n8n-import) so a hand-arranged graph stays arranged.
46
+ */
47
+ ui?: {
48
+ x: number;
49
+ y: number;
50
+ };
42
51
  }
43
52
  /** A data edge (carries DataItem[]). fromPort/toPort default "default". */
44
53
  export interface DataEdge {
@@ -55,11 +64,20 @@ export interface WorkflowDef {
55
64
  /** Workflow-level variables exposed to expressions as $vars. */
56
65
  vars?: Record<string, unknown>;
57
66
  }
67
+ /**
68
+ * SINGLE source of the attended/unattended split. Attended = a person is present right now:
69
+ * manual (pressed 运行), intent (just SAID it, confirmed by default D22), form (just SUBMITTED
70
+ * it, D34). Everything else (schedule / im-message / webhook) fires with nobody watching.
71
+ * Lives here (leaf module) so both the gate and host-executors can import it cycle-free.
72
+ */
73
+ export declare function isUnattendedTrigger(kind: string): boolean;
58
74
  export interface ExecutorContext {
59
75
  nodeId: string;
60
76
  kind: string;
61
77
  /** Owning workflow id (def.id) — lets host-backed nodes (approval) tag outbound notifications. */
62
78
  workflowId?: string;
79
+ /** This run's trigger kind (manual/schedule/…) — drives fine-grained unattended audits (IT-7b). */
80
+ triggerKind?: string;
63
81
  /** 0-based; increments per loop iteration (drives the cache key, spec §A5). */
64
82
  runIndex: number;
65
83
  vars: Record<string, unknown>;
@@ -106,6 +124,12 @@ export interface ExecutorHost {
106
124
  decidedAt: string;
107
125
  note?: string;
108
126
  }>;
127
+ /**
128
+ * D34 wait-until-webhook: suspend the branch until the given webhook path is called
129
+ * (await-in-memory, same posture as approval — the run stays "running"; a restart loses the
130
+ * wait and the run fails loud; checkpoint replay recovers prior steps on re-run).
131
+ */
132
+ waitWebhook?(req: WebhookWaitHostRequest): Promise<Record<string, unknown>>;
109
133
  }
110
134
  export interface AgentHostRequest {
111
135
  agentId?: string;
@@ -116,6 +140,8 @@ export interface AgentHostRequest {
116
140
  export interface ToolHostRequest {
117
141
  tool: string;
118
142
  args: Record<string, unknown>;
143
+ /** True when this run's trigger is unattended — the host applies fine-grained audits (IT-7b). */
144
+ unattended?: boolean;
119
145
  input: DataItem[];
120
146
  signal?: AbortSignal;
121
147
  }
@@ -163,6 +189,15 @@ export interface ApprovalHostRequest {
163
189
  input: DataItem[];
164
190
  signal?: AbortSignal;
165
191
  }
192
+ export interface WebhookWaitHostRequest {
193
+ /** Webhook path to wait for (normalized with a leading "/"). */
194
+ path: string;
195
+ nodeId: string;
196
+ workflowId?: string;
197
+ /** Auto-fail deadline; default 24h (a forever-pending branch is a leak, not patience). */
198
+ timeoutMs?: number;
199
+ signal?: AbortSignal;
200
+ }
166
201
  export interface MemoryHostRequest {
167
202
  op: "read" | "write" | "search";
168
203
  /** Topic-file name; absent → operate on the always-visible index. */
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import type { RuntimeToolContract } from "../../runtime/ports/index.js";
11
11
  import { type DataItem } from "./data-item.js";
12
- import type { ExecutorHost, MemoryHostRequest, SubworkflowHostRequest, ApprovalHostRequest } from "./node-schema.js";
12
+ import type { ExecutorHost, ToolHostRequest, MemoryHostRequest, SubworkflowHostRequest, ApprovalHostRequest, WebhookWaitHostRequest } from "./node-schema.js";
13
13
  /** Injected boundary capabilities — supplied by the handler host that owns the real runners. */
14
14
  export interface QlaExecutorHostDeps {
15
15
  /** Run one agent turn (spawn external ACP agent + sendTask). Returns the agent's text output. */
@@ -50,6 +50,13 @@ export interface QlaExecutorHostDeps {
50
50
  decidedAt: string;
51
51
  note?: string;
52
52
  }>;
53
+ /** D34 wait-until-webhook: suspend until the path is hit (handler owns the wake registry). */
54
+ waitWebhook?: (req: WebhookWaitHostRequest) => Promise<Record<string, unknown>>;
55
+ /**
56
+ * IT-7b fine-grained unattended audit (unified permission engine's operation classifier).
57
+ * Called for every tool invocation in an UNATTENDED run; throw to refuse (fail-loud).
58
+ */
59
+ auditUnattendedTool?: (req: ToolHostRequest) => void;
53
60
  /**
54
61
  * Vault credential → auth headers, resolved at EXECUTION time only (D29). Absent ⇒ http
55
62
  * nodes carrying credentialId fail-loud (never silently unauthenticated).
@@ -73,6 +73,12 @@ export type WorkflowPatch = {
73
73
  } | null;
74
74
  timeoutMs?: number | null;
75
75
  onError?: "stop" | "continue" | "errorPort" | null;
76
+ } | {
77
+ op: "set_node_ui";
78
+ positions: Record<string, {
79
+ x: number;
80
+ y: number;
81
+ } | null>;
76
82
  };
77
83
  /** A patch + concurrency/scope envelope (spec §C). `scope` present ⇒ scoped (框选) edit. */
78
84
  export interface PatchEnvelope {
@@ -77,6 +77,8 @@ export interface WorkflowRuntimeOptions {
77
77
  gate?: ExecutionGate;
78
78
  now?: () => Date;
79
79
  trigger?: Record<string, unknown>;
80
+ /** This run's trigger KIND (manual/schedule/…) — exposed on ExecutorContext for IT-7b audits. */
81
+ triggerKind?: string;
80
82
  log?: {
81
83
  info(m: string): void;
82
84
  warn(m: string): void;
@@ -96,6 +98,7 @@ export declare class WorkflowRuntime {
96
98
  private readonly gate?;
97
99
  private readonly now;
98
100
  private readonly trigger?;
101
+ private readonly triggerKind?;
99
102
  private readonly log?;
100
103
  private readonly host?;
101
104
  private readonly abortController?;
@@ -41,6 +41,15 @@ export interface WorkflowChatResult {
41
41
  def?: Record<string, unknown>;
42
42
  patch?: unknown[];
43
43
  trigger?: Record<string, unknown>;
44
+ /**
45
+ * Fail-loud(§3/EX-A):本轮 agent 调过 propose_workflow 但**没有任何一次通过校验**时带上
46
+ * (attempts=被拒次数,errors=最后一次的校验错误)。reply 此时只是 agent 的口头方案,
47
+ * **不是**已落图的提案 —— 前端必须把失败 + 重试出路显式给用户,不许当正常回复展示。
48
+ */
49
+ rejected?: {
50
+ attempts: number;
51
+ errors: string[];
52
+ };
44
53
  }
45
54
  /** agent 按需检索能力长尾(系统提示只放每类前 N 条)。 */
46
55
  export declare const LIST_CAPABILITIES_TOOL_NAME = "list_capabilities";
@@ -236,6 +236,11 @@ export interface WorkflowChatResult {
236
236
  patch?: unknown[];
237
237
  trigger?: Record<string, unknown>;
238
238
  error?: string;
239
+ /** propose 全被校验拒(无任何提案落地)时的显式失败:前端展示真实错误 + 重试出路,不许当正常回复。 */
240
+ rejected?: {
241
+ attempts: number;
242
+ errors: string[];
243
+ };
239
244
  }
240
245
  /** solo.start RPC params. */
241
246
  export interface SoloStartParams {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.12.13",
3
+ "version": "2.12.14",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",