dante-watch 0.1.2 → 0.1.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.
Files changed (63) hide show
  1. package/README.md +56 -23
  2. package/package.json +1 -1
  3. package/src/bib/answers.mjs +2 -2
  4. package/src/bib/bib.json +1 -1
  5. package/src/bib/ear.mjs +19 -18
  6. package/src/bib/net.json +1 -1
  7. package/src/bib/net.mjs +7 -9
  8. package/src/bib/probe.mjs +7 -8
  9. package/src/bib/pruef.json +1 -0
  10. package/src/bib/router.mjs +16 -19
  11. package/src/bib/system.mjs +14 -15
  12. package/src/bib/wash.mjs +5 -13
  13. package/src/checks/battery.mjs +15 -10
  14. package/src/checks/common.mjs +5 -5
  15. package/src/checks/demo.mjs +2 -2
  16. package/src/checks/formats.mjs +221 -0
  17. package/src/checks/hf.mjs +252 -0
  18. package/src/checks/loc.mjs +2 -4
  19. package/src/checks/php2shell.mjs +8 -9
  20. package/src/checks/rechte.mjs +2 -3
  21. package/src/checks/secrets.mjs +2 -4
  22. package/src/checks/sshd.mjs +3 -5
  23. package/src/checks/webshell.mjs +3 -5
  24. package/src/cli.mjs +15 -10
  25. package/src/core/check.mjs +4 -8
  26. package/src/core/consent.mjs +7 -7
  27. package/src/core/render.mjs +2 -2
  28. package/src/core/sh.mjs +12 -7
  29. package/src/i18n-checks.mjs +2 -3
  30. package/src/i18n.mjs +54 -14
  31. package/src/mascot.mjs +3 -5
  32. package/src/me/deep.mjs +37 -0
  33. package/src/me/diary.mjs +51 -0
  34. package/src/me/home.mjs +10 -0
  35. package/src/me/lock.mjs +41 -0
  36. package/src/me/nudge.mjs +52 -0
  37. package/src/me/onboard.mjs +102 -0
  38. package/src/me/overview.mjs +10 -0
  39. package/src/me/patrol.mjs +43 -0
  40. package/src/me/pick.mjs +64 -0
  41. package/src/me/pool.mjs +15 -0
  42. package/src/me/recon.mjs +94 -0
  43. package/src/me/refresh.mjs +70 -0
  44. package/src/me/schedule-deep.mjs +86 -0
  45. package/src/me/schedule.mjs +120 -0
  46. package/src/me/texts.mjs +291 -0
  47. package/src/me/user.mjs +67 -0
  48. package/src/pack/builtin.mjs +67 -4
  49. package/src/pack/ere.mjs +87 -0
  50. package/src/pack/install.mjs +6 -8
  51. package/src/pack/key.mjs +2 -3
  52. package/src/pack/know.mjs +4 -5
  53. package/src/pack/pack.mjs +14 -10
  54. package/src/pack/rules.mjs +109 -1
  55. package/src/pack/texts.mjs +8 -7
  56. package/src/session.mjs +199 -37
  57. package/src/ticker.mjs +10 -9
  58. package/src/ui/footer.mjs +3 -5
  59. package/src/ui/job-worker.mjs +3 -3
  60. package/src/ui/job.mjs +7 -6
  61. package/src/ui/quips.mjs +1 -2
  62. package/src/ui/wait.mjs +3 -4
  63. package/src/version.mjs +11 -0
package/src/bib/net.mjs CHANGED
@@ -1,15 +1,13 @@
1
- // The second ear: a small neural net (fastText-style) that learns which words are used alike, so a
2
- // line that never stood in the bib can still land ("mein kumpel meint mein server ist offen").
3
- // Every feature of a line (the same words, word pairs and letter triples the counting ear uses)
4
- // is hashed into one of B buckets; each bucket holds a D-dim vector. The line is the weighted mean
5
- // of its vectors, one linear layer + softmax turns it into intent probabilities.
6
- // Inference runs locally in every install; training happens in our kitchen (bib/train-net.mjs).
7
- // Weights ship as plain integers (int8 per row with a scale), readable, no blobs.
1
+ // Second classifier: a small fastText-style net. Words, word pairs and letter triples are hashed into
2
+ // buckets, each bucket holds a vector, the line is their weighted mean and one softmax layer gives intent
3
+ // probabilities. This lets unseen phrasings land ("mein kumpel meint mein server ist offen").
4
+ // Inference runs locally. Training is done offline (bib/train-net.mjs); the weights ship as int8 rows with
5
+ // a scale factor in plain JSON.
8
6
  import { features } from "./router.mjs";
9
7
 
10
8
  const hash = (s, B) => { let h = 2166136261; for (let i = 0; i < s.length; i++) { h ^= s.charCodeAt(i); h = Math.imul(h, 16777619); } return (h >>> 0) % B; };
11
9
 
12
- // Line → bucket ids + weights (weights as in the counting ear: first word strongest, triples weak).
10
+ // Line -> bucket ids + weights (weights as in the counting ear: first word strongest, triples weak).
13
11
  export function encode(text, B) {
14
12
  const ids = [], ws = [];
15
13
  for (const [f, w] of features(text)) { ids.push(hash(f, B)); ws.push(w); }
@@ -39,7 +37,7 @@ export function predict(net, text) {
39
37
  return net.labels.map((intent, k) => ({ intent, p: p[k] })).sort((a, b) => b.p - a.p);
40
38
  }
41
39
 
42
- // Deterministic: same bib + same seed → same net, so every update can be reproduced and compared.
40
+ // Deterministic: same bib + same seed -> same net, so every update can be reproduced and compared.
43
41
  export function trainNet(samples, { B = 1 << 14, D = 24, epochs = 6, lr = 0.25, seed = 7 } = {}) {
44
42
  let s = seed >>> 0; const rnd = () => ((s = Math.imul(s ^ (s >>> 15), 2246822519) + 1 >>> 0) / 4294967296);
45
43
  const labels = [...new Set(samples.map((x) => x.intent))].sort();
package/src/bib/probe.mjs CHANGED
@@ -1,13 +1,12 @@
1
- // Probe bib: a small hand-written seed per intent (DE/EN/ES). It only proves the ear works;
2
- // the real bib is cooked by DeepSeek from washed real goals and replaces this file's role.
3
- // "unklar" is the negative class: things a human says that are not a Dante job.
1
+ // Small hand-written seed per intent (de/en/es), used to bootstrap the classifier.
2
+ // "unklar" is the negative class: things people say that are not a Dante task.
4
3
  const S = {
5
4
  gruss: ["hi", "hallo", "hey dante", "moin", "servus", "guten morgen", "na wie gehts", "hello", "hey there", "good evening", "hola", "buenas", "buenos dias", "que tal dante", "yo"],
6
5
  hilfe: ["hilfe", "help", "was kannst du", "was kannst du alles", "welche befehle gibt es", "wie funktioniert das", "zeig mir die befehle", "what can you do", "how does this work", "show commands", "ayuda", "que puedes hacer", "como funciona", "?", "ich weiß nicht was ich sagen soll"],
7
6
  raus: ["raus", "tschüss", "bye", "exit", "quit", "schlaf", "geh schlafen", "ich bin fertig", "das wars", "mach aus", "goodbye", "im done", "adios", "chao", "salir"],
8
7
  pruef: ["prüf", "prüf mal", "check", "scan", "prüf diesen rechner", "ist mein mac sicher", "bin ich sicher", "schau nach lücken", "gibt es lücken", "check this machine", "am i safe", "scan for vulnerabilities", "revisa", "estoy seguro", "busca vulnerabilidades"],
9
8
  server: ["server root@host", "prüf meinen server", "check server root@1.2.3.4", "ziel root@box", "schau dir meinen server an", "ist mein server sicher", "mein vps", "verbinde dich mit root@host", "check my server", "scan my vps admin@host", "is my server safe", "revisa mi servidor", "mi servidor esta seguro", "servidor root@host", "geh auf den server"],
10
- key: ["key ~/.ssh/id_ed25519", "schlüssel ~/.ssh/key", "nimm den key ~/.ssh/earnos", "mein ssh key ist ~/.ssh/x", "benutz den schlüssel", "setz den key", "use key ~/.ssh/id_rsa", "my ssh key is ~/.ssh/k", "set the key", "usa la llave ~/.ssh/k", "mi clave ssh", "clave ~/.ssh/id"],
9
+ key: ["key ~/.ssh/id_ed25519", "schlüssel ~/.ssh/key", "nimm den key ~/.ssh/id_ed25519", "mein ssh key ist ~/.ssh/x", "benutz den schlüssel", "setz den key", "use key ~/.ssh/id_rsa", "my ssh key is ~/.ssh/k", "set the key", "usa la llave ~/.ssh/k", "mi clave ssh", "clave ~/.ssh/id"],
11
10
  pruef_lokal: ["hier", "lokal", "local", "zurück zu meinem rechner", "diesen rechner", "wieder lokal", "back to my machine", "this computer", "localhost", "aqui", "mi computadora", "vuelve a local"],
12
11
  fix: ["fix", "fix das", "mach es zu", "schließ die lücke", "repariere das", "kannst du das reparieren", "behebe es", "fix it", "close it", "patch it", "repair the hole", "arreglalo", "cierra el hueco", "repara eso", "mach das heile"],
13
12
  demo: ["demo", "zeig mir eine demo", "übung", "probelauf", "zeig wie das geht", "zeig mir die schleife", "test run", "show me a demo", "practice", "show me how it works", "demostracion", "muestrame un ejemplo", "prueba de practica"],
@@ -15,17 +14,17 @@ const S = {
15
14
  smalltalk: ["erzähl einen witz", "wie gehts dir", "danke dir", "bin müde", "langer tag heute", "tell me a joke", "how are you doing", "thanks man", "rough day", "cuéntame un chiste", "cómo estás", "gracias", "qué día más largo"],
16
15
  unklar: ["schreib mir eine mail", "wie wird das wetter", "bestell mir pizza", "mach meine hausaufgaben", "übersetz das ins englische", "write my essay", "whats the weather", "book a flight", "order food", "escribe un correo", "cual es el clima", "haz mi tarea", "wer hat das spiel gewonnen", "kauf aktien"],
17
16
  };
18
- // "lokal" is no intent of its own (it overlapped "pruef": "check local" is both) — it is a slot.
17
+ // "lokal" is no intent of its own (it overlapped "pruef": "check local" is both) - it is a slot.
19
18
  export const PROBE = Object.entries(S).flatMap(([intent, xs]) => xs.map((text) => ({ intent: intent === "pruef_lokal" ? "pruef" : intent, text })));
20
19
 
21
- // Held-out lines the router never saw — typos included, the way people really type.
20
+ // Held-out lines the router never saw - typos included, the way people really type.
22
21
  export const HELDOUT = [
23
22
  ["hallo bruder", "gruss"], ["hey wie gehts dir", "gruss"], ["hola amigo", "gruss"], ["hi dante", "gruss"],
24
23
  ["was kann der", "hilfe"], ["welche befehle", "hilfe"], ["help me", "hilfe"], ["que comandos hay", "hilfe"],
25
24
  ["tschau", "raus"], ["ich geh jetzt", "raus"], ["exit now", "raus"],
26
25
  ["prüff mal bitte", "pruef"], ["ist der rechner sicher", "pruef"], ["chek for holes", "pruef"], ["escanea", "pruef"], ["gibts sicherheitslücken", "pruef"],
27
- ["servr root@46.225.140.200", "server"], ["kannst du meinen server checken", "server"], ["check admin@myhost", "server"], ["revisa servidor root@host", "server"],
28
- ["key ~/.ssh/earnos", "key"], ["nimm schlüssel ~/.ssh/a", "key"], ["usa clave ~/.ssh/b", "key"],
26
+ ["servr root@203.0.113.10", "server"], ["kannst du meinen server checken", "server"], ["check admin@myhost", "server"], ["revisa servidor root@host", "server"],
27
+ ["key ~/.ssh/id_ed25519", "key"], ["nimm schlüssel ~/.ssh/a", "key"], ["usa clave ~/.ssh/b", "key"],
29
28
  ["zurück lokal", "pruef"], ["mein rechner hier", "pruef"],
30
29
  ["fix es bitte", "fix"], ["mach die lücke zu", "fix"], ["please fix", "fix"], ["arregla eso", "fix"],
31
30
  ["demo bitte", "demo"], ["zeig mal ne übung", "demo"], ["demo please", "demo"],