qlogicagent 2.2.0 → 2.4.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 (72) hide show
  1. package/dist/agent.js +10 -9
  2. package/dist/cli.js +213 -211
  3. package/dist/index.js +212 -210
  4. package/dist/orchestration.js +13 -12
  5. package/dist/protocol.js +1 -0
  6. package/dist/types/agent/constants.d.ts +4 -53
  7. package/dist/types/agent/tunable-defaults.d.ts +225 -0
  8. package/dist/types/agent/types.d.ts +24 -100
  9. package/dist/types/cli/stdio-server.d.ts +40 -0
  10. package/dist/types/cli/tool-bootstrap.d.ts +6 -0
  11. package/dist/types/contracts/index.d.ts +2 -3
  12. package/dist/types/llm/provider-def.d.ts +3 -0
  13. package/dist/types/llm/transport.d.ts +25 -25
  14. package/dist/types/llm/transports/anthropic-messages.d.ts +2 -2
  15. package/dist/types/llm/transports/gemini-generatecontent.d.ts +2 -2
  16. package/dist/types/llm/transports/openai-chat.d.ts +2 -2
  17. package/dist/types/llm/transports/openai-responses.d.ts +9 -9
  18. package/dist/types/llm/transports/volcengine-responses.d.ts +11 -11
  19. package/dist/types/orchestration/agent-instance.d.ts +15 -0
  20. package/dist/types/orchestration/skill-improvement.d.ts +39 -8
  21. package/dist/types/orchestration/solo-evaluator.d.ts +7 -0
  22. package/dist/types/orchestration/subagent/fork-subagent.d.ts +2 -2
  23. package/dist/types/orchestration/tool-loop/tool-choice-policy.d.ts +1 -1
  24. package/dist/types/protocol/methods.d.ts +143 -53
  25. package/dist/types/protocol/notifications.d.ts +4 -495
  26. package/dist/types/protocol/wire/acp-protocol.d.ts +411 -0
  27. package/dist/types/protocol/wire/agent-events.d.ts +32 -0
  28. package/dist/types/protocol/wire/agent-methods.d.ts +587 -0
  29. package/dist/types/protocol/wire/agent-rpc.d.ts +97 -0
  30. package/dist/types/protocol/wire/capability-manifest.d.ts +111 -0
  31. package/dist/types/protocol/wire/capability-transport.d.ts +207 -0
  32. package/dist/types/protocol/wire/channel-ingress.d.ts +29 -0
  33. package/dist/types/protocol/wire/channel.d.ts +89 -0
  34. package/dist/types/protocol/wire/chat-types.d.ts +87 -0
  35. package/dist/types/protocol/wire/checkpoint-runtime.d.ts +61 -0
  36. package/dist/types/protocol/wire/checkpoint.d.ts +72 -0
  37. package/dist/types/protocol/wire/execution.d.ts +391 -0
  38. package/dist/types/protocol/wire/gateway-rpc.d.ts +314 -0
  39. package/dist/types/protocol/wire/gateway.d.ts +62 -0
  40. package/dist/types/protocol/wire/hook-protocol.d.ts +37 -0
  41. package/dist/types/protocol/wire/index.d.ts +25 -0
  42. package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +80 -0
  43. package/dist/types/protocol/wire/notification-payloads.d.ts +581 -0
  44. package/dist/types/protocol/wire/provider-runtime-contract.d.ts +66 -0
  45. package/dist/types/protocol/wire/provider-runtime-core.d.ts +147 -0
  46. package/dist/types/protocol/wire/provider-runtime-io.d.ts +20 -0
  47. package/dist/types/protocol/wire/resource-manifest.d.ts +68 -0
  48. package/dist/types/protocol/wire/session.d.ts +32 -0
  49. package/dist/types/protocol/wire/thread-protocol.d.ts +157 -0
  50. package/dist/types/protocol/wire/transport.d.ts +57 -0
  51. package/dist/types/protocol/wire/turn.d.ts +208 -0
  52. package/dist/types/protocol/wire/web-capability.d.ts +51 -0
  53. package/dist/types/runtime/hooks/memory-hooks.d.ts +2 -5
  54. package/dist/types/runtime/hooks/skill-recall-hooks.d.ts +2 -4
  55. package/dist/types/runtime/infra/acp-types.d.ts +3 -142
  56. package/dist/types/runtime/infra/project-store.d.ts +6 -0
  57. package/dist/types/runtime/infra/skill-injector.d.ts +9 -2
  58. package/dist/types/runtime/infra/token-budget.d.ts +3 -3
  59. package/dist/types/runtime/session/index.d.ts +1 -1
  60. package/dist/types/runtime/session/session-memory.d.ts +46 -0
  61. package/dist/types/runtime/session/session-persistence.d.ts +34 -8
  62. package/dist/types/runtime/session/session-state.d.ts +4 -4
  63. package/dist/types/skills/memory/memory-tool.d.ts +1 -1
  64. package/dist/types/skills/memory/qmemory-adapter.d.ts +1 -1
  65. package/dist/types/skills/permissions/hook-runner.d.ts +4 -4
  66. package/dist/types/skills/permissions/permission-classifier.d.ts +2 -2
  67. package/dist/types/skills/skill-system/skill-source.d.ts +65 -0
  68. package/dist/types/skills/tools/project-switch-tool.d.ts +24 -0
  69. package/dist/types/skills/tools.d.ts +5 -5
  70. package/dist/types/transport/acp-event-emitter.d.ts +1 -1
  71. package/dist/types/transport/acp-server.d.ts +18 -9
  72. package/package.json +14 -3
@@ -1,7 +1,14 @@
1
1
  /**
2
2
  * Skill self-learning: decides whether a completed turn should
3
3
  * trigger skill creation or improvement instructions.
4
+ *
5
+ * Guards against proliferation:
6
+ * - MAX_SKILLS_PER_PROJECT: hard cap on project-level skills
7
+ * - Dedup check: compares tool-set signature against existing skills
8
+ * - Cooldown: prevents rapid-fire creation within a session
4
9
  */
10
+ import { MAX_SKILLS_PER_PROJECT, MAX_SKILLS_GLOBAL } from "../agent/tunable-defaults.js";
11
+ export { MAX_SKILLS_PER_PROJECT, MAX_SKILLS_GLOBAL };
5
12
  export interface SkillTurnResult {
6
13
  ok: boolean;
7
14
  /** Number of tool invocations in this turn */
@@ -36,6 +43,32 @@ export interface SkillImproveInstruction {
36
43
  reason: string;
37
44
  }
38
45
  export type SkillInstruction = SkillCreateInstruction | SkillImproveInstruction;
46
+ /**
47
+ * Reset cooldown state (for testing).
48
+ */
49
+ export declare function resetSkillCreationCooldown(): void;
50
+ /**
51
+ * Check if an existing skill in skillsDir already covers the same tool set.
52
+ * Returns the name of the conflicting skill, or null if none found.
53
+ */
54
+ export declare function findDuplicateSkill(tools: string[], skillsDir: string): string | null;
55
+ /**
56
+ * Count active skills in a directory.
57
+ */
58
+ export declare function countSkillsInDir(skillsDir: string): number;
59
+ /**
60
+ * Context for proliferation checks.
61
+ */
62
+ export interface SkillCreationContext {
63
+ /** Project-level skills directory */
64
+ projectSkillsDir?: string;
65
+ /** User-level (global) skills directory */
66
+ globalSkillsDir?: string;
67
+ /** Tool names used in this turn */
68
+ tools: string[];
69
+ /** Optional suggested name */
70
+ suggestedName?: string;
71
+ }
39
72
  /**
40
73
  * Determine whether a completed turn should produce a skill instruction.
41
74
  *
@@ -44,16 +77,14 @@ export type SkillInstruction = SkillCreateInstruction | SkillImproveInstruction;
44
77
  * - It involved multi-step orchestration
45
78
  * - It used ≥3 tool calls across ≥2 distinct tools
46
79
  * - No existing skill was already applied
47
- *
48
- * An improvement is suggested when:
49
- * - The turn used an existing skill but got negative feedback
80
+ * - Cooldown has elapsed since last skill creation
81
+ * - No duplicate skill exists (same tool signature)
82
+ * - Project skill count < MAX_SKILLS_PER_PROJECT
50
83
  */
51
- export declare function shouldCreateSkill(result: SkillTurnResult): boolean;
84
+ export declare function shouldCreateSkill(result: SkillTurnResult, context?: SkillCreationContext): boolean;
52
85
  export declare function shouldImproveSkill(result: SkillTurnResult): boolean;
53
86
  /**
54
87
  * Build a skill instruction from a turn result, or null if none is warranted.
88
+ * Updates cooldown timestamp on success.
55
89
  */
56
- export declare function buildSkillInstruction(result: SkillTurnResult, context: {
57
- tools: string[];
58
- suggestedName?: string;
59
- }): SkillInstruction | null;
90
+ export declare function buildSkillInstruction(result: SkillTurnResult, context: SkillCreationContext): SkillInstruction | null;
@@ -24,6 +24,13 @@ export interface SoloCallbacks {
24
24
  onEvaluation?: (soloId: string, evaluation: SoloEvaluation) => void;
25
25
  /** Streaming text delta from a competing agent (forwarded from child process). */
26
26
  onAgentDelta?: (soloId: string, agentId: string, text: string) => void;
27
+ /** File diff produced by a completed agent. */
28
+ onAgentDiff?: (soloId: string, agentId: string, files: {
29
+ path: string;
30
+ hunks: string;
31
+ }[]) => void;
32
+ /** Token usage report after agent completes. */
33
+ onAgentUsage?: (soloId: string, agentId: string, inputTokens: number, outputTokens: number) => void;
27
34
  }
28
35
  export declare class SoloEvaluator {
29
36
  private processManager;
@@ -9,12 +9,12 @@
9
9
  * 5. Depth control via in-memory counter (not DB-based)
10
10
  */
11
11
  import type { AgentDefinition } from "./agent-registry.js";
12
+ import { MAX_FORK_DEPTH } from "../../agent/tunable-defaults.js";
12
13
  /** Sentinel tag injected into fork children to prevent recursive forking. */
13
14
  export declare const FORK_SENTINEL_TAG = "<fork-child-context>";
14
15
  /** Placeholder text used for all tool_results in shared prefix (ensures byte-identical prefix). */
15
16
  export declare const FORK_PLACEHOLDER_RESULT = "Fork started \u2014 processing in background";
16
- /** Maximum fork depth for in-memory agents (CC: MAX_FORK_DEPTH). */
17
- export declare const MAX_FORK_DEPTH = 4;
17
+ export { MAX_FORK_DEPTH };
18
18
  export interface ForkContext {
19
19
  /** Parent's full message history (becomes shared prefix for cache). */
20
20
  parentMessages: unknown[];
@@ -1,4 +1,4 @@
1
- import type { RuntimeToolEligibilityContract } from "qlogicagent-runtime-contracts";
1
+ import type { RuntimeToolEligibilityContract } from "../../protocol/wire/index.js";
2
2
  export type ToolChoiceLike = "auto" | "none" | "required" | {
3
3
  type: "function";
4
4
  function?: {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Centralized RPC Method Protocol all JSON-RPC request methods
2
+ * Centralized RPC Method Protocol 鈥?all JSON-RPC request methods
3
3
  * that qlogicagent exposes to external apps.
4
4
  *
5
5
  * This is the SINGLE SOURCE OF TRUTH for the agent's inbound API contract.
@@ -8,7 +8,8 @@
8
8
  */
9
9
  import type { ChatMessage, ToolDefinition } from "../agent/types.js";
10
10
  import type { TodoItem } from "../contracts/todo.js";
11
- import type { AgentDescriptor, AgentConfig, AgentsScanParams, AgentsConfigParams, AgentsSetConfigParams, AgentsGetConfigParams, AgentsRemoveConfigParams, AgentsSetGatewayParams, SoloStatus, SoloStartParams, SoloIdParams, SoloSelectParams, ProductCreateParams, ProductIdParams, ProductStatus, ProductSummary } from "../runtime/infra/acp-types.js";
11
+ import type { AgentDescriptor, AgentConfig, GatewayRpcMethodMap, RpcProjectInfo, RpcProjectType, RpcProjectStatus, SoloStatus, ProductStatus, ProductSummary } from "./wire/index.js";
12
+ import type { AgentsScanParams, AgentsConfigParams, AgentsSetConfigParams, AgentsGetConfigParams, AgentsRemoveConfigParams, AgentsSetGatewayParams, SoloStartParams, SoloIdParams, SoloSelectParams, ProductCreateParams, ProductIdParams } from "../runtime/infra/acp-types.js";
12
13
  export interface InitializeParams {
13
14
  protocolVersion: string;
14
15
  host?: {
@@ -125,6 +126,8 @@ export interface SessionGetInfoResult {
125
126
  totalCost?: number;
126
127
  };
127
128
  }
129
+ export type SessionGetMessagesParams = GatewayRpcMethodMap["session.getMessages"]["params"];
130
+ export type SessionGetMessagesResult = GatewayRpcMethodMap["session.getMessages"]["result"];
128
131
  export interface MemoryListParams {
129
132
  /** Filter by source: "local" (md files), "store" (in-memory), "qmemory" (remote). */
130
133
  source?: "local" | "store" | "qmemory" | "all";
@@ -177,7 +180,7 @@ export interface MemoryDreamResult {
177
180
  export interface ToolsListParams {
178
181
  /** Filter by category. */
179
182
  category?: "builtin" | "mcp" | "plugin" | "all";
180
- /** Include full parameter schemas (default false names only). */
183
+ /** Include full parameter schemas (default false 鈥?names only). */
181
184
  includeSchema?: boolean;
182
185
  }
183
186
  export interface ToolsListResult {
@@ -302,56 +305,59 @@ export interface TasksCancelResult {
302
305
  ok: boolean;
303
306
  message: string;
304
307
  }
305
- export type ProjectType = "default" | "personal" | "group";
306
- export type ProjectStatus = "active" | "archived";
307
- export interface ProjectInfo {
308
- id: string;
309
- name: string;
310
- workspaceDir: string;
311
- type: ProjectType;
312
- status: ProjectStatus;
313
- groupId?: string;
314
- createdAt: string;
315
- updatedAt: string;
316
- }
317
- export interface ProjectCreateParams {
318
- name: string;
319
- workspaceDir: string;
320
- type?: ProjectType;
321
- groupId?: string;
322
- }
323
- export interface ProjectCreateResult {
324
- ok: boolean;
325
- project: ProjectInfo;
326
- }
327
- export interface ProjectListParams {
328
- }
329
- export interface ProjectListResult {
330
- projects: ProjectInfo[];
331
- }
332
- export interface ProjectDeleteParams {
333
- projectId: string;
334
- }
335
- export interface ProjectDeleteResult {
336
- ok: boolean;
337
- switchedTo?: ProjectInfo;
338
- }
339
- export interface SessionSwitchProjectParams {
340
- projectId?: string;
341
- projectName?: string;
342
- workspaceDir?: string;
343
- }
344
- export interface SessionSwitchProjectResult {
345
- ok: boolean;
346
- project: ProjectInfo;
347
- }
348
- export interface SessionGetStateParams {
349
- }
350
- export interface SessionGetStateResult {
351
- sessionId: string;
352
- activeProject: ProjectInfo | null;
353
- projects: ProjectInfo[];
354
- }
308
+ export type ProjectType = RpcProjectType;
309
+ export type ProjectStatus = RpcProjectStatus;
310
+ export type ProjectInfo = RpcProjectInfo;
311
+ export type ProjectCreateParams = GatewayRpcMethodMap["project.create"]["params"];
312
+ export type ProjectCreateResult = GatewayRpcMethodMap["project.create"]["result"];
313
+ export type ProjectListParams = GatewayRpcMethodMap["project.list"]["params"];
314
+ export type ProjectListResult = GatewayRpcMethodMap["project.list"]["result"];
315
+ export type ProjectDeleteParams = GatewayRpcMethodMap["project.delete"]["params"];
316
+ export type ProjectDeleteResult = GatewayRpcMethodMap["project.delete"]["result"];
317
+ export type ProjectRenameParams = GatewayRpcMethodMap["project.rename"]["params"];
318
+ export type ProjectRenameResult = GatewayRpcMethodMap["project.rename"]["result"];
319
+ export type ProjectArchiveParams = GatewayRpcMethodMap["project.archive"]["params"];
320
+ export type ProjectArchiveResult = GatewayRpcMethodMap["project.archive"]["result"];
321
+ export type ProjectUnarchiveParams = GatewayRpcMethodMap["project.unarchive"]["params"];
322
+ export type ProjectUnarchiveResult = GatewayRpcMethodMap["project.unarchive"]["result"];
323
+ export type ProjectArchiveByGroupParams = GatewayRpcMethodMap["project.archiveByGroup"]["params"];
324
+ export type ProjectArchiveByGroupResult = GatewayRpcMethodMap["project.archiveByGroup"]["result"];
325
+ export type SessionCreateParams = GatewayRpcMethodMap["session.create"]["params"];
326
+ export type SessionCreateResult = GatewayRpcMethodMap["session.create"]["result"];
327
+ export type SessionListParams = GatewayRpcMethodMap["session.list"]["params"];
328
+ export type SessionListResult = GatewayRpcMethodMap["session.list"]["result"];
329
+ export type SessionGetParams = GatewayRpcMethodMap["session.get"]["params"];
330
+ export type SessionGetResult = GatewayRpcMethodMap["session.get"]["result"];
331
+ export type SessionUpdateParams = GatewayRpcMethodMap["session.update"]["params"];
332
+ export type SessionUpdateResult = GatewayRpcMethodMap["session.update"]["result"];
333
+ export type SessionDeleteParams = GatewayRpcMethodMap["session.delete"]["params"];
334
+ export type SessionDeleteResult = GatewayRpcMethodMap["session.delete"]["result"];
335
+ export type SessionArchiveParams = GatewayRpcMethodMap["session.archive"]["params"];
336
+ export type SessionArchiveResult = GatewayRpcMethodMap["session.archive"]["result"];
337
+ export type InstructionsListParams = GatewayRpcMethodMap["instructions.list"]["params"];
338
+ export type InstructionsListResult = GatewayRpcMethodMap["instructions.list"]["result"];
339
+ export type InstructionsReadParams = GatewayRpcMethodMap["instructions.read"]["params"];
340
+ export type InstructionsReadResult = GatewayRpcMethodMap["instructions.read"]["result"];
341
+ export type InstructionsWriteParams = GatewayRpcMethodMap["instructions.write"]["params"];
342
+ export type InstructionsWriteResult = GatewayRpcMethodMap["instructions.write"]["result"];
343
+ export type InstructionsDeleteParams = GatewayRpcMethodMap["instructions.delete"]["params"];
344
+ export type InstructionsDeleteResult = GatewayRpcMethodMap["instructions.delete"]["result"];
345
+ export type FilesListParams = GatewayRpcMethodMap["files.list"]["params"];
346
+ export type FilesListResult = GatewayRpcMethodMap["files.list"]["result"];
347
+ export type FilesReadParams = GatewayRpcMethodMap["files.read"]["params"];
348
+ export type FilesReadResult = GatewayRpcMethodMap["files.read"]["result"];
349
+ export type FilesCreateParams = GatewayRpcMethodMap["files.create"]["params"];
350
+ export type FilesCreateResult = GatewayRpcMethodMap["files.create"]["result"];
351
+ export type FilesRenameParams = GatewayRpcMethodMap["files.rename"]["params"];
352
+ export type FilesRenameResult = GatewayRpcMethodMap["files.rename"]["result"];
353
+ export type FilesDeleteParams = GatewayRpcMethodMap["files.delete"]["params"];
354
+ export type FilesDeleteResult = GatewayRpcMethodMap["files.delete"]["result"];
355
+ export type FilesGitStatusParams = GatewayRpcMethodMap["files.gitStatus"]["params"];
356
+ export type FilesGitStatusResult = GatewayRpcMethodMap["files.gitStatus"]["result"];
357
+ export type SessionSwitchProjectParams = GatewayRpcMethodMap["session.switchProject"]["params"];
358
+ export type SessionSwitchProjectResult = GatewayRpcMethodMap["session.switchProject"]["result"];
359
+ export type SessionGetStateParams = GatewayRpcMethodMap["session.getState"]["params"];
360
+ export type SessionGetStateResult = GatewayRpcMethodMap["session.getState"]["result"];
355
361
  export interface RpcMethodMap {
356
362
  "initialize": {
357
363
  params: InitializeParams;
@@ -377,6 +383,10 @@ export interface RpcMethodMap {
377
383
  params: SessionGetInfoParams;
378
384
  result: SessionGetInfoResult;
379
385
  };
386
+ "session.getMessages": {
387
+ params: SessionGetMessagesParams;
388
+ result: SessionGetMessagesResult;
389
+ };
380
390
  "memory.list": {
381
391
  params: MemoryListParams;
382
392
  result: MemoryListResult;
@@ -546,6 +556,22 @@ export interface RpcMethodMap {
546
556
  params: ProjectDeleteParams;
547
557
  result: ProjectDeleteResult;
548
558
  };
559
+ "project.rename": {
560
+ params: ProjectRenameParams;
561
+ result: ProjectRenameResult;
562
+ };
563
+ "project.archive": {
564
+ params: ProjectArchiveParams;
565
+ result: ProjectArchiveResult;
566
+ };
567
+ "project.unarchive": {
568
+ params: ProjectUnarchiveParams;
569
+ result: ProjectUnarchiveResult;
570
+ };
571
+ "project.archiveByGroup": {
572
+ params: ProjectArchiveByGroupParams;
573
+ result: ProjectArchiveByGroupResult;
574
+ };
549
575
  "session.switchProject": {
550
576
  params: SessionSwitchProjectParams;
551
577
  result: SessionSwitchProjectResult;
@@ -554,6 +580,70 @@ export interface RpcMethodMap {
554
580
  params: SessionGetStateParams;
555
581
  result: SessionGetStateResult;
556
582
  };
583
+ "session.create": {
584
+ params: SessionCreateParams;
585
+ result: SessionCreateResult;
586
+ };
587
+ "session.list": {
588
+ params: SessionListParams;
589
+ result: SessionListResult;
590
+ };
591
+ "session.get": {
592
+ params: SessionGetParams;
593
+ result: SessionGetResult;
594
+ };
595
+ "session.update": {
596
+ params: SessionUpdateParams;
597
+ result: SessionUpdateResult;
598
+ };
599
+ "session.delete": {
600
+ params: SessionDeleteParams;
601
+ result: SessionDeleteResult;
602
+ };
603
+ "session.archive": {
604
+ params: SessionArchiveParams;
605
+ result: SessionArchiveResult;
606
+ };
607
+ "instructions.list": {
608
+ params: InstructionsListParams;
609
+ result: InstructionsListResult;
610
+ };
611
+ "instructions.read": {
612
+ params: InstructionsReadParams;
613
+ result: InstructionsReadResult;
614
+ };
615
+ "instructions.write": {
616
+ params: InstructionsWriteParams;
617
+ result: InstructionsWriteResult;
618
+ };
619
+ "instructions.delete": {
620
+ params: InstructionsDeleteParams;
621
+ result: InstructionsDeleteResult;
622
+ };
623
+ "files.list": {
624
+ params: FilesListParams;
625
+ result: FilesListResult;
626
+ };
627
+ "files.read": {
628
+ params: FilesReadParams;
629
+ result: FilesReadResult;
630
+ };
631
+ "files.create": {
632
+ params: FilesCreateParams;
633
+ result: FilesCreateResult;
634
+ };
635
+ "files.rename": {
636
+ params: FilesRenameParams;
637
+ result: FilesRenameResult;
638
+ };
639
+ "files.delete": {
640
+ params: FilesDeleteParams;
641
+ result: FilesDeleteResult;
642
+ };
643
+ "files.gitStatus": {
644
+ params: FilesGitStatusParams;
645
+ result: FilesGitStatusResult;
646
+ };
557
647
  }
558
648
  /** All known RPC method names. */
559
649
  export type RpcMethod = keyof RpcMethodMap;