@runcore-sh/runcore 0.3.0 → 0.3.2
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/dictionary.json +2 -2
- package/dist/agents/runtime/driver.d.ts.map +1 -1
- package/dist/agents/runtime/driver.js +1 -2
- package/dist/agents/runtime/driver.js.map +1 -1
- package/dist/agents/runtime/manager.d.ts.map +1 -1
- package/dist/agents/runtime/manager.js +1 -0
- package/dist/agents/runtime/manager.js.map +1 -1
- package/dist/agents/runtime/types.d.ts +2 -0
- package/dist/agents/runtime/types.d.ts.map +1 -1
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +2 -0
- package/dist/auth/middleware.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/llm/ollama.d.ts +5 -0
- package/dist/llm/ollama.d.ts.map +1 -1
- package/dist/llm/ollama.js +22 -1
- package/dist/llm/ollama.js.map +1 -1
- package/dist/llm/providers/ollama.d.ts +2 -2
- package/dist/llm/providers/ollama.d.ts.map +1 -1
- package/dist/llm/providers/ollama.js +63 -17
- package/dist/llm/providers/ollama.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +85 -29
- package/dist/server.js.map +1 -1
- package/dist/ui-sync.d.ts +34 -0
- package/dist/ui-sync.d.ts.map +1 -0
- package/dist/ui-sync.js +108 -0
- package/dist/ui-sync.js.map +1 -0
- package/package.json +5 -5
- package/public/avatar/Hey-Dash_en_windows_v4_0_0.zip +0 -0
- package/public/avatar/README.md +43 -0
- package/public/avatar/dash_headhshot_v1.png +0 -0
- package/public/avatar/idle.mp4 +0 -0
- package/public/avatar/photo.png +0 -0
- package/public/index.html +115 -64
- package/public/nerve/icon-192.svg +6 -0
- package/public/nerve/icon-512.svg +6 -0
- package/public/nerve/index.html +698 -0
- package/public/nerve/manifest.json +24 -0
- package/public/nerve/sw.js +84 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Core Nerve — Service Worker
|
|
2
|
+
// Caches app shell, handles push notifications
|
|
3
|
+
|
|
4
|
+
const CACHE_NAME = "nerve-v1";
|
|
5
|
+
const SHELL = ["/nerve"];
|
|
6
|
+
|
|
7
|
+
// Install: cache the app shell
|
|
8
|
+
self.addEventListener("install", (e) => {
|
|
9
|
+
e.waitUntil(
|
|
10
|
+
caches.open(CACHE_NAME).then((c) => c.addAll(SHELL))
|
|
11
|
+
);
|
|
12
|
+
self.skipWaiting();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// Activate: clean old caches
|
|
16
|
+
self.addEventListener("activate", (e) => {
|
|
17
|
+
e.waitUntil(
|
|
18
|
+
caches.keys().then((keys) =>
|
|
19
|
+
Promise.all(keys.filter((k) => k !== CACHE_NAME).map((k) => caches.delete(k)))
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
self.clients.claim();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Fetch: cache-first for shell, network-only for API
|
|
26
|
+
self.addEventListener("fetch", (e) => {
|
|
27
|
+
const url = new URL(e.request.url);
|
|
28
|
+
|
|
29
|
+
// API calls always go to network
|
|
30
|
+
if (url.pathname.startsWith("/api/")) return;
|
|
31
|
+
|
|
32
|
+
e.respondWith(
|
|
33
|
+
caches.match(e.request).then((cached) => {
|
|
34
|
+
if (cached) return cached;
|
|
35
|
+
return fetch(e.request).then((res) => {
|
|
36
|
+
if (res.ok && e.request.method === "GET") {
|
|
37
|
+
const clone = res.clone();
|
|
38
|
+
caches.open(CACHE_NAME).then((c) => c.put(e.request, clone));
|
|
39
|
+
}
|
|
40
|
+
return res;
|
|
41
|
+
});
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Push: show notification when server sends one
|
|
47
|
+
self.addEventListener("push", (e) => {
|
|
48
|
+
if (!e.data) return;
|
|
49
|
+
|
|
50
|
+
let payload;
|
|
51
|
+
try {
|
|
52
|
+
payload = e.data.json();
|
|
53
|
+
} catch {
|
|
54
|
+
payload = { title: "Core", body: e.data.text() };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const options = {
|
|
58
|
+
body: payload.body || "",
|
|
59
|
+
icon: "/public/nerve/icon-192.svg",
|
|
60
|
+
badge: "/public/nerve/icon-192.svg",
|
|
61
|
+
vibrate: [100, 50, 100],
|
|
62
|
+
data: payload.data || {},
|
|
63
|
+
actions: [{ action: "open", title: "Open" }],
|
|
64
|
+
tag: "nerve-" + (payload.data?.state ? Object.values(payload.data.state).join("-") : "update"),
|
|
65
|
+
renotify: true,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
e.waitUntil(self.registration.showNotification(payload.title || "Core", options));
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// Notification click: open the nerve PWA
|
|
72
|
+
self.addEventListener("notificationclick", (e) => {
|
|
73
|
+
e.notification.close();
|
|
74
|
+
e.waitUntil(
|
|
75
|
+
self.clients.matchAll({ type: "window" }).then((clients) => {
|
|
76
|
+
for (const client of clients) {
|
|
77
|
+
if (client.url.includes("/nerve") && "focus" in client) {
|
|
78
|
+
return client.focus();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return self.clients.openWindow("/nerve");
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
});
|