qlogicagent 2.15.2 → 2.15.4

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.
Files changed (35) hide show
  1. package/README.md +11 -9
  2. package/dist/agent.js +16 -10
  3. package/dist/cli.js +323 -315
  4. package/dist/index.js +322 -314
  5. package/dist/types/agent/tool-loop/loop-helpers.d.ts +8 -0
  6. package/dist/types/cli/handlers/control-handler.d.ts +3 -0
  7. package/dist/types/cli/stdio-server.d.ts +4 -0
  8. package/dist/types/cli/tool-registry-adapter.d.ts +0 -1
  9. package/dist/types/protocol/methods.d.ts +0 -2
  10. package/dist/types/skills/tools/shell/exec-audit-log.d.ts +24 -0
  11. package/package.json +1 -1
  12. package/dist/types/agent/tool-access.d.ts +0 -1
  13. package/dist/types/agent/tool-loop/single-round.d.ts +0 -2
  14. package/dist/types/protocol/index.d.ts +0 -7
  15. package/dist/types/protocol/wire/provider-runtime-io.d.ts +0 -20
  16. package/dist/types/runtime/execution/index.d.ts +0 -7
  17. package/dist/types/runtime/hooks/index.d.ts +0 -4
  18. package/dist/types/runtime/index.d.ts +0 -5
  19. package/dist/types/runtime/infra/index.d.ts +0 -19
  20. package/dist/types/runtime/infra/mcp-bridge.d.ts +0 -166
  21. package/dist/types/runtime/infra/model-id-translator.d.ts +0 -22
  22. package/dist/types/runtime/infra/secure-storage.d.ts +0 -81
  23. package/dist/types/runtime/infra/skill-injector.d.ts +0 -59
  24. package/dist/types/runtime/prompt/index.d.ts +0 -5
  25. package/dist/types/runtime/sandbox/index.d.ts +0 -2
  26. package/dist/types/runtime/session/index.d.ts +0 -4
  27. package/dist/types/skills/index.d.ts +0 -6
  28. package/dist/types/skills/mcp/index.d.ts +0 -1
  29. package/dist/types/skills/permissions/index.d.ts +0 -13
  30. package/dist/types/skills/plugins/index.d.ts +0 -2
  31. package/dist/types/skills/tools/brief-tool.d.ts +0 -74
  32. package/dist/types/skills/tools/browser-tool.d.ts +0 -114
  33. package/dist/types/skills/tools/plan-mode-tool.d.ts +0 -98
  34. package/dist/types/skills/tools/structured-output-tool.d.ts +0 -116
  35. package/dist/types/transport/index.d.ts +0 -7
@@ -1,114 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const BROWSER_TOOL_NAME: "browser";
3
- export type BrowserAction = "navigate" | "click" | "type" | "scroll" | "snapshot" | "screenshot" | "console" | "cdp";
4
- export interface BrowserToolParams {
5
- /** Browser action to perform */
6
- action: BrowserAction;
7
- /** URL for navigate action */
8
- url?: string;
9
- /** Element reference (e.g. "@e5") for click/type actions */
10
- ref?: string;
11
- /** Text to type */
12
- text?: string;
13
- /** Scroll direction */
14
- direction?: "up" | "down" | "left" | "right";
15
- /** CDP method name for raw cdp action */
16
- method?: string;
17
- /** CDP params object */
18
- params?: Record<string, unknown>;
19
- /** JavaScript expression for console eval */
20
- expression?: string;
21
- /** Whether to include full accessibility tree */
22
- full?: boolean;
23
- }
24
- export declare const BROWSER_TOOL_SCHEMA: {
25
- readonly type: "object";
26
- readonly properties: {
27
- readonly action: {
28
- readonly type: "string";
29
- readonly enum: readonly ["navigate", "click", "type", "scroll", "snapshot", "screenshot", "console", "cdp"];
30
- readonly description: string;
31
- };
32
- readonly url: {
33
- readonly type: "string";
34
- readonly description: "URL to navigate to. Required for 'navigate' action.";
35
- };
36
- readonly ref: {
37
- readonly type: "string";
38
- readonly description: "Element reference like \"@e5\" from a previous snapshot. Required for click/type.";
39
- };
40
- readonly text: {
41
- readonly type: "string";
42
- readonly description: "Text to type into the referenced element. Required for 'type' action.";
43
- };
44
- readonly direction: {
45
- readonly type: "string";
46
- readonly enum: readonly ["up", "down", "left", "right"];
47
- readonly description: "Scroll direction. Required for 'scroll' action.";
48
- };
49
- readonly method: {
50
- readonly type: "string";
51
- readonly description: "CDP method name (e.g. 'Page.reload'). Required for 'cdp' action.";
52
- };
53
- readonly params: {
54
- readonly type: "object";
55
- readonly description: "Parameters for the CDP method. Optional for 'cdp' action.";
56
- };
57
- readonly expression: {
58
- readonly type: "string";
59
- readonly description: "JavaScript expression to evaluate. Used with 'console' action.";
60
- };
61
- readonly full: {
62
- readonly type: "boolean";
63
- readonly description: "Include full accessibility tree (default: compact). Used with 'snapshot'.";
64
- };
65
- };
66
- readonly required: readonly ["action"];
67
- };
68
- export interface BrowserSnapshot {
69
- elements: Array<{
70
- ref: string;
71
- role: string;
72
- name: string;
73
- text?: string;
74
- }>;
75
- url: string;
76
- title: string;
77
- }
78
- export interface BrowserScreenshot {
79
- base64: string;
80
- mimeType: string;
81
- width: number;
82
- height: number;
83
- }
84
- /**
85
- * Host-provided browser automation backend.
86
- * The host manages Chrome/Chromium lifecycle and CDP connections.
87
- */
88
- export interface BrowserToolDeps {
89
- navigate(url: string): Promise<{
90
- snapshot: BrowserSnapshot;
91
- }>;
92
- click(ref: string): Promise<{
93
- success: boolean;
94
- error?: string;
95
- }>;
96
- type(ref: string, text: string): Promise<{
97
- success: boolean;
98
- error?: string;
99
- }>;
100
- scroll(direction: "up" | "down" | "left" | "right"): Promise<{
101
- success: boolean;
102
- }>;
103
- snapshot(full?: boolean): Promise<BrowserSnapshot>;
104
- screenshot(): Promise<BrowserScreenshot>;
105
- consoleEval(expression?: string): Promise<{
106
- result?: string;
107
- messages?: string[];
108
- errors?: string[];
109
- }>;
110
- cdp(method: string, params?: Record<string, unknown>): Promise<Record<string, unknown>>;
111
- /** Validate URL safety (SSRF prevention). Returns error message if blocked, null if safe. */
112
- validateUrl(url: string): string | null;
113
- }
114
- export declare function createBrowserTool(deps: BrowserToolDeps): PortableTool<BrowserToolParams>;
@@ -1,98 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const PLAN_MODE_TOOL_NAME: "plan_mode";
3
- export type PlanModeAction = "enter" | "exit";
4
- export interface PlanModeToolParams {
5
- /** Action: enter or exit plan mode */
6
- action: PlanModeAction;
7
- /** Plan text (for exit — the finalized plan to present for approval) */
8
- plan?: string;
9
- /** File path where plan was saved (optional) */
10
- planFilePath?: string;
11
- /**
12
- * Semantic permissions to request on exit (CC ExitPlanModeV2 parity).
13
- * Each entry describes a tool + intent the agent wants permission for.
14
- */
15
- allowedPrompts?: Array<{
16
- tool: string;
17
- prompt: string;
18
- }>;
19
- }
20
- export declare const PLAN_MODE_TOOL_SCHEMA: {
21
- readonly type: "object";
22
- readonly properties: {
23
- readonly action: {
24
- readonly type: "string";
25
- readonly enum: readonly ["enter", "exit"];
26
- readonly description: string;
27
- };
28
- readonly plan: {
29
- readonly type: "string";
30
- readonly description: string;
31
- };
32
- readonly planFilePath: {
33
- readonly type: "string";
34
- readonly description: "Optional file path where the plan was saved for reference.";
35
- };
36
- readonly allowedPrompts: {
37
- readonly type: "array";
38
- readonly description: string;
39
- readonly items: {
40
- readonly type: "object";
41
- readonly properties: {
42
- readonly tool: {
43
- readonly type: "string";
44
- readonly description: "Tool name to pre-approve.";
45
- };
46
- readonly prompt: {
47
- readonly type: "string";
48
- readonly description: "Intent description for this permission.";
49
- };
50
- };
51
- readonly required: readonly ["tool", "prompt"];
52
- };
53
- };
54
- };
55
- readonly required: readonly ["action"];
56
- };
57
- /** Tools allowed during plan mode (read-only + reasoning + task tracking) */
58
- export declare const PLAN_MODE_ALLOWED_TOOLS: readonly string[];
59
- export interface PlanModeState {
60
- active: boolean;
61
- enteredAt?: string;
62
- plan?: string;
63
- planFilePath?: string;
64
- }
65
- export interface PlanModeResult {
66
- success: boolean;
67
- state: PlanModeState;
68
- allowedTools?: readonly string[];
69
- error?: string;
70
- }
71
- /**
72
- * Host-provided plan mode backend.
73
- * The host is responsible for filtering tool availability based on mode state.
74
- */
75
- export interface PlanModeToolDeps {
76
- /** Get current plan mode state */
77
- getState(): PlanModeState;
78
- /** Enter plan mode — host should restrict tool availability */
79
- enterPlanMode(): Promise<PlanModeResult>;
80
- /** Exit plan mode — host restores full tool availability */
81
- exitPlanMode(plan?: string, planFilePath?: string): Promise<PlanModeResult>;
82
- /** Check if in agent/sub-agent context (plan mode not allowed in sub-agents) */
83
- isAgentContext?(): boolean;
84
- /**
85
- * Request approval for the plan from the user/coordinator.
86
- * CC parity: ExitPlanModeV2 triggers an approval dialog on exit.
87
- * Returns true if approved, false if rejected.
88
- */
89
- requestPlanApproval?(plan: string, allowedPrompts?: Array<{
90
- tool: string;
91
- prompt: string;
92
- }>): Promise<boolean>;
93
- /**
94
- * Persist plan to disk (CC parity: plan is saved to planFilePath).
95
- */
96
- persistPlan?(plan: string, filePath: string): Promise<void>;
97
- }
98
- export declare function createPlanModeTool(deps: PlanModeToolDeps): PortableTool<PlanModeToolParams>;
@@ -1,116 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const STRUCTURED_OUTPUT_TOOL_NAME: "structured_output";
3
- /** Maximum content size for structured output results. */
4
- export declare const STRUCTURED_OUTPUT_MAX_CHARS = 100000;
5
- export interface StructuredOutputToolParams {
6
- /** The structured data to return. Must conform to the session's output schema. */
7
- data: Record<string, unknown>;
8
- }
9
- /**
10
- * Base schema — accepts any object.
11
- * When used with createConfiguredStructuredOutputTool, the host overrides
12
- * this with the actual JSON Schema from `response_format.json_schema`.
13
- */
14
- export declare const STRUCTURED_OUTPUT_TOOL_SCHEMA: {
15
- readonly type: "object";
16
- readonly properties: {
17
- readonly data: {
18
- readonly type: "object";
19
- readonly description: string;
20
- readonly additionalProperties: true;
21
- };
22
- };
23
- readonly required: readonly ["data"];
24
- };
25
- /** Schema validation error detail. */
26
- export interface SchemaValidationError {
27
- path: string;
28
- message: string;
29
- keyword?: string;
30
- }
31
- /** Result of structured output validation. */
32
- export interface StructuredOutputResult {
33
- valid: boolean;
34
- errors?: SchemaValidationError[];
35
- }
36
- /**
37
- * Whether the structured output tool should be enabled for this session.
38
- * CC equivalent: `isSyntheticOutputToolEnabled`.
39
- */
40
- export declare function isStructuredOutputEnabled(opts: {
41
- isNonInteractiveSession: boolean;
42
- }): boolean;
43
- /**
44
- * Runtime dependencies injected by the host.
45
- *
46
- * The host provides:
47
- * 1. The JSON Schema to validate against (from session config)
48
- * 2. A validator function (host may use Ajv, Zod, or any validator)
49
- * 3. An output sink to deliver the validated data
50
- *
51
- * The tool is only available in non-interactive (SDK/API) sessions
52
- * where a `response_format.json_schema` has been specified.
53
- */
54
- export interface StructuredOutputToolDeps {
55
- /**
56
- * Get the JSON Schema that the output must conform to.
57
- * Returns undefined if no schema is configured (tool should not be registered).
58
- */
59
- getOutputSchema(): Record<string, unknown> | undefined;
60
- /**
61
- * Validate data against the output schema.
62
- * Returns { valid: true } or { valid: false, errors: [...] }.
63
- */
64
- validateOutput(data: Record<string, unknown>): StructuredOutputResult;
65
- /**
66
- * Deliver the validated output to the caller.
67
- * Called only after successful validation.
68
- */
69
- deliverOutput(data: Record<string, unknown>): Promise<void>;
70
- }
71
- /**
72
- * Create the base structured output tool with DI-based validation.
73
- * This is the standard factory for runtime integration.
74
- */
75
- export declare function createStructuredOutputTool(deps: StructuredOutputToolDeps): PortableTool<StructuredOutputToolParams>;
76
- /**
77
- * Result of creating a configured structured output tool.
78
- * Success: { tool } — ready-to-use tool with compiled schema.
79
- * Failure: { error } — schema was invalid.
80
- */
81
- export type ConfiguredToolResult = {
82
- tool: PortableTool<StructuredOutputToolParams>;
83
- } | {
84
- error: string;
85
- };
86
- /**
87
- * Host-provided schema compilation interface.
88
- * Allows the host to use any validator (Ajv, Zod, custom).
89
- */
90
- export interface SchemaCompiler {
91
- /**
92
- * Validate that the schema itself is a valid JSON Schema.
93
- * Returns null if valid, or an error message string if invalid.
94
- */
95
- validateSchema(schema: Record<string, unknown>): string | null;
96
- /**
97
- * Compile the schema into a reusable validator function.
98
- * Returns a function that validates data and returns StructuredOutputResult.
99
- */
100
- compile(schema: Record<string, unknown>): (data: Record<string, unknown>) => StructuredOutputResult;
101
- }
102
- /**
103
- * Create a StructuredOutputTool configured with a specific JSON Schema.
104
- * Mirrors CC's `createSyntheticOutputTool(jsonSchema)`.
105
- *
106
- * Features:
107
- * - Validates the schema itself at creation time
108
- * - Compiles the validator for reuse (cached via WeakMap)
109
- * - Overrides the tool's `parameters` with the provided schema (dynamic input)
110
- * - Returns { tool } on success or { error } if schema is invalid
111
- *
112
- * @param jsonSchema The JSON Schema to validate output against.
113
- * @param compiler Schema compiler/validator provided by the host.
114
- * @param deliver Output delivery function (called after successful validation).
115
- */
116
- export declare function createConfiguredStructuredOutputTool(jsonSchema: Record<string, unknown>, compiler: SchemaCompiler, deliver: (data: Record<string, unknown>) => Promise<void>): ConfiguredToolResult;
@@ -1,7 +0,0 @@
1
- /**
2
- * Transport layer — ACP Server + Event Emitter.
3
- */
4
- export { AcpServer, ACP_ERROR_CODES } from "./acp-server.js";
5
- export type { AcpRequestHandler, AcpServerConfig } from "./acp-server.js";
6
- export type { Transport } from "./io-transport.js";
7
- export { emitAcpUpdate } from "./acp-event-emitter.js";