qlogicagent 2.19.13 → 2.20.1

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 (92) hide show
  1. package/README.md +0 -1
  2. package/dist/agent-contract.js +1 -1
  3. package/dist/agent.js +31 -31
  4. package/dist/cli.js +1 -1
  5. package/dist/host-contract.js +1 -1
  6. package/dist/index.js +457 -453
  7. package/dist/orchestration.js +13 -13
  8. package/dist/project-memory-host.js +19 -18
  9. package/dist/protocol.js +1 -1
  10. package/dist/tunables.js +1 -1
  11. package/dist/types/cli/acp-extended-handlers.d.ts +5 -10
  12. package/dist/types/cli/acp-extended-host-adapter.d.ts +1 -1
  13. package/dist/types/cli/community-workflow-installer.d.ts +2 -2
  14. package/dist/types/cli/handlers/dream-handler.d.ts +6 -0
  15. package/dist/types/cli/handlers/goal-handler.d.ts +1 -13
  16. package/dist/types/cli/handlers/product-handler.d.ts +6 -9
  17. package/dist/types/cli/handlers/solo-handler.d.ts +3 -6
  18. package/dist/types/cli/handlers/workflow-compute-handler.d.ts +1 -1
  19. package/dist/types/cli/memory-coordinator.d.ts +0 -2
  20. package/dist/types/cli/multi-agent-handler-host.d.ts +1 -1
  21. package/dist/types/cli/orchestration-memory-context.d.ts +1 -0
  22. package/dist/types/cli/product-coordinator.d.ts +2 -5
  23. package/dist/types/cli/rpc-registry.d.ts +0 -3
  24. package/dist/types/cli/runtime-hook-bootstrap.d.ts +0 -2
  25. package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +2 -1
  26. package/dist/types/cli/stdio-server.d.ts +2 -3
  27. package/dist/types/cli/task-distillation-coordinator.d.ts +0 -3
  28. package/dist/types/contracts/hooks.d.ts +2 -0
  29. package/dist/types/host-contract/index.d.ts +3 -13
  30. package/dist/types/index.d.ts +0 -1
  31. package/dist/types/orchestration/agent-instance.d.ts +30 -15
  32. package/dist/types/orchestration/agent-roster.d.ts +2 -2
  33. package/dist/types/orchestration/goal-loop-coordinator.d.ts +18 -8
  34. package/dist/types/orchestration/goal-mode-adapters.d.ts +6 -1
  35. package/dist/types/orchestration/goal-run-persistence.d.ts +12 -10
  36. package/dist/types/orchestration/goal-run-types.d.ts +3 -21
  37. package/dist/types/orchestration/index.d.ts +0 -1
  38. package/dist/types/orchestration/product-checkpoint.d.ts +10 -6
  39. package/dist/types/orchestration/product-persistence.d.ts +47 -20
  40. package/dist/types/orchestration/product-planner.d.ts +30 -10
  41. package/dist/types/orchestration/product-run-coordinator.d.ts +4 -3
  42. package/dist/types/orchestration/solo-evaluator.d.ts +10 -16
  43. package/dist/types/orchestration/solo-persistence.d.ts +10 -10
  44. package/dist/types/orchestration/workflow/budget-permission-gate.d.ts +1 -1
  45. package/dist/types/orchestration/workflow/capability-catalog.d.ts +11 -34
  46. package/dist/types/orchestration/workflow/host-executors.d.ts +3 -3
  47. package/dist/types/orchestration/workflow/n8n-import.d.ts +0 -1
  48. package/dist/types/orchestration/workflow/node-schema.d.ts +5 -18
  49. package/dist/types/orchestration/workflow/params-schema.d.ts +7 -16
  50. package/dist/types/orchestration/workflow/qla-executor-host.d.ts +4 -27
  51. package/dist/types/orchestration/workflow/workflow-bundle.d.ts +10 -28
  52. package/dist/types/orchestration/workflow/workflow-controller.d.ts +14 -8
  53. package/dist/types/orchestration/workflow/workflow-error.d.ts +1 -1
  54. package/dist/types/orchestration/workflow/workflow-render.d.ts +1 -1
  55. package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +8 -8
  56. package/dist/types/orchestration/workflow/workflow-store.d.ts +7 -8
  57. package/dist/types/orchestration/workflow-chat-builder.d.ts +1 -1
  58. package/dist/types/protocol/agent-contract.d.ts +7 -7
  59. package/dist/types/protocol/methods.d.ts +1 -129
  60. package/dist/types/protocol/notifications.d.ts +1 -1
  61. package/dist/types/protocol/wire/acp-agent-management.d.ts +45 -24
  62. package/dist/types/protocol/wire/acp-protocol.d.ts +3 -8
  63. package/dist/types/protocol/wire/agent-methods.d.ts +2 -468
  64. package/dist/types/protocol/wire/index.d.ts +1 -1
  65. package/dist/types/protocol/wire/notification-payloads.d.ts +0 -6
  66. package/dist/types/protocol/wire/thread-protocol.d.ts +1 -1
  67. package/dist/types/runtime/config/tunable-defaults.d.ts +0 -9
  68. package/dist/types/runtime/hooks/memory-hooks.d.ts +11 -4
  69. package/dist/types/runtime/infra/acp-protocol-adapter.d.ts +1 -2
  70. package/dist/types/runtime/memory/implicit-extraction.d.ts +4 -1
  71. package/dist/types/runtime/memory/recall-category-filter.d.ts +0 -12
  72. package/dist/types/runtime/ports/memory-recall-source.d.ts +1 -0
  73. package/dist/types/runtime/ports/project-memory-store.d.ts +3 -0
  74. package/dist/types/skills/memory/host-memory-provider.d.ts +7 -0
  75. package/dist/types/skills/memory/memdir.d.ts +1 -2
  76. package/dist/types/skills/memory/task-distillation.d.ts +18 -4
  77. package/dist/types/skills/skill-system/skill-lifecycle.d.ts +0 -17
  78. package/dist/types/skills/skill-system/skill-validation.d.ts +1 -1
  79. package/dist/types/transport/acp-server.d.ts +1 -5
  80. package/dist/types/workflow-host.d.ts +2 -4
  81. package/dist/workflow-host.js +7 -9
  82. package/package.json +1 -1
  83. package/dist/types/cli/credential-vault.d.ts +0 -68
  84. package/dist/types/orchestration/skill-improvement.d.ts +0 -97
  85. package/dist/types/skills/memory/local-store-records.d.ts +0 -206
  86. package/dist/types/skills/memory/local-store.d.ts +0 -376
  87. package/dist/types/skills/memory/memory-attachment-store.d.ts +0 -62
  88. package/dist/types/skills/memory/memory-consolidation.d.ts +0 -64
  89. package/dist/types/skills/memory/memory-db-path.d.ts +0 -13
  90. package/dist/types/skills/memory/proposal-consumer.d.ts +0 -51
  91. package/dist/types/skills/memory/sqlite-memory-mappers.d.ts +0 -7
  92. package/dist/types/skills/memory/sqlite-memory-schema.d.ts +0 -11
@@ -1,68 +0,0 @@
1
- /**
2
- * Credential Vault (spec D29, IT-7) — owner-scoped, encrypted-at-rest storage for workflow
3
- * node credentials (http auth headers, oauth tokens, …).
4
- *
5
- * Storage layout (under the active owner profile, sibling of settings):
6
- * <ownerProfile>/credentials/.vault-key random 32-byte key, created once (0600)
7
- * <ownerProfile>/credentials/<id>.json AES-256-GCM ciphertext envelope
8
- *
9
- * Threat model: the key and the data live in separate files on the SAME machine — this protects
10
- * against credential files leaking individually (backups, copy-paste, bundle export), not against
11
- * an attacker with full user-account access (no user master password exists to anchor more).
12
- *
13
- * Hard rules (D29): decrypted secrets exist only inside the engine process at execution time —
14
- * list() never returns secret material, and nothing here is ever serialized into defs, bundles,
15
- * exports, or Hub publishes (the bundle sanitizer strips by key shape as the second fence).
16
- */
17
- export type CredentialType = "apiKey" | "bearer" | "basic" | "oauth2" | "custom";
18
- /** Public, secret-free view (what credential.list returns / the UI renders). */
19
- export interface CredentialSummary {
20
- id: string;
21
- type: CredentialType;
22
- label: string;
23
- createdAt: string;
24
- updatedAt: string;
25
- /** Secret-free hints for pickers (e.g. apiKey header name, oauth2 scopes). */
26
- meta?: Record<string, unknown>;
27
- /**
28
- * Set when the on-disk envelope could not be read/parsed. The entry is unusable (get()
29
- * throws) but stays VISIBLE in list() so the list-driven UI shows the loss instead of the
30
- * credential silently vanishing; delete works on it.
31
- */
32
- corrupt?: true;
33
- }
34
- /**
35
- * Secret payload shapes by type (validated on create):
36
- * apiKey: { headerName, value } · bearer: { token } · basic: { username, password }
37
- * oauth2: { accessToken, refreshToken?, tokenUrl?, clientId?, clientSecret?, scopes? }
38
- * custom: { headers: Record<string,string> }
39
- */
40
- export type CredentialData = Record<string, unknown>;
41
- export declare class CredentialVault {
42
- private readonly dir;
43
- constructor(ownerProfileDir?: string);
44
- private keyPath;
45
- private ensureKey;
46
- private encrypt;
47
- private decrypt;
48
- private filePath;
49
- list(): CredentialSummary[];
50
- create(input: {
51
- type: CredentialType;
52
- label: string;
53
- data: CredentialData;
54
- meta?: Record<string, unknown>;
55
- id?: string;
56
- }): CredentialSummary;
57
- /** Decrypted payload — engine-internal use ONLY (execution-time injection). Never over RPC. */
58
- get(id: string): {
59
- summary: CredentialSummary;
60
- data: CredentialData;
61
- };
62
- delete(id: string): boolean;
63
- /** Update the secret payload in place (e.g. oauth2 token refresh / exchange completion). */
64
- updateData(id: string, data: CredentialData, metaPatch?: Record<string, unknown>): CredentialSummary;
65
- }
66
- export declare function validateCredentialData(type: CredentialType, data: CredentialData): void;
67
- /** Materialize a credential into HTTP request headers (the engine-side injection point). */
68
- export declare function credentialToHeaders(type: CredentialType, data: CredentialData): Record<string, string>;
@@ -1,97 +0,0 @@
1
- /**
2
- * Task-pattern learning gates (R3 蒸馏管道的候选判定基建)。
3
- *
4
- * 原消费者(tool-loop 回合内即时产技能路径)已于 2026-07-07 整链废弃删除——
5
- * 即时产出无法验证做法正确性,且其产物是用户永远看不见的默认禁用技能(死链)。
6
- * 本模块的门槛判定/模式签名/冷却状态机保留,作为 R3 任务后蒸馏的候选采集核心
7
- * (docs/memory-layering-and-distillation-spec.md):蒸馏产 procedure 记忆,
8
- * 高复用 procedure 晋升为技能(默认启用——质量闸已前移到真实复用数据)。
9
- *
10
- * Guards against proliferation:
11
- * - Project-level pattern repetition: same workflow signature must appear
12
- * ≥ SKILL_PATTERN_REPETITION_THRESHOLD times before triggering creation
13
- * - Cooldown: prevents rapid-fire creation within a session
14
- */
15
- import type { SkillInstruction } from "../contracts/turn-event.js";
16
- export type { SkillCreateInstruction, SkillImproveInstruction, SkillInstruction, } from "../contracts/turn-event.js";
17
- export interface SkillTurnResult {
18
- ok: boolean;
19
- /** Number of tool invocations in this turn */
20
- toolCallCount: number;
21
- /** Number of distinct tool names used */
22
- distinctToolCount: number;
23
- /** Was a multi-step orchestration (≥2 rounds) used? */
24
- multiStep: boolean;
25
- /** Did the turn involve a sub-agent fork? */
26
- hasSubAgent: boolean;
27
- /** Optional user feedback signal (positive/negative/none) */
28
- feedback?: "positive" | "negative" | null;
29
- /** Skill name if an existing skill was used */
30
- existingSkillName?: string | null;
31
- }
32
- /**
33
- * Reset cooldown state (for testing).
34
- */
35
- export declare function resetSkillCreationCooldown(): void;
36
- interface PatternEntry {
37
- /** Sorted tool signature (e.g. "bash+file_read+file_write") */
38
- signature: string;
39
- /** Number of times this pattern has been observed */
40
- count: number;
41
- /** First seen timestamp (ISO) */
42
- firstSeen: string;
43
- /** Last seen timestamp (ISO) */
44
- lastSeen: string;
45
- /** Whether a skill has already been created for this pattern */
46
- promoted: boolean;
47
- }
48
- /**
49
- * Record a workflow pattern observation and return whether it has reached
50
- * the repetition threshold (i.e., is now eligible for skill creation).
51
- *
52
- * @returns true if the pattern just reached the threshold on this observation
53
- */
54
- export declare function recordPatternAndCheckThreshold(projectRoot: string, tools: string[]): boolean;
55
- /**
56
- * Mark a pattern as promoted (skill already created for it).
57
- * Called when a skill is created through other paths (e.g., manual).
58
- */
59
- export declare function markPatternPromoted(projectRoot: string, tools: string[]): void;
60
- /**
61
- * Get all tracked patterns for a project. Useful for diagnostics.
62
- */
63
- export declare function getPatternStats(projectRoot: string): PatternEntry[];
64
- /**
65
- * Build a normalized "tool signature" from sorted tool names.
66
- * Used as the pattern-store key (workflow signature) for repetition tracking.
67
- */
68
- export declare function buildToolSignature(tools: string[]): string;
69
- /**
70
- * Context for proliferation checks.
71
- */
72
- export interface SkillCreationContext {
73
- /** Tool names used in this turn */
74
- tools: string[];
75
- /** Optional suggested name */
76
- suggestedName?: string;
77
- /** Project root directory (required for pattern tracking) */
78
- projectRoot?: string;
79
- }
80
- /**
81
- * Determine whether a completed turn should produce a skill instruction.
82
- *
83
- * A new skill is suggested when:
84
- * - The turn succeeded
85
- * - It involved multi-step orchestration
86
- * - It used ≥3 tool calls across ≥2 distinct tools
87
- * - No existing skill was already applied
88
- * - Cooldown has elapsed since last skill creation
89
- * - **Pattern repetition threshold reached** (≥3 occurrences at project level)
90
- */
91
- export declare function shouldCreateSkill(result: SkillTurnResult, context?: SkillCreationContext): boolean;
92
- export declare function shouldImproveSkill(result: SkillTurnResult): boolean;
93
- /**
94
- * Build a skill instruction from a turn result, or null if none is warranted.
95
- * Updates cooldown timestamp on success.
96
- */
97
- export declare function buildSkillInstruction(result: SkillTurnResult, context: SkillCreationContext): SkillInstruction | null;
@@ -1,206 +0,0 @@
1
- /** Lightweight attachment reference carried on records / atlas wire (no bytes, no extractedText). */
2
- export interface MemoryAttachmentRef {
3
- id: string;
4
- kind: string;
5
- filename: string;
6
- mimeType: string;
7
- size: number;
8
- url: string;
9
- }
10
- export interface MemoryRecord {
11
- id: string;
12
- text: string;
13
- userId: string;
14
- category: string;
15
- importance: number;
16
- confidence: number;
17
- source: string;
18
- sessionId: string;
19
- eventDate: string;
20
- tags: string[];
21
- embedding: Float32Array | null;
22
- createdAt: number;
23
- updatedAt: number;
24
- accessCount: number;
25
- lastAccessedAt: number;
26
- isArchived: boolean;
27
- /** Lightweight attachment refs (populated by the provider for atlas/detail). */
28
- attachments?: MemoryAttachmentRef[];
29
- }
30
- export interface MemoryInsertInput {
31
- text: string;
32
- userId: string;
33
- category?: string;
34
- importance?: number;
35
- confidence?: number;
36
- source?: string;
37
- sessionId?: string;
38
- eventDate?: string;
39
- tags?: string[];
40
- embedding?: Float32Array;
41
- /** Provenance of `embedding` (model id). Vectors from different models are not
42
- * comparable; search skips rows whose model/dims mismatch the query's. */
43
- embeddingModel?: string;
44
- }
45
- export interface MemoryUpdateInput {
46
- text?: string;
47
- category?: string;
48
- importance?: number;
49
- source?: string;
50
- eventDate?: string;
51
- tags?: string[];
52
- embedding?: Float32Array | null;
53
- /** Provenance of the replacement embedding (see MemoryInsertInput). */
54
- embeddingModel?: string;
55
- }
56
- export interface MemorySearchHit {
57
- id: string;
58
- text: string;
59
- score: number;
60
- category: string;
61
- importance: number;
62
- metadata: Record<string, unknown>;
63
- }
64
- export interface MemoryAtlasBucket {
65
- id: string;
66
- startAt: number;
67
- endAt: number;
68
- count: number;
69
- avgImportance: number;
70
- avgConfidence: number;
71
- topCategory: string;
72
- }
73
- export interface MemoryAtlasCluster {
74
- id: string;
75
- label: string;
76
- kind: "source" | "category" | "tag";
77
- count: number;
78
- startAt: number;
79
- endAt: number;
80
- avgImportance: number;
81
- avgConfidence: number;
82
- topCategory: string;
83
- }
84
- export interface MemoryAtlasWindowCursor {
85
- startAt: number;
86
- endAt: number;
87
- centerAt: number;
88
- pageSize: number;
89
- hasBefore: boolean;
90
- hasAfter: boolean;
91
- }
92
- export interface MemoryAtlasResult {
93
- totalCount: number;
94
- records: MemoryRecord[];
95
- buckets: MemoryAtlasBucket[];
96
- clusters: MemoryAtlasCluster[];
97
- windowCursor: MemoryAtlasWindowCursor | null;
98
- timeRange: {
99
- startAt: number;
100
- endAt: number;
101
- } | null;
102
- }
103
- export type MemorySourceKind = "manual" | "explicit" | "document" | "image" | "video" | "auto" | "turn" | "dream" | "agent" | "feedback";
104
- export type MemoryClaimStatus = "active" | "superseded" | "conflicted" | "archived" | "pending_confirmation";
105
- export type MemoryProposalStatus = "pending" | "accepted" | "merged" | "conflicted" | "rejected" | "expired";
106
- export interface MemoryObservationInput {
107
- userId: string;
108
- text: string;
109
- source: string;
110
- sourcePriority: number;
111
- sessionId?: string;
112
- evidenceType?: string;
113
- payload?: Record<string, unknown>;
114
- }
115
- export interface MemoryObservationRecord extends Required<Omit<MemoryObservationInput, "payload" | "sessionId" | "evidenceType">> {
116
- id: string;
117
- sessionId: string;
118
- evidenceType: string;
119
- payload: Record<string, unknown>;
120
- createdAt: number;
121
- }
122
- export interface MemoryProposalInput {
123
- userId: string;
124
- observationIds: string[];
125
- text: string;
126
- category: string;
127
- importance: number;
128
- confidence: number;
129
- source: string;
130
- sourcePriority: number;
131
- entity: string;
132
- predicate: string;
133
- value: Record<string, unknown>;
134
- validTime?: string;
135
- tags?: string[];
136
- status?: MemoryProposalStatus;
137
- relatedClaimIds?: string[];
138
- /**
139
- * Crash-safe dedup key for evidence-bearing sources (feedback distillation — §10). When set,
140
- * proposeExtracted skips inserting a duplicate proposal for the same key. Left undefined by all
141
- * existing callers (LLM extraction / dream / manual), so their behaviour is unchanged.
142
- */
143
- idempotencyKey?: string;
144
- }
145
- export interface MemoryProposalRecord extends Omit<MemoryProposalInput, "value" | "validTime" | "tags" | "status" | "relatedClaimIds"> {
146
- id: string;
147
- value: Record<string, unknown>;
148
- validTime: string;
149
- tags: string[];
150
- status: MemoryProposalStatus;
151
- relatedClaimIds: string[];
152
- createdAt: number;
153
- updatedAt: number;
154
- }
155
- export interface MemoryClaimInput {
156
- userId: string;
157
- memoryId?: string;
158
- entity: string;
159
- predicate: string;
160
- value: Record<string, unknown>;
161
- text: string;
162
- category: string;
163
- importance: number;
164
- confidence: number;
165
- source: string;
166
- sourcePriority: number;
167
- status: MemoryClaimStatus;
168
- validTime?: string;
169
- evidenceIds: string[];
170
- supersedesClaimId?: string;
171
- conflictGroupId?: string;
172
- }
173
- export interface MemoryClaimRecord extends Omit<MemoryClaimInput, "memoryId" | "value" | "validTime" | "supersedesClaimId" | "conflictGroupId"> {
174
- id: string;
175
- memoryId: string;
176
- value: Record<string, unknown>;
177
- validTime: string;
178
- supersedesClaimId: string;
179
- conflictGroupId: string;
180
- createdAt: number;
181
- updatedAt: number;
182
- }
183
- export interface MemoryConflictRecord {
184
- id: string;
185
- userId: string;
186
- claimAId: string;
187
- claimBId: string;
188
- reason: string;
189
- status: "open" | "resolved" | "dismissed";
190
- createdAt: number;
191
- updatedAt: number;
192
- }
193
- export interface SqliteDatabase {
194
- exec(sql: string): void;
195
- prepare(sql: string): SqliteStatement;
196
- pragma(pragma: string): unknown;
197
- close(): void;
198
- }
199
- export interface SqliteStatement {
200
- run(...params: unknown[]): {
201
- changes: number;
202
- lastInsertRowid: number | bigint;
203
- };
204
- get(...params: unknown[]): unknown;
205
- all(...params: unknown[]): unknown[];
206
- }