@burtson-labs/agent-core 1.6.13
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/LICENSE +201 -0
- package/README.md +88 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/activation.d.ts +60 -0
- package/dist/mcp/activation.d.ts.map +1 -0
- package/dist/mcp/activation.js +139 -0
- package/dist/mcp/activation.js.map +1 -0
- package/dist/mcp/clientPool.d.ts +202 -0
- package/dist/mcp/clientPool.d.ts.map +1 -0
- package/dist/mcp/clientPool.js +469 -0
- package/dist/mcp/clientPool.js.map +1 -0
- package/dist/mcp/index.d.ts +18 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +28 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +43 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +130 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/toolAdapter.d.ts +57 -0
- package/dist/mcp/toolAdapter.d.ts.map +1 -0
- package/dist/mcp/toolAdapter.js +223 -0
- package/dist/mcp/toolAdapter.js.map +1 -0
- package/dist/mcp/types.d.ts +122 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +15 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/providers/deterministic-provider.d.ts +21 -0
- package/dist/providers/deterministic-provider.d.ts.map +1 -0
- package/dist/providers/deterministic-provider.js +80 -0
- package/dist/providers/deterministic-provider.js.map +1 -0
- package/dist/providers/provider-client.d.ts +12 -0
- package/dist/providers/provider-client.d.ts.map +1 -0
- package/dist/providers/provider-client.js +11 -0
- package/dist/providers/provider-client.js.map +1 -0
- package/dist/runtime/AgentRuntime.d.ts +67 -0
- package/dist/runtime/AgentRuntime.d.ts.map +1 -0
- package/dist/runtime/AgentRuntime.js +382 -0
- package/dist/runtime/AgentRuntime.js.map +1 -0
- package/dist/security/secretPatterns.d.ts +76 -0
- package/dist/security/secretPatterns.d.ts.map +1 -0
- package/dist/security/secretPatterns.js +290 -0
- package/dist/security/secretPatterns.js.map +1 -0
- package/dist/tools/ask-user-tool.d.ts +19 -0
- package/dist/tools/ask-user-tool.d.ts.map +1 -0
- package/dist/tools/ask-user-tool.js +148 -0
- package/dist/tools/ask-user-tool.js.map +1 -0
- package/dist/tools/compactMessages.d.ts +52 -0
- package/dist/tools/compactMessages.d.ts.map +1 -0
- package/dist/tools/compactMessages.js +158 -0
- package/dist/tools/compactMessages.js.map +1 -0
- package/dist/tools/core-tools.d.ts +29 -0
- package/dist/tools/core-tools.d.ts.map +1 -0
- package/dist/tools/core-tools.js +2214 -0
- package/dist/tools/core-tools.js.map +1 -0
- package/dist/tools/git-tools.d.ts +32 -0
- package/dist/tools/git-tools.d.ts.map +1 -0
- package/dist/tools/git-tools.js +330 -0
- package/dist/tools/git-tools.js.map +1 -0
- package/dist/tools/index.d.ts +15 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +31 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/language-adapters.d.ts +48 -0
- package/dist/tools/language-adapters.d.ts.map +1 -0
- package/dist/tools/language-adapters.js +299 -0
- package/dist/tools/language-adapters.js.map +1 -0
- package/dist/tools/loop/compactionTrigger.d.ts +47 -0
- package/dist/tools/loop/compactionTrigger.d.ts.map +1 -0
- package/dist/tools/loop/compactionTrigger.js +32 -0
- package/dist/tools/loop/compactionTrigger.js.map +1 -0
- package/dist/tools/loop/finalAnswerNudges.d.ts +68 -0
- package/dist/tools/loop/finalAnswerNudges.d.ts.map +1 -0
- package/dist/tools/loop/finalAnswerNudges.js +87 -0
- package/dist/tools/loop/finalAnswerNudges.js.map +1 -0
- package/dist/tools/loop/goalAnchor.d.ts +72 -0
- package/dist/tools/loop/goalAnchor.d.ts.map +1 -0
- package/dist/tools/loop/goalAnchor.js +76 -0
- package/dist/tools/loop/goalAnchor.js.map +1 -0
- package/dist/tools/loop/llmStream.d.ts +70 -0
- package/dist/tools/loop/llmStream.d.ts.map +1 -0
- package/dist/tools/loop/llmStream.js +181 -0
- package/dist/tools/loop/llmStream.js.map +1 -0
- package/dist/tools/loop/parallelExecute.d.ts +57 -0
- package/dist/tools/loop/parallelExecute.d.ts.map +1 -0
- package/dist/tools/loop/parallelExecute.js +54 -0
- package/dist/tools/loop/parallelExecute.js.map +1 -0
- package/dist/tools/loop/singleToolExecute.d.ts +71 -0
- package/dist/tools/loop/singleToolExecute.d.ts.map +1 -0
- package/dist/tools/loop/singleToolExecute.js +139 -0
- package/dist/tools/loop/singleToolExecute.js.map +1 -0
- package/dist/tools/loop/toolCallNormalize.d.ts +57 -0
- package/dist/tools/loop/toolCallNormalize.d.ts.map +1 -0
- package/dist/tools/loop/toolCallNormalize.js +99 -0
- package/dist/tools/loop/toolCallNormalize.js.map +1 -0
- package/dist/tools/loop/turnSetup.d.ts +43 -0
- package/dist/tools/loop/turnSetup.d.ts.map +1 -0
- package/dist/tools/loop/turnSetup.js +48 -0
- package/dist/tools/loop/turnSetup.js.map +1 -0
- package/dist/tools/ocr.d.ts +52 -0
- package/dist/tools/ocr.d.ts.map +1 -0
- package/dist/tools/ocr.js +238 -0
- package/dist/tools/ocr.js.map +1 -0
- package/dist/tools/post-edit-checks.d.ts +46 -0
- package/dist/tools/post-edit-checks.d.ts.map +1 -0
- package/dist/tools/post-edit-checks.js +236 -0
- package/dist/tools/post-edit-checks.js.map +1 -0
- package/dist/tools/skill-loader.d.ts +94 -0
- package/dist/tools/skill-loader.d.ts.map +1 -0
- package/dist/tools/skill-loader.js +422 -0
- package/dist/tools/skill-loader.js.map +1 -0
- package/dist/tools/skill-registry.d.ts +44 -0
- package/dist/tools/skill-registry.d.ts.map +1 -0
- package/dist/tools/skill-registry.js +118 -0
- package/dist/tools/skill-registry.js.map +1 -0
- package/dist/tools/skill-types.d.ts +38 -0
- package/dist/tools/skill-types.d.ts.map +1 -0
- package/dist/tools/skill-types.js +10 -0
- package/dist/tools/skill-types.js.map +1 -0
- package/dist/tools/skills/code-review-skill.d.ts +9 -0
- package/dist/tools/skills/code-review-skill.d.ts.map +1 -0
- package/dist/tools/skills/code-review-skill.js +66 -0
- package/dist/tools/skills/code-review-skill.js.map +1 -0
- package/dist/tools/skills/core-skill.d.ts +13 -0
- package/dist/tools/skills/core-skill.d.ts.map +1 -0
- package/dist/tools/skills/core-skill.js +23 -0
- package/dist/tools/skills/core-skill.js.map +1 -0
- package/dist/tools/skills/git-skill.d.ts +10 -0
- package/dist/tools/skills/git-skill.d.ts.map +1 -0
- package/dist/tools/skills/git-skill.js +30 -0
- package/dist/tools/skills/git-skill.js.map +1 -0
- package/dist/tools/skills/index.d.ts +17 -0
- package/dist/tools/skills/index.d.ts.map +1 -0
- package/dist/tools/skills/index.js +49 -0
- package/dist/tools/skills/index.js.map +1 -0
- package/dist/tools/skills/interaction-skill.d.ts +14 -0
- package/dist/tools/skills/interaction-skill.d.ts.map +1 -0
- package/dist/tools/skills/interaction-skill.js +24 -0
- package/dist/tools/skills/interaction-skill.js.map +1 -0
- package/dist/tools/skills/mail-search-skill.d.ts +25 -0
- package/dist/tools/skills/mail-search-skill.d.ts.map +1 -0
- package/dist/tools/skills/mail-search-skill.js +343 -0
- package/dist/tools/skills/mail-search-skill.js.map +1 -0
- package/dist/tools/skills/plan-skill.d.ts +10 -0
- package/dist/tools/skills/plan-skill.d.ts.map +1 -0
- package/dist/tools/skills/plan-skill.js +126 -0
- package/dist/tools/skills/plan-skill.js.map +1 -0
- package/dist/tools/skills/semantic-search-skill.d.ts +22 -0
- package/dist/tools/skills/semantic-search-skill.d.ts.map +1 -0
- package/dist/tools/skills/semantic-search-skill.js +244 -0
- package/dist/tools/skills/semantic-search-skill.js.map +1 -0
- package/dist/tools/skills/test-gen-skill.d.ts +9 -0
- package/dist/tools/skills/test-gen-skill.d.ts.map +1 -0
- package/dist/tools/skills/test-gen-skill.js +123 -0
- package/dist/tools/skills/test-gen-skill.js.map +1 -0
- package/dist/tools/tool-registry.d.ts +60 -0
- package/dist/tools/tool-registry.d.ts.map +1 -0
- package/dist/tools/tool-registry.js +200 -0
- package/dist/tools/tool-registry.js.map +1 -0
- package/dist/tools/tool-types.d.ts +281 -0
- package/dist/tools/tool-types.d.ts.map +1 -0
- package/dist/tools/tool-types.js +10 -0
- package/dist/tools/tool-types.js.map +1 -0
- package/dist/tools/tool-use-loop.d.ts +231 -0
- package/dist/tools/tool-use-loop.d.ts.map +1 -0
- package/dist/tools/tool-use-loop.js +2057 -0
- package/dist/tools/tool-use-loop.js.map +1 -0
- package/dist/tools/tool-use-parser.d.ts +78 -0
- package/dist/tools/tool-use-parser.d.ts.map +1 -0
- package/dist/tools/tool-use-parser.js +427 -0
- package/dist/tools/tool-use-parser.js.map +1 -0
- package/dist/tools/toolAvailabilityDetector.d.ts +48 -0
- package/dist/tools/toolAvailabilityDetector.d.ts.map +1 -0
- package/dist/tools/toolAvailabilityDetector.js +156 -0
- package/dist/tools/toolAvailabilityDetector.js.map +1 -0
- package/dist/tools/unified-patch.d.ts +87 -0
- package/dist/tools/unified-patch.d.ts.map +1 -0
- package/dist/tools/unified-patch.js +217 -0
- package/dist/tools/unified-patch.js.map +1 -0
- package/dist/types/agent.d.ts +69 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +54 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/tasks.d.ts +22 -0
- package/dist/types/tasks.d.ts.map +1 -0
- package/dist/types/tasks.js +3 -0
- package/dist/types/tasks.js.map +1 -0
- package/dist/utils/event-emitter.d.ts +13 -0
- package/dist/utils/event-emitter.d.ts.map +1 -0
- package/dist/utils/event-emitter.js +54 -0
- package/dist/utils/event-emitter.js.map +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mail-search skill — macOS only.
|
|
4
|
+
*
|
|
5
|
+
* Lets the agent answer "find my email thread with X about Y" without the
|
|
6
|
+
* AppleScript trial-and-error pattern (16 iterations,
|
|
7
|
+
* six 30s `whose subject contains …` timeouts on a large inbox). Two tools:
|
|
8
|
+
*
|
|
9
|
+
* mail_search — Spotlight-indexed search over ~/Library/Mail. mdfind
|
|
10
|
+
* walks the kMD index in milliseconds even on inboxes
|
|
11
|
+
* with tens of thousands of messages. Returns top hits
|
|
12
|
+
* with subject / from / date / .emlx path.
|
|
13
|
+
* mail_read — read a single .emlx by absolute path. Strips the Apple
|
|
14
|
+
* envelope (byte-count prefix line + trailing plist) and
|
|
15
|
+
* returns the RFC822 message — headers + body — so the
|
|
16
|
+
* agent can quote, summarise, or extract a thread.
|
|
17
|
+
*
|
|
18
|
+
* Auto-activates when the user mentions email, inbox, or Mail.app —
|
|
19
|
+
* triggers stay broad because the keyword set is tiny ("email"/"inbox"
|
|
20
|
+
* are unambiguous). Manifest-level activation is `auto`; per-tool
|
|
21
|
+
* platform gating happens inside `execute()` so the tool descriptor is
|
|
22
|
+
* always present in the catalogue but fails cleanly on Linux/Windows.
|
|
23
|
+
*/
|
|
24
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
27
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
28
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
29
|
+
}
|
|
30
|
+
Object.defineProperty(o, k2, desc);
|
|
31
|
+
}) : (function(o, m, k, k2) {
|
|
32
|
+
if (k2 === undefined) k2 = k;
|
|
33
|
+
o[k2] = m[k];
|
|
34
|
+
}));
|
|
35
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
36
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
37
|
+
}) : function(o, v) {
|
|
38
|
+
o["default"] = v;
|
|
39
|
+
});
|
|
40
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
41
|
+
var ownKeys = function(o) {
|
|
42
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
43
|
+
var ar = [];
|
|
44
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
45
|
+
return ar;
|
|
46
|
+
};
|
|
47
|
+
return ownKeys(o);
|
|
48
|
+
};
|
|
49
|
+
return function (mod) {
|
|
50
|
+
if (mod && mod.__esModule) return mod;
|
|
51
|
+
var result = {};
|
|
52
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
53
|
+
__setModuleDefault(result, mod);
|
|
54
|
+
return result;
|
|
55
|
+
};
|
|
56
|
+
})();
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
exports.mailSearchSkill = void 0;
|
|
59
|
+
const fs = __importStar(require("node:fs"));
|
|
60
|
+
const os = __importStar(require("node:os"));
|
|
61
|
+
const path = __importStar(require("node:path"));
|
|
62
|
+
// Lazily resolved: `os.homedir()` / `path.join` are externalized to
|
|
63
|
+
// `undefined` in browser bundles, so a top-level call here crashed the
|
|
64
|
+
// Stealth Web app on import. This skill is macOS-only and gated behind
|
|
65
|
+
// `darwinGuard()` at execute time, so the path is only ever needed on a
|
|
66
|
+
// real Node host.
|
|
67
|
+
let cachedMailRoot;
|
|
68
|
+
function mailRoot() {
|
|
69
|
+
if (cachedMailRoot === undefined) {
|
|
70
|
+
cachedMailRoot = path.join(os.homedir(), 'Library', 'Mail');
|
|
71
|
+
}
|
|
72
|
+
return cachedMailRoot;
|
|
73
|
+
}
|
|
74
|
+
const DEFAULT_LIMIT = 20;
|
|
75
|
+
const MAX_LIMIT = 50;
|
|
76
|
+
const READ_BYTE_CAP = 80000;
|
|
77
|
+
function darwinGuard() {
|
|
78
|
+
if (process.platform !== 'darwin') {
|
|
79
|
+
return {
|
|
80
|
+
output: 'mail_search / mail_read are macOS-only — they read Mail.app\'s Spotlight index and ' +
|
|
81
|
+
'~/Library/Mail .emlx files. On this platform the tool cannot run.',
|
|
82
|
+
isError: true
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Mail.app's data directory sits under macOS TCC (Transparency, Consent,
|
|
89
|
+
* Control) — the parent process running bandit needs Full Disk Access in
|
|
90
|
+
* System Settings → Privacy & Security → Full Disk Access. Without it,
|
|
91
|
+
* `mdfind -onlyin ~/Library/Mail` silently returns ZERO hits even though
|
|
92
|
+
* the inbox has thousands of messages, which would look identical to a
|
|
93
|
+
* legitimate "no matches" — a classic source of agent confusion. Probe
|
|
94
|
+
* once: if we can't readdir ~/Library/Mail, report the permission gap
|
|
95
|
+
* with the exact remediation step the user needs.
|
|
96
|
+
*/
|
|
97
|
+
function fullDiskAccessGuard() {
|
|
98
|
+
try {
|
|
99
|
+
fs.readdirSync(mailRoot());
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
const code = err?.code;
|
|
104
|
+
if (code === 'EPERM' || code === 'EACCES') {
|
|
105
|
+
return {
|
|
106
|
+
output: 'macOS Full Disk Access required to read Mail.app data.\n\n' +
|
|
107
|
+
'Open System Settings → Privacy & Security → Full Disk Access, click + and add the ' +
|
|
108
|
+
'application that launched bandit (Terminal.app, iTerm.app, Ghostty, your VS Code build, etc.). ' +
|
|
109
|
+
'Then quit and relaunch that application — TCC permissions only apply to processes started ' +
|
|
110
|
+
'AFTER the grant. After that, mail_search / mail_read will work.',
|
|
111
|
+
isError: true
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (code === 'ENOENT') {
|
|
115
|
+
return {
|
|
116
|
+
output: 'Mail.app data directory not found at ~/Library/Mail. Is Apple Mail set up on this Mac?',
|
|
117
|
+
isError: true
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
output: `Could not access ~/Library/Mail: ${err instanceof Error ? err.message : String(err)}`,
|
|
122
|
+
isError: true
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Build the mdfind query from user-supplied filters. Spotlight syntax:
|
|
128
|
+
* kMDItemKind == 'Mail Message' -- restrict to email
|
|
129
|
+
* kMDItemAuthors == '*alex*'cd -- author contains
|
|
130
|
+
* kMDItemSubject == '*DFS*'cd -- subject contains
|
|
131
|
+
* kMDItemTextContent == '*open api*'cd -- body contains
|
|
132
|
+
* kMDItemContentCreationDate >= $time.iso(2026-04-01) -- after date
|
|
133
|
+
*
|
|
134
|
+
* The 'cd' flags = case-insensitive + diacritic-insensitive. We keep the
|
|
135
|
+
* query free-text and treat it as a body/subject/author OR-match so a
|
|
136
|
+
* single string like "alex dfs" finds messages where any of those terms
|
|
137
|
+
* appear anywhere — that's the usual user intent.
|
|
138
|
+
*/
|
|
139
|
+
function buildQuery(opts) {
|
|
140
|
+
const clauses = [`kMDItemKind == 'Mail Message'`];
|
|
141
|
+
if (opts.from) {
|
|
142
|
+
const escaped = opts.from.replace(/'/g, "\\'");
|
|
143
|
+
clauses.push(`kMDItemAuthors == '*${escaped}*'cd`);
|
|
144
|
+
}
|
|
145
|
+
if (opts.subject) {
|
|
146
|
+
const escaped = opts.subject.replace(/'/g, "\\'");
|
|
147
|
+
clauses.push(`kMDItemSubject == '*${escaped}*'cd`);
|
|
148
|
+
}
|
|
149
|
+
if (opts.query) {
|
|
150
|
+
const escaped = opts.query.replace(/'/g, "\\'");
|
|
151
|
+
// Free-text: match in author OR subject OR body. Spotlight evaluates
|
|
152
|
+
// the inner OR before AND-ing with the kind/from/subject/since
|
|
153
|
+
// clauses.
|
|
154
|
+
clauses.push(`(kMDItemAuthors == '*${escaped}*'cd || kMDItemSubject == '*${escaped}*'cd || kMDItemTextContent == '*${escaped}*'cd)`);
|
|
155
|
+
}
|
|
156
|
+
if (opts.since) {
|
|
157
|
+
// Trust the model to pass an ISO date (YYYY-MM-DD or full ISO).
|
|
158
|
+
// Spotlight's $time.iso() accepts both.
|
|
159
|
+
const iso = opts.since.replace(/'/g, '');
|
|
160
|
+
clauses.push(`kMDItemContentCreationDate >= $time.iso(${iso})`);
|
|
161
|
+
}
|
|
162
|
+
return clauses.join(' && ');
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Pull the metadata fields we surface in the search result list. mdls
|
|
166
|
+
* output looks like:
|
|
167
|
+
* kMDItemSubject = "FW: DFS Open API"
|
|
168
|
+
* kMDItemAuthors = ("Chris VanMeerhaeghe <chris@rwtcompany.com>")
|
|
169
|
+
* kMDItemContentCreationDate = 2026-04-29 16:01:30 +0000
|
|
170
|
+
* Parse the right-hand side per key, falling back to '' on missing.
|
|
171
|
+
*/
|
|
172
|
+
function parseMdlsOutput(stdout) {
|
|
173
|
+
const result = { subject: '', from: '', date: '' };
|
|
174
|
+
for (const line of stdout.split('\n')) {
|
|
175
|
+
const m = line.match(/^(\w+)\s*=\s*(.*)$/);
|
|
176
|
+
if (!m)
|
|
177
|
+
continue;
|
|
178
|
+
const key = m[1];
|
|
179
|
+
let value = m[2].trim();
|
|
180
|
+
// Strip surrounding quotes / parens / array braces.
|
|
181
|
+
value = value.replace(/^["(]+|[")]+$/g, '').trim();
|
|
182
|
+
// Multi-author array becomes "a", "b" — keep the first one for
|
|
183
|
+
// display; the full list is rarely useful in a card-style listing.
|
|
184
|
+
if (value.includes('","'))
|
|
185
|
+
value = value.split('","')[0].replace(/^"|"$/g, '');
|
|
186
|
+
if (key === 'kMDItemSubject')
|
|
187
|
+
result.subject = value;
|
|
188
|
+
else if (key === 'kMDItemAuthors')
|
|
189
|
+
result.from = value;
|
|
190
|
+
else if (key === 'kMDItemContentCreationDate')
|
|
191
|
+
result.date = value;
|
|
192
|
+
}
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
const mailSearchTool = {
|
|
196
|
+
name: 'mail_search',
|
|
197
|
+
description: 'Search Apple Mail.app via Spotlight. Returns up to N matching messages with subject, sender, ' +
|
|
198
|
+
'date, and absolute .emlx path you can pass to mail_read. Use this instead of `osascript ... whose ...` ' +
|
|
199
|
+
'— Spotlight is indexed and returns in <1s even on large inboxes; AppleScript `whose` does a linear ' +
|
|
200
|
+
'scan and times out at 30s on inboxes with thousands of messages. macOS only.',
|
|
201
|
+
parameters: [
|
|
202
|
+
{ name: 'query', description: 'Free-text search (matches in author, subject, or body).' },
|
|
203
|
+
{ name: 'from', description: 'Filter by sender substring (e.g. "alex" or "rwtcompany.com").' },
|
|
204
|
+
{ name: 'subject', description: 'Filter by subject substring (e.g. "DFS").' },
|
|
205
|
+
{ name: 'since', description: 'ISO date (YYYY-MM-DD); only messages after this date.' },
|
|
206
|
+
{ name: 'limit', description: 'Max messages to return. Default 20, capped at 50.' }
|
|
207
|
+
],
|
|
208
|
+
async execute(params, ctx) {
|
|
209
|
+
const guarded = darwinGuard() ?? fullDiskAccessGuard();
|
|
210
|
+
if (guarded)
|
|
211
|
+
return guarded;
|
|
212
|
+
const limit = Math.min(MAX_LIMIT, Math.max(1, parseInt(params.limit ?? '', 10) || DEFAULT_LIMIT));
|
|
213
|
+
const query = buildQuery({
|
|
214
|
+
query: params.query?.trim(),
|
|
215
|
+
from: params.from?.trim(),
|
|
216
|
+
subject: params.subject?.trim(),
|
|
217
|
+
since: params.since?.trim()
|
|
218
|
+
});
|
|
219
|
+
if (query === `kMDItemKind == 'Mail Message'`) {
|
|
220
|
+
return {
|
|
221
|
+
output: 'Refusing to list every message in your inbox — pass at least one of `query`, `from`, ' +
|
|
222
|
+
'`subject`, or `since` to narrow the search.',
|
|
223
|
+
isError: true
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
const findResult = await ctx.runCommand('mdfind', ['-onlyin', mailRoot(), query], ctx.workspaceRoot);
|
|
227
|
+
if (findResult.exitCode !== 0) {
|
|
228
|
+
return {
|
|
229
|
+
output: `mdfind failed: ${findResult.stderr.trim() || 'exit ' + findResult.exitCode}`,
|
|
230
|
+
isError: true
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
const paths = findResult.stdout.split('\n').map(s => s.trim()).filter(Boolean).slice(0, limit);
|
|
234
|
+
if (paths.length === 0) {
|
|
235
|
+
return { output: '(no matching messages)' };
|
|
236
|
+
}
|
|
237
|
+
// Pull metadata per hit. mdls is fast (≤5ms each) so we don't bother
|
|
238
|
+
// batching — keeps the code simple and per-message failures don't
|
|
239
|
+
// poison the whole result set.
|
|
240
|
+
const rows = [];
|
|
241
|
+
for (const p of paths) {
|
|
242
|
+
try {
|
|
243
|
+
const meta = await ctx.runCommand('mdls', ['-name', 'kMDItemSubject', '-name', 'kMDItemAuthors', '-name', 'kMDItemContentCreationDate', p], ctx.workspaceRoot);
|
|
244
|
+
const parsed = parseMdlsOutput(meta.stdout);
|
|
245
|
+
rows.push({ ...parsed, path: p });
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
rows.push({ subject: '(metadata read failed)', from: '', date: '', path: p });
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const lines = rows.map((r, i) => {
|
|
252
|
+
const subj = r.subject || '(no subject)';
|
|
253
|
+
const from = r.from || '(unknown sender)';
|
|
254
|
+
const date = r.date || '(no date)';
|
|
255
|
+
return `${i + 1}. [${date}] ${from}\n ${subj}\n path: ${r.path}`;
|
|
256
|
+
});
|
|
257
|
+
const truncatedNote = paths.length === limit
|
|
258
|
+
? `\n\n(showing first ${limit} hits — narrow the search if you need more.)`
|
|
259
|
+
: '';
|
|
260
|
+
return { output: `Found ${rows.length} message${rows.length === 1 ? '' : 's'}:\n\n${lines.join('\n\n')}${truncatedNote}` };
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
const mailReadTool = {
|
|
264
|
+
name: 'mail_read',
|
|
265
|
+
description: 'Read a single Mail.app message by its .emlx file path (from mail_search). Returns the RFC822 ' +
|
|
266
|
+
'message — headers + body. Strips Apple\'s envelope (byte-count prefix + trailing plist). macOS only.',
|
|
267
|
+
parameters: [
|
|
268
|
+
{ name: 'path', description: 'Absolute path to a .emlx file (use the path field from a mail_search row).', required: true }
|
|
269
|
+
],
|
|
270
|
+
async execute(params) {
|
|
271
|
+
const guarded = darwinGuard() ?? fullDiskAccessGuard();
|
|
272
|
+
if (guarded)
|
|
273
|
+
return guarded;
|
|
274
|
+
const filePath = params.path?.trim();
|
|
275
|
+
if (!filePath) {
|
|
276
|
+
return { output: 'mail_read requires `path` (the .emlx file from a mail_search row).', isError: true };
|
|
277
|
+
}
|
|
278
|
+
// Path safety: only allow absolute paths under ~/Library/Mail with
|
|
279
|
+
// a recognised .emlx-family extension. Prevents the model from
|
|
280
|
+
// accidentally aiming this at /etc/passwd or similar.
|
|
281
|
+
const abs = path.resolve(filePath);
|
|
282
|
+
const root = mailRoot();
|
|
283
|
+
if (!abs.startsWith(root + path.sep)) {
|
|
284
|
+
return {
|
|
285
|
+
output: `mail_read can only open files under ${root}. Got: ${abs}`,
|
|
286
|
+
isError: true
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
if (!/\.(emlx|partial\.emlx|emlxpart)$/.test(abs)) {
|
|
290
|
+
return {
|
|
291
|
+
output: `mail_read expects a .emlx file. Got: ${abs}`,
|
|
292
|
+
isError: true
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
let raw;
|
|
296
|
+
try {
|
|
297
|
+
raw = await fs.promises.readFile(abs, 'utf-8');
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
return {
|
|
301
|
+
output: `Failed to read ${abs}: ${err instanceof Error ? err.message : String(err)}`,
|
|
302
|
+
isError: true
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
// Apple .emlx layout:
|
|
306
|
+
// <ascii byte-count>\n
|
|
307
|
+
// <RFC822 message of exactly that many bytes>
|
|
308
|
+
// <Apple plist trailer>
|
|
309
|
+
// Slice out the RFC822 portion using the declared byte count.
|
|
310
|
+
const firstNewline = raw.indexOf('\n');
|
|
311
|
+
const byteCount = parseInt(raw.slice(0, firstNewline).trim(), 10);
|
|
312
|
+
let rfc822 = Number.isFinite(byteCount) && byteCount > 0
|
|
313
|
+
? raw.slice(firstNewline + 1, firstNewline + 1 + byteCount)
|
|
314
|
+
: raw;
|
|
315
|
+
if (rfc822.length > READ_BYTE_CAP) {
|
|
316
|
+
rfc822 = rfc822.slice(0, READ_BYTE_CAP) + `\n\n[…truncated, ${rfc822.length - READ_BYTE_CAP} more bytes; use a more specific search to narrow the thread]`;
|
|
317
|
+
}
|
|
318
|
+
return { output: rfc822 };
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
exports.mailSearchSkill = {
|
|
322
|
+
id: 'mac/mail-search',
|
|
323
|
+
name: 'Mail Search (macOS)',
|
|
324
|
+
version: '1.0.0',
|
|
325
|
+
description: 'Search and read Apple Mail.app messages via Spotlight + .emlx — no AppleScript timeouts.',
|
|
326
|
+
instructions: 'When the user asks about an email thread, who emailed them, or to summarise a conversation: ' +
|
|
327
|
+
'\n1. Call `mail_search` with `query`/`from`/`subject`/`since` filters. Do NOT use `osascript ... whose ...` ' +
|
|
328
|
+
'on Mail.app — it scans linearly and times out at 30s on large inboxes.\n' +
|
|
329
|
+
'2. Pick the relevant `path` from the result list.\n' +
|
|
330
|
+
'3. Call `mail_read(path=...)` to get the message body.\n' +
|
|
331
|
+
'For a thread you may need to mail_read 2-3 messages. Prefer `from` over generic `query` when you ' +
|
|
332
|
+
'know the sender — it returns much fewer false positives.',
|
|
333
|
+
activation: 'auto',
|
|
334
|
+
triggerPatterns: [
|
|
335
|
+
/\bemail\b/i,
|
|
336
|
+
/\binbox\b/i,
|
|
337
|
+
/\bmail\.?app\b/i,
|
|
338
|
+
/\bapple mail\b/i,
|
|
339
|
+
/\bmessage(s)? from\b/i
|
|
340
|
+
],
|
|
341
|
+
tools: [mailSearchTool, mailReadTool]
|
|
342
|
+
};
|
|
343
|
+
//# sourceMappingURL=mail-search-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail-search-skill.js","sourceRoot":"","sources":["../../../src/tools/skills/mail-search-skill.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AAIlC,oEAAoE;AACpE,uEAAuE;AACvE,uEAAuE;AACvE,wEAAwE;AACxE,kBAAkB;AAClB,IAAI,cAAkC,CAAC;AACvC,SAAS,QAAQ;IACf,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AACD,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,aAAa,GAAG,KAAM,CAAC;AAE7B,SAAS,WAAW;IAClB,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO;YACL,MAAM,EACJ,qFAAqF;gBACrF,mEAAmE;YACrE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,mBAAmB;IAC1B,IAAI,CAAC;QACH,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,GAAI,GAA6B,EAAE,IAAI,CAAC;QAClD,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC1C,OAAO;gBAC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@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan skill — auto-activated on complex multi-file tasks.
|
|
3
|
+
*
|
|
4
|
+
* Exposes plan generation as a tool within the tool-use loop.
|
|
5
|
+
* This bridges the plan-based execution path into the agentic loop:
|
|
6
|
+
* the model decides when to plan (complex tasks) vs. act directly (simple tasks).
|
|
7
|
+
*/
|
|
8
|
+
import type { SkillManifest } from '../skill-types';
|
|
9
|
+
export declare const planSkill: SkillManifest;
|
|
10
|
+
//# sourceMappingURL=plan-skill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-skill.d.ts","sourceRoot":"","sources":["../../../src/tools/skills/plan-skill.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAsIpD,eAAO,MAAM,SAAS,EAAE,aAiBvB,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Plan skill — auto-activated on complex multi-file tasks.
|
|
4
|
+
*
|
|
5
|
+
* Exposes plan generation as a tool within the tool-use loop.
|
|
6
|
+
* This bridges the plan-based execution path into the agentic loop:
|
|
7
|
+
* the model decides when to plan (complex tasks) vs. act directly (simple tasks).
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.planSkill = void 0;
|
|
11
|
+
const createPlanTool = {
|
|
12
|
+
name: 'create_plan',
|
|
13
|
+
description: 'Generate a structured execution plan for a complex multi-step task. Use this when the task requires coordinating changes across multiple files or systems. Returns a plan with numbered steps you should follow.',
|
|
14
|
+
parameters: [
|
|
15
|
+
{ name: 'goal', description: 'Clear description of what needs to be accomplished', required: true },
|
|
16
|
+
{ name: 'context_files', description: 'Comma-separated list of relevant file paths to consider in the plan' }
|
|
17
|
+
],
|
|
18
|
+
async execute(params, ctx) {
|
|
19
|
+
const goal = params.goal?.trim();
|
|
20
|
+
if (!goal)
|
|
21
|
+
return { output: 'Error: goal parameter is required', isError: true };
|
|
22
|
+
// Gather workspace context for the plan
|
|
23
|
+
const contextFiles = params.context_files
|
|
24
|
+
? params.context_files.split(',').map((f) => f.trim()).filter(Boolean)
|
|
25
|
+
: [];
|
|
26
|
+
// Read each context file to give the plan generator information
|
|
27
|
+
const fileContents = [];
|
|
28
|
+
for (const file of contextFiles.slice(0, 5)) {
|
|
29
|
+
try {
|
|
30
|
+
const absPath = file.startsWith('/') ||
|
|
31
|
+
file.startsWith('~') ||
|
|
32
|
+
/^[A-Za-z]:[\\/]/.test(file) ||
|
|
33
|
+
file.startsWith('\\\\')
|
|
34
|
+
? file
|
|
35
|
+
: `${ctx.workspaceRoot}/${file}`;
|
|
36
|
+
const content = await ctx.readFile(absPath);
|
|
37
|
+
const lines = content.split('\n').length;
|
|
38
|
+
const preview = content.slice(0, 2000);
|
|
39
|
+
fileContents.push(`--- ${file} (${lines} lines) ---\n${preview}${content.length > 2000 ? '\n[truncated]' : ''}`);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
fileContents.push(`--- ${file} (could not read) ---`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Build a structured plan using heuristic decomposition
|
|
46
|
+
const steps = decomposeGoal(goal);
|
|
47
|
+
const plan = {
|
|
48
|
+
goal,
|
|
49
|
+
steps: steps.map((step, i) => ({
|
|
50
|
+
id: `step-${i + 1}`,
|
|
51
|
+
title: step,
|
|
52
|
+
status: 'pending'
|
|
53
|
+
})),
|
|
54
|
+
contextFiles,
|
|
55
|
+
totalSteps: steps.length
|
|
56
|
+
};
|
|
57
|
+
const output = [
|
|
58
|
+
`## Plan: ${goal}`,
|
|
59
|
+
'',
|
|
60
|
+
`**${plan.totalSteps} steps identified:**`,
|
|
61
|
+
'',
|
|
62
|
+
...plan.steps.map((s) => `${s.id}. ${s.title}`),
|
|
63
|
+
'',
|
|
64
|
+
fileContents.length > 0 ? '**Context files reviewed:**' : '',
|
|
65
|
+
...fileContents.slice(0, 3).map((c) => c.split('\n')[0]),
|
|
66
|
+
'',
|
|
67
|
+
'Execute each step in order using the available tools (read_file, write_file, search_code, etc.).',
|
|
68
|
+
'After completing all steps, verify the changes are correct.'
|
|
69
|
+
].filter(Boolean).join('\n');
|
|
70
|
+
return { output };
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Decompose a goal into actionable steps using simple heuristics.
|
|
75
|
+
* This gives the model a structured starting point within the tool-use loop.
|
|
76
|
+
*/
|
|
77
|
+
function decomposeGoal(goal) {
|
|
78
|
+
const lower = goal.toLowerCase();
|
|
79
|
+
// Check for explicit multi-part goals
|
|
80
|
+
const delimiters = [/ and then /i, / then /i, /;\s*/, / -> /];
|
|
81
|
+
for (const delimiter of delimiters) {
|
|
82
|
+
if (delimiter.test(goal)) {
|
|
83
|
+
const parts = goal.split(delimiter).map((p) => p.trim()).filter(Boolean);
|
|
84
|
+
if (parts.length > 1)
|
|
85
|
+
return parts;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Common task patterns → step templates
|
|
89
|
+
const steps = [];
|
|
90
|
+
if (/\b(refactor|restructure|extract|split)\b/i.test(lower)) {
|
|
91
|
+
steps.push('Read the target file(s) to understand current structure', 'Identify the code to extract or restructure', 'Create new file(s) if needed', 'Move or refactor the identified code', 'Update imports and references in dependent files', 'Verify no broken imports with search_code');
|
|
92
|
+
}
|
|
93
|
+
else if (/\b(fix|bug|error|broken)\b/i.test(lower)) {
|
|
94
|
+
steps.push('Read the file containing the bug', 'Search for related error patterns or failing tests', 'Identify the root cause', 'Apply the fix', 'Verify the fix resolves the issue');
|
|
95
|
+
}
|
|
96
|
+
else if (/\b(add|implement|create|build|feature)\b/i.test(lower)) {
|
|
97
|
+
steps.push('Read existing related files to understand patterns', 'Create new file(s) for the feature', 'Implement the core logic', 'Wire up imports and exports', 'Add any necessary configuration or setup');
|
|
98
|
+
}
|
|
99
|
+
else if (/\b(test|spec)\b/i.test(lower)) {
|
|
100
|
+
steps.push('Read the source file to understand what needs testing', 'Find existing test files for patterns', 'Write test cases covering main scenarios', 'Run tests to verify they pass');
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
// Generic decomposition
|
|
104
|
+
steps.push('Explore relevant files to understand context', 'Plan the specific changes needed', 'Implement the changes', 'Verify the changes are correct');
|
|
105
|
+
}
|
|
106
|
+
return steps;
|
|
107
|
+
}
|
|
108
|
+
exports.planSkill = {
|
|
109
|
+
id: 'agent/plan',
|
|
110
|
+
name: 'Plan',
|
|
111
|
+
version: '1.0.0',
|
|
112
|
+
description: 'Generate structured execution plans for complex multi-step tasks.',
|
|
113
|
+
instructions: 'For complex tasks that touch multiple files, use create_plan first to break the work into steps. For simple single-file tasks, skip planning and use tools directly.',
|
|
114
|
+
activation: 'auto',
|
|
115
|
+
triggerPatterns: [
|
|
116
|
+
/\brefactor\b/i,
|
|
117
|
+
/\bmulti.?file\b/i,
|
|
118
|
+
/\bmigrat/i,
|
|
119
|
+
/\brestructure\b/i,
|
|
120
|
+
/\barchitect/i,
|
|
121
|
+
/\boverhaul\b/i,
|
|
122
|
+
/\breorganize\b/i
|
|
123
|
+
],
|
|
124
|
+
tools: [createPlanTool]
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=plan-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-skill.js","sourceRoot":"","sources":["../../../src/tools/skills/plan-skill.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAKH,MAAM,cAAc,GAAc;IAChC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,kNAAkN;IAC/N,UAAU,EAAE;QACV,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,oDAAoD,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnG,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,qEAAqE,EAAE;KAC9G;IACD,KAAK,C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CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CACR,uDAAuD,EACvD,uCAAuC,EACvC,0CAA0C,EAC1C,+BAA+B,CAChC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,wBAAwB;QACxB,KAAK,CAAC,IAAI,CACR,8CAA8C,EAC9C,kCAAkC,EAClC,uBAAuB,EACvB,gCAAgC,CACjC,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAEY,QAAA,SAAS,GAAkB;IACtC,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,mEAAmE;IAChF,YAAY,EAAE,sKAAsK;IACpL,UAAU,EAAE,MAAM;IAClB,eAAe,EAAE;QACf,eAAe;QACf,kBAAkB;QAClB,WAAW;QACX,kBAAkB;QAClB,cAAc;QACd,eAAe;QACf,iBAAiB;KAClB;IACD,KAAK,EAAE,CAAC,cAAc,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic search skill — auto-activated when users ask about code concepts,
|
|
3
|
+
* architecture, or need to find code by meaning rather than literal text.
|
|
4
|
+
*
|
|
5
|
+
* Uses Ollama's nomic-embed-text model for local embeddings. Indexes workspace
|
|
6
|
+
* files on first search and caches vectors in memory for the session.
|
|
7
|
+
*
|
|
8
|
+
* Requires Ollama running locally with nomic-embed-text installed:
|
|
9
|
+
* ollama pull nomic-embed-text
|
|
10
|
+
*/
|
|
11
|
+
import type { SkillManifest } from '../skill-types';
|
|
12
|
+
export declare const semanticSearchSkill: SkillManifest;
|
|
13
|
+
/**
|
|
14
|
+
* Configure the Ollama base URL for the embedding client.
|
|
15
|
+
* Call this before the skill is used if Ollama is not on localhost.
|
|
16
|
+
*/
|
|
17
|
+
export declare function configureSemanticSearchOllamaUrl(url: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Reset the in-memory index (e.g. on workspace change).
|
|
20
|
+
*/
|
|
21
|
+
export declare function resetSemanticIndex(): void;
|
|
22
|
+
//# sourceMappingURL=semantic-search-skill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-search-skill.d.ts","sourceRoot":"","sources":["../../../src/tools/skills/semantic-search-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAuNpD,eAAO,MAAM,mBAAmB,EAAE,aAkBjC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAElE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAGzC"}
|