qlogicagent 0.5.3 → 1.0.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.
Files changed (104) hide show
  1. package/README.md +24 -23
  2. package/dist/agent.js +13 -13
  3. package/dist/cli.js +218 -184
  4. package/dist/contracts.js +1 -1
  5. package/dist/index.js +391 -20
  6. package/dist/orchestration.js +14 -105
  7. package/dist/types/agent/agent.d.ts +1 -1
  8. package/dist/types/agent/constants.d.ts +2 -2
  9. package/dist/types/agent/tool-access.d.ts +30 -0
  10. package/dist/types/agent/tool-loop.d.ts +2 -4
  11. package/dist/types/agent/types.d.ts +51 -13
  12. package/dist/types/cli/main.d.ts +3 -3
  13. package/dist/types/cli/stdio-server.d.ts +89 -7
  14. package/dist/types/cli/tool-bootstrap.d.ts +16 -5
  15. package/dist/types/cli/transport.d.ts +40 -0
  16. package/dist/types/contracts/index.d.ts +0 -1
  17. package/dist/types/contracts/todo.d.ts +9 -0
  18. package/dist/types/index.d.ts +3 -0
  19. package/dist/types/llm/index.d.ts +7 -1
  20. package/dist/types/llm/media-client.d.ts +43 -0
  21. package/dist/types/llm/media-transport.d.ts +80 -0
  22. package/dist/types/llm/model-catalog.d.ts +5 -5
  23. package/dist/types/llm/provider-def.d.ts +7 -0
  24. package/dist/types/llm/provider-registry.d.ts +1 -1
  25. package/dist/types/llm/transport.d.ts +2 -0
  26. package/dist/types/llm/transports/anthropic-messages.d.ts +34 -11
  27. package/dist/types/llm/transports/gemini-media.d.ts +21 -0
  28. package/dist/types/llm/transports/minimax-media.d.ts +21 -0
  29. package/dist/types/llm/transports/openai-chat.d.ts +1 -1
  30. package/dist/types/llm/transports/openai-media.d.ts +24 -0
  31. package/dist/types/llm/transports/qwen-media.d.ts +25 -0
  32. package/dist/types/llm/transports/volcengine-media.d.ts +34 -0
  33. package/dist/types/orchestration/index.d.ts +14 -112
  34. package/dist/types/orchestration/skill-improvement.d.ts +2 -2
  35. package/dist/types/orchestration/{fork-subagent.d.ts → subagent/fork-subagent.d.ts} +2 -4
  36. package/dist/types/orchestration/{tool-schema.d.ts → tool-loop/tool-schema.d.ts} +1 -2
  37. package/dist/types/protocol/index.d.ts +7 -0
  38. package/dist/types/protocol/methods.d.ts +380 -0
  39. package/dist/types/protocol/notifications.d.ts +296 -0
  40. package/dist/types/runtime/execution/dream-agent.d.ts +1 -1
  41. package/dist/types/runtime/execution/forked-agent.d.ts +1 -3
  42. package/dist/types/runtime/hooks/context-compression.d.ts +1 -1
  43. package/dist/types/runtime/infra/agent-paths.d.ts +57 -0
  44. package/dist/types/runtime/infra/checkpoint-backend.d.ts +8 -0
  45. package/dist/types/runtime/infra/disk-storage.d.ts +36 -0
  46. package/dist/types/runtime/infra/file-watcher.d.ts +2 -2
  47. package/dist/types/runtime/infra/index.d.ts +2 -0
  48. package/dist/types/runtime/infra/secure-storage.d.ts +1 -1
  49. package/dist/types/runtime/infra/task-runtime.d.ts +1 -1
  50. package/dist/types/runtime/prompt/environment-context.d.ts +1 -1
  51. package/dist/types/runtime/prompt/instruction-loader.d.ts +6 -6
  52. package/dist/types/runtime/session/index.d.ts +1 -1
  53. package/dist/types/runtime/session/session-memory.d.ts +0 -1
  54. package/dist/types/runtime/session/session-persistence.d.ts +1 -1
  55. package/dist/types/runtime/session/session-state.d.ts +18 -9
  56. package/dist/types/skills/index.d.ts +20 -26
  57. package/dist/types/skills/mcp/mcp-manager.d.ts +3 -4
  58. package/dist/types/skills/mcp/mcp-stdio-client.d.ts +1 -1
  59. package/dist/types/skills/{memory-store.d.ts → memory/memory-store.d.ts} +20 -0
  60. package/dist/types/skills/{memory-tool.d.ts → memory/memory-tool.d.ts} +20 -0
  61. package/dist/types/skills/{qmemory-adapter.d.ts → memory/qmemory-adapter.d.ts} +1 -0
  62. package/dist/types/skills/permissions/hook-runner.d.ts +1 -1
  63. package/dist/types/skills/permissions/settings-watcher.d.ts +2 -2
  64. package/dist/types/skills/plugins/plugin-api.d.ts +1 -1
  65. package/dist/types/skills/plugins/plugin-loader.d.ts +1 -4
  66. package/dist/types/skills/plugins/plugin-marketplace.d.ts +1 -1
  67. package/dist/types/skills/portable-tool.d.ts +34 -1
  68. package/dist/types/skills/todo-tool.d.ts +51 -42
  69. package/dist/types/skills/tools/instructions-tool.d.ts +20 -58
  70. package/dist/types/skills/tools/shell/shell-exec.d.ts +2 -0
  71. package/dist/types/skills/tools/skill-invoke-tool.d.ts +2 -2
  72. package/dist/types/skills/tools.d.ts +65 -0
  73. package/package.json +2 -2
  74. package/dist/types/contracts/skill-candidate.d.ts +0 -63
  75. package/dist/types/orchestration/curator-scheduler.d.ts +0 -119
  76. package/dist/types/orchestration/memory-provider.d.ts +0 -14
  77. package/dist/types/orchestration/skill-candidate.d.ts +0 -52
  78. package/dist/types/orchestration/skill-consolidation.d.ts +0 -123
  79. package/dist/types/orchestration/skill-similarity.d.ts +0 -98
  80. package/dist/types/orchestration/team-orchestration.d.ts +0 -195
  81. package/dist/types/orchestration/team-tool-loop-wiring.d.ts +0 -92
  82. package/dist/types/skills/memory-query-tool.d.ts +0 -43
  83. package/dist/types/skills/tool-registry.d.ts +0 -29
  84. package/dist/types/skills/tools/memory-tool.d.ts +0 -74
  85. package/dist/types/skills/tools/pdf-tool.d.ts +0 -66
  86. /package/dist/types/orchestration/{context-collapse.d.ts → context/context-collapse.d.ts} +0 -0
  87. /package/dist/types/orchestration/{context-compression.d.ts → context/context-compression.d.ts} +0 -0
  88. /package/dist/types/orchestration/{reactive-compact.d.ts → context/reactive-compact.d.ts} +0 -0
  89. /package/dist/types/orchestration/{turn-loop-guard.d.ts → context/turn-loop-guard.d.ts} +0 -0
  90. /package/dist/types/orchestration/{error-classification.d.ts → error-handling/error-classification.d.ts} +0 -0
  91. /package/dist/types/orchestration/{failover-classification.d.ts → error-handling/failover-classification.d.ts} +0 -0
  92. /package/dist/types/orchestration/{failover-error.d.ts → error-handling/failover-error.d.ts} +0 -0
  93. /package/dist/types/orchestration/{retry-loop.d.ts → error-handling/retry-loop.d.ts} +0 -0
  94. /package/dist/types/orchestration/{agent-registry.d.ts → subagent/agent-registry.d.ts} +0 -0
  95. /package/dist/types/orchestration/{task-types.d.ts → subagent/task-types.d.ts} +0 -0
  96. /package/dist/types/orchestration/{conversation-repair.d.ts → tool-loop/conversation-repair.d.ts} +0 -0
  97. /package/dist/types/orchestration/{tool-choice-policy.d.ts → tool-loop/tool-choice-policy.d.ts} +0 -0
  98. /package/dist/types/orchestration/{tool-loop-state.d.ts → tool-loop/tool-loop-state.d.ts} +0 -0
  99. /package/dist/types/skills/{memory-extractor.d.ts → memory/memory-extractor.d.ts} +0 -0
  100. /package/dist/types/skills/{skill-frontmatter.d.ts → skill-system/skill-frontmatter.d.ts} +0 -0
  101. /package/dist/types/skills/{skill-guard.d.ts → skill-system/skill-guard.d.ts} +0 -0
  102. /package/dist/types/skills/{skill-loader.d.ts → skill-system/skill-loader.d.ts} +0 -0
  103. /package/dist/types/skills/{skill-source.d.ts → skill-system/skill-source.d.ts} +0 -0
  104. /package/dist/types/skills/{skill-types.d.ts → skill-system/skill-types.d.ts} +0 -0
@@ -1,92 +0,0 @@
1
- /**
2
- * Team Tool Loop Wiring — Connects team orchestration to the tool loop.
3
- *
4
- * When the LLM invokes `team_create`, this module:
5
- * 1. Validates the team plan
6
- * 2. Maps team agents to fork contexts
7
- * 3. Coordinates execution according to the team execution mode
8
- * 4. Aggregates results according to the aggregation policy
9
- * 5. Returns the aggregated result as a tool_result
10
- *
11
- * This bridges the gap between the pure strategy layer (team-orchestration.ts)
12
- * and the Hub's tool loop.
13
- */
14
- import type { AgentRole, TeamExecutionMode, TeamAggregationPolicy, TeamLifecycleState } from "./team-orchestration.js";
15
- import type { AgentDefinition } from "./agent-registry.js";
16
- import type { ForkResult } from "./fork-subagent.js";
17
- export interface TeamToolRequest {
18
- /** Team name for identification. */
19
- name: string;
20
- /** Agent specs for the team. */
21
- agents: TeamAgentRequest[];
22
- /** Execution mode. */
23
- mode: TeamExecutionMode;
24
- /** How to aggregate results. */
25
- aggregation: TeamAggregationPolicy;
26
- }
27
- export interface TeamAgentRequest {
28
- /** Role within the team. */
29
- role: AgentRole;
30
- /** Agent type from built-in registry. */
31
- agentType: string;
32
- /** Task prompt for this agent. */
33
- prompt: string;
34
- /** Max turns override. */
35
- maxTurns?: number;
36
- /** Dependencies (agent IDs that must complete before this one). */
37
- dependsOn?: string[];
38
- }
39
- export interface TeamExecutionPlan {
40
- /** Ordered batches for execution. */
41
- batches: TeamExecutionBatch[];
42
- /** Total estimated token budget. */
43
- totalBudget: number;
44
- /** Lifecycle state. */
45
- state: TeamLifecycleState;
46
- }
47
- export interface TeamExecutionBatch {
48
- /** Agents in this batch (run in parallel within a batch). */
49
- agents: TeamAgentRequest[];
50
- /** Batch mode (parallel or sequential within the batch). */
51
- mode: "parallel" | "serial";
52
- }
53
- /**
54
- * Resolve the execution plan for a team request.
55
- * Validates the request, resolves dependencies into ordered batches,
56
- * and determines the execution topology.
57
- */
58
- export declare function resolveTeamExecutionPlan(request: TeamToolRequest): TeamExecutionPlan;
59
- export interface TeamAggregatedResult {
60
- /** Whether the team execution succeeded overall. */
61
- ok: boolean;
62
- /** Aggregated output text. */
63
- output: string;
64
- /** Individual agent results. */
65
- agentResults: Array<{
66
- agentId: string;
67
- role: AgentRole;
68
- result: ForkResult;
69
- }>;
70
- /** Total tokens consumed by all agents. */
71
- totalTokensUsed: number;
72
- /** Lifecycle state after aggregation. */
73
- finalState: TeamLifecycleState;
74
- }
75
- /**
76
- * Aggregate results from team agents according to the aggregation policy.
77
- */
78
- export declare function aggregateTeamToolResults(results: Array<{
79
- agentId: string;
80
- role: AgentRole;
81
- result: ForkResult;
82
- }>, policy: TeamAggregationPolicy): TeamAggregatedResult;
83
- /**
84
- * Map a team tool_call into the format needed for the tool loop to dispatch.
85
- * Returns the list of fork configs the tool loop should execute.
86
- */
87
- export declare function mapTeamRequestToForkConfigs(request: TeamToolRequest, agentRegistry: (name: string) => AgentDefinition | undefined): Array<{
88
- agentDef: AgentDefinition;
89
- prompt: string;
90
- maxTurns?: number;
91
- role: AgentRole;
92
- }>;
@@ -1,43 +0,0 @@
1
- import type { PortableTool } from "./portable-tool.js";
2
- export declare const MEMORY_QUERY_TOOL_NAME: "memory_query";
3
- export declare const MEMORY_QUERY_TOOL_SCHEMA: {
4
- readonly type: "object";
5
- readonly properties: {
6
- readonly query: {
7
- readonly type: "string";
8
- readonly description: string;
9
- };
10
- readonly category: {
11
- readonly type: "string";
12
- readonly description: string;
13
- };
14
- };
15
- readonly required: readonly ["query"];
16
- };
17
- export interface MediaPreferencesSummary {
18
- imageStyle?: string;
19
- videoStyle?: string;
20
- musicGenre?: string;
21
- musicMood?: string;
22
- primaryPurpose?: string;
23
- colorPreference?: string;
24
- }
25
- /**
26
- * Dependency-injected callbacks for memory query.
27
- * Consumers provide these from their own memory system.
28
- */
29
- export interface MemoryQueryToolDeps {
30
- /** Query recalled facts/memories by natural language. */
31
- queryGraph?: (query: string, userId: string) => string[];
32
- /** Retrieve user profile summary. */
33
- getProfileSummary?: (userId: string) => string | null;
34
- /** Retrieve media preferences. */
35
- getMediaPreferences?: (userId: string) => MediaPreferencesSummary | null;
36
- /** User ID for this session. */
37
- userId?: string;
38
- }
39
- export interface MemoryQueryToolParams {
40
- query: string;
41
- category?: string;
42
- }
43
- export declare function createMemoryQueryTool(deps?: MemoryQueryToolDeps): PortableTool<MemoryQueryToolParams>;
@@ -1,29 +0,0 @@
1
- import type { PortableTool, PortableToolResult } from "./portable-tool.js";
2
- import type { ToolDefinition } from "../agent/types.js";
3
- export declare class ToolRegistry {
4
- private tools;
5
- /** Register a single tool. Overwrites if name already exists. */
6
- register(tool: PortableTool<any>): void;
7
- /** Register multiple tools at once. */
8
- registerAll(tools: PortableTool<any>[]): void;
9
- /** Unregister a tool by name. */
10
- unregister(name: string): boolean;
11
- /** Find a tool by name. Returns undefined if not registered. */
12
- findTool(name: string): PortableTool | undefined;
13
- /** Check if a tool is registered locally. */
14
- has(name: string): boolean;
15
- /**
16
- * Execute a tool by name.
17
- * @throws Error if the tool is not registered.
18
- */
19
- execute(name: string, toolCallId: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<PortableToolResult>;
20
- /**
21
- * Generate ToolDefinition[] manifest for LLM tool_use.
22
- * Excludes deferred tools by default.
23
- */
24
- getToolManifest(includeDeferred?: boolean): ToolDefinition[];
25
- /** Get all registered tool names. */
26
- getToolNames(): string[];
27
- /** Number of registered tools. */
28
- get size(): number;
29
- }
@@ -1,74 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const MEMORY_SEARCH_TOOL_NAME: "memory_search";
3
- export type MemorySource = "memory" | "sessions" | "all";
4
- export interface MemorySearchToolParams {
5
- /** Search query */
6
- query: string;
7
- /** Source to search in */
8
- source?: MemorySource;
9
- /** Maximum results to return */
10
- maxResults?: number;
11
- /** Filter by time range (ISO date string, sessions only) */
12
- after?: string;
13
- /** Filter by time range (ISO date string, sessions only) */
14
- before?: string;
15
- }
16
- export declare const MEMORY_SEARCH_TOOL_SCHEMA: {
17
- readonly type: "object";
18
- readonly properties: {
19
- readonly query: {
20
- readonly type: "string";
21
- readonly description: "Search query. Supports natural language and keywords.";
22
- };
23
- readonly source: {
24
- readonly type: "string";
25
- readonly enum: readonly ["memory", "sessions", "all"];
26
- readonly description: string;
27
- };
28
- readonly maxResults: {
29
- readonly type: "number";
30
- readonly description: "Maximum results to return (default: 5).";
31
- };
32
- readonly after: {
33
- readonly type: "string";
34
- readonly description: "Only return sessions after this date (ISO format). Sessions source only.";
35
- };
36
- readonly before: {
37
- readonly type: "string";
38
- readonly description: "Only return sessions before this date (ISO format). Sessions source only.";
39
- };
40
- };
41
- readonly required: readonly ["query"];
42
- };
43
- export interface MemoryEntry {
44
- content: string;
45
- source: "memory" | "session";
46
- relevance: number;
47
- metadata?: {
48
- sessionId?: string;
49
- timestamp?: string;
50
- summary?: string;
51
- };
52
- }
53
- export interface MemoryQueryOutput {
54
- results: MemoryEntry[];
55
- query: string;
56
- sources: MemorySource[];
57
- }
58
- /**
59
- * Host-provided memory search backend.
60
- */
61
- export interface MemorySearchToolDeps {
62
- /**
63
- * Search memory/sessions.
64
- * The host routes to QMemory vector search, FTS session search, or both.
65
- */
66
- searchMemory(params: {
67
- query: string;
68
- source: MemorySource;
69
- maxResults: number;
70
- after?: string;
71
- before?: string;
72
- }): Promise<MemoryQueryOutput>;
73
- }
74
- export declare function createMemorySearchTool(deps: MemorySearchToolDeps): PortableTool<MemorySearchToolParams>;
@@ -1,66 +0,0 @@
1
- import type { PortableTool } from "../portable-tool.js";
2
- export declare const PDF_TOOL_NAME: "pdf";
3
- export interface PdfToolParams {
4
- prompt?: string;
5
- pdf?: string;
6
- pdfs?: string[];
7
- pages?: string;
8
- }
9
- export declare const PDF_TOOL_SCHEMA: {
10
- readonly type: "object";
11
- readonly properties: {
12
- readonly prompt: {
13
- readonly type: "string";
14
- readonly description: "Describe what to analyze or extract from the PDF(s).";
15
- };
16
- readonly pdf: {
17
- readonly type: "string";
18
- readonly description: "Single PDF path or URL.";
19
- };
20
- readonly pdfs: {
21
- readonly type: "array";
22
- readonly items: {
23
- readonly type: "string";
24
- };
25
- readonly description: "Multiple PDF paths or URLs (up to 10).";
26
- };
27
- readonly pages: {
28
- readonly type: "string";
29
- readonly description: "Page range to process, e.g. \"1-5\", \"1,3,5-7\". Defaults to all pages.";
30
- };
31
- };
32
- readonly required: readonly [];
33
- };
34
- /** Deps injected by the host runtime for PDF analysis. */
35
- export interface PdfToolDeps {
36
- /**
37
- * Extract text and/or page images from a PDF.
38
- * The host decides how to load (local FS, HTTP, etc.).
39
- */
40
- extractPdf(source: string, options?: {
41
- pages?: string;
42
- }): Promise<{
43
- text: string;
44
- pageImages?: Array<{
45
- page: number;
46
- base64: string;
47
- mimeType: string;
48
- }>;
49
- }>;
50
- /**
51
- * Optional: analyze extracted content via LLM.
52
- * If not provided, the tool returns raw extracted text.
53
- */
54
- analyzePdfContent?(prompt: string, content: {
55
- text: string;
56
- images?: Array<{
57
- base64: string;
58
- mimeType: string;
59
- }>;
60
- }): Promise<{
61
- text: string;
62
- model?: string;
63
- provider?: string;
64
- }>;
65
- }
66
- export declare function createPdfTool(deps: PdfToolDeps): PortableTool<PdfToolParams>;