@codrihub/memora 0.0.0-stage → 1.2.3

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.
@@ -0,0 +1,83 @@
1
+ {
2
+ "id": "/",
3
+ "name": "Memora",
4
+ "short_name": "Memora",
5
+ "description": "Memora, second brain for your AI: a self-hosted memory vault of Markdown notes, wired into a living brain your agents read and write over MCP.",
6
+ "start_url": "/",
7
+ "scope": "/",
8
+ "display": "standalone",
9
+ "display_override": [
10
+ "standalone",
11
+ "minimal-ui"
12
+ ],
13
+ "orientation": "any",
14
+ "background_color": "#0b0e14",
15
+ "theme_color": "#0b0e14",
16
+ "lang": "en",
17
+ "dir": "ltr",
18
+ "categories": [
19
+ "productivity",
20
+ "utilities"
21
+ ],
22
+ "icons": [
23
+ {
24
+ "src": "/icon-192.png",
25
+ "sizes": "192x192",
26
+ "type": "image/png",
27
+ "purpose": "any"
28
+ },
29
+ {
30
+ "src": "/icon-512.png",
31
+ "sizes": "512x512",
32
+ "type": "image/png",
33
+ "purpose": "any"
34
+ },
35
+ {
36
+ "src": "/icon-maskable-512.png",
37
+ "sizes": "512x512",
38
+ "type": "image/png",
39
+ "purpose": "maskable"
40
+ }
41
+ ],
42
+ "shortcuts": [
43
+ {
44
+ "name": "Open the brain",
45
+ "short_name": "Brain",
46
+ "description": "The 3D brain of your vault",
47
+ "url": "/brain",
48
+ "icons": [
49
+ {
50
+ "src": "/assets/shortcut-brain.png",
51
+ "sizes": "96x96",
52
+ "type": "image/png"
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ "name": "Nodes",
58
+ "short_name": "Nodes",
59
+ "description": "Browse and write nodes",
60
+ "url": "/nodes",
61
+ "icons": [
62
+ {
63
+ "src": "/assets/shortcut-nodes.png",
64
+ "sizes": "96x96",
65
+ "type": "image/png"
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "name": "Activity",
71
+ "short_name": "Activity",
72
+ "description": "What your agents are doing, live",
73
+ "url": "/activity",
74
+ "icons": [
75
+ {
76
+ "src": "/assets/shortcut-activity.png",
77
+ "sizes": "96x96",
78
+ "type": "image/png"
79
+ }
80
+ ]
81
+ }
82
+ ]
83
+ }
@@ -0,0 +1,39 @@
1
+ <!DOCTYPE html>
2
+ <!-- Generated by web/scripts/build-pages.mjs. Do not edit. -->
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <meta name="color-scheme" content="dark">
8
+ <meta name="theme-color" content="#0b0e14">
9
+ <meta name="robots" content="noindex,nofollow,noarchive,nosnippet,noimageindex">
10
+ <meta http-equiv="refresh" content="8">
11
+ <title>Offline · Memora</title>
12
+ <link rel="manifest" href="/manifest.webmanifest">
13
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png">
14
+ <style>
15
+ :root{ --bg:#0b0e14; --panel:#12161f; --line:#232a38; --fg:#e6e9ef; --muted:#8b98ad; --accent:#5eead4; }
16
+ *{box-sizing:border-box}
17
+ body{margin:0;min-height:100vh;display:grid;place-items:center;background:var(--bg);color:var(--fg);
18
+ font:15px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;padding:24px}
19
+ .card{max-width:420px;width:100%;background:var(--panel);border:1px solid var(--line);border-radius:16px;
20
+ padding:28px 24px;text-align:center;box-shadow:0 18px 44px rgba(0,0,0,.5)}
21
+ .mark{width:44px;height:44px;margin:0 auto 14px;display:block}
22
+ h1{font-size:18px;margin:0 0 6px}
23
+ p{margin:0 0 18px;color:var(--muted);font-size:14px}
24
+ button{appearance:none;border:1px solid rgba(94,234,212,.45);background:rgba(94,234,212,.1);color:var(--accent);
25
+ font:inherit;font-weight:600;padding:10px 16px;border-radius:10px;cursor:pointer}
26
+ button:hover{background:rgba(94,234,212,.16)}
27
+ .hint{margin-top:14px;font-size:12px;color:var(--muted)}
28
+ </style>
29
+ </head>
30
+ <body>
31
+ <div class="card">
32
+ <svg class="mark" viewBox="0 0 24 24" aria-hidden="true"><defs><linearGradient id="mmg4r4ge7" x1="3" y1="3" x2="21" y2="21" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5eead4"/><stop offset="1" stop-color="#22d3ee"/></linearGradient><linearGradient id="mmt4r4ge7" x1="0" y1="0" x2="0" y2="24" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#17202e"/><stop offset="1" stop-color="#0b0f17"/></linearGradient><radialGradient id="mmc4r4ge7" cx="50%" cy="50%" r="50%"><stop offset="0" stop-color="#ffffff"/><stop offset=".55" stop-color="#a5f3fc"/><stop offset="1" stop-color="#22d3ee"/></radialGradient></defs><g fill="none" stroke="none"><rect x="1.5" y="1.5" width="21" height="21" rx="6.2" fill="url(#mmt4r4ge7)"/><rect x="1.5" y="1.5" width="21" height="21" rx="6.2" fill="none" stroke="url(#mmg4r4ge7)" stroke-opacity=".55" stroke-width=".8"/><path d="M7.2 16.8V7.4l4.8 5.1 4.8-5.1v9.4" fill="none" stroke="url(#mmg4r4ge7)" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/><circle cx="7.2" cy="16.8" r="1.7" fill="#5eead4"/><circle cx="7.2" cy="7.4" r="1.7" fill="#5eead4"/><circle cx="16.8" cy="7.4" r="1.7" fill="#22d3ee"/><circle cx="16.8" cy="16.8" r="1.7" fill="#22d3ee"/><circle cx="12" cy="12.5" r="3" fill="#22d3ee" opacity=".22"/><circle cx="12" cy="12.5" r="2" fill="url(#mmc4r4ge7)"/></g></svg>
33
+ <h1>Connection lost</h1>
34
+ <p>This page was served from cache. Memory vault content is always fetched directly from the server, so a network connection is required to display notes.</p>
35
+ <button type="button" onclick="location.reload()">Try again</button>
36
+ <div class="hint">Memora by Codrihub Tech</div>
37
+ </div>
38
+ </body>
39
+ </html>
@@ -0,0 +1,50 @@
1
+ User-agent: *
2
+ Disallow: /
3
+
4
+ User-agent: GPTBot
5
+ Disallow: /
6
+
7
+ User-agent: ChatGPT-User
8
+ Disallow: /
9
+
10
+ User-agent: OAI-SearchBot
11
+ Disallow: /
12
+
13
+ User-agent: ClaudeBot
14
+ Disallow: /
15
+
16
+ User-agent: Claude-Web
17
+ Disallow: /
18
+
19
+ User-agent: anthropic-ai
20
+ Disallow: /
21
+
22
+ User-agent: CCBot
23
+ Disallow: /
24
+
25
+ User-agent: Google-Extended
26
+ Disallow: /
27
+
28
+ User-agent: PerplexityBot
29
+ Disallow: /
30
+
31
+ User-agent: Bytespider
32
+ Disallow: /
33
+
34
+ User-agent: Amazonbot
35
+ Disallow: /
36
+
37
+ User-agent: Applebot-Extended
38
+ Disallow: /
39
+
40
+ User-agent: meta-externalagent
41
+ Disallow: /
42
+
43
+ User-agent: cohere-ai
44
+ Disallow: /
45
+
46
+ User-agent: Diffbot
47
+ Disallow: /
48
+
49
+ User-agent: ImagesiftBot
50
+ Disallow: /
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--shadow-sm:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--shadow-lg:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.\@container{container-type:inline-size}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.block{display:block}.contents{display:contents}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.shrink{flex-shrink:1}.grow{flex-grow:1}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.zoom-100{zoom:100%}.resize{resize:both}.rounded{border-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.lowercase{text-transform:lowercase}.italic{font-style:italic}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}
package/assets/sw.js ADDED
@@ -0,0 +1,93 @@
1
+ (() => {
2
+ const VERSION = "memora-v1.2.3";
3
+ const SHELL = "shell-" + VERSION;
4
+ const sw = self;
5
+ const OFFLINE_FILES = ["/offline.html", "/icon-192.png", "/icon-512.png"];
6
+ const NEVER_CACHE = [
7
+ "/api/",
8
+ "/mcp",
9
+ "/_bus",
10
+ "/ws",
11
+ "/login",
12
+ "/logout",
13
+ "/oauth/",
14
+ "/.well-known/",
15
+ "/healthz"
16
+ ];
17
+ sw.addEventListener("install", ((event) => {
18
+ event.waitUntil(
19
+ (async () => {
20
+ const cache = await caches.open(SHELL);
21
+ await Promise.all(
22
+ OFFLINE_FILES.map((u) => cache.add(new Request(u, { cache: "reload" })).catch(() => null))
23
+ );
24
+ await sw.skipWaiting();
25
+ })()
26
+ );
27
+ }));
28
+ sw.addEventListener("activate", ((event) => {
29
+ event.waitUntil(
30
+ (async () => {
31
+ const names = await caches.keys();
32
+ const older = names.filter((n) => n !== SHELL);
33
+ await Promise.all(older.map((n) => caches.delete(n)));
34
+ if (sw.registration.navigationPreload) {
35
+ await sw.registration.navigationPreload.disable().catch(() => null);
36
+ }
37
+ await sw.clients.claim();
38
+ if (older.length) {
39
+ const wins = await sw.clients.matchAll({ type: "window" });
40
+ await Promise.all(wins.map(nudge));
41
+ }
42
+ })()
43
+ );
44
+ }));
45
+ sw.addEventListener("message", ((event) => {
46
+ const d = event.data ?? {};
47
+ if (d.type === "SKIP_WAITING") void sw.skipWaiting();
48
+ if (d.type === "VERSION" && event.source) {
49
+ event.source.postMessage({
50
+ type: "VERSION",
51
+ version: VERSION
52
+ });
53
+ }
54
+ }));
55
+ async function nudge(c) {
56
+ const ch = new MessageChannel();
57
+ const answered = new Promise((res) => {
58
+ ch.port1.onmessage = () => res(true);
59
+ setTimeout(() => res(false), 1500);
60
+ });
61
+ try {
62
+ c.postMessage({ type: "NEW_VERSION", version: VERSION }, [ch.port2]);
63
+ } catch {
64
+ }
65
+ if (!await answered) await c.navigate(c.url).catch(() => null);
66
+ }
67
+ function isNever(pathname) {
68
+ return NEVER_CACHE.some((p) => pathname === p || pathname.startsWith(p));
69
+ }
70
+ const wait = (ms) => new Promise((r) => setTimeout(r, ms));
71
+ sw.addEventListener("fetch", ((event) => {
72
+ const req = event.request;
73
+ if (req.method !== "GET" || req.mode !== "navigate") return;
74
+ const url = new URL(req.url);
75
+ if (url.origin !== sw.location.origin) return;
76
+ if (isNever(url.pathname)) return;
77
+ event.respondWith(
78
+ (async () => {
79
+ try {
80
+ return await fetch(req);
81
+ } catch {
82
+ await wait(1200);
83
+ try {
84
+ return await fetch(req);
85
+ } catch {
86
+ const cache = await caches.open(SHELL);
87
+ return await cache.match("/offline.html") || new Response("Offline", { status: 503, headers: { "Content-Type": "text/plain" } });
88
+ }
89
+ }
90
+ })()
91
+ );
92
+ }));
93
+ })();
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { run } from '../lib/launcher.js';
3
+
4
+ run('memora-cli');
package/bin/memora.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { run } from '../lib/launcher.js';
3
+
4
+ run('memora');
@@ -0,0 +1,96 @@
1
+ // The `memora` and `memora-cli` commands of the @codrihub/memora npm package.
2
+ //
3
+ // npm installs exactly one platform package (an optionalDependency whose
4
+ // `os`/`cpu` match this machine) holding the prebuilt release binaries; this
5
+ // launcher finds it and runs the binary with the same arguments, stdio and exit
6
+ // code. Nothing is downloaded at install time.
7
+ //
8
+ // build.ts compiles this file to lib/launcher.js (types stripped, no bundling),
9
+ // so it may only use Node built-ins and erasable TypeScript syntax.
10
+
11
+ import { spawn } from 'node:child_process';
12
+ import { createRequire } from 'node:module';
13
+ import { dirname, join } from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+ /** `${process.platform}-${process.arch}` -> platform package. One per release build. */
27
+ export const PLATFORMS = {
28
+ 'linux-x64': { pkg: '@codrihub/memora-linux-x64', os: 'linux', cpu: 'x64' },
29
+ 'linux-arm64': { pkg: '@codrihub/memora-linux-arm64', os: 'linux', cpu: 'arm64' },
30
+ };
31
+
32
+ const REPO = 'https://github.com/Codrihub/memora';
33
+
34
+ function fail(lines ) {
35
+ process.stderr.write(lines.join('\n') + '\n');
36
+ process.exit(1);
37
+ }
38
+
39
+ function binaryPath(name ) {
40
+ const key = `${process.platform}-${process.arch}`;
41
+ const platform = PLATFORMS[key];
42
+ if (!platform) {
43
+ fail([
44
+ `${name}: there is no prebuilt Memora binary for ${process.platform}/${process.arch}.`,
45
+ `The npm package ships Linux binaries only (${Object.keys(PLATFORMS).join(', ')}).`,
46
+ '',
47
+ 'Other ways to run Memora:',
48
+ ` Docker (any OS): ghcr.io/codrihub/memora, see ${REPO}#docker-compose`,
49
+ ` From source: cargo build --release, see ${REPO}#from-source`,
50
+ ...(process.platform === 'win32' ? [' On Windows you can also install it inside WSL 2: npm install -g @codrihub/memora'] : []),
51
+ ]);
52
+ }
53
+ let pkgDir ;
54
+ try {
55
+ pkgDir = dirname(createRequire(import.meta.url).resolve(`${platform.pkg}/package.json`));
56
+ } catch {
57
+ fail([
58
+ `${name}: the package ${platform.pkg} is not installed.`,
59
+ 'npm installs it as an optional dependency of @codrihub/memora, so it is left out',
60
+ 'by --omit=optional (or --no-optional) and by lockfiles made on another platform.',
61
+ 'Reinstall without that flag, for example: npm install -g @codrihub/memora',
62
+ ]);
63
+ }
64
+ return join(pkgDir, 'bin', name);
65
+ }
66
+
67
+ export function run(name ) {
68
+ const bin = binaryPath(name);
69
+ const env = { ...process.env };
70
+ // The web UI ships in this package; an explicit MEMORA_ASSETS still wins.
71
+ if (name === 'memora' && !env.MEMORA_ASSETS) {
72
+ env.MEMORA_ASSETS = join(dirname(dirname(fileURLToPath(import.meta.url))), 'assets');
73
+ }
74
+
75
+ const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit', env });
76
+
77
+ // Ctrl-C reaches the whole foreground process group, so the child already has
78
+ // SIGINT; only keep Node from dying first. Signals sent to this pid alone (a
79
+ // process manager stopping the service) are passed on.
80
+ const handlers = [
81
+ ['SIGINT', () => {}],
82
+ ['SIGTERM', () => child.kill('SIGTERM')],
83
+ ['SIGHUP', () => child.kill('SIGHUP')],
84
+ ];
85
+ for (const [sig, h] of handlers) process.on(sig, h);
86
+
87
+ child.on('error', (e) => fail([`${name}: cannot run ${bin}: ${e.message}`]));
88
+ child.on('exit', (code, signal) => {
89
+ for (const [sig, h] of handlers) process.off(sig, h);
90
+ if (signal) {
91
+ process.kill(process.pid, signal);
92
+ return;
93
+ }
94
+ process.exit(code ?? 1);
95
+ });
96
+ }
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@codrihub/memora",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.2.3",
4
+ "description": "Self-hosted memory vault for AI agents: the Memora server (HTTP, MCP, web UI) and the memora-cli console",
5
+ "keywords": [
6
+ "memora",
7
+ "mcp",
8
+ "model-context-protocol",
9
+ "ai-agents",
10
+ "memory",
11
+ "knowledge-base",
12
+ "markdown",
13
+ "self-hosted"
14
+ ],
15
+ "license": "MIT",
16
+ "author": "Codrihub",
17
+ "homepage": "https://github.com/Codrihub/memora#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/Codrihub/memora/issues"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/Codrihub/memora.git",
24
+ "directory": "npm"
25
+ },
26
+ "type": "module",
27
+ "bin": {
28
+ "memora": "bin/memora.js",
29
+ "memora-cli": "bin/memora-cli.js"
30
+ },
31
+ "files": [
32
+ "bin",
33
+ "lib",
34
+ "assets"
35
+ ],
36
+ "engines": {
37
+ "node": ">=18"
38
+ },
39
+ "optionalDependencies": {
40
+ "@codrihub/memora-linux-x64": "1.2.3",
41
+ "@codrihub/memora-linux-arm64": "1.2.3"
42
+ }
43
+ }