@noxsoft/mcp 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/auth.d.ts +19 -0
- package/dist/auth.js +73 -0
- package/dist/auth.js.map +1 -1
- package/dist/client.js +3 -0
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +55 -2
- package/dist/index.js.map +1 -1
- package/dist/tools/context.d.ts +2 -0
- package/dist/tools/context.js +599 -0
- package/dist/tools/context.js.map +1 -0
- package/dist/tools/email.d.ts +2 -0
- package/dist/tools/email.js +422 -0
- package/dist/tools/email.js.map +1 -0
- package/dist/tools/identity.js +68 -1
- package/dist/tools/identity.js.map +1 -1
- package/dist/tools/tasks.d.ts +2 -0
- package/dist/tools/tasks.js +390 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
import { apiRequest } from "../client.js";
|
|
2
|
+
function timeAgo(dateStr) {
|
|
3
|
+
const now = Date.now();
|
|
4
|
+
const then = new Date(dateStr).getTime();
|
|
5
|
+
const diffMs = now - then;
|
|
6
|
+
const diffMins = Math.floor(diffMs / 60000);
|
|
7
|
+
if (diffMins < 1)
|
|
8
|
+
return "just now";
|
|
9
|
+
if (diffMins < 60)
|
|
10
|
+
return `${diffMins} minute${diffMins === 1 ? "" : "s"} ago`;
|
|
11
|
+
const diffHours = Math.floor(diffMins / 60);
|
|
12
|
+
if (diffHours < 24)
|
|
13
|
+
return `${diffHours} hour${diffHours === 1 ? "" : "s"} ago`;
|
|
14
|
+
const diffDays = Math.floor(diffHours / 24);
|
|
15
|
+
return `${diffDays} day${diffDays === 1 ? "" : "s"} ago`;
|
|
16
|
+
}
|
|
17
|
+
function formatSpaceSummary(space) {
|
|
18
|
+
const visibility = (space.visibility || "private").toUpperCase();
|
|
19
|
+
const members = space.member_count ?? 0;
|
|
20
|
+
const entries = space.entry_count ?? 0;
|
|
21
|
+
const created = space.created_at ? timeAgo(space.created_at) : "—";
|
|
22
|
+
return [
|
|
23
|
+
`**${space.name}** (${visibility})`,
|
|
24
|
+
` Members: ${members} | Entries: ${entries}`,
|
|
25
|
+
` Created: ${created}`,
|
|
26
|
+
` ID: ${space.id}`,
|
|
27
|
+
].join("\n");
|
|
28
|
+
}
|
|
29
|
+
function formatMember(member) {
|
|
30
|
+
const identity = member.agent_name
|
|
31
|
+
? `@${member.agent_name}`
|
|
32
|
+
: member.user_email || "unknown";
|
|
33
|
+
const role = (member.role || "editor").toUpperCase();
|
|
34
|
+
const joined = member.joined_at ? timeAgo(member.joined_at) : "—";
|
|
35
|
+
return `- ${identity} — **${role}** (joined ${joined})`;
|
|
36
|
+
}
|
|
37
|
+
function formatEntrySummary(entry) {
|
|
38
|
+
const type = (entry.entry_type || "note").toUpperCase();
|
|
39
|
+
const pinned = entry.pinned ? " [PINNED]" : "";
|
|
40
|
+
const author = entry.author_agent_name
|
|
41
|
+
? `@${entry.author_agent_name}`
|
|
42
|
+
: entry.author_user_email || "unknown";
|
|
43
|
+
const labels = entry.labels && entry.labels.length ? entry.labels.join(", ") : "—";
|
|
44
|
+
const created = entry.created_at ? timeAgo(entry.created_at) : "—";
|
|
45
|
+
const comments = entry.comment_count ?? 0;
|
|
46
|
+
const title = entry.title || "(untitled)";
|
|
47
|
+
return [
|
|
48
|
+
`**[${type}]${pinned} ${title}**`,
|
|
49
|
+
` By: ${author} | Labels: ${labels}`,
|
|
50
|
+
` Comments: ${comments} | Created: ${created}`,
|
|
51
|
+
` ID: ${entry.id}`,
|
|
52
|
+
].join("\n");
|
|
53
|
+
}
|
|
54
|
+
function formatEntryDetail(entry) {
|
|
55
|
+
const type = (entry.entry_type || "note").toUpperCase();
|
|
56
|
+
const pinned = entry.pinned ? "Yes" : "No";
|
|
57
|
+
const author = entry.author_agent_name
|
|
58
|
+
? `@${entry.author_agent_name}`
|
|
59
|
+
: entry.author_user_email || "unknown";
|
|
60
|
+
const labels = entry.labels && entry.labels.length ? entry.labels.join(", ") : "—";
|
|
61
|
+
const created = entry.created_at
|
|
62
|
+
? new Date(entry.created_at).toLocaleString()
|
|
63
|
+
: "—";
|
|
64
|
+
const updated = entry.updated_at
|
|
65
|
+
? new Date(entry.updated_at).toLocaleString()
|
|
66
|
+
: "—";
|
|
67
|
+
let result = [
|
|
68
|
+
`# ${entry.title || "(untitled)"}`,
|
|
69
|
+
"",
|
|
70
|
+
`**Type:** ${type}`,
|
|
71
|
+
`**Pinned:** ${pinned}`,
|
|
72
|
+
`**Author:** ${author}`,
|
|
73
|
+
`**Labels:** ${labels}`,
|
|
74
|
+
`**Created:** ${created}`,
|
|
75
|
+
`**Updated:** ${updated}`,
|
|
76
|
+
`**ID:** ${entry.id}`,
|
|
77
|
+
].join("\n");
|
|
78
|
+
if (entry.content) {
|
|
79
|
+
result += `\n\n## Content\n\n${entry.content}`;
|
|
80
|
+
}
|
|
81
|
+
if (entry.comments && entry.comments.length > 0) {
|
|
82
|
+
result += "\n\n## Comments\n";
|
|
83
|
+
for (const comment of entry.comments) {
|
|
84
|
+
const cAuthor = comment.author_agent_name
|
|
85
|
+
? `@${comment.author_agent_name}`
|
|
86
|
+
: comment.author_user_email || "unknown";
|
|
87
|
+
const time = comment.created_at
|
|
88
|
+
? new Date(comment.created_at).toLocaleString()
|
|
89
|
+
: "—";
|
|
90
|
+
result += `\n---\n**${cAuthor}** — _${time}_\n${comment.content || ""}`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
function formatSpaceDetail(space) {
|
|
96
|
+
const visibility = (space.visibility || "private").toUpperCase();
|
|
97
|
+
const created = space.created_at
|
|
98
|
+
? new Date(space.created_at).toLocaleString()
|
|
99
|
+
: "—";
|
|
100
|
+
const updated = space.updated_at
|
|
101
|
+
? new Date(space.updated_at).toLocaleString()
|
|
102
|
+
: "—";
|
|
103
|
+
let result = [
|
|
104
|
+
`# ${space.name}`,
|
|
105
|
+
"",
|
|
106
|
+
`**Visibility:** ${visibility}`,
|
|
107
|
+
`**Description:** ${space.description || "—"}`,
|
|
108
|
+
`**Created:** ${created}`,
|
|
109
|
+
`**Updated:** ${updated}`,
|
|
110
|
+
`**ID:** ${space.id}`,
|
|
111
|
+
].join("\n");
|
|
112
|
+
if (space.members && space.members.length > 0) {
|
|
113
|
+
result += `\n\n## Members (${space.members.length})\n\n`;
|
|
114
|
+
result += space.members.map(formatMember).join("\n");
|
|
115
|
+
}
|
|
116
|
+
if (space.recent_entries && space.recent_entries.length > 0) {
|
|
117
|
+
result += `\n\n## Recent Entries (${space.recent_entries.length})\n\n`;
|
|
118
|
+
result += space.recent_entries.map(formatEntrySummary).join("\n\n");
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
result += "\n\n## Recent Entries\n\nNo entries yet.";
|
|
122
|
+
}
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
// Tool definitions
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
const tools = [
|
|
129
|
+
{
|
|
130
|
+
name: "create_context_space",
|
|
131
|
+
description: "Create a new shared context space where agents and users can collaborate on notes, context, and decisions.",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {
|
|
135
|
+
name: {
|
|
136
|
+
type: "string",
|
|
137
|
+
description: "Name of the context space.",
|
|
138
|
+
},
|
|
139
|
+
description: {
|
|
140
|
+
type: "string",
|
|
141
|
+
description: "A brief description of what this space is for.",
|
|
142
|
+
},
|
|
143
|
+
visibility: {
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "Visibility level: private (only members), shared (discoverable), or public (open to all). Default: private.",
|
|
146
|
+
enum: ["private", "shared", "public"],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
required: ["name"],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "list_context_spaces",
|
|
154
|
+
description: "List all context spaces you belong to, with member and entry counts.",
|
|
155
|
+
inputSchema: {
|
|
156
|
+
type: "object",
|
|
157
|
+
properties: {},
|
|
158
|
+
required: [],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "get_context_space",
|
|
163
|
+
description: "Get full details of a context space including its members and recent entries.",
|
|
164
|
+
inputSchema: {
|
|
165
|
+
type: "object",
|
|
166
|
+
properties: {
|
|
167
|
+
space_id: {
|
|
168
|
+
type: "string",
|
|
169
|
+
description: "Space UUID.",
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
required: ["space_id"],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "invite_to_space",
|
|
177
|
+
description: "Invite an agent or user to a context space. Provide either agent_name or user_email.",
|
|
178
|
+
inputSchema: {
|
|
179
|
+
type: "object",
|
|
180
|
+
properties: {
|
|
181
|
+
space_id: {
|
|
182
|
+
type: "string",
|
|
183
|
+
description: "Space UUID.",
|
|
184
|
+
},
|
|
185
|
+
agent_name: {
|
|
186
|
+
type: "string",
|
|
187
|
+
description: 'Agent name to invite (e.g. "sonnet", "opus").',
|
|
188
|
+
},
|
|
189
|
+
user_email: {
|
|
190
|
+
type: "string",
|
|
191
|
+
description: "User email to invite.",
|
|
192
|
+
},
|
|
193
|
+
role: {
|
|
194
|
+
type: "string",
|
|
195
|
+
description: "Role for the invitee: viewer, editor, or admin. Default: editor.",
|
|
196
|
+
enum: ["viewer", "editor", "admin"],
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
required: ["space_id"],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "add_context_entry",
|
|
204
|
+
description: "Add a note, context, decision, reference, or annotation to a context space.",
|
|
205
|
+
inputSchema: {
|
|
206
|
+
type: "object",
|
|
207
|
+
properties: {
|
|
208
|
+
space_id: {
|
|
209
|
+
type: "string",
|
|
210
|
+
description: "Space UUID.",
|
|
211
|
+
},
|
|
212
|
+
content: {
|
|
213
|
+
type: "string",
|
|
214
|
+
description: "Entry content (supports markdown).",
|
|
215
|
+
},
|
|
216
|
+
title: {
|
|
217
|
+
type: "string",
|
|
218
|
+
description: "Optional entry title.",
|
|
219
|
+
},
|
|
220
|
+
entry_type: {
|
|
221
|
+
type: "string",
|
|
222
|
+
description: "Type of entry: note, context, decision, reference, or annotation. Default: note.",
|
|
223
|
+
enum: ["note", "context", "decision", "reference", "annotation"],
|
|
224
|
+
},
|
|
225
|
+
labels: {
|
|
226
|
+
type: "array",
|
|
227
|
+
items: { type: "string" },
|
|
228
|
+
description: "Labels/tags for categorization.",
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
required: ["space_id", "content"],
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "list_context_entries",
|
|
236
|
+
description: "List entries in a context space, optionally filtered by type.",
|
|
237
|
+
inputSchema: {
|
|
238
|
+
type: "object",
|
|
239
|
+
properties: {
|
|
240
|
+
space_id: {
|
|
241
|
+
type: "string",
|
|
242
|
+
description: "Space UUID.",
|
|
243
|
+
},
|
|
244
|
+
type: {
|
|
245
|
+
type: "string",
|
|
246
|
+
description: "Filter by entry type: note, context, decision, reference, or annotation.",
|
|
247
|
+
enum: ["note", "context", "decision", "reference", "annotation"],
|
|
248
|
+
},
|
|
249
|
+
limit: {
|
|
250
|
+
type: "number",
|
|
251
|
+
description: "Max results (default 20).",
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
required: ["space_id"],
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: "get_context_entry",
|
|
259
|
+
description: "Get full details of a context entry including its comments.",
|
|
260
|
+
inputSchema: {
|
|
261
|
+
type: "object",
|
|
262
|
+
properties: {
|
|
263
|
+
entry_id: {
|
|
264
|
+
type: "string",
|
|
265
|
+
description: "Entry UUID.",
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
required: ["entry_id"],
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "update_context_entry",
|
|
273
|
+
description: "Update a context entry's title, content, type, pinned state, or labels.",
|
|
274
|
+
inputSchema: {
|
|
275
|
+
type: "object",
|
|
276
|
+
properties: {
|
|
277
|
+
entry_id: {
|
|
278
|
+
type: "string",
|
|
279
|
+
description: "Entry UUID.",
|
|
280
|
+
},
|
|
281
|
+
title: {
|
|
282
|
+
type: "string",
|
|
283
|
+
description: "New title.",
|
|
284
|
+
},
|
|
285
|
+
content: {
|
|
286
|
+
type: "string",
|
|
287
|
+
description: "New content.",
|
|
288
|
+
},
|
|
289
|
+
entry_type: {
|
|
290
|
+
type: "string",
|
|
291
|
+
description: "New type: note, context, decision, reference, or annotation.",
|
|
292
|
+
enum: ["note", "context", "decision", "reference", "annotation"],
|
|
293
|
+
},
|
|
294
|
+
pinned: {
|
|
295
|
+
type: "boolean",
|
|
296
|
+
description: "Pin or unpin the entry.",
|
|
297
|
+
},
|
|
298
|
+
labels: {
|
|
299
|
+
type: "array",
|
|
300
|
+
items: { type: "string" },
|
|
301
|
+
description: "New labels.",
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
required: ["entry_id"],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "add_context_comment",
|
|
309
|
+
description: "Add a comment to a context entry. Use for discussion, feedback, or follow-ups.",
|
|
310
|
+
inputSchema: {
|
|
311
|
+
type: "object",
|
|
312
|
+
properties: {
|
|
313
|
+
entry_id: {
|
|
314
|
+
type: "string",
|
|
315
|
+
description: "Entry UUID.",
|
|
316
|
+
},
|
|
317
|
+
content: {
|
|
318
|
+
type: "string",
|
|
319
|
+
description: "Comment text (supports markdown).",
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
required: ["entry_id", "content"],
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "search_context",
|
|
327
|
+
description: "Search across context entries in your spaces by matching query text against titles and content. Optionally narrow to a specific space.",
|
|
328
|
+
inputSchema: {
|
|
329
|
+
type: "object",
|
|
330
|
+
properties: {
|
|
331
|
+
query: {
|
|
332
|
+
type: "string",
|
|
333
|
+
description: "Search query to match against entry titles and content.",
|
|
334
|
+
},
|
|
335
|
+
space_id: {
|
|
336
|
+
type: "string",
|
|
337
|
+
description: "Optional space UUID to narrow the search.",
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
required: ["query"],
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
];
|
|
344
|
+
// ---------------------------------------------------------------------------
|
|
345
|
+
// Handler
|
|
346
|
+
// ---------------------------------------------------------------------------
|
|
347
|
+
async function handle(name, args) {
|
|
348
|
+
switch (name) {
|
|
349
|
+
// ----- create_context_space -----
|
|
350
|
+
case "create_context_space": {
|
|
351
|
+
const body = { name: args.name };
|
|
352
|
+
if (args.description !== undefined)
|
|
353
|
+
body.description = args.description;
|
|
354
|
+
if (args.visibility !== undefined)
|
|
355
|
+
body.visibility = args.visibility;
|
|
356
|
+
const res = await apiRequest("cntx", "POST", "/api/spaces", { body });
|
|
357
|
+
if (!res.ok)
|
|
358
|
+
return JSON.stringify(res.data);
|
|
359
|
+
const space = res.data;
|
|
360
|
+
const visibility = (space.visibility || "private").toUpperCase();
|
|
361
|
+
return [
|
|
362
|
+
`Context space created.`,
|
|
363
|
+
`- **Name:** ${space.name}`,
|
|
364
|
+
`- **ID:** ${space.id}`,
|
|
365
|
+
`- **Visibility:** ${visibility}`,
|
|
366
|
+
space.description ? `- **Description:** ${space.description}` : null,
|
|
367
|
+
]
|
|
368
|
+
.filter(Boolean)
|
|
369
|
+
.join("\n");
|
|
370
|
+
}
|
|
371
|
+
// ----- list_context_spaces -----
|
|
372
|
+
case "list_context_spaces": {
|
|
373
|
+
const res = await apiRequest("cntx", "GET", "/api/spaces");
|
|
374
|
+
if (!res.ok)
|
|
375
|
+
return JSON.stringify(res.data);
|
|
376
|
+
const data = res.data;
|
|
377
|
+
const spaces = Array.isArray(data)
|
|
378
|
+
? data
|
|
379
|
+
: Array.isArray(data.spaces)
|
|
380
|
+
? data.spaces
|
|
381
|
+
: Array.isArray(data.data)
|
|
382
|
+
? data.data
|
|
383
|
+
: [];
|
|
384
|
+
if (!spaces.length)
|
|
385
|
+
return "No context spaces found.";
|
|
386
|
+
return spaces.map(formatSpaceSummary).join("\n\n");
|
|
387
|
+
}
|
|
388
|
+
// ----- get_context_space -----
|
|
389
|
+
case "get_context_space": {
|
|
390
|
+
const spaceId = args.space_id;
|
|
391
|
+
const res = await apiRequest("cntx", "GET", `/api/spaces/${spaceId}`);
|
|
392
|
+
if (!res.ok)
|
|
393
|
+
return JSON.stringify(res.data);
|
|
394
|
+
const data = res.data;
|
|
395
|
+
const space = data.space || data;
|
|
396
|
+
return formatSpaceDetail(space);
|
|
397
|
+
}
|
|
398
|
+
// ----- invite_to_space -----
|
|
399
|
+
case "invite_to_space": {
|
|
400
|
+
const spaceId = args.space_id;
|
|
401
|
+
const body = {};
|
|
402
|
+
if (args.agent_name !== undefined)
|
|
403
|
+
body.agent_name = args.agent_name;
|
|
404
|
+
if (args.user_email !== undefined)
|
|
405
|
+
body.user_email = args.user_email;
|
|
406
|
+
if (args.role !== undefined)
|
|
407
|
+
body.role = args.role;
|
|
408
|
+
const res = await apiRequest("cntx", "POST", `/api/spaces/${spaceId}/members`, { body });
|
|
409
|
+
if (!res.ok)
|
|
410
|
+
return JSON.stringify(res.data);
|
|
411
|
+
const member = res.data;
|
|
412
|
+
const identity = member.agent_name
|
|
413
|
+
? `@${member.agent_name}`
|
|
414
|
+
: member.user_email || (args.agent_name ? `@${args.agent_name}` : args.user_email || "member");
|
|
415
|
+
const role = (member.role || args.role || "editor").toUpperCase();
|
|
416
|
+
return [
|
|
417
|
+
`Member invited.`,
|
|
418
|
+
`- **Space ID:** ${spaceId}`,
|
|
419
|
+
`- **Invited:** ${identity}`,
|
|
420
|
+
`- **Role:** ${role}`,
|
|
421
|
+
].join("\n");
|
|
422
|
+
}
|
|
423
|
+
// ----- add_context_entry -----
|
|
424
|
+
case "add_context_entry": {
|
|
425
|
+
const spaceId = args.space_id;
|
|
426
|
+
const body = { content: args.content };
|
|
427
|
+
if (args.title !== undefined)
|
|
428
|
+
body.title = args.title;
|
|
429
|
+
if (args.entry_type !== undefined)
|
|
430
|
+
body.entry_type = args.entry_type;
|
|
431
|
+
if (args.labels !== undefined)
|
|
432
|
+
body.labels = args.labels;
|
|
433
|
+
const res = await apiRequest("cntx", "POST", `/api/spaces/${spaceId}/entries`, { body });
|
|
434
|
+
if (!res.ok)
|
|
435
|
+
return JSON.stringify(res.data);
|
|
436
|
+
const entry = res.data;
|
|
437
|
+
const type = (entry.entry_type || "note").toUpperCase();
|
|
438
|
+
return [
|
|
439
|
+
`Entry added.`,
|
|
440
|
+
`- **Title:** ${entry.title || "(untitled)"}`,
|
|
441
|
+
`- **ID:** ${entry.id}`,
|
|
442
|
+
`- **Type:** ${type}`,
|
|
443
|
+
`- **Space ID:** ${spaceId}`,
|
|
444
|
+
entry.labels && entry.labels.length
|
|
445
|
+
? `- **Labels:** ${entry.labels.join(", ")}`
|
|
446
|
+
: null,
|
|
447
|
+
]
|
|
448
|
+
.filter(Boolean)
|
|
449
|
+
.join("\n");
|
|
450
|
+
}
|
|
451
|
+
// ----- list_context_entries -----
|
|
452
|
+
case "list_context_entries": {
|
|
453
|
+
const spaceId = args.space_id;
|
|
454
|
+
const query = {};
|
|
455
|
+
if (args.type !== undefined)
|
|
456
|
+
query.type = args.type;
|
|
457
|
+
if (args.limit !== undefined)
|
|
458
|
+
query.limit = args.limit;
|
|
459
|
+
const res = await apiRequest("cntx", "GET", `/api/spaces/${spaceId}/entries`, { query });
|
|
460
|
+
if (!res.ok)
|
|
461
|
+
return JSON.stringify(res.data);
|
|
462
|
+
const data = res.data;
|
|
463
|
+
const entries = Array.isArray(data)
|
|
464
|
+
? data
|
|
465
|
+
: Array.isArray(data.entries)
|
|
466
|
+
? data.entries
|
|
467
|
+
: Array.isArray(data.data)
|
|
468
|
+
? data.data
|
|
469
|
+
: [];
|
|
470
|
+
if (!entries.length)
|
|
471
|
+
return "No entries found in this space.";
|
|
472
|
+
return entries.map(formatEntrySummary).join("\n\n");
|
|
473
|
+
}
|
|
474
|
+
// ----- get_context_entry -----
|
|
475
|
+
case "get_context_entry": {
|
|
476
|
+
const entryId = args.entry_id;
|
|
477
|
+
const res = await apiRequest("cntx", "GET", `/api/entries/${entryId}`);
|
|
478
|
+
if (!res.ok)
|
|
479
|
+
return JSON.stringify(res.data);
|
|
480
|
+
const data = res.data;
|
|
481
|
+
const entry = data.entry || data;
|
|
482
|
+
return formatEntryDetail(entry);
|
|
483
|
+
}
|
|
484
|
+
// ----- update_context_entry -----
|
|
485
|
+
case "update_context_entry": {
|
|
486
|
+
const entryId = args.entry_id;
|
|
487
|
+
const body = {};
|
|
488
|
+
if (args.title !== undefined)
|
|
489
|
+
body.title = args.title;
|
|
490
|
+
if (args.content !== undefined)
|
|
491
|
+
body.content = args.content;
|
|
492
|
+
if (args.entry_type !== undefined)
|
|
493
|
+
body.entry_type = args.entry_type;
|
|
494
|
+
if (args.pinned !== undefined)
|
|
495
|
+
body.pinned = args.pinned;
|
|
496
|
+
if (args.labels !== undefined)
|
|
497
|
+
body.labels = args.labels;
|
|
498
|
+
const res = await apiRequest("cntx", "PATCH", `/api/entries/${entryId}`, { body });
|
|
499
|
+
if (!res.ok)
|
|
500
|
+
return JSON.stringify(res.data);
|
|
501
|
+
const entry = res.data;
|
|
502
|
+
const fields = Object.keys(body);
|
|
503
|
+
return [
|
|
504
|
+
`Entry updated.`,
|
|
505
|
+
`- **ID:** ${entry.id || entryId}`,
|
|
506
|
+
`- **Title:** ${entry.title || "(untitled)"}`,
|
|
507
|
+
`- **Updated fields:** ${fields.join(", ")}`,
|
|
508
|
+
entry.entry_type ? `- **Type:** ${entry.entry_type.toUpperCase()}` : null,
|
|
509
|
+
entry.pinned !== undefined ? `- **Pinned:** ${entry.pinned ? "Yes" : "No"}` : null,
|
|
510
|
+
]
|
|
511
|
+
.filter(Boolean)
|
|
512
|
+
.join("\n");
|
|
513
|
+
}
|
|
514
|
+
// ----- add_context_comment -----
|
|
515
|
+
case "add_context_comment": {
|
|
516
|
+
const entryId = args.entry_id;
|
|
517
|
+
const body = { content: args.content };
|
|
518
|
+
const res = await apiRequest("cntx", "POST", `/api/entries/${entryId}/comments`, { body });
|
|
519
|
+
if (!res.ok)
|
|
520
|
+
return JSON.stringify(res.data);
|
|
521
|
+
const comment = res.data;
|
|
522
|
+
const time = comment.created_at
|
|
523
|
+
? new Date(comment.created_at).toLocaleString()
|
|
524
|
+
: "—";
|
|
525
|
+
return [
|
|
526
|
+
`Comment added.`,
|
|
527
|
+
`- **Entry ID:** ${entryId}`,
|
|
528
|
+
`- **Comment ID:** ${comment.id || "—"}`,
|
|
529
|
+
`- **Created:** ${time}`,
|
|
530
|
+
].join("\n");
|
|
531
|
+
}
|
|
532
|
+
// ----- search_context -----
|
|
533
|
+
case "search_context": {
|
|
534
|
+
const queryStr = args.query.toLowerCase();
|
|
535
|
+
// If a specific space is given, search within that space.
|
|
536
|
+
// Otherwise, get all spaces and search across their entries.
|
|
537
|
+
const spaceIds = [];
|
|
538
|
+
if (args.space_id) {
|
|
539
|
+
spaceIds.push(args.space_id);
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
// Fetch all spaces to get their IDs
|
|
543
|
+
const spacesRes = await apiRequest("cntx", "GET", "/api/spaces");
|
|
544
|
+
if (!spacesRes.ok)
|
|
545
|
+
return JSON.stringify(spacesRes.data);
|
|
546
|
+
const spacesData = spacesRes.data;
|
|
547
|
+
const spaces = Array.isArray(spacesData)
|
|
548
|
+
? spacesData
|
|
549
|
+
: Array.isArray(spacesData.spaces)
|
|
550
|
+
? spacesData.spaces
|
|
551
|
+
: Array.isArray(spacesData.data)
|
|
552
|
+
? spacesData.data
|
|
553
|
+
: [];
|
|
554
|
+
for (const s of spaces) {
|
|
555
|
+
if (s.id)
|
|
556
|
+
spaceIds.push(s.id);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
if (!spaceIds.length)
|
|
560
|
+
return "No spaces to search.";
|
|
561
|
+
const matches = [];
|
|
562
|
+
for (const sid of spaceIds) {
|
|
563
|
+
const res = await apiRequest("cntx", "GET", `/api/spaces/${sid}/entries`, { query: { limit: 100 } });
|
|
564
|
+
if (!res.ok)
|
|
565
|
+
continue;
|
|
566
|
+
const data = res.data;
|
|
567
|
+
const entries = Array.isArray(data)
|
|
568
|
+
? data
|
|
569
|
+
: Array.isArray(data.entries)
|
|
570
|
+
? data.entries
|
|
571
|
+
: Array.isArray(data.data)
|
|
572
|
+
? data.data
|
|
573
|
+
: [];
|
|
574
|
+
for (const entry of entries) {
|
|
575
|
+
const titleMatch = (entry.title || "").toLowerCase().includes(queryStr);
|
|
576
|
+
const contentMatch = (entry.content || "").toLowerCase().includes(queryStr);
|
|
577
|
+
const labelMatch = (entry.labels || []).some((l) => l.toLowerCase().includes(queryStr));
|
|
578
|
+
if (titleMatch || contentMatch || labelMatch) {
|
|
579
|
+
matches.push(entry);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
if (!matches.length)
|
|
584
|
+
return `No entries matching "${args.query}" found.`;
|
|
585
|
+
return [
|
|
586
|
+
`**Search results for "${args.query}"** (${matches.length} match${matches.length === 1 ? "" : "es"})`,
|
|
587
|
+
"",
|
|
588
|
+
matches.map(formatEntrySummary).join("\n\n"),
|
|
589
|
+
].join("\n");
|
|
590
|
+
}
|
|
591
|
+
default:
|
|
592
|
+
return null;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
// ---------------------------------------------------------------------------
|
|
596
|
+
// Export
|
|
597
|
+
// ---------------------------------------------------------------------------
|
|
598
|
+
export const contextTools = { tools, handle };
|
|
599
|
+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