@makerstufferupper/flypi 0.0.0-stage → 0.1.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.
Files changed (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -2
  3. package/assets/screenshot.png +0 -0
  4. package/bin/flypi.mjs +28 -0
  5. package/dist/ui/assets/index-CG1CuGxu.js +105 -0
  6. package/dist/ui/assets/index-qaKjH5fH.css +1 -0
  7. package/dist/ui/flypi-logo-dark.jpeg +0 -0
  8. package/dist/ui/flypi-logo-light.jpeg +0 -0
  9. package/dist/ui/index.html +17 -0
  10. package/package.json +71 -5
  11. package/scripts/benchmark-nli.ts +273 -0
  12. package/scripts/flypi.mjs +303 -0
  13. package/scripts/probe-turn-boundary.ts +97 -0
  14. package/scripts/probe.ts +119 -0
  15. package/scripts/record-transcript.ts +63 -0
  16. package/scripts/reembed-memory.ts +41 -0
  17. package/scripts/release.mjs +35 -0
  18. package/scripts/secret.ts +24 -0
  19. package/scripts/serve-daemon.ts +101 -0
  20. package/scripts/serve-memory.ts +78 -0
  21. package/scripts/serve.ts +89 -0
  22. package/scripts/smoke-memory.mjs +239 -0
  23. package/scripts/smoke-secrets.mjs +153 -0
  24. package/scripts/smoke.mjs +59 -0
  25. package/scripts/start.mjs +294 -0
  26. package/scripts/turn-boundary.ts +52 -0
  27. package/scripts/update.ts +92 -0
  28. package/scripts/warm-models.ts +41 -0
  29. package/src/agent/config-files.ts +529 -0
  30. package/src/agent/mcp-signin.ts +137 -0
  31. package/src/agent/mcp-status.ts +168 -0
  32. package/src/agent/onboarding.ts +74 -0
  33. package/src/agent/packages.ts +150 -0
  34. package/src/agent/paths.ts +80 -0
  35. package/src/agent/permission-gate.ts +70 -0
  36. package/src/agent/pi-mcp.ts +97 -0
  37. package/src/agent/runtime.ts +347 -0
  38. package/src/daemon/index.ts +442 -0
  39. package/src/daemon/jobs.ts +202 -0
  40. package/src/daemon/update.ts +248 -0
  41. package/src/memory/capture.ts +109 -0
  42. package/src/memory/config.ts +90 -0
  43. package/src/memory/consolidate.ts +218 -0
  44. package/src/memory/db.ts +393 -0
  45. package/src/memory/embed.ts +154 -0
  46. package/src/memory/judge.ts +167 -0
  47. package/src/memory/mcp.ts +496 -0
  48. package/src/memory/media.ts +135 -0
  49. package/src/memory/progress.ts +39 -0
  50. package/src/memory/recall.ts +528 -0
  51. package/src/memory/review.ts +86 -0
  52. package/src/memory/store.ts +1034 -0
  53. package/src/memory/wiki.ts +140 -0
  54. package/src/secrets/cli.ts +248 -0
  55. package/src/secrets/config.ts +133 -0
  56. package/src/secrets/crypto.ts +180 -0
  57. package/src/secrets/extension.ts +253 -0
  58. package/src/secrets/redact.ts +132 -0
  59. package/src/secrets/vault.ts +396 -0
  60. package/src/server/event-log.ts +49 -0
  61. package/src/server/extension-ui.ts +118 -0
  62. package/src/server/index.ts +398 -0
  63. package/src/server/memory-api.ts +158 -0
  64. package/src/server/protocol.ts +947 -0
  65. package/src/server/run-store.ts +136 -0
  66. package/src/server/secrets-api.ts +88 -0
  67. package/src/server/session-registry.ts +593 -0
  68. package/src/shared/attachments.ts +40 -0
  69. package/src/shared/cache-probe.ts +47 -0
  70. package/src/shared/markdown.ts +17 -0
  71. package/src/shared/metrics.ts +212 -0
  72. package/src/shared/sqlite.ts +74 -0
  73. package/src/shared/transcript.ts +404 -0
  74. package/src/shared/turn-boundary.ts +98 -0
  75. package/src/shared/views.ts +31 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 makerstufferupper
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,45 @@
1
- # Temporary Holding Version
1
+ # flypi
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A local, multi-model agent tool with a browser UI and a personal knowledge wiki, built on the
4
+ [pi SDK](https://www.npmjs.com/package/@earendil-works/pi-coding-agent) running in-process.
5
+ Everything it reads or writes lives in `.flypi/` — never in `~/.pi`.
6
+
7
+ ![flypi in the browser: a session sidebar, the chat with its model and thinking selectors, and an activity panel](assets/screenshot.png)
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install -g @makerstufferupper/flypi
13
+ ```
14
+
15
+ Requires Node ≥ 22.19 (24 or newer is recommended, for the built-in `node:sqlite`).
16
+
17
+ ## Run
18
+
19
+ ```bash
20
+ flypi start # starts the daemon and prints the URL with a per-run token
21
+ flypi status # what is running, and which version
22
+ flypi logs -f
23
+ flypi stop
24
+ ```
25
+
26
+ The first start downloads two local models (~900 MB) for the memory store — an embedder and a
27
+ contradiction judge. Skip them with `flypi start --embeddings none --judge none`.
28
+
29
+ ## Configure
30
+
31
+ `.flypi/agent/models.json` names your providers and models, and `.flypi/agent/settings.json` picks
32
+ the default pair. The settings page in the UI edits the same two files. Until you add a provider the
33
+ UI comes up normally and the model turn says out loud that no default is set.
34
+
35
+ ## What you get
36
+
37
+ - A chat UI with thinking, tool output, sessions, and image paste.
38
+ - A memory wiki: every turn is searched against it before the model is asked anything, and the model
39
+ can write to it over MCP.
40
+ - A daemon with a scheduler, a tool permission gate, and an encrypted secrets vault.
41
+ - Any endpoint pi supports, including local OpenAI-compatible servers.
42
+
43
+ ## License
44
+
45
+ MIT
Binary file
package/bin/flypi.mjs ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * The installed entry point (`bin: flypi`). Its only job is the default state directory: a published app
4
+ * keeps its `.flypi/` in the home directory, so `npx flypi` from anywhere finds the same memories and the
5
+ * same vault, instead of one per cwd. `--root DIR` or `FLYPI_ROOT` override it.
6
+ *
7
+ * A checkout is unchanged: `scripts/flypi.mjs` still defaults to cwd, which is what `npm run flypi`,
8
+ * `./start.sh` and the tests rely on. So the two defaults live in two files, deliberately.
9
+ */
10
+ import { readFileSync } from "node:fs";
11
+ import { homedir } from "node:os";
12
+ import { resolve } from "node:path";
13
+ import { fileURLToPath } from "node:url";
14
+
15
+ // Checked before anything is imported, so an old Node gets this sentence rather than a tsx stack trace.
16
+ // Read from package.json rather than repeated here: this floor is pi's own, and start.mjs cannot import
17
+ // anything (it runs before npm install), so the two entry points would otherwise drift.
18
+ const pkg = resolve(import.meta.dirname, "..", "package.json");
19
+ const min = /(\d+\.\d+\.\d+)/.exec(JSON.parse(readFileSync(pkg, "utf8")).engines.node)?.[1] ?? "0.0.0";
20
+ const compare = (a, b) => a.split(".").reduce((diff, part, i) => diff || Math.sign(Number(part) - Number(b.split(".")[i] ?? 0)), 0);
21
+ if (compare(process.versions.node, min) < 0) {
22
+ console.error(`flypi needs Node >= ${min}; this is ${process.versions.node}. Install a newer Node (24+ recommended for node:sqlite).`);
23
+ process.exit(1);
24
+ }
25
+
26
+ // `??=` so an explicit FLYPI_ROOT, or `--root`, still wins inside scripts/flypi.mjs.
27
+ process.env.FLYPI_ROOT ??= homedir();
28
+ await import("../scripts/flypi.mjs");