chat-recall 0.5.7 → 0.5.9
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/README.md +11 -24
- package/dist/cli.js +412 -111
- package/dist/cli.js.map +1 -1
- package/dist/intent-drain.d.ts.map +1 -1
- package/dist/intent-drain.js +68 -2
- package/dist/intent-drain.js.map +1 -1
- package/dist/mcp.js +272 -18
- package/dist/mcp.js.map +1 -1
- package/dist/sync-client.d.ts.map +1 -1
- package/dist/sync-client.js +12 -2
- package/dist/sync-client.js.map +1 -1
- package/dist/watch.js +2501 -2032
- package/package.json +1 -1
- package/skills/chat-recall/SKILL.md +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-drain.d.ts","sourceRoot":"","sources":["../src/intent-drain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA+DH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"intent-drain.d.ts","sourceRoot":"","sources":["../src/intent-drain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA+DH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAoHD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CA6D7F"}
|
package/dist/intent-drain.js
CHANGED
|
@@ -68,6 +68,59 @@ function applyCodeRecommendation(intent) {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
/** Run one intent and return the (status, result-json) to ack with. */
|
|
71
|
+
/**
|
|
72
|
+
* Install what the account holds onto THIS machine, from one server.
|
|
73
|
+
*
|
|
74
|
+
* Fetches the toolkit inventory and hands it to the engine's executor. Only an
|
|
75
|
+
* inventory travels, so what can actually be rebuilt is decided there — see
|
|
76
|
+
* toolkit-pull.ts. A type the server cannot reconstruct is reported, never
|
|
77
|
+
* silently dropped.
|
|
78
|
+
*/
|
|
79
|
+
async function runPull(base, opts) {
|
|
80
|
+
const { executePull } = await import('@chat-recall/engine/core/toolkit-pull.js');
|
|
81
|
+
const { hostname } = await import('node:os');
|
|
82
|
+
const creds = loadAllCredentials().find((c) => c.serverUrl.replace(/\/+$/, '') === base.replace(/\/+$/, ''));
|
|
83
|
+
const headers = creds?.token ? { authorization: `Bearer ${creds.token}` } : {};
|
|
84
|
+
const wanted = opts.types?.length ? opts.types : ['mcp', 'skill', 'command', 'agent', 'instructions'];
|
|
85
|
+
const rows = [];
|
|
86
|
+
for (const type of wanted) {
|
|
87
|
+
try {
|
|
88
|
+
const res = await fetchWithTimeout(`${base}/api/toolkit/browse/${type}?limit=1000`, { headers });
|
|
89
|
+
if (!res.ok)
|
|
90
|
+
continue;
|
|
91
|
+
const body = (await res.json());
|
|
92
|
+
for (const it of body.items || [])
|
|
93
|
+
rows.push(it);
|
|
94
|
+
}
|
|
95
|
+
catch { /* one type failing must not abort the rest */ }
|
|
96
|
+
}
|
|
97
|
+
const filtered = opts.name
|
|
98
|
+
? rows.filter((r) => {
|
|
99
|
+
try {
|
|
100
|
+
return (JSON.parse(r.extra_json || '{}').mcpName || r.title) === opts.name;
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return r.title === opts.name;
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
: rows;
|
|
107
|
+
const report = executePull(filtered, { thisDeviceId: hostname(), types: wanted });
|
|
108
|
+
const written = report.outcomes.filter((o) => o.status === 'written');
|
|
109
|
+
const failed = report.outcomes.filter((o) => o.status === 'failed');
|
|
110
|
+
return {
|
|
111
|
+
// A skip is a reported outcome, not a failure — the artifact genuinely
|
|
112
|
+
// cannot be installed here and the reason travels back with the ack.
|
|
113
|
+
status: failed.length > 0 ? 'error' : 'done',
|
|
114
|
+
result: JSON.stringify({
|
|
115
|
+
installed: written.length,
|
|
116
|
+
present: report.outcomes.filter((o) => o.status === 'present').length,
|
|
117
|
+
skipped: report.outcomes.filter((o) => o.status === 'skipped').map((o) => `${o.name}: ${o.reason}`).slice(0, 20),
|
|
118
|
+
failed: failed.map((o) => `${o.name}: ${o.reason}`).slice(0, 20),
|
|
119
|
+
needsEnv: [...new Set(written.flatMap((o) => o.needsEnv || []))],
|
|
120
|
+
unsupported: report.unsupported,
|
|
121
|
+
}),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
71
124
|
async function runIntent(intent, ctx) {
|
|
72
125
|
try {
|
|
73
126
|
if (intent.kind === 'recheck_session') {
|
|
@@ -85,6 +138,18 @@ async function runIntent(intent, ctx) {
|
|
|
85
138
|
if (intent.kind === 'code_apply') {
|
|
86
139
|
return applyCodeRecommendation(intent);
|
|
87
140
|
}
|
|
141
|
+
if (intent.kind === 'pull') {
|
|
142
|
+
// CROSS-DEVICE. `sync_all` copies between tools on THIS disk; `pull`
|
|
143
|
+
// installs what the account has, sourced from the server — the only
|
|
144
|
+
// kind that can set up a machine that has nothing yet.
|
|
145
|
+
const types = (intent.artifact_type || '')
|
|
146
|
+
.split(',').map((t) => t.trim()).filter(Boolean);
|
|
147
|
+
const r = await runPull(ctx.base, {
|
|
148
|
+
types: types.length ? types : undefined,
|
|
149
|
+
name: intent.name || undefined,
|
|
150
|
+
});
|
|
151
|
+
return r;
|
|
152
|
+
}
|
|
88
153
|
if (intent.kind === 'sync_all') {
|
|
89
154
|
const report = await executeSyncAll();
|
|
90
155
|
const status = report.failed.length > 0 ? 'error' : 'done';
|
|
@@ -155,8 +220,9 @@ export async function drainSyncIntents(opts = {}) {
|
|
|
155
220
|
out.errored++;
|
|
156
221
|
if (opts.verbose) {
|
|
157
222
|
const label = intent.kind === 'sync_all' ? 'sync_all'
|
|
158
|
-
: intent.kind === '
|
|
159
|
-
:
|
|
223
|
+
: intent.kind === 'pull' ? `pull ${intent.artifact_type || 'all'}${intent.name ? ` "${intent.name}"` : ''}`
|
|
224
|
+
: intent.kind === 'recheck_session' ? `recheck ${intent.name}`
|
|
225
|
+
: `${intent.artifact_type} "${intent.name}" ${intent.from_tool}→${intent.to_tool}`;
|
|
160
226
|
console.error(`[sync-intent] ${label}: ${status}`);
|
|
161
227
|
}
|
|
162
228
|
try {
|
package/dist/intent-drain.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-drain.js","sourceRoot":"","sources":["../src/intent-drain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,OAAO,EACL,cAAc,EAAE,WAAW,GAE5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAW7D;mFACmF;AACnF,SAAS,uBAAuB,CAAC,MAAqB;IACpD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAgI,CAAC;QAC5K,IAAI,MAAM,CAAC,aAAa,KAAK,kBAAkB,EAAE,CAAC;YAChD,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;gBAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,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,CAAC,CAAC;YACrD,CAAC;YACD,IAAI,CAAC;gBACH,MAAM,gBAAgB,CAAC,GAAG,IAAI,qBAAqB,MAAM,CAAC,EAAE,MAAM,EAAE;oBAClE,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,WAAW,EAAE;oBAC/D,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;iBACzC,CAAC,CAAC;YACL,CAAC;YAAC,MAAM,CAAC;gBACP,gEAAgE;gBAChE,6DAA6D;YAC/D,CAAC;QACH,CAAC;QAED,yEAAyE;QACzE,uEAAuE;QACvE,IAAI,CAAC;YACH,MAAM,uBAAuB,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9E,CAAC;QAAC,MAAM,CAAC,CAAC,yCAAyC,CAAC,CAAC;IACvD,CAAC;IAED,IAAI,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC;QACtB,IAAI,CAAC;YACH,MAAM,eAAe,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/mcp.js
CHANGED
|
@@ -17390,10 +17390,55 @@ var init_diary_source = __esm({
|
|
|
17390
17390
|
}
|
|
17391
17391
|
});
|
|
17392
17392
|
|
|
17393
|
+
// ../engine/dist/core/redact-inline.js
|
|
17394
|
+
function redactInlineSecrets(value) {
|
|
17395
|
+
let redacted = false;
|
|
17396
|
+
let out = value;
|
|
17397
|
+
out = out.replace(/(\w+:\/\/[^:/@\s]+:)([^@\s]{1,512})(@)/g, (_m, head, _pw, tail) => {
|
|
17398
|
+
redacted = true;
|
|
17399
|
+
return `${head}__SECRET_NOT_SYNCED__${tail}`;
|
|
17400
|
+
});
|
|
17401
|
+
const tokenShapes = [
|
|
17402
|
+
/\bsk-[A-Za-z0-9_-]{16,}\b/g,
|
|
17403
|
+
// OpenAI-style
|
|
17404
|
+
/\bgh[pousr]_[A-Za-z0-9]{16,}\b/g,
|
|
17405
|
+
// GitHub
|
|
17406
|
+
/\bAIza[0-9A-Za-z_-]{20,}\b/g,
|
|
17407
|
+
// Google
|
|
17408
|
+
/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g
|
|
17409
|
+
// Slack
|
|
17410
|
+
];
|
|
17411
|
+
for (const re of tokenShapes) {
|
|
17412
|
+
out = out.replace(re, () => {
|
|
17413
|
+
redacted = true;
|
|
17414
|
+
return "__SECRET_NOT_SYNCED__";
|
|
17415
|
+
});
|
|
17416
|
+
}
|
|
17417
|
+
return { text: out, redacted };
|
|
17418
|
+
}
|
|
17419
|
+
var init_redact_inline = __esm({
|
|
17420
|
+
"../engine/dist/core/redact-inline.js"() {
|
|
17421
|
+
"use strict";
|
|
17422
|
+
}
|
|
17423
|
+
});
|
|
17424
|
+
|
|
17393
17425
|
// ../engine/dist/parsers/skills-source.js
|
|
17394
17426
|
import { existsSync as existsSync36, readdirSync as readdirSync26, readFileSync as readFileSync25, statSync as statSync31 } from "fs";
|
|
17395
17427
|
import { homedir as homedir12 } from "os";
|
|
17396
17428
|
import { join as join35 } from "path";
|
|
17429
|
+
function rebuildBody(content) {
|
|
17430
|
+
const { text, redacted } = redactInlineSecrets(content);
|
|
17431
|
+
const out = {};
|
|
17432
|
+
if (text.length > MAX_BODY_CHARS) {
|
|
17433
|
+
out.body = text.slice(0, MAX_BODY_CHARS);
|
|
17434
|
+
out.bodyTruncated = true;
|
|
17435
|
+
} else {
|
|
17436
|
+
out.body = text;
|
|
17437
|
+
}
|
|
17438
|
+
if (redacted)
|
|
17439
|
+
out.bodySecretsRedacted = true;
|
|
17440
|
+
return out;
|
|
17441
|
+
}
|
|
17397
17442
|
function resolveRoots() {
|
|
17398
17443
|
const home = homedir12();
|
|
17399
17444
|
const all = [];
|
|
@@ -17437,7 +17482,7 @@ function parseFrontmatter3(text) {
|
|
|
17437
17482
|
}
|
|
17438
17483
|
return out;
|
|
17439
17484
|
}
|
|
17440
|
-
var MAX_CHUNK_CHARS12, SkillsSource;
|
|
17485
|
+
var MAX_CHUNK_CHARS12, MAX_BODY_CHARS, SkillsSource;
|
|
17441
17486
|
var init_skills_source = __esm({
|
|
17442
17487
|
"../engine/dist/parsers/skills-source.js"() {
|
|
17443
17488
|
"use strict";
|
|
@@ -17446,7 +17491,9 @@ var init_skills_source = __esm({
|
|
|
17446
17491
|
init_codex2();
|
|
17447
17492
|
init_tool_paths();
|
|
17448
17493
|
init_settings();
|
|
17494
|
+
init_redact_inline();
|
|
17449
17495
|
MAX_CHUNK_CHARS12 = 2e3;
|
|
17496
|
+
MAX_BODY_CHARS = 512 * 1024;
|
|
17450
17497
|
SkillsSource = class {
|
|
17451
17498
|
sourceType = "skill";
|
|
17452
17499
|
async *discover() {
|
|
@@ -17524,7 +17571,10 @@ var init_skills_source = __esm({
|
|
|
17524
17571
|
skillName,
|
|
17525
17572
|
description: fm.description || "",
|
|
17526
17573
|
skillDir,
|
|
17527
|
-
subdirs
|
|
17574
|
+
subdirs,
|
|
17575
|
+
// The whole file, so another machine can rebuild this skill. The
|
|
17576
|
+
// search chunk below stays capped at 2000 chars; this does not.
|
|
17577
|
+
...rebuildBody(content)
|
|
17528
17578
|
};
|
|
17529
17579
|
if (root.readonly || pluginName !== void 0)
|
|
17530
17580
|
extra.readonly = true;
|
|
@@ -17602,18 +17652,27 @@ function reconstructionSpec(cfg) {
|
|
|
17602
17652
|
type: cfg.type || (cfg.url ? "remote" : "local"),
|
|
17603
17653
|
enabled: cfg.enabled !== false
|
|
17604
17654
|
};
|
|
17655
|
+
let hidSecret = false;
|
|
17656
|
+
const clean = (v) => {
|
|
17657
|
+
const r = redactInlineSecrets(v);
|
|
17658
|
+
if (r.redacted)
|
|
17659
|
+
hidSecret = true;
|
|
17660
|
+
return r.text;
|
|
17661
|
+
};
|
|
17605
17662
|
if (typeof cfg.url === "string" && cfg.url)
|
|
17606
|
-
out.url = cfg.url;
|
|
17663
|
+
out.url = clean(cfg.url);
|
|
17607
17664
|
if (Array.isArray(cfg.command))
|
|
17608
|
-
out.command = cfg.command;
|
|
17665
|
+
out.command = cfg.command.map(clean);
|
|
17609
17666
|
else if (typeof cfg.command === "string")
|
|
17610
|
-
out.command = cfg.command;
|
|
17667
|
+
out.command = clean(cfg.command);
|
|
17611
17668
|
if (Array.isArray(cfg.args))
|
|
17612
|
-
out.args = cfg.args;
|
|
17669
|
+
out.args = cfg.args.map((a) => clean(String(a)));
|
|
17613
17670
|
if (Array.isArray(cfg.alwaysAllow))
|
|
17614
17671
|
out.alwaysAllow = cfg.alwaysAllow;
|
|
17615
17672
|
if (cfg.env && typeof cfg.env === "object")
|
|
17616
17673
|
out.envKeys = Object.keys(cfg.env).sort();
|
|
17674
|
+
if (hidSecret)
|
|
17675
|
+
out.secretsRedacted = true;
|
|
17617
17676
|
return out;
|
|
17618
17677
|
}
|
|
17619
17678
|
var McpsSource;
|
|
@@ -17624,6 +17683,7 @@ var init_mcps_source = __esm({
|
|
|
17624
17683
|
init_codex2();
|
|
17625
17684
|
init_settings();
|
|
17626
17685
|
init_tool_paths();
|
|
17686
|
+
init_redact_inline();
|
|
17627
17687
|
McpsSource = class {
|
|
17628
17688
|
sourceType = "mcp";
|
|
17629
17689
|
async *discover() {
|
|
@@ -17696,7 +17756,7 @@ var init_mcps_source = __esm({
|
|
|
17696
17756
|
}
|
|
17697
17757
|
for (const [name, cfgRaw] of Object.entries(obj)) {
|
|
17698
17758
|
const cfg = cfgRaw || {};
|
|
17699
|
-
const cmd = commandPreview(cfg);
|
|
17759
|
+
const cmd = redactInlineSecrets(commandPreview(cfg)).text;
|
|
17700
17760
|
const allow = Array.isArray(cfg.alwaysAllow) ? cfg.alwaysAllow.slice(0, 8) : [];
|
|
17701
17761
|
const spec = reconstructionSpec(cfg);
|
|
17702
17762
|
yield {
|
|
@@ -17885,6 +17945,19 @@ var init_toolkit_format = __esm({
|
|
|
17885
17945
|
// ../engine/dist/parsers/slash-commands-source.js
|
|
17886
17946
|
import { existsSync as existsSync38, readdirSync as readdirSync28, readFileSync as readFileSync27, statSync as statSync33 } from "fs";
|
|
17887
17947
|
import { join as join37, basename as basename20 } from "path";
|
|
17948
|
+
function rebuildBody2(content) {
|
|
17949
|
+
const { text, redacted } = redactInlineSecrets(content);
|
|
17950
|
+
const out = {};
|
|
17951
|
+
if (text.length > MAX_BODY_CHARS2) {
|
|
17952
|
+
out.body = text.slice(0, MAX_BODY_CHARS2);
|
|
17953
|
+
out.bodyTruncated = true;
|
|
17954
|
+
} else {
|
|
17955
|
+
out.body = text;
|
|
17956
|
+
}
|
|
17957
|
+
if (redacted)
|
|
17958
|
+
out.bodySecretsRedacted = true;
|
|
17959
|
+
return out;
|
|
17960
|
+
}
|
|
17888
17961
|
function parseCommand(content, fallbackName, format) {
|
|
17889
17962
|
if (format === "toml") {
|
|
17890
17963
|
const t = parseScalarToml(content);
|
|
@@ -17901,7 +17974,7 @@ function parseCommand(content, fallbackName, format) {
|
|
|
17901
17974
|
body: body.trim()
|
|
17902
17975
|
};
|
|
17903
17976
|
}
|
|
17904
|
-
var MAX_CHUNK_CHARS13, SlashCommandsSource;
|
|
17977
|
+
var MAX_CHUNK_CHARS13, MAX_BODY_CHARS2, SlashCommandsSource;
|
|
17905
17978
|
var init_slash_commands_source = __esm({
|
|
17906
17979
|
"../engine/dist/parsers/slash-commands-source.js"() {
|
|
17907
17980
|
"use strict";
|
|
@@ -17913,7 +17986,9 @@ var init_slash_commands_source = __esm({
|
|
|
17913
17986
|
init_tool_paths();
|
|
17914
17987
|
init_toolkit_format();
|
|
17915
17988
|
init_project_dir_name();
|
|
17989
|
+
init_redact_inline();
|
|
17916
17990
|
MAX_CHUNK_CHARS13 = 2e3;
|
|
17991
|
+
MAX_BODY_CHARS2 = 512 * 1024;
|
|
17917
17992
|
SlashCommandsSource = class {
|
|
17918
17993
|
sourceType = "command";
|
|
17919
17994
|
roots() {
|
|
@@ -17977,7 +18052,10 @@ var init_slash_commands_source = __esm({
|
|
|
17977
18052
|
commandName: parsed.name,
|
|
17978
18053
|
description: parsed.description,
|
|
17979
18054
|
scope: root.scope,
|
|
17980
|
-
format: root.format
|
|
18055
|
+
format: root.format,
|
|
18056
|
+
// The whole file, so another machine can rebuild it. The search
|
|
18057
|
+
// chunk stays capped at 2000 chars; this does not.
|
|
18058
|
+
...rebuildBody2(content)
|
|
17981
18059
|
}
|
|
17982
18060
|
};
|
|
17983
18061
|
} catch {
|
|
@@ -18013,6 +18091,19 @@ var init_slash_commands_source = __esm({
|
|
|
18013
18091
|
// ../engine/dist/parsers/subagents-source.js
|
|
18014
18092
|
import { existsSync as existsSync39, readdirSync as readdirSync29, readFileSync as readFileSync28, statSync as statSync34 } from "fs";
|
|
18015
18093
|
import { join as join38, basename as basename21 } from "path";
|
|
18094
|
+
function rebuildBody3(content) {
|
|
18095
|
+
const { text, redacted } = redactInlineSecrets(content);
|
|
18096
|
+
const out = {};
|
|
18097
|
+
if (text.length > MAX_BODY_CHARS3) {
|
|
18098
|
+
out.body = text.slice(0, MAX_BODY_CHARS3);
|
|
18099
|
+
out.bodyTruncated = true;
|
|
18100
|
+
} else {
|
|
18101
|
+
out.body = text;
|
|
18102
|
+
}
|
|
18103
|
+
if (redacted)
|
|
18104
|
+
out.bodySecretsRedacted = true;
|
|
18105
|
+
return out;
|
|
18106
|
+
}
|
|
18016
18107
|
function parseAgent(content, fallbackName, format) {
|
|
18017
18108
|
if (format === "toml") {
|
|
18018
18109
|
const t = parseScalarToml(content);
|
|
@@ -18031,7 +18122,7 @@ function parseAgent(content, fallbackName, format) {
|
|
|
18031
18122
|
body: body.trim()
|
|
18032
18123
|
};
|
|
18033
18124
|
}
|
|
18034
|
-
var MAX_CHUNK_CHARS14, SubagentsSource;
|
|
18125
|
+
var MAX_CHUNK_CHARS14, MAX_BODY_CHARS3, SubagentsSource;
|
|
18035
18126
|
var init_subagents_source = __esm({
|
|
18036
18127
|
"../engine/dist/parsers/subagents-source.js"() {
|
|
18037
18128
|
"use strict";
|
|
@@ -18043,7 +18134,9 @@ var init_subagents_source = __esm({
|
|
|
18043
18134
|
init_tool_paths();
|
|
18044
18135
|
init_toolkit_format();
|
|
18045
18136
|
init_project_dir_name();
|
|
18137
|
+
init_redact_inline();
|
|
18046
18138
|
MAX_CHUNK_CHARS14 = 2e3;
|
|
18139
|
+
MAX_BODY_CHARS3 = 512 * 1024;
|
|
18047
18140
|
SubagentsSource = class {
|
|
18048
18141
|
sourceType = "agent";
|
|
18049
18142
|
roots() {
|
|
@@ -18108,7 +18201,10 @@ var init_subagents_source = __esm({
|
|
|
18108
18201
|
description: parsed.description,
|
|
18109
18202
|
tools: parsed.tools,
|
|
18110
18203
|
scope: root.scope,
|
|
18111
|
-
format: root.format
|
|
18204
|
+
format: root.format,
|
|
18205
|
+
// The whole file, so another machine can rebuild it. The search
|
|
18206
|
+
// chunk stays capped at 2000 chars; this does not.
|
|
18207
|
+
...rebuildBody3(content)
|
|
18112
18208
|
}
|
|
18113
18209
|
};
|
|
18114
18210
|
} catch {
|
|
@@ -18497,6 +18593,9 @@ var init_all_sources = __esm({
|
|
|
18497
18593
|
});
|
|
18498
18594
|
|
|
18499
18595
|
// ../engine/dist/core/extractor-version.js
|
|
18596
|
+
function extractorVersionForItem(id, sourceType) {
|
|
18597
|
+
return extractorVersionForTool(toolOfId(id)) + (ITEM_SOURCE_BUMP[sourceType] ?? 0);
|
|
18598
|
+
}
|
|
18500
18599
|
function toolOfId(id) {
|
|
18501
18600
|
if (id.startsWith("agy_"))
|
|
18502
18601
|
return "agy";
|
|
@@ -18516,11 +18615,17 @@ function extractorVersionForTool(tool) {
|
|
|
18516
18615
|
function extractorVersionForId(id) {
|
|
18517
18616
|
return extractorVersionForTool(toolOfId(id));
|
|
18518
18617
|
}
|
|
18519
|
-
var BASE_EXTRACTOR_VERSION, TOOL_EXTRACTOR_BUMP, EXTRACTOR_VERSION;
|
|
18618
|
+
var BASE_EXTRACTOR_VERSION, ITEM_SOURCE_BUMP, TOOL_EXTRACTOR_BUMP, EXTRACTOR_VERSION;
|
|
18520
18619
|
var init_extractor_version = __esm({
|
|
18521
18620
|
"../engine/dist/core/extractor-version.js"() {
|
|
18522
18621
|
"use strict";
|
|
18523
18622
|
BASE_EXTRACTOR_VERSION = 2;
|
|
18623
|
+
ITEM_SOURCE_BUMP = {
|
|
18624
|
+
mcp: 1,
|
|
18625
|
+
skill: 1,
|
|
18626
|
+
agent: 1,
|
|
18627
|
+
command: 1
|
|
18628
|
+
};
|
|
18524
18629
|
TOOL_EXTRACTOR_BUMP = {
|
|
18525
18630
|
agy: 2,
|
|
18526
18631
|
claude: 1,
|
|
@@ -18901,7 +19006,7 @@ var init_http = __esm({
|
|
|
18901
19006
|
CLI_VERSION = JSON.parse(readFileSync33(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
|
|
18902
19007
|
} catch {
|
|
18903
19008
|
try {
|
|
18904
|
-
if (true) CLI_VERSION = "0.5.
|
|
19009
|
+
if (true) CLI_VERSION = "0.5.9";
|
|
18905
19010
|
} catch {
|
|
18906
19011
|
}
|
|
18907
19012
|
}
|
|
@@ -19413,7 +19518,7 @@ var init_telemetry = __esm({
|
|
|
19413
19518
|
init_sync_client();
|
|
19414
19519
|
cliVersion2 = () => {
|
|
19415
19520
|
try {
|
|
19416
|
-
return true ? "0.5.
|
|
19521
|
+
return true ? "0.5.9" : "dev";
|
|
19417
19522
|
} catch {
|
|
19418
19523
|
return "dev";
|
|
19419
19524
|
}
|
|
@@ -20577,6 +20682,7 @@ async function syncToTargetInScope(cred, opts = {}) {
|
|
|
20577
20682
|
}
|
|
20578
20683
|
const itemVersions = loadItemVersions(base);
|
|
20579
20684
|
const seenTools = /* @__PURE__ */ new Set();
|
|
20685
|
+
const seenItemKeys = /* @__PURE__ */ new Map();
|
|
20580
20686
|
const registry = buildSourceRegistry();
|
|
20581
20687
|
for (const sourceType of registry.getRegisteredTypes()) {
|
|
20582
20688
|
if (sourceType === "session") continue;
|
|
@@ -20591,7 +20697,9 @@ async function syncToTargetInScope(cred, opts = {}) {
|
|
|
20591
20697
|
for await (const item of discovered) {
|
|
20592
20698
|
const itemTool = toolOfId(item.id);
|
|
20593
20699
|
seenTools.add(itemTool);
|
|
20594
|
-
const
|
|
20700
|
+
const itemKey = `${itemTool}:${item.sourceType}`;
|
|
20701
|
+
seenItemKeys.set(itemKey, extractorVersionForItem(item.id, item.sourceType));
|
|
20702
|
+
const versionStale = (itemVersions[itemKey] ?? EXTRACTOR_VERSION) < extractorVersionForItem(item.id, item.sourceType);
|
|
20595
20703
|
if ((item.mtime || 0) < (opts.sinceMs ?? 0) && !versionStale) continue;
|
|
20596
20704
|
if (excluded(item.projectPath || "")) continue;
|
|
20597
20705
|
if (!includedProject(item.projectPath || "")) continue;
|
|
@@ -20674,6 +20782,7 @@ async function syncToTargetInScope(cred, opts = {}) {
|
|
|
20674
20782
|
try {
|
|
20675
20783
|
const rec = {};
|
|
20676
20784
|
for (const t of seenTools) rec[t] = extractorVersionForTool(t);
|
|
20785
|
+
for (const [k, v] of seenItemKeys) rec[k] = v;
|
|
20677
20786
|
saveItemVersions(base, rec);
|
|
20678
20787
|
} catch {
|
|
20679
20788
|
}
|
|
@@ -21113,7 +21222,7 @@ var init_sync_client = __esm({
|
|
|
21113
21222
|
ownVersion = JSON.parse(readFileSync35(join45(dir, "../package.json"), "utf-8")).version || ownVersion;
|
|
21114
21223
|
} catch {
|
|
21115
21224
|
try {
|
|
21116
|
-
if (true) ownVersion = "0.5.
|
|
21225
|
+
if (true) ownVersion = "0.5.9";
|
|
21117
21226
|
} catch {
|
|
21118
21227
|
}
|
|
21119
21228
|
}
|
|
@@ -23503,7 +23612,7 @@ var RecallMemorySearchSchema = z.object({
|
|
|
23503
23612
|
top_k: z.number().optional().default(10).describe("Number of results"),
|
|
23504
23613
|
source_types: z.array(z.enum(["session", "plan", "task", "claude_md", "paste", "history", "diary"])).optional().describe("Filter by source types (default: all)"),
|
|
23505
23614
|
project_filter: z.string().optional().describe("Filter by project path"),
|
|
23506
|
-
semantic: z.boolean().optional().default(false).describe("
|
|
23615
|
+
semantic: z.boolean().optional().default(false).describe("Reserved and currently ignored: the semantic tier is switched off server-side, so every search runs keyword FTS.")
|
|
23507
23616
|
});
|
|
23508
23617
|
var RecallSmartResumeSchema = z.object({
|
|
23509
23618
|
session_id: z.string().describe("Session ID to get smart resume context for")
|
|
@@ -23705,6 +23814,16 @@ var RecallSecurityDismissSchema = z.object({
|
|
|
23705
23814
|
status: z.enum(["rotated", "false_positive", "dismissed", "undismissed"]).describe("Why this finding is no longer actionable \u2014 or `undismissed` to put it BACK on the action-required list (the inverse this tool was missing)."),
|
|
23706
23815
|
reason: z.string().optional().describe("Optional note")
|
|
23707
23816
|
});
|
|
23817
|
+
var TOOLKIT_TYPES = ["mcp", "skill", "command", "agent", "instructions"];
|
|
23818
|
+
var RecallToolkitStatusSchema = z.object({
|
|
23819
|
+
type: z.enum(TOOLKIT_TYPES).optional().describe("Restrict to one artifact type. Omit for every type.")
|
|
23820
|
+
});
|
|
23821
|
+
var RecallToolkitSyncSchema = z.object({
|
|
23822
|
+
types: z.array(z.enum(TOOLKIT_TYPES)).optional().describe("Which artifact types to install. Omit for all of them."),
|
|
23823
|
+
name: z.string().optional().describe("Install ONE named artifact. Requires exactly one entry in `types`."),
|
|
23824
|
+
device: z.string().optional().describe("Hostname of the machine to install on. Omit to target EVERY device on the account."),
|
|
23825
|
+
scope: z.enum(["pull", "fan_out"]).optional().default("pull").describe("pull = install what the account has onto the device(s), from the server (cross-device). fan_out = copy what a device already has between its own tools (single-machine).")
|
|
23826
|
+
});
|
|
23708
23827
|
var RecallSecurityRulesSchema = z.object({
|
|
23709
23828
|
action: z.enum(["list", "test"]).optional().default("list").describe("list = return tenant rules; test = try a regex against sample text (does not persist)"),
|
|
23710
23829
|
name: z.string().optional().describe("For test: rule name"),
|
|
@@ -24087,7 +24206,7 @@ with recall_show (pass the plan id).`,
|
|
|
24087
24206
|
project_filter: { type: "string", description: "Filter by project path" },
|
|
24088
24207
|
provider: { type: "string", enum: ["ollama", "gemini"], default: "ollama" },
|
|
24089
24208
|
scope: { type: "string", enum: ["local", "server"], default: "local", description: "server = synced cross-device history (needs chat-recall login)." },
|
|
24090
|
-
semantic: { type: "boolean", default: false, description: "
|
|
24209
|
+
semantic: { type: "boolean", default: false, description: "Reserved and currently ignored: the semantic tier is switched off server-side, so every search runs keyword FTS." }
|
|
24091
24210
|
},
|
|
24092
24211
|
required: ["query"]
|
|
24093
24212
|
}
|
|
@@ -24627,6 +24746,59 @@ secret. The dismissal syncs across devices.`,
|
|
|
24627
24746
|
required: ["preview", "status"]
|
|
24628
24747
|
}
|
|
24629
24748
|
},
|
|
24749
|
+
{
|
|
24750
|
+
name: "recall_toolkit_status",
|
|
24751
|
+
description: `Which MCP servers, skills, commands and agents exist, on which AI tool, on which device.
|
|
24752
|
+
|
|
24753
|
+
Use it before recall_toolkit_sync to see what is missing where, and after, to
|
|
24754
|
+
confirm what landed. Counts are per (type, tool) and rows name the device that
|
|
24755
|
+
uploaded them, so you can tell "my laptop has it" from "my desktop has it".
|
|
24756
|
+
|
|
24757
|
+
NOTE: the server holds an INVENTORY. MCP registrations carry enough to rebuild
|
|
24758
|
+
elsewhere; skills and agents do not (their file content is not uploaded), and
|
|
24759
|
+
this tool says which is which.`,
|
|
24760
|
+
inputSchema: {
|
|
24761
|
+
type: "object",
|
|
24762
|
+
properties: {
|
|
24763
|
+
type: { type: "string", enum: [...TOOLKIT_TYPES], description: "Restrict to one artifact type. Omit for every type." }
|
|
24764
|
+
}
|
|
24765
|
+
}
|
|
24766
|
+
},
|
|
24767
|
+
{
|
|
24768
|
+
name: "recall_toolkit_sync",
|
|
24769
|
+
description: `Install the account's MCP servers / skills / agents onto a device, or fan a device's own artifacts out across its tools.
|
|
24770
|
+
|
|
24771
|
+
TWO DIFFERENT OPERATIONS \u2014 pick with \`scope\`:
|
|
24772
|
+
|
|
24773
|
+
scope: 'pull' Install what the ACCOUNT has onto the target device, sourced
|
|
24774
|
+
from the server. This is the cross-device one: it is what
|
|
24775
|
+
sets up a new laptop. Omit \`device\` to target every device.
|
|
24776
|
+
|
|
24777
|
+
scope: 'fan_out' Copy what ONE device already has between that device's own
|
|
24778
|
+
tools (claude \u2192 codex \u2192 cursor \u2026). Single machine only; it
|
|
24779
|
+
reads that machine's disk.
|
|
24780
|
+
|
|
24781
|
+
Examples:
|
|
24782
|
+
everything, everywhere { }
|
|
24783
|
+
every MCP, everywhere { types: ['mcp'] }
|
|
24784
|
+
every MCP on one machine { types: ['mcp'], device: 'my-laptop' }
|
|
24785
|
+
one artifact { types: ['mcp'], name: 'acme-mcp' }
|
|
24786
|
+
fan a machine's own set out { scope: 'fan_out', device: 'my-laptop' }
|
|
24787
|
+
|
|
24788
|
+
The work is QUEUED, not done inline: the target device performs it on its next
|
|
24789
|
+
drain (the watch daemon polls, or run \`chat-recall toolkit drain\`). Only that
|
|
24790
|
+
device can write its own config files, so nothing else could do it. Read the
|
|
24791
|
+
outcome back with recall_toolkit_status.`,
|
|
24792
|
+
inputSchema: {
|
|
24793
|
+
type: "object",
|
|
24794
|
+
properties: {
|
|
24795
|
+
types: { type: "array", items: { type: "string", enum: [...TOOLKIT_TYPES] }, description: "Artifact types to install. Omit for all." },
|
|
24796
|
+
name: { type: "string", description: "Install ONE named artifact. Requires exactly one entry in types." },
|
|
24797
|
+
device: { type: "string", description: "Hostname of the target machine. Omit to target every device on the account." },
|
|
24798
|
+
scope: { type: "string", enum: ["pull", "fan_out"], default: "pull", description: "pull = install from the server (cross-device). fan_out = copy between one machine's own tools." }
|
|
24799
|
+
}
|
|
24800
|
+
}
|
|
24801
|
+
},
|
|
24630
24802
|
{
|
|
24631
24803
|
name: "recall_security_rules",
|
|
24632
24804
|
description: `List tenant custom secret-detection rules, or test a regex in the sandbox.
|
|
@@ -26581,6 +26753,88 @@ ${row.value}`
|
|
|
26581
26753
|
});
|
|
26582
26754
|
return { content: [{ type: "text", text: `Dismissed \`${params.preview}\` as ${params.status}.` }] };
|
|
26583
26755
|
}
|
|
26756
|
+
case "recall_toolkit_status": {
|
|
26757
|
+
const params = RecallToolkitStatusSchema.parse(args);
|
|
26758
|
+
requireRemote();
|
|
26759
|
+
const types = params.type ? [params.type] : [...TOOLKIT_TYPES];
|
|
26760
|
+
const REBUILDABLE = {
|
|
26761
|
+
mcp: "yes \u2014 a registration is config, and the whole entry is stored",
|
|
26762
|
+
skill: "yes \u2014 the full file is stored, so it can be written on any machine",
|
|
26763
|
+
agent: "yes \u2014 the body is converted to each tool's own encoding (markdown or TOML)",
|
|
26764
|
+
command: "yes \u2014 same as agents, converted per tool",
|
|
26765
|
+
instructions: "no, deliberately \u2014 a CLAUDE.md belongs to a repo, not to a machine"
|
|
26766
|
+
};
|
|
26767
|
+
const lines = ["# Toolkit inventory", ""];
|
|
26768
|
+
for (const type of types) {
|
|
26769
|
+
let items = [];
|
|
26770
|
+
try {
|
|
26771
|
+
const r = await remoteGetQS(`/api/toolkit/browse/${type}`, { limit: 1e3 });
|
|
26772
|
+
items = r.items || [];
|
|
26773
|
+
} catch (err) {
|
|
26774
|
+
lines.push(`## ${type}`, `_could not read: ${err instanceof Error ? err.message : err}_`, "");
|
|
26775
|
+
continue;
|
|
26776
|
+
}
|
|
26777
|
+
const byTool = /* @__PURE__ */ new Map();
|
|
26778
|
+
const byDevice = /* @__PURE__ */ new Map();
|
|
26779
|
+
let rebuildable = 0;
|
|
26780
|
+
for (const it of items) {
|
|
26781
|
+
let e = {};
|
|
26782
|
+
try {
|
|
26783
|
+
e = JSON.parse(it.extra_json || "{}");
|
|
26784
|
+
} catch {
|
|
26785
|
+
}
|
|
26786
|
+
byTool.set(String(e.tool || "?"), (byTool.get(String(e.tool || "?")) || 0) + 1);
|
|
26787
|
+
byDevice.set(String(e.syncedDeviceId || "?"), (byDevice.get(String(e.syncedDeviceId || "?")) || 0) + 1);
|
|
26788
|
+
if (type === "mcp" && e.spec) rebuildable++;
|
|
26789
|
+
if ((type === "skill" || type === "agent" || type === "command") && typeof e.body === "string" && e.body) rebuildable++;
|
|
26790
|
+
}
|
|
26791
|
+
lines.push(`## ${type} \u2014 ${items.length}`);
|
|
26792
|
+
if (byTool.size) lines.push(`- by tool: ${[...byTool].map(([k, v]) => `${k} ${v}`).join(" \xB7 ")}`);
|
|
26793
|
+
if (byDevice.size) lines.push(`- by device: ${[...byDevice].map(([k, v]) => `${k} ${v}`).join(" \xB7 ")}`);
|
|
26794
|
+
lines.push(`- installable on another device: ${REBUILDABLE[type]}`);
|
|
26795
|
+
if (type === "skill" || type === "agent" || type === "command") {
|
|
26796
|
+
lines.push(`- carrying a full body: ${rebuildable}/${items.length}` + (rebuildable < items.length ? " \u2014 the rest need a re-index on their source device" : ""));
|
|
26797
|
+
}
|
|
26798
|
+
if (type === "mcp") {
|
|
26799
|
+
lines.push(`- carrying a rebuild spec: ${rebuildable}/${items.length}` + (rebuildable < items.length ? " \u2014 the rest need a re-index on their source device" : ""));
|
|
26800
|
+
}
|
|
26801
|
+
lines.push("");
|
|
26802
|
+
}
|
|
26803
|
+
lines.push("Queue an install with `recall_toolkit_sync`.");
|
|
26804
|
+
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
26805
|
+
}
|
|
26806
|
+
case "recall_toolkit_sync": {
|
|
26807
|
+
const params = RecallToolkitSyncSchema.parse(args);
|
|
26808
|
+
requireRemote();
|
|
26809
|
+
if (params.name && (params.types?.length ?? 0) !== 1) {
|
|
26810
|
+
return { content: [{ type: "text", text: "A `name` needs exactly one entry in `types`, so the artifact is unambiguous." }] };
|
|
26811
|
+
}
|
|
26812
|
+
if (params.scope === "fan_out" && !params.device) {
|
|
26813
|
+
return { content: [{ type: "text", text: "`fan_out` copies between ONE machine's own tools \u2014 name the machine with `device`." }] };
|
|
26814
|
+
}
|
|
26815
|
+
const body = params.scope === "fan_out" ? { kind: "sync_all", deviceId: params.device } : { kind: "pull", types: params.types, name: params.name, deviceId: params.device ?? null };
|
|
26816
|
+
const r = await remotePost("/api/sync-intents", body);
|
|
26817
|
+
if (!r.id) return { content: [{ type: "text", text: `Queue refused it: ${r.error || "unknown error"}` }] };
|
|
26818
|
+
const what = params.name ? `"${params.name}"` : params.types?.length ? params.types.join(", ") : "every artifact type";
|
|
26819
|
+
const where = params.device ? `on ${params.device}` : "on every device on this account";
|
|
26820
|
+
return {
|
|
26821
|
+
content: [{
|
|
26822
|
+
type: "text",
|
|
26823
|
+
text: [
|
|
26824
|
+
`Queued: ${params.scope === "fan_out" ? "fan out" : "install"} ${what} ${where}.`,
|
|
26825
|
+
`Intent id: ${r.id}`,
|
|
26826
|
+
"",
|
|
26827
|
+
// The queue accepting is NOT the work happening. Saying so stops
|
|
26828
|
+
// an agent reporting success for something that has not run.
|
|
26829
|
+
"QUEUED, NOT DONE. Only the target device can write its own config",
|
|
26830
|
+
"files, so it performs this on its next drain \u2014 the watch daemon polls,",
|
|
26831
|
+
"or run `chat-recall toolkit drain` there to do it now.",
|
|
26832
|
+
"",
|
|
26833
|
+
"Check the result with `recall_toolkit_status`."
|
|
26834
|
+
].join("\n")
|
|
26835
|
+
}]
|
|
26836
|
+
};
|
|
26837
|
+
}
|
|
26584
26838
|
case "recall_security_rules": {
|
|
26585
26839
|
const params = RecallSecurityRulesSchema.parse(args);
|
|
26586
26840
|
requireRemote();
|