qlogicagent 2.10.26 → 2.10.28

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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Workflow mode handlers — ACP surface for the automation workflow engine (plan M2 接入).
3
+ * Exposes workflow.create/get/describe/patch/run/setActive/list/delete over the same RPC host
4
+ * as product/solo. The engine (WorkflowController) lives in qlogicagent (D12); triggers live in
5
+ * the gateway (D7/B) and drive `workflow.run` over ACP.
6
+ *
7
+ * fail-loud throughout (plan §1.5): unknown id / illegal patch / missing capability all throw.
8
+ */
9
+ import { AgentProcessManager } from "../../runtime/infra/agent-process.js";
10
+ import type { AcpDetector } from "../../runtime/infra/acp-detector.js";
11
+ import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
12
+ import { WorkflowController } from "../../orchestration/workflow/workflow-controller.js";
13
+ import { WorkflowStore } from "../../orchestration/workflow/workflow-store.js";
14
+ import { WorkflowScheduler } from "../../orchestration/workflow/workflow-scheduler.js";
15
+ export interface WorkflowCoordinatorHost {
16
+ acpDetector: AcpDetector;
17
+ getActiveProjectRoot(): string;
18
+ handleMcpToolCall(memberId: string, tool: string, args: Record<string, unknown>): Promise<unknown>;
19
+ sendNotification(method: string, params: Record<string, unknown>): void;
20
+ workflowController: WorkflowController | null;
21
+ workflowStore: WorkflowStore | null;
22
+ workflowProcessManager: AgentProcessManager | null;
23
+ workflowScheduler: WorkflowScheduler | null;
24
+ }
25
+ export interface WorkflowHandlerHost extends WorkflowCoordinatorHost {
26
+ sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
27
+ }
28
+ /** Build (once) the WorkflowController wired to real qlogicagent capabilities (no mocks, §1.5). */
29
+ export declare function ensureWorkflowController(this: WorkflowCoordinatorHost): WorkflowController;
30
+ export declare function handleWorkflowCreate(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
31
+ export declare function handleWorkflowGet(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
32
+ export declare function handleWorkflowDescribe(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
33
+ export declare function handleWorkflowPatch(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
34
+ export declare function handleWorkflowRun(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
35
+ export declare function handleWorkflowSetActive(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
36
+ export declare function handleWorkflowList(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
37
+ export declare function handleWorkflowDelete(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
38
+ export declare function handleWorkflowOnImMessage(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
39
+ export declare function handleWorkflowOnWebhook(this: WorkflowHandlerHost, msg: AgentRpcRequest): Promise<void>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Process-level WorkflowController singleton (single-track, D17 "one store / one engine").
3
+ *
4
+ * The ACP workflow-handler builds the fully-wired controller (real ExecutorHost: agent/tool/mcp)
5
+ * and publishes it here. The agent-facing `workflow` tool resolves the same instance so authoring
6
+ * (create/patch) and running share one engine + one store. When the engine has not been
7
+ * initialized (e.g. a bare CLI tool turn before any ACP workflow call), callers that only need
8
+ * authoring can fall back to a store-only controller; `run` fail-louds (no silent no-op).
9
+ */
10
+ import type { WorkflowController } from "./workflow-controller.js";
11
+ /** Publish the fully-wired controller (called by ensureWorkflowController). */
12
+ export declare function setWorkflowController(ctrl: WorkflowController): void;
13
+ /** The live, run-capable controller, or null if the engine has not been initialized yet. */
14
+ export declare function getWorkflowController(): WorkflowController | null;
@@ -1,44 +1,45 @@
1
1
  import type { PortableTool } from "../portable-tool.js";
2
- export type WorkflowAction = "list" | "run" | "describe";
3
- export interface WorkflowStep {
4
- /** Step identifier */
2
+ export type WorkflowAction = "list" | "get" | "describe" | "create" | "patch" | "setActive" | "run" | "delete";
3
+ export interface WorkflowToolParams {
4
+ action: WorkflowAction;
5
+ workflowId?: string;
6
+ name?: string;
7
+ def?: Record<string, unknown>;
8
+ patch?: unknown[];
9
+ baseRev?: number;
10
+ scope?: string[];
11
+ active?: boolean;
12
+ }
13
+ export interface WorkflowToolRecord {
5
14
  id: string;
6
- /** Tool name to invoke */
7
- tool: string;
8
- /** Tool arguments (supports ${prev.result} interpolation) */
9
- args: Record<string, unknown>;
10
- /** Step IDs this step depends on (for DAG ordering) */
11
- dependsOn?: string[];
12
- /** Condition expression: "always" | "on_success" | "on_failure" (default: "on_success") */
13
- condition?: "always" | "on_success" | "on_failure";
14
- /** Human-readable label */
15
- label?: string;
15
+ name?: string;
16
+ rev?: number;
17
+ active?: boolean;
16
18
  }
17
- export interface WorkflowDefinition {
18
- /** Workflow name */
19
- name: string;
20
- /** Description */
21
- description?: string;
22
- /** Ordered steps (executed in dependency order) */
23
- steps: WorkflowStep[];
24
- /** Variables that can be overridden at runtime */
25
- variables?: Record<string, string>;
19
+ export interface WorkflowRunOutcome {
20
+ status?: string;
26
21
  }
27
- export interface WorkflowToolParams {
28
- /** Action to perform */
29
- action: WorkflowAction;
30
- /** Workflow name (for run/describe) */
31
- workflow?: string;
32
- /** Variable overrides (for run) */
33
- variables?: Record<string, string>;
22
+ export interface WorkflowToolService {
23
+ list(): Promise<WorkflowToolRecord[]>;
24
+ get(id: string): Promise<unknown>;
25
+ describe(id: string): Promise<string>;
26
+ create(input: {
27
+ id: string;
28
+ name: string;
29
+ def: Record<string, unknown>;
30
+ active: boolean;
31
+ }): Promise<WorkflowToolRecord>;
32
+ patch(id: string, envelope: {
33
+ patch: unknown[];
34
+ baseRev?: number;
35
+ scope?: string[];
36
+ }): Promise<unknown>;
37
+ setActive(id: string, active: boolean): Promise<WorkflowToolRecord>;
38
+ run(id: string): Promise<WorkflowRunOutcome>;
39
+ delete(id: string): Promise<void>;
34
40
  }
35
41
  export interface WorkflowToolDeps {
36
- /** Execute a tool by name and return its text result */
37
- invokeTool(toolName: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<{
38
- result: string;
39
- error?: string;
40
- }>;
41
- /** Get current working directory */
42
- getCwd(): string;
42
+ /** Resolve the host-owned workflow service port. Keeps skills independent from orchestration internals. */
43
+ getService(): WorkflowToolService;
43
44
  }
44
45
  export declare function createWorkflowTool(deps: WorkflowToolDeps): PortableTool<WorkflowToolParams>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.10.26",
3
+ "version": "2.10.28",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",