pi-pocket 0.28.0-beta.5 → 0.28.0-beta.6
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/SECURITY.md +1 -1
- package/docs/architecture.md +6 -0
- package/docs/customizing.md +2 -2
- package/docs/extensions/linked-sessions.md +1 -1
- package/docs/extensions/policies/api-stability.md +1 -0
- package/docs/extensions/prompt-sections.md +4 -0
- package/docs/extensions/reference/api-versions.md +1 -0
- package/docs/extensions/reference/host.md +36 -1
- package/docs/extensions/reference/theme-surface.md +1 -0
- package/docs/extensions/sessions.md +37 -0
- package/docs/extensions/tools.md +1 -1
- package/docs/extensions.md +1 -0
- package/docs/features.md +7 -6
- package/docs/map.md +4 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/server/app.ts +11 -0
- package/src/server/commands.ts +26 -6
- package/src/server/custom-providers.ts +661 -0
- package/src/server/extension-sessions.ts +238 -0
- package/src/server/extensions/agent-teams.ts +9 -1
- package/src/server/extensions/artifacts.ts +16 -24
- package/src/server/extensions/ask.ts +8 -13
- package/src/server/extensions/browser.ts +8 -2
- package/src/server/extensions/codemode.ts +100 -10
- package/src/server/extensions/memory.ts +1 -1
- package/src/server/extensions/plan.ts +3 -1
- package/src/server/extensions/prompt.ts +6 -6
- package/src/server/extensions/schedules.ts +1 -1
- package/src/server/extensions/subagents.ts +27 -7
- package/src/server/extensions/tool-search.ts +70 -20
- package/src/server/host.ts +34 -0
- package/src/server/http/api.ts +30 -0
- package/src/server/linked-sessions.ts +2 -2
- package/src/server/model-refresh.ts +5 -5
- package/src/server/providers.ts +25 -11
- package/types/pocket.d.ts +33 -0
- package/web/home.js +11 -0
- package/web/model-refresh.js +30 -20
- package/web/sheets/custom-providers.js +278 -0
- package/web/sheets/model.js +1 -3
- package/web/sheets/providers.js +207 -21
- package/web/style.css +168 -8
- package/web/theme-surface.js +1 -0
- package/web/ui.js +2 -0
package/SECURITY.md
CHANGED
|
@@ -13,7 +13,7 @@ Pi Pocket runs a coding agent that executes commands on the machine it runs on,
|
|
|
13
13
|
- **Anyone who can steer can do what you can.** Through Pi, they reach your files, Pi Pocket's settings and tokens, and its code. An invite to one session limits what someone sees in the app, not what Pi can reach. Neither do git worktrees or spend limits: a worktree keeps a session's files apart, and a run is stopped only after the request that crosses its limit.
|
|
14
14
|
- **Approvals.** Lancet Guard approvals can come from anyone who can steer, including the person who asked, unless the owner turns on "Approvals need someone else" (Menu → Extensions); then, when nobody is known to have asked, only the owner can allow. A notification offers Allow only for a call that fits on one short line; anything longer opens the app first. Since 0.22.0, an extension can ask a question on the same kind of card (a sign-in, a code): only the person Pi works for fills it in, what they type goes to that extension and never to Pi or the transcript, and its notification has no Allow. Values an extension hides show as `[label]` in command output, tool results, and messages to Pi; that keeps them out by accident, not from a command or a model that leaks them on purpose. A "Done when" check command runs after every answer without asking, so with Lancet Guard on it must be one the guard allows outright.
|
|
15
15
|
- **The built-in browser** reaches what this machine reaches: `localhost`, your network, and the internet. Anyone who can steer can use it from the Browser panel, and Pi from its `browser` tool; Lancet Guard does not check either, and pages can hold whatever they show. The addresses people open show in the session's chat. Its pages run in Chromium on the server, not in your browser, so they cannot reach the app or its cookies. Only the owner opens files from the address bar or sees which servers run on the machine. If steering guests should not reach your network, turn Browser off in Menu → Extensions.
|
|
16
|
-
- **Models** are a person's to choose. Pi starts subagents only on their session's model, or on models the owner allowed (Providers →
|
|
16
|
+
- **Models** are a person's to choose. Pi starts subagents only on their session's model, or on models the owner allowed (Providers → Subagent models); PiP passes a model only when its person named it; titles and summaries use the session's own model. Subagents on another model, and PiP, ask a model's sign-in afresh first and use none whose sign-in expired; a session's own run, a subagent on its model, titles, and summaries just try the model, and a run that fails on an expired sign-in marks it. This guards spending against Pi's choices, not against a person: anyone who can steer can pick a session's model, and Pi, which runs commands, can reach Pi's sign-ins and Pi Pocket's files like anything else on the machine.
|
|
17
17
|
- **Linked sessions** (Agent Teams, off until the owner turns it on) widen what prompt injection can reach. A session that read something hostile (a page, a file, an issue) can pass it on to the other sessions of its team in a message, and a message makes Pi work in the target for the person Pi worked for in the sender, with that person's access, in a session where other people may have written. Pi is told to take a linked session's message as a request, not as an order from a person, and to do nothing destructive or with credentials only because one asks; that is guidance to the model, not a boundary. A message is fenced, and a team stops at the starting session's spend limit. Since 0.19.0, no count of messages or sessions stops a team, so set a session budget for a session that starts one; a link gives no access to a session someone cannot already see.
|
|
18
18
|
- **Plan mode** keeps Pi to planning; it is not a boundary. Programs that people configured to run on their own, such as a git diff driver, run as they would for anyone.
|
|
19
19
|
- **Drop-in extensions** in `~/.pi-pocket/extensions/` run inside the server with the owner's rights. They stay off until the owner turns them on. One with a browser module also runs code in the app's own page, with the rights of whoever's tab loads it: the owner's alone unless the module opens it to others (never to someone invited to one session). The page's content security policy keeps that code from loading scripts and styles from another site or fetching from one, but code in the page could still send data out in other ways (navigating the page elsewhere, for one): turn on only browser modules you trust, as with the server part. What a module's route throws with `web.error` reaches everyone who may use that route as it is; anything else it throws, only the owner reads. Every file of a web type (`.js`, `.mjs`, `.css`, `.json`, images, and `.woff2` fonts) in a browser module's folder can be read by everyone the module is for. A module's conversation command is offered to everyone who can steer that session, people invited to only that session included, and its handler runs with the owner's rights: treat its arguments as untrusted, and check who runs it. A global command is the owner's alone.
|
package/docs/architecture.md
CHANGED
|
@@ -55,6 +55,10 @@ Extensions never see `PocketApp`. They get `PocketHost` (`host.ts`), whose funct
|
|
|
55
55
|
|
|
56
56
|
`FolderFavoritesDoc` (`pocket.folder-favorites`) stores each person's ordered favorite working folders in SQLite. `folder-favorites.ts` reads and changes only the signed-in person's list; explicit star/unstar operations run inside one harness transaction, so concurrent devices do not overwrite unrelated changes. The commit coordinator sends each connected client only its person's list as a `folder-favorites` event. `hello.folderFavorites` supplies the initial list and refreshes it on reconnect. The folder picker shows only what the server committed, so a failed save leaves its list as it was.
|
|
57
57
|
|
|
58
|
+
## Ordinary sessions an extension starts
|
|
59
|
+
|
|
60
|
+
`ExtensionSessions` (`extension-sessions.ts`, `app.extensionSessions`, `host.sessions` as `SessionsApi`) starts a top-level session for the person Pi works for in the source, the same kind New session makes. It writes nothing to `linkedFrom`. The owner's list of models for subagents does not apply: a named model must be known and usable now, and a start that names none keeps the default a new session would get. The call's record is an item of `LinkedSessionCallsDoc` under its own token (`session:<source>:<key>`, hashed, apart from the tokens of linked sessions), kept and pruned by `recordOf`, and written in the commit that makes the session. A repeat reads the record first: it returns that session for the record's person, without the checks again. Its first message, when given, goes through `Commands.submit` as that person's own words (a `u:` request id), and a repeat finds that submission. A source past its spend limit, an invited person, a PiP source, and a blank message are refused before anything is made. A message to a session with no model is refused in the creation commit, which then makes nothing. Since 0.28.0, experimental.
|
|
61
|
+
|
|
58
62
|
## Linked sessions
|
|
59
63
|
|
|
60
64
|
`LinkedSessions` (`linked-sessions.ts`, `app.linkedSessions`, `host.linkedSessions` as `LinkedSessionsApi`) starts a session from another and carries messages between them; Agent Teams (`extensions/agent-teams.ts`, off by default) is its only user. A linked session is an ordinary ownerless session in the source's folder. Its session entry's `linkedFrom` names the session that started it, and nothing else follows from it: it is not in `SubagentsDoc`, `parentOf`, or `rootOf`, so it gives no access, and stopping or archiving one leaves the other as it was.
|
|
@@ -96,6 +100,8 @@ Only people choose models; Pi, PiP, and Pi Pocket itself never pick one on the s
|
|
|
96
100
|
- **PiP** passes a model, or names one in what it sends, only when its person named it in their own words (`pip.ts`, with `model-names.ts`): their own messages (`u:` request ids, from the authors document) since PiP's last new context (with those its last compaction kept), and the standing instructions of the watches and webhooks to PiP that they set up; never a watch PiP set up, what was posted, or what GitHub said.
|
|
97
101
|
- **Sign-ins:** `Providers` asks subscriptions' sign-ins afresh (the owner's Providers sheet, a model a subagent on another model or PiP is about to use, a run that failed on one, a run answered by a marked one) and keeps, in memory, the ones their provider refused to renew. Only subagents on another model (`resolveModel`, `modelProblem`), PiP, and linked sessions as they start (`Providers.problem`) check before use, and refuse their models. Everything else tries the model: a session's own run and a subagent on its session's model fail where people see them, and a run that failed on an expired sign-in marks it; a title that fails is only logged. `modelList` and `agentInfo` mark them, and the owner is told. A check that began before a sign-in or sign-out here marks nothing.
|
|
98
102
|
|
|
103
|
+
**OpenAI-compatible endpoints.** `app.customProviders` (`custom-providers.ts`) is the owner's only (`/api/custom-providers`, `requireOwner`). Changes run one after another. Each reads Pi's `models.json`, refuses to rewrite one that is not plain JSON or that Pi's own check (`ModelRuntime.create({ refreshOnCreate: false })`) refuses, writes the whole file at once (temporary file, rename, mode 600), then reloads only that provider (`models.refresh({ providers: [id], allowNetwork: false })`) and sends `models`. It manages only entries with `api: "openai-completions"`, a `baseUrl`, and an id that is not built in; it keeps fields it does not set. A key goes through `models.login(id, "api_key")` into `auth.json`, never into `models.json`; an endpoint without a key gets `apiKey: "none"`. Discovery reaches any address, a private one too, because only the owner can ask, and such servers are often local; its errors are fixed messages, never the fetch error, which can carry the key.
|
|
104
|
+
|
|
99
105
|
**Manual model refresh.** `Providers.modelRefresh` (`model-refresh.ts`) shares one in-flight refresh across owner tabs. `POST /api/models/refresh` requires the owner and the normal `X-Pocket` header; `hello.server.refreshModels` gates the UI against an older server. It checks local configuration with Pi’s public runtime API before reloading it, then refreshes each configured provider in parallel with a separate eight-second limit and `force: true` (network stays off under `PI_OFFLINE`). Each completed provider sends the existing `models` event and refreshes room views, so a slow provider does not hold back a healthy one. Pi owns cache publication and cancellation generations; failed catalog fetches keep its cached/static models. Refresh never configures a conversation or changes the default or subagent allow-list. Counts compare available provider/id keys before and after; provider errors are safe fixed messages, not raw exceptions that could contain credentials.
|
|
100
106
|
|
|
101
107
|
`PocketApp.modelList` resolves Pi’s `enabledModels` through the SDK’s `resolveModelScopeWithDiagnostics` against available models, then `modelList` marks scope membership alongside sign-in state. Both `hello` and providers’ `models` updates use that list. Manual refresh rereads Pi settings before recomputing the scope; malformed scope values are ignored so the picker still opens. The model picker’s Scoped / All state lasts only while it is open and filters the list without changing Pi’s settings, the session’s model, or its default. Empty scopes mean all available models, not a ban on picking models.
|
package/docs/customizing.md
CHANGED
|
@@ -65,7 +65,7 @@ Use a template for a message that people send often. Use a skill for steps that
|
|
|
65
65
|
|
|
66
66
|
## Models and providers
|
|
67
67
|
|
|
68
|
-
People sign in to providers in Menu → **Providers**, and pick a model for each session with the model chip in the message box. Pi Pocket uses Pi's sign-ins (`~/.pi/agent/auth.json`) and Pi's list of models. To add a model or
|
|
68
|
+
People sign in to providers in Menu → **Providers**, and pick a model for each session with the model chip in the message box. Pi Pocket uses Pi's sign-ins (`~/.pi/agent/auth.json`) and Pi's list of models. To add an OpenAI-compatible endpoint (LM Studio, Ollama, vLLM, a proxy), the owner taps **Add** on the **OpenAI Compatible** row in Providers: a name, a base URL, an API key (or **No key**), and models picked from the endpoint's list (**Find models**) or typed by hand. Pi Pocket writes the endpoint into Pi's `models.json`, which it makes, with its folder, when missing, and keeps the key in `auth.json`. **Edit** and **Remove** change it later. A `models.json` with comments, or one Pi refuses, is left alone. To add another model or provider that Pi does not know, or the fields the form does not set (headers, compat, costs), add it to `models.json` as Pi's `models.md` says; the form keeps those fields when it edits the endpoint. A provider that needs code comes as a Pi Pocket drop-in that calls `host.registerModelProvider` ([host.md](extensions/reference/host.md#registermodelprovider)), not as a Pi extension: see [Pi's extensions and packages](#pis-extensions-and-packages).
|
|
69
69
|
|
|
70
70
|
**A Claude subscription.** Sign in to Anthropic with it in Providers. Then turn on **Claude subscription billing** in Menu → Extensions → Installed → **Built in**, so that requests count against the plan. It is off by default, and it asks before it turns on. Without it, Anthropic can bill the requests as extra usage, and refuse them when that is used up.
|
|
71
71
|
|
|
@@ -80,7 +80,7 @@ People sign in to providers in Menu → **Providers**, and pick a model for each
|
|
|
80
80
|
|
|
81
81
|
Models are the person's choice, never Pi's:
|
|
82
82
|
|
|
83
|
-
- A subagent runs on its session's model, unless the owner allows models under **
|
|
83
|
+
- A subagent runs on its session's model, unless the owner allows models under **Subagent models** in the Providers sheet (a pane on the right on wide screens, at the top on phones). By default, there are none. Once some are allowed, subagents and linked sessions run only on those: on the session's model when it is one of them and Pi names none, else on a model Pi chooses from them (Pi must name one when the session's is not among them).
|
|
84
84
|
- PiP gives a model only when its person named it.
|
|
85
85
|
|
|
86
86
|
Instructions, skills, and `AGENTS.md` cannot change this. Tell the person where the setting is instead.
|
|
@@ -18,7 +18,7 @@ A linked session is an ordinary session. The session list shows it under the ses
|
|
|
18
18
|
|
|
19
19
|
- `cwd` selects an existing working folder using the same path rules as the folder picker (including `~`). Prefer an absolute path. A blank `cwd` counts as no `cwd`. A relative `cwd` resolves against the folder of the server process, not the folder of the source. The child loads that folder's project context and tools; the source stays in its own folder. A missing path or a file is rejected before a session is created. Since 0.19.0: an older Pi Pocket ignores `cwd` and uses the source's folder, so a gallery entry that needs it sets `minPocket` to `0.19.0`.
|
|
20
20
|
- Without `title`, the title is the first line of the message.
|
|
21
|
-
- `model` is `provider/modelId`. While the owner's list (Menu → Providers →
|
|
21
|
+
- `model` is `provider/modelId`. While the owner's list (Menu → Providers → Subagent models) is empty, it must be the source's model. Once the list has models, it must be one of them, and the source's own model counts only when it is listed. Without `model`, the session uses the source's model if the list is empty or has it. If the list does not have it, the call is refused with an error that names the allowed models: the caller must choose one (the error is a 400 for a human route).
|
|
22
22
|
- `send` refuses a session that runs on a model off the list (a person changed it, or the owner changed the list), when the list is not empty. A message from a linked session to the session that started it is a reply, not work: it goes whatever model that session runs on.
|
|
23
23
|
- `thinking` can be any level, also one above the source's. Without it, the session uses the source's level. Pi Pocket lowers it to the highest level that the model has, or uses the lowest level of the model when it has none that low.
|
|
24
24
|
- When a model cannot be used now, Pi Pocket refuses the call before it makes anything.
|
|
@@ -48,6 +48,7 @@ These members are public:
|
|
|
48
48
|
- `skillPaths()`, `skills(cwd)`
|
|
49
49
|
- `heldBack(conversationId)`, `onLimitsChanged(listener)`
|
|
50
50
|
- `linkedSessions`: `start`, `send`, `list` (experimental in 0.14, see [Experimental](#experimental)); `stop`, `archive` (experimental, since 0.28.0)
|
|
51
|
+
- `sessions.start` (experimental, since 0.28.0: [Starting an ordinary session](../sessions.md))
|
|
51
52
|
- `text`: `quoted`, `defang`
|
|
52
53
|
- `thinkingLevels`
|
|
53
54
|
- `fetchPublic(url, init)` (experimental, since 0.20.0)
|
|
@@ -28,6 +28,10 @@ Sections render before each request. Pi Pocket sends again only the sections tha
|
|
|
28
28
|
- Put the date in a section, not the time.
|
|
29
29
|
- Do not put counters in a section.
|
|
30
30
|
|
|
31
|
+
## A section for one tool
|
|
32
|
+
|
|
33
|
+
A section about a tool shows while `input.agent.tools` has the tool. In codemode's Only mode, scripts alone call most tools, so also show it when `input.agent.callable` has the tool with `callers` that leave out `"model"`, as `browser.ts` does.
|
|
34
|
+
|
|
31
35
|
## A section for one session
|
|
32
36
|
|
|
33
37
|
`input.conversationId` is the session. `input.read.snapshot(Doc, input.conversationId, context)` reads a document of that session. Use them to write a section that depends on the session.
|
|
@@ -91,3 +91,4 @@ Each member in the reference has its own Since line. These parts came together:
|
|
|
91
91
|
| Answers to pick on an ask's card: `header`, `choices`, `multiple`, and `other` in `AskField` (experimental) | 0.27.0 |
|
|
92
92
|
| Read-only conversation and descendant usage: `ConversationWebRequest.conversationUsage` (experimental) | 0.28.0 |
|
|
93
93
|
| How a run stopped: `outcome` and `failure` on `run.ended`, and `failed` on a linked session (experimental) | 0.28.0 |
|
|
94
|
+
| `host.sessions.start` (experimental) | 0.28.0 |
|
|
@@ -108,7 +108,7 @@ subagentModels(): readonly string[];
|
|
|
108
108
|
|
|
109
109
|
Since 0.13.1 · Stable
|
|
110
110
|
|
|
111
|
-
The models that the owner lets subagents use, as `provider/modelId`. While the list is empty (the default), a subagent runs on the model of its own session. Once it has models, subagents and linked sessions run only on those: the model of the session when it is listed and none is named; when it is not listed, the caller must name a listed model. The owner sets it in Menu → Providers →
|
|
111
|
+
The models that the owner lets subagents use, as `provider/modelId`. While the list is empty (the default), a subagent runs on the model of its own session. Once it has models, subagents and linked sessions run only on those: the model of the session when it is listed and none is named; when it is not listed, the caller must name a listed model. The owner sets it in Menu → Providers → Subagent models.
|
|
112
112
|
|
|
113
113
|
### `modelProblem`
|
|
114
114
|
|
|
@@ -403,6 +403,41 @@ What `fetchPublic` takes besides the address.
|
|
|
403
403
|
- `maxBytes`: the size of the body at most, after it is decoded.
|
|
404
404
|
- `timeoutMs`: the time for the whole request at most, the body included.
|
|
405
405
|
|
|
406
|
+
## Ordinary sessions
|
|
407
|
+
|
|
408
|
+
### `sessions`
|
|
409
|
+
|
|
410
|
+
```ts
|
|
411
|
+
readonly sessions: Sessions;
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
Since 0.28.0 · Experimental
|
|
415
|
+
|
|
416
|
+
Lets an extension start an ordinary session, the same kind a person gets from New session. [Starting an ordinary session](../sessions.md) tells you who it acts for, what it checks, and what the new session is.
|
|
417
|
+
|
|
418
|
+
The call acts as the person that Pi works for in `source`, and that person's checks apply. Give it a `key` that stays the same when the call runs again. A second call with the same `key` returns the session the first call made, and sends its message once. It acts for the person of the first call, and it does not check the model, the folder, or the spend limit again. A `key` of `linkedSessions.start` never finds a session of this API.
|
|
419
|
+
|
|
420
|
+
#### `sessions.start`
|
|
421
|
+
|
|
422
|
+
```ts
|
|
423
|
+
start(
|
|
424
|
+
source: ConversationId,
|
|
425
|
+
request: { title?: string; cwd?: string; model?: string; thinking?: string; message?: string },
|
|
426
|
+
key: string,
|
|
427
|
+
): Promise<{ session: ConversationId }>;
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Since 0.28.0 · Experimental
|
|
431
|
+
|
|
432
|
+
Makes a top-level session and, when `message` is given, sends that text as its first message. It returns the new session's id.
|
|
433
|
+
|
|
434
|
+
- The new session works in `cwd` when supplied, otherwise the server's default folder. `cwd` must name an existing folder and uses the normal folder-picker path rules. A missing folder is refused before a session is made.
|
|
435
|
+
- `model` is `provider/modelId`. It must be a model known here whose provider can be used now. Without it, the session starts on the model a new session would get. The owner's list of models for subagents does not apply.
|
|
436
|
+
- `thinking` is any level. Pi Pocket lowers it to the highest level the model has, or uses the model's lowest when it has none that low. Without it, the session keeps the thinking level it started with.
|
|
437
|
+
- The new session has no `linkedFrom`. It is its own row in the session list, and it can start linked sessions of its own.
|
|
438
|
+
- A source past its spend limit, a person invited to one session, and a PiP source are refused, and nothing is made.
|
|
439
|
+
- A blank `message` is refused, and nothing is made. A `message` is also refused when the session gets no model: no `model` and no default model.
|
|
440
|
+
|
|
406
441
|
## Linked sessions
|
|
407
442
|
|
|
408
443
|
### `linkedSessions`
|
|
@@ -128,6 +128,7 @@ Each is a `data-part` attribute. Some elements have two (`data-part="composer-bu
|
|
|
128
128
|
| `home` | The home screen on wide screens |
|
|
129
129
|
| `home-facts`, `home-logo`, `home-title`, `home-fact`, `home-colors` | Its summary: the block, the logo, the first line, each fact, the palette's colors (each a `home-color`) |
|
|
130
130
|
| `home-actions` | Its buttons |
|
|
131
|
+
| `home-menu` | Its menu button, top right: the menu without a session's items |
|
|
131
132
|
| `home-recent`, `home-heading`, `home-recent-row`, `home-recent-key` | Jump back in: the list, its heading, each session, and the number that opens it |
|
|
132
133
|
| `home-list` | The session list as a phone's home screen |
|
|
133
134
|
| `pane` | The conversation's window (or the subagents board, or an extension's page) |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Starting an ordinary session
|
|
2
|
+
|
|
3
|
+
An extension can start an ordinary session, the same kind a person gets from New session. Use `host.sessions.start`. Its shape is in [the host reference](reference/host.md).
|
|
4
|
+
|
|
5
|
+
**Experimental, since 0.28.0.** It can change in a minor release, but never in a patch release ([API stability](policies/api-stability.md#experimental)). A module for an older server checks that `host.sessions` is there, and a gallery entry that needs it sets `minPocket` to `0.28.0`.
|
|
6
|
+
|
|
7
|
+
## What the call does
|
|
8
|
+
|
|
9
|
+
`start(source, { title?, cwd?, model?, thinking?, message? }, key)` makes a session and returns `{ session }`, its id.
|
|
10
|
+
|
|
11
|
+
- The session is top-level. It has no `linkedFrom`, and it shows as its own row in the session list. It can itself start linked sessions.
|
|
12
|
+
- It works in `cwd` when supplied, otherwise the server's default folder. `cwd` uses the same path rules as the folder picker, including `~`. A missing path or a file is rejected before a session is created.
|
|
13
|
+
- Without `title`, the title is the folder's name, as for New session.
|
|
14
|
+
- `model` is `provider/modelId`. It must be a model known here, and its provider must be usable now. Without `model`, the session starts on the model a new session would get. The owner's list of models for subagents does not apply: this is an ordinary session, not a subagent and not a linked session.
|
|
15
|
+
- `thinking` is any level. Pi Pocket lowers it to the highest level the model has, or uses the model's lowest when it has none that low, as it does for a linked session. This is the named model, or the default model when `model` is not given. Without `thinking`, the session keeps the thinking level it started with.
|
|
16
|
+
- With `message`, that text is the session's first message. It is an ordinary message from the person Pi works for in `source`, not a message sent for them.
|
|
17
|
+
|
|
18
|
+
## Who it acts for
|
|
19
|
+
|
|
20
|
+
The call acts for the person Pi works for in `source`. That person must be able to see the source, steer, and start sessions.
|
|
21
|
+
|
|
22
|
+
Pi Pocket refuses the call, and makes nothing, when:
|
|
23
|
+
|
|
24
|
+
- nobody is the person Pi works for in the source, or that person cannot see the source;
|
|
25
|
+
- the source is a PiP conversation;
|
|
26
|
+
- that person was invited to one session;
|
|
27
|
+
- the source is past its spend limit;
|
|
28
|
+
- `model` is unknown, or its provider cannot be used now;
|
|
29
|
+
- `cwd` does not name an existing folder;
|
|
30
|
+
- `cwd` is a remote workspace, and that person is not the owner;
|
|
31
|
+
- `message` is blank, or the session gets no model to send it to (no `model` and no default model).
|
|
32
|
+
|
|
33
|
+
## Once
|
|
34
|
+
|
|
35
|
+
Give the call a `key` that stays the same when it runs again, such as `${api.taskId}:${api.callId}`. A second call with the same `key` from the same source returns the session the first call made. It acts for the person the first call acted for, also when someone else wrote in the source since then. It does not check the model, the folder, or the spend limit again: a source that has reached its spend limit since then still gets its session back. When `message` is given, it is sent once: the repeat finds the message the first call sent.
|
|
36
|
+
|
|
37
|
+
The keys of this call are apart from those of `linkedSessions.start`. The same `key` given to both starts two sessions, one of each kind.
|
package/docs/extensions/tools.md
CHANGED
|
@@ -27,7 +27,7 @@ export default function createMyWords() {
|
|
|
27
27
|
|
|
28
28
|
- `name` must be different from the name of each other tool ([Names](reference/names.md)). Use a prefix of your own.
|
|
29
29
|
- `description` and `parameters` go to the model with each request. Keep them short and exact.
|
|
30
|
-
- `deferred: true` keeps a tool out of the requests until Pi loads it with `tool_search`, which only the Tool search module offers: while it is off, Pi cannot load the tool. Use it for a tool that few conversations need, or for a large set of tools. `test/prompt-budget.test.ts` keeps Pi Pocket's own prompt and tools at
|
|
30
|
+
- `deferred: true` keeps a tool out of the requests until Pi loads it with `tool_search`, which only the Tool search module offers: while it is off, Pi cannot load the tool. Use it for a tool that few conversations need, or for a large set of tools. `test/prompt-budget.test.ts` keeps Pi Pocket's own prompt and tools at 11,000 characters (about 4,000 tokens) in a plain session.
|
|
31
31
|
- `parameters` is a TypeBox schema (`Type` from `@earendil-works/pi-ai`). Pi Durable checks the arguments against it before `execute` runs.
|
|
32
32
|
- `execute(args, api, context)` does the work.
|
|
33
33
|
|
package/docs/extensions.md
CHANGED
|
@@ -24,6 +24,7 @@ This page is the map. Read all of it, then only the pages that your task needs.
|
|
|
24
24
|
| Check or change Pi's tool calls and answers | [Hooks](extensions/hooks.md) |
|
|
25
25
|
| Use the app's services, and work with older servers | [Using the host](extensions/host.md) |
|
|
26
26
|
| Start sessions, and send messages between them | [Starting and messaging sessions](extensions/linked-sessions.md) |
|
|
27
|
+
| Start an ordinary session, like New session | [Starting an ordinary session](extensions/sessions.md) |
|
|
27
28
|
| Add to the app: routes, a browser module, commands | [Adding to the app](extensions/app.md) |
|
|
28
29
|
| Name how an input this module sends shows in the transcript | [Adding to the app](extensions/app.md), [`web.presentEntry`](extensions/reference/web.md#presententry) |
|
|
29
30
|
| Answer requests on the server, and say who may use them | [Routes](extensions/routes.md) |
|
package/docs/features.md
CHANGED
|
@@ -20,7 +20,7 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
20
20
|
- **A new context.** Menu → **New context** (or `/reset [note]`): Pi starts fresh and no longer sees the messages so far, while everyone still does. An optional handoff note carries over what matters.
|
|
21
21
|
- **Instructions for Pi.** Menu → **Instructions for Pi** (or `/instructions …`): ground rules Pi gets with every message in this session, such as "use pnpm, not npm". Everyone in the session can see them.
|
|
22
22
|
- **Memory.** Short lessons Pi keeps across sessions: how to build and test a project, a gotcha it hit, a convention, a preference someone stated. Pi proposes one with its `memory` tool (one or two sentences each, never secrets) only when a person asks for it, or when Pi is sure that it will help in many later sessions, never for a one-off detail, and proposes fixing or forgetting one that turns out wrong; the owner approves. What Pi reads (a web page, a post, a comment, a file) could talk it into a "lesson" that would reach every later session, so nothing Pi saves, changes, or forgets counts until the owner says: **Approve** and **Discard** show right under Pi's memory call, with the words that wait and where they would apply (this project, or everywhere: every session and PiP), and in the sheet. Approve approves only what you saw: if Pi changed it since, the app says so and shows the new words. Lessons and project names are kept on one line, without invisible characters, so Pi reads only what the owner saw. A change or forgetting Pi proposes leaves the lesson as it was until then. Lessons you add yourself count at once. Each is for this project or for everywhere: a project's lessons reach every later session in the same repository, its worktrees included (or the same folder, outside a repository), and everywhere's reach every session and PiP. Menu → **Memory** (its hint says how many apply here and everywhere) lists them in those two groups, each with who saved it and a link to the session it came from (when you may see it), with Edit and Forget; type one in to add it by hand, for this project or everywhere, or use `/remember run the tests with make check` or **Remember…** on a message. A guest's lessons wait for the owner too, and a guest's change to one in force is a proposal they can withdraw. What waits shows at the top of the owner's sheet; the menu's hint says how many. Lessons waiting take no room from the approved ones, and a person (or Pi for them) may have 20 waiting at most. Only the owner, or whoever saved a lesson, changes or forgets it; viewers only read. A project keeps 40 lessons and everywhere 30; past that, forget one first. Changes show as lines in the chat. Turn it off in Extensions.
|
|
23
|
-
- **A lean prompt.** A new session gets only the tools most conversations use. `browser`, `background`, `schedule`, `watch_pr`, `ask_someone`, and the design tools wait, and so do their prompt sections; the prompt lists them with a line each, and Pi loads one with `tool_search` when a task needs it. On a model whose provider takes tool changes in the messages (Claude 4.8 and 5, and later), the tool joins the list and stays for the conversation; on any other, Pi calls it from a `codemode` script, so the tool list and the prompt cache never change. Long guides, such as the design guide and the page-to-app messages of artifacts, are files that Pi reads when it needs them. Turn the **Tool search** module off in Menu → Extensions to offer every tool every time. A test keeps Pi Pocket's own part of a plain session's prompt at
|
|
23
|
+
- **A lean prompt.** A new session gets only the tools most conversations use. `browser`, `subagent`, `background`, `schedule`, `watch_pr`, `ask_someone`, and the design tools wait, and so do their prompt sections; the prompt lists them with a line each, and Pi loads one with `tool_search` when a task needs it. On a model whose provider takes tool changes in the messages (Claude 4.8 and 5, and later), the tool joins the list and stays for the conversation; on any other, Pi calls it from a `codemode` script, so the tool list and the prompt cache never change. Long guides, such as the design guide and the page-to-app messages of artifacts, are files that Pi reads when it needs them. Turn the **Tool search** module off in Menu → Extensions to offer every tool every time. A test keeps Pi Pocket's own part of a plain session's prompt at 11,000 characters (about 4,000 tokens: schemas and this prose run at about 2.75 characters a token) or less.
|
|
24
24
|
- **Plan mode.** The **Plan** chip by the message box (or `/plan`): Pi reads files, runs read-only commands, and uses tools their extensions mark read-only, then proposes a plan; writing, editing, and other commands are blocked. Subagents inherit plan mode and explore under the same restrictions. **Approve plan** turns plan mode off and tells Pi to go ahead; it waits until Pi has answered since plan mode went on.
|
|
25
25
|
- **Scheduled messages.** `/schedule in 2h check the deploy`, `/schedule tomorrow 9am …`, or `/schedule every weekday 8:00 summarize CI`, or Menu → **Scheduled messages**: Pi gets the message at its time, in this device's time zone, even with nobody watching, and the people in the session get the usual "Pi finished" notification. Pi can schedule its own follow-ups with its `schedule` tool. Each schedule is a durable task: a restart while it waits keeps waiting, one after its time sends at once, and none is ever sent twice. A schedule is cancelled, with a line in the chat saying why, once its person can no longer steer the session or a spend limit is reached. Limits (settable since 0.24.0): a session holds 50 schedules, a message 4000 characters, a repeat comes at most every 10 minutes (a short repeat can cost money in model calls), and `in …` reaches 366 days ahead. The owner changes each in Menu → Extensions, under Scheduled messages; a change applies at once, to new schedules only. Archiving a session that has repeating schedules says how many keep running there, with a tap to see them, and its Schedules sheet marks it as archived; nothing stops or moves (since 0.28.0).
|
|
26
26
|
- **Done when.** `/until npm test`: after each of Pi's answers, the check runs in the session's folder; while it fails, Pi gets the end of its output and keeps going, for five checks at most. A bar above the message box shows how it stands. With Lancet Guard on, the check must be a command the guard allows outright. In plan mode the check waits until the plan is approved, and past a spend limit Pi stops going on. A check cut off by a server restart is not run again, as it may have done part of its work: Pi hears so, and its next answer is checked.
|
|
@@ -52,7 +52,7 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
52
52
|
- **Continue a Pi session.** A session of Pi in the terminal can carry on here. The owner picks it from **Continue a Pi session** in the New session sheet (or the launcher): Pi's sessions on this computer by folder, newest first, with a search through their titles, folders, and words, and for one its folder, model, and last messages. **Continue in Pocket** makes a new session in its folder, with its model when that one is signed in here, and its whole conversation to read. Pi gets the context Pi itself builds from the file: what a compaction summarized, and Pi's context edits, stay as Pi had them. Pi's system prompt and extensions' state stay behind, and nothing Pi did runs again: a tool call that never finished gets a result saying so. The session's file is only read. The list marks sessions already continued here, and says when Pi went on in the terminal since.
|
|
53
53
|
- **Diagrams and math.** Mermaid fences render as diagrams. Inline `$…$`, display `$$…$$`, and `math`, `latex`, or `tex` fences render as LaTeX. A closing `$` must have no space before it and no letter or digit after it, so prices and text such as `PATH=$HOME/bin:$PATH` stay plain. The owner can turn Diagrams off in Menu → **Extensions**; the original text remains in the conversation.
|
|
54
54
|
- **Export.** Menu → **Export as Markdown** (or `/export`): the whole history as a Markdown file, with tool calls folded into `<details>` blocks.
|
|
55
|
-
- **Any provider or model.** Uses Pi's own model runtime and sign-ins (`~/.pi/agent/auth.json`): pick a model and thinking level per session from the menu that opens up from the model chip in the message box (arrows and Enter pick, with a search box when there are many models), and sign in to providers (API key or subscription) from an inline card in the Providers sheet; expired sign-ins come first with a warning pill. API keys cannot be empty or only spaces. A failed sign-in shows a short message, technical details folded away, and **Start again**. A provider search with no matches offers **Clear search**. Pi’s `enabledModels` setting supplies the **Scoped** list, using Pi’s own pattern matching (including wildcards and thinking-level suffixes). When any scoped models are available, **[scoped | all]** beside the **Model** heading switches between that list and every model with a configured sign-in; the active choice uses the primary color. Tab in the search box (or in the picker, when it has no search box) switches it too, also when the search has no matches; from the picker's other controls, Tab moves the focus. On a touch screen, each choice takes a tap about 40px across. Each opening starts scoped; without a scope, when no pattern matches, or when `/model …` searches for models only outside the scope, it shows all instead. Switching the list keeps the search and changes no model or setting. The default-model picker has the same switch. New sessions start with the owner's default model and thinking level: **Make default** under the thinking levels makes the session's the default, and Menu → **Default model** (or the launcher) picks one without changing a session; without one, a new session starts with a trusted project's model/thinking default, then the last model anyone picked, then Pi's global default. To use project defaults, Menu → **Default model** → **Clear owner default: use project defaults, then last picked**. A project pin needs both `defaultProvider` and `defaultModel` in the final session folder's `.pi/settings.json`; `defaultThinkingLevel` is optional (`off` when omitted) and limited to that model's levels. Thinking-only project settings do not change another source's pair. Untrusted settings use normal fallback; a settings-only project appears in the owner's trust flow. Trust affects only later new sessions, never the open one, and no project setting can grant itself trust. Invalid consulted trusted settings stop creation with a contained error, without a model swap. Known unsigned project models stay selected. Imports, forks, subagents, manual choices, and PiP's own conversation keep their previous behavior. Extra per-project skill/prompt paths and per-project run policy are not supported yet ([project defaults](customizing.md#project-model-defaults-for-new-sessions)) A model is always one a person chose: a default that is not signed in now stays the default (the chip shows it, and the first message says why it fails) rather than give way to another model, and with no model chosen anywhere a new session starts with none until someone picks one. A subscription sign-in that its provider will no longer renew (OpenAI's refusing a refresh with `invalid_grant`, say) is found when the owner opens the Providers sheet, when a subagent on another model or PiP is about to use one of its models, or when a run fails on it: the sheet marks the provider **needs sign-in** with what the provider said, the model menu marks its models, the owner (alone) gets a notice, and subagents on other models and PiP use none of its models until someone signs in again. A session on one of its models, and a subagent on that session's model, are not checked first: they try it, and their runs fail where you see them. **
|
|
55
|
+
- **Any provider or model.** Uses Pi's own model runtime and sign-ins (`~/.pi/agent/auth.json`): pick a model and thinking level per session from the menu that opens up from the model chip in the message box (arrows and Enter pick, with a search box when there are many models), and sign in to providers (API key or subscription) from an inline card in the Providers sheet; expired sign-ins come first with a warning pill. API keys cannot be empty or only spaces. A failed sign-in shows a short message, technical details folded away, and **Start again**. A provider search with no matches offers **Clear search**. Pi’s `enabledModels` setting supplies the **Scoped** list, using Pi’s own pattern matching (including wildcards and thinking-level suffixes). When any scoped models are available, **[scoped | all]** beside the **Model** heading switches between that list and every model with a configured sign-in; the active choice uses the primary color. Tab in the search box (or in the picker, when it has no search box) switches it too, also when the search has no matches; from the picker's other controls, Tab moves the focus. On a touch screen, each choice takes a tap about 40px across. Each opening starts scoped; without a scope, when no pattern matches, or when `/model …` searches for models only outside the scope, it shows all instead. Switching the list keeps the search and changes no model or setting. The default-model picker has the same switch. New sessions start with the owner's default model and thinking level: **Make default** under the thinking levels makes the session's the default, and Menu → **Default model** (or the launcher) picks one without changing a session; without one, a new session starts with a trusted project's model/thinking default, then the last model anyone picked, then Pi's global default. To use project defaults, Menu → **Default model** → **Clear owner default: use project defaults, then last picked**. A project pin needs both `defaultProvider` and `defaultModel` in the final session folder's `.pi/settings.json`; `defaultThinkingLevel` is optional (`off` when omitted) and limited to that model's levels. Thinking-only project settings do not change another source's pair. Untrusted settings use normal fallback; a settings-only project appears in the owner's trust flow. Trust affects only later new sessions, never the open one, and no project setting can grant itself trust. Invalid consulted trusted settings stop creation with a contained error, without a model swap. Known unsigned project models stay selected. Imports, forks, subagents, manual choices, and PiP's own conversation keep their previous behavior. Extra per-project skill/prompt paths and per-project run policy are not supported yet ([project defaults](customizing.md#project-model-defaults-for-new-sessions)) A model is always one a person chose: a default that is not signed in now stays the default (the chip shows it, and the first message says why it fails) rather than give way to another model, and with no model chosen anywhere a new session starts with none until someone picks one. A subscription sign-in that its provider will no longer renew (OpenAI's refusing a refresh with `invalid_grant`, say) is found when the owner opens the Providers sheet, when a subagent on another model or PiP is about to use one of its models, or when a run fails on it: the sheet marks the provider **needs sign-in** with what the provider said, the model menu marks its models, the owner (alone) gets a notice, and subagents on other models and PiP use none of its models until someone signs in again. A session on one of its models, and a subagent on that session's model, are not checked first: they try it, and their runs fail where you see them. **Subagent models** gets a full-height pane on the right of the owner's Providers sheet on wide screens, and comes first on phones. It lists every signed-in model by provider, with a box to find one when there are many: each one checked is a model Pi may start subagents and linked sessions on; with none checked (the default) they run on their session's model, and with some checked they run only on those, never on the session's own model unless it is checked (see Background subagents; `subagentModels` in `~/.pi-pocket/config.json`). A tap changes that one model alone, so quick taps, and two tabs at once, keep every choice. An allowed model that is not signed in now stays listed, marked, so it can be taken off. Star a model in Providers to save it as a favorite, independently of its subagent checkbox. **All models / Favorites** filters this list and the session/default-model picker; favorite models come after the current model and before other models in the picker, within the active scope. Favorites belong to the signed-in person in this browser and survive reloads; they do not sync between devices.
|
|
56
56
|
- **Multiplayer.** Any number of browsers can watch and steer the same session live. The status line under the message box shows how many are here, how full the context is (after a compaction, an estimate marked ~ until the next answer measures it), the cache hit rate, the cost, and a pill that says whether Lancet Guard is on (it opens Extensions). **Reply speed** in Appearance (or the launcher) adds how fast the last answer came: its tokens per second and how long its first token took (a response delivered in one buffered flush has no speed, only that wait). It is off until you turn it on, in each browser. On a touch screen, a tap on the line says in a notice what its items mean. On a narrow screen the line keeps to one row where it can. Where it does not fit, it gives up these in turn, only as far as it must: the speed's long words ("42 tok/s · 1.2s"), "1 here" while you are alone, the word "guard" (the shield stays), the word "context" (the meter stays), the cache, and the wait for the first token. "Sign in another device" makes a one-time invite link, a QR code, and a short code to type on the other device's sign-in screen. The owner can tick **Sign in as me (owner)** to sign their own other device in as the owner, with the owner's notifications, instead of as someone new. Messages show who sent them.
|
|
57
57
|
- **Profile pictures.** Menu → **Your name** (or the round button at the bottom of the side rail) has **Add photo** and **Remove photo**. The picture is cropped to a square and shrunk in the browser, kept in the data folder, and replaces your initials in the people lists, the rail, and on your messages for everyone who can see you.
|
|
58
58
|
- **Working together.** The top bar shows who else is in the session (an avatar with a mark that greys when their tab is in the background, and how many more), and "Alex is writing to Pi…" warns before two people steer at once. The **People** panel opens beside the conversation on wide screens, where it takes the Browser panel's place, and as a sheet on phones. Its header counts the people here; the roster shows their online or away state, typing, and role. A **Take turns** card starts or turns off shared driving with the same permissions as the menu. It has:
|
|
@@ -83,12 +83,12 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
83
83
|
- **For page authors.** `data-pid` names an element for comments and pins. The tweaks manifest is `<script type="application/json" id="pocket-tweaks">[…]</script>`, an array of up to 40 knobs `{ name, label?, type: "range" | "color" | "select" | "toggle" | "text", value, min?, max?, step?, unit?, options? }`. A name that starts with `--` sets that CSS custom property on `:root`; any other name reaches the page as a `pocket:tweak` event on `window`. The app speaks to the page through the bridge's `pocket-inspect`, `pocket-edit-text`, `pocket-tweak-set`, `pocket-highlight`, and `pocket-goto` messages, and the page answers with `pocket-picked`, `pocket-text-edited`, `pocket-tweaks`, and `pocket-deck`. Only the app's inspector can send those answers, and the app checks their shape and length before it uses them.
|
|
84
84
|
- **Who.** People who see every session load the module; people who steer comment, edit, tweak, go back, and export; viewers read the canvas, versions, and comments. Someone invited to one session never loads it. While **Take turns** is on, only the driver writes.
|
|
85
85
|
- **Limits.** The static Preview of an inline card does not load a bundle's assets until you tap Run. The inspector adds about 36 KB to each HTML artifact page. A second HTML page inside the frame has no bridge, and neither has a page that navigates itself, so comments, edits, and tweaks go quiet there. Shadow DOM and nested iframes cannot be picked. A comment shows only on the version it was made on. On a phone, a 1280 px page at "fit" is small: use zoom or a custom size.
|
|
86
|
-
- **Agent Teams.** Off until the owner turns it on in Menu → **Extensions**. Pi starts work in a linked session: an ordinary session in the list, under the one that started it, with its own settings and life (stopping or archiving one leaves the other as it is). It works in the same folder, or in the folder an extension names with `cwd` (since 0.19.0; no worktree of its own) with the same model, thinking level, and agent settings, but none of the history, plan mode, or budget, so Pi gives it all it needs in its first message. With **
|
|
86
|
+
- **Agent Teams.** Off until the owner turns it on in Menu → **Extensions**. Pi starts work in a linked session: an ordinary session in the list, under the one that started it, with its own settings and life (stopping or archiving one leaves the other as it is). It works in the same folder, or in the folder an extension names with `cwd` (since 0.19.0; no worktree of its own) with the same model, thinking level, and agent settings, but none of the history, plan mode, or budget, so Pi gives it all it needs in its first message. With **Subagent models** (Menu → Providers) empty, it runs on the starting session's model; with models checked there, it runs only on one of them: the session's model when that is checked and Pi names none, else a checked one that Pi must name (the refusal lists them), and Pi may name only a checked one. A linked session's reply to the session that started it goes whatever model that one runs on. A message to a linked session on a model that is no longer checked is refused. Pi may name any thinking level, also one above the session's (a level the model lacks becomes its nearest lower one, or its lowest); a model that cannot be used now is refused, with no session made. Pi's tool, `team`, starts linked sessions, lists them, and sends them messages, both ways: an answer does not go back by itself, so each one sends back what it was asked for. A message from a linked session shows as a card of its own, not as a person's message (since 0.28.0): its head names the session and has **Open** when you can see it ("A session you cannot open" when you cannot), its text shows as Markdown, as Pi's replies do, with its first line leading, and a long one folds to its first lines with **Show all**. Pi takes it as a request, not as a person's order. Since 0.19.0, linked sessions write their messages and replies to each other in the language of the person they work for: ASD-STE100 (Simplified Technical English), at about 80% adherence, when it is English (in other languages since 0.28.0); their answers to messages from people stay as they were. The links above the transcript (**Started from**, **Linked session**, and past three, **+N more**) open the others. Each start and message acts as the person Pi works for, with their access, take turns, plan mode, and spend limit: a session someone cannot see stays out of their reach, and its name out of the list Pi gets, unless everyone in the session sees it. A link gives no access: someone who sees only the new session does not learn where it came from. A team has bounds: a linked session starts none, and the budget of the session that started the team covers what all of them spend. No count limits how many linked sessions a session starts, and no count of messages between them stops them (since 0.19.0; before, a session started 10 at most, and they stopped after 20 messages with no person writing). Unlike subagents, linked sessions report nothing by themselves, and a subagent cannot start them.
|
|
87
87
|
- **Session tags.** Off until the owner turns it on in Menu → **Extensions**. Shared labels on sessions, which show as chips under each row's title. To tag sessions, hover a row and click its tag button, hold a row (on a touch screen), or select rows (Ctrl/⌘+click, or **Select**) and choose **Edit tags**, or use **Edit this session's tags** in the launcher: add a tag, take one off, then Save. Tags are lowercase, up to 32 characters each, and 10 on a session at most; a change to several sessions saves on all of them or on none. The filter button in the session search, or a tap on a chip, shows only the sessions that have every chosen tag; the tab keeps its filter until it closes. **New** in the Sessions head, while the filter is on, gives the new session the chosen tags, so it stays in the list. The list's search and the launcher find sessions by their tags too. People who steer every session edit tags, viewers see them and filter by them, and people invited to one session do not see them. Each person sees only the tags of the sessions they can see. Since 0.20.0; it uses the session list's extension points, which other extensions can use too ([browser-modules.md](extensions/browser-modules.md#the-session-list)).
|
|
88
88
|
- **Ask someone.** Off until the owner turns it on in Menu → **Extensions**. When Pi needs an answer that only someone outside the chat can give (a manager, a client, an expert), **Ask someone** under one of Pi's answers puts a request in the message box, and Pi writes the question with its `ask_someone` tool so that it stands alone: the background, the question, the options, and its recommendation. Nothing goes anywhere yet: the draft waits in **Questions for others** (the status line under the message box, the session menu, or the launcher), where you edit it, **Copy text**, or **Create link** for a day, a week, or a month. The link opens a page with no sign-in, the question, and a box for one answer and an optional name; then it closes. **Copy link**, **Copy message**, and **Share…** (on a phone) send it on; **End link** takes the page down. When the answer comes, a notice says so, and **Give to Pi** puts it in the message box, quoted and marked as someone else's view, for you to send. People who steer every session use it; viewers and people invited to one session do not. Since 0.22.0.
|
|
89
89
|
- **Waiting out provider limits.** When a provider's limit stops a run (a 429 or an overload, a Claude or ChatGPT usage window, a model's cap), Pi Pocket waits for it to clear and goes on by itself, instead of failing. It waits until the reset time the provider gave (or, with none, tries again at growing intervals), then sends one request to find out; if that gets an answer, the sessions waiting on the same limit go on, one at a time. The live line says what Pi waits for, when it tries next, and when the limit resets, with **Retry now**; **Stop** or **Interrupt** end the wait at once, and a message you send meanwhile waits in the queue as always. The session's square is a hollow square with a dot, also on peek tiles, and a subagent's row says it waits. One push goes out when a wait of ten minutes or more begins (Menu → **Notifications** → **Waiting for a limit**). It survives a restart. The owner sets the longest wait (**Wait for a limit** in the Providers sheet: Off, 1, 6, 12, or 24 hours; default 6): what waits is any reset time within that longest wait, load with no time given (an ordinary 429 or an overload), which is tried again at growing intervals for up to 30 minutes, and, since 0.24.0, a plan's usage limit with no time given (OpenAI subscription sharing, Z.ai, MiniMax, OpenCode Go), which is tried again about every 15 minutes, up to the longest wait, counted from the first failure across restarts. What fails the run at once, with the reset in the message where there is one: a window of days (Claude's 7-day window, a Codex window of over 300 minutes), a reset after the longest wait, a usage limit that names a window of days (daily, weekly, monthly), with or without a reset time, and a sign-in that expired or billing. Retry now sends one try each 30 seconds. It never picks another model. Since 0.21.0.
|
|
90
90
|
- **Prompt cache keeper.** On by default; `PI_POCKET_CACHE_KEEPER=off` turns it off. While a run waits on a tool call, Pi Pocket replays the last request that ended in a tool call, with `maxTokens` 1, at 90% of the cache's lifetime or 10 seconds early, whichever is sooner. It does so only when the expected savings are more than the cost. It keeps the 5-minute cache only: no idle warming, no 1h cache, no request with `cacheRetention` none, and no Anthropic thinking set by a token budget. It stops on a real cached request, when the run ends (PiP's too), on an error, at shutdown, or after 30 minutes. A warm request does not wait for a provider limit. Its usage counts in `pi.usage` and in the spend of the person and session that were paying when it started, and spend limits are checked before each warm. A restart drops the warm timers and does not replay warm requests.
|
|
91
|
-
- **Background subagents.** The `subagent` tool spawns named subagents that work in their own conversations while you keep talking. Pi writes its tasks for subagents in the language of the person it works for, in ASD-STE100 (Simplified Technical English) when it is English (since 0.19.0; in other languages since 0.28.0), and asks for their reports in that language too. Since 0.20.0, Pi's instructions say when to start one (independent parts of the work, a long or noisy job whose result alone matters, a review or second opinion before it calls work done, or when you ask for subagents or parallel work), when to do the work itself (one or two tool calls, work that needs the conversation), and what a brief holds (the goal, paths, what is known, limits, and the report wanted: answer first, then evidence); the result of a start tells Pi to carry on with its own part. Linked sessions (Agent Teams) get the same kind of guidance: they suit long or separate jobs that you may want to follow, and subagents suit short helpers. Open one to watch it or talk to it. Its answer goes back to the main agent at its next pause (after a tool call; when it is idle, after a moment, so answers that finish together go together); answers that arrive meanwhile wait together and go as one message, shown as a card each, so many subagents cost the main agent one extra turn at most, and wait in its queue as one row: one that arrives while that row waits joins it. A subagent that fails says why, and one that is stopped says so, to the main agent too, so it does not wait for an answer; a message sent to it while it worked, which its failed run never took, is withdrawn, and the main agent is told to send it again. A subagent thinks at the session's level unless Pi names another, of any height, such as a cheap model at its highest (a level its model lacks becomes the nearest lower one it has, or its lowest, and the main agent is told), with an optional tool list. Pi picks no model on its own: until the owner allows models for subagents (**
|
|
91
|
+
- **Background subagents.** The `subagent` tool spawns named subagents that work in their own conversations while you keep talking. Since 0.28.0 the tool waits for tool search, as `browser` does, so a session that starts none does not pay for its prompt. On a model without tool changes in the messages (all but Claude 4.8 and 5, and later), Pi then starts subagents from a codemode script: the conversation shows each start as a line of that script, without the subagent's card, and the subagents board still opens each one. Pi writes its tasks for subagents in the language of the person it works for, in ASD-STE100 (Simplified Technical English) when it is English (since 0.19.0; in other languages since 0.28.0), and asks for their reports in that language too. Since 0.20.0, Pi's instructions say when to start one (independent parts of the work, a long or noisy job whose result alone matters, a review or second opinion before it calls work done, or when you ask for subagents or parallel work), when to do the work itself (one or two tool calls, work that needs the conversation), and what a brief holds (the goal, paths, what is known, limits, and the report wanted: answer first, then evidence); the result of a start tells Pi to carry on with its own part. Linked sessions (Agent Teams) get the same kind of guidance: they suit long or separate jobs that you may want to follow, and subagents suit short helpers. Open one to watch it or talk to it. Its answer goes back to the main agent at its next pause (after a tool call; when it is idle, after a moment, so answers that finish together go together); answers that arrive meanwhile wait together and go as one message, shown as a card each, so many subagents cost the main agent one extra turn at most, and wait in its queue as one row: one that arrives while that row waits joins it. A subagent that fails says why, and one that is stopped says so, to the main agent too, so it does not wait for an answer; a message sent to it while it worked, which its failed run never took, is withdrawn, and the main agent is told to send it again. A subagent thinks at the session's level unless Pi names another, of any height, such as a cheap model at its highest (a level its model lacks becomes the nearest lower one it has, or its lowest, and the main agent is told), with an optional tool list. Pi picks no model on its own: until the owner allows models for subagents (**Subagent models** in the Providers sheet), a subagent runs on its session's model, and the subagent tool offers none and refuses one Pi names. Once some are allowed, a subagent runs only on those: with no model named, on the session's model when that is allowed, else Pi must name an allowed one (the refusal lists them, and its instructions show each model's thinking, context window, and price where known, with a line on matching the model to the work); one that is not allowed is refused, as is one whose sign-in expired, with word to tell you rather than pick another. A subagent on a model the owner does not allow (any longer), the session's own included, gets no more work; a level raised by hand in its conversation stays as work is sent. One whose model or provider failed (an expired sign-in, a model that is gone or refused, a quota or rate limit) says so with its model, on its card and in a notice, and the main agent is told to stop and tell you, never to start it again on another model. A subagent's status line shows what the subagent itself cost, with no limit: the limit is its session's (since 0.28.0).
|
|
92
92
|
- **PiP.** The owner's assistant, "Pi in Pocket", over every screen. It stays out of the way until called: Alt+A, the rail's orb, the PiP tile in the places, the launcher, or `/pip` (`/pip what needs me?` asks at once); a small mark shows in the corner only while it works or has something new. It opens as a rounded, shadowed window anchored 16px from the bottom right corner on wide screens (on a short screen it is shorter, never over a session's top bar; on a screen narrower than about 1600 px it covers the right end of a session's message box until it closes) and a sheet from the bottom on phones, over whatever is open, which stays as it was; Esc, back, or a swipe down closes it. PiP looks after the other sessions: it lists and reads them, starts sessions (in a folder, a worktree, with a model) and messages them, stops and archives them, schedules messages there, watches your GitHub repositories and pull requests and acts on what happens there (see Watch a repository), starts sessions in a repository by name (its checkout, or a clone), and follows runs until they end, when a report comes back to it and it says in a line what came of it: pushed as a notification when you are not looking (instead of the session's own "Pi finished", which is held back only while PiP is on, not held back by a spend limit, and following that run, and for a minute after its report), which opens PiP over whatever the app shows. A request to do hands-on work authorizes PiP to start or message the session it needs; you do not have to say “start a session.” PiP delegates to that session's tools instead of refusing because its own tools cannot edit files or run commands. PiP's model and new sessions' default model are separate: if a worker has no model, choose one in that session. Menu → Default model sets the model for future sessions. It is dependable before fast: it acts on a session (messages, stops, archives, follows its run, schedules there, or watches its PR) only after it looked at it in the last 15 minutes (read it, started it, or had a report from it), its tools say how a session stands after they act, and it says what it checked and what it did not; tasks it sends that touch code ask for the checks and tests. It never picks a model: which one is yours to say, as below. A session's last answer comes to PiP, in a report or a read, in parts of up to 12,000 characters; when it is cut, a note after the fence says how many characters are left, and PiP's `session_read` tool takes `answerFrom` (a character) to read the rest of that answer, part by part. What sessions say reaches PiP fenced as data, never as instructions, and what sessions, guests, or GitHub named (titles, waiting calls, scheduled messages, PR titles) comes on one line, quoted, as data too. It makes at most 60 messages, follows, schedules, and watches (its reminders to itself included; a schedule it could not make does not count), and starts at most 20 sessions, an hour (counted since the server started). It can deny a call waiting for approval, never allow one. When one of its own calls waits for approval, the panel says so, and **Review** opens its conversation, where it can be allowed. What it sends shows as sent through PiP for you; it reads files but changes none and runs no commands, handing hands-on work to sessions. It writes what other agents read (its messages to sessions, scheduled messages, and the instructions of its watches) in its person's language: ASD-STE100 (Simplified Technical English), at about 80% adherence, when it is English (since 0.19.0), the same short, plain style in another (since 0.28.0), so a session it worked in reads in your language; it asks each session to answer it in the same language and style, and a session answers a message that came through PiP (scheduled ones too) in the language of that message. PiP's answers to you stay as they were. Your messages are accent bubbles, and one you send while it works shows at once, dimmed, with when PiP reads it (at its next pause, or when it finishes for a queued one) and **Withdraw**, until PiP takes it; completed steps have small green checks, and reports are rounded cards that expand to show more. Its replies link the sessions they name; **Open as a conversation** shows every step, and **Start fresh** gives it a new context. The panel's header measures context against PiP's compaction limit, capped at the model's context window (or just that window with **As sessions do**), and follows changes in Extensions; **Compact** there (or `/compact`, or `/compact` with what to keep in mind, typed to PiP) turns its older messages into a short summary, the newest few kept as they are; and by default it compacts when a session would, at Pi's own thresholds (since 0.22.0; before, above 60k tokens). To keep it smaller, the owner picks 40k, 60k, or 100k in Extensions under PiP (`pipCompactAt` in `~/.pi-pocket/config.json`): then it compacts itself once idle above that, and waits for 8k tokens more before it does again, while a session's thresholds stay as a backstop during a long run. An owner who chose a limit before keeps it. PiP's summary is its own: written from its conversation with what sessions said, webhooks' posts, GitHub's events, and what files and scripts gave back left out, so none of their words come back as PiP's notes; it keeps its person's preferences, what is still open, and what it follows and watches, which live on the server and carry on as they were. A summary that cannot be written leaves the context as it was: Compact's notice says why, and after one of PiP's own that failed it waits 30 minutes, or 8k tokens more, before it tries again. A summary costs a request, counted in PiP's spend. It is a conversation of its own, kept out of the session list and out of everyone else's reach (nobody else can open it or write to it), and durable like the rest: follows outlive a restart. Its cost shows in its person's Spend sheet, and its follows in Running now. Turn it off in Extensions: it stops what it was doing (a compaction too), takes no messages, its own conversation's box included, and meanwhile its follows' reports and its own scheduled messages wait, webhooks to it answer 503, and repository watches to it hold what they found, all going on once it is back. PiP follows its owner's standing instructions in `pip.md` in the data folder (since 0.28.0, [customizing.md](customizing.md#pips-instructions)).
|
|
93
93
|
- **Resize.** At widths of 768px and above, drag PiP's left edge, top edge, or top-left corner to resize it, with the bottom-right corner fixed. The same zones are finger-sized on touch screens. Its size is remembered for each account in this browser and fits back inside the viewport when it shrinks. Phones use a bottom sheet with rounded top corners and a grabber; the model, context meter, and all four header actions stay available.
|
|
94
94
|
- **Choose PiP's model.** Tap the model chip in PiP's header to use the existing model and thinking picker for PiP alone, from Home or over a session. The chip and picker choices are disabled while PiP works. Saving also checks that PiP is idle. This header path does not change the last picked model for new sessions; **Open as a conversation** keeps its existing behavior. With no model, the welcome offers **Choose a model to use these suggestions**, which opens the same picker. Suggestions that send at once wait for a model; those that put text in the box stay usable, and choosing a model keeps the suggestions visible.
|
|
@@ -110,7 +110,7 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
110
110
|
- **The queue and the bars above the message box.** Messages waiting for Pi show above the message box, with how many wait whenever not all of them show. With the bars there (the subagents bar, plan mode, a goal, a PR watch, a trust question, who drives), they take less than half of the room they share with the conversation when the bars fit in it, and the conversation keeps the rest, staying where you were reading. The bars always show whole; the queue and the subagents' list take what the bars leave, and scroll. Unfolding the subagents bar gives the list the room, one whole row at least: the queue shows fewer rows, or folds to how many wait. With several bars on a short screen, the plan, goal, watch, and trust bars keep one line each, their words cut short and their buttons whole. When even that does not fit (a phone on its side with every bar up), the stack scrolls, and the conversation keeps a quarter of the room, or a few lines, whichever is less.
|
|
111
111
|
- **Live editing.** No build step. Edit a file in `web/` and every open browser reloads. Edit a file in `src/server/extensions/` and it is reinstalled into the running server (a running tool call finishes on the old code). For core server changes, use **Restart server** in the menu: running work resumes after the restart.
|
|
112
112
|
- **Lancet Guard.** Off by default: the owner turns it on in Menu → **Extensions**. If `specpi-lancet-guard` is installed in Pi and turned on there too, its rules and classifier check every bash, write, and edit call, and each command Pi starts in the background. A "risky" or "unsure" verdict shows Allow/Deny buttons to everyone in the session; the answer survives restarts. The classifier needs the LANCET Nano model, a one-time download of about 109 MB. While it is missing, the guard row in Extensions says so and the owner gets a **Download** button there: it fetches the pinned release from GitHub, checks it against fixed checksums, and installs it where Pi's own `/lancet-guard setup` puts it, so Pi uses it too. Progress shows in every tab, and nothing downloads it without that button. A guard that is on without its model blocks the bash calls its local rules leave open, and the status line shows "guard failed".
|
|
113
|
-
- **Codemode.** On by default, like `"+codemode"` in Pi's `defaultTools`. The `codemode` tool runs JavaScript the agent writes in a QuickJS sandbox with no Node, files, network, or timers; its only capability is calling the agent's other tools as `tools.<name>(args)`. Use it to batch independent calls, chain them, or filter large output before it reaches the model. Each call a script makes goes through the same checks and hooks as a direct call, so Lancet Guard judges it and can ask for approval. `store()` and `load()` keep values per conversation. Its card shows the script, each call it made, and the output.
|
|
113
|
+
- **Codemode.** On by default, like `"+codemode"` in Pi's `defaultTools`. The `codemode` tool runs JavaScript the agent writes in a QuickJS sandbox with no Node, files, network, or timers; its only capability is calling the agent's other tools as `tools.<name>(args)`. Use it to batch independent calls, chain them, or filter large output before it reaches the model. Each call a script makes goes through the same checks and hooks as a direct call, so Lancet Guard judges it and can ask for approval. `store()` and `load()` keep values per conversation. Its card shows the script, each call it made, and the output. Since 0.28.0, Codemode has a **Mode** setting in Menu → Extensions, for the owner and all sessions, as Pi's `codemode.mode`. **On** (the default) changes nothing. **Only** declares only `codemode`, `tool_search`, `artifact`, `ask`, and `memory` (the cards of the last 3 need a direct call). Pi calls every other tool only from scripts (except a drop-in tool whose `callers` names `"model"`), also the tools of a module that is turned on later, and a tool that a session loaded before. The codemode section of the prompt lists each of these tools with its description and parameters, up to 3,000 tokens (Pi's default `codemode.inlineBudget`), and then the names of the others. Tools that wait for `tool_search` still wait, and a tool that it loads goes through codemode. A subagent that gets one of these tools also gets `codemode`. One limit: a subagent started in On mode with a list of tools without `codemode` cannot call a tool in Only mode, because the setting cannot see each session's list.
|
|
114
114
|
- **Share to Pi.** With Pi Pocket on the home screen (Android), share a link, some text, or a screenshot from any app to Pi Pocket: pick a session or a new one, and it goes into the message box with the files attached, ready to send.
|
|
115
115
|
- **Pi's questions.** Since 0.27.0, Pi's `ask` tool asks the person it works for 1 to 4 questions on a card at its call, when a decision changes the work and only they can make it. Each question has a short tag, the question, and 2 to 4 answers as buttons, each with a line under it; a tap chooses one (or several, where the question allows it), and **Or type your own answer** takes a typed one instead. **Send** is on once each question has an answer; **Decline** answers nothing, and Pi goes on with its best judgment. Pi waits for the answer, for hours if it must, and after a restart the same card asks again. Pi gets one line per question (`Storage: Local storage`), and the call shows each question and its answer to everyone in the session. The card shows, and notifies, as an extension's question does (below). It runs in plan mode, the guard never asks about it, and subagents do not have it. The **Ask** module, on by default (Menu → Extensions).
|
|
116
116
|
- **Questions from extensions.** An extension can ask the person Pi works for on a card, as an approval asks: a sign-in, a one-time code, a key, or "solve the CAPTCHA, then tap Done". Only that person can fill it in (the owner, when nobody is known); anyone who can steer can **Decline**. What is typed goes to the extension, never to Pi, into the transcript, or to the other people here, and the call's line says **Answered** or **Declined** by whom. A notification goes to that person alone, and opens the session: the fields are filled in in the app. Extensions can also hide values (they show as `[label]` in command output, tool results, and in a message to Pi that someone pasted one into), give commands environment variables, and use the session's browser page. Since 0.22.0 ([docs/extensions/people-values.md](extensions/people-values.md)).
|
|
@@ -123,7 +123,8 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
123
123
|
- **Extension settings.** A module can declare settings (on or off, text, a number, a choice, or a secret such as an API key); the owner changes them in Menu → Extensions under the module, with **Save settings**, and **Default** or **Clear** to put one back. A secret's value never leaves the server: the sheet shows only that it is set. Modules can also listen to what happens in the app (sessions made, renamed, and archived, messages, runs) and offer services to each other; Extensions says which ones offer a service. Since 0.22.0 ([docs/extensions/services-settings.md](extensions/services-settings.md)).
|
|
124
124
|
- **Extension gallery.** Menu → Extensions → **Discover** (or **Find extensions** in the launcher) lists drop-ins other people wrote, from a reviewed index ([TannerMidd/pi-pocket-extensions](https://github.com/TannerMidd/pi-pocket-extensions) unless the owner picks another): search them by name, words, and tags; entries for a newer Pi Pocket are hidden. Each row has a quiet **Install**, which installs it turned off. An entry (since 0.27.0) says **What it can reach** in plain sentences, each marked with where it comes from: **In its code** (from the scan below: "Talks to openrouter.ai", "Uses your openrouter key, from Pi", "Runs git and gh", "Uses files it writes"), **Declared** (the hooks it sees with, such as "Sees tool calls, before they run", and changes to Pi's instructions or tools), and **Always** (it runs in the server with your rights, in every session, where Lancet Guard does not see its code), then what the scan found nothing for. The scan reads the code's text, so the code can reach more than it finds: the entry says so, and nothing claims an extension stays inside. When the installed files were edited since install, the entry and the question say that the summary is the pinned version's, not what runs. **What it adds** shows its tools and commands as code, and what it puts in the app; technical information is folded below. **Install and turn on** asks one question over the sheet: what it reaches, and that the scan reads text so the code can reach more, with **Cancel**, **Install turned off**, and **Install and turn on** (Cancel has the focus, Escape closes only the question, and the question stays until it is installed and on); **Install turned off** installs it without asking, and an installed one that is off has **Turn on**, which asks the same question. Before turning it on, read its source with **View source**, or install it off and **Ask Pi to review**. A theme's entry shows its picture in its own colors (dark and light side by side when it has both), what it changes from its files (its colors, a layout of its own, its fonts, its images), its palette with the values, and **Use it in this browser** and **Open Appearance** once installed. In **Updates**, a row says what an update adds to what the extension declares ("Declares more: sees tool results; 2 new tools", or "Declares nothing new") before its review; its code's changes are in the review's diff. In Installed, a tap on a row opens its settings and details, and turning a drop-in on asks in its row. An entry shows who wrote it, where its code is (a GitHub repository at a pinned commit), its files, and what it declares: its tools (and which only read), hooks, prompt sections, wraps, routes, and browser module, and who can reach them. **Install** downloads its files over https from that commit, checks each against the SHA-256 the index pins (one that differs installs nothing), and puts them in the extensions folder, off, as every drop-in starts. Before turning it on, read its whole source in the gallery, or **Ask Pi to review**: a new session in the extensions folder, in plan mode, where Pi audits what the code reads (`config.json`, sign-ins, other secrets), the addresses it calls, the processes it starts, what its browser module does, and whether it does what it declares. Updates are never automatic: the **Updates** tab lists available updates with a **Review update** button, and the review shows what changes, as a diff of every file and of what it declares, before you apply it. When the index revokes the version you have, the gallery and Extensions say why and offer to turn it off, and a notice says so while it is on. **Uninstall** removes its files (where each came from is kept in `<name>.gallery.json` beside it). **Share…** on one of your own drop-ins in Extensions checks that it stands on its own (its files named after it, importing only Pi Pocket's packages and its own files), drafts its index entry (the description from its doc comment, each file's SHA-256, what it declares while it is on), asks where its files are on GitHub (the repository and commit you put them in, tags, your GitHub name), and, once the entry would pass the index's checks, opens GitHub's page for a pull request to the index with the entry filled in; Pi Pocket itself makes no GitHub calls. [docs/extensions.md](extensions/publishing.md) says how to publish. The owner's alone; turned off in Extensions, it reads nothing. It lists themes too, with a **Theme** tag and filter: **Install** checks a theme's pinned files and its CSS before it goes into `themes/`, and puts it in Appearance's list without applying it; **Update** shows a diff; **Remove** moves it to `themes/.removed/`; **Share…** in Appearance drafts an entry for one of your own themes ([themes.md](extensions/themes.md#themes-in-the-gallery)). **What an entry reaches.** `GET /api/x/gallery/reach` (the owner's, like the other gallery routes) answers `{ entries: { [name]: … } }` for every entry of the index read now, each with the entry's `pin` so the app matches a result to the exact files it shows, so the app can show what each one can reach before it is installed. An extension gives `{ kind: "extension", commit, scanned: { network, keys, programs, files } }`: short words for the hosts its address literals name (`localhost`, standards' namespaces, `example.*`, and repository pages left out; `addresses it builds at run time` when it calls `fetch(`, `new WebSocket(`, or `http.request` with no host in its code, or gives one of them, or a `net`, `tls`, or `dgram` connection, an address it builds, also beside hosts it names), the keys it reads (`openrouter key from Pi`, an environment variable whose name has `KEY`, `TOKEN`, or `SECRET`, `Pi's auth.json`), the programs it starts (`programs it names at run time` when it imports `child_process` but names none, or loads code the scan cannot read: `eval`, `new Function`, `getBuiltinModule`, `process.binding` or `dlopen`, `import()` or `require()` of a name it builds, or a `.node` file), and the files it writes (`files it writes`, paths under `~/.pi/agent/`, or `your home folder`). The scan is by literal patterns on the code with its comments taken out: it tells what the code says, not what it does. A theme gives `{ kind: "theme", commit, palette: { colors, colorsLight } }` from its `colors.toml` and `colors-light.toml` (`null` for one it lacks). An entry that cannot be read (a download fails, or a file differs from the size or SHA-256 the index pins) gives `{ kind, commit, error }` and fails no other entry. Only the code files (`.ts`, `.js`, `.mjs`, `.cjs`) and the two palette files are read: from the installed copy when the entry is installed at the same commit and each file is as pinned, otherwise downloaded from the pinned commit with the checks every download has. Results are kept in `gallery/reach.json` in the data folder, by entry, commit, and pinned files, so the next answer downloads nothing for them; entries that fail are tried again, and three are read at a time.
|
|
125
125
|
- **Updates.** Menu → **Update Pi Pocket** (or the launcher) shows the running version, the newest release with its notes, and **Update to … and restart**; a notice says once when a new version is out. The owner's alone. Under the version, the sheet shows the checkout's branch and commit, **installed with npm (global)**, **installed with npm (local)**, or **run with npx**. For npm installs, Pi Pocket asks the npm registry's `latest` tag for the newest published version 2 minutes after the server starts and every 6 hours after, and GitHub for that version's release notes (`PI_POCKET_UPDATES_REPO` names another repository). A git checkout asks GitHub for the newest release (or the repository's version tags, without notes) and downloads its commit into the checkout under a ref of its own, `refs/pocket-update/target`. An update from a git checkout needs a checkout that the server's user can write, run by the launcher (`npm start`), with no changes that are not committed and no commits the release lacks, and a Node.js the release runs on; the sheet says which of these stands in the way, and an ignored file of yours where the release has a file stops it too. It installs the release's packages beside the checkout first (`npm ci` in `.pocket-update/staging/`, only when the lock file names other packages), stops loading edited files, puts the packages in place, moves the branch forward to the release's commit (a detached checkout moves detached), and restarts. **A global npm install** updates from the app too, when the server's user can write the folder that holds the package and the launcher runs the server: Pi Pocket installs the exact published version into a staging folder beside the package, swaps it in place of the running copy, and restarts, with the copy before kept next to it. If the machine stops at the very moment of the swap, `pi-pocket` may not start: `npm install -g pi-pocket` puts it back. A **local** npm install (in a project's `node_modules`) and a copy **run with npx** do not update from the app: the sheet lists what stands in the way, with the server's hint of what to run instead (`npm install pi-pocket@latest` in the project, or `npx pi-pocket@latest`), and the update button stays off. The owner runs the command and restarts. Running work continues through a restart, but a tool call the restart cuts off comes back as interrupted, and the sheet says when Pi works. When the new version does not start, the launcher puts the files before back and starts that (a git checkout puts the commit and packages back; a global npm install swaps the kept copy back, with no network), and the sheet and a notice say what happened; after the next look the sheet offers that version again, for the owner to try again. A release whose notes have a `[!WARNING]` or `[!CAUTION]` alert needs a tick that you read it, and is not undone by itself, since it may change data one way; so does a release whose notes Pi Pocket could not read because GitHub did not answer (the registry or the tag gave the version, with no notes), since they may have such an alert: read them on GitHub. Under Menu → Extensions → Installed → **Pi Pocket updates**: **Look for new versions** (on), **Install new versions by themselves** (off), and **Beta updates** (off). **Beta updates** (since 0.27.0) also offers pre-releases, tagged `vX.Y.Z-beta.N` (GitHub releases marked as pre-release; npm's `beta` dist-tag): a git checkout takes the highest version among GitHub's non-draft releases (or the beta tags, when GitHub does not answer), and an npm install the newer of the `latest` and `beta` dist-tags. A beta is marked **Beta** in the sheet, the menu hint, and the notice, and its caution says that it may have bugs. With the setting off nothing changes: only stable releases are offered, a beta is never offered, and a running beta still gets the next stable release (`0.27.0` is newer than `0.27.0-beta.N`, and `0.27.0-beta.2` is newer than `0.27.0-beta.1`) but never an older one. Turning it off drops a beta found before. An install by itself also takes a beta, when both settings are on. A server from before 0.27.0 needs a restart (menu → Restart server) for the setting to work. An install by itself waits until no session has worked for 10 minutes, and again after its packages install; it never takes a release with a warning or without notes, or one that failed before (did not start, or did not install). A launcher started before this feature restarts but does not go back, and cannot update a global npm install at all (the sheet says so): quit Pi Pocket and start it again once.
|
|
126
|
-
- **
|
|
126
|
+
- **OpenAI-compatible endpoints.** The owner adds an endpoint from the **OpenAI Compatible** row of the Providers list (**Add**; searching "ollama", "local", or "custom" finds it): a name, a base URL (`http://localhost:1234/v1`), and an API key, or **No key** for a local server. **Find models** asks the endpoint's `GET /models` and lists what it has, each with a checkbox; a model ID can also be typed by hand, and either way it is added. **Save** writes the endpoint into Pi's `~/.pi/agent/models.json` (made, with `~/.pi/agent/`, when missing) and keeps the key in Pi's sign-ins (`auth.json`), so its models show in the model menu at once, with no restart. Each endpoint is a row of the list like any provider, with **Edit** (an empty key keeps the saved one; models can be found again with the saved key, at the same address only) and **Remove** (which removes its key too). Pi Pocket rewrites `models.json` only when it is plain JSON that Pi accepts, and keeps the fields that it does not set; a file with comments or trailing commas is left alone, with a message.
|
|
127
|
+
- **Refresh models.** The owner can tap **Refresh models** in the menu (under App) or the Providers sheet (the refresh button beside the Subagent models heading), or run **Refresh models** from the Ctrl/⌘+K launcher. The same controls work on phones. Refresh reloads `models.json` and Pi’s sign-ins, and asks configured providers for fresh catalogs. The menu's row says when it is refreshing, and a notice gives the added and removed model counts, without closing the menu; the Providers sheet also shows the errors for individual providers. All connected tabs receive the updated list. Healthy providers finish independently of slow ones; each provider has an eight-second limit. Running sessions keep their chosen models. A local model must be configured in `models.json` or registered by a Pocket-compatible extension: refresh does not load regular Pi CLI extensions or discover arbitrary local servers.
|
|
127
128
|
- **Uploads.** In normal chat and PiP, attach files with the picker, paste files or images, or drop them into the message box. Files are saved on the server for the conversation you send to and their paths are given to the agent; supported images also go straight to models that accept them. That includes HEIC and HEIF photos (from an iPhone, say), which the server converts to JPEG for the model in a worker, one photo at a time, with limits of 30 seconds and 64 million pixels (a photo that big needs about 1 GB of memory while it converts), so a broken or huge photo gets a notice and does not hold up the server; the original stays in the session's uploads. When the image the model gets differs from the file, its line in the message says so: the format when it changes (`[Image: shown to you as JPEG.]`, always for a HEIC photo), and, in the words of Pi's `read` tool, the original size, the shown size, and the multiplier when it is made smaller. An image that does not change gets no note. An image starts to be made ready for the model as soon as it uploads, so a send seldom waits for it. In a session's message box (not PiP's), attached files stay across a reload, as the draft does, and leave with your sign-out; while a message is on its way, the box dims and holds what it sends, and if the send fails, it is all there to send again.
|
|
128
129
|
- **Code in your messages.** In a message you send, `` `code` `` and a fence of ` ``` ` lines show as code, the way Pi's replies show it, colored when the fence names a language (` ```js `). A span closes with as many backticks as opened it, a fence's lines stand on their own, and a stray or unclosed one stays text. Nothing else is formatted: `*`, `#`, lists, and spacing stay as typed, and @mentions outside code stay buttons. Only the display changes: Pi, exports, and ↑ get the message as written.
|
|
129
130
|
- **Rich replies.** Code blocks in Pi's replies show their language and a Copy button, with syntax colors for the common languages (no dependencies, so it works offline), and a block of more than 40 lines folds until you ask for the rest. Some show more than code, with the code a tab away: an `html` block (or a reply that is a whole page) is previewed as a page, inline, with its scripts off and nothing loaded from anywhere; **▶ Run** runs its scripts in the artifacts' sandbox, where it can reach the internet but not the app; an `svg` block is drawn as an image (tap it for full screen); and a `diff` or `patch` block opens in the diff viewer. While Pi is still writing, they show as code. Write cards color the file they write, and the file viewer previews `.html` files the same way, with Run. **Cards in the reply.** An `artifact` call with `inline: true` (an `artifact_inline` call, in a session from before 0.28.0) shows as a card in the reply, as the `html` block above with the artifact's name and version in its bar, an **Open** button for the artifact viewer at that version, and the same Preview/Code and Run/Stop; a failed, denied, or stopped call shows as a step with its reason instead. The result records the version its call made, so each card keeps showing its own: an update by Pi adds a new card, and earlier cards, in this session and a fork, do not change. A card's page is read from the artifact's own address, so whoever can see the session sees the card, a viewer and someone invited to this session alone included, and each can Run it. Once run, its page gets what an artifact's does: a follow-up for the message box (a notice for a viewer) and saved state under the artifact's id, shared with the viewer. A preview grows to fit the page, up to 1200 px, and a running page up to 900 px, then scrolls inside. On a phone the bar takes two lines. A viewer already open on an older version stays on it and offers "latest is vN" after an update. Only a call Pi makes itself is a card: one made inside a codemode script is one of its nested calls, and in PiP's panel the call is a line among its steps.
|
package/docs/map.md
CHANGED
|
@@ -94,6 +94,7 @@ A module split into parts keeps its name for the part others import, with the re
|
|
|
94
94
|
| `extension-settings.ts` | Settings modules declare (`web.settings`): their fields checked as the module loads, the owner's values checked before config.json keeps them, and what browsers see (never a secret's value) |
|
|
95
95
|
| `artifact-state.ts` | What an artifact's page saves for each person (`/api/c/:id/artifact-state/:artifact`): one JSON value per artifact, person, and session, up to 16 KB, with a schema label that makes older values read as none, and a limit on saves; not in Pi's context, and a fork starts with none |
|
|
96
96
|
| `reveal.ts` | Ctrl+click on a path (`/api/c/:id/reveal`, the owner's): shows it in the file manager of the machine the server runs on, selected in its folder (FileManager1 over D-Bus, else `xdg-open`; `open -R`; `explorer /select,`) |
|
|
97
|
+
| `extension-sessions.ts` | Ordinary sessions an extension starts (`ExtensionSessions`, `host.sessions` as `SessionsApi` in `host.ts`): a top-level session, like New session, for the person Pi works for in the source, with its model and thinking written in that same commit and its first message sent once; the call's record is an item of `LinkedSessionCallsDoc`, written in the commit that makes the session (since 0.28.0) |
|
|
97
98
|
| `linked-sessions.ts` | Linked sessions (`LinkedSessions`, `host.linkedSessions` as `LinkedSessionsApi` in `host.ts`): starting a session from another and sending its first message, with a record of the call that makes a repeat find the first; the addresses each session knows its linked ones by; messages between them, sent once, as the person Pi works for, through `Commands.submit`; stopping a run and archiving a session of the team (`stop`, `archive`, since 0.28.0); and a team's bounds (one level; since 0.19.0, no count of sessions or messages) |
|
|
98
99
|
|
|
99
100
|
### Workspace providers
|
|
@@ -181,6 +182,7 @@ The agent's side of Design mode. `extensions/design.ts` installs it (see Extensi
|
|
|
181
182
|
| File | Owns |
|
|
182
183
|
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
183
184
|
| `providers.ts`, `net.ts` | Provider sign-ins, and those that need signing in again (a subscription its provider will not renew); HTTP settings for provider streams |
|
|
185
|
+
| `custom-providers.ts` | OpenAI-compatible endpoints the owner adds in Providers: their entries in Pi's `models.json` (made with its folder when missing; a file with comments, or one Pi refuses, is left alone), their keys as stored API-key sign-ins, and discovery of an endpoint's models (`GET <baseUrl>/models`); `web/sheets/custom-providers.js` is the form |
|
|
184
186
|
| `guides/*.md` | Pages that the prompt points Pi to, to read only when a task needs them (`artifact-bridge.md`, `design.md`), so that the prompt stays short |
|
|
185
187
|
| `public-fetch.ts` | `host.fetchPublic`: fetch that reaches only public addresses, checked where each connection is made and at each redirect |
|
|
186
188
|
| `gallery.ts` | The extension gallery (`app.gallery`, `host.gallery`): its index read and kept in the data folder's `gallery/`, downloads checked against their pinned SHA-256, installs (off), updates with a diff, removal, the `<name>.gallery.json` provenance beside each, revoked versions, and Share's draft entries |
|
|
@@ -199,7 +201,7 @@ Outside `src/`: `flake.nix` and `nix/` build Pi Pocket with Nix (`nix/package.ni
|
|
|
199
201
|
|
|
200
202
|
## Extensions: `src/server/extensions/`
|
|
201
203
|
|
|
202
|
-
Each default-exports `(host: PocketHost, web: ExtensionWeb) => Extension | Extension[] | void` (`web` adds to the app: [extensions/app.md](extensions/app.md)) and is installed in this order: `prompt` (system prompt, with where Pi Pocket's docs are), `artifacts` (the `artifact` tool, with `inline: true` for a card in the reply: one store, `publish`, and bundles: `assets`, `removeAssets`, `group`, `kind`; `legacyInline` shows old `artifact_inline` calls to the model as `artifact` calls; `withoutInline` is PiP's), `browser` (browser tool and its prompt section; through `host.browsers`), `diagrams` (Diagrams, on by default: no tools or routes, only the browser client `diagrams` in `diagrams/`: `index.js` renders Mermaid with Pele and math with KaTeX, `style.css` and `math.css` style them; it is the one built-in client that session invitations may load, `isTrustedDiagramsClient` in `extension-web.ts`), `subagents` (subagent tool and its tasks: anchors, reporters, and the courier that sends waiting reports to the parent together; a subagent runs on its session's model, or one the owner allowed, and the app rebuilds the module when that list changes), `agent-teams` (Agent Teams, off by default: the `team` tool and its prompt section, through `host.linkedSessions`; its browser module `agent-teams.js` describes the tool's calls with `pocket.toolCall`; it imports of Pi Pocket's only types and `model-facts.ts`, a pure helper that formats model facts), `schedules` (schedule tool and its four limits, as settings; installs the schedule task), `background` (the background tool and its one setting, through `host.background`; installs the watch task), `goals` (hook after each answer), `plan` (tool hook and prompt section), `anthropic-subscription` (Claude subscription billing), `guard` (tool hook that asks for approval), `codemode` (codemode tool; a script's calls go through the same hooks), `memory` (memory tool and the prompt section of lessons in force; through `host.memory`), `pip` (PiP's tools, prompt, and follow task, through `host.pip`; only PiP's conversation selects it, as `PocketApp`'s settings leave it out of every other conversation's), `triggers` (the PR and repository watch tasks and the `watch_pr` tool, through `host.watches` and `host.repoWatches`; webhooks need it on), `gallery` (the extension gallery's owner-only routes under `/api/x/gallery/`, through `host.gallery`, and its twice-daily look for revoked versions; it installs `pocket-gallery`, which tells the web app it is on), `session-tags` (Session tags, off by default: its `x.session-tags.tags` document, routes that check ids with `request.sessions()`, and its browser folder `session-tags/`, which uses the session list's extension points; it imports nothing of Pi Pocket's but types, as a drop-in would), `ask` (Ask: Pi's `ask` tool and its prompt section, questions with answers to pick on a card through `host.ask`; subagents do not get it, and plan mode lets it run), `ask-someone` (Ask someone, off by default: the `ask_someone` tool, which saves a draft question in its `x.ask-someone.questions` document; routes to edit, share, and end them; a public page (`web.publicPage`) for one answer through each link; and its browser folder `ask-someone/`; it imports nothing of Pi Pocket's but types), `updates` (Updates of Pi Pocket itself: owner-only routes under `/api/x/updates/`, through `host.updates`, its three settings (look, install by itself, beta updates), the look every 6 hours and the install by itself, and its browser folder `updates/`, the menu row, launcher action, and sheet, which says in words how the copy was installed and shows the hints that the server gives for a local or npx install), `design` (Design mode's workspace: its routes under `/api/x/design/` for comments, tweaks, "go back to this one", and the designs list, the `pocket.design-comments` document, the `/design-open` command, and the agent side from `../design/index.ts` (tools, prompt guide, export route); its browser folder `design/` is the canvas: only `index.js` (the store, the rail button, the launcher actions, the command, and a loading state), `paths.js`, and `state.js` (the workspace's one store) load at app start; `app.js` (the workspace, with `style.css`) loads when the panel first opens, and `docks.js`, `views.js`, and the System view (`system-ui.js`, with `system.css`) when first used; `unsaved.js` carries the System view's unsaved count and save; `workspace.js` is the picker, toolbar, and modes, `canvas.js` the frame and its bridge, `docks.js` the versions, comments, text edits, and tweaks, `system-view.js`, `system-sections.js`, `system-widgets.js`, `system-actions.js`, `system-data.js`, and `system-preview.js` the System view, `check.js` the Check tab, `picker.js` the design picker, `views.js` compare, the variations grid, the slide strip, and present mode, `data.js` what it asks of the server, `parts.js` small pieces, `style.css` the workspace's sheet, and `system.css` the System view's; `devices.js`, `tweaks.js`, `edits.js`, `messages.js`, `comments.js`, `system.js`, `color.js`, and `specimen.js` are pure helpers (`color.js`, with `color.d.ts`, is also the server's color math, through `../design/color.ts`); `system-routes.ts` and `system-api.ts` are the System view's routes (`system`, `system/check`, `system/docs`, `system/export`) and the engines they call; it imports the app's own `/store.js` and `/artifact-bridge.js`), and `tool-search` (the `tool_search` tool, and the list of tools that wait to be searched for: `browser`, `background`, `schedule`, `watch_pr`, `ask_someone`, and the design tools; it marks them deferred with `wrapTool`, and shows their prompt sections only once one of their tools is loaded, with `wrapSection` (the design guide's section with any of the three design tools); on a model whose provider takes tool changes in the messages it loads a tool into the list, and on any other it gives the tool's description in the search result and Pi calls it from a codemode script, so the list, and the prompt cache that starts with it, never change; turn it off and they are offered every time).
|
|
204
|
+
Each default-exports `(host: PocketHost, web: ExtensionWeb) => Extension | Extension[] | void` (`web` adds to the app: [extensions/app.md](extensions/app.md)) and is installed in this order: `prompt` (system prompt, with where Pi Pocket's docs are), `artifacts` (the `artifact` tool, with `inline: true` for a card in the reply: one store, `publish`, and bundles: `assets`, `removeAssets`, `group`, `kind`; `legacyInline` shows old `artifact_inline` calls to the model as `artifact` calls; `withoutInline` is PiP's), `browser` (browser tool and its prompt section; through `host.browsers`), `diagrams` (Diagrams, on by default: no tools or routes, only the browser client `diagrams` in `diagrams/`: `index.js` renders Mermaid with Pele and math with KaTeX, `style.css` and `math.css` style them; it is the one built-in client that session invitations may load, `isTrustedDiagramsClient` in `extension-web.ts`), `subagents` (subagent tool and its tasks: anchors, reporters, and the courier that sends waiting reports to the parent together; a subagent runs on its session's model, or one the owner allowed, and the app rebuilds the module when that list changes; it waits for tool search, and provides its guide through `web.provide` for the codemode route), `agent-teams` (Agent Teams, off by default: the `team` tool and its prompt section, through `host.linkedSessions`; its browser module `agent-teams.js` describes the tool's calls with `pocket.toolCall`; it imports of Pi Pocket's only types and `model-facts.ts`, a pure helper that formats model facts), `schedules` (schedule tool and its four limits, as settings; installs the schedule task), `background` (the background tool and its one setting, through `host.background`; installs the watch task), `goals` (hook after each answer), `plan` (tool hook and prompt section), `anthropic-subscription` (Claude subscription billing), `guard` (tool hook that asks for approval), `codemode` (codemode tool; a script's calls go through the same hooks; its Mode setting Only hides the other tools with a `wraps` getter over `host.toolNames()`, read at each resolve, and lists them in its prompt section; `tool-search` asks it through `web.provide`, and still lists, finds, and loads the hidden tools that wait; `plan`, `browser`, and `agent-teams` look in `agent.callable` too), `memory` (memory tool and the prompt section of lessons in force; through `host.memory`), `pip` (PiP's tools, prompt, and follow task, through `host.pip`; only PiP's conversation selects it, as `PocketApp`'s settings leave it out of every other conversation's), `triggers` (the PR and repository watch tasks and the `watch_pr` tool, through `host.watches` and `host.repoWatches`; webhooks need it on), `gallery` (the extension gallery's owner-only routes under `/api/x/gallery/`, through `host.gallery`, and its twice-daily look for revoked versions; it installs `pocket-gallery`, which tells the web app it is on), `session-tags` (Session tags, off by default: its `x.session-tags.tags` document, routes that check ids with `request.sessions()`, and its browser folder `session-tags/`, which uses the session list's extension points; it imports nothing of Pi Pocket's but types, as a drop-in would), `ask` (Ask: Pi's `ask` tool and its prompt section, questions with answers to pick on a card through `host.ask`; subagents do not get it, and plan mode lets it run), `ask-someone` (Ask someone, off by default: the `ask_someone` tool, which saves a draft question in its `x.ask-someone.questions` document; routes to edit, share, and end them; a public page (`web.publicPage`) for one answer through each link; and its browser folder `ask-someone/`; it imports nothing of Pi Pocket's but types), `updates` (Updates of Pi Pocket itself: owner-only routes under `/api/x/updates/`, through `host.updates`, its three settings (look, install by itself, beta updates), the look every 6 hours and the install by itself, and its browser folder `updates/`, the menu row, launcher action, and sheet, which says in words how the copy was installed and shows the hints that the server gives for a local or npx install), `design` (Design mode's workspace: its routes under `/api/x/design/` for comments, tweaks, "go back to this one", and the designs list, the `pocket.design-comments` document, the `/design-open` command, and the agent side from `../design/index.ts` (tools, prompt guide, export route); its browser folder `design/` is the canvas: only `index.js` (the store, the rail button, the launcher actions, the command, and a loading state), `paths.js`, and `state.js` (the workspace's one store) load at app start; `app.js` (the workspace, with `style.css`) loads when the panel first opens, and `docks.js`, `views.js`, and the System view (`system-ui.js`, with `system.css`) when first used; `unsaved.js` carries the System view's unsaved count and save; `workspace.js` is the picker, toolbar, and modes, `canvas.js` the frame and its bridge, `docks.js` the versions, comments, text edits, and tweaks, `system-view.js`, `system-sections.js`, `system-widgets.js`, `system-actions.js`, `system-data.js`, and `system-preview.js` the System view, `check.js` the Check tab, `picker.js` the design picker, `views.js` compare, the variations grid, the slide strip, and present mode, `data.js` what it asks of the server, `parts.js` small pieces, `style.css` the workspace's sheet, and `system.css` the System view's; `devices.js`, `tweaks.js`, `edits.js`, `messages.js`, `comments.js`, `system.js`, `color.js`, and `specimen.js` are pure helpers (`color.js`, with `color.d.ts`, is also the server's color math, through `../design/color.ts`); `system-routes.ts` and `system-api.ts` are the System view's routes (`system`, `system/check`, `system/docs`, `system/export`) and the engines they call; it imports the app's own `/store.js` and `/artifact-bridge.js`), and `tool-search` (the `tool_search` tool, and the list of tools that wait to be searched for: `browser`, `subagent`, `background`, `schedule`, `watch_pr`, `ask_someone`, and the design tools; it marks them deferred with `wrapTool`, and shows their prompt sections only once one of their tools is loaded, with `wrapSection` (the design guide's section with any of the three design tools); on a model whose provider takes tool changes in the messages it loads a tool into the list, and on any other it gives the tool's description in the search result and Pi calls it from a codemode script, so the list, and the prompt cache that starts with it, never change; turn it off and they are offered every time).
|
|
203
205
|
|
|
204
206
|
## Web: `web/` (Preact and htm, no build)
|
|
205
207
|
|
|
@@ -266,7 +268,7 @@ Plain ES modules, loaded as they are. `math.js` finds Markdown math delimiters;
|
|
|
266
268
|
|
|
267
269
|
`web/model-favorites.js` keeps per-person model favorites in this browser's local storage. The Providers sheet supplies star controls; it and the session/default-model picker share the Favorites filter. Stars do not change subagent permissions.
|
|
268
270
|
|
|
269
|
-
Manual refresh lives in `src/server/model-refresh.ts`, owned by `Providers.modelRefresh`; `web/model-refresh.js` shares the refresh and its feedback between the menu, Providers, and the launcher. `test/model-refresh.test.ts` checks local configuration, external sign-ins, provider isolation, cancellation, session use, and endpoint access.
|
|
271
|
+
Manual refresh lives in `src/server/model-refresh.ts`, owned by `Providers.modelRefresh`; `web/model-refresh.js` shares the refresh and its feedback between the menu, Providers, and the launcher. `test/model-refresh.test.ts` checks local configuration, external sign-ins, provider isolation, cancellation, session use, and endpoint access. `test/custom-providers.test.ts` checks OpenAI-compatible endpoints: the new file and folder, the key in `auth.json`, edits that keep hand-made fields, and files left alone.
|
|
270
272
|
|
|
271
273
|
The Extensions hub in `sheets/gallery.js` shares one listing between Discover, Installed, Updates, and the selected entry. `sheets.js` maps its sheet routes to one retained hub; `sheets/extensions.js` supplies the built-in and local drop-in management controls for Installed, and the standalone sheet when the gallery is unavailable.
|
|
272
274
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-pocket",
|
|
3
|
-
"version": "0.28.0-beta.
|
|
3
|
+
"version": "0.28.0-beta.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-pocket",
|
|
9
|
-
"version": "0.28.0-beta.
|
|
9
|
+
"version": "0.28.0-beta.6",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@earendil-works/chord": "1.4.0",
|