paperclip-plugin-supermemory-otomatik 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/manifest.js +1 -1
- package/dist/manifest.js.map +1 -1
- package/dist/ui/index.js +115 -36
- package/dist/ui/index.js.map +2 -2
- package/dist/worker.js +33172 -37
- package/dist/worker.js.map +4 -4
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ The plugin uses Paperclip's standard plugin slots (`settingsPage`, `page`, `side
|
|
|
13
13
|
|
|
14
14
|
## Install from Paperclip
|
|
15
15
|
|
|
16
|
-
Package: [`paperclip-plugin-supermemory-otomatik`](https://www.npmjs.com/package/paperclip-plugin-supermemory-otomatik) **0.2.
|
|
16
|
+
Package: [`paperclip-plugin-supermemory-otomatik`](https://www.npmjs.com/package/paperclip-plugin-supermemory-otomatik) **0.2.9**.
|
|
17
17
|
|
|
18
18
|
1. In Paperclip, open **Settings → Plugins → Install Plugin**.
|
|
19
19
|
2. Enter `paperclip-plugin-supermemory-otomatik` and install it for the instance.
|
|
@@ -50,7 +50,7 @@ For project namespaces, select only agents who already have project access in Pa
|
|
|
50
50
|
|
|
51
51
|
## Memory content types
|
|
52
52
|
|
|
53
|
-
The page mirrors the Instructions layout: left content list, **Leggi / Modifica / Raw**, text editing, drag-and-drop and file upload. It supports:
|
|
53
|
+
The page mirrors the Instructions layout: left content list, **Leggi / Modifica / Raw**, text editing, drag-and-drop and file upload. The workspace fits the available Paperclip window; long documents scroll inside their content panel. It supports:
|
|
54
54
|
|
|
55
55
|
- Text files: TXT, Markdown, HTML, JSON and CSV (up to 1 MB).
|
|
56
56
|
- Public web URLs. Supermemory Local needs its Firecrawl integration configured; URL extraction sends the URL/page to Firecrawl.
|
|
@@ -58,6 +58,8 @@ The page mirrors the Instructions layout: left content list, **Leggi / Modifica
|
|
|
58
58
|
|
|
59
59
|
Text and URL content can be edited and reindexed. Binary file contents cannot be retrieved into the editor; delete the catalog item and upload a replacement to update one. Office, audio and video formats appear in some hosted Supermemory documentation but are not documented for the installed Supermemory Local server, so this plugin does not offer them as verified Local formats.
|
|
60
60
|
|
|
61
|
+
PDFs are also text-extracted locally in the Paperclip worker and sent to Supermemory as linked text documents. This provides searchable content even when the Local binary PDF OCR provider cannot process a file. Existing PDFs uploaded before this feature can be reindexed from their document card by selecting the same PDF file; this adds the extracted text without uploading a duplicate binary. Deleting a PDF removes both its binary source and all linked extracted-text documents from Supermemory.
|
|
62
|
+
|
|
61
63
|
The content is indexed as retrieval/reference material (`taskType: "superrag"`) rather than used to update a personal profile. Text, URL, file, search, update, and delete requests all pass through the ACL gateway. The plugin sends file bytes as JSON/base64 through Paperclip; the gateway converts them to multipart before forwarding them to Local. Supermemory returns an asynchronous status; `queued` means indexing has started, not finished.
|
|
62
64
|
|
|
63
65
|
## Tools
|
package/dist/manifest.js
CHANGED
|
@@ -9,7 +9,7 @@ var MEMORY_ROUTE = "memory";
|
|
|
9
9
|
var manifest = {
|
|
10
10
|
id: PLUGIN_ID,
|
|
11
11
|
apiVersion: 1,
|
|
12
|
-
version: "0.2.
|
|
12
|
+
version: "0.2.9",
|
|
13
13
|
minimumHostVersion: "2026.1023.0",
|
|
14
14
|
displayName: "Supermemory (self-hosted)",
|
|
15
15
|
description: "Memory tools and an Owner-managed memory library for self-hosted Supermemory, with company-, agent-, and project-scoped access.",
|
package/dist/manifest.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/manifest.ts"],
|
|
4
|
-
"sourcesContent": ["import type { PaperclipPluginManifestV1 } from \"@paperclipai/plugin-sdk\";\n\nexport const PLUGIN_ID = \"paperclipai.supermemory\";\nexport const SEARCH_TOOL = \"search-approved-memory\";\nexport const SAVE_TOOL = \"submit-memory-candidate\";\nexport const MEMORY_SETTINGS_PAGE = \"supermemory-settings\";\nexport const MEMORY_PAGE = \"supermemory-memory\";\nexport const MEMORY_SIDEBAR = \"supermemory-sidebar\";\nexport const MEMORY_ROUTE = \"memory\";\n\nconst manifest: PaperclipPluginManifestV1 = {\n id: PLUGIN_ID,\n apiVersion: 1,\n version: \"0.2.
|
|
4
|
+
"sourcesContent": ["import type { PaperclipPluginManifestV1 } from \"@paperclipai/plugin-sdk\";\n\nexport const PLUGIN_ID = \"paperclipai.supermemory\";\nexport const SEARCH_TOOL = \"search-approved-memory\";\nexport const SAVE_TOOL = \"submit-memory-candidate\";\nexport const MEMORY_SETTINGS_PAGE = \"supermemory-settings\";\nexport const MEMORY_PAGE = \"supermemory-memory\";\nexport const MEMORY_SIDEBAR = \"supermemory-sidebar\";\nexport const MEMORY_ROUTE = \"memory\";\n\nconst manifest: PaperclipPluginManifestV1 = {\n id: PLUGIN_ID,\n apiVersion: 1,\n version: \"0.2.9\",\n minimumHostVersion: \"2026.1023.0\",\n displayName: \"Supermemory (self-hosted)\",\n description: \"Memory tools and an Owner-managed memory library for self-hosted Supermemory, with company-, agent-, and project-scoped access.\",\n author: \"Otomatik\",\n categories: [\"connector\", \"automation\", \"ui\"],\n capabilities: [\n \"agent.tools.register\",\n \"agents.read\",\n \"projects.read\",\n \"access.members.read\",\n \"http.outbound\",\n \"instance.settings.register\",\n \"secrets.read-ref\",\n \"ui.page.register\",\n \"ui.sidebar.register\",\n ],\n entrypoints: {\n worker: \"./dist/worker.js\",\n ui: \"./dist/ui\",\n },\n instanceConfigSchema: {\n type: \"object\",\n properties: {\n gatewayUrl: {\n type: \"string\",\n title: \"Gateway Supermemory su Tailscale HTTPS\",\n description: \"URL HTTPS tailnet del gateway ACL e delle operazioni Owner. Esempio OTOMATIK: https://otomatik.tail77a9ab.ts.net:18443/mcp. Supermemory Local resta privato sul server.\",\n default: \"https://otomatik.tail77a9ab.ts.net:18443/mcp\",\n },\n localApiUrl: {\n type: \"string\",\n title: \"Legacy Supermemory Local API URL\",\n description: \"Legacy value retained for existing configurations; ignored since plugin 0.2.3. The Local API is reached only by the server-side gateway.\",\n },\n adminApiKeyRef: {\n // Paperclip persists a secret-ref format as an object binding, even\n // though the format marker historically describes a string picker.\n type: [\"string\", \"object\"],\n format: \"secret-ref\",\n title: \"Secret con la chiave master Supermemory Local\",\n description: \"Usata come credenziale per le route Owner del gateway Tailscale. Viene risolta solo dopo il controllo Owner o per una ricerca con namespace assegnato esplicitamente; non viene esposta nei prompt.\",\n },\n agentGrants: {\n type: \"array\",\n title: \"Authorized agents\",\n description: \"Only listed Paperclip agents can use the memory tools. Each one uses its own ACL gateway token secret, already bound to the same agent, company, and role.\",\n items: {\n type: \"object\",\n title: \"Agent grant\",\n required: [\"agentId\", \"tokenRef\"],\n properties: {\n agentId: {\n type: \"string\",\n title: \"Paperclip agent\",\n minLength: 1,\n },\n tokenRef: {\n type: [\"string\", \"object\"],\n format: \"secret-ref\",\n title: \"This agent's ACL token secret\",\n description: \"Select the Paperclip company secret containing only this agent's Supermemory ACL token.\",\n },\n },\n },\n default: [],\n },\n },\n },\n tools: [\n {\n name: SEARCH_TOOL,\n displayName: \"Search approved Supermemory\",\n description: \"Search this agent's explicitly authorized company/team compartments and any assigned agent/project namespaces. Project memory is available only when the Paperclip run is in that project and the agent is on its explicit allowlist. Do not search for credentials or personal records.\",\n parametersSchema: {\n type: \"object\",\n properties: {\n query: { type: \"string\", minLength: 1, maxLength: 300 },\n searchMode: { type: \"string\", enum: [\"hybrid\", \"memories\", \"chunks\"], default: \"hybrid\" },\n limit: { type: \"integer\", minimum: 1, maximum: 5, default: 3 },\n },\n required: [\"query\"],\n additionalProperties: false,\n },\n },\n {\n name: SAVE_TOOL,\n displayName: \"Submit a Supermemory candidate\",\n description: \"Submit one durable, non-sensitive fact or decision to this agent's role staging compartment for human review. This does not publish it to shared approved memory. Never submit credentials, personal data, customer cases, legal/health/workplace records, or full chat transcripts.\",\n parametersSchema: {\n type: \"object\",\n properties: {\n content: { type: \"string\", minLength: 20, maxLength: 1200 },\n },\n required: [\"content\"],\n additionalProperties: false,\n },\n },\n ],\n ui: {\n slots: [\n {\n type: \"settingsPage\",\n id: MEMORY_SETTINGS_PAGE,\n displayName: \"Supermemory settings\",\n exportName: \"SupermemorySettingsPage\",\n },\n {\n type: \"page\",\n id: MEMORY_PAGE,\n displayName: \"Memory\",\n exportName: \"MemoryPage\",\n routePath: MEMORY_ROUTE,\n },\n {\n type: \"sidebar\",\n id: MEMORY_SIDEBAR,\n displayName: \"Memory\",\n exportName: \"MemorySidebarLink\",\n },\n ],\n },\n};\n\nexport default manifest;\n"],
|
|
5
5
|
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/ui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/ui/index.tsx
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
3
|
import {
|
|
4
4
|
MarkdownBlock,
|
|
5
5
|
useHostContext,
|
|
@@ -273,8 +273,11 @@ function MemoryPage() {
|
|
|
273
273
|
const readDocument = usePluginAction("memory-document-read");
|
|
274
274
|
const saveText = usePluginAction("memory-text-save");
|
|
275
275
|
const uploadFile = usePluginAction("memory-file-upload");
|
|
276
|
+
const reindexPdfText = usePluginAction("memory-file-reindex-text");
|
|
276
277
|
const deleteDocument = usePluginAction("memory-document-delete");
|
|
277
278
|
const navigation = useHostNavigation();
|
|
279
|
+
const pageRef = useRef(null);
|
|
280
|
+
const [pageHeight, setPageHeight] = useState(null);
|
|
278
281
|
const [catalog, setCatalog] = useState(null);
|
|
279
282
|
const [loading, setLoading] = useState(true);
|
|
280
283
|
const [error, setError] = useState(null);
|
|
@@ -293,6 +296,28 @@ function MemoryPage() {
|
|
|
293
296
|
const [showAssignment, setShowAssignment] = useState(false);
|
|
294
297
|
const [showUrlForm, setShowUrlForm] = useState(false);
|
|
295
298
|
const [urlInput, setUrlInput] = useState("");
|
|
299
|
+
useLayoutEffect(() => {
|
|
300
|
+
const measure = () => {
|
|
301
|
+
const page = pageRef.current;
|
|
302
|
+
if (!page) return;
|
|
303
|
+
const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
|
|
304
|
+
const top = Math.max(0, page.getBoundingClientRect().top);
|
|
305
|
+
const available = Math.max(360, Math.floor(viewportHeight - top - 16));
|
|
306
|
+
setPageHeight((current) => current === null || Math.abs(current - available) > 1 ? available : current);
|
|
307
|
+
};
|
|
308
|
+
measure();
|
|
309
|
+
window.addEventListener("resize", measure);
|
|
310
|
+
window.addEventListener("scroll", measure, true);
|
|
311
|
+
window.visualViewport?.addEventListener("resize", measure);
|
|
312
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
313
|
+
if (pageRef.current?.parentElement) observer?.observe(pageRef.current.parentElement);
|
|
314
|
+
return () => {
|
|
315
|
+
window.removeEventListener("resize", measure);
|
|
316
|
+
window.removeEventListener("scroll", measure, true);
|
|
317
|
+
window.visualViewport?.removeEventListener("resize", measure);
|
|
318
|
+
observer?.disconnect();
|
|
319
|
+
};
|
|
320
|
+
}, []);
|
|
296
321
|
const refreshCatalog = useCallback(async (keepAssignmentId) => {
|
|
297
322
|
if (!companyId) return;
|
|
298
323
|
const data = await loadCatalog({ companyId });
|
|
@@ -433,6 +458,40 @@ function MemoryPage() {
|
|
|
433
458
|
setBusy(false);
|
|
434
459
|
}
|
|
435
460
|
}
|
|
461
|
+
async function reindexExistingPdf(file) {
|
|
462
|
+
if (!companyId || !activeAssignment || !document || document.kind !== "file") {
|
|
463
|
+
setError("Seleziona prima il PDF da reindicizzare.");
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
if (file.name !== (document.fileName ?? document.title) || file.type !== "application/pdf") {
|
|
467
|
+
setError("Seleziona lo stesso PDF gi\xE0 presente nella libreria.");
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
if (file.size > BINARY_MAX_BYTES) {
|
|
471
|
+
setError("Il PDF non pu\xF2 superare 6 MiB tramite il bridge Paperclip.");
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
setBusy(true);
|
|
475
|
+
setError(null);
|
|
476
|
+
try {
|
|
477
|
+
const base64 = await readAsBase64(file);
|
|
478
|
+
const result = await reindexPdfText({ companyId, assignmentId: activeAssignment.id, documentId: document.id, fileName: file.name, mimeType: file.type, base64 });
|
|
479
|
+
await refreshCatalog(activeAssignment.id);
|
|
480
|
+
setDocument((current) => current?.id === result.document.id ? { ...current, ...result.document } : result.document);
|
|
481
|
+
toast({ tone: "success", title: "Testo PDF indicizzato", body: "L\u2019estratto testuale \xE8 collegato al documento esistente e ricercabile in Supermemory." });
|
|
482
|
+
} catch (cause) {
|
|
483
|
+
const message = displayError(cause);
|
|
484
|
+
setError(message);
|
|
485
|
+
toast({ tone: "error", title: "Reindicizzazione non riuscita", body: message });
|
|
486
|
+
} finally {
|
|
487
|
+
setBusy(false);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
function onReindexPdfChange(event) {
|
|
491
|
+
const file = event.target.files?.[0];
|
|
492
|
+
if (file) void reindexExistingPdf(file);
|
|
493
|
+
event.target.value = "";
|
|
494
|
+
}
|
|
436
495
|
function onFilesChange(event) {
|
|
437
496
|
const file = event.target.files?.[0];
|
|
438
497
|
if (file) void handleFile(file);
|
|
@@ -538,8 +597,8 @@ function MemoryPage() {
|
|
|
538
597
|
/* @__PURE__ */ jsx("span", { style: mutedStyle, children: "I documenti e le assegnazioni non sono visibili agli altri membri dell\u2019organizzazione." })
|
|
539
598
|
] })
|
|
540
599
|
] });
|
|
541
|
-
return /* @__PURE__ */ jsxs("main", { style: pageStyle, children: [
|
|
542
|
-
/* @__PURE__ */ jsxs("header", { style: { display: "flex", alignItems: "start", justifyContent: "space-between", gap: 16, marginBottom: 20 }, children: [
|
|
600
|
+
return /* @__PURE__ */ jsxs("main", { ref: pageRef, style: { ...pageStyle, boxSizing: "border-box", height: pageHeight ?? "calc(100vh - 160px)", minHeight: 0, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
|
|
601
|
+
/* @__PURE__ */ jsxs("header", { style: { display: "flex", alignItems: "start", justifyContent: "space-between", gap: 16, marginBottom: 20, flexShrink: 0 }, children: [
|
|
543
602
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
544
603
|
/* @__PURE__ */ jsx("h1", { style: { fontSize: 26, fontWeight: 650, margin: 0 }, children: "Memory" }),
|
|
545
604
|
/* @__PURE__ */ jsx("p", { style: { ...mutedStyle, margin: "6px 0 0", maxWidth: 760 }, children: "Gestisci namespace e contenuti Supermemory per questa organizzazione. Questa libreria \xE8 visibile solo agli Owner." })
|
|
@@ -559,12 +618,12 @@ function MemoryPage() {
|
|
|
559
618
|
/* @__PURE__ */ jsx("a", { ...navigation.linkProps("/company/settings/instance/plugins/paperclipai.supermemory"), style: { ...secondaryButtonStyle, textDecoration: "none" }, children: "Configurazione" })
|
|
560
619
|
] })
|
|
561
620
|
] }),
|
|
562
|
-
error ? /* @__PURE__ */ jsx("div", { role: "alert", style: { ...panelStyle, padding: 12, marginBottom: 16, borderColor: "var(--destructive, #b91c1c)" }, children: error }) : null,
|
|
563
|
-
!catalog?.configured ? /* @__PURE__ */ jsxs("div", { style: { ...panelStyle, padding: 14, marginBottom: 16 }, children: [
|
|
621
|
+
error ? /* @__PURE__ */ jsx("div", { role: "alert", style: { ...panelStyle, padding: 12, marginBottom: 16, borderColor: "var(--destructive, #b91c1c)", flexShrink: 0 }, children: error }) : null,
|
|
622
|
+
!catalog?.configured ? /* @__PURE__ */ jsxs("div", { style: { ...panelStyle, padding: 14, marginBottom: 16, flexShrink: 0 }, children: [
|
|
564
623
|
/* @__PURE__ */ jsx("strong", { children: "Chiave master non configurata." }),
|
|
565
624
|
/* @__PURE__ */ jsx("span", { style: { ...mutedStyle, marginLeft: 6 }, children: "Le assegnazioni saranno salvate, ma l\u2019indicizzazione e la ricerca nei namespace restano disattivate finch\xE9 non selezioni il secret Supermemory Local nella configurazione del plugin." })
|
|
566
625
|
] }) : null,
|
|
567
|
-
showAssignment ? /* @__PURE__ */ jsxs("form", { onSubmit: saveAssignmentForm, style: { ...panelStyle, padding: 18, display: "grid", gap: 13, marginBottom: 18 }, children: [
|
|
626
|
+
showAssignment ? /* @__PURE__ */ jsxs("form", { onSubmit: saveAssignmentForm, style: { ...panelStyle, padding: 18, display: "grid", gap: 13, marginBottom: 18, maxHeight: "min(38vh, 340px)", overflowY: "auto", flexShrink: 0 }, children: [
|
|
568
627
|
/* @__PURE__ */ jsx("h2", { style: { fontSize: 17, margin: 0 }, children: editingAssignmentId ? "Modifica assegnazione del namespace" : "Assegna un namespace" }),
|
|
569
628
|
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "minmax(160px, 220px) minmax(220px, 1fr)", gap: 12 }, children: [
|
|
570
629
|
/* @__PURE__ */ jsxs("label", { style: { display: "grid", gap: 6, fontSize: 13 }, children: [
|
|
@@ -607,14 +666,14 @@ function MemoryPage() {
|
|
|
607
666
|
}, children: "Annulla" })
|
|
608
667
|
] })
|
|
609
668
|
] }) : null,
|
|
610
|
-
/* @__PURE__ */ jsxs("section", { style: { display: "grid", gridTemplateColumns: "minmax(230px, 285px) minmax(0, 1fr)", gap: 18, minHeight:
|
|
611
|
-
/* @__PURE__ */ jsxs("aside", { style: { ...panelStyle, padding: 14, display: "flex", flexDirection: "column", minWidth: 0 }, children: [
|
|
669
|
+
/* @__PURE__ */ jsxs("section", { style: { display: "grid", gridTemplateColumns: "minmax(230px, 285px) minmax(0, 1fr)", gap: 18, flex: 1, minHeight: 0, overflow: "hidden" }, children: [
|
|
670
|
+
/* @__PURE__ */ jsxs("aside", { style: { ...panelStyle, padding: 14, display: "flex", flexDirection: "column", minWidth: 0, minHeight: 0, overflow: "hidden" }, children: [
|
|
612
671
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 10 }, children: [
|
|
613
672
|
/* @__PURE__ */ jsx("h2", { style: { fontSize: 15, margin: 0 }, children: "Namespace e file" }),
|
|
614
673
|
/* @__PURE__ */ jsx("span", { style: { ...mutedStyle, fontSize: 12 }, children: catalog?.assignments.length ?? 0 })
|
|
615
674
|
] }),
|
|
616
675
|
!catalog?.assignments.length ? /* @__PURE__ */ jsx("div", { style: { ...mutedStyle, fontSize: 13, padding: "12px 2px" }, children: "Nessun namespace. Usa \u201CAssegna namespace\u201D per iniziare." }) : null,
|
|
617
|
-
/* @__PURE__ */ jsx("div", { style: { display: "
|
|
676
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 12, flex: 1, minHeight: 0, overflowY: "auto" }, children: (catalog?.assignments ?? []).map((assignment) => {
|
|
618
677
|
const docs = catalog?.documents.filter((item) => item.assignmentId === assignment.id) ?? [];
|
|
619
678
|
const selected = assignment.id === activeAssignmentId;
|
|
620
679
|
return /* @__PURE__ */ jsxs("div", { style: { border: `1px solid ${selected ? "var(--ring, var(--primary))" : "var(--border)"}`, borderRadius: 8, overflow: "hidden" }, children: [
|
|
@@ -651,7 +710,7 @@ function MemoryPage() {
|
|
|
651
710
|
] })
|
|
652
711
|
] }) : null
|
|
653
712
|
] }),
|
|
654
|
-
/* @__PURE__ */ jsxs("section", { style: { ...panelStyle, minWidth: 0, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
|
|
713
|
+
/* @__PURE__ */ jsxs("section", { style: { ...panelStyle, minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
|
|
655
714
|
/* @__PURE__ */ jsxs("div", { onDragOver: (event) => event.preventDefault(), onDrop, style: { padding: 16, borderBottom: "1px solid var(--border)", display: "flex", justifyContent: "space-between", alignItems: "start", gap: 14, flexWrap: "wrap" }, children: [
|
|
656
715
|
/* @__PURE__ */ jsxs("div", { style: { minWidth: 0, flex: "1 1 280px" }, children: [
|
|
657
716
|
/* @__PURE__ */ jsx("h2", { style: { fontSize: 16, margin: 0 }, children: activeAssignment?.label ?? "Seleziona un namespace" }),
|
|
@@ -677,36 +736,56 @@ function MemoryPage() {
|
|
|
677
736
|
/* @__PURE__ */ jsx("strong", { children: "Trascina qui un file" }),
|
|
678
737
|
/* @__PURE__ */ jsx("p", { style: { ...mutedStyle, fontSize: 13, lineHeight: 1.55 }, children: "Testo: TXT, Markdown, HTML, JSON e CSV (max 1 MB). File binari verificati per Supermemory Local: PDF, PNG, JPG/JPEG, GIF e WebP (max 6 MiB in questa interfaccia). Puoi anche aggiungere un URL pubblico." }),
|
|
679
738
|
/* @__PURE__ */ jsx("span", { style: { ...mutedStyle, fontSize: 12 }, children: "Office, audio e video sono supportati da alcune versioni del servizio hosted, ma non sono documentati per il server Local installato." })
|
|
680
|
-
] }) }) : /* @__PURE__ */ jsxs("div", { style: { flex: 1, minHeight:
|
|
681
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "minmax(0, 1fr) auto", gap: 12, alignItems: "end" }, children: [
|
|
739
|
+
] }) }) : /* @__PURE__ */ jsxs("div", { style: { flex: 1, minHeight: 0, padding: 18, display: "flex", flexDirection: "column", gap: 14, overflow: "hidden" }, children: [
|
|
740
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "minmax(0, 1fr) auto", gap: 12, alignItems: "end", flexShrink: 0 }, children: [
|
|
682
741
|
/* @__PURE__ */ jsxs("label", { style: { display: "grid", gap: 6, fontSize: 12 }, children: [
|
|
683
742
|
"Titolo",
|
|
684
743
|
/* @__PURE__ */ jsx("input", { style: inputStyle, value: title, readOnly: mode === "read" || mode === "raw" || document.kind === "file", onChange: (event) => editField(setTitle, event.target.value) })
|
|
685
744
|
] }),
|
|
686
|
-
/* @__PURE__ */ jsx("span", { style: { ...mutedStyle, fontSize: 11, whiteSpace: "nowrap" }, children: document.status === "done" ? "Indicizzato" : `Stato: ${document.status}` })
|
|
745
|
+
/* @__PURE__ */ jsx("span", { style: { ...mutedStyle, fontSize: 11, whiteSpace: "nowrap" }, children: document.kind === "file" && document.indexedTextDocumentIds?.length ? `Testo: ${document.indexedTextStatus ?? document.status}` : document.status === "done" ? "Indicizzato" : `Stato: ${document.status}` })
|
|
687
746
|
] }),
|
|
688
|
-
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
|
|
691
|
-
"
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
747
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, minHeight: 0, overflow: "auto", display: mode === "edit" && document.kind !== "file" ? "flex" : "block" }, children: [
|
|
748
|
+
mode === "read" ? document.kind === "file" ? /* @__PURE__ */ jsxs("div", { style: { ...panelStyle, padding: 18 }, children: [
|
|
749
|
+
/* @__PURE__ */ jsx("strong", { children: document.indexedTextDocumentIds?.length ? "PDF ricevuto e testo estratto" : "File PDF conservato da Supermemory" }),
|
|
750
|
+
/* @__PURE__ */ jsxs("p", { style: { ...mutedStyle, marginBottom: 12 }, children: [
|
|
751
|
+
"Nome: ",
|
|
752
|
+
document.fileName ?? document.title,
|
|
753
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
754
|
+
"Tipo: ",
|
|
755
|
+
document.mimeType ?? "non specificato",
|
|
756
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
757
|
+
document.indexedTextDocumentIds?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
758
|
+
"Testo estratto e inviato a Supermemory in ",
|
|
759
|
+
document.indexedTextDocumentIds.length,
|
|
760
|
+
" documento/i. Stato dell\u2019indice testuale: ",
|
|
761
|
+
document.indexedTextStatus ?? document.status,
|
|
762
|
+
". Stato del file originale: ",
|
|
763
|
+
document.binaryProcessingStatus ?? "non disponibile",
|
|
764
|
+
"."
|
|
765
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
766
|
+
"Non \xE8 disponibile un indice testuale collegato. Stato del file: ",
|
|
767
|
+
document.binaryProcessingStatus ?? document.status,
|
|
768
|
+
"; la ricerca potrebbe non trovare il contenuto."
|
|
769
|
+
] }),
|
|
770
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
771
|
+
"Per sostituire il file, elimina questa voce e carica la versione aggiornata."
|
|
772
|
+
] }),
|
|
773
|
+
document.mimeType === "application/pdf" ? /* @__PURE__ */ jsxs("label", { style: { ...secondaryButtonStyle, display: "inline-flex", alignItems: "center", cursor: busy ? "wait" : "pointer" }, children: [
|
|
774
|
+
busy ? "Indicizzazione\u2026" : "Estrai / reindicizza testo dal PDF",
|
|
775
|
+
/* @__PURE__ */ jsx("input", { type: "file", hidden: true, disabled: busy, accept: ".pdf,application/pdf", onChange: onReindexPdfChange })
|
|
776
|
+
] }) : null
|
|
777
|
+
] }) : document.kind === "url" ? /* @__PURE__ */ jsxs("div", { style: { ...panelStyle, padding: 18, overflowWrap: "anywhere" }, children: [
|
|
778
|
+
/* @__PURE__ */ jsx("strong", { children: "Pagina indicizzata" }),
|
|
779
|
+
/* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("a", { href: document.sourceUrl ?? content, target: "_blank", rel: "noopener noreferrer", style: { textDecoration: "underline" }, children: document.sourceUrl ?? content }) }),
|
|
780
|
+
/* @__PURE__ */ jsx("p", { style: { ...mutedStyle, marginBottom: 0 }, children: "Supermemory conserva l\u2019indice estratto; per aggiornare il contenuto salva di nuovo l\u2019URL." })
|
|
781
|
+
] }) : /* @__PURE__ */ jsx("div", { style: { ...panelStyle, padding: 16 }, children: /* @__PURE__ */ jsx(MarkdownBlock, { content }) }) : null,
|
|
782
|
+
mode === "edit" ? document.kind === "file" ? /* @__PURE__ */ jsxs("div", { style: { ...panelStyle, padding: 18 }, children: [
|
|
783
|
+
/* @__PURE__ */ jsx("strong", { children: "Il contenuto del file non \xE8 modificabile in-place." }),
|
|
784
|
+
/* @__PURE__ */ jsx("p", { style: { ...mutedStyle, marginBottom: 0 }, children: "Per aggiornarlo, elimina il documento e carica il file aggiornato." })
|
|
785
|
+
] }) : /* @__PURE__ */ jsx("textarea", { style: { ...inputStyle, flex: 1, minHeight: 0, resize: "none", fontFamily: "var(--font-mono, ui-monospace, monospace)", lineHeight: 1.6 }, value: content, onChange: (event) => editField(setContent, event.target.value) }) : null,
|
|
786
|
+
mode === "raw" ? /* @__PURE__ */ jsx("pre", { style: { ...panelStyle, padding: 16, margin: 0, whiteSpace: "pre-wrap", overflowWrap: "anywhere", fontSize: 12 }, children: JSON.stringify({ ...document, title, content }, null, 2) }) : null
|
|
787
|
+
] }),
|
|
788
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8, justifyContent: "space-between", borderTop: "1px solid var(--border)", paddingTop: 12, flexShrink: 0 }, children: [
|
|
710
789
|
/* @__PURE__ */ jsx("button", { type: "button", style: { ...secondaryButtonStyle, color: "var(--destructive, #b91c1c)" }, onClick: () => void removeDocument(), disabled: busy || !document.id, children: "Elimina documento" }),
|
|
711
790
|
/* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 8 }, children: mode === "edit" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
712
791
|
/* @__PURE__ */ jsx("button", { type: "button", style: secondaryButtonStyle, onClick: () => {
|
|
@@ -722,7 +801,7 @@ function MemoryPage() {
|
|
|
722
801
|
busy ? /* @__PURE__ */ jsx("div", { "aria-live": "polite", style: { borderTop: "1px solid var(--border)", padding: "8px 14px", fontSize: 12, ...mutedStyle }, children: "Operazione in corso\u2026" }) : null
|
|
723
802
|
] })
|
|
724
803
|
] }),
|
|
725
|
-
/* @__PURE__ */ jsxs("footer", { style: { ...mutedStyle, fontSize: 11, lineHeight: 1.6, marginTop: 12 }, children: [
|
|
804
|
+
/* @__PURE__ */ jsxs("footer", { style: { ...mutedStyle, fontSize: 11, lineHeight: 1.6, marginTop: 12, flexShrink: 0 }, children: [
|
|
726
805
|
"Le assegnazioni progetto sono controllate con ",
|
|
727
806
|
/* @__PURE__ */ jsx("code", { children: "projectId" }),
|
|
728
807
|
" del run Paperclip e la allowlist degli agenti qui selezionati. Le informazioni restano separate per organizzazione. I namespace vengono creati da Supermemory al primo contenuto; disattivare un\u2019assegnazione revoca l\u2019accesso ma non cancella i documenti."
|