myagentmemory 0.4.15 → 0.4.16

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.
@@ -57,12 +57,102 @@ function securityHeaders(contentType) {
57
57
  "X-Content-Type-Options": "nosniff",
58
58
  };
59
59
  }
60
+ const ACTIVATION_PAGE_STYLES = `
61
+ :root{color-scheme:light;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172033;background:#f4f7fb;font-synthesis:none}
62
+ *{box-sizing:border-box}
63
+ body{min-height:100vh;margin:0;padding:2rem 1.25rem;display:grid;place-items:center;background:radial-gradient(circle at 12% 0%,#e8f0ff 0,transparent 38rem),radial-gradient(circle at 100% 100%,#eef2ff 0,transparent 32rem),#f7f9fc}
64
+ main{width:min(100%,34rem)}
65
+ .skip-link{position:fixed;z-index:1;top:1rem;left:1rem;padding:.65rem .8rem;border-radius:.55rem;background:#172033;color:#fff;font-weight:700;transform:translateY(-200%)}
66
+ .skip-link:focus{transform:translateY(0)}
67
+ .brand{display:flex;align-items:center;gap:.75rem;margin:0 0 1.25rem .25rem;color:#33415c;font-size:.875rem;font-weight:700;letter-spacing:.01em}
68
+ .mark{width:2.25rem;height:2.25rem;display:grid;place-items:center;border-radius:.7rem;background:linear-gradient(145deg,#172033,#3159b8);color:#fff;box-shadow:0 .5rem 1.25rem rgba(35,65,130,.2);font-size:1.05rem;letter-spacing:-.08em}
69
+ .card{padding:clamp(1.5rem,5vw,2.5rem);border:1px solid rgba(205,216,231,.9);border-radius:1.5rem;background:rgba(255,255,255,.94);box-shadow:0 1.5rem 4rem rgba(32,51,84,.12),0 .125rem .375rem rgba(32,51,84,.06);backdrop-filter:blur(1rem)}
70
+ .eyebrow{display:inline-flex;align-items:center;gap:.45rem;margin:0 0 1rem;padding:.42rem .7rem;border:1px solid #d9e4f7;border-radius:999px;background:#f3f7ff;color:#315798;font-size:.78rem;font-weight:750;letter-spacing:.03em;text-transform:uppercase}
71
+ .eyebrow::before{content:"";width:.45rem;height:.45rem;border-radius:50%;background:#2b67d1;box-shadow:0 0 0 .22rem #dbe8ff}
72
+ h1{margin:0;color:#141d2c;font-size:clamp(2rem,7vw,2.75rem);line-height:1.06;letter-spacing:-.045em;text-wrap:balance}
73
+ .intro{margin:.9rem 0 1.75rem;color:#526176;font-size:1.05rem;line-height:1.55}
74
+ form{display:grid;gap:.75rem}
75
+ label{color:#29364a;font-size:.9rem;font-weight:700}
76
+ input{width:100%;min-height:3.25rem;padding:.8rem 3.5rem .8rem 1rem;border:1px solid #bcc8d8;border-radius:.8rem;background:#fff;color:#172033;font:inherit;box-shadow:inset 0 1px 2px rgba(24,39,65,.04)}
77
+ input::placeholder{color:#8a96a7}
78
+ input:hover{border-color:#92a2b8}
79
+ input:focus-visible{outline:0;border-color:#2b67d1;box-shadow:0 0 0 .25rem rgba(43,103,209,.15)}
80
+ button{min-height:3.35rem;margin-top:.25rem;padding:.85rem 1rem;border:1px solid #172033;border-radius:.8rem;background:linear-gradient(180deg,#24334a,#172033);color:#fff;font:inherit;font-weight:750;cursor:pointer;box-shadow:0 .55rem 1.2rem rgba(23,32,51,.18);touch-action:manipulation;transition:transform .15s}
81
+ button:hover{background:linear-gradient(180deg,#2d405c,#1d2a40);box-shadow:0 .7rem 1.4rem rgba(23,32,51,.23);transform:translateY(-1px)}
82
+ button:active{transform:translateY(0)}
83
+ button:focus-visible,summary:focus-visible{outline:.2rem solid rgba(43,103,209,.32);outline-offset:.18rem}
84
+ .terminal-note{margin:.8rem 0 0;color:#6a7789;font-size:.85rem;text-align:center}
85
+ .error{margin:0 0 1rem;padding:.8rem 1rem;border:1px solid #efb8bd;border-radius:.75rem;background:#fff3f4;color:#982631;font-size:.9rem;line-height:1.45}
86
+ details{margin-top:1.5rem;padding-top:1.25rem;border-top:1px solid #e2e8f0;color:#5b687a;font-size:.85rem;line-height:1.55}
87
+ summary{color:#46566d;font-weight:700;cursor:pointer;list-style-position:outside;touch-action:manipulation}
88
+ details p{margin:.8rem 0 0}
89
+ .never-sent{padding:.75rem .85rem;border-radius:.65rem;background:#f5f7fa;color:#536176}
90
+ .success{display:grid;place-items:center;width:3.5rem;height:3.5rem;margin-bottom:1.4rem;border-radius:1rem;background:#eaf7ef;color:#197542;font-size:1.65rem;font-weight:800;box-shadow:inset 0 0 0 1px #c9ead6}
91
+ .completion .intro{margin-bottom:0}
92
+ @media (max-width:30rem){body{padding:1rem}.brand{margin-left:.1rem}.card{border-radius:1.15rem}h1{font-size:2rem}}
93
+ @media (prefers-reduced-motion:reduce){input,button{transition:none}}
94
+ `;
60
95
  function activationPage(action, error) {
61
- const errorHtml = error ? `<p class="error">${error}</p>` : "";
62
- return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>Activate AgentMemory</title><style>body{font:16px system-ui;max-width:34rem;margin:10vh auto;padding:0 1.5rem;color:#18212b}form{display:grid;gap:1rem}input,button{font:inherit;padding:.8rem;border-radius:.5rem;border:1px solid #aab4bf}button{background:#18212b;color:#fff;cursor:pointer}.muted{color:#586574}.error{color:#a21d24}</style></head><body><h1>Activate AgentMemory</h1><p>Enter an email address to enable the free daily agent-session allowance on this device.</p>${errorHtml}<form method="post" action="${action}"><label>Email <input type="email" name="email" autocomplete="email" maxlength="254" required autofocus></label><button type="submit">Activate and return to terminal</button></form><p class="muted">The AgentMemory CLI sends your email plus core, bundle, platform, architecture, and release-channel metadata to the private activation service. D1 stores a daily count of opaque SessionStart operations for your normalized email. The request never includes memory, session content, queries, repository paths, raw agent session identifiers, IP addresses, or user-agent strings. Activation records expire after 365 days without use.</p></body></html>`;
96
+ const errorHtml = error ? `<p class="error" id="activation-error" role="alert">${error}</p>` : "";
97
+ const describedBy = error ? "activation-error terminal-note" : "terminal-note";
98
+ const autofocus = error ? " autofocus" : "";
99
+ return `<!doctype html>
100
+ <html lang="en">
101
+ <head>
102
+ <meta charset="utf-8">
103
+ <meta name="viewport" content="width=device-width, initial-scale=1">
104
+ <meta name="theme-color" content="#f4f7fb">
105
+ <title>Activate AgentMemory</title>
106
+ <style>${ACTIVATION_PAGE_STYLES}</style>
107
+ </head>
108
+ <body>
109
+ <a class="skip-link" href="#activation">Skip to Activation</a>
110
+ <main id="activation">
111
+ <div class="brand" translate="no"><span class="mark" aria-hidden="true">AM</span><span>AgentMemory</span></div>
112
+ <section class="card" aria-labelledby="activation-title">
113
+ <p class="eyebrow">Free daily allowance</p>
114
+ <h1 id="activation-title">Activate This Device</h1>
115
+ <p class="intro">Use your email to enable AgentMemory Pro for your local agent sessions.</p>
116
+ <form method="post" action="${action}">
117
+ <label for="email">Email address</label>
118
+ ${errorHtml}
119
+ <input id="email" type="email" name="email" autocomplete="email" inputmode="email" spellcheck="false" placeholder="you@example.com…" maxlength="254" required${autofocus} aria-describedby="${describedBy}">
120
+ <button type="submit">Activate AgentMemory</button>
121
+ </form>
122
+ <p class="terminal-note" id="terminal-note">Your terminal will finish setup after activation.</p>
123
+ <details>
124
+ <summary>What’s shared during activation</summary>
125
+ <p>Your email identifies your free daily allowance. The CLI also sends core and bundle versions, platform, architecture, and release channel. The service stores a daily count of opaque session-start operations. Activation records expire after 365 days without use.</p>
126
+ <p class="never-sent"><strong>Never sent:</strong> The request never includes memory, session content, queries, repository paths, raw agent session identifiers, IP addresses, or user-agent strings.</p>
127
+ </details>
128
+ </section>
129
+ </main>
130
+ </body>
131
+ </html>`;
63
132
  }
64
133
  function completionPage() {
65
- return '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>AgentMemory activated</title></head><body><h1>Activation complete</h1><p>You can close this tab and return to the terminal.</p></body></html>';
134
+ return `<!doctype html>
135
+ <html lang="en">
136
+ <head>
137
+ <meta charset="utf-8">
138
+ <meta name="viewport" content="width=device-width, initial-scale=1">
139
+ <meta name="theme-color" content="#f4f7fb">
140
+ <title>AgentMemory activated</title>
141
+ <style>${ACTIVATION_PAGE_STYLES}</style>
142
+ </head>
143
+ <body>
144
+ <a class="skip-link" href="#completion">Skip to Activation Status</a>
145
+ <main id="completion">
146
+ <div class="brand" translate="no"><span class="mark" aria-hidden="true">AM</span><span>AgentMemory</span></div>
147
+ <section class="card completion" aria-labelledby="completion-title">
148
+ <div class="success" aria-hidden="true">✓</div>
149
+ <p class="eyebrow">Device activated</p>
150
+ <h1 id="completion-title">You’re All Set</h1>
151
+ <p class="intro">Return to your terminal to finish installing AgentMemory Pro. You can close this tab.</p>
152
+ </section>
153
+ </main>
154
+ </body>
155
+ </html>`;
66
156
  }
67
157
  function send(response, status, body, contentType = "text/html; charset=utf-8") {
68
158
  response.writeHead(status, securityHeaders(contentType));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagentmemory",
3
- "version": "0.4.15",
3
+ "version": "0.4.16",
4
4
  "description": "agentmemory (agent-memory) is persistent memory for coding agents (Claude Code, OpenAI Codex, Cursor, Agent) with qmd-powered semantic search across daily logs, long-term memory, and scratchpad",
5
5
  "main": "./dist/core.js",
6
6
  "types": "./dist/core.d.ts",
@@ -94,13 +94,104 @@ function securityHeaders(contentType: string): Record<string, string> {
94
94
  };
95
95
  }
96
96
 
97
+ const ACTIVATION_PAGE_STYLES = `
98
+ :root{color-scheme:light;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172033;background:#f4f7fb;font-synthesis:none}
99
+ *{box-sizing:border-box}
100
+ body{min-height:100vh;margin:0;padding:2rem 1.25rem;display:grid;place-items:center;background:radial-gradient(circle at 12% 0%,#e8f0ff 0,transparent 38rem),radial-gradient(circle at 100% 100%,#eef2ff 0,transparent 32rem),#f7f9fc}
101
+ main{width:min(100%,34rem)}
102
+ .skip-link{position:fixed;z-index:1;top:1rem;left:1rem;padding:.65rem .8rem;border-radius:.55rem;background:#172033;color:#fff;font-weight:700;transform:translateY(-200%)}
103
+ .skip-link:focus{transform:translateY(0)}
104
+ .brand{display:flex;align-items:center;gap:.75rem;margin:0 0 1.25rem .25rem;color:#33415c;font-size:.875rem;font-weight:700;letter-spacing:.01em}
105
+ .mark{width:2.25rem;height:2.25rem;display:grid;place-items:center;border-radius:.7rem;background:linear-gradient(145deg,#172033,#3159b8);color:#fff;box-shadow:0 .5rem 1.25rem rgba(35,65,130,.2);font-size:1.05rem;letter-spacing:-.08em}
106
+ .card{padding:clamp(1.5rem,5vw,2.5rem);border:1px solid rgba(205,216,231,.9);border-radius:1.5rem;background:rgba(255,255,255,.94);box-shadow:0 1.5rem 4rem rgba(32,51,84,.12),0 .125rem .375rem rgba(32,51,84,.06);backdrop-filter:blur(1rem)}
107
+ .eyebrow{display:inline-flex;align-items:center;gap:.45rem;margin:0 0 1rem;padding:.42rem .7rem;border:1px solid #d9e4f7;border-radius:999px;background:#f3f7ff;color:#315798;font-size:.78rem;font-weight:750;letter-spacing:.03em;text-transform:uppercase}
108
+ .eyebrow::before{content:"";width:.45rem;height:.45rem;border-radius:50%;background:#2b67d1;box-shadow:0 0 0 .22rem #dbe8ff}
109
+ h1{margin:0;color:#141d2c;font-size:clamp(2rem,7vw,2.75rem);line-height:1.06;letter-spacing:-.045em;text-wrap:balance}
110
+ .intro{margin:.9rem 0 1.75rem;color:#526176;font-size:1.05rem;line-height:1.55}
111
+ form{display:grid;gap:.75rem}
112
+ label{color:#29364a;font-size:.9rem;font-weight:700}
113
+ input{width:100%;min-height:3.25rem;padding:.8rem 3.5rem .8rem 1rem;border:1px solid #bcc8d8;border-radius:.8rem;background:#fff;color:#172033;font:inherit;box-shadow:inset 0 1px 2px rgba(24,39,65,.04)}
114
+ input::placeholder{color:#8a96a7}
115
+ input:hover{border-color:#92a2b8}
116
+ input:focus-visible{outline:0;border-color:#2b67d1;box-shadow:0 0 0 .25rem rgba(43,103,209,.15)}
117
+ button{min-height:3.35rem;margin-top:.25rem;padding:.85rem 1rem;border:1px solid #172033;border-radius:.8rem;background:linear-gradient(180deg,#24334a,#172033);color:#fff;font:inherit;font-weight:750;cursor:pointer;box-shadow:0 .55rem 1.2rem rgba(23,32,51,.18);touch-action:manipulation;transition:transform .15s}
118
+ button:hover{background:linear-gradient(180deg,#2d405c,#1d2a40);box-shadow:0 .7rem 1.4rem rgba(23,32,51,.23);transform:translateY(-1px)}
119
+ button:active{transform:translateY(0)}
120
+ button:focus-visible,summary:focus-visible{outline:.2rem solid rgba(43,103,209,.32);outline-offset:.18rem}
121
+ .terminal-note{margin:.8rem 0 0;color:#6a7789;font-size:.85rem;text-align:center}
122
+ .error{margin:0 0 1rem;padding:.8rem 1rem;border:1px solid #efb8bd;border-radius:.75rem;background:#fff3f4;color:#982631;font-size:.9rem;line-height:1.45}
123
+ details{margin-top:1.5rem;padding-top:1.25rem;border-top:1px solid #e2e8f0;color:#5b687a;font-size:.85rem;line-height:1.55}
124
+ summary{color:#46566d;font-weight:700;cursor:pointer;list-style-position:outside;touch-action:manipulation}
125
+ details p{margin:.8rem 0 0}
126
+ .never-sent{padding:.75rem .85rem;border-radius:.65rem;background:#f5f7fa;color:#536176}
127
+ .success{display:grid;place-items:center;width:3.5rem;height:3.5rem;margin-bottom:1.4rem;border-radius:1rem;background:#eaf7ef;color:#197542;font-size:1.65rem;font-weight:800;box-shadow:inset 0 0 0 1px #c9ead6}
128
+ .completion .intro{margin-bottom:0}
129
+ @media (max-width:30rem){body{padding:1rem}.brand{margin-left:.1rem}.card{border-radius:1.15rem}h1{font-size:2rem}}
130
+ @media (prefers-reduced-motion:reduce){input,button{transition:none}}
131
+ `;
132
+
97
133
  function activationPage(action: string, error?: string): string {
98
- const errorHtml = error ? `<p class="error">${error}</p>` : "";
99
- return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>Activate AgentMemory</title><style>body{font:16px system-ui;max-width:34rem;margin:10vh auto;padding:0 1.5rem;color:#18212b}form{display:grid;gap:1rem}input,button{font:inherit;padding:.8rem;border-radius:.5rem;border:1px solid #aab4bf}button{background:#18212b;color:#fff;cursor:pointer}.muted{color:#586574}.error{color:#a21d24}</style></head><body><h1>Activate AgentMemory</h1><p>Enter an email address to enable the free daily agent-session allowance on this device.</p>${errorHtml}<form method="post" action="${action}"><label>Email <input type="email" name="email" autocomplete="email" maxlength="254" required autofocus></label><button type="submit">Activate and return to terminal</button></form><p class="muted">The AgentMemory CLI sends your email plus core, bundle, platform, architecture, and release-channel metadata to the private activation service. D1 stores a daily count of opaque SessionStart operations for your normalized email. The request never includes memory, session content, queries, repository paths, raw agent session identifiers, IP addresses, or user-agent strings. Activation records expire after 365 days without use.</p></body></html>`;
134
+ const errorHtml = error ? `<p class="error" id="activation-error" role="alert">${error}</p>` : "";
135
+ const describedBy = error ? "activation-error terminal-note" : "terminal-note";
136
+ const autofocus = error ? " autofocus" : "";
137
+ return `<!doctype html>
138
+ <html lang="en">
139
+ <head>
140
+ <meta charset="utf-8">
141
+ <meta name="viewport" content="width=device-width, initial-scale=1">
142
+ <meta name="theme-color" content="#f4f7fb">
143
+ <title>Activate AgentMemory</title>
144
+ <style>${ACTIVATION_PAGE_STYLES}</style>
145
+ </head>
146
+ <body>
147
+ <a class="skip-link" href="#activation">Skip to Activation</a>
148
+ <main id="activation">
149
+ <div class="brand" translate="no"><span class="mark" aria-hidden="true">AM</span><span>AgentMemory</span></div>
150
+ <section class="card" aria-labelledby="activation-title">
151
+ <p class="eyebrow">Free daily allowance</p>
152
+ <h1 id="activation-title">Activate This Device</h1>
153
+ <p class="intro">Use your email to enable AgentMemory Pro for your local agent sessions.</p>
154
+ <form method="post" action="${action}">
155
+ <label for="email">Email address</label>
156
+ ${errorHtml}
157
+ <input id="email" type="email" name="email" autocomplete="email" inputmode="email" spellcheck="false" placeholder="you@example.com…" maxlength="254" required${autofocus} aria-describedby="${describedBy}">
158
+ <button type="submit">Activate AgentMemory</button>
159
+ </form>
160
+ <p class="terminal-note" id="terminal-note">Your terminal will finish setup after activation.</p>
161
+ <details>
162
+ <summary>What’s shared during activation</summary>
163
+ <p>Your email identifies your free daily allowance. The CLI also sends core and bundle versions, platform, architecture, and release channel. The service stores a daily count of opaque session-start operations. Activation records expire after 365 days without use.</p>
164
+ <p class="never-sent"><strong>Never sent:</strong> The request never includes memory, session content, queries, repository paths, raw agent session identifiers, IP addresses, or user-agent strings.</p>
165
+ </details>
166
+ </section>
167
+ </main>
168
+ </body>
169
+ </html>`;
100
170
  }
101
171
 
102
172
  function completionPage(): string {
103
- return '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>AgentMemory activated</title></head><body><h1>Activation complete</h1><p>You can close this tab and return to the terminal.</p></body></html>';
173
+ return `<!doctype html>
174
+ <html lang="en">
175
+ <head>
176
+ <meta charset="utf-8">
177
+ <meta name="viewport" content="width=device-width, initial-scale=1">
178
+ <meta name="theme-color" content="#f4f7fb">
179
+ <title>AgentMemory activated</title>
180
+ <style>${ACTIVATION_PAGE_STYLES}</style>
181
+ </head>
182
+ <body>
183
+ <a class="skip-link" href="#completion">Skip to Activation Status</a>
184
+ <main id="completion">
185
+ <div class="brand" translate="no"><span class="mark" aria-hidden="true">AM</span><span>AgentMemory</span></div>
186
+ <section class="card completion" aria-labelledby="completion-title">
187
+ <div class="success" aria-hidden="true">✓</div>
188
+ <p class="eyebrow">Device activated</p>
189
+ <h1 id="completion-title">You’re All Set</h1>
190
+ <p class="intro">Return to your terminal to finish installing AgentMemory Pro. You can close this tab.</p>
191
+ </section>
192
+ </main>
193
+ </body>
194
+ </html>`;
104
195
  }
105
196
 
106
197
  function send(response: ServerResponse, status: number, body: string, contentType = "text/html; charset=utf-8"): void {