friend-assistant 0.1.73 → 0.1.75
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/README.md +45 -10
- package/dist/BUILD.json +2 -2
- package/dist/friend.mjs +1026 -394
- package/dist/sandbox-child.mjs +318 -0
- package/dist/web/assets/{OrgParts-CKm9GiMe.js → OrgParts-Bqe2lWnf.js} +1 -1
- package/dist/web/assets/index-Dr-VZg6E.js +4460 -0
- package/dist/web/assets/{jarvis-ui-P2GxXH_b.js → jarvis-ui-qSd9qTim.js} +1 -1
- package/dist/web/assets/jarvisTree-ox5cfat5.js +1 -0
- package/dist/web/assets/ort-wasm-simd-threaded.jsep-Dt5UNR3U.wasm +0 -0
- package/dist/web/assets/ort.bundle.min-CpOE52-p.js +2877 -0
- package/dist/web/index.html +1 -1
- package/dist/web/models/sface.LICENSE +202 -0
- package/dist/web/models/sface.onnx +0 -0
- package/dist/web/models/yunet.LICENSE +21 -0
- package/dist/web/models/yunet.onnx +0 -0
- package/dist/web/ort/ort-wasm-simd-threaded.mjs +60 -0
- package/dist/web/ort/ort-wasm-simd-threaded.wasm +0 -0
- package/package.json +4 -1
- package/dist/web/assets/index-Ds89qbOY.js +0 -4460
- package/dist/web/assets/jarvisTree-DL1hkJfL.js +0 -1
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ friend onboard
|
|
|
18
18
|
`friend onboard` is a guided setup, one step at a time. Press Enter to take the suggestion at any question; run it again and it carries on where it stopped.
|
|
19
19
|
|
|
20
20
|
1. **Welcome**: what is about to happen.
|
|
21
|
-
2. **What you want to use**: pick any of: Claude through your subscription (Claude Code), Claude with an API key, a model on this PC (Ollama), voice, safe code running (
|
|
22
|
-
3. **What this PC needs**: it checks Node.js, plus only what your choices need: Python (voice),
|
|
21
|
+
2. **What you want to use**: pick any of: Claude through your subscription (Claude Code), Claude with an API key, a model on this PC (Ollama), voice, safe code running (built in, nothing to install).
|
|
22
|
+
3. **What this PC needs**: it checks Node.js, plus only what your choices need: Python (voice), Ollama, Claude Code, and whether the port is free. Docker is optional and is not asked for. For each missing one it shows the exact command (`winget` on Windows, `brew` on a Mac, `apt` on Linux, `npm` for Claude Code), asks **before** installing, runs it one by one with the output visible, and checks again. If a program was installed but this terminal cannot see it yet, it tells you to open a new terminal and run `friend onboard` again.
|
|
23
23
|
4. **Your account**: password and PIN (each typed twice) and the assistant's name.
|
|
24
24
|
5. **How Friend thinks**: signs in to Claude if needed (`claude auth login`), asks for an API key, or downloads the local model, and sets the safety net (the local model behind Claude).
|
|
25
25
|
6. **Voice**: a female or male voice, then the speech models (about 250 MB).
|
|
@@ -42,7 +42,7 @@ Every command starts with `friend`. If you run Friend from the source code, writ
|
|
|
42
42
|
| `friend onboard --yes` | Takes every suggestion without asking (passwords and keys are still asked). | You want the defaults quickly. |
|
|
43
43
|
| `friend onboard --redo <step>` | Runs one step again. Steps: welcome, features, prereqs, account, model, voice, workspace, network, look, finish. | You want to change one thing, for example `friend onboard --redo look` or `--redo network`. |
|
|
44
44
|
| `friend onboard --reset` | Forgets what the wizard has done so far and starts over. Your account and settings stay. | The wizard's memory of its steps is wrong. |
|
|
45
|
-
| `friend doctor` | Shows what this PC has (Node.js, Python, Docker, Ollama, Claude Code, the port) and the exact command to fix what is missing. Changes nothing. | Something does not work, or before asking for help. |
|
|
45
|
+
| `friend doctor` | Shows what this PC has (Node.js, Python, Docker (optional), Ollama, Claude Code, the port) and the exact command to fix what is missing. Changes nothing. | Something does not work, or before asking for help. |
|
|
46
46
|
| `friend setup` | Only creates the owner account: password, PIN, assistant name, workspace folder, API key, voice. | You want the plain version without the wizard. |
|
|
47
47
|
| `friend status` | Prints the saved settings: data folder, owner, address, public URL, workspace, model, whether an API key is set. | A quick look at how Friend is set up. |
|
|
48
48
|
| `friend version` | Prints the version. | Reporting a problem, or checking an update. |
|
|
@@ -141,7 +141,7 @@ Connectors (Gmail, Chrome control, any MCP service) are managed inside the app,
|
|
|
141
141
|
| Key | What it is |
|
|
142
142
|
|---|---|
|
|
143
143
|
| `provider` | Which model answers: `claude` (API key), `claude-code` (your subscription), `ollama` (this PC) or `openai` (any OpenAI-compatible server, such as OmniRoute). |
|
|
144
|
-
| `approvals` | How much Friend asks before acting: `manual` (asks every time, the default), `edits` (file work and the sandboxed code runner go ahead) or `auto` (commands and tools go ahead too). Risky commands (they need your PIN), the camera, adding connectors or plugins, and Friend's own data folder always ask, in every mode. The AI cannot change this. Easier: Esc → Settings → Approvals. |
|
|
144
|
+
| `approvals` | How much Friend asks before acting: `manual` (asks every time, the default), `edits` (file work and the sandboxed code runner go ahead) or `auto` (commands and tools go ahead too). Risky commands (they need your PIN), the camera (unless you switched the eye on and are talking at the screen, see "The eye"), adding connectors or plugins, and Friend's own data folder always ask, in every mode. The AI cannot change this. Easier: Esc → Settings → Approvals. |
|
|
145
145
|
| `ownerName` | Your name, shown on the profile badge (a shield in the corner) while you are signed in; it shows whoever Friend just recognized when they speak. Empty shows "Owner". |
|
|
146
146
|
| `apiKey`, `model` | The Anthropic API key and the Claude model used with it. |
|
|
147
147
|
| `claudeCode.model`, `claudeCode.command`, `claudeCode.fallback` | The subscription route: model (`sonnet`, `haiku`, `opus`), the command that starts Claude Code, and `ollama` or `none` for what to use when Claude is unavailable. |
|
|
@@ -157,6 +157,8 @@ Connectors (Gmail, Chrome control, any MCP service) are managed inside the app,
|
|
|
157
157
|
| `session.autoCompact` | With Claude Code, Friend keeps one long conversation and re-reads all of it for every answer. On (default): when it grows past `session.compactAtTokens`, Friend writes short notes on it and starts a fresh conversation from them before the next answer. Off: it only tidies when you press Tidy up now. |
|
|
158
158
|
| `session.compactAtTokens` | How big the conversation may grow before it is tidied up by itself, in tokens (50000 to 800000, default 100000). A fresh conversation already starts near 36000. |
|
|
159
159
|
| `voice.enabled`, `voice.sttModel`, `voice.ttsVoice`, `voice.language`, `voice.speakTyped`, `voice.duck`, `voice.duckPercent`, `voice.accept`, `voice.challenge` | Speech on or off, the listening model, the speaking voice, a forced language, speaking typed replies, turning music and video down while you talk and while Friend speaks (and how far, in percent), and the two thresholds for recognising your voice. |
|
|
160
|
+
| `eye.autoOffMinutes` | Minutes until the camera eye switches itself off (0 to 1440, default 120; 0 means only when you switch it off). The eye itself (Friend looks through the camera without asking each time, only when you talk to it at the screen) is switched on, with your PIN, in Esc → Settings → Approvals, and is always off after a restart or sign-out. |
|
|
161
|
+
| `codeRunner` | Where the code the assistant writes runs: `auto` (the default: Docker when it is installed and running, otherwise the sandbox built into Friend), `sandbox` (always the built-in one, nothing to install) or `docker` (always Docker). Easier: Esc → Settings → Approvals. Changing it needs your PIN. |
|
|
160
162
|
| `phoneApprovals.enabled`, `phoneApprovals.channel`, `phoneApprovals.delaySec`, `phoneApprovals.buttons`, `phoneApprovals.allowRisky`, `phoneApprovals.batchSec` | Approving from your phone when you are away from the screen: on or off, which linked app is asked (`auto`, `telegram`, `whatsapp`), how many seconds to wait for the screen first (0 to 110), Telegram Allow / Deny buttons, whether the camera and the Office's requests may also be answered there, and how many seconds (0 to 30) questions that pile up are gathered into one message. See `docs/guides/phone-approvals.md`. |
|
|
161
163
|
| `audit.keepDays`, `audit.archive`, `audit.sealAt`, `audit.unlockMinutes` | The audit trail: days kept before older entries are archived and removed (90; 0 keeps everything), whether a verifiable archive is kept, the time the daily seal goes to your phone (09:00; empty turns it off), and how many minutes the audit screen stays open after your PIN (10). |
|
|
162
164
|
| `bind`, `port` | Where Friend listens (easier: `friend lan`). |
|
|
@@ -461,22 +463,35 @@ Plugins add **skills** (instructions the agent loads when they fit, for example
|
|
|
461
463
|
|
|
462
464
|
- Manage them from the screen (Esc, then **Plugins**) or the terminal: `friend plugin catalog | list | install <name|folder> | enable <id> | disable <id> | remove <id>`.
|
|
463
465
|
- **Installing shows what is inside and needs your confirmation (the PIN in the browser).** Switching a plugin on needs the PIN too; switching off and removing do not.
|
|
464
|
-
- A plugin's tools can never be more powerful than the code sandbox: they run in a throwaway Docker container
|
|
466
|
+
- A plugin's tools can never be more powerful than the code sandbox: they run in the same sandbox as the code the agent writes (a throwaway Docker container when Docker works, otherwise the sandbox built into Friend; no network, no access to your files, time and memory limits), get their arguments as `/work/args.json`, and **ask for your approval on every call**. Skills are text only: they give the model words, never power, and cannot override your rules or the approval system.
|
|
465
467
|
- Plugins are validated strictly (lowercase ids, size and file-count limits, no links, every file must be inside the plugin folder) and re-validated each time Friend loads; a broken plugin is switched off with a visible reason.
|
|
466
468
|
- Make your own: a folder with `plugin.json` plus the files it names, then `friend plugin install ./my-plugin`. See `docs/superpowers/specs/2026-10-08-friend-plugins-design.md` for the format. Downloading plugins from the internet is deliberately not supported yet (it needs signed packages to be safe).
|
|
467
469
|
|
|
468
|
-
## Running code safely
|
|
470
|
+
## Running code safely
|
|
469
471
|
|
|
470
|
-
The agent can write a program (Python, Node or shell), run it, and read the result: calculations, data crunching, quick experiments.
|
|
472
|
+
The agent can write a program (Python, Node or shell), run it, and read the result: calculations, data crunching, quick experiments. **Nothing needs to be installed**: Friend has its own sandbox. If you have Docker, Friend can use that instead (a real container, a real shell). The setting `codeRunner` chooses: `auto` (the default: Docker when it is installed and running, otherwise the built-in sandbox), `sandbox` or `docker`. The result tells the agent (and the log) which one ran. With `auto`, if Docker is installed but not running, the run goes to the built-in sandbox instead and the result says so; set `codeRunner` to `docker` if you never want that.
|
|
471
473
|
|
|
472
|
-
Every run asks for your approval, and the card shows the **whole program**.
|
|
474
|
+
Every run asks for your approval, and the card shows the **whole program**.
|
|
475
|
+
|
|
476
|
+
**The built-in sandbox** runs each program in its own, fresh, locked-down Node.js process (Node's permission model: no reading files outside Friend's own program folders, no starting other programs, no threads, a neutral environment (no user name, home folder or PATH of yours), the network switched off (TCP, UDP and DNS), 512 MB of memory, killed at the time limit):
|
|
477
|
+
|
|
478
|
+
- **JavaScript** runs in QuickJS: plain JavaScript with `console.log` and `readFile(name)` for the files it was given. No `require`, no `fetch`, no `process`.
|
|
479
|
+
- **Python** runs in Pyodide: the standard library only (no numpy or pandas). Start-up takes about a second.
|
|
480
|
+
- **Shell** runs in an emulated bash (just-bash) over an in-memory folder: pipes, redirections, loops and a fixed set of commands (`grep`, `sed`, `awk`, `sort`, `wc`, `tr`, `jq`, and more). It is not a real shell: a script that needs `curl`, `git` or a compiler stops with a message naming the command. Use Docker for those.
|
|
481
|
+
- Files: a program sees only its own code and the files it was handed, in memory. Nothing is kept between runs.
|
|
482
|
+
- Needs Node.js 20.19 or newer for the shell part (the permission feature comes with Node 20 and later).
|
|
483
|
+
|
|
484
|
+
`pnpm test` runs hostile programs against the built-in sandbox in every language (reading the data folder and the environment, network attempts, endless loops, endless output, memory hogs) and confirms each is stopped and the next run still works.
|
|
485
|
+
|
|
486
|
+
**With Docker** (`codeRunner: docker`, or `auto` when Docker is running), each run is its own throwaway container:
|
|
473
487
|
|
|
474
488
|
- `--network none`: no internet and no DNS; it cannot send anything anywhere.
|
|
475
489
|
- It sees none of your files: only its own code is mounted, read-only. The root filesystem is read-only; only a 64 MB scratch `/tmp` is writable.
|
|
476
490
|
- Not root (user 65534), all capabilities dropped, `no-new-privileges`, 512 MB memory (no swap), 1 CPU, at most 128 processes.
|
|
477
491
|
- A time limit (10 s by default, 60 s at most); after that the container is killed and removed. Output is cut at 20,000 characters.
|
|
492
|
+
- The first use of each language downloads a small image (about 50 MB), so that one run needs internet; after that it works offline. [Docker Desktop](https://www.docker.com/products/docker-desktop/) is needed on Windows and Mac (Windows Sandbox is not needed, so Windows Home works); on Linux, Docker Engine.
|
|
478
493
|
|
|
479
|
-
|
|
494
|
+
The Docker tests include a check against real containers that runs hostile code (network attempts, writes outside `/tmp`, memory hog, endless loop, fork bomb) and confirms each is stopped.
|
|
480
495
|
|
|
481
496
|
## Free-form pages (sandbox)
|
|
482
497
|
|
|
@@ -501,7 +516,7 @@ Say "remind me in 30 minutes to call the bank", "remind me tomorrow at 5pm to se
|
|
|
501
516
|
Ask "what is this?" while you hold something up to the camera, and Friend can look. It works one picture at a time:
|
|
502
517
|
|
|
503
518
|
1. The camera is **off** until you turn it on: press **Esc**, choose **Camera: off** (it becomes **Camera: on**). The switch is not remembered; a reload turns it off again.
|
|
504
|
-
2. When the agent wants to look it calls `camera.snap
|
|
519
|
+
2. When the agent wants to look it calls `camera.snap` (one picture) or `camera.watch` (a few seconds, up to 12 pictures), and an approval card appears: "Take one picture with the camera and show it to the AI model". There is no "Always allow" for the camera. The one exception is the eye (below).
|
|
505
520
|
3. After you approve, the browser opens the camera, takes one frame (JPEG, longest side 1024 px), closes the camera and uploads the frame. While the camera is open a red **Camera on** badge with a small live preview shows in the corner; the agent cannot hide it.
|
|
506
521
|
|
|
507
522
|
- The picture is shown to the model for that turn only. It is never written to disk, never saved in the conversation history (history keeps "[camera picture, not kept]"), and the audit log records only its size. Guests can never use the camera.
|
|
@@ -510,6 +525,26 @@ Ask "what is this?" while you hold something up to the camera, and Friend can lo
|
|
|
510
525
|
- Like the microphone, the camera needs `localhost` or HTTPS.
|
|
511
526
|
- Text inside a picture is treated as data, never as instructions.
|
|
512
527
|
|
|
528
|
+
### The eye: letting Friend look by itself
|
|
529
|
+
|
|
530
|
+
If you do not want to approve every look, switch **the eye** on (Esc → Settings → Approvals → The eye; it needs your PIN). While it is on, Friend uses the camera whenever it needs to see, and when in doubt, without a card. It is deliberately narrow:
|
|
531
|
+
|
|
532
|
+
- **Only you, at the screen.** It works for what you type or say to Friend on its own screen. A message from Telegram or WhatsApp, a voice from Alexa, a guest, a household member, the Office workers and scheduled tasks can never make it look: those keep asking.
|
|
533
|
+
- **Off by default, and it switches itself off:** after the minutes you chose (`eye.autoOffMinutes`, default 120, 0 = never), when you sign out, and whenever Friend starts again. Closing it needs no PIN. The AI cannot switch it on or change it.
|
|
534
|
+
- **Limits you cannot raise:** 20 looks and 30 seconds of video per hour without a card, 10 seconds and 12 pictures per clip; after that the card comes back.
|
|
535
|
+
- **Always visible:** the red camera badge shows whenever the camera is open. Every look is written in the audit log (when, how, from where), never the picture.
|
|
536
|
+
- **Nothing is kept.** Pictures are seen once and thrown away; only text notes (such as "Priya visited at 4 pm") stay.
|
|
537
|
+
- **Where pictures go:** to the AI model you chose. With Claude (API or Claude Code) a picture is sent to Anthropic; with a local Ollama vision model it stays on this PC.
|
|
538
|
+
|
|
539
|
+
### People Friend remembers
|
|
540
|
+
|
|
541
|
+
Say "this is Priya, my sister" while she is in front of the camera, and Friend asks for your PIN, takes one look (it must show exactly one face) and remembers her. What is kept is **128 numbers about the face, encrypted on this PC** (like your keys), never a picture. After that, when Friend looks and Priya is there, it is told "Recognised: Priya (sister)". Faces nobody introduced are never saved and never named; the assistant is only told "1 person I do not know".
|
|
542
|
+
|
|
543
|
+
- Settings → Approvals → *People Friend remembers* lists everyone, with **Remove** for one person and **Forget everyone** (both need your PIN and delete the numbers and the notes about them). Up to 50 people.
|
|
544
|
+
- Introducing, removing and forgetting work only at the Friend screen.
|
|
545
|
+
- Recognition is a hint, never proof: a photo or a look-alike can fool it, so a face never approves anything and never replaces your PIN. The models are YuNet (MIT) and SFace (Apache 2.0), run in your browser, with no internet needed; their licences are in `web/models` in the package.
|
|
546
|
+
- Face data is sensitive personal data (India's DPDP Act, the EU's GDPR). Introduce only people who know and agree, and not children.
|
|
547
|
+
|
|
513
548
|
## Safety model
|
|
514
549
|
|
|
515
550
|
- Reading is free, writing inside your workspace is free, shell commands ask first, destructive commands ask and need your PIN.
|
package/dist/BUILD.json
CHANGED