@nex-ai/nex 0.1.45 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/setup.js +0 -3
- package/dist/commands/setup.js.map +1 -1
- package/dist/lib/installers.js +1 -57
- package/dist/lib/installers.js.map +1 -1
- package/dist/lib/platform-detect.d.ts +1 -1
- package/dist/lib/platform-detect.js +0 -29
- package/dist/lib/platform-detect.js.map +1 -1
- package/dist/plugin/config.js +1 -1
- package/dist/plugin/config.js.map +1 -1
- package/package.json +1 -1
- package/platform-plugins/windsurf-workflows/{nex:ask.md → nex-ask.md} +1 -1
- package/platform-plugins/windsurf-workflows/{nex:remember.md → nex-remember.md} +1 -1
- package/platform-plugins/windsurf-workflows/{nex:search.md → nex-search.md} +1 -1
- package/platform-rules/aider-conventions.md +0 -9
- package/platform-rules/cline-rules.md +0 -9
- package/platform-rules/continue-rules.md +0 -9
- package/platform-rules/cursor-rules.md +0 -9
- package/platform-rules/kilocode-rules.md +0 -9
- package/platform-rules/opencode-agents.md +0 -9
- package/platform-rules/vscode-instructions.md +0 -9
- package/platform-rules/windsurf-rules.md +0 -9
- package/platform-rules/zed-rules.md +0 -9
- package/plugin-commands/{nex:entities.md → entities.md} +1 -1
- package/dist/plugin/adapters/cline-capture.d.ts +0 -7
- package/dist/plugin/adapters/cline-capture.js +0 -25
- package/dist/plugin/adapters/cline-capture.js.map +0 -1
- package/dist/plugin/adapters/cline-recall.d.ts +0 -7
- package/dist/plugin/adapters/cline-recall.js +0 -30
- package/dist/plugin/adapters/cline-recall.js.map +0 -1
- package/dist/plugin/adapters/cline-task-start.d.ts +0 -7
- package/dist/plugin/adapters/cline-task-start.js +0 -30
- package/dist/plugin/adapters/cline-task-start.js.map +0 -1
- package/dist/plugin/adapters/cursor-recall.d.ts +0 -7
- package/dist/plugin/adapters/cursor-recall.js +0 -31
- package/dist/plugin/adapters/cursor-recall.js.map +0 -1
- package/dist/plugin/adapters/cursor-session-start.d.ts +0 -7
- package/dist/plugin/adapters/cursor-session-start.js +0 -30
- package/dist/plugin/adapters/cursor-session-start.js.map +0 -1
- package/dist/plugin/adapters/cursor-stop.d.ts +0 -7
- package/dist/plugin/adapters/cursor-stop.js +0 -25
- package/dist/plugin/adapters/cursor-stop.js.map +0 -1
- package/dist/plugin/adapters/windsurf-capture.d.ts +0 -7
- package/dist/plugin/adapters/windsurf-capture.js +0 -25
- package/dist/plugin/adapters/windsurf-capture.js.map +0 -1
- package/dist/plugin/adapters/windsurf-recall.d.ts +0 -7
- package/dist/plugin/adapters/windsurf-recall.js +0 -31
- package/dist/plugin/adapters/windsurf-recall.js.map +0 -1
- package/dist/plugin/shared.d.ts +0 -39
- package/dist/plugin/shared.js +0 -380
- package/dist/plugin/shared.js.map +0 -1
- package/platform-rules/codex-agents.md +0 -59
- /package/plugin-commands/{nex:integrate.md → integrate.md} +0 -0
- /package/plugin-commands/{nex:recall.md → recall.md} +0 -0
- /package/plugin-commands/{nex:register.md → register.md} +0 -0
- /package/plugin-commands/{nex:remember.md → remember.md} +0 -0
- /package/plugin-commands/{nex:scan.md → scan.md} +0 -0
package/dist/plugin/shared.js
DELETED
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared hook logic — platform-agnostic recall, capture, and session-start.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from auto-recall.ts, auto-capture.ts, auto-session-start.ts
|
|
5
|
-
* so adapters for Cursor, Windsurf, Cline, etc. can reuse the same logic
|
|
6
|
-
* without duplicating filter/client/format code.
|
|
7
|
-
*/
|
|
8
|
-
import { loadConfig, loadScanConfig, ConfigError, isHookEnabled } from "./config.js";
|
|
9
|
-
import { NexClient, NexAuthError } from "./nex-client.js";
|
|
10
|
-
import { formatNexContext } from "./context-format.js";
|
|
11
|
-
import { captureFilter } from "./capture-filter.js";
|
|
12
|
-
import { SessionStore } from "./session-store.js";
|
|
13
|
-
import { shouldRecall, recordRecall } from "./recall-filter.js";
|
|
14
|
-
import { RateLimiter } from "./rate-limiter.js";
|
|
15
|
-
import { scanAndIngest } from "./file-scanner.js";
|
|
16
|
-
import { ingestContextFiles } from "./context-files.js";
|
|
17
|
-
import { readManifest, writeManifest, isChanged, markIngested, isScanFresh, markScanned } from "./file-manifest.js";
|
|
18
|
-
import { readdirSync, statSync, readFileSync } from "node:fs";
|
|
19
|
-
import { join, extname } from "node:path";
|
|
20
|
-
import { homedir } from "node:os";
|
|
21
|
-
const sessions = new SessionStore();
|
|
22
|
-
// ── Recall ──────────────────────────────────────────────────────────────
|
|
23
|
-
/**
|
|
24
|
-
* Run recall logic: filter prompt → query Nex /ask → return formatted context.
|
|
25
|
-
* Returns null if recall is skipped or fails.
|
|
26
|
-
*/
|
|
27
|
-
export async function doRecall(prompt, sessionKey) {
|
|
28
|
-
if (!isHookEnabled("recall"))
|
|
29
|
-
return null;
|
|
30
|
-
const trimmed = prompt?.trim();
|
|
31
|
-
if (!trimmed || trimmed.length < 5)
|
|
32
|
-
return null;
|
|
33
|
-
if (trimmed.startsWith("/"))
|
|
34
|
-
return null;
|
|
35
|
-
const isFirst = sessionKey ? !sessions.get(sessionKey) : true;
|
|
36
|
-
const decision = shouldRecall(trimmed, isFirst);
|
|
37
|
-
if (!decision.shouldRecall)
|
|
38
|
-
return null;
|
|
39
|
-
const cfg = loadConfig();
|
|
40
|
-
const client = new NexClient(cfg.apiKey, cfg.baseUrl);
|
|
41
|
-
let result;
|
|
42
|
-
try {
|
|
43
|
-
const nexSessionId = sessionKey ? sessions.get(sessionKey) : undefined;
|
|
44
|
-
result = await client.ask(trimmed, nexSessionId, 30_000);
|
|
45
|
-
}
|
|
46
|
-
catch (err) {
|
|
47
|
-
if (err instanceof NexAuthError) {
|
|
48
|
-
return {
|
|
49
|
-
context: "[Nex] API key expired or invalid. Run: nex register --email <email>",
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
throw err;
|
|
53
|
-
}
|
|
54
|
-
if (!result.answer)
|
|
55
|
-
return null;
|
|
56
|
-
if (result.session_id && sessionKey) {
|
|
57
|
-
sessions.set(sessionKey, result.session_id);
|
|
58
|
-
}
|
|
59
|
-
recordRecall(result.session_id);
|
|
60
|
-
const entityCount = result.entity_references?.length ?? 0;
|
|
61
|
-
const context = formatNexContext({
|
|
62
|
-
answer: result.answer,
|
|
63
|
-
entityCount,
|
|
64
|
-
sessionId: result.session_id,
|
|
65
|
-
});
|
|
66
|
-
return { context, nexSessionId: result.session_id };
|
|
67
|
-
}
|
|
68
|
-
// ── Capture ─────────────────────────────────────────────────────────────
|
|
69
|
-
const INGEST_TIMEOUT_MS = 3_000;
|
|
70
|
-
const MAX_PLAN_FILES = 2;
|
|
71
|
-
/**
|
|
72
|
-
* Run capture logic: filter message → ingest to Nex + scan plan files.
|
|
73
|
-
*/
|
|
74
|
-
export async function doCapture(input) {
|
|
75
|
-
if (!isHookEnabled("capture"))
|
|
76
|
-
return;
|
|
77
|
-
let cfg;
|
|
78
|
-
try {
|
|
79
|
-
cfg = loadConfig();
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const client = new NexClient(cfg.apiKey, cfg.baseUrl);
|
|
85
|
-
const rateLimiter = new RateLimiter();
|
|
86
|
-
// Conversation capture
|
|
87
|
-
const message = input.message?.trim();
|
|
88
|
-
if (message) {
|
|
89
|
-
const filterResult = captureFilter(message);
|
|
90
|
-
if (!filterResult.skipped) {
|
|
91
|
-
if (rateLimiter.canProceed()) {
|
|
92
|
-
try {
|
|
93
|
-
await client.ingest(filterResult.text, "claude-code-conversation", INGEST_TIMEOUT_MS);
|
|
94
|
-
}
|
|
95
|
-
catch (err) {
|
|
96
|
-
if (err instanceof NexAuthError) {
|
|
97
|
-
process.stderr.write(`[nex-capture] API key expired or invalid. Run 'nex register --email <email>' to get a new key.\n`);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
process.stderr.write(`[nex-capture] Ingest failed: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// Plan file ingestion
|
|
106
|
-
const plansDir = input.planDir ?? join(process.cwd(), ".claude", "plans");
|
|
107
|
-
try {
|
|
108
|
-
await ingestPlanFiles(client, rateLimiter, plansDir);
|
|
109
|
-
}
|
|
110
|
-
catch (err) {
|
|
111
|
-
process.stderr.write(`[nex-capture] Plan file scan error: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
112
|
-
}
|
|
113
|
-
// Transcript ingestion — ingest the full session conversation
|
|
114
|
-
if (input.sessionId) {
|
|
115
|
-
try {
|
|
116
|
-
await ingestTranscript(client, input.sessionId);
|
|
117
|
-
}
|
|
118
|
-
catch {
|
|
119
|
-
// non-fatal
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
async function ingestPlanFiles(client, rateLimiter, plansDir) {
|
|
124
|
-
const scanConfig = loadScanConfig();
|
|
125
|
-
if (!scanConfig.enabled)
|
|
126
|
-
return;
|
|
127
|
-
let entries;
|
|
128
|
-
try {
|
|
129
|
-
entries = readdirSync(plansDir, { withFileTypes: true });
|
|
130
|
-
}
|
|
131
|
-
catch {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const manifest = readManifest();
|
|
135
|
-
let ingested = 0;
|
|
136
|
-
for (const entry of entries) {
|
|
137
|
-
if (ingested >= MAX_PLAN_FILES)
|
|
138
|
-
break;
|
|
139
|
-
if (!entry.isFile())
|
|
140
|
-
continue;
|
|
141
|
-
if (extname(entry.name).toLowerCase() !== ".md")
|
|
142
|
-
continue;
|
|
143
|
-
const fullPath = join(plansDir, entry.name);
|
|
144
|
-
try {
|
|
145
|
-
const stat = statSync(fullPath);
|
|
146
|
-
if (!isChanged(fullPath, stat, manifest))
|
|
147
|
-
continue;
|
|
148
|
-
if (!rateLimiter.canProceed())
|
|
149
|
-
break;
|
|
150
|
-
let content = readFileSync(fullPath, "utf-8");
|
|
151
|
-
if (content.length > 100_000) {
|
|
152
|
-
content = content.slice(0, 100_000) + "\n[...truncated]";
|
|
153
|
-
}
|
|
154
|
-
const context = `claude-code-plan:${entry.name}`;
|
|
155
|
-
await client.ingest(content, context, INGEST_TIMEOUT_MS);
|
|
156
|
-
markIngested(fullPath, stat, context, manifest);
|
|
157
|
-
ingested++;
|
|
158
|
-
}
|
|
159
|
-
catch {
|
|
160
|
-
// skip individual file errors
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (ingested > 0)
|
|
164
|
-
writeManifest(manifest);
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Read a Claude Code session transcript and ingest the full conversation.
|
|
168
|
-
*
|
|
169
|
-
* Extracts user and assistant messages from the JSONL transcript file,
|
|
170
|
-
* builds a condensed conversation text, and sends it to Nex in one shot.
|
|
171
|
-
* This captures the full context instead of just the last assistant message.
|
|
172
|
-
*/
|
|
173
|
-
const MAX_TRANSCRIPT_LENGTH = 100_000;
|
|
174
|
-
async function ingestTranscript(client, sessionId) {
|
|
175
|
-
const cwd = process.cwd();
|
|
176
|
-
// Claude Code stores transcripts at ~/.claude/projects/<project-hash>/<session-id>.jsonl
|
|
177
|
-
// Project hash is the CWD path with / replaced by -
|
|
178
|
-
const projectHash = "-" + cwd.replace(/\//g, "-");
|
|
179
|
-
const transcriptPath = join(homedir(), ".claude", "projects", projectHash, `${sessionId}.jsonl`);
|
|
180
|
-
let raw;
|
|
181
|
-
try {
|
|
182
|
-
raw = readFileSync(transcriptPath, "utf-8");
|
|
183
|
-
}
|
|
184
|
-
catch {
|
|
185
|
-
return; // transcript doesn't exist yet or path is wrong
|
|
186
|
-
}
|
|
187
|
-
// Extract user/assistant messages
|
|
188
|
-
const lines = [];
|
|
189
|
-
for (const line of raw.split("\n")) {
|
|
190
|
-
if (!line.trim())
|
|
191
|
-
continue;
|
|
192
|
-
try {
|
|
193
|
-
const entry = JSON.parse(line);
|
|
194
|
-
const role = entry.message?.role;
|
|
195
|
-
if (role !== "user" && role !== "assistant")
|
|
196
|
-
continue;
|
|
197
|
-
let text = "";
|
|
198
|
-
const content = entry.message?.content;
|
|
199
|
-
if (typeof content === "string") {
|
|
200
|
-
text = content;
|
|
201
|
-
}
|
|
202
|
-
else if (Array.isArray(content)) {
|
|
203
|
-
text = content
|
|
204
|
-
.filter((c) => c.type === "text")
|
|
205
|
-
.map((c) => c.text)
|
|
206
|
-
.join("\n");
|
|
207
|
-
}
|
|
208
|
-
if (!text.trim())
|
|
209
|
-
continue;
|
|
210
|
-
// Strip nex-context blocks to avoid feedback loops
|
|
211
|
-
text = text.replace(/<nex-context>[\s\S]*?<\/nex-context>/g, "").trim();
|
|
212
|
-
if (!text)
|
|
213
|
-
continue;
|
|
214
|
-
lines.push(`[${role}]: ${text}`);
|
|
215
|
-
}
|
|
216
|
-
catch {
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
if (lines.length < 2)
|
|
221
|
-
return; // need at least one exchange
|
|
222
|
-
let transcript = lines.join("\n\n");
|
|
223
|
-
if (transcript.length > MAX_TRANSCRIPT_LENGTH) {
|
|
224
|
-
// Keep the most recent messages (end of conversation is most valuable)
|
|
225
|
-
transcript = transcript.slice(-MAX_TRANSCRIPT_LENGTH);
|
|
226
|
-
transcript = "[...earlier messages truncated]\n\n" + transcript;
|
|
227
|
-
}
|
|
228
|
-
await client.ingest(transcript, `claude-code-transcript:${sessionId}`, 30_000);
|
|
229
|
-
}
|
|
230
|
-
// ── Session Start ───────────────────────────────────────────────────────
|
|
231
|
-
const SESSION_START_QUERY = "Summarize the key active context, recent interactions, and important updates for this user.";
|
|
232
|
-
/**
|
|
233
|
-
* Run session-start logic: scan files → query Nex baseline → return context.
|
|
234
|
-
* Returns null if disabled. Returns registrationPrompt if no API key.
|
|
235
|
-
*/
|
|
236
|
-
export async function doSessionStart(source, sessionKey) {
|
|
237
|
-
if (!isHookEnabled("session_start"))
|
|
238
|
-
return null;
|
|
239
|
-
let cfg;
|
|
240
|
-
try {
|
|
241
|
-
cfg = loadConfig();
|
|
242
|
-
}
|
|
243
|
-
catch (err) {
|
|
244
|
-
if (err instanceof ConfigError) {
|
|
245
|
-
// No API key — return registration instructions
|
|
246
|
-
return {
|
|
247
|
-
context: "",
|
|
248
|
-
registrationPrompt: buildRegistrationPrompt(),
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
return null;
|
|
252
|
-
}
|
|
253
|
-
const client = new NexClient(cfg.apiKey, cfg.baseUrl);
|
|
254
|
-
const contextParts = [];
|
|
255
|
-
// File scan on startup or clear
|
|
256
|
-
const shouldScan = source === "startup" || source === "clear";
|
|
257
|
-
if (shouldScan) {
|
|
258
|
-
// Skip expensive file scanning if a scan completed recently (within 1 hour).
|
|
259
|
-
// The context query below still runs — only the file walk + ingest is skipped.
|
|
260
|
-
const scanManifest = readManifest();
|
|
261
|
-
const scanFresh = isScanFresh(scanManifest);
|
|
262
|
-
if (!scanFresh) {
|
|
263
|
-
const rateLimiter = new RateLimiter();
|
|
264
|
-
const cwd = process.cwd();
|
|
265
|
-
try {
|
|
266
|
-
const ctxResult = await ingestContextFiles(client, rateLimiter, cwd);
|
|
267
|
-
if (ctxResult.ingested > 0) {
|
|
268
|
-
contextParts.push(`[Context files: ${ctxResult.ingested} ingested (${ctxResult.files.join(", ")})]`);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
catch {
|
|
272
|
-
// non-fatal
|
|
273
|
-
}
|
|
274
|
-
try {
|
|
275
|
-
const scanConfig = loadScanConfig();
|
|
276
|
-
if (scanConfig.enabled) {
|
|
277
|
-
const scanResult = await scanAndIngest(client, rateLimiter, cwd, scanConfig);
|
|
278
|
-
if (scanResult.ingested > 0) {
|
|
279
|
-
contextParts.push(`[File scan: ${scanResult.ingested} file${scanResult.ingested === 1 ? "" : "s"} ingested, ${scanResult.scanned} scanned]`);
|
|
280
|
-
// Trigger compounding intelligence after ingestion (non-blocking, best-effort)
|
|
281
|
-
triggerCompounding(cfg).catch(() => { });
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
catch {
|
|
286
|
-
// non-fatal
|
|
287
|
-
}
|
|
288
|
-
// Mark scan as complete so subsequent sessions skip it
|
|
289
|
-
markScanned(scanManifest);
|
|
290
|
-
writeManifest(scanManifest);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
let result;
|
|
294
|
-
try {
|
|
295
|
-
result = await client.ask(SESSION_START_QUERY, undefined, 30_000);
|
|
296
|
-
}
|
|
297
|
-
catch (err) {
|
|
298
|
-
if (err instanceof NexAuthError) {
|
|
299
|
-
return {
|
|
300
|
-
context: "",
|
|
301
|
-
registrationPrompt: buildAuthExpiredPrompt(),
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
throw err;
|
|
305
|
-
}
|
|
306
|
-
if (!result.answer && contextParts.length === 0)
|
|
307
|
-
return null;
|
|
308
|
-
if (result.session_id && sessionKey) {
|
|
309
|
-
sessions.set(sessionKey, result.session_id);
|
|
310
|
-
}
|
|
311
|
-
recordRecall(result.session_id);
|
|
312
|
-
const entityCount = result.entity_references?.length ?? 0;
|
|
313
|
-
const context = formatNexContext({
|
|
314
|
-
answer: result.answer,
|
|
315
|
-
entityCount,
|
|
316
|
-
sessionId: result.session_id,
|
|
317
|
-
});
|
|
318
|
-
const fullContext = contextParts.length > 0
|
|
319
|
-
? `${context}\n${contextParts.join("\n")}`
|
|
320
|
-
: context;
|
|
321
|
-
return { context: fullContext, nexSessionId: result.session_id };
|
|
322
|
-
}
|
|
323
|
-
function buildRegistrationPrompt() {
|
|
324
|
-
return [
|
|
325
|
-
"[Nex Memory Plugin] No API key configured. Registration is required to enable persistent memory.",
|
|
326
|
-
"",
|
|
327
|
-
"IMPORTANT: Before proceeding with the user's request, you must set up Nex memory:",
|
|
328
|
-
"1. Ask the user for their email address to register for a Nex account",
|
|
329
|
-
"2. Run: nex register --email <email>",
|
|
330
|
-
"3. Then run: nex setup",
|
|
331
|
-
"",
|
|
332
|
-
"Keep it brief — just ask for the email and register. No restart needed after registration.",
|
|
333
|
-
].join("\n");
|
|
334
|
-
}
|
|
335
|
-
function buildAuthExpiredPrompt() {
|
|
336
|
-
return [
|
|
337
|
-
"[Nex Memory Plugin] API key expired or invalid. Re-registration is required to restore persistent memory.",
|
|
338
|
-
"",
|
|
339
|
-
"IMPORTANT: Before proceeding with the user's request, you must renew the Nex API key:",
|
|
340
|
-
"1. Ask the user for their email address",
|
|
341
|
-
"2. Run: nex register --email <email>",
|
|
342
|
-
"3. Then run: nex setup",
|
|
343
|
-
"",
|
|
344
|
-
"Keep it brief — just ask for the email and register. No restart needed after registration.",
|
|
345
|
-
].join("\n");
|
|
346
|
-
}
|
|
347
|
-
// ── Helpers ─────────────────────────────────────────────────────────────
|
|
348
|
-
/** Read stdin as a string (shared across all hook scripts). */
|
|
349
|
-
export async function readStdin() {
|
|
350
|
-
const chunks = [];
|
|
351
|
-
for await (const chunk of process.stdin) {
|
|
352
|
-
chunks.push(chunk);
|
|
353
|
-
}
|
|
354
|
-
return Buffer.concat(chunks).toString("utf-8");
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Trigger compounding intelligence jobs after content ingestion.
|
|
358
|
-
* Runs consolidation, pattern detection, and playbook synthesis.
|
|
359
|
-
* Best-effort — errors are silently ignored.
|
|
360
|
-
*/
|
|
361
|
-
async function triggerCompounding(cfg) {
|
|
362
|
-
const jobs = ["consolidation", "pattern_detection", "playbook_synthesis"];
|
|
363
|
-
const url = `${cfg.baseUrl}/api/developers/v1/compounding/trigger`;
|
|
364
|
-
await Promise.allSettled(jobs.map((job) => fetch(url, {
|
|
365
|
-
method: "POST",
|
|
366
|
-
headers: { Authorization: `Bearer ${cfg.apiKey}`, "Content-Type": "application/json" },
|
|
367
|
-
body: JSON.stringify({ job_type: job, dry_run: false }),
|
|
368
|
-
signal: AbortSignal.timeout(30_000),
|
|
369
|
-
})));
|
|
370
|
-
}
|
|
371
|
-
/** Wrap output in Claude Code hookSpecificOutput format. */
|
|
372
|
-
export function claudeCodeOutput(hookEventName, additionalContext) {
|
|
373
|
-
return JSON.stringify({
|
|
374
|
-
hookSpecificOutput: {
|
|
375
|
-
hookEventName,
|
|
376
|
-
additionalContext,
|
|
377
|
-
},
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/plugin/shared.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAmBlC,MAAM,QAAQ,GAAG,IAAI,YAAY,E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Nex provides your AI agent with real-time organizational knowledge — contacts, deals, meetings, emails, notes, insights, patterns, and playbooks — via MCP tools. Context is proactively injected into your conversation, so relevant knowledge surfaces automatically even when you don't ask for it.
|
|
6
|
-
|
|
7
|
-
## MCP Tools Available
|
|
8
|
-
|
|
9
|
-
### `nex_ask` — AI-powered context query (recommended)
|
|
10
|
-
Use for natural language questions about organizational context.
|
|
11
|
-
Examples: "what's the latest on the Acme deal?", "when did I last talk to Sarah?"
|
|
12
|
-
|
|
13
|
-
### `nex_remember` — Store information
|
|
14
|
-
Save notes, observations, meeting summaries, or any text to the knowledge base.
|
|
15
|
-
Examples: "remember that John prefers email over Slack", store meeting notes
|
|
16
|
-
|
|
17
|
-
### `nex_search` — Fuzzy record lookup
|
|
18
|
-
Search CRM records (people, companies, deals) by name or keyword.
|
|
19
|
-
Use when looking up a specific named entity rather than asking a question.
|
|
20
|
-
|
|
21
|
-
### `nex_list_integrations` — Check connected data sources
|
|
22
|
-
Shows which integrations (Gmail, Slack, Calendar, CRM) are connected and active.
|
|
23
|
-
|
|
24
|
-
### `nex_connect_integration` — Connect a data source
|
|
25
|
-
Initiate OAuth connection for Gmail, Google Calendar, Outlook, Slack, Salesforce, HubSpot, or Attio.
|
|
26
|
-
|
|
27
|
-
### `nex_get_notifications` — View recent notifications
|
|
28
|
-
Check for new notifications from Nex. Shows deal changes, meeting updates, relationship insights, and custom alerts.
|
|
29
|
-
|
|
30
|
-
### `nex_set_notification_preferences` — Update notification settings
|
|
31
|
-
Change notification frequency or toggle notification types. Example: set polling to every 5 minutes.
|
|
32
|
-
|
|
33
|
-
### `nex_create_notification_rule` — Create custom notification rules
|
|
34
|
-
Set up AI-powered notification rules in natural language. Example: "notify me when deal value changes by more than 10%".
|
|
35
|
-
|
|
36
|
-
## Proactive Context
|
|
37
|
-
|
|
38
|
-
Nex automatically surfaces relevant context from the user's knowledge graph on every prompt — not just questions. When you see a `<nex-context>` block, use it naturally to inform your response:
|
|
39
|
-
|
|
40
|
-
- **Entity insights** — facts about people, companies, and deals mentioned or relevant to the task
|
|
41
|
-
- **Knowledge insights** — patterns, lessons learned, and domain knowledge from past work
|
|
42
|
-
- **Playbook rules** — proven approaches and best practices from the user's experience
|
|
43
|
-
|
|
44
|
-
Leverage this context to provide more informed, personalized responses. If the context mentions a relevant pattern or past decision, incorporate it naturally without explicitly referencing the context block.
|
|
45
|
-
|
|
46
|
-
## When to Use Nex Tools Directly
|
|
47
|
-
|
|
48
|
-
Use `nex_ask` proactively when:
|
|
49
|
-
- The user mentions a person, company, or project — look up their context
|
|
50
|
-
- The task involves a domain the knowledge graph may have insights on
|
|
51
|
-
- You need organizational context to make a better recommendation
|
|
52
|
-
|
|
53
|
-
Use `nex_remember` when:
|
|
54
|
-
- The user shares a decision, preference, or important fact worth persisting
|
|
55
|
-
- A conversation reveals new knowledge that future sessions should have access to
|
|
56
|
-
|
|
57
|
-
Always try `nex_ask` first for general queries. Use `nex_search` when you need to find a specific record by name.
|
|
58
|
-
|
|
59
|
-
# --- End Nex ---
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|