@gmickel/gno 0.34.0 → 0.35.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 +37 -26
- package/assets/screenshots/webui-collections.jpg +0 -0
- package/assets/screenshots/webui-graph.jpg +0 -0
- package/package.json +1 -1
- package/src/core/file-ops.ts +12 -1
- package/src/core/file-refactors.ts +180 -0
- package/src/core/note-creation.ts +137 -0
- package/src/core/note-presets.ts +183 -0
- package/src/core/sections.ts +62 -0
- package/src/core/validation.ts +4 -3
- package/src/mcp/tools/capture.ts +71 -12
- package/src/mcp/tools/index.ts +82 -1
- package/src/mcp/tools/workspace-write.ts +321 -0
- package/src/sdk/client.ts +341 -0
- package/src/sdk/types.ts +67 -0
- package/src/serve/CLAUDE.md +3 -1
- package/src/serve/browse-tree.ts +60 -12
- package/src/serve/public/app.tsx +1 -0
- package/src/serve/public/components/CaptureModal.tsx +135 -13
- package/src/serve/public/components/QuickSwitcher.tsx +228 -4
- package/src/serve/public/components/ShortcutHelpModal.tsx +54 -1
- package/src/serve/public/components/editor/MarkdownPreview.tsx +58 -26
- package/src/serve/public/hooks/useCaptureModal.tsx +31 -5
- package/src/serve/public/lib/workspace-actions.ts +226 -0
- package/src/serve/public/lib/workspace-events.ts +39 -0
- package/src/serve/public/pages/Browse.tsx +154 -3
- package/src/serve/public/pages/DocView.tsx +439 -0
- package/src/serve/public/pages/DocumentEditor.tsx +52 -0
- package/src/serve/routes/api.ts +712 -13
- package/src/serve/server.ts +74 -0
package/src/serve/server.ts
CHANGED
|
@@ -19,24 +19,30 @@ import {
|
|
|
19
19
|
handleCapabilities,
|
|
20
20
|
handleCollections,
|
|
21
21
|
handleConnectors,
|
|
22
|
+
handleCreateFolder,
|
|
22
23
|
handleCreateCollection,
|
|
23
24
|
handleCreateEditableCopy,
|
|
24
25
|
handleCreateDoc,
|
|
25
26
|
handleDeactivateDoc,
|
|
26
27
|
handleDeleteCollection,
|
|
27
28
|
handleDoc,
|
|
29
|
+
handleDocSections,
|
|
28
30
|
handleDocsAutocomplete,
|
|
29
31
|
handleDocs,
|
|
32
|
+
handleDuplicateDoc,
|
|
30
33
|
handleEmbed,
|
|
31
34
|
handleEmbedStatus,
|
|
32
35
|
handleHealth,
|
|
33
36
|
handleImportPreview,
|
|
34
37
|
handleInstallConnector,
|
|
38
|
+
handleMoveDoc,
|
|
39
|
+
handleNotePresets,
|
|
35
40
|
handleJob,
|
|
36
41
|
handleModelPull,
|
|
37
42
|
handleModelStatus,
|
|
38
43
|
handlePresets,
|
|
39
44
|
handleQuery,
|
|
45
|
+
handleRefactorPlan,
|
|
40
46
|
handleRenameDoc,
|
|
41
47
|
handleRevealDoc,
|
|
42
48
|
handleSearch,
|
|
@@ -257,6 +263,21 @@ export async function startServer(
|
|
|
257
263
|
);
|
|
258
264
|
},
|
|
259
265
|
},
|
|
266
|
+
"/api/note-presets": {
|
|
267
|
+
GET: async () =>
|
|
268
|
+
withSecurityHeaders(await handleNotePresets(), isDev),
|
|
269
|
+
},
|
|
270
|
+
"/api/folders": {
|
|
271
|
+
POST: async (req: Request) => {
|
|
272
|
+
if (!isRequestAllowed(req, port)) {
|
|
273
|
+
return withSecurityHeaders(forbiddenResponse(), isDev);
|
|
274
|
+
}
|
|
275
|
+
return withSecurityHeaders(
|
|
276
|
+
await handleCreateFolder(ctxHolder, req),
|
|
277
|
+
isDev
|
|
278
|
+
);
|
|
279
|
+
},
|
|
280
|
+
},
|
|
260
281
|
"/api/browse/tree": {
|
|
261
282
|
GET: async () =>
|
|
262
283
|
withSecurityHeaders(await handleBrowseTree(store), isDev),
|
|
@@ -290,6 +311,48 @@ export async function startServer(
|
|
|
290
311
|
);
|
|
291
312
|
},
|
|
292
313
|
},
|
|
314
|
+
"/api/docs/:id/move": {
|
|
315
|
+
POST: async (req: Request) => {
|
|
316
|
+
if (!isRequestAllowed(req, port)) {
|
|
317
|
+
return withSecurityHeaders(forbiddenResponse(), isDev);
|
|
318
|
+
}
|
|
319
|
+
const url = new URL(req.url);
|
|
320
|
+
const parts = url.pathname.split("/");
|
|
321
|
+
const id = decodeURIComponent(parts[3] || "");
|
|
322
|
+
return withSecurityHeaders(
|
|
323
|
+
await handleMoveDoc(ctxHolder, store, id, req),
|
|
324
|
+
isDev
|
|
325
|
+
);
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
"/api/docs/:id/duplicate": {
|
|
329
|
+
POST: async (req: Request) => {
|
|
330
|
+
if (!isRequestAllowed(req, port)) {
|
|
331
|
+
return withSecurityHeaders(forbiddenResponse(), isDev);
|
|
332
|
+
}
|
|
333
|
+
const url = new URL(req.url);
|
|
334
|
+
const parts = url.pathname.split("/");
|
|
335
|
+
const id = decodeURIComponent(parts[3] || "");
|
|
336
|
+
return withSecurityHeaders(
|
|
337
|
+
await handleDuplicateDoc(ctxHolder, store, id, req),
|
|
338
|
+
isDev
|
|
339
|
+
);
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
"/api/docs/:id/refactor-plan": {
|
|
343
|
+
POST: async (req: Request) => {
|
|
344
|
+
if (!isRequestAllowed(req, port)) {
|
|
345
|
+
return withSecurityHeaders(forbiddenResponse(), isDev);
|
|
346
|
+
}
|
|
347
|
+
const url = new URL(req.url);
|
|
348
|
+
const parts = url.pathname.split("/");
|
|
349
|
+
const id = decodeURIComponent(parts[3] || "");
|
|
350
|
+
return withSecurityHeaders(
|
|
351
|
+
await handleRefactorPlan(ctxHolder, store, id, req),
|
|
352
|
+
isDev
|
|
353
|
+
);
|
|
354
|
+
},
|
|
355
|
+
},
|
|
293
356
|
"/api/docs/:id/trash": {
|
|
294
357
|
POST: async (req: Request) => {
|
|
295
358
|
if (!isRequestAllowed(req, port)) {
|
|
@@ -479,6 +542,17 @@ export async function startServer(
|
|
|
479
542
|
);
|
|
480
543
|
},
|
|
481
544
|
},
|
|
545
|
+
"/api/doc/:id/sections": {
|
|
546
|
+
GET: async (req: Request) => {
|
|
547
|
+
const url = new URL(req.url);
|
|
548
|
+
const parts = url.pathname.split("/");
|
|
549
|
+
const id = decodeURIComponent(parts[3] || "");
|
|
550
|
+
return withSecurityHeaders(
|
|
551
|
+
await handleDocSections(store, id, req),
|
|
552
|
+
isDev
|
|
553
|
+
);
|
|
554
|
+
},
|
|
555
|
+
},
|
|
482
556
|
"/api/doc/:id/backlinks": {
|
|
483
557
|
GET: async (req: Request) => {
|
|
484
558
|
const url = new URL(req.url);
|