agent-recall-mcp 3.5.2 → 3.5.4
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 +254 -143
- package/dist/build-server.d.ts +28 -0
- package/dist/build-server.d.ts.map +1 -0
- package/dist/build-server.js +55 -0
- package/dist/build-server.js.map +1 -0
- package/dist/http/activity.d.ts +60 -0
- package/dist/http/activity.d.ts.map +1 -0
- package/dist/http/activity.js +254 -0
- package/dist/http/activity.js.map +1 -0
- package/dist/http/alerts.d.ts +84 -0
- package/dist/http/alerts.d.ts.map +1 -0
- package/dist/http/alerts.js +213 -0
- package/dist/http/alerts.js.map +1 -0
- package/dist/http/cli.d.ts +3 -0
- package/dist/http/cli.d.ts.map +1 -0
- package/dist/http/cli.js +515 -0
- package/dist/http/cli.js.map +1 -0
- package/dist/http/export-tar.d.ts +23 -0
- package/dist/http/export-tar.d.ts.map +1 -0
- package/dist/http/export-tar.js +264 -0
- package/dist/http/export-tar.js.map +1 -0
- package/dist/http/federation.d.ts +45 -0
- package/dist/http/federation.d.ts.map +1 -0
- package/dist/http/federation.js +185 -0
- package/dist/http/federation.js.map +1 -0
- package/dist/http/film/film.css +80 -0
- package/dist/http/film/film.js +446 -0
- package/dist/http/film/human.jpg +0 -0
- package/dist/http/film/m0.jpg +0 -0
- package/dist/http/film/m2.jpg +0 -0
- package/dist/http/film/m3.jpg +0 -0
- package/dist/http/film/wrong.jpg +0 -0
- package/dist/http/film.d.ts +16 -0
- package/dist/http/film.d.ts.map +1 -0
- package/dist/http/film.js +119 -0
- package/dist/http/film.js.map +1 -0
- package/dist/http/home/cabinet.svg +1 -0
- package/dist/http/home/drawer-project.svg +1 -0
- package/dist/http/home/drawer-rules.svg +1 -0
- package/dist/http/home/drawer-you.svg +1 -0
- package/dist/http/home/fig1.svg +242 -0
- package/dist/http/home/fig2-1.svg +61 -0
- package/dist/http/home/fig2-2.svg +92 -0
- package/dist/http/home/fig3.svg +1 -0
- package/dist/http/home/home.css +509 -0
- package/dist/http/home/home.html +517 -0
- package/dist/http/home/icons.svg +15 -0
- package/dist/http/home.d.ts +23 -0
- package/dist/http/home.d.ts.map +1 -0
- package/dist/http/home.js +295 -0
- package/dist/http/home.js.map +1 -0
- package/dist/http/identities.d.ts +29 -0
- package/dist/http/identities.d.ts.map +1 -0
- package/dist/http/identities.js +91 -0
- package/dist/http/identities.js.map +1 -0
- package/dist/http/import-memory.d.ts +161 -0
- package/dist/http/import-memory.d.ts.map +1 -0
- package/dist/http/import-memory.js +718 -0
- package/dist/http/import-memory.js.map +1 -0
- package/dist/http/jsonfile.d.ts +6 -0
- package/dist/http/jsonfile.d.ts.map +1 -0
- package/dist/http/jsonfile.js +60 -0
- package/dist/http/jsonfile.js.map +1 -0
- package/dist/http/legal/PRIVACY.md +70 -0
- package/dist/http/legal.d.ts +10 -0
- package/dist/http/legal.d.ts.map +1 -0
- package/dist/http/legal.js +35 -0
- package/dist/http/legal.js.map +1 -0
- package/dist/http/limits.d.ts +59 -0
- package/dist/http/limits.d.ts.map +1 -0
- package/dist/http/limits.js +163 -0
- package/dist/http/limits.js.map +1 -0
- package/dist/http/markdown-lite.d.ts +2 -0
- package/dist/http/markdown-lite.d.ts.map +1 -0
- package/dist/http/markdown-lite.js +86 -0
- package/dist/http/markdown-lite.js.map +1 -0
- package/dist/http/multipart.d.ts +43 -0
- package/dist/http/multipart.d.ts.map +1 -0
- package/dist/http/multipart.js +152 -0
- package/dist/http/multipart.js.map +1 -0
- package/dist/http/oauth-app.d.ts +75 -0
- package/dist/http/oauth-app.d.ts.map +1 -0
- package/dist/http/oauth-app.js +259 -0
- package/dist/http/oauth-app.js.map +1 -0
- package/dist/http/oauth-config.d.ts +46 -0
- package/dist/http/oauth-config.d.ts.map +1 -0
- package/dist/http/oauth-config.js +122 -0
- package/dist/http/oauth-config.js.map +1 -0
- package/dist/http/oauth-pages.d.ts +40 -0
- package/dist/http/oauth-pages.d.ts.map +1 -0
- package/dist/http/oauth-pages.js +97 -0
- package/dist/http/oauth-pages.js.map +1 -0
- package/dist/http/oauth-provider.d.ts +124 -0
- package/dist/http/oauth-provider.d.ts.map +1 -0
- package/dist/http/oauth-provider.js +486 -0
- package/dist/http/oauth-provider.js.map +1 -0
- package/dist/http/oauth-store.d.ts +128 -0
- package/dist/http/oauth-store.d.ts.map +1 -0
- package/dist/http/oauth-store.js +317 -0
- package/dist/http/oauth-store.js.map +1 -0
- package/dist/http/redirect-policy.d.ts +16 -0
- package/dist/http/redirect-policy.d.ts.map +1 -0
- package/dist/http/redirect-policy.js +83 -0
- package/dist/http/redirect-policy.js.map +1 -0
- package/dist/http/review-pages.d.ts +39 -0
- package/dist/http/review-pages.d.ts.map +1 -0
- package/dist/http/review-pages.js +78 -0
- package/dist/http/review-pages.js.map +1 -0
- package/dist/http/review.d.ts +36 -0
- package/dist/http/review.d.ts.map +1 -0
- package/dist/http/review.js +220 -0
- package/dist/http/review.js.map +1 -0
- package/dist/http/serve.d.ts +58 -0
- package/dist/http/serve.d.ts.map +1 -0
- package/dist/http/serve.js +324 -0
- package/dist/http/serve.js.map +1 -0
- package/dist/http/site-pages.d.ts +110 -0
- package/dist/http/site-pages.d.ts.map +1 -0
- package/dist/http/site-pages.js +630 -0
- package/dist/http/site-pages.js.map +1 -0
- package/dist/http/site-theme.d.ts +13 -0
- package/dist/http/site-theme.d.ts.map +1 -0
- package/dist/http/site-theme.js +22 -0
- package/dist/http/site-theme.js.map +1 -0
- package/dist/http/site.d.ts +52 -0
- package/dist/http/site.d.ts.map +1 -0
- package/dist/http/site.js +353 -0
- package/dist/http/site.js.map +1 -0
- package/dist/http/stats.d.ts +139 -0
- package/dist/http/stats.d.ts.map +1 -0
- package/dist/http/stats.js +599 -0
- package/dist/http/stats.js.map +1 -0
- package/dist/http/tar-import.d.ts +69 -0
- package/dist/http/tar-import.d.ts.map +1 -0
- package/dist/http/tar-import.js +234 -0
- package/dist/http/tar-import.js.map +1 -0
- package/dist/http/tenant-paths.d.ts +14 -0
- package/dist/http/tenant-paths.d.ts.map +1 -0
- package/dist/http/tenant-paths.js +42 -0
- package/dist/http/tenant-paths.js.map +1 -0
- package/dist/http/tokens.d.ts +32 -0
- package/dist/http/tokens.d.ts.map +1 -0
- package/dist/http/tokens.js +137 -0
- package/dist/http/tokens.js.map +1 -0
- package/dist/http/trial.d.ts +55 -0
- package/dist/http/trial.d.ts.map +1 -0
- package/dist/http/trial.js +218 -0
- package/dist/http/trial.js.map +1 -0
- package/dist/http/web-session.d.ts +108 -0
- package/dist/http/web-session.d.ts.map +1 -0
- package/dist/http/web-session.js +267 -0
- package/dist/http/web-session.js.map +1 -0
- package/dist/index.js +12 -65
- package/dist/index.js.map +1 -1
- package/dist/lib/ambient-capture.d.ts.map +1 -1
- package/dist/lib/ambient-capture.js +4 -1
- package/dist/lib/ambient-capture.js.map +1 -1
- package/dist/lib/bookkeeping.d.ts +26 -0
- package/dist/lib/bookkeeping.d.ts.map +1 -0
- package/dist/lib/bookkeeping.js +31 -0
- package/dist/lib/bookkeeping.js.map +1 -0
- package/dist/lib/hosted-redact.d.ts +17 -0
- package/dist/lib/hosted-redact.d.ts.map +1 -0
- package/dist/lib/hosted-redact.js +57 -0
- package/dist/lib/hosted-redact.js.map +1 -0
- package/dist/lib/lifecycle-exit.d.ts +5 -13
- package/dist/lib/lifecycle-exit.d.ts.map +1 -1
- package/dist/lib/lifecycle-exit.js +38 -16
- package/dist/lib/lifecycle-exit.js.map +1 -1
- package/dist/server.d.ts +3 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +6 -3
- package/dist/server.js.map +1 -1
- package/dist/tools/annotations.d.ts +65 -0
- package/dist/tools/annotations.d.ts.map +1 -0
- package/dist/tools/annotations.js +4 -0
- package/dist/tools/annotations.js.map +1 -0
- package/dist/tools/check-action.d.ts.map +1 -1
- package/dist/tools/check-action.js +2 -0
- package/dist/tools/check-action.js.map +1 -1
- package/dist/tools/check.d.ts.map +1 -1
- package/dist/tools/check.js +6 -2
- package/dist/tools/check.js.map +1 -1
- package/dist/tools/digest.d.ts.map +1 -1
- package/dist/tools/digest.js +2 -0
- package/dist/tools/digest.js.map +1 -1
- package/dist/tools/pipeline-close.d.ts.map +1 -1
- package/dist/tools/pipeline-close.js +2 -0
- package/dist/tools/pipeline-close.js.map +1 -1
- package/dist/tools/pipeline-current.d.ts.map +1 -1
- package/dist/tools/pipeline-current.js +2 -0
- package/dist/tools/pipeline-current.js.map +1 -1
- package/dist/tools/pipeline-list.d.ts.map +1 -1
- package/dist/tools/pipeline-list.js +2 -0
- package/dist/tools/pipeline-list.js.map +1 -1
- package/dist/tools/pipeline-open.d.ts.map +1 -1
- package/dist/tools/pipeline-open.js +2 -0
- package/dist/tools/pipeline-open.js.map +1 -1
- package/dist/tools/pipeline-show.d.ts.map +1 -1
- package/dist/tools/pipeline-show.js +2 -0
- package/dist/tools/pipeline-show.js.map +1 -1
- package/dist/tools/recall.d.ts.map +1 -1
- package/dist/tools/recall.js +4 -1
- package/dist/tools/recall.js.map +1 -1
- package/dist/tools/register-rule.d.ts.map +1 -1
- package/dist/tools/register-rule.js +2 -0
- package/dist/tools/register-rule.js.map +1 -1
- package/dist/tools/remember.d.ts.map +1 -1
- package/dist/tools/remember.js +10 -1
- package/dist/tools/remember.js.map +1 -1
- package/dist/tools/session-end.d.ts +15 -0
- package/dist/tools/session-end.d.ts.map +1 -1
- package/dist/tools/session-end.js +13 -1
- package/dist/tools/session-end.js.map +1 -1
- package/dist/tools/session-start.d.ts +6 -1
- package/dist/tools/session-start.d.ts.map +1 -1
- package/dist/tools/session-start.js +24 -212
- package/dist/tools/session-start.js.map +1 -1
- package/package.json +11 -8
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { esc } from "./oauth-pages.js";
|
|
3
|
+
import { SITE_TOKENS } from "./site-theme.js";
|
|
4
|
+
import { ROOT_FILES } from "./tar-import.js";
|
|
5
|
+
import { DEFAULT_IMPORT_LIMITS } from "./import-memory.js";
|
|
6
|
+
export const REPO_URL = "https://github.com/Goldentrii/AgentRecall-X";
|
|
7
|
+
export const TELEGRAM_URL = "https://t.me/+ywZwoHrg3AM0NDVi";
|
|
8
|
+
export const DEFAULT_PRIVACY_URL = `${REPO_URL}/blob/main/PRIVACY.md`;
|
|
9
|
+
// ---- assets ---------------------------------------------------------------
|
|
10
|
+
const CSS = SITE_TOKENS + `
|
|
11
|
+
*{box-sizing:border-box}
|
|
12
|
+
html{-webkit-text-size-adjust:100%}
|
|
13
|
+
body{margin:0;background:var(--bg);color:var(--ink);font:17px/1.6 var(--sans)}
|
|
14
|
+
a{color:inherit;text-underline-offset:3px;text-decoration-thickness:1px}
|
|
15
|
+
a:hover{text-decoration-thickness:2px}
|
|
16
|
+
:focus-visible{outline:3px solid var(--cyan);outline-offset:3px;border-radius:4px}
|
|
17
|
+
.skip{position:absolute;left:-999px;top:8px;background:var(--ink);color:var(--bg);padding:8px 14px;border-radius:8px;z-index:9}
|
|
18
|
+
.skip:focus{left:8px}
|
|
19
|
+
.wrap{max-width:1080px;margin:0 auto;padding:0 24px}
|
|
20
|
+
header.top{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:20px 0}
|
|
21
|
+
.brand{display:flex;align-items:center;gap:10px;font:600 19px/1 var(--sans);text-decoration:none;letter-spacing:.02em}
|
|
22
|
+
.brand svg{width:30px;height:30px}
|
|
23
|
+
nav.main{display:flex;gap:22px;flex-wrap:wrap;font-size:15px}
|
|
24
|
+
nav.main a{text-decoration:none;color:var(--muted);padding:6px 0;border-bottom:2px solid transparent}
|
|
25
|
+
nav.main a:hover,nav.main a[aria-current]{color:var(--ink);border-bottom-color:var(--gold)}
|
|
26
|
+
h1,h2,h3{font-family:var(--serif);line-height:1.12;letter-spacing:-.01em;margin:0}
|
|
27
|
+
h1{font-size:clamp(2.35rem,6.4vw,4.1rem);font-weight:500}
|
|
28
|
+
h2{font-size:clamp(1.55rem,3.4vw,2.1rem);font-weight:500}
|
|
29
|
+
h3{font-size:1.2rem;font-weight:500}
|
|
30
|
+
p{margin:0 0 14px}
|
|
31
|
+
h1+.lede{margin-top:14px}
|
|
32
|
+
.panel h3{margin-top:18px}
|
|
33
|
+
.lede{font-size:clamp(1.05rem,2.2vw,1.25rem);color:var(--muted);max-width:34em}
|
|
34
|
+
.hero{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:40px;align-items:center;padding:28px 0 56px}
|
|
35
|
+
.hero h1{margin:0 0 18px}
|
|
36
|
+
.cta{display:flex;gap:12px;flex-wrap:wrap;margin:26px 0 18px}
|
|
37
|
+
.btn{display:inline-block;font:600 16px/1 var(--sans);padding:15px 24px;border-radius:999px;border:1px solid var(--gold);background:var(--gold);color:var(--bg);text-decoration:none;cursor:pointer}
|
|
38
|
+
.btn:hover{filter:brightness(1.08)}
|
|
39
|
+
.btn.alt{background:transparent;color:var(--ink);border-color:var(--edge)}
|
|
40
|
+
.btn.alt:hover{filter:none;border-color:var(--ink)}
|
|
41
|
+
.btn.small{padding:10px 16px;font-size:14px}
|
|
42
|
+
.btn.danger{background:transparent;color:var(--err-ink);border-color:var(--err-line)}
|
|
43
|
+
.btn.danger:hover{filter:none;border-color:var(--err-ink)}
|
|
44
|
+
.agentnote{font-size:14px;color:var(--dim)}
|
|
45
|
+
.agentnote a{font-family:var(--mono);font-size:13px;color:var(--cyan)}
|
|
46
|
+
.art{width:100%;height:auto;display:block}
|
|
47
|
+
.art .chip{fill:var(--card);stroke:var(--line);stroke-width:2}
|
|
48
|
+
.art .wire{stroke:var(--dim);stroke-width:2;fill:none;stroke-dasharray:3 6;stroke-linecap:round}
|
|
49
|
+
.art .back{fill:var(--sunk);stroke:var(--line);stroke-width:2}
|
|
50
|
+
.art .face{fill:var(--card);stroke:var(--dim);stroke-width:2}
|
|
51
|
+
.art text{font-family:var(--sans);fill:var(--ink);font-size:15px}
|
|
52
|
+
.art .mono{font-family:var(--mono);font-size:13px;fill:var(--dim)}
|
|
53
|
+
.art .head{font-family:var(--serif);font-weight:500;font-size:20px}
|
|
54
|
+
.art .hl{fill:var(--gold)}
|
|
55
|
+
.art .hltext{fill:var(--bg);font-weight:600;font-size:14px}
|
|
56
|
+
.art .dot{fill:var(--cyan)}
|
|
57
|
+
.art .rule{stroke:var(--line);stroke-width:2}
|
|
58
|
+
.doors{display:grid;grid-template-columns:1fr 1fr;gap:22px;padding:8px 0 24px}
|
|
59
|
+
.door{background:var(--card);border:1px solid var(--line);border-top:3px solid var(--gold);border-radius:16px;padding:28px}
|
|
60
|
+
.door.local{border-top-color:var(--cyan)}
|
|
61
|
+
.door h2{margin:0 0 10px}
|
|
62
|
+
.door p{color:var(--muted)}
|
|
63
|
+
.door ul{margin:0 0 22px;padding-left:20px;color:var(--ink)}
|
|
64
|
+
.door li{margin:4px 0}
|
|
65
|
+
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;padding:30px 0 20px;margin:0;list-style:none;counter-reset:s}
|
|
66
|
+
.steps li{counter-increment:s;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:20px}
|
|
67
|
+
.steps li:before{content:counter(s);display:block;font:600 13px/1 var(--mono);color:var(--gold);margin-bottom:10px}
|
|
68
|
+
.steps strong{display:block;font-size:1.05rem;margin-bottom:6px}
|
|
69
|
+
.steps span{color:var(--muted);font-size:15.5px}
|
|
70
|
+
section.block{padding:34px 0}
|
|
71
|
+
footer.foot{border-top:1px solid var(--line);margin-top:48px;padding:26px 0 44px;display:flex;gap:22px;flex-wrap:wrap;justify-content:space-between;color:var(--dim);font-size:15px}
|
|
72
|
+
footer.foot nav{display:flex;gap:22px;flex-wrap:wrap}
|
|
73
|
+
.panel{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:26px 26px 24px;margin:0 0 22px}
|
|
74
|
+
.panel>h2{font-size:1.5rem;margin-bottom:6px}
|
|
75
|
+
.panel>p.sub{color:var(--muted);margin-bottom:16px}
|
|
76
|
+
.who{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:6px 0 26px}
|
|
77
|
+
.who p{margin:0;color:var(--muted);font-size:15px}
|
|
78
|
+
.who form{margin:0}
|
|
79
|
+
.idrow{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
|
|
80
|
+
.idval{font:600 clamp(1.4rem,4vw,2rem)/1.2 var(--mono);background:var(--gold);color:var(--bg);padding:6px 14px;border-radius:8px;overflow-wrap:anywhere}
|
|
81
|
+
.cmd{position:relative;margin:10px 0 14px}
|
|
82
|
+
pre{margin:0;background:var(--sunk);border:1px solid var(--line);border-radius:10px;padding:14px 16px;font:14px/1.55 var(--mono);white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink)}
|
|
83
|
+
.cmd pre{padding-right:84px}
|
|
84
|
+
.copy{display:none;position:absolute;top:8px;right:8px;font:600 13px/1 var(--sans);padding:8px 11px;border-radius:999px;border:1px solid var(--edge);background:var(--card);color:var(--ink);cursor:pointer}
|
|
85
|
+
.js .copy{display:block}
|
|
86
|
+
.copy:hover{border-color:var(--ink)}
|
|
87
|
+
.idrow .copy{position:static;display:none}
|
|
88
|
+
.js .idrow .copy{display:block}
|
|
89
|
+
.tabs{margin-top:6px}
|
|
90
|
+
.tabs>input{position:absolute;opacity:0;pointer-events:none}
|
|
91
|
+
.tablist{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px}
|
|
92
|
+
.tablist label{cursor:pointer;padding:9px 15px;border-radius:999px;border:1px solid var(--line);font-size:15px;font-weight:600;background:var(--sunk);color:var(--muted)}
|
|
93
|
+
.tablist label:hover{border-color:var(--dim);color:var(--ink)}
|
|
94
|
+
.tabs>input:focus-visible~.tablist label{outline:none}
|
|
95
|
+
.tabs .p{display:none}
|
|
96
|
+
#t1:checked~.panels #p1,#t2:checked~.panels #p2,#t3:checked~.panels #p3,#t4:checked~.panels #p4,#t5:checked~.panels #p5{display:block}
|
|
97
|
+
#t1:checked~.tablist [for=t1],#t2:checked~.tablist [for=t2],#t3:checked~.tablist [for=t3],#t4:checked~.tablist [for=t4],#t5:checked~.tablist [for=t5]{background:var(--gold);color:var(--bg);border-color:var(--gold)}
|
|
98
|
+
#t1:focus-visible~.tablist [for=t1],#t2:focus-visible~.tablist [for=t2],#t3:focus-visible~.tablist [for=t3],#t4:focus-visible~.tablist [for=t4],#t5:focus-visible~.tablist [for=t5]{outline:3px solid var(--cyan);outline-offset:3px}
|
|
99
|
+
.step-note{color:var(--muted);font-size:15.5px;margin:4px 0 0}
|
|
100
|
+
.agentprompt{margin-top:22px;padding-top:20px;border-top:1px dashed var(--line)}
|
|
101
|
+
.agentprompt h3{margin-bottom:4px}
|
|
102
|
+
details.fold{margin:12px 0;border:1px solid var(--line);border-radius:10px;background:var(--sunk)}
|
|
103
|
+
details.fold>summary{cursor:pointer;padding:12px 16px;font-weight:600;border-radius:10px}
|
|
104
|
+
details.fold>summary:focus-visible{outline:3px solid var(--cyan);outline-offset:2px}
|
|
105
|
+
details.fold[open]>summary{border-bottom:1px solid var(--line);border-bottom-left-radius:0;border-bottom-right-radius:0}
|
|
106
|
+
details.fold>.cmd,details.fold>.step-note{margin:12px 14px}
|
|
107
|
+
.rows{list-style:none;margin:0;padding:0}
|
|
108
|
+
.rows li{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:14px 0;border-top:1px solid var(--line)}
|
|
109
|
+
.rows li:first-child{border-top:0}
|
|
110
|
+
.rows .name{font-weight:600}
|
|
111
|
+
.rows .meta{color:var(--dim);font-size:14px}
|
|
112
|
+
.rows form{margin:0}
|
|
113
|
+
.empty{color:var(--muted);margin:0}
|
|
114
|
+
.bar{height:12px;border-radius:99px;background:var(--sunk);border:1px solid var(--line);overflow:hidden;margin:10px 0 8px}
|
|
115
|
+
.bar b{display:block;height:100%;background:var(--gold)}
|
|
116
|
+
.bar b.w20{width:20%}.bar b.w40{width:40%}.bar b.w60{width:60%}.bar b.w80{width:80%}.bar b.w100{width:100%}.bar b.w0{width:2%}.bar b.w5{width:5%}.bar b.w10{width:10%}
|
|
117
|
+
.bar b.full{background:var(--err-ink)}
|
|
118
|
+
.pair{display:grid;grid-template-columns:1fr 1fr;gap:22px}
|
|
119
|
+
.pair .panel{margin:0}
|
|
120
|
+
.notice{border:1px solid var(--line);border-left-width:4px;border-radius:10px;padding:12px 16px;margin:0 0 20px;font-size:15.5px}
|
|
121
|
+
.notice.ok{background:var(--ok-bg);border-color:var(--ok-line);color:var(--ok-ink)}
|
|
122
|
+
.notice.err{background:var(--err-bg);border-color:var(--err-line);color:var(--err-ink)}
|
|
123
|
+
.notice.plain{background:var(--sunk);border-left-color:var(--cyan);color:var(--ink)}
|
|
124
|
+
.notice .meta{display:block;margin-top:4px;font-size:14px}
|
|
125
|
+
.trial .rows li>div{min-width:0;flex:1 1 100%}
|
|
126
|
+
.trial .rows .btn{margin-top:10px;color:var(--bg)}
|
|
127
|
+
.trial .tick{color:var(--ok-ink);background:var(--ok-bg);border:1px solid var(--ok-line);border-radius:999px;padding:1px 9px;font-size:13px;white-space:nowrap}
|
|
128
|
+
.trial .muted{opacity:.8}
|
|
129
|
+
.signin{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:34px;align-items:start;padding:20px 0 20px}
|
|
130
|
+
.signin ul{padding-left:20px;margin:0 0 14px}
|
|
131
|
+
.signin li{margin:6px 0}
|
|
132
|
+
.signin .panel form{margin:0 0 10px}
|
|
133
|
+
.signin .btn{width:100%;text-align:center;margin-bottom:10px}
|
|
134
|
+
code{font:.9em var(--mono);background:var(--sunk);padding:1px 6px;border-radius:5px}
|
|
135
|
+
.who h1{font-size:clamp(1.8rem,4vw,2.6rem);margin-bottom:6px}
|
|
136
|
+
.small:not(.btn){font-size:14px;color:var(--dim)}
|
|
137
|
+
.imp label.opt{display:block;margin:8px 0}
|
|
138
|
+
.imp input[type=text],.imp input[type=file]{display:block;margin:6px 0 16px;font:inherit;color:var(--ink);max-width:100%}
|
|
139
|
+
.imp input[type=text]{padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:var(--sunk)}
|
|
140
|
+
.imp .notice{margin:14px 0}
|
|
141
|
+
.msg{max-width:560px;margin:40px auto}
|
|
142
|
+
.legal{max-width:46rem;padding:12px 0 8px}
|
|
143
|
+
.legal h1{font-size:clamp(2rem,5vw,3rem);margin-bottom:18px}
|
|
144
|
+
.legal h2{margin:34px 0 10px;padding-top:22px;border-top:1px solid var(--line)}
|
|
145
|
+
.legal h1+p+h2,.legal h1+p+p+h2{margin-top:26px}
|
|
146
|
+
.legal ul{margin:0 0 14px;padding-left:22px}
|
|
147
|
+
.legal li{margin:6px 0}
|
|
148
|
+
.legal a{color:var(--cyan)}
|
|
149
|
+
.legal .tbl{overflow-x:auto;margin:0 0 18px;border:1px solid var(--line);border-radius:12px;background:var(--card)}
|
|
150
|
+
.legal table{border-collapse:collapse;width:100%;min-width:34rem;font-size:15.5px}
|
|
151
|
+
.legal th,.legal td{text-align:left;vertical-align:top;padding:12px 14px;border-top:1px solid var(--line)}
|
|
152
|
+
.legal thead th{border-top:0;color:var(--dim);font:600 13px/1.3 var(--sans);letter-spacing:.04em;text-transform:uppercase}
|
|
153
|
+
.legal td{color:var(--muted)}
|
|
154
|
+
.legal tbody td:first-child{color:var(--ink)}
|
|
155
|
+
.support{max-width:46rem;padding:12px 0 8px}
|
|
156
|
+
.support h1{font-size:clamp(2rem,5vw,3rem)}
|
|
157
|
+
.support .panel{margin:0 0 18px}
|
|
158
|
+
.support .panel p:last-child{margin-bottom:0}
|
|
159
|
+
.support .panel h2{font-size:1.35rem;margin-bottom:8px}
|
|
160
|
+
.support .addr{font:600 1.05rem/1.4 var(--mono);overflow-wrap:anywhere}
|
|
161
|
+
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
|
|
162
|
+
@media (max-width:820px){.hero,.signin{grid-template-columns:1fr;gap:28px}.doors,.pair{grid-template-columns:1fr}.steps{grid-template-columns:1fr}}
|
|
163
|
+
@media (max-width:560px){.legal .tbl{overflow:visible;border:0;background:none}.legal table,.legal tbody,.legal tr,.legal td{display:block;min-width:0;width:100%}.legal thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}.legal tr{margin:0 0 12px;border:1px solid var(--line);border-radius:12px;background:var(--card);overflow:hidden}.legal td{border-top:0;padding:8px 14px}.legal td:first-child{padding-top:12px}.legal td:last-child{padding-bottom:12px}.legal td[data-label]:not([data-label=""])::before{content:attr(data-label);display:block;color:var(--dim);font:600 12px/1.3 var(--sans);letter-spacing:.04em;text-transform:uppercase;margin-bottom:2px}}
|
|
164
|
+
@media (max-width:520px){body{font-size:16px}.wrap{padding:0 18px}.panel{padding:20px 18px}.door{padding:24px 20px 22px}.tablist label{padding:8px 12px;font-size:14px}.btn{width:100%;text-align:center}.cta{flex-direction:column}.cmd pre{padding:14px}.cmd .copy{position:static;width:100%;margin-top:8px;padding:11px}.idrow .copy{position:static}.trial .rows .btn{width:100%}.rows .btn,.who .btn{width:auto}}
|
|
165
|
+
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
|
|
166
|
+
`;
|
|
167
|
+
const SCRIPT = `document.documentElement.className+=" js";document.addEventListener("click",function(e){var b=e.target.closest("[data-copy]");if(!b)return;var t=document.getElementById(b.getAttribute("data-copy"));if(!t)return;var o=b.textContent;function done(m){b.textContent=m;setTimeout(function(){b.textContent=o},1600)}if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(t.textContent).then(function(){done("Copied")},function(){done("Select and copy")})}else{done("Select and copy")}});`;
|
|
168
|
+
const sha = (s) => `'sha256-${createHash("sha256").update(s, "utf8").digest("base64")}'`;
|
|
169
|
+
export const STYLE_HASH = sha(CSS);
|
|
170
|
+
export const SCRIPT_HASH = sha(SCRIPT);
|
|
171
|
+
/** Headers for every site page. `formOrigins`: provider origins, only for a page whose sign-in form redirects to them.
|
|
172
|
+
* `hashes`: a page with its own inline style/script; no `script` hash means the page has no script (script-src 'none'). */
|
|
173
|
+
export function siteHeaders(opts = {}) {
|
|
174
|
+
const extra = (opts.formOrigins ?? []).filter((o) => /^https?:\/\/[A-Za-z0-9.\-:[\]]+$/.test(o));
|
|
175
|
+
return {
|
|
176
|
+
"content-type": "text/html; charset=utf-8",
|
|
177
|
+
"content-security-policy": `default-src 'none'; img-src 'self' data:; style-src ${opts.hashes?.style ?? STYLE_HASH}; script-src ${opts.hashes ? (opts.hashes.script ?? "'none'") : SCRIPT_HASH}; base-uri 'none'; ` +
|
|
178
|
+
`form-action 'self'${extra.length ? " " + extra.join(" ") : ""}; frame-ancestors 'none'`,
|
|
179
|
+
"x-frame-options": "DENY",
|
|
180
|
+
"referrer-policy": "no-referrer",
|
|
181
|
+
"x-content-type-options": "nosniff",
|
|
182
|
+
"cache-control": opts.noStore === false ? "public, max-age=300" : "no-store",
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export const TEXT_HEADERS = {
|
|
186
|
+
"content-type": "text/plain; charset=utf-8",
|
|
187
|
+
"x-content-type-options": "nosniff",
|
|
188
|
+
"referrer-policy": "no-referrer",
|
|
189
|
+
"cache-control": "public, max-age=300",
|
|
190
|
+
"content-security-policy": "default-src 'none'; frame-ancestors 'none'",
|
|
191
|
+
};
|
|
192
|
+
// Colours repeat SITE_TOKENS (--line, --dim, --card, --gold, --bg): an SVG used as a favicon cannot read
|
|
193
|
+
// CSS variables. A test in hosted-site.test.mjs fails if any of them stops being a token value.
|
|
194
|
+
const MARK = `<svg viewBox="0 0 40 40" aria-hidden="true" focusable="false"><rect x="9" y="3" width="28" height="22" rx="5" fill="#1e2a3b" stroke="#9aaec3" stroke-width="2.4"/><rect x="5" y="9" width="28" height="22" rx="5" fill="#0c121c" stroke="#9aaec3" stroke-width="2.4"/><rect x="1.5" y="15" width="28" height="22" rx="5" fill="#F5C451" stroke="#9aaec3" stroke-width="2.4"/><circle cx="23.5" cy="21.5" r="3" fill="#04060a"/></svg>`;
|
|
195
|
+
export const FAVICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">${MARK.replace(/^<svg[^>]*>/, "").replace(/<\/svg>$/, "")}</svg>`;
|
|
196
|
+
function layout(title, body, ctx, nav, description = "One memory shared by every AI agent you use.") {
|
|
197
|
+
const cur = (n) => (nav === n ? ' aria-current="page"' : "");
|
|
198
|
+
const indexable = nav === "home" || nav === "local" || nav === "privacy" || nav === "support";
|
|
199
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">` +
|
|
200
|
+
`<title>${esc(title)}</title><meta name="description" content="${esc(description)}">` +
|
|
201
|
+
`<meta name="color-scheme" content="dark"><meta name="robots" content="${indexable ? "index,follow" : "noindex"}">` +
|
|
202
|
+
`<link rel="icon" href="/favicon.svg" type="image/svg+xml">` +
|
|
203
|
+
`<link rel="alternate" type="text/markdown" href="/connect.md" title="Connect an agent (for agents)">` +
|
|
204
|
+
`<link rel="alternate" type="text/markdown" href="/local.md" title="Run locally (for agents)">` +
|
|
205
|
+
`<style>${CSS}</style></head><body>` +
|
|
206
|
+
`<a class="skip" href="#main">Skip to content</a>` +
|
|
207
|
+
`<div class="wrap"><header class="top"><a class="brand" href="/" aria-label="AgentRecall home">${MARK}AgentRecall</a>` +
|
|
208
|
+
`<nav class="main" aria-label="Main"><a href="/connect"${cur("connect")}>Connect an agent</a><a href="/local"${cur("local")}>Run it locally</a>` +
|
|
209
|
+
`<a href="${REPO_URL}" rel="noopener">GitHub</a></nav></header>` +
|
|
210
|
+
`<main id="main">${body}</main>` +
|
|
211
|
+
`<footer class="foot"><span>AgentRecall is open source (MIT). Memory you host here is private to your account.</span>` +
|
|
212
|
+
footerNav(nav) + `</footer>` +
|
|
213
|
+
`</div><script>${SCRIPT}</script></body></html>`;
|
|
214
|
+
}
|
|
215
|
+
/** The footer links, on every site page (the home page and the film use it too). Privacy and Support are this site's own pages. */
|
|
216
|
+
export function footerNav(current) {
|
|
217
|
+
const cur = (n) => (current === n ? ' aria-current="page"' : "");
|
|
218
|
+
return `<nav aria-label="Footer"><a href="${REPO_URL}" rel="noopener">GitHub</a><a href="/privacy"${cur("privacy")}>Privacy</a>` +
|
|
219
|
+
`<a href="/support"${cur("support")}>Support</a><a href="${TELEGRAM_URL}" rel="noopener">Telegram</a></nav>`;
|
|
220
|
+
}
|
|
221
|
+
/** A closed-by-default disclosure, so long copy blocks do not stack up on a phone. */
|
|
222
|
+
function fold(title, inner) {
|
|
223
|
+
return `<details class="fold"><summary>${esc(title)}</summary>${inner}</details>`;
|
|
224
|
+
}
|
|
225
|
+
/** A copyable block. `id` must be unique on the page. */
|
|
226
|
+
function cmd(id, text) {
|
|
227
|
+
return `<div class="cmd"><pre id="${esc(id)}" tabindex="0">${esc(text)}</pre><button type="button" class="copy" data-copy="${esc(id)}">Copy</button></div>`;
|
|
228
|
+
}
|
|
229
|
+
// ---- the instructions (shared by the pages and the .md files) -------------------
|
|
230
|
+
const GITHUB_SKILL = "https://raw.githubusercontent.com/Goldentrii/AgentRecall-X/main/SKILL.md";
|
|
231
|
+
const HOOKS_URL = `${REPO_URL}#hooks-claude-code-runs-the-loop-for-you`;
|
|
232
|
+
const claudeCode = (b) => `claude mcp add --scope user --transport http agent-recall ${b}/mcp`;
|
|
233
|
+
const codex = (b) => `codex mcp add agent-recall --url ${b}/mcp`;
|
|
234
|
+
const cursorJson = (b) => `{ "mcpServers": { "agent-recall": { "url": "${b}/mcp" } } }`;
|
|
235
|
+
export function hostedAgentPrompt(b) {
|
|
236
|
+
return [
|
|
237
|
+
`Connect yourself to my AgentRecall memory (one memory shared by all my agents). The MCP server is ${b}/mcp (Streamable HTTP, sign-in with OAuth).`,
|
|
238
|
+
``,
|
|
239
|
+
`- If you are Claude Code, run: ${claudeCode(b)}`,
|
|
240
|
+
` Then tell me to type /mcp, pick agent-recall and choose Authenticate, so I can sign in with GitHub in my browser.`,
|
|
241
|
+
`- If you are Codex, run: ${codex(b)}`,
|
|
242
|
+
` Then run: codex mcp login agent-recall (I sign in in the browser).`,
|
|
243
|
+
`- If you are Cursor, add this to ~/.cursor/mcp.json and tell me to sign in when Cursor prompts: ${cursorJson(b)}`,
|
|
244
|
+
`- Any other MCP client: add ${b}/mcp as a Streamable HTTP server and let it start the OAuth sign-in.`,
|
|
245
|
+
``,
|
|
246
|
+
`Do not ask for my password or any token: the sign-in happens in my browser. When it is connected, call session_start (project "auto") and tell me what it returned. Full instructions: ${b}/connect.md`,
|
|
247
|
+
].join("\n");
|
|
248
|
+
}
|
|
249
|
+
export function localAgentPrompt() {
|
|
250
|
+
return [
|
|
251
|
+
`Install AgentRecall locally for me (fully offline; memory is plain markdown in ~/.agent-recall/).`,
|
|
252
|
+
``,
|
|
253
|
+
`1. Add the MCP server for the client you are running in:`,
|
|
254
|
+
` - Claude Code: claude mcp add --scope user agent-recall -- npx -y agent-recall-mcp`,
|
|
255
|
+
` - Codex: codex mcp add agent-recall -- npx -y agent-recall-mcp`,
|
|
256
|
+
` - Cursor / Windsurf: add { "mcpServers": { "agent-recall": { "command": "npx", "args": ["-y", "agent-recall-mcp"] } } } to the client's MCP config.`,
|
|
257
|
+
`2. If you are Claude Code, also install the skill: mkdir -p ~/.claude/skills/agent-recall && curl -o ~/.claude/skills/agent-recall/SKILL.md ${GITHUB_SKILL}`,
|
|
258
|
+
`3. Optional, only after I say yes: npm i -g agent-recall-cli, then wire the hooks from ${HOOKS_URL} into ~/.claude/settings.json. Show me the exact change first; do not overwrite my existing hooks.`,
|
|
259
|
+
`4. Verify: restart if needed, call session_start (project "auto") and tell me what it returned.`,
|
|
260
|
+
``,
|
|
261
|
+
`Full instructions: ${REPO_URL}#local-install`,
|
|
262
|
+
].join("\n");
|
|
263
|
+
}
|
|
264
|
+
// ---- packing a local store ----------------------------------------------------------
|
|
265
|
+
const ROOT_LIST = ROOT_FILES.join(" ");
|
|
266
|
+
const PACK_NAME = "agent-recall-memory.tar";
|
|
267
|
+
/** bash / zsh: only memory files (root files that exist + projects/**.{md,json,jsonl,txt}, no dotfiles), POSIX ustar. */
|
|
268
|
+
export const PACK_BASH = `cd "\${AGENT_RECALL_ROOT:-$HOME/.agent-recall}" && { ls -1 ${ROOT_LIST} 2>/dev/null; ` +
|
|
269
|
+
`find projects -type f \\( -iname '*.md' -o -iname '*.json' -o -iname '*.jsonl' -o -iname '*.txt' \\) -not -path '*/.*' 2>/dev/null; } ` +
|
|
270
|
+
`| tar --format=ustar -cf "$HOME/${PACK_NAME}" -T -`;
|
|
271
|
+
/** PowerShell 5.1+/7 with the Windows system tar (bsdtar). */
|
|
272
|
+
export const PACK_POWERSHELL = [
|
|
273
|
+
`$r = if ($env:AGENT_RECALL_ROOT) { $env:AGENT_RECALL_ROOT } else { Join-Path $HOME '.agent-recall' }`,
|
|
274
|
+
`Push-Location -LiteralPath $r`,
|
|
275
|
+
`$n = (Get-Location).ProviderPath.TrimEnd('\\').Length + 1`,
|
|
276
|
+
`$f = @(@(${ROOT_FILES.map((x) => `'${x}'`).join(",")}) | Where-Object { Test-Path -LiteralPath $_ -PathType Leaf })`,
|
|
277
|
+
`$f += @(Get-ChildItem projects -Recurse -File -ErrorAction SilentlyContinue | Where-Object { $_.Extension -in '.md','.json','.jsonl','.txt' } | ForEach-Object { $_.FullName.Substring($n).Replace('\\','/') } | Where-Object { -not $_.Contains('/.') })`,
|
|
278
|
+
`$l = Join-Path $env:TEMP 'agent-recall-files.txt'`,
|
|
279
|
+
`[IO.File]::WriteAllLines($l, [string[]]$f)`,
|
|
280
|
+
`tar --format=ustar -cf (Join-Path $HOME '${PACK_NAME}') -T $l`,
|
|
281
|
+
`Pop-Location`,
|
|
282
|
+
].join("; ");
|
|
283
|
+
export function importAgentPrompt(b) {
|
|
284
|
+
return [
|
|
285
|
+
`Pack my local AgentRecall memory into one .tar file so I can import it into my hosted AgentRecall account. You cannot upload it: I do that myself in my browser.`,
|
|
286
|
+
``,
|
|
287
|
+
`- macOS / Linux / Git Bash (bash or zsh), run: ${PACK_BASH}`,
|
|
288
|
+
`- Windows PowerShell, run: ${PACK_POWERSHELL}`,
|
|
289
|
+
``,
|
|
290
|
+
`This writes ${PACK_NAME} in my home folder. It holds only memory files (projects/**, awareness, insights, identity card), never config.json, telemetry, keys or logs. A missing optional file is fine.`,
|
|
291
|
+
`Then tell me the full path of the file and ask me to open ${b}/connect, find "Import memory", choose that file and press Import. Do not send the file anywhere else. Full instructions: ${b}/connect.md`,
|
|
292
|
+
].join("\n");
|
|
293
|
+
}
|
|
294
|
+
// ---- legal pages -----------------------------------------------------------------
|
|
295
|
+
export const ISSUES_URL = `${REPO_URL}/issues`;
|
|
296
|
+
/** /privacy: PRIVACY.md rendered (see legal.ts). `policyHtml` is already safe HTML from markdown-lite. */
|
|
297
|
+
export function privacyPage(ctx, policyHtml) {
|
|
298
|
+
return layout("Privacy policy: AgentRecall", `<article class="legal">${policyHtml}</article>`, ctx, "privacy", "How the hosted AgentRecall service handles your data.");
|
|
299
|
+
}
|
|
300
|
+
/** /privacy when the shipped policy text could not be loaded: say so, never show partial text. */
|
|
301
|
+
export function privacyUnavailablePage(ctx) {
|
|
302
|
+
return layout("Privacy policy: AgentRecall", `<div class="panel msg"><h1>Privacy policy unavailable</h1>` +
|
|
303
|
+
`<p>This server could not load its privacy policy text just now. The same policy is on GitHub: <a href="${esc(DEFAULT_PRIVACY_URL)}" rel="noopener">PRIVACY.md</a>.</p></div>`, ctx, "none");
|
|
304
|
+
}
|
|
305
|
+
/** /support: the contact address is the one PRIVACY.md names (passed in, never typed here). */
|
|
306
|
+
export function supportPage(ctx, contact) {
|
|
307
|
+
const mail = contact === null ? "" :
|
|
308
|
+
`<section class="panel"><h2>Email</h2><p>For account questions, data requests and deletion, write to ` +
|
|
309
|
+
`<a class="addr" href="mailto:${esc(contact)}">${esc(contact)}</a>.</p>` +
|
|
310
|
+
`<p>Please do not put personal data in public issues. Data requests are answered within one month, as the <a href="/privacy">privacy policy</a> says.</p></section>`;
|
|
311
|
+
return layout("Support: AgentRecall", `<div class="support"><h1>Support</h1>` +
|
|
312
|
+
`<p class="lede">AgentRecall is a free, early-stage project run by one person. Support is best effort: there is no support team and no guaranteed response time.</p>` +
|
|
313
|
+
mail +
|
|
314
|
+
`<section class="panel"><h2>Bugs and questions</h2><p>Open an issue on <a href="${ISSUES_URL}" rel="noopener">GitHub</a>. Issues are public, so they also help the next person with the same problem.</p></section>` +
|
|
315
|
+
`<section class="panel"><h2>Community</h2><p>Talk to other users in the <a href="${TELEGRAM_URL}" rel="noopener">Telegram group</a>.</p></section></div>`, ctx, "support", "How to get help with AgentRecall.");
|
|
316
|
+
}
|
|
317
|
+
export function connectMarkdown(b, hosted) {
|
|
318
|
+
return [
|
|
319
|
+
`# Connect an agent to AgentRecall (hosted)`,
|
|
320
|
+
``,
|
|
321
|
+
hosted
|
|
322
|
+
? `AgentRecall is one memory shared by every AI agent a person uses. This server is ${b}. MCP endpoint: ${b}/mcp (Streamable HTTP, OAuth 2.1 sign-in with GitHub). Sign-up is free.`
|
|
323
|
+
: `Hosted sign-in is not configured on this server (${b}). Use a local install instead: ${b}/local.md`,
|
|
324
|
+
``,
|
|
325
|
+
`You (the agent) cannot sign in for the human. The human signs in with their own browser. Do not ask for passwords or tokens.`,
|
|
326
|
+
``,
|
|
327
|
+
`## Steps`,
|
|
328
|
+
``,
|
|
329
|
+
`1. Add the server to your MCP client.`,
|
|
330
|
+
` - Claude Code: \`${claudeCode(b)}\` then tell the human to type /mcp, pick agent-recall, choose Authenticate.`,
|
|
331
|
+
` - Codex: \`${codex(b)}\` then \`codex mcp login agent-recall\`.`,
|
|
332
|
+
` - Cursor: add to ~/.cursor/mcp.json: \`${cursorJson(b)}\``,
|
|
333
|
+
` - claude.ai: Settings, Connectors, Add custom connector, URL ${b}/mcp`,
|
|
334
|
+
` - Any other client that supports Streamable HTTP with OAuth: give it ${b}/mcp and nothing else.`,
|
|
335
|
+
`2. The human signs in with GitHub in the browser window that opens. Their AgentRecall ID is created on first sign-in (for example gh-123456); no email is collected.`,
|
|
336
|
+
`3. Call \`session_start\` with \`project: "auto"\` and report what it returned.`,
|
|
337
|
+
``,
|
|
338
|
+
`## After connecting`,
|
|
339
|
+
``,
|
|
340
|
+
`- Dashboard (human, browser): ${b}/connect shows the ID, connected agents (disconnect any), storage used, and "Download my memory".`,
|
|
341
|
+
`- Corrections you propose with \`check\` wait for the human to approve them at ${b}/review. Tell them it is waiting.`,
|
|
342
|
+
`- Loop: session_start first; remember for facts; check for corrections and before risky actions; session_end when done. Saying "noted" is not saving: only a tool call saves.`,
|
|
343
|
+
``,
|
|
344
|
+
...(hosted ? [
|
|
345
|
+
`## Import a local memory`,
|
|
346
|
+
``,
|
|
347
|
+
`Months of memory may already live in ~/.agent-recall on the human's computer. The human can bring it into this account. You cannot upload it: only the human, signed in in the browser, can (an agent token is refused on purpose, because imported corrections become always-followed rules).`,
|
|
348
|
+
``,
|
|
349
|
+
`1. Pack it. Only memory files are included, in POSIX ustar (a missing optional file is fine):`,
|
|
350
|
+
` - bash / zsh: \`${PACK_BASH}\``,
|
|
351
|
+
` - PowerShell: \`${PACK_POWERSHELL}\``,
|
|
352
|
+
` Result: ${PACK_NAME} in the home folder. Store root is $AGENT_RECALL_ROOT, else ~/.agent-recall.`,
|
|
353
|
+
` Rules (corrections, behaviour policies, personal profile, identity card) are NOT imported unless the human ticks "Also import always-follow rules": they become active for all agents at once.`,
|
|
354
|
+
`2. Tell the human to open ${b}/connect, find "Import memory", choose the file, pick "Add" (keeps everything already here, never overwrites) or "Replace" (type REPLACE; the old memory is kept 7 days, then deleted), and press Import.`,
|
|
355
|
+
`3. The result page lists what was imported, skipped (already present) and refused. Then call \`session_start\` and report what it returned.`,
|
|
356
|
+
``,
|
|
357
|
+
`Accepted: projects/<name>/** (.md .json .jsonl .txt) and the root files ${ROOT_FILES.join(", ")}. Never imported: config.json, telemetry, tmp, working-memory, logs, locks, vector indexes, dotfiles, links. Only import an archive the human made themselves.`,
|
|
358
|
+
``,
|
|
359
|
+
] : []),
|
|
360
|
+
`Local install instead: ${b}/local.md`,
|
|
361
|
+
``,
|
|
362
|
+
].join("\n");
|
|
363
|
+
}
|
|
364
|
+
export function localMarkdown(b) {
|
|
365
|
+
return [
|
|
366
|
+
`# Run AgentRecall locally`,
|
|
367
|
+
``,
|
|
368
|
+
`Fully offline. Memory is plain markdown in ~/.agent-recall/. By default nothing leaves the machine (the Supabase mirror, Telegram reports and cloud embeddings are all opt-in).`,
|
|
369
|
+
``,
|
|
370
|
+
`## Install (run these for the human)`,
|
|
371
|
+
``,
|
|
372
|
+
`- Claude Code: \`claude mcp add --scope user agent-recall -- npx -y agent-recall-mcp\``,
|
|
373
|
+
`- Codex: \`codex mcp add agent-recall -- npx -y agent-recall-mcp\``,
|
|
374
|
+
`- Cursor / Windsurf: \`{ "mcpServers": { "agent-recall": { "command": "npx", "args": ["-y", "agent-recall-mcp"] } } }\``,
|
|
375
|
+
`- VS Code (.vscode/mcp.json): \`{ "servers": { "agent-recall": { "command": "npx", "args": ["-y", "agent-recall-mcp"] } } }\``,
|
|
376
|
+
``,
|
|
377
|
+
`## Claude Code extras (optional)`,
|
|
378
|
+
``,
|
|
379
|
+
`- Skill: \`mkdir -p ~/.claude/skills/agent-recall && curl -o ~/.claude/skills/agent-recall/SKILL.md ${GITHUB_SKILL}\``,
|
|
380
|
+
`- Hooks that run the memory loop without agent discipline: \`npm i -g agent-recall-cli\`, then add the hooks from ${HOOKS_URL} to ~/.claude/settings.json. Show the human the exact change and get a yes first; never overwrite existing hooks.`,
|
|
381
|
+
``,
|
|
382
|
+
`## Verify`,
|
|
383
|
+
``,
|
|
384
|
+
`Call \`session_start\` with \`project: "auto"\` and report what it returned.`,
|
|
385
|
+
``,
|
|
386
|
+
`Prefer a hosted memory shared across devices? ${b}/connect.md`,
|
|
387
|
+
`Source and docs: ${REPO_URL}`,
|
|
388
|
+
``,
|
|
389
|
+
].join("\n");
|
|
390
|
+
}
|
|
391
|
+
export function llmsTxt(b) {
|
|
392
|
+
return [
|
|
393
|
+
`# AgentRecall`,
|
|
394
|
+
``,
|
|
395
|
+
`> One memory shared by every AI agent you use. Rules, corrections and project state follow the user from Claude Code to Codex to Cursor and any MCP client. Hosted (${b}/mcp, free, sign in with GitHub) or local and fully offline (npx -y agent-recall-mcp).`,
|
|
396
|
+
``,
|
|
397
|
+
`## Set up (for agents)`,
|
|
398
|
+
``,
|
|
399
|
+
`- [Connect to the hosted server](${b}/connect.md): add ${b}/mcp to your MCP client; the human signs in with GitHub`,
|
|
400
|
+
`- [Install locally](${b}/local.md): npx -y agent-recall-mcp, plain markdown in ~/.agent-recall/`,
|
|
401
|
+
``,
|
|
402
|
+
`## For humans`,
|
|
403
|
+
``,
|
|
404
|
+
`- [Website](${b}/): connect an agent or run it locally`,
|
|
405
|
+
`- [Dashboard](${b}/connect): your ID, connected agents, storage, download your memory`,
|
|
406
|
+
`- [Review corrections](${b}/review): approve or reject what your agents propose`,
|
|
407
|
+
``,
|
|
408
|
+
`## Docs`,
|
|
409
|
+
``,
|
|
410
|
+
`- [README](${REPO_URL}/blob/main/README.md)`,
|
|
411
|
+
`- [Hosted server](${REPO_URL}/blob/main/docs/hosted-server.md)`,
|
|
412
|
+
`- [Privacy policy](${b}/privacy)`,
|
|
413
|
+
`- [Support](${b}/support)`,
|
|
414
|
+
`- [AGENTS.md](${REPO_URL}/blob/main/AGENTS.md): lifecycle doctrine`,
|
|
415
|
+
``,
|
|
416
|
+
].join("\n");
|
|
417
|
+
}
|
|
418
|
+
// ---- hero art -------------------------------------------------------------
|
|
419
|
+
const HERO_ART = `<svg class="art" viewBox="0 0 460 380" role="img" aria-labelledby="hero-t hero-d">` +
|
|
420
|
+
`<title id="hero-t">One memory, every agent</title>` +
|
|
421
|
+
`<desc id="hero-d">Claude Code, Codex, Cursor and claude.ai all connect to one memory card. At session_start every agent gets the same card: the hard rules, such as ask before a version bump, and the project state.</desc>` +
|
|
422
|
+
`<path class="wire" d="M150 62C190 62 190 150 226 150"/><path class="wire" d="M150 138C190 138 200 168 226 168"/><path class="wire" d="M150 214C190 214 200 190 226 190"/><path class="wire" d="M150 290C190 290 190 210 226 210"/>` +
|
|
423
|
+
`<g><rect class="chip" x="8" y="40" width="142" height="44" rx="12"/><text x="24" y="68">Claude Code</text>` +
|
|
424
|
+
`<rect class="chip" x="8" y="116" width="142" height="44" rx="12"/><text x="24" y="144">Codex</text>` +
|
|
425
|
+
`<rect class="chip" x="8" y="192" width="142" height="44" rx="12"/><text x="24" y="220">Cursor</text>` +
|
|
426
|
+
`<rect class="chip" x="8" y="268" width="142" height="44" rx="12"/><text x="24" y="296">claude.ai</text></g>` +
|
|
427
|
+
`<rect class="back" x="250" y="40" width="214" height="296" rx="16" transform="rotate(5 352 188)"/>` +
|
|
428
|
+
`<rect class="back" x="244" y="34" width="214" height="296" rx="16" transform="rotate(2.5 346 182)"/>` +
|
|
429
|
+
`<rect class="face" x="232" y="26" width="216" height="304" rx="16"/>` +
|
|
430
|
+
`<circle class="dot" cx="422" cy="52" r="8"/>` +
|
|
431
|
+
`<text class="mono" x="252" y="58">session_start</text>` +
|
|
432
|
+
`<text class="head" x="252" y="96">Hard rules</text>` +
|
|
433
|
+
`<rect class="hl" x="246" y="112" width="190" height="30" rx="5"/><text class="hltext" x="258" y="133">Ask before a version bump</text>` +
|
|
434
|
+
`<circle class="dot" cx="260" cy="168" r="4"/><text x="274" y="173">Never push to main</text>` +
|
|
435
|
+
`<circle class="dot" cx="260" cy="198" r="4"/><text x="274" y="203">Use pnpm, not npm</text>` +
|
|
436
|
+
`<line class="rule" x1="252" y1="226" x2="428" y2="226"/>` +
|
|
437
|
+
`<text class="head" x="252" y="256">Project state</text>` +
|
|
438
|
+
`<text class="mono" x="252" y="282">goal ship the hosted site</text>` +
|
|
439
|
+
`<text class="mono" x="252" y="304">next review the PR</text>` +
|
|
440
|
+
`</svg>`;
|
|
441
|
+
// ---- pages ----------------------------------------------------------------
|
|
442
|
+
export function homePage(ctx) {
|
|
443
|
+
return layout("AgentRecall: one memory for every AI agent", `<section class="hero"><div>` +
|
|
444
|
+
`<h1>Teach one agent. Every agent remembers.</h1>` +
|
|
445
|
+
`<p class="lede">AgentRecall is one memory shared by Claude Code, Codex, Cursor, claude.ai and any MCP client. Your rules, corrections and project state follow you from tool to tool.</p>` +
|
|
446
|
+
`<div class="cta"><a class="btn" href="/connect">Connect an agent</a><a class="btn alt" href="/local">Run it locally</a></div>` +
|
|
447
|
+
`<p class="agentnote">Are you an AI agent? Read <a href="/connect.md">/connect.md</a> or <a href="/local.md">/local.md</a>.</p>` +
|
|
448
|
+
`</div>${HERO_ART}</section>` +
|
|
449
|
+
`<section class="doors" aria-label="Choose how to use AgentRecall">` +
|
|
450
|
+
`<article class="door"><h2>Connect an agent</h2><p>We host the memory. Sign in with GitHub, get your ID, add one URL to your agent.</p>` +
|
|
451
|
+
`<ul><li>Ready in about a minute</li><li>Free, stored in Frankfurt (EU)</li><li>One memory across devices and agents</li></ul>` +
|
|
452
|
+
`<a class="btn" href="/connect">Connect an agent</a></article>` +
|
|
453
|
+
`<article class="door local"><h2>Run it locally</h2><p>Everything stays on your machine, as plain markdown files you can read.</p>` +
|
|
454
|
+
`<ul><li>Works fully offline</li><li>One npx command, or let your agent install it</li><li>Optional hooks run the loop for you</li></ul>` +
|
|
455
|
+
`<a class="btn alt" href="/local">Install locally</a></article></section>` +
|
|
456
|
+
`<section class="block"><h2>How the hosted memory works</h2><ol class="steps">` +
|
|
457
|
+
`<li><strong>Sign in with GitHub</strong><span>Your AgentRecall ID is created on first sign-in. No email is collected.</span></li>` +
|
|
458
|
+
`<li><strong>Add the server URL</strong><span>One command for Claude Code, Codex or Cursor. Agents sign in through your browser.</span></li>` +
|
|
459
|
+
`<li><strong>Every agent remembers</strong><span>At the start of each session your agents load the same rules and project state.</span></li></ol></section>`, ctx, "home", "AgentRecall is one memory shared by every AI agent you use: Claude Code, Codex, Cursor, claude.ai and any MCP client. Hosted or fully local.");
|
|
460
|
+
}
|
|
461
|
+
export function connectSignInPage(ctx, v) {
|
|
462
|
+
return layout("Connect an agent: AgentRecall", `<section class="signin"><div>` +
|
|
463
|
+
`<h1>Connect an agent</h1><p class="lede">Sign in once. You get your own private memory and the exact commands to connect your agents.</p>` +
|
|
464
|
+
`<ul><li>Your AgentRecall ID, created on first sign-in. No email is collected.</li>` +
|
|
465
|
+
`<li>One command each for Claude Code, Codex, Cursor and claude.ai.</li>` +
|
|
466
|
+
`<li>See every connected agent and disconnect any of them.</li>` +
|
|
467
|
+
`<li>Download all of your memory whenever you like.</li></ul>` +
|
|
468
|
+
`<p class="small">Prefer to keep everything on your own machine? <a href="/local">Run it locally</a>.</p></div>` +
|
|
469
|
+
`<div class="panel"><h2>Sign in</h2><p class="sub">Free. The only cookie is the one that keeps you signed in for 30 minutes.</p>` +
|
|
470
|
+
(v.error ? `<div class="notice err" role="alert">${esc(v.error)}</div>` : "") +
|
|
471
|
+
`<form method="post" action="/connect/start">` +
|
|
472
|
+
v.providers.map((p, i) => `<button type="submit" class="btn${i === 0 ? "" : " alt"}" name="provider" value="${esc(p.name)}">Sign in with ${esc(p.label)}</button>`).join("") +
|
|
473
|
+
`</form><p class="small">Agents cannot use this page: it refuses API tokens.</p></div></section>`, ctx, "connect");
|
|
474
|
+
}
|
|
475
|
+
export function connectUnavailablePage(ctx) {
|
|
476
|
+
return layout("Connect an agent: AgentRecall", `<section class="msg"><h1>Hosted sign-in is not set up here</h1>` +
|
|
477
|
+
`<p class="lede">This server has no GitHub or Google sign-in configured, so it cannot create hosted accounts. You can still run AgentRecall on your own machine.</p>` +
|
|
478
|
+
`<div class="cta"><a class="btn" href="/local">Run it locally</a><a class="btn alt" href="/">Back to the home page</a></div></section>`, ctx, "connect");
|
|
479
|
+
}
|
|
480
|
+
export function messagePage(ctx, title, message, back) {
|
|
481
|
+
return layout(`${title}: AgentRecall`, `<section class="msg"><h1>${esc(title)}</h1><div class="notice err" role="alert">${esc(message)}</div>` +
|
|
482
|
+
`<p><a class="btn alt" href="${esc(back.href)}">${esc(back.label)}</a></p></section>`, ctx, "none");
|
|
483
|
+
}
|
|
484
|
+
export const TRIAL_RULE_SAY = "Remember this rule: always answer me in one short paragraph.";
|
|
485
|
+
export const TRIAL_ASK_SAY = "What rules do I have?";
|
|
486
|
+
/** The "See it work" card: three steps decided from server records (see trial.ts). Says only what those records show. */
|
|
487
|
+
function trialCard(t) {
|
|
488
|
+
const step = (n, title, body, state = "") => `<li data-step="${n}" data-done="${t.done[n - 1]}"${state ? ` class="${state}"` : ""}><div><div class="name">${n}. ${esc(title)}${t.done[n - 1] ? ` <span class="tick">✓ done</span>` : ""}</div>${body}</div></li>`;
|
|
489
|
+
const unknown = `<div class="meta">This could not be checked just now. Reload in a moment.</div>`;
|
|
490
|
+
const cap = t.capped ? `<div class="meta">Not found among your most recent rules.</div>` : "";
|
|
491
|
+
const s1 = step(1, "Connect an agent", t.done[0]
|
|
492
|
+
? `<div class="meta">An agent of yours has used your memory.</div>`
|
|
493
|
+
: `<div class="meta">Add one below, then ask it anything once, so the server sees it.</div><a class="btn small" href="#h-connect">Add an agent</a>`);
|
|
494
|
+
const s2 = t.waiting
|
|
495
|
+
? step(2, "Approve your rule", `<div class="meta">Your agent proposed a rule. Nothing is active until you approve it.</div><a class="btn small" href="/review">Review and approve your rule</a>`)
|
|
496
|
+
: step(2, "Teach it one rule", t.degraded ? unknown
|
|
497
|
+
: t.done[1]
|
|
498
|
+
? `<div class="meta">You have an active rule.</div>`
|
|
499
|
+
: `<div class="meta">Say this to your agent, then approve the rule it proposes on the review page.</div>${cap}${cmd("trial-rule", TRIAL_RULE_SAY)}`);
|
|
500
|
+
const ready = t.done[1]; // a second agent is only meaningful once a rule is active
|
|
501
|
+
const s3 = step(3, "Use a second agent", t.degraded ? unknown
|
|
502
|
+
: t.done[2]
|
|
503
|
+
? `<div class="meta">${t.proven ? "A different sign-in of yours made a call after your rule went live." : "Two sign-ins of yours made a call after your rule went live."}</div>`
|
|
504
|
+
: ready
|
|
505
|
+
? `<div class="meta">Open a different agent and ask it this. It should list your rule.</div>${cap}${cmd("trial-ask", TRIAL_ASK_SAY)}`
|
|
506
|
+
: `<div class="meta">Available once your rule is active.</div>`, !t.done[2] && !ready ? "muted" : "");
|
|
507
|
+
const names = ["connect an agent", "teach it one rule", "use a second agent"];
|
|
508
|
+
const status = t.next === null
|
|
509
|
+
? (t.proven
|
|
510
|
+
? `<div class="notice ok" role="status">A second agent has been active since your rule went live. <span class="meta">The records show a call, not that it read your rule; a new sign-in of the same agent counts too.</span></div>`
|
|
511
|
+
: `<div class="notice plain" role="status">Two sign-ins of yours have been active since your rule went live.</div>`)
|
|
512
|
+
: t.degraded && t.next > 1
|
|
513
|
+
? `<p class="sub">Some steps could not be checked just now.</p>`
|
|
514
|
+
: `<p class="sub">Next: ${t.waiting ? "approve your rule" : names[t.next - 1]}.</p>`;
|
|
515
|
+
return `<section class="panel trial" aria-labelledby="h-trial"><h2 id="h-trial">See it work</h2>` +
|
|
516
|
+
`<p class="sub" data-trial-count="${t.count}">${t.count} of 3 steps done.${t.count < 3 ? " It takes about three minutes." : ""}</p>${status}` +
|
|
517
|
+
`<ol class="rows">${s1}${s2}${s3}</ol></section>`;
|
|
518
|
+
}
|
|
519
|
+
const day = (iso) => `<time datetime="${esc(iso)}">${esc(iso.slice(0, 10))}</time>`;
|
|
520
|
+
function ago(iso, now) {
|
|
521
|
+
const s = Math.floor((now - Date.parse(iso)) / 1000);
|
|
522
|
+
if (!Number.isFinite(s) || s < 0)
|
|
523
|
+
return iso.slice(0, 10);
|
|
524
|
+
if (s < 60)
|
|
525
|
+
return "just now";
|
|
526
|
+
if (s < 3600)
|
|
527
|
+
return `${Math.floor(s / 60)} min ago`;
|
|
528
|
+
if (s < 86400)
|
|
529
|
+
return `${Math.floor(s / 3600)} h ago`;
|
|
530
|
+
if (s < 30 * 86400)
|
|
531
|
+
return `${Math.floor(s / 86400)} d ago`;
|
|
532
|
+
return iso.slice(0, 10);
|
|
533
|
+
}
|
|
534
|
+
const hidden = (name, value) => `<input type="hidden" name="${esc(name)}" value="${esc(value)}">`;
|
|
535
|
+
const mb = (n) => `${Math.round((n / (1024 * 1024)) * 10) / 10} MB`;
|
|
536
|
+
export function dashboardPage(ctx, v) {
|
|
537
|
+
const b = ctx.base;
|
|
538
|
+
const pct = v.quotaBytes > 0 ? Math.min(100, (v.usedBytes / v.quotaBytes) * 100) : 0;
|
|
539
|
+
const width = pct <= 0 ? "w0" : pct <= 5 ? "w5" : pct <= 10 ? "w10" : pct <= 20 ? "w20" : pct <= 40 ? "w40" : pct <= 60 ? "w60" : pct <= 80 ? "w80" : "w100";
|
|
540
|
+
const tabs = [
|
|
541
|
+
["Claude Code", cmd("c1", claudeCode(b)), `<p class="step-note">Then type <code>/mcp</code> inside Claude Code, pick <strong>agent-recall</strong> and choose <strong>Authenticate</strong>. Sign in with the same GitHub account.</p>`],
|
|
542
|
+
["Codex", cmd("c2", codex(b)), `<p class="step-note">Codex opens the sign-in page itself. If you closed it, run <code>codex mcp login agent-recall</code>.</p>`],
|
|
543
|
+
["Cursor", cmd("c3", `{\n "mcpServers": {\n "agent-recall": { "url": "${b}/mcp" }\n }\n}`), `<p class="step-note">Add this to <code>~/.cursor/mcp.json</code>, then sign in when Cursor prompts you.</p>`],
|
|
544
|
+
["claude.ai", cmd("c4", `${b}/mcp`), `<p class="step-note">Settings, Connectors, <strong>Add custom connector</strong>, paste this URL (on plans where custom connectors are available).</p>`],
|
|
545
|
+
["Other clients", cmd("c5", `${b}/mcp`), `<p class="step-note">Any MCP client that supports Streamable HTTP with OAuth: give it this URL and nothing else. It finds the sign-in from the server’s response.</p>`],
|
|
546
|
+
];
|
|
547
|
+
return layout("Your AgentRecall: connect an agent", `<div class="who"><div><h1>Your AgentRecall</h1><p>Signed in with ${esc(v.account)}</p></div>` +
|
|
548
|
+
`<form method="post" action="/connect/logout">${hidden("csrf", v.csrf)}<button type="submit" class="btn alt small">Sign out</button></form></div>` +
|
|
549
|
+
(v.notice ? `<div class="notice ${v.notice.kind}" role="status">${esc(v.notice.text)}</div>` : "") +
|
|
550
|
+
trialCard(v.trial) +
|
|
551
|
+
`<section class="panel" aria-labelledby="h-id"><h2 id="h-id">Your AgentRecall ID</h2>` +
|
|
552
|
+
`<p class="sub">It names your private memory on this server. It was created when you first signed in; no email is collected. You never type it into an agent: signing in connects an agent to it.</p>` +
|
|
553
|
+
`<div class="idrow"><span class="idval" id="uid">${esc(v.uid)}</span><button type="button" class="copy" data-copy="uid">Copy</button></div></section>` +
|
|
554
|
+
`<section class="panel" aria-labelledby="h-connect"><h2 id="h-connect">Connect an agent</h2>` +
|
|
555
|
+
`<p class="sub">Pick your client and paste. Each agent signs in with your GitHub account in the browser, then shares this one memory.</p>` +
|
|
556
|
+
`<div class="tabs">` +
|
|
557
|
+
tabs.map((_, i) => `<input type="radio" name="client" id="t${i + 1}"${i === 0 ? " checked" : ""} aria-label="${esc(tabs[i][0])}">`).join("") +
|
|
558
|
+
`<div class="tablist" aria-hidden="true">${tabs.map((t, i) => `<label for="t${i + 1}">${esc(t[0])}</label>`).join("")}</div>` +
|
|
559
|
+
`<div class="panels">${tabs.map((t, i) => `<div class="p" id="p${i + 1}">${t[1]}${t[2]}</div>`).join("")}</div></div>` +
|
|
560
|
+
`<div class="agentprompt"><h3>Or let your agent do it</h3>` +
|
|
561
|
+
fold("Show the prompt to paste", `<p class="step-note">Paste this into any agent. It runs the right command for itself and asks you to sign in.</p>${cmd("prompt", hostedAgentPrompt(b))}`) + `</div></section>` +
|
|
562
|
+
`<section class="panel" aria-labelledby="h-agents"><h2 id="h-agents">Your agents</h2>` +
|
|
563
|
+
`<p class="sub">${esc(v.agents.length)} ${v.agents.length === 1 ? "agent shares" : "agents share"} this memory. Every agent that signed in or holds a token is listed, with its last activity. Names are what each app calls itself; AgentRecall cannot verify them. Disconnect ends an OAuth sign-in at once; to revoke a token, ask the server operator.</p>` +
|
|
564
|
+
(v.agents.length === 0
|
|
565
|
+
? `<p class="empty">No agent is connected yet. Add one above; it appears here after you sign in from it.</p>`
|
|
566
|
+
: `<ul class="rows">${v.agents.map((a) => `<li><div><div class="name">${esc(a.name)} <span class="meta">(self-reported name)</span></div>` +
|
|
567
|
+
`<div class="meta">${esc(a.signIn)}. Connected ${day(a.connectedAt)}. ${a.lastSeen ? `Last active <time datetime="${esc(a.lastSeen)}">${esc(ago(a.lastSeen, v.now))}</time>${a.lastTool ? `, last tool ${esc(a.lastTool)}` : ""}` : "No activity yet"}</div></div>` +
|
|
568
|
+
(a.grantId
|
|
569
|
+
? `<form method="post" action="/connect/disconnect">${hidden("grant", a.grantId)}${hidden("csrf", v.csrf)}<button type="submit" class="btn danger small" aria-label="Disconnect ${esc(a.name)}">Disconnect</button></form>`
|
|
570
|
+
: "") + `</li>`).join("")}</ul>`) +
|
|
571
|
+
`</section>` +
|
|
572
|
+
`<div class="pair"><section class="panel" aria-labelledby="h-store"><h2 id="h-store">Your memory</h2>` +
|
|
573
|
+
`<p class="sub">Storage used${v.quotaBytes > 0 ? ` of ${esc(mb(v.quotaBytes))}` : ""}.</p>` +
|
|
574
|
+
`<div class="bar" role="img" aria-label="${esc(mb(v.usedBytes))} used"><b class="${width}${pct >= 100 ? " full" : ""}"></b></div>` +
|
|
575
|
+
`<p>${esc(mb(v.usedBytes))} used${v.quotaBytes > 0 && pct >= 100 ? ". Full: reading still works, new memories are refused." : ""}</p>` +
|
|
576
|
+
`<form method="post" action="/connect/download">${hidden("csrf", v.csrf)}<button type="submit" class="btn alt small">Download my memory (.tar)</button></form>` +
|
|
577
|
+
`<p class="small">All your files as plain markdown and JSON, yours to keep.</p></section>` +
|
|
578
|
+
`<section class="panel" aria-labelledby="h-rev"><h2 id="h-rev">Corrections</h2>` +
|
|
579
|
+
`<p class="sub">Your agents can only propose an always-follow rule. Nothing becomes active until you approve it.</p>` +
|
|
580
|
+
`<p>${v.pending === 0 ? "Nothing is waiting for your review." : `<strong>${esc(v.pending)}</strong> ${v.pending === 1 ? "correction is" : "corrections are"} waiting for your review.`}</p>` +
|
|
581
|
+
`<a class="btn${v.pending > 0 ? "" : " alt"} small" href="/review">Review corrections</a></section></div>` +
|
|
582
|
+
`<section class="panel imp" aria-labelledby="h-imp"><h2 id="h-imp">Import memory</h2>` +
|
|
583
|
+
`<p class="sub">Already have a memory on your own computer? Bring it here so every agent shares it. Pack it with one command, then upload the file.</p>` +
|
|
584
|
+
`<div class="notice err" role="note"><strong>Only import an archive you made yourself.</strong> Its rules become active for all your agents.</div>` +
|
|
585
|
+
`<h3>1. Pack your local memory</h3>` +
|
|
586
|
+
`<p class="step-note">Only memory files are packed (never config, keys, logs or telemetry). The store is <code>$AGENT_RECALL_ROOT</code>, else <code>~/.agent-recall</code>. Writes <code>${esc(PACK_NAME)}</code> in your home folder.</p>` +
|
|
587
|
+
fold("PowerShell (Windows)", cmd("i1", PACK_POWERSHELL)) +
|
|
588
|
+
fold("bash / zsh (macOS, Linux)", cmd("i2", PACK_BASH)) +
|
|
589
|
+
fold("Or let your agent pack it", `<p class="step-note">It cannot upload for you; it tells you where the file is.</p>${cmd("i3", importAgentPrompt(b))}`) +
|
|
590
|
+
`<h3>2. Upload it</h3>` +
|
|
591
|
+
`<form method="post" action="/connect/import" enctype="multipart/form-data">${hidden("csrf", v.csrf)}` +
|
|
592
|
+
`<label class="opt"><input type="radio" name="mode" value="add" checked> <strong>Add</strong>: keep everything already here; only files that do not exist yet are added, nothing is overwritten.</label>` +
|
|
593
|
+
`<label class="opt"><input type="radio" name="mode" value="replace"> <strong>Replace</strong>: the archive takes the place of your memory. What is here now is kept for 7 days, then deleted.</label>` +
|
|
594
|
+
`<label class="opt" for="confirm">To use Replace, type <code>REPLACE</code>:</label><input type="text" id="confirm" name="confirm" autocomplete="off" maxlength="16">` +
|
|
595
|
+
`${hidden("rules_seen", "1")}<label class="opt"><input type="checkbox" name="rules" value="1"> Also import always-follow rules (corrections). <span class="small">Off by default: rules in an archive become active for all your agents at once.</span></label>` +
|
|
596
|
+
`<label class="opt" for="archive">Memory archive (.tar)</label><input type="file" id="archive" name="archive" accept=".tar,application/x-tar" required>` +
|
|
597
|
+
`<button type="submit" class="btn small">Import memory</button></form>` +
|
|
598
|
+
`<p class="small">Limits: ${esc(mb(DEFAULT_IMPORT_LIMITS.maxFileBytes))} per file, ${esc(DEFAULT_IMPORT_LIMITS.maxEntries)} entries, and it must fit your storage. Your connected agents are not touched.</p></section>`, ctx, "connect");
|
|
599
|
+
}
|
|
600
|
+
export function importResultPage(ctx, r) {
|
|
601
|
+
const x = r.refused;
|
|
602
|
+
const refused = x.path + x.type + x.size + x.special + x.duplicate;
|
|
603
|
+
const li = (n, t) => (n > 0 ? `<li>${esc(n)} ${t}</li>` : "");
|
|
604
|
+
return layout("Memory imported: AgentRecall", `<section class="msg"><h1>Memory imported</h1>` +
|
|
605
|
+
`<div class="notice ok" role="status">${esc(r.imported)} ${r.imported === 1 ? "file was" : "files were"} ${r.mode === "replace" ? "imported. Your previous memory is kept for 7 days, then deleted." : "added."}</div>` +
|
|
606
|
+
`<ul><li><strong>${esc(r.imported)}</strong> imported (${esc(mb(r.bytes))})${r.projects.length ? ` into ${r.projects.length} ${r.projects.length === 1 ? "project" : "projects"}: ${esc(r.projects.slice(0, 20).join(", "))}${r.projects.length > 20 ? ", …" : ""}` : ""}</li>` +
|
|
607
|
+
li(r.skippedExisting, "left as they were (the file already existed here; nothing was overwritten)") +
|
|
608
|
+
li(refused, `left out: ${[x.type && `${x.type} not part of a memory (config, telemetry, other file types)`, x.path && `${x.path} with an unsafe path`, x.size && `${x.size} too large`, x.special && `${x.special} links or special files`, x.duplicate && `${x.duplicate} duplicates or name clashes`].filter(Boolean).map(String).map(esc).join("; ")}`) +
|
|
609
|
+
`<li><strong>${esc(r.alwaysFollow)}</strong> always-follow ${r.alwaysFollow === 1 ? "correction is" : "corrections are"} now active for your agents.</li>${r.rulesSkipped > 0 ? `<li><strong>${esc(r.rulesSkipped)}</strong> always-follow ${r.rulesSkipped === 1 ? "rule was" : "rules were"} not imported. Import again with the box ticked to include them.</li>` : ""}</ul>` +
|
|
610
|
+
(r.samples.length ? `<p class="small">Left out, for example: ${r.samples.map((p) => `<code>${esc(p)}</code>`).join(", ")}</p>` : "") +
|
|
611
|
+
`<p><a class="btn" href="/connect">Back to your dashboard</a></p></section>`, ctx, "none");
|
|
612
|
+
}
|
|
613
|
+
export function localPage(ctx) {
|
|
614
|
+
return layout("Run AgentRecall locally", `<section class="block"><h1>Run it locally</h1>` +
|
|
615
|
+
`<p class="lede">Fully offline. Your memory is plain markdown in <code>~/.agent-recall/</code>. By default nothing leaves your machine.</p></section>` +
|
|
616
|
+
`<section class="panel" aria-labelledby="h-ai"><h2 id="h-ai">Let your agent install it</h2>` +
|
|
617
|
+
`<p class="sub">Paste this into Claude Code, Codex or Cursor. The agent installs the server, the skill and (if you say yes) the hooks.</p>` +
|
|
618
|
+
cmd("lprompt", localAgentPrompt()) + `</section>` +
|
|
619
|
+
`<section class="panel" aria-labelledby="h-man"><h2 id="h-man">Or do it yourself</h2>` +
|
|
620
|
+
`<h3>Claude Code</h3>${cmd("l1", "claude mcp add --scope user agent-recall -- npx -y agent-recall-mcp")}` +
|
|
621
|
+
`<h3>Codex</h3>${cmd("l2", "codex mcp add agent-recall -- npx -y agent-recall-mcp")}` +
|
|
622
|
+
`<h3>Cursor, Windsurf</h3>${cmd("l3", `{ "mcpServers": { "agent-recall": { "command": "npx", "args": ["-y", "agent-recall-mcp"] } } }`)}` +
|
|
623
|
+
`<h3>Claude Code skill</h3>${cmd("l4", `mkdir -p ~/.claude/skills/agent-recall\ncurl -o ~/.claude/skills/agent-recall/SKILL.md ${GITHUB_SKILL}`)}` +
|
|
624
|
+
`<p class="step-note">Optional hooks make Claude Code run the memory loop for you: install <code>npm i -g agent-recall-cli</code> and add the hooks listed in the <a href="${esc(HOOKS_URL)}" rel="noopener">README</a>.</p></section>` +
|
|
625
|
+
`<section class="panel" aria-labelledby="h-what"><h2 id="h-what">What “local” means</h2>` +
|
|
626
|
+
`<ul><li>Works with no network. Memory lives in <code>~/.agent-recall/</code> as markdown you can read, edit and back up.</li>` +
|
|
627
|
+
`<li>Nothing is sent anywhere by default. The Supabase mirror, Telegram reports and cloud embeddings are all opt-in.</li>` +
|
|
628
|
+
`<li>Want one memory across devices instead? <a href="/connect">Connect an agent</a> to the hosted server.</li></ul></section>`, ctx, "local", "Install AgentRecall locally: one npx command, plain markdown memory on your own machine, fully offline.");
|
|
629
|
+
}
|
|
630
|
+
//# sourceMappingURL=site-pages.js.map
|