mind-palace-graph 0.3.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.
- package/INSTALL.md +387 -0
- package/README.md +602 -0
- package/dist/api.d.ts +682 -0
- package/dist/api.js +660 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.d.ts +95 -0
- package/dist/cli.js +856 -0
- package/dist/cli.js.map +1 -0
- package/dist/format.d.ts +16 -0
- package/dist/format.js +199 -0
- package/dist/format.js.map +1 -0
- package/dist/fuzzy.d.ts +45 -0
- package/dist/fuzzy.js +150 -0
- package/dist/fuzzy.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +528 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server.d.ts +24 -0
- package/dist/mcp-server.js +187 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/mind-palace.d.ts +148 -0
- package/dist/mind-palace.js +780 -0
- package/dist/mind-palace.js.map +1 -0
- package/dist/nodes.d.ts +57 -0
- package/dist/nodes.js +220 -0
- package/dist/nodes.js.map +1 -0
- package/dist/pagination.d.ts +41 -0
- package/dist/pagination.js +63 -0
- package/dist/pagination.js.map +1 -0
- package/dist/palace-format.d.ts +30 -0
- package/dist/palace-format.js +146 -0
- package/dist/palace-format.js.map +1 -0
- package/dist/rg.d.ts +34 -0
- package/dist/rg.js +288 -0
- package/dist/rg.js.map +1 -0
- package/dist/sources.d.ts +87 -0
- package/dist/sources.js +457 -0
- package/dist/sources.js.map +1 -0
- package/dist/tokens.d.ts +35 -0
- package/dist/tokens.js +95 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +236 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +67 -0
- package/skills/mpg-context/SKILL.md +556 -0
- package/skills/mpg-context/references/anti-patterns.md +133 -0
- package/skills/mpg-context/references/integration.md +123 -0
- package/skills/mpg-context/references/mind-palace.md +217 -0
- package/skills/mpg-context/references/multi-agent.md +147 -0
- package/skills/mpg-context/references/sources.md +120 -0
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Programmatic API for mpg.
|
|
3
|
+
*
|
|
4
|
+
* This is the surface an LLM harness should embed against instead of
|
|
5
|
+
* shelling out to the CLI. It exposes the same operations the CLI
|
|
6
|
+
* does, but as async functions returning structured data.
|
|
7
|
+
*
|
|
8
|
+
* The CLI is a thin wrapper over this module. Conversely, this module
|
|
9
|
+
* is what powers `mpg search`, `mpg stash`, etc. for in-process use.
|
|
10
|
+
*/
|
|
11
|
+
import { type Stash } from "./mind-palace.js";
|
|
12
|
+
import type { Node } from "./types.js";
|
|
13
|
+
export type Effort = "scan" | "quick" | "normal" | "deep" | "auto";
|
|
14
|
+
export type Strategy = "fill" | "deep";
|
|
15
|
+
export type SortMode = "default" | "recent" | "oldest";
|
|
16
|
+
export type WindowCurve = "flat" | "linear" | "log";
|
|
17
|
+
export interface SearchOptions {
|
|
18
|
+
/** Regex pattern. Required for search. */
|
|
19
|
+
pattern: string;
|
|
20
|
+
/** Paths to search (files, dirs, globs, @file, @-). */
|
|
21
|
+
in?: string[];
|
|
22
|
+
/** Search the stdout of a command. */
|
|
23
|
+
cmd?: string;
|
|
24
|
+
/** Read content from stdin. */
|
|
25
|
+
stdin?: boolean;
|
|
26
|
+
/** Fetch and search a URL. */
|
|
27
|
+
url?: string;
|
|
28
|
+
/** Tokens of context before each match. Default: 500. */
|
|
29
|
+
before?: number;
|
|
30
|
+
/** Tokens of context after each match. Default: 500. */
|
|
31
|
+
after?: number;
|
|
32
|
+
/** Cap on the number of nodes returned. Default: 30. */
|
|
33
|
+
maxNodes?: number;
|
|
34
|
+
/** Total token budget across all nodes. */
|
|
35
|
+
maxTokens?: number;
|
|
36
|
+
/** How to use --max-tokens. Default: "fill". */
|
|
37
|
+
strategy?: Strategy;
|
|
38
|
+
/** Effort preset. Default: "normal". */
|
|
39
|
+
effort?: Effort;
|
|
40
|
+
/** rg options. */
|
|
41
|
+
rg?: {
|
|
42
|
+
caseInsensitive?: boolean;
|
|
43
|
+
word?: boolean;
|
|
44
|
+
fixedStrings?: boolean;
|
|
45
|
+
multiline?: boolean;
|
|
46
|
+
hidden?: boolean;
|
|
47
|
+
noIgnore?: boolean;
|
|
48
|
+
include?: string[];
|
|
49
|
+
exclude?: string[];
|
|
50
|
+
type?: string;
|
|
51
|
+
};
|
|
52
|
+
/** Use a stashed file list as the search target. */
|
|
53
|
+
from?: string;
|
|
54
|
+
/** Compose multiple stashes' file lists as the search target. */
|
|
55
|
+
compose?: string[];
|
|
56
|
+
/** Palace file path. Defaults to project-scoped. */
|
|
57
|
+
palacePath?: string;
|
|
58
|
+
/** Pagination: 1-indexed page number. */
|
|
59
|
+
page?: number;
|
|
60
|
+
/** Pagination: items per page (default 10). */
|
|
61
|
+
pageSize?: number;
|
|
62
|
+
/** Disable pagination; return everything. */
|
|
63
|
+
all?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Disable the wide-record auto-tune. By default, when the sources
|
|
66
|
+
* being searched have a median line length over ~500 chars (typical
|
|
67
|
+
* of JSONL event streams), mpg drops `before`/`after` to 0 so each
|
|
68
|
+
* node is just the matched line. Set this to `true` to keep the
|
|
69
|
+
* effort-preset windowing regardless of corpus shape.
|
|
70
|
+
*/
|
|
71
|
+
noAutoTune?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Order returned nodes by source file modification time.
|
|
74
|
+
* "default" (or undefined): rg's natural traversal order.
|
|
75
|
+
* "recent": newest-edited files first. Surfaces what changed
|
|
76
|
+
* recently — useful when scan is used as a memory index.
|
|
77
|
+
* "oldest": oldest files first.
|
|
78
|
+
* Non-file sources (cmd / url / stdin) sort to the end in `recent`
|
|
79
|
+
* and to the beginning in `oldest`.
|
|
80
|
+
*/
|
|
81
|
+
sort?: SortMode;
|
|
82
|
+
/**
|
|
83
|
+
* Token-window decay curve applied across returned nodes.
|
|
84
|
+
* "flat" (or undefined): every node gets the full `before`/`after`
|
|
85
|
+
* window. The classic behavior.
|
|
86
|
+
* "linear": window decays linearly from full at rank 0 down to a
|
|
87
|
+
* small floor (~10% of full) at the last rank. Combined with
|
|
88
|
+
* `sort: "recent"`, this gives recent nodes rich context and
|
|
89
|
+
* older nodes a tight disambiguating window.
|
|
90
|
+
* "log": window decays as `full / log2(rank + 2)`. Gentler than
|
|
91
|
+
* linear — useful when you want meaningful context several
|
|
92
|
+
* ranks deep, not just on the first hit.
|
|
93
|
+
* In all modes the per-node window is bounded between 0 and the
|
|
94
|
+
* configured `before`/`after`.
|
|
95
|
+
*/
|
|
96
|
+
windowCurve?: WindowCurve;
|
|
97
|
+
/** Sub-line clip mode (N chars on each side of the matched span). */
|
|
98
|
+
clipChars?: number;
|
|
99
|
+
/** Typo-tolerant search via regex transform (skipped if pattern is regex-y). */
|
|
100
|
+
fuzzy?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/** Public, harness-friendly node shape. Same as internal Node. */
|
|
103
|
+
export interface SearchNode extends Node {
|
|
104
|
+
}
|
|
105
|
+
/** Public, harness-friendly result shape. */
|
|
106
|
+
export interface SearchResult {
|
|
107
|
+
pattern: string;
|
|
108
|
+
effort: Effort;
|
|
109
|
+
strategy: Strategy;
|
|
110
|
+
/**
|
|
111
|
+
* Machine-readable status so LLMs can branch without parsing text.
|
|
112
|
+
* - "ok": matches returned cleanly.
|
|
113
|
+
* - "no_matches": zero matches, all sources searched successfully.
|
|
114
|
+
* - "truncated": matches exceeded budget; partial result.
|
|
115
|
+
* - "partial": at least one source errored but others returned
|
|
116
|
+
* matches. Check `errors[]` for per-source failures.
|
|
117
|
+
* - "error": all sources errored; no usable matches.
|
|
118
|
+
*/
|
|
119
|
+
status: "ok" | "no_matches" | "truncated" | "partial" | "error";
|
|
120
|
+
total_nodes: number;
|
|
121
|
+
total_tokens: number;
|
|
122
|
+
/** Token count of the actual nodes returned (after pagination). */
|
|
123
|
+
page_tokens: number;
|
|
124
|
+
sources_count: number;
|
|
125
|
+
truncated: boolean;
|
|
126
|
+
nodes: SearchNode[];
|
|
127
|
+
/** Per-source errors. Empty array when all sources searched cleanly. */
|
|
128
|
+
errors: Array<{
|
|
129
|
+
source: string;
|
|
130
|
+
message: string;
|
|
131
|
+
}>;
|
|
132
|
+
duration_ms: number;
|
|
133
|
+
before_tokens: number;
|
|
134
|
+
after_tokens: number;
|
|
135
|
+
max_nodes: number;
|
|
136
|
+
max_tokens?: number;
|
|
137
|
+
/** True when the wide-record auto-tune shrank before/after to 0. */
|
|
138
|
+
auto_tune_applied?: boolean;
|
|
139
|
+
/** Optional pagination metadata; absent when pagination is off. */
|
|
140
|
+
pagination?: {
|
|
141
|
+
page: number;
|
|
142
|
+
page_size: number;
|
|
143
|
+
total_items: number;
|
|
144
|
+
total_pages: number;
|
|
145
|
+
has_next: boolean;
|
|
146
|
+
has_prev: boolean;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export interface StashOptions {
|
|
150
|
+
/** Stash name. */
|
|
151
|
+
name: string;
|
|
152
|
+
/** Free-form note. */
|
|
153
|
+
note?: string;
|
|
154
|
+
/** Tags for filtering. */
|
|
155
|
+
tags?: string[];
|
|
156
|
+
/** Overwrite an existing stash. Default: merge. */
|
|
157
|
+
replace?: boolean;
|
|
158
|
+
/** Palace file path. Defaults to project-scoped. */
|
|
159
|
+
palacePath?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Auto-expire this stash after the given duration (e.g. "1h", "7d").
|
|
162
|
+
* Pruned automatically by `mpg --mp-prune-expired`. Default: no expiry.
|
|
163
|
+
*/
|
|
164
|
+
ttl?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Locations-only stash: drop context_before/match_text/context_after
|
|
167
|
+
* to keep just (source, line, span). Useful when you only need the
|
|
168
|
+
* stash for `--mp-from` re-search and don't want to persist body text.
|
|
169
|
+
*/
|
|
170
|
+
locations?: boolean;
|
|
171
|
+
}
|
|
172
|
+
export interface StashResult {
|
|
173
|
+
action: "created" | "merged" | "replaced";
|
|
174
|
+
stash: Stash;
|
|
175
|
+
palace_path: string;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Threshold above which auto-tune treats the corpus as "wide-record"
|
|
179
|
+
* (JSONL events, log lines with embedded JSON, etc) and drops
|
|
180
|
+
* before/after padding. Chosen so that typical source code (lines
|
|
181
|
+
* usually under 200 chars) stays in the line-based regime, while
|
|
182
|
+
* single-line serialized events trip the switch.
|
|
183
|
+
*/
|
|
184
|
+
export declare const WIDE_RECORD_MEDIAN_THRESHOLD = 500;
|
|
185
|
+
/**
|
|
186
|
+
* Estimate median line length across the first chunk of up to 3 files.
|
|
187
|
+
* Used by the wide-record auto-tune.
|
|
188
|
+
*
|
|
189
|
+
* Bounded I/O: we read at most 64KB per file and at most 256KB total,
|
|
190
|
+
* regardless of file size. A file whose head contains any NUL byte is
|
|
191
|
+
* treated as binary and skipped — otherwise a stray .png in a dir spec
|
|
192
|
+
* would feed garbage into the median.
|
|
193
|
+
*/
|
|
194
|
+
export declare function sampleMedianLineLength(files: string[]): number;
|
|
195
|
+
/**
|
|
196
|
+
* Run a search and return structured result.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* const r = await search({ pattern: "TODO", in: ["src/"], effort: "quick" });
|
|
200
|
+
* console.log(r.total_nodes, r.nodes[0].match_text);
|
|
201
|
+
*/
|
|
202
|
+
export declare function search(opts: SearchOptions): Promise<SearchResult>;
|
|
203
|
+
/**
|
|
204
|
+
* Stash a search result in the mind palace.
|
|
205
|
+
*
|
|
206
|
+
* The `result` can be a SearchResult, or just an array of Nodes.
|
|
207
|
+
* Returns the action taken (created/merged/replaced) and the full stash.
|
|
208
|
+
*/
|
|
209
|
+
export declare function stash(result: SearchResult | SearchNode[], opts: StashOptions): Promise<StashResult>;
|
|
210
|
+
export declare function listStashes(palacePath?: string, tagFilter?: string[]): Stash[];
|
|
211
|
+
export declare function getStash(name: string, palacePath?: string): Stash | null;
|
|
212
|
+
export declare function dropStash(name: string, palacePath?: string): boolean;
|
|
213
|
+
/** Resolve a stash (or composition of stashes) to its source paths. */
|
|
214
|
+
export declare function stashToSources(names: string | string[], palacePath?: string): string[];
|
|
215
|
+
/** Claude-compatible tool definitions. Drop into Claude's API. */
|
|
216
|
+
export declare const claudeTools: readonly [{
|
|
217
|
+
readonly type: "function";
|
|
218
|
+
readonly function: {
|
|
219
|
+
readonly name: "mpg_search";
|
|
220
|
+
readonly description: string;
|
|
221
|
+
readonly parameters: {
|
|
222
|
+
type: "object";
|
|
223
|
+
properties: {
|
|
224
|
+
pattern: {
|
|
225
|
+
type: string;
|
|
226
|
+
description: string;
|
|
227
|
+
};
|
|
228
|
+
in: {
|
|
229
|
+
type: string;
|
|
230
|
+
items: {
|
|
231
|
+
type: string;
|
|
232
|
+
};
|
|
233
|
+
description: string;
|
|
234
|
+
};
|
|
235
|
+
cmd: {
|
|
236
|
+
type: string;
|
|
237
|
+
description: string;
|
|
238
|
+
};
|
|
239
|
+
url: {
|
|
240
|
+
type: string;
|
|
241
|
+
description: string;
|
|
242
|
+
};
|
|
243
|
+
before: {
|
|
244
|
+
type: string;
|
|
245
|
+
description: string;
|
|
246
|
+
};
|
|
247
|
+
after: {
|
|
248
|
+
type: string;
|
|
249
|
+
description: string;
|
|
250
|
+
};
|
|
251
|
+
max_nodes: {
|
|
252
|
+
type: string;
|
|
253
|
+
description: string;
|
|
254
|
+
};
|
|
255
|
+
max_tokens: {
|
|
256
|
+
type: string;
|
|
257
|
+
description: string;
|
|
258
|
+
};
|
|
259
|
+
effort: {
|
|
260
|
+
type: string;
|
|
261
|
+
enum: string[];
|
|
262
|
+
description: string;
|
|
263
|
+
};
|
|
264
|
+
strategy: {
|
|
265
|
+
type: string;
|
|
266
|
+
enum: string[];
|
|
267
|
+
description: string;
|
|
268
|
+
};
|
|
269
|
+
from: {
|
|
270
|
+
type: string;
|
|
271
|
+
description: string;
|
|
272
|
+
};
|
|
273
|
+
compose: {
|
|
274
|
+
type: string;
|
|
275
|
+
items: {
|
|
276
|
+
type: string;
|
|
277
|
+
};
|
|
278
|
+
description: string;
|
|
279
|
+
};
|
|
280
|
+
page: {
|
|
281
|
+
type: string;
|
|
282
|
+
description: string;
|
|
283
|
+
};
|
|
284
|
+
page_size: {
|
|
285
|
+
type: string;
|
|
286
|
+
description: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
required: string[];
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
}, {
|
|
293
|
+
readonly type: "function";
|
|
294
|
+
readonly function: {
|
|
295
|
+
readonly name: "mpg_stash";
|
|
296
|
+
readonly description: string;
|
|
297
|
+
readonly parameters: {
|
|
298
|
+
type: "object";
|
|
299
|
+
properties: {
|
|
300
|
+
name: {
|
|
301
|
+
type: string;
|
|
302
|
+
description: string;
|
|
303
|
+
};
|
|
304
|
+
note: {
|
|
305
|
+
type: string;
|
|
306
|
+
description: string;
|
|
307
|
+
};
|
|
308
|
+
tags: {
|
|
309
|
+
type: string;
|
|
310
|
+
items: {
|
|
311
|
+
type: string;
|
|
312
|
+
};
|
|
313
|
+
description: string;
|
|
314
|
+
};
|
|
315
|
+
pattern: {
|
|
316
|
+
type: string;
|
|
317
|
+
description: string;
|
|
318
|
+
};
|
|
319
|
+
in: {
|
|
320
|
+
type: string;
|
|
321
|
+
items: {
|
|
322
|
+
type: string;
|
|
323
|
+
};
|
|
324
|
+
description: string;
|
|
325
|
+
};
|
|
326
|
+
effort: {
|
|
327
|
+
type: string;
|
|
328
|
+
enum: string[];
|
|
329
|
+
};
|
|
330
|
+
replace: {
|
|
331
|
+
type: string;
|
|
332
|
+
description: string;
|
|
333
|
+
};
|
|
334
|
+
palace_path: {
|
|
335
|
+
type: string;
|
|
336
|
+
description: string;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
required: string[];
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
}, {
|
|
343
|
+
readonly type: "function";
|
|
344
|
+
readonly function: {
|
|
345
|
+
readonly name: "mpg_list_stashes";
|
|
346
|
+
readonly description: string;
|
|
347
|
+
readonly parameters: {
|
|
348
|
+
readonly type: "object";
|
|
349
|
+
readonly properties: {
|
|
350
|
+
readonly tag_filter: {
|
|
351
|
+
readonly type: "array";
|
|
352
|
+
readonly items: {
|
|
353
|
+
readonly type: "string";
|
|
354
|
+
};
|
|
355
|
+
readonly description: "Only show stashes with all of these tags.";
|
|
356
|
+
};
|
|
357
|
+
readonly page: {
|
|
358
|
+
readonly type: "number";
|
|
359
|
+
readonly description: "1-indexed page number.";
|
|
360
|
+
};
|
|
361
|
+
readonly page_size: {
|
|
362
|
+
readonly type: "number";
|
|
363
|
+
readonly description: "Stashes per page. Default 20.";
|
|
364
|
+
};
|
|
365
|
+
readonly palace_path: {
|
|
366
|
+
readonly type: "string";
|
|
367
|
+
readonly description: "Override mind-palace file.";
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
readonly required: string[];
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
}, {
|
|
374
|
+
readonly type: "function";
|
|
375
|
+
readonly function: {
|
|
376
|
+
readonly name: "mpg_get_stash";
|
|
377
|
+
readonly description: string;
|
|
378
|
+
readonly parameters: {
|
|
379
|
+
readonly type: "object";
|
|
380
|
+
readonly properties: {
|
|
381
|
+
readonly name: {
|
|
382
|
+
readonly type: "string";
|
|
383
|
+
readonly description: "Name of the stash to retrieve.";
|
|
384
|
+
};
|
|
385
|
+
readonly with_nodes: {
|
|
386
|
+
readonly type: "boolean";
|
|
387
|
+
readonly description: string;
|
|
388
|
+
};
|
|
389
|
+
readonly page: {
|
|
390
|
+
readonly type: "number";
|
|
391
|
+
readonly description: "1-indexed page number (only when with_nodes:true).";
|
|
392
|
+
};
|
|
393
|
+
readonly page_size: {
|
|
394
|
+
readonly type: "number";
|
|
395
|
+
readonly description: "Nodes per page. Default 10 (only when with_nodes:true).";
|
|
396
|
+
};
|
|
397
|
+
readonly palace_path: {
|
|
398
|
+
readonly type: "string";
|
|
399
|
+
readonly description: "Override mind-palace file.";
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
readonly required: readonly ["name"];
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
}, {
|
|
406
|
+
readonly type: "function";
|
|
407
|
+
readonly function: {
|
|
408
|
+
readonly name: "mpg_drop_stash";
|
|
409
|
+
readonly description: string;
|
|
410
|
+
readonly parameters: {
|
|
411
|
+
readonly type: "object";
|
|
412
|
+
readonly properties: {
|
|
413
|
+
readonly name: {
|
|
414
|
+
readonly type: "string";
|
|
415
|
+
readonly description: "Name of the stash to drop.";
|
|
416
|
+
};
|
|
417
|
+
readonly palace_path: {
|
|
418
|
+
readonly type: "string";
|
|
419
|
+
readonly description: "Override mind-palace file.";
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
readonly required: readonly ["name"];
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
}];
|
|
426
|
+
/** Gemini-compatible tool definitions (function_declarations array). */
|
|
427
|
+
export declare const geminiTools: {
|
|
428
|
+
name: "mpg_search" | "mpg_stash" | "mpg_list_stashes" | "mpg_get_stash" | "mpg_drop_stash";
|
|
429
|
+
description: string;
|
|
430
|
+
parameters: {
|
|
431
|
+
type: "object";
|
|
432
|
+
properties: {
|
|
433
|
+
pattern: {
|
|
434
|
+
type: string;
|
|
435
|
+
description: string;
|
|
436
|
+
};
|
|
437
|
+
in: {
|
|
438
|
+
type: string;
|
|
439
|
+
items: {
|
|
440
|
+
type: string;
|
|
441
|
+
};
|
|
442
|
+
description: string;
|
|
443
|
+
};
|
|
444
|
+
cmd: {
|
|
445
|
+
type: string;
|
|
446
|
+
description: string;
|
|
447
|
+
};
|
|
448
|
+
url: {
|
|
449
|
+
type: string;
|
|
450
|
+
description: string;
|
|
451
|
+
};
|
|
452
|
+
before: {
|
|
453
|
+
type: string;
|
|
454
|
+
description: string;
|
|
455
|
+
};
|
|
456
|
+
after: {
|
|
457
|
+
type: string;
|
|
458
|
+
description: string;
|
|
459
|
+
};
|
|
460
|
+
max_nodes: {
|
|
461
|
+
type: string;
|
|
462
|
+
description: string;
|
|
463
|
+
};
|
|
464
|
+
max_tokens: {
|
|
465
|
+
type: string;
|
|
466
|
+
description: string;
|
|
467
|
+
};
|
|
468
|
+
effort: {
|
|
469
|
+
type: string;
|
|
470
|
+
enum: string[];
|
|
471
|
+
description: string;
|
|
472
|
+
};
|
|
473
|
+
strategy: {
|
|
474
|
+
type: string;
|
|
475
|
+
enum: string[];
|
|
476
|
+
description: string;
|
|
477
|
+
};
|
|
478
|
+
from: {
|
|
479
|
+
type: string;
|
|
480
|
+
description: string;
|
|
481
|
+
};
|
|
482
|
+
compose: {
|
|
483
|
+
type: string;
|
|
484
|
+
items: {
|
|
485
|
+
type: string;
|
|
486
|
+
};
|
|
487
|
+
description: string;
|
|
488
|
+
};
|
|
489
|
+
page: {
|
|
490
|
+
type: string;
|
|
491
|
+
description: string;
|
|
492
|
+
};
|
|
493
|
+
page_size: {
|
|
494
|
+
type: string;
|
|
495
|
+
description: string;
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
required: string[];
|
|
499
|
+
} | {
|
|
500
|
+
type: "object";
|
|
501
|
+
properties: {
|
|
502
|
+
name: {
|
|
503
|
+
type: string;
|
|
504
|
+
description: string;
|
|
505
|
+
};
|
|
506
|
+
note: {
|
|
507
|
+
type: string;
|
|
508
|
+
description: string;
|
|
509
|
+
};
|
|
510
|
+
tags: {
|
|
511
|
+
type: string;
|
|
512
|
+
items: {
|
|
513
|
+
type: string;
|
|
514
|
+
};
|
|
515
|
+
description: string;
|
|
516
|
+
};
|
|
517
|
+
pattern: {
|
|
518
|
+
type: string;
|
|
519
|
+
description: string;
|
|
520
|
+
};
|
|
521
|
+
in: {
|
|
522
|
+
type: string;
|
|
523
|
+
items: {
|
|
524
|
+
type: string;
|
|
525
|
+
};
|
|
526
|
+
description: string;
|
|
527
|
+
};
|
|
528
|
+
effort: {
|
|
529
|
+
type: string;
|
|
530
|
+
enum: string[];
|
|
531
|
+
};
|
|
532
|
+
replace: {
|
|
533
|
+
type: string;
|
|
534
|
+
description: string;
|
|
535
|
+
};
|
|
536
|
+
palace_path: {
|
|
537
|
+
type: string;
|
|
538
|
+
description: string;
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
required: string[];
|
|
542
|
+
} | {
|
|
543
|
+
readonly type: "object";
|
|
544
|
+
readonly properties: {
|
|
545
|
+
readonly tag_filter: {
|
|
546
|
+
readonly type: "array";
|
|
547
|
+
readonly items: {
|
|
548
|
+
readonly type: "string";
|
|
549
|
+
};
|
|
550
|
+
readonly description: "Only show stashes with all of these tags.";
|
|
551
|
+
};
|
|
552
|
+
readonly page: {
|
|
553
|
+
readonly type: "number";
|
|
554
|
+
readonly description: "1-indexed page number.";
|
|
555
|
+
};
|
|
556
|
+
readonly page_size: {
|
|
557
|
+
readonly type: "number";
|
|
558
|
+
readonly description: "Stashes per page. Default 20.";
|
|
559
|
+
};
|
|
560
|
+
readonly palace_path: {
|
|
561
|
+
readonly type: "string";
|
|
562
|
+
readonly description: "Override mind-palace file.";
|
|
563
|
+
};
|
|
564
|
+
};
|
|
565
|
+
readonly required: string[];
|
|
566
|
+
} | {
|
|
567
|
+
readonly type: "object";
|
|
568
|
+
readonly properties: {
|
|
569
|
+
readonly name: {
|
|
570
|
+
readonly type: "string";
|
|
571
|
+
readonly description: "Name of the stash to retrieve.";
|
|
572
|
+
};
|
|
573
|
+
readonly with_nodes: {
|
|
574
|
+
readonly type: "boolean";
|
|
575
|
+
readonly description: string;
|
|
576
|
+
};
|
|
577
|
+
readonly page: {
|
|
578
|
+
readonly type: "number";
|
|
579
|
+
readonly description: "1-indexed page number (only when with_nodes:true).";
|
|
580
|
+
};
|
|
581
|
+
readonly page_size: {
|
|
582
|
+
readonly type: "number";
|
|
583
|
+
readonly description: "Nodes per page. Default 10 (only when with_nodes:true).";
|
|
584
|
+
};
|
|
585
|
+
readonly palace_path: {
|
|
586
|
+
readonly type: "string";
|
|
587
|
+
readonly description: "Override mind-palace file.";
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
readonly required: readonly ["name"];
|
|
591
|
+
} | {
|
|
592
|
+
readonly type: "object";
|
|
593
|
+
readonly properties: {
|
|
594
|
+
readonly name: {
|
|
595
|
+
readonly type: "string";
|
|
596
|
+
readonly description: "Name of the stash to drop.";
|
|
597
|
+
};
|
|
598
|
+
readonly palace_path: {
|
|
599
|
+
readonly type: "string";
|
|
600
|
+
readonly description: "Override mind-palace file.";
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
readonly required: readonly ["name"];
|
|
604
|
+
};
|
|
605
|
+
}[];
|
|
606
|
+
/** Legacy: single-tool definition for OpenAI-compatible APIs. */
|
|
607
|
+
export declare const toolDefinition: {
|
|
608
|
+
readonly name: "mpg";
|
|
609
|
+
readonly description: string;
|
|
610
|
+
readonly parameters: {
|
|
611
|
+
readonly type: "object";
|
|
612
|
+
readonly properties: {
|
|
613
|
+
readonly action: {
|
|
614
|
+
readonly type: "string";
|
|
615
|
+
readonly enum: readonly ["search", "stash", "list", "get", "drop"];
|
|
616
|
+
readonly description: "Which operation to perform.";
|
|
617
|
+
};
|
|
618
|
+
readonly pattern: {
|
|
619
|
+
readonly type: "string";
|
|
620
|
+
readonly description: "Regex pattern (search).";
|
|
621
|
+
};
|
|
622
|
+
readonly in: {
|
|
623
|
+
readonly type: "array";
|
|
624
|
+
readonly items: {
|
|
625
|
+
readonly type: "string";
|
|
626
|
+
};
|
|
627
|
+
readonly description: "Paths to search.";
|
|
628
|
+
};
|
|
629
|
+
readonly name: {
|
|
630
|
+
readonly type: "string";
|
|
631
|
+
readonly description: "Stash name (stash/get/drop).";
|
|
632
|
+
};
|
|
633
|
+
readonly note: {
|
|
634
|
+
readonly type: "string";
|
|
635
|
+
readonly description: "Stash note (stash).";
|
|
636
|
+
};
|
|
637
|
+
readonly tags: {
|
|
638
|
+
readonly type: "array";
|
|
639
|
+
readonly items: {
|
|
640
|
+
readonly type: "string";
|
|
641
|
+
};
|
|
642
|
+
readonly description: "Tags (stash/filter).";
|
|
643
|
+
};
|
|
644
|
+
readonly before: {
|
|
645
|
+
readonly type: "number";
|
|
646
|
+
};
|
|
647
|
+
readonly after: {
|
|
648
|
+
readonly type: "number";
|
|
649
|
+
};
|
|
650
|
+
readonly max_nodes: {
|
|
651
|
+
readonly type: "number";
|
|
652
|
+
};
|
|
653
|
+
readonly max_tokens: {
|
|
654
|
+
readonly type: "number";
|
|
655
|
+
};
|
|
656
|
+
readonly effort: {
|
|
657
|
+
readonly type: "string";
|
|
658
|
+
readonly enum: readonly ["quick", "normal", "deep", "auto"];
|
|
659
|
+
};
|
|
660
|
+
readonly from: {
|
|
661
|
+
readonly type: "string";
|
|
662
|
+
readonly description: "Stash name as search target.";
|
|
663
|
+
};
|
|
664
|
+
readonly compose: {
|
|
665
|
+
readonly type: "array";
|
|
666
|
+
readonly items: {
|
|
667
|
+
readonly type: "string";
|
|
668
|
+
};
|
|
669
|
+
readonly description: "Stash names as union target.";
|
|
670
|
+
};
|
|
671
|
+
readonly page: {
|
|
672
|
+
readonly type: "number";
|
|
673
|
+
readonly description: "1-indexed page number.";
|
|
674
|
+
};
|
|
675
|
+
readonly page_size: {
|
|
676
|
+
readonly type: "number";
|
|
677
|
+
readonly description: "Items per page.";
|
|
678
|
+
};
|
|
679
|
+
};
|
|
680
|
+
readonly required: readonly ["action"];
|
|
681
|
+
};
|
|
682
|
+
};
|