qlogicagent 2.18.8 → 2.18.10
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.
- package/dist/cli.js +1 -1
- package/dist/host-contract.js +1 -1
- package/dist/index.js +458 -1018
- package/dist/pet-host.js +19 -0
- package/dist/project-memory-host.js +40 -0
- package/dist/protocol.js +1 -1
- package/dist/skills/mcp/astraclaw-native-mcp-server.js +7 -7
- package/dist/types/cli/acp-session-host.d.ts +1 -1
- package/dist/types/cli/community-resource-installer.d.ts +3 -5
- package/dist/types/cli/core-tools/registry.d.ts +1 -2
- package/dist/types/cli/default-project-bootstrap.d.ts +1 -1
- package/dist/types/cli/handlers/agents-handler.d.ts +8 -6
- package/dist/types/cli/handlers/community-handler.d.ts +0 -4
- package/dist/types/cli/handlers/control-handler.d.ts +1 -1
- package/dist/types/cli/handlers/project-handler.d.ts +1 -1
- package/dist/types/cli/handlers/session-handler.d.ts +0 -7
- package/dist/types/cli/handlers/solo-handler.d.ts +0 -2
- package/dist/types/cli/handlers/workflow-compute-handler.d.ts +8 -0
- package/dist/types/cli/memory-coordinator.d.ts +1 -1
- package/dist/types/cli/multi-agent-state-coordinator.d.ts +0 -3
- package/dist/types/cli/pet-runtime.d.ts +5 -5
- package/dist/types/cli/product-coordinator.d.ts +0 -2
- package/dist/types/cli/project-memory-store-factory.d.ts +11 -1
- package/dist/types/cli/rpc-registry.d.ts +0 -15
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +2 -5
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +2 -0
- package/dist/types/cli/stdio-runtime-services.d.ts +2 -0
- package/dist/types/cli/stdio-server.d.ts +3 -4
- package/dist/types/config/cn-mirror.d.ts +2 -2
- package/dist/types/host-contract/index.d.ts +167 -9
- package/dist/types/orchestration/agent-instance.d.ts +1 -3
- package/dist/types/orchestration/goal-mode-adapters.d.ts +0 -3
- package/dist/types/orchestration/goal-run-persistence.d.ts +0 -3
- package/dist/types/orchestration/product-persistence.d.ts +1 -4
- package/dist/types/orchestration/product-planner.d.ts +2 -3
- package/dist/types/orchestration/run-state-host-authority.d.ts +7 -0
- package/dist/types/orchestration/solo-evaluator.d.ts +8 -3
- package/dist/types/orchestration/solo-persistence.d.ts +4 -7
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +13 -2
- package/dist/types/orchestration/workflow/node-schema.d.ts +2 -1
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +1 -1
- package/dist/types/orchestration/workflow/workflow-bundle.d.ts +1 -1
- package/dist/types/pet-host.d.ts +9 -0
- package/dist/types/project-memory-host.d.ts +3 -0
- package/dist/types/protocol/wire/acp-agent-management.d.ts +1 -1
- package/dist/types/protocol/wire/acp-protocol.d.ts +8 -1
- package/dist/types/runtime/infra/acp-detector.d.ts +1 -1
- package/dist/types/runtime/infra/background-tasks.d.ts +1 -1
- package/dist/types/runtime/pet/pet-community-assets.d.ts +7 -17
- package/dist/types/runtime/pet/pet-reaction-engine.d.ts +1 -1
- package/dist/types/runtime/pet/petdex-vision-qa.d.ts +12 -0
- package/dist/types/runtime/ports/memory-recall-source.d.ts +10 -0
- package/dist/types/runtime/ports/project-memory-store.d.ts +1 -1
- package/dist/types/runtime/session/session-persistence.d.ts +3 -4
- package/dist/types/skills/mcp/mcp-manager.d.ts +4 -0
- package/dist/types/skills/memory/host-memory-provider.d.ts +2 -2
- package/dist/types/skills/memory/memory-config-resolver.d.ts +4 -0
- package/dist/types/skills/memory/task-distillation.d.ts +1 -1
- package/dist/types/test-support/run-state-authority-setup.d.ts +1 -0
- package/dist/types/transport/host-pet-client.d.ts +20 -0
- package/dist/types/transport/host-run-state-client.d.ts +17 -0
- package/dist/types/workflow-host.d.ts +33 -0
- package/dist/workflow-host.js +13 -0
- package/package.json +27 -3
- package/dist/runtime/infra/mcp-bridge-server.js +0 -338
- package/dist/types/cli/core-tools/cron-tool-bootstrap.d.ts +0 -8
- package/dist/types/cli/core-tools/cron-workflow-service.d.ts +0 -7
- package/dist/types/cli/handlers/message-feedback-handler.d.ts +0 -31
- package/dist/types/cli/handlers/pet-handler.d.ts +0 -49
- package/dist/types/cli/handlers/workflow-handler.d.ts +0 -182
- package/dist/types/cli/tool-bootstrap-workflow-registration.d.ts +0 -7
- package/dist/types/cli/workflow-host-adapter.d.ts +0 -31
- package/dist/types/orchestration/workflow/workflow-service.d.ts +0 -14
- package/dist/types/runtime/infra/agent-process.d.ts +0 -368
- package/dist/types/runtime/infra/external-agent-pool.d.ts +0 -89
- package/dist/types/skills/memory/local-memory-provider.d.ts +0 -325
- package/dist/types/skills/memory/memory-provider-factory.d.ts +0 -33
- package/dist/types/skills/tools/cron-tool.d.ts +0 -96
- package/dist/types/skills/tools/petdex-create-tool.d.ts +0 -47
- package/dist/types/skills/tools/workflow-tool.d.ts +0 -45
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local Memory Provider - implements MemoryProvider using local SQLite store.
|
|
3
|
-
*
|
|
4
|
-
* This is the default provider for desktop use. Requires no external service.
|
|
5
|
-
* Uses FTS5 for keyword search and optionally embedding API for vector search.
|
|
6
|
-
*
|
|
7
|
-
* Falls back gracefully:
|
|
8
|
-
* - With embedding API configured: hybrid search (FTS + vector)
|
|
9
|
-
* - Without embedding: FTS-only search (still useful for exact/keyword matches)
|
|
10
|
-
*/
|
|
11
|
-
import type { MemoryProvider, MemorySearchResult, MemorySearchOptions, MemoryIngestOptions } from "../../protocol/wire/index.js";
|
|
12
|
-
import type { MemoryClaimRecord, MemoryConflictRecord, MemoryProposalRecord, MemoryUpdateInput, SqliteDatabase } from "./local-store.js";
|
|
13
|
-
import { type AdoptedAttachment } from "./memory-attachment-store.js";
|
|
14
|
-
import { type LocalEmbeddingConfig } from "./local-embedding.js";
|
|
15
|
-
import { type ExtractedMemoryItem, type MemoryConsolidationResult } from "./memory-consolidation.js";
|
|
16
|
-
export type { ExtractedMemoryItem } from "./memory-consolidation.js";
|
|
17
|
-
export interface LocalMemoryProviderConfig {
|
|
18
|
-
/** Active owner profile. Determines the physical SQLite database location. */
|
|
19
|
-
ownerUserId?: string;
|
|
20
|
-
/** Embedding configuration. If omitted, uses FTS-only search. */
|
|
21
|
-
embedding?: LocalEmbeddingConfig;
|
|
22
|
-
/** User ID prefix for multi-tenant isolation. */
|
|
23
|
-
userIdPrefix?: string;
|
|
24
|
-
/** Factory function to create the SQLite database instance. */
|
|
25
|
-
createDatabase?: (dbPath: string) => SqliteDatabase;
|
|
26
|
-
}
|
|
27
|
-
export declare class LocalMemoryProvider implements MemoryProvider {
|
|
28
|
-
readonly providerId = "qmemory-local";
|
|
29
|
-
private store;
|
|
30
|
-
private embedding;
|
|
31
|
-
private consolidator;
|
|
32
|
-
private attachmentStore;
|
|
33
|
-
private userIdPrefix;
|
|
34
|
-
private dbPath;
|
|
35
|
-
private attachmentsDir;
|
|
36
|
-
/** Active embedding model id — stamped onto stored vectors and used to skip
|
|
37
|
-
* incomparable vectors at search time (model switch = silent noise otherwise). */
|
|
38
|
-
private embeddingModelId;
|
|
39
|
-
/** One-shot flag: the embedding-degradation trace is logged once per provider instance. */
|
|
40
|
-
private embeddingFailureLogged;
|
|
41
|
-
constructor(config: LocalMemoryProviderConfig);
|
|
42
|
-
/** Persist an uploaded attachment (orphan until linked at commit). */
|
|
43
|
-
adoptAttachment(input: {
|
|
44
|
-
data?: Buffer;
|
|
45
|
-
sourceUrl?: string;
|
|
46
|
-
filename: string;
|
|
47
|
-
mimeType: string;
|
|
48
|
-
userId: string;
|
|
49
|
-
}): Promise<AdoptedAttachment>;
|
|
50
|
-
/** Resolve an attachment id to its on-disk path (for serving). */
|
|
51
|
-
locateAttachment(id: string): Promise<{
|
|
52
|
-
absPath: string;
|
|
53
|
-
mimeType: string;
|
|
54
|
-
filename: string;
|
|
55
|
-
} | null>;
|
|
56
|
-
/** Drop uploads that were never saved to a memory. */
|
|
57
|
-
purgeOrphanAttachments(): Promise<void>;
|
|
58
|
-
/** Read an attachment's bytes + mime (P2 multimodal understanding). */
|
|
59
|
-
readAttachmentBytes(id: string): Promise<{
|
|
60
|
-
bytes: Buffer;
|
|
61
|
-
mimeType: string;
|
|
62
|
-
} | null>;
|
|
63
|
-
/** Persist the understood/extracted text on an attachment row. */
|
|
64
|
-
setAttachmentText(id: string, text: string): void;
|
|
65
|
-
private resolveUserId;
|
|
66
|
-
/**
|
|
67
|
-
* The embedding API failing silently downgrades every search to FTS-only —
|
|
68
|
-
* leave one error-level trace per provider instance (deduped so a broken
|
|
69
|
-
* endpoint does not flood the log on every query).
|
|
70
|
-
*/
|
|
71
|
-
private noteEmbeddingFailure;
|
|
72
|
-
private buildEmbedding;
|
|
73
|
-
search(query: string, userId: string, options?: MemorySearchOptions): Promise<MemorySearchResult[]>;
|
|
74
|
-
/** Public embedding access for task-distillation signatures (R3). Null when
|
|
75
|
-
* the embedding provider is unavailable — callers must degrade, not throw.
|
|
76
|
-
* B3(X7): returns number[] (not Float32Array) — this method is on the 16-method
|
|
77
|
-
* host-state proxy surface and its result crosses the x/host.request JSON wire
|
|
78
|
-
* in host mode; typed arrays do not survive JSON serialization. */
|
|
79
|
-
embedText(text: string): Promise<number[] | null>;
|
|
80
|
-
addText(text: string, userId: string, options?: MemoryIngestOptions & {
|
|
81
|
-
category?: string;
|
|
82
|
-
importance?: number;
|
|
83
|
-
}): Promise<{
|
|
84
|
-
memoriesAdded: number;
|
|
85
|
-
}>;
|
|
86
|
-
remove(memoryId: string): Promise<boolean>;
|
|
87
|
-
update(memoryId: string, input: MemoryUpdateInput): Promise<boolean>;
|
|
88
|
-
/**
|
|
89
|
-
* Prompt-injection screen for L2 writes. The memory-tool path already checks
|
|
90
|
-
* this, but implicit extraction / distillation / RPC ingestion used to write
|
|
91
|
-
* UNSCREENED — recalled memories land in a system message, so this is the
|
|
92
|
-
* last write-side gate. Rejections are traced, never silent.
|
|
93
|
-
*/
|
|
94
|
-
private screenUnsafeItems;
|
|
95
|
-
/**
|
|
96
|
-
* Commit extracted memory items through the single consolidation pipeline.
|
|
97
|
-
*/
|
|
98
|
-
ingestExtracted(items: ExtractedMemoryItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationResult>;
|
|
99
|
-
observeExtracted(items: ExtractedMemoryItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationResult>;
|
|
100
|
-
proposeExtracted(items: ExtractedMemoryItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationResult>;
|
|
101
|
-
/**
|
|
102
|
-
* Consume the pending-proposal backlog (the "proposals black hole" fix).
|
|
103
|
-
*
|
|
104
|
-
* Trust ladder, mirroring V3's graduated autonomy:
|
|
105
|
-
* - CORROBORATED facts — the same fact proposed again from an independent
|
|
106
|
-
* context (different session or different source) — commit automatically,
|
|
107
|
-
* with a trace. Evidence, not a confidence score, is the auto gate.
|
|
108
|
-
* - Feedback-distillation proposals commit alone: their >=2-evidence bar
|
|
109
|
-
* was already enforced upstream (idempotency-keyed sweep, §10).
|
|
110
|
-
* - dream-source proposals never commit alone; they only corroborate.
|
|
111
|
-
* - Everything else waits for corroboration and EXPIRES after the TTL —
|
|
112
|
-
* visibly (status=expired), not by silent deletion.
|
|
113
|
-
*/
|
|
114
|
-
consumePendingProposals(userId: string, opts?: {
|
|
115
|
-
now?: number;
|
|
116
|
-
ttlMs?: number;
|
|
117
|
-
maxCommitsPerPass?: number;
|
|
118
|
-
}): Promise<{
|
|
119
|
-
committed: number;
|
|
120
|
-
merged: number;
|
|
121
|
-
expiredIds: string[];
|
|
122
|
-
pendingLeft: number;
|
|
123
|
-
}>;
|
|
124
|
-
/** Proposals for the memory candidate surface: pending (default) or the
|
|
125
|
-
* read-only expired history. Other statuses stay internal. */
|
|
126
|
-
listPendingProposals(userId: string, limit?: number, status?: "pending" | "expired"): MemoryProposalRecord[];
|
|
127
|
-
/** Resolve one pending proposal from the UI: confirm -> commit now; dismiss -> rejected. */
|
|
128
|
-
resolveProposal(userId: string, proposalId: string, action: "confirm" | "dismiss"): Promise<boolean>;
|
|
129
|
-
listClaims(userId: string): MemoryClaimRecord[];
|
|
130
|
-
listConflicts(userId: string): MemoryConflictRecord[];
|
|
131
|
-
/**
|
|
132
|
-
* Drain the consolidation backlog: auto-resolve open conflicts and promote
|
|
133
|
-
* corroborated pending claims. Called by dream after consolidation so the
|
|
134
|
-
* observation→proposal→claim pipeline doesn't accumulate unresolved state
|
|
135
|
-
* forever (the "proposals black hole").
|
|
136
|
-
*
|
|
137
|
-
* Conflict winner = higher source priority, then confidence, then recency.
|
|
138
|
-
* The loser claim is superseded and its backing memory archived.
|
|
139
|
-
*/
|
|
140
|
-
resolveConflicts(userId: string, opts?: {
|
|
141
|
-
minEvidenceToPromote?: number;
|
|
142
|
-
}): Promise<{
|
|
143
|
-
conflictsResolved: number;
|
|
144
|
-
claimsPromoted: number;
|
|
145
|
-
}>;
|
|
146
|
-
/**
|
|
147
|
-
* Trigger memory decay - multi-strategy (temporal + staleness + noise).
|
|
148
|
-
* Also enforces capacity limit and runs vacuum for space reclamation.
|
|
149
|
-
*/
|
|
150
|
-
triggerDecay(userId: string): Promise<{
|
|
151
|
-
decayed: number;
|
|
152
|
-
}>;
|
|
153
|
-
/**
|
|
154
|
-
* Apply feedback to a memory (useful/irrelevant/outdated/wrong).
|
|
155
|
-
* Adjusts importance or archives/deletes based on signal.
|
|
156
|
-
*/
|
|
157
|
-
/** V3 promote/demote: archive(技能接棒,记忆退役)与 unarchive(降格回归)成对。
|
|
158
|
-
* claims 状态随动,防 archived 记忆的 claim 继续参与冲突/召回。
|
|
159
|
-
* B3(X7)异步化:16 面 host-state proxy 方法,签名统一 Promise(实现体仍同步)。 */
|
|
160
|
-
setMemoryArchived(memoryId: string, archived: boolean): Promise<boolean>;
|
|
161
|
-
feedback(memoryIds: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong"): Promise<{
|
|
162
|
-
affected: number;
|
|
163
|
-
}>;
|
|
164
|
-
/**
|
|
165
|
-
* Get a user profile value.
|
|
166
|
-
*/
|
|
167
|
-
getProfile(userId: string, key: string): string | null;
|
|
168
|
-
/**
|
|
169
|
-
* Set a user profile value (upsert).
|
|
170
|
-
* B3(X7)异步化:16 面 host-state proxy 方法。
|
|
171
|
-
*/
|
|
172
|
-
setProfile(userId: string, key: string, value: string): Promise<void>;
|
|
173
|
-
/**
|
|
174
|
-
* Get all profile entries for a user.
|
|
175
|
-
* B3(X7)异步化:16 面 host-state proxy 方法。
|
|
176
|
-
*/
|
|
177
|
-
getAllProfiles(userId: string): Promise<Record<string, string>>;
|
|
178
|
-
/**
|
|
179
|
-
* Delete a profile entry.
|
|
180
|
-
*/
|
|
181
|
-
deleteProfile(userId: string, key: string): boolean;
|
|
182
|
-
/**
|
|
183
|
-
* Get memories within a time range, grouped by day.
|
|
184
|
-
* Powers "what happened last week" type queries.
|
|
185
|
-
*/
|
|
186
|
-
getTemporalSlice(userId: string, startMs: number, endMs: number, options?: {
|
|
187
|
-
category?: string;
|
|
188
|
-
limit?: number;
|
|
189
|
-
}): {
|
|
190
|
-
date: string;
|
|
191
|
-
memories: Array<{
|
|
192
|
-
id: string;
|
|
193
|
-
text: string;
|
|
194
|
-
category: string;
|
|
195
|
-
importance: number;
|
|
196
|
-
}>;
|
|
197
|
-
}[];
|
|
198
|
-
/**
|
|
199
|
-
* Get activity summary over recent N days (daily counts + highlights).
|
|
200
|
-
* B3(X7)异步化:16 面 host-state proxy 方法。
|
|
201
|
-
*/
|
|
202
|
-
getActivitySummary(userId: string, days?: number): Promise<{
|
|
203
|
-
dailyCounts: Array<{
|
|
204
|
-
date: string;
|
|
205
|
-
count: number;
|
|
206
|
-
}>;
|
|
207
|
-
highlights: Array<{
|
|
208
|
-
id: string;
|
|
209
|
-
text: string;
|
|
210
|
-
category: string;
|
|
211
|
-
importance: number;
|
|
212
|
-
date: string;
|
|
213
|
-
}>;
|
|
214
|
-
}>;
|
|
215
|
-
/**
|
|
216
|
-
* List full memory records for a user (paginated). Used by the memory atlas
|
|
217
|
-
* visualization, which needs the complete record shape (confidence, importance,
|
|
218
|
-
* accessCount, timestamps, tags) to drive its 3D rendering.
|
|
219
|
-
*/
|
|
220
|
-
list(userId: string, options?: {
|
|
221
|
-
page?: number;
|
|
222
|
-
pageSize?: number;
|
|
223
|
-
activeOnly?: boolean;
|
|
224
|
-
}): import("./local-store-records.js").MemoryRecord[];
|
|
225
|
-
/**
|
|
226
|
-
* Return the final atlas payload: a bounded interactive record window plus
|
|
227
|
-
* whole-history buckets/clusters for large timelines.
|
|
228
|
-
* B3(X7)异步化:16 面 host-state proxy 方法。
|
|
229
|
-
*/
|
|
230
|
-
getAtlas(userId: string, options?: {
|
|
231
|
-
pageSize?: number;
|
|
232
|
-
windowStartAt?: number;
|
|
233
|
-
windowEndAt?: number;
|
|
234
|
-
windowCenterAt?: number;
|
|
235
|
-
bucketCount?: number;
|
|
236
|
-
clusterLimit?: number;
|
|
237
|
-
activeOnly?: boolean;
|
|
238
|
-
}): Promise<import("./local-store-records.js").MemoryAtlasResult>;
|
|
239
|
-
/** Complete tag-scoped listing (resident refresh / onboarding purge) — see store.listByTag. */
|
|
240
|
-
listMemoriesByTag(userId: string, tag: string): import("./local-store-records.js").MemoryRecord[];
|
|
241
|
-
/**
|
|
242
|
-
* Find related memories (event continuity detection).
|
|
243
|
-
* Given a new memory, finds existing memories that are semantically related
|
|
244
|
-
* (cosine 0.6-0.82) and from the past 14 days. These represent continuations
|
|
245
|
-
* of an ongoing event/thread.
|
|
246
|
-
*
|
|
247
|
-
* Example: "interviewed with ByteDance on Monday" -> finds "sent ByteDance resume last week" -> linked event chain.
|
|
248
|
-
*/
|
|
249
|
-
findRelatedEvents(text: string, userId: string, options?: {
|
|
250
|
-
maxDaysBack?: number;
|
|
251
|
-
minSimilarity?: number;
|
|
252
|
-
maxSimilarity?: number;
|
|
253
|
-
limit?: number;
|
|
254
|
-
}): Promise<Array<{
|
|
255
|
-
id: string;
|
|
256
|
-
text: string;
|
|
257
|
-
score: number;
|
|
258
|
-
date: string;
|
|
259
|
-
}>>;
|
|
260
|
-
/**
|
|
261
|
-
* Synthesize a temporal narrative from memories in a time range.
|
|
262
|
-
* Returns a structured timeline suitable for prompt injection.
|
|
263
|
-
* B3(X7)异步化:16 面 host-state proxy 方法。
|
|
264
|
-
*/
|
|
265
|
-
synthesizeTimeline(userId: string, startMs: number, endMs: number): Promise<string>;
|
|
266
|
-
/**
|
|
267
|
-
* Rerank search results by applying recency boost, access frequency,
|
|
268
|
-
* and importance weighting. No LLM needed - pure scoring heuristics.
|
|
269
|
-
*
|
|
270
|
-
* This goes beyond basic search scoring by considering:
|
|
271
|
-
* - Temporal proximity (recent memories get boosted)
|
|
272
|
-
* - Access frequency (frequently recalled = more relevant)
|
|
273
|
-
* - Category alignment (if preferredCategories specified)
|
|
274
|
-
*/
|
|
275
|
-
rerank(results: Array<{
|
|
276
|
-
id: string;
|
|
277
|
-
text: string;
|
|
278
|
-
score: number;
|
|
279
|
-
category?: string;
|
|
280
|
-
metadata?: Record<string, unknown>;
|
|
281
|
-
}>, options?: {
|
|
282
|
-
preferredCategories?: string[];
|
|
283
|
-
recencyBoostDays?: number;
|
|
284
|
-
}): Array<{
|
|
285
|
-
id: string;
|
|
286
|
-
text: string;
|
|
287
|
-
score: number;
|
|
288
|
-
category?: string;
|
|
289
|
-
metadata?: Record<string, unknown>;
|
|
290
|
-
}>;
|
|
291
|
-
/**
|
|
292
|
-
* Health check — a real probe, not a constant: reports the actual active row
|
|
293
|
-
* count and turns DB access errors into status "error" instead of "healthy".
|
|
294
|
-
*/
|
|
295
|
-
health(): Promise<{
|
|
296
|
-
status: string;
|
|
297
|
-
memoryCount: number;
|
|
298
|
-
dbPath: string;
|
|
299
|
-
}>;
|
|
300
|
-
/**
|
|
301
|
-
* Get memory count for a user.
|
|
302
|
-
*/
|
|
303
|
-
count(userId: string): number;
|
|
304
|
-
/**
|
|
305
|
-
* Reset ALL long-term memory state for a user: every SQLite table (memories,
|
|
306
|
-
* observations, proposals, claims, conflicts, attachments index, profile KV),
|
|
307
|
-
* the attachment files on disk, and the task-distillation working stores
|
|
308
|
-
* (candidate prompts are stored in clear text — they are memory-domain data
|
|
309
|
-
* and must not survive a "clear my memory"). promotion-proposals.json is
|
|
310
|
-
* deliberately KEPT: it is the audit trail of the user's own promote/demote
|
|
311
|
-
* decisions and the demote map for already-created skills.
|
|
312
|
-
*
|
|
313
|
-
* Returns the number of memory rows removed (wire-compat with the old shape).
|
|
314
|
-
*/
|
|
315
|
-
resetUser(userId: string): Promise<number>;
|
|
316
|
-
/**
|
|
317
|
-
* Close the database connection.
|
|
318
|
-
*/
|
|
319
|
-
close(): void;
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Create a local memory provider (convenience factory).
|
|
323
|
-
* Caller must provide the createDatabase factory to avoid hard dependency on better-sqlite3.
|
|
324
|
-
*/
|
|
325
|
-
export declare function createLocalMemoryProvider(config: LocalMemoryProviderConfig): LocalMemoryProvider;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory Provider Factory — creates local SQLite memory provider.
|
|
3
|
-
*
|
|
4
|
-
* No remote/cloud memory service exists. Memory is always local.
|
|
5
|
-
* This factory is the single integration point for stdio-server.ts.
|
|
6
|
-
*/
|
|
7
|
-
import type { LocalMemoryProvider } from "./local-memory-provider.js";
|
|
8
|
-
import { type MemoryProviderFactoryConfig } from "./memory-embedding-config.js";
|
|
9
|
-
export type { MemoryProviderFactoryConfig } from "./memory-embedding-config.js";
|
|
10
|
-
export interface MemoryProviderFactoryResult {
|
|
11
|
-
provider: LocalMemoryProvider | null;
|
|
12
|
-
mode: "local" | "none";
|
|
13
|
-
error?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Create the local SQLite memory provider.
|
|
17
|
-
* Returns null (mode "none") only if better-sqlite3 is not available.
|
|
18
|
-
*/
|
|
19
|
-
export declare function createMemoryProvider(config: MemoryProviderFactoryConfig): MemoryProviderFactoryResult;
|
|
20
|
-
/**
|
|
21
|
-
* Build MemoryProviderFactoryConfig from environment variables.
|
|
22
|
-
* Used by stdio-server to auto-configure memory.
|
|
23
|
-
*
|
|
24
|
-
* Environment variables:
|
|
25
|
-
* QMEMORY_EMBEDDING_TIMEOUT_MS — embedding request timeout (default: 1500)
|
|
26
|
-
* QMEMORY_USER_PREFIX — user ID prefix for multi-tenant
|
|
27
|
-
*
|
|
28
|
-
* Fixed embedding resolution:
|
|
29
|
-
* Layer 0: Explicit ModelRegistry "embedding" binding
|
|
30
|
-
* Layer 1: LLM Router default embedding endpoint (BAAI/bge-m3)
|
|
31
|
-
* Layer 2: FTS5 pure text (NullEmbeddingProvider)
|
|
32
|
-
*/
|
|
33
|
-
export declare function resolveMemoryConfigFromEnv(): MemoryProviderFactoryConfig;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
export declare const CRON_TOOL_NAME: "cron";
|
|
3
|
-
export type CronAction = "create" | "list" | "get" | "update" | "delete" | "pause" | "resume" | "trigger";
|
|
4
|
-
export interface CronToolParams {
|
|
5
|
-
action: CronAction;
|
|
6
|
-
/** Job ID (required for get/update/delete/pause/resume/trigger) */
|
|
7
|
-
jobId?: string;
|
|
8
|
-
/** Task prompt to execute on schedule */
|
|
9
|
-
prompt?: string;
|
|
10
|
-
/** Cron expression or shorthand ('5m', '1h', '0 9 * * *') */
|
|
11
|
-
schedule?: string;
|
|
12
|
-
/** Human-readable job name */
|
|
13
|
-
name?: string;
|
|
14
|
-
/** Whether the job is enabled */
|
|
15
|
-
enabled?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare const CRON_TOOL_SCHEMA: {
|
|
18
|
-
readonly type: "object";
|
|
19
|
-
readonly properties: {
|
|
20
|
-
readonly action: {
|
|
21
|
-
readonly type: "string";
|
|
22
|
-
readonly enum: readonly ["create", "list", "get", "update", "delete", "pause", "resume", "trigger"];
|
|
23
|
-
readonly description: "Workflow-backed action: create/list/get/update/delete/pause/resume/trigger.";
|
|
24
|
-
};
|
|
25
|
-
readonly jobId: {
|
|
26
|
-
readonly type: "string";
|
|
27
|
-
readonly description: "Job ID. Required for get/update/delete/pause/resume/trigger.";
|
|
28
|
-
};
|
|
29
|
-
readonly prompt: {
|
|
30
|
-
readonly type: "string";
|
|
31
|
-
readonly description: "Task prompt to execute on schedule. Required for create.";
|
|
32
|
-
};
|
|
33
|
-
readonly schedule: {
|
|
34
|
-
readonly type: "string";
|
|
35
|
-
readonly description: string;
|
|
36
|
-
};
|
|
37
|
-
readonly name: {
|
|
38
|
-
readonly type: "string";
|
|
39
|
-
readonly description: "Human-readable job name.";
|
|
40
|
-
};
|
|
41
|
-
readonly enabled: {
|
|
42
|
-
readonly type: "boolean";
|
|
43
|
-
readonly description: "Whether the job is enabled (for update).";
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
readonly required: readonly ["action"];
|
|
47
|
-
};
|
|
48
|
-
export interface CronJob {
|
|
49
|
-
id: string;
|
|
50
|
-
name: string;
|
|
51
|
-
prompt: string;
|
|
52
|
-
schedule: string;
|
|
53
|
-
scheduleDisplay: string;
|
|
54
|
-
state: "scheduled" | "paused";
|
|
55
|
-
enabled: boolean;
|
|
56
|
-
nextRunAt?: string;
|
|
57
|
-
lastRunAt?: string;
|
|
58
|
-
lastStatus?: "success" | "error" | null;
|
|
59
|
-
}
|
|
60
|
-
export interface CronResult {
|
|
61
|
-
success: boolean;
|
|
62
|
-
job?: CronJob;
|
|
63
|
-
jobs?: CronJob[];
|
|
64
|
-
error?: string;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Host-provided cron scheduler backend.
|
|
68
|
-
* Jobs are persisted locally and survive restarts.
|
|
69
|
-
*/
|
|
70
|
-
export interface CronToolDeps {
|
|
71
|
-
createJob(params: {
|
|
72
|
-
prompt: string;
|
|
73
|
-
schedule: string;
|
|
74
|
-
name?: string;
|
|
75
|
-
repeat?: number | null;
|
|
76
|
-
allowedTools?: string[];
|
|
77
|
-
}): Promise<CronResult>;
|
|
78
|
-
listJobs(): Promise<CronResult>;
|
|
79
|
-
getJob(jobId: string): Promise<CronResult>;
|
|
80
|
-
updateJob(jobId: string, updates: Partial<{
|
|
81
|
-
prompt: string;
|
|
82
|
-
schedule: string;
|
|
83
|
-
name: string;
|
|
84
|
-
enabled: boolean;
|
|
85
|
-
repeat: number | null;
|
|
86
|
-
allowedTools: string[];
|
|
87
|
-
}>): Promise<CronResult>;
|
|
88
|
-
deleteJob(jobId: string): Promise<CronResult>;
|
|
89
|
-
pauseJob(jobId: string): Promise<CronResult>;
|
|
90
|
-
resumeJob(jobId: string): Promise<CronResult>;
|
|
91
|
-
triggerJob(jobId: string): Promise<CronResult>;
|
|
92
|
-
/** Validate cron schedule expression. Returns error or null. */
|
|
93
|
-
validateSchedule?(schedule: string): string | null;
|
|
94
|
-
}
|
|
95
|
-
export declare const MAX_CRON_JOBS = 50;
|
|
96
|
-
export declare function createCronTool(deps: CronToolDeps): PortableTool<CronToolParams>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
import type { GeneratePetdexImage, UploadPetdexReferenceImage } from "@xiaozhiclaw/pet-core";
|
|
3
|
-
export declare const PETDEX_CREATE_TOOL_NAME: "petdex_create";
|
|
4
|
-
export interface PetdexCreateToolParams {
|
|
5
|
-
name?: string;
|
|
6
|
-
description: string;
|
|
7
|
-
prompt?: string;
|
|
8
|
-
reference_image_url?: string;
|
|
9
|
-
base_spritesheet_path?: string;
|
|
10
|
-
output_dir?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface PetdexCreateToolDeps {
|
|
13
|
-
generateImage: GeneratePetdexImage;
|
|
14
|
-
uploadReferenceImage?: UploadPetdexReferenceImage;
|
|
15
|
-
resolveOutputDir(outputDir?: string): string;
|
|
16
|
-
}
|
|
17
|
-
export declare const PETDEX_CREATE_TOOL_SCHEMA: {
|
|
18
|
-
readonly type: "object";
|
|
19
|
-
readonly properties: {
|
|
20
|
-
readonly name: {
|
|
21
|
-
readonly type: "string";
|
|
22
|
-
readonly description: "Short display name for the generated desktop pet. Defaults to a short name derived from description.";
|
|
23
|
-
};
|
|
24
|
-
readonly description: {
|
|
25
|
-
readonly type: "string";
|
|
26
|
-
readonly description: "Canonical character description for the Petdex desktop pet.";
|
|
27
|
-
};
|
|
28
|
-
readonly prompt: {
|
|
29
|
-
readonly type: "string";
|
|
30
|
-
readonly description: "Optional extra visual direction. The tool will embed it into a strict Petdex 8x9 atlas prompt.";
|
|
31
|
-
};
|
|
32
|
-
readonly reference_image_url: {
|
|
33
|
-
readonly type: "string";
|
|
34
|
-
readonly description: "Optional publicly accessible HTTP/HTTPS reference image URL for image-to-image generation.";
|
|
35
|
-
};
|
|
36
|
-
readonly base_spritesheet_path: {
|
|
37
|
-
readonly type: "string";
|
|
38
|
-
readonly description: "Optional existing spritesheet.webp path; used as the identity reference to regenerate the whole atlas while keeping the same character.";
|
|
39
|
-
};
|
|
40
|
-
readonly output_dir: {
|
|
41
|
-
readonly type: "string";
|
|
42
|
-
readonly description: "Optional output directory. Defaults to the workspace Petdex asset output directory.";
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
readonly required: readonly ["description"];
|
|
46
|
-
};
|
|
47
|
-
export declare function createPetdexCreateTool(deps: PetdexCreateToolDeps): PortableTool<PetdexCreateToolParams>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { PortableTool } from "../portable-tool.js";
|
|
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 {
|
|
14
|
-
id: string;
|
|
15
|
-
name?: string;
|
|
16
|
-
rev?: number;
|
|
17
|
-
active?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export interface WorkflowRunOutcome {
|
|
20
|
-
status?: string;
|
|
21
|
-
}
|
|
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>;
|
|
40
|
-
}
|
|
41
|
-
export interface WorkflowToolDeps {
|
|
42
|
-
/** Resolve the host-owned workflow service port. Keeps skills independent from orchestration internals. */
|
|
43
|
-
getService(): WorkflowToolService;
|
|
44
|
-
}
|
|
45
|
-
export declare function createWorkflowTool(deps: WorkflowToolDeps): PortableTool<WorkflowToolParams>;
|