pi-pocket 0.27.0-beta.7 → 0.27.0-beta.9
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/docs/examples/design-system/README.md +1 -1
- package/docs/examples/design-system/pocket/.pi/design/guidelines.md +1 -1
- package/docs/extensions/reference/names.md +2 -2
- package/docs/extensions/tools.md +1 -0
- package/docs/features.md +5 -4
- package/docs/map.md +25 -30
- package/package.json +1 -2
- package/src/server/design/color.ts +25 -543
- package/src/server/design/docsite-color-section.ts +99 -197
- package/src/server/design/docsite-components.ts +40 -45
- package/src/server/design/docsite-core.ts +171 -302
- package/src/server/design/docsite-css.ts +267 -0
- package/src/server/design/docsite-js.ts +215 -0
- package/src/server/design/docsite-markdown.ts +0 -14
- package/src/server/design/docsite-reference.ts +74 -212
- package/src/server/design/docsite-space.ts +75 -231
- package/src/server/design/docsite-type.ts +146 -114
- package/src/server/design/docsite.ts +208 -339
- package/src/server/design/fix.ts +63 -15
- package/src/server/design/guide.ts +10 -104
- package/src/server/design/index.ts +3 -12
- package/src/server/design/lint-analyze-system.ts +22 -8
- package/src/server/design/lint-color.ts +26 -3
- package/src/server/design/scan-categorize.ts +41 -56
- package/src/server/design/scan-colors.ts +608 -15
- package/src/server/design/scan-facts-files.ts +71 -198
- package/src/server/design/scan-facts-use.ts +131 -323
- package/src/server/design/scan-facts.ts +90 -94
- package/src/server/design/scan-files.ts +62 -196
- package/src/server/design/scan-import-convert.ts +29 -60
- package/src/server/design/scan-import-eval.ts +85 -352
- package/src/server/design/scan-import.ts +414 -139
- package/src/server/design/scan-infer.ts +73 -57
- package/src/server/design/scan-palette.ts +52 -135
- package/src/server/design/scan-parse.ts +140 -561
- package/src/server/design/scan-prepare.ts +142 -151
- package/src/server/design/scan-render-pages.ts +76 -89
- package/src/server/design/scan-render-probe.ts +7 -17
- package/src/server/design/scan-render.ts +101 -146
- package/src/server/design/scan-roles.ts +492 -162
- package/src/server/design/scan-scales.ts +223 -479
- package/src/server/design/scan-tailwind.ts +93 -0
- package/src/server/design/scan-tree.ts +29 -99
- package/src/server/design/scan-variables.ts +198 -182
- package/src/server/design/scan.ts +150 -291
- package/src/server/design/system.ts +34 -104
- package/src/server/design/tokens-model-defs.ts +7 -1
- package/src/server/extensions/agent-teams.ts +1 -1
- package/src/server/extensions/artifacts.ts +36 -65
- package/src/server/extensions/browser.ts +8 -13
- package/src/server/extensions/codemode.ts +3 -2
- package/src/server/extensions/design/canvas.js +1 -1
- package/src/server/extensions/design/check.js +25 -31
- package/src/server/extensions/design/color.d.ts +29 -0
- package/src/server/extensions/design/color.js +398 -252
- package/src/server/extensions/design/parts.js +3 -3
- package/src/server/extensions/design/style.css +16 -79
- package/src/server/extensions/design/system-api.ts +11 -18
- package/src/server/extensions/design/system-routes.ts +337 -433
- package/src/server/extensions/design/system-sections.js +361 -482
- package/src/server/extensions/design/system-view.js +151 -246
- package/src/server/extensions/design/system-widgets.js +245 -307
- package/src/server/extensions/design/system.css +121 -304
- package/src/server/extensions/design/system.js +17 -32
- package/src/server/extensions/design/workspace.js +1 -1
- package/src/server/extensions/memory.ts +14 -19
- package/src/server/extensions/plan.ts +1 -0
- package/src/server/extensions/prompt.ts +54 -15
- package/src/server/extensions/schedules.ts +2 -2
- package/src/server/extensions/subagents.ts +19 -23
- package/src/server/extensions/tool-search.ts +196 -0
- package/src/server/guides/artifact-bridge.md +7 -0
- package/src/server/guides/design.md +124 -0
- package/src/server/reload.ts +3 -0
- package/docs/design/design-system.md +0 -165
- package/docs/examples/design-system/pocket/.pi/design/dist/components.css +0 -730
- package/docs/examples/design-system/pocket/.pi/design/dist/names.md +0 -495
- package/docs/examples/design-system/pocket/.pi/design/dist/tailwind.css +0 -1132
- package/docs/examples/design-system/pocket/.pi/design/dist/tokens.css +0 -1126
- package/docs/examples/design-system/pocket/.pi/design/dist/tokens.dark.resolved.json +0 -2022
- package/docs/examples/design-system/pocket/.pi/design/dist/tokens.high-contrast.resolved.json +0 -2022
- package/docs/examples/design-system/pocket/.pi/design/dist/tokens.light.resolved.json +0 -2022
- package/docs/examples/design-system/pocket/.pi/design/dist/tokens.resolved.json +0 -371
- package/docs/examples/design-system/pocket/.pi/design/dist/tokens.studio.json +0 -5915
- package/src/server/design/check-cli.ts +0 -266
- package/src/server/design/docsite-assets.ts +0 -21
- package/src/server/design/docsite-color.ts +0 -267
- package/src/server/design/docsite-css-base.ts +0 -395
- package/src/server/design/docsite-css-content.ts +0 -474
- package/src/server/design/docsite-css-phone.ts +0 -246
- package/src/server/design/docsite-css-reference.ts +0 -363
- package/src/server/design/docsite-css-specimens.ts +0 -463
- package/src/server/design/docsite-js-code.ts +0 -90
- package/src/server/design/docsite-js-core.ts +0 -69
- package/src/server/design/docsite-js-demos.ts +0 -22
- package/src/server/design/docsite-js-links.ts +0 -22
- package/src/server/design/docsite-js-nav.ts +0 -68
- package/src/server/design/docsite-js-stages.ts +0 -78
- package/src/server/design/docsite-js-table.ts +0 -78
- package/src/server/design/docsite-motion.ts +0 -110
- package/src/server/design/docsite-shadows.ts +0 -38
- package/src/server/design/scan-braces.ts +0 -109
- package/src/server/design/scan-channels.ts +0 -102
- package/src/server/design/scan-color-base.ts +0 -191
- package/src/server/design/scan-color-names.ts +0 -397
- package/src/server/design/scan-color-palette.ts +0 -85
- package/src/server/design/scan-color-roles.ts +0 -552
- package/src/server/design/scan-facts-antd.ts +0 -157
- package/src/server/design/scan-facts-lists.ts +0 -502
- package/src/server/design/scan-facts-sass.ts +0 -105
- package/src/server/design/scan-facts-theme.ts +0 -377
- package/src/server/design/scan-facts-wordpress.ts +0 -359
- package/src/server/design/scan-import-material.ts +0 -691
- package/src/server/design/scan-import-sd-config.ts +0 -338
- package/src/server/design/scan-import-sd.ts +0 -408
- package/src/server/design/scan-import-studio.ts +0 -220
- package/src/server/design/scan-js-eval.ts +0 -1235
- package/src/server/design/scan-review.ts +0 -47
- package/src/server/design/scan-sass-colors.ts +0 -264
- package/src/server/design/scan-sass-eval.ts +0 -228
- package/src/server/design/scan-sass-expr.ts +0 -878
- package/src/server/design/scan-sass-modules.ts +0 -313
- package/src/server/design/scan-sass-run.ts +0 -969
- package/src/server/design/scan-sass-stmt.ts +0 -242
- package/src/server/design/scan-sass-values.ts +0 -853
- package/src/server/design/scan-theme-shapes.ts +0 -559
- package/src/server/design/scan-util.ts +0 -37
- package/src/server/design/system-schema.ts +0 -51
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Example design system: Pi Pocket
|
|
2
2
|
|
|
3
|
-
`pocket/.pi/design/` is Pi Pocket's own design system, written the way Design mode expects it (see [
|
|
3
|
+
`pocket/.pi/design/` is Pi Pocket's own design system, written the way Design mode expects it (see the design system in [features.md](../../features.md)). It is the reference for the file format and a ready system to try.
|
|
4
4
|
|
|
5
5
|
| File | What it holds |
|
|
6
6
|
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -64,7 +64,7 @@ Pi Pocket looks like a tiling window manager that learned to be gentle: soft til
|
|
|
64
64
|
## Using the system
|
|
65
65
|
|
|
66
66
|
- Link `ds/tokens.css` and use `var(--…)` for every color, size, space, radius, shadow, and duration.
|
|
67
|
-
- Reuse a component from `components/` before you write a new one. Copy its markup and its classes.
|
|
67
|
+
- Reuse a component from `components/` before you write a new one. Copy its markup and its classes. Link `ds/components.css` for the CSS of every component.
|
|
68
68
|
- For dark mode, set `data-theme="dark"` on the root. The system also follows `prefers-color-scheme`.
|
|
69
69
|
- A design that needs a value the system does not have asks for a new token. It does not invent one in place.
|
|
70
70
|
|
|
@@ -7,7 +7,7 @@ The rules for the names that a module gives. These are the names of its file, ex
|
|
|
7
7
|
To install an extension with the name of an installed extension replaces that extension. A tool with the name of another tool replaces it in all sessions. Thus Pi Pocket refuses a drop-in that would take a name that Pi Pocket keeps, or a name that another module has. Menu → Extensions says why.
|
|
8
8
|
|
|
9
9
|
- **Extension names that Pi Pocket keeps:** `coding-tools`, and all names that start with `pocket-`, such as `pocket-core`, `pocket-prompt`, and `pocket-guard`. This is true also when that built-in module is off.
|
|
10
|
-
- **Built-in tools:** `read`, `write`, `edit`, `bash`, `artifact`, `artifact_inline`, `browser`, `subagent`, `team`, `schedule`, `codemode`, and `memory`. PiP's tools: `sessions`, `session_read`, `session_start`, `session_send`, `session_follow`, `session_stop`, `session_archive`, `session_schedule`, `approvals`, `repo_watch`, and `session_watch_pr`. The triggers' tool: `watch_pr`. Design's tools: `design_preview`, `design_export`, and `design_system`.
|
|
10
|
+
- **Built-in tools:** `read`, `write`, `edit`, `bash`, `artifact`, `artifact_inline`, `browser`, `subagent`, `team`, `schedule`, `codemode`, `tool_search`, and `memory`. PiP's tools: `sessions`, `session_read`, `session_start`, `session_send`, `session_follow`, `session_stop`, `session_archive`, `session_schedule`, `approvals`, `repo_watch`, and `session_watch_pr`. The triggers' tool: `watch_pr`. Design's tools: `design_preview`, `design_export`, and `design_system`.
|
|
11
11
|
- **Names that another module has:** the first module to install an extension or tool keeps its name.
|
|
12
12
|
|
|
13
13
|
Give each extension and tool a name of your own, with a prefix: `example-clock`, `acme_lookup`. To change how a built-in tool works, do not replace it. Wrap it (`wrapTool` in Pi Durable's README), or check its calls with a hook.
|
|
@@ -16,7 +16,7 @@ Give each extension and tool a name of your own, with a prefix: `example-clock`,
|
|
|
16
16
|
|
|
17
17
|
- A module is a `.ts` file in the drop-in folder.
|
|
18
18
|
- Files that start with `_`, or that end in `.test.ts`, are not modules. Use them for helpers and tests.
|
|
19
|
-
- A drop-in with the name of a built-in module does not load. The built-in modules are `prompt`, `artifacts`, `browser`, `subagents`, `agent-teams`, `schedules`, `goals`, `plan`, `guard`, `codemode`, `memory`, `pip`, `triggers`, `gallery`, and `
|
|
19
|
+
- A drop-in with the name of a built-in module does not load. The built-in modules are `prompt`, `artifacts`, `browser`, `subagents`, `agent-teams`, `schedules`, `goals`, `plan`, `guard`, `codemode`, `memory`, `pip`, `triggers`, `gallery`, `design`, and `tool-search`.
|
|
20
20
|
- `_pocket.d.ts` in the drop-in folder is Pi Pocket's link to its types. Do not use this name. See [Types for your editor](types.md).
|
|
21
21
|
|
|
22
22
|
What a module adds to the app uses the name of its file without `.ts`: `server-status.ts` is `server-status`, at `/api/x/server-status/` and `/x/server-status/`. File names are unique across the two folders of modules, so these addresses never collide. A module that adds to the app needs a name of letters, digits, `-`, and `_` that starts with a letter or digit.
|
package/docs/extensions/tools.md
CHANGED
|
@@ -27,6 +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 16,000 characters in a plain session.
|
|
30
31
|
- `parameters` is a TypeBox schema (`Type` from `@earendil-works/pi-ai`). Pi Durable checks the arguments against it before `execute` runs.
|
|
31
32
|
- `execute(args, api, context)` does the work.
|
|
32
33
|
|
package/docs/features.md
CHANGED
|
@@ -20,6 +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 16,000 characters (about 4,000 tokens) or less.
|
|
23
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.
|
|
24
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.
|
|
25
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.
|
|
@@ -69,11 +70,11 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
69
70
|
- **Tweaks.** A page can declare knobs (colors, sizes, choices, switches) and the Tweaks tab shows them as controls that change the page live. Values are each person's own, kept for each design. **Keep these** puts them in the message box so that Pi writes them into the design.
|
|
70
71
|
- **Variations.** Artifacts of one group show as a grid of live thumbnails. **Use this one** puts a message about it in the message box.
|
|
71
72
|
- **Export and share.** PNG, PDF, PPTX (decks), and an HTML zip, from the menu. The file is written in the session's `exports/` folder and the browser downloads it. **Share a link** is the artifact viewer's Share. There is no Canva export.
|
|
72
|
-
- **What Pi does.** Its guide (a prompt section, only while the module is on) gives Pi an order of work, after Claude Design's (since 0.27.0): one round of questions when the work is new or unclear, then a start from what exists (the design system, the code, the screens) rather than a mock from scratch, a first version early, iterations, a check, and a short reply. A screen that exists is redesigned from itself: Pi reads its code and data first, makes version 1 the screen as it is today (in its place in the app, compared with a screenshot of the real one when it can get one), and then changes it in new versions, within what the code supports; a change that needs new data or server work is marked in the design and named in the reply, and a different direction becomes a new artifact in the same group. The product's own type sizes, spacing, and density win over the guide's craft defaults. It also gives Pi a page skeleton and craft rules: one HTML artifact for each design, `data-pid` on meaningful elements, a tweaks manifest of 3 to 8 knobs bound to the system's tokens, assets for images and fonts, variations as a group of 2 to 4 artifacts, a link to `ds/tokens.css` when the project has a design system, and a check with `design_preview` before it replies. When the project has a system, the
|
|
73
|
-
- **The design system.** A project's design system lives in `.pi/design/` in the session's folder: `tokens.json` (W3C Design Tokens, DTCG: groups, `$value`, `$type`, references such as `{color.blue.500}`, tiers for primitives, semantic roles, and component tokens), `tokens.<mode>.json` for each other mode (dark, high contrast, a brand), `components/<slug>.html` (a component specimen with its states), and `guidelines.md`. Pi Pocket checks it (broken or circular references, raw values in semantic roles, declared contrast pairs in every mode) and builds `dist/`: `tokens.css` (`:root`, a `[data-theme]` block for each mode, and a `prefers-color-scheme` block), `tailwind.css` (a Tailwind v4 `@theme`, with utilities such as `bg-surface` and `text-primary`), `tokens.<mode>.resolved.json` (DTCG, one for each mode), `tokens.studio.json` (Tokens Studio), `tokens.resolved.json` (a compact summary), and `components.css`. A design that links `ds/tokens.css`, `ds/tailwind.css`, or `ds/components.css` gets the current files as assets when Pi publishes it, a snapshot kept with that version. Pi's `design_system` tool has the actions `scan` (a structured draft from the project's style files: colors in every CSS syntax, roles, the type, spacing, and radius scales, shadows,
|
|
73
|
+
- **What Pi does.** Its guide, `src/server/guides/design.md`, which Pi reads before it makes or changes a design (a short prompt section, only while the module is on, points to it), gives Pi an order of work, after Claude Design's (since 0.27.0): one round of questions when the work is new or unclear, then a start from what exists (the design system, the code, the screens) rather than a mock from scratch, a first version early, iterations, a check, and a short reply. A screen that exists is redesigned from itself: Pi reads its code and data first, makes version 1 the screen as it is today (in its place in the app, compared with a screenshot of the real one when it can get one), and then changes it in new versions, within what the code supports; a change that needs new data or server work is marked in the design and named in the reply, and a different direction becomes a new artifact in the same group. The product's own type sizes, spacing, and density win over the guide's craft defaults. It also gives Pi a page skeleton and craft rules: one HTML artifact for each design, `data-pid` on meaningful elements, a tweaks manifest of 3 to 8 knobs bound to the system's tokens, assets for images and fonts, variations as a group of 2 to 4 artifacts, a link to `ds/tokens.css` when the project has a design system, and a check with `design_preview` before it replies. When the project has a system, the prompt section carries a summary of it (roles and components first) as untrusted project data. Its tools: `design_preview` renders a version in a private headless Chromium (never the browser people watch) at mobile and desktop sizes, or the sizes asked for, and returns screenshots and a short report (see **Checks**); its options are `checks` (on by default), `tweaks`, `colorScheme`, `page` (another page of the bundle), and `actions` (hover, click, or focus on a selector before the screenshot). `design_export` writes PNG, PDF, PPTX, or an HTML zip, by default as `exports/<id>-v<version>.<ext>`, and refuses a path outside the session's folder; it also takes `tweaks`, a custom `viewport`, and, for a deck's PNG, `slide` (a number, or `"all"` for a zip of every slide). A page's PDF is as wide as its viewport, and PPTX slide images have twice the pixels. `design_system` reads, scans, and changes the project's design system (see **The design system**). The private renderer serves the bundle on a loopback address under a random path and gives Chromium no sign-in; other requests go through `host.fetchPublic`, so a design reaches only public addresses. Renders run 2 at once, and more wait their turn; each has 90 seconds.
|
|
74
|
+
- **The design system.** A project's design system lives in `.pi/design/` in the session's folder: `tokens.json` (W3C Design Tokens, DTCG: groups, `$value`, `$type`, references such as `{color.blue.500}`, tiers for primitives, semantic roles, and component tokens), `tokens.<mode>.json` for each other mode (dark, high contrast, a brand), `components/<slug>.html` (a component specimen with its states), and `guidelines.md`. Pi Pocket checks it (broken or circular references, raw values in semantic roles, declared contrast pairs in every mode) and builds `dist/`: `tokens.css` (`:root`, a `[data-theme]` block for each mode, and a `prefers-color-scheme` block), `tailwind.css` (a Tailwind v4 `@theme`, with utilities such as `bg-surface` and `text-primary`), `tokens.<mode>.resolved.json` (DTCG, one for each mode), `tokens.studio.json` (Tokens Studio), `tokens.resolved.json` (a compact summary), and `components.css`. A design that links `ds/tokens.css`, `ds/tailwind.css`, or `ds/components.css` gets the current files as assets when Pi publishes it, a snapshot kept with that version. Pi's `design_system` tool has the actions `scan` (a structured draft from the project's style files: colors in every CSS syntax, roles, the type, spacing, and radius scales, shadows, breakpoints, and dark mode, from CSS custom properties and rules in CSS, SCSS, Less, and page style blocks, Sass and Less variables with literal values, Tailwind's `@theme` and a `tailwind.config` theme read as a literal, and DTCG, Style Dictionary, and Tokens Studio JSON files; a browser renders the project's pages to fill in what the files leave out), `init` (from a scan or given tokens; it refuses to replace a system unless asked), `set`, `validate`, `compile`, `component`, `guidelines`, and the 0.26 `read` and `write`. A project with only `.pi/design-system.md` (the 0.26 format) keeps working.
|
|
74
75
|
- **The System view.** The first row of the design picker (or `/design-open system`, or the launcher's "Open the design system") shows the system: **Colors** (role cards with contrast badges first, a live sample card, and the palette as ramp strips in a folded group), **Type**, **Spacing**, **Radii**, **Shadows** (each with its value), **Motion** (durations and easings that play), **Components** (every state, in a frame that runs nothing and loads nothing), and **Guidelines**. A section's count is its role tokens; the palette and component tokens show their own counts inside it. Modes show one at a time or side by side, and a mode's value says whether it is its own or inherited from the default. People who steer change a color, a size, a time, a weight, a font, an easing, or a shadow's layers in place, or link a token to another; the open design shows each change live when it uses the system's variables. The editor lists every contrast pair of a color (an exempt pair shows as exempt, not as a failure). **Undo** and **Redo** step through the changes, **Discard** gives them up, and **Save** writes the files and the generated CSS with no run of Pi (it refuses a change that the checks refuse, or one made on a system that changed meanwhile). The menu publishes the documentation page as a design, exports the generated files as a zip, and adds or removes a mode. People who only view see everything and change nothing. **Focus mode** hides the conversation for wide work. On a phone, the canvas fits the screen's width, and until a size is chosen it takes the size of its panel. The Design module loads only a small shell at app start; the workspace and the System view load when first opened.
|
|
75
|
-
- **Checks.** A design's **Check** tab
|
|
76
|
-
- **The documentation page.** The System view's menu (and `design_system`) makes a documentation page of the system as a design: navigation, a filter of names and values, and links to every section; color roles with their values, contrast, and copy buttons for the CSS variable
|
|
76
|
+
- **Checks.** A design's **Check** tab and `design_preview` render the page on the server and judge only what the author's CSS sets, never the browser's defaults. They report values that are not the system's (colors, fonts, and sizes, each with the exact CSS edit and the nearest token of the matching role), contrast (WCAG 2.2 AA, judged only where the background is certain), non-text contrast of focus rings and icon buttons (3:1), tap targets (an error under 24 px, a warning under 44 px), sideways overflow, image alt text, heading order, a missing `lang`, form controls with no label (a placeholder is not a label), links, buttons, and widgets with no accessible name, no `main` landmark, fonts that did not load, a missing viewport tag, missing `data-pid`s, elements with no visible focus style, long motion with no `prefers-reduced-motion` rule, and author-set input text under 16 px on a phone. A check runs in any mode of the system. The tab follows the mode and size on the canvas, puts a pin on each element, and **Send to Pi** puts one message with every finding in the message box. **Fix N exact matches** rewrites literals that equal a token exactly to `var(--token)` and saves a new version with no run of Pi. On a phone, the tab starts as a bar with the counts, so the page keeps most of the screen.
|
|
77
|
+
- **The documentation page.** The System view's menu (and `design_system`) makes a documentation page of the system as a design: navigation, a filter of names and values, and links to every section; color roles with their values, contrast, and copy buttons for the CSS variable and the Tailwind class; the contrast pairs in every mode (exempt pairs labelled); palettes, type specimens, spacing, radii, shadows, and motion demos; component state grids with their code; guidelines; every token with a column for each mode; and a list of the generated files with how to use them. Component states are drawn in shadow roots after an allowlist sanitizer, under a nonce-only script policy, so they paint in screenshots and PDFs and run nothing. It runs in the artifact sandbox with no network, so it can be shared with a link or exported like any design.
|
|
77
78
|
- **Decks.** A deck is a page with `<meta name="pocket-kind" content="deck">` and its slides as `<section class="slide">`, written at 1920×1080 (`<meta name="pocket-slide-size" content="1280x720">` changes that). The canvas shows one slide at a time, scaled to fit, with a slide strip, a full-screen present mode, arrow keys, and swipes, and the page needs no navigation script of its own. PNG, PDF, and PPTX exports use the same slide size. PPTX slides are images with the slide's text as speaker notes, not editable shapes. A deck opened in its own tab or published shows one slide at a time too, and printing it gives one page for each slide.
|
|
78
79
|
- **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.
|
|
79
80
|
- **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.
|
package/docs/map.md
CHANGED
|
@@ -140,41 +140,36 @@ A module split into parts keeps its name for the part others import, with the re
|
|
|
140
140
|
|
|
141
141
|
The agent's side of Design mode. `extensions/design.ts` installs it (see Extensions below).
|
|
142
142
|
|
|
143
|
-
| File | Owns
|
|
144
|
-
| ----------------------------- |
|
|
145
|
-
| `design/index.ts` | `designTools(host)` (`design_preview`, `design_export`, `design_system`), `designGuide(host)` (the prompt section), and `designRoutes(web, host)` (`POST /api/x/design/c/:conversation/export`, steer access)
|
|
146
|
-
| `design/bundle.ts` | `readBundle`: a version's page and assets from the artifact documents, by hash, in a tool call or a route (no `PocketApp` reader)
|
|
147
|
-
| `design/render.ts` | Private headless Chromium renders: a process and profile for each render, a loopback endpoint under a random path that serves one bundle, public fetches only, limits (2 at once, 90 s); deck slide size and slides
|
|
148
|
-
| `design/export.ts` | `saveDesignExport` (shared by the tool and the route): PNG, PDF, PPTX, and the HTML zip, written to `exports/` by default
|
|
149
|
-
| `design/files.ts` | Where an export may be written: inside the session folder, never through a link, replaced atomically
|
|
150
|
-
| `design/pptx.ts` | The PPTX writer: one image for each slide, at the deck's slide size (16:9 by default), with the slide's text as speaker notes, through `zip.ts`
|
|
151
|
-
| `design/system-types.ts` | The shared shapes: `DesignSystem`, `ResolvedToken`, `ComponentSpec`, `SystemChange`, `CheckReport`, `CheckFinding`
|
|
152
|
-
| `design/tokens.ts` | The tokens engine: `loadDesignSystem`, `writeDesignSystem` (validate, atomic writes, rebuild `dist/`), `compileDesignSystem`, `systemSummary`; `tokens-model.ts` (`buildSystem`: the phases in order) with `tokens-model-defs.ts` (definitions and modes), `tokens-model-resolve.ts` (types and references), `tokens-model-checks.ts` (the warnings and contrast), and `tokens-model-report.ts` (the problem list), `tokens-values.ts` (value forms), `tokens-ramps.ts` (the ramp-order warning), `tokens-compile.ts` (`tokens.css`, `components.css`), `tokens-tailwind.ts` (the Tailwind v4 theme), `tokens-names.ts` (the names table, `names.md`), `tokens-dtcg.ts` (the DTCG files for each mode, the 2025.10 forms, and `tokens.studio.json`), `tokens-io.ts` (bounded reads without links), `tokens-summary.ts` (the prompt summary: roles and components first), `tokens-base.ts`
|
|
153
|
-
| `design/components.ts` | Component specimens: `components/<slug>.html` with its metadata, CSS, and one template for each state
|
|
154
|
-
| `design/color.ts` | Color math: every CSS color syntax, OKLab and OKLCH, WCAG luminance and contrast, hex
|
|
155
|
-
| `design/system.ts` | `design_system`: the actions on `.pi/design/` and the 0.26 `.pi/design-system.md`, bounded, read and written without following links, output fenced as project data
|
|
156
|
-
| `design/scan.ts` | `design_system` scan: a bounded walk that follows no link, and the structured draft
|
|
157
|
-
| `design/scan-worker.ts` | The static scan in a worker thread, which `scanProject` starts: the server goes on meanwhile, and a scan past 20 s or a 256 MB heap is stopped
|
|
158
|
-
| `design/scan-render.ts` | The rendered scan: a project's HTML pages shown offline in the private Chromium, once as they are and once in dark mode, and read as the browser computed them; the static scan wins where it is sure, the rendered values fill the rest
|
|
159
|
-
| `design/scan-render-pages.ts` | The pages the rendered scan shows: the project's HTML (and its built output), the files they need, and the custom property names and dark-mode switches the stylesheets name; a bounded walk that follows no link
|
|
160
|
-
| `design/scan-render-probe.ts` | The script that reads a rendered page in an isolated world: only values the author's styles set (it reads the page again with all styles off), as bounded plain data
|
|
161
|
-
| `design/
|
|
162
|
-
| `design/
|
|
163
|
-
| `design/
|
|
164
|
-
| `design/
|
|
165
|
-
| `design/
|
|
166
|
-
| `design/lint.ts` | `checkDesign` and `checkPage`: the page checks of `design_preview`, the Check tab, and the CLI; `lint-page.ts` and `lint-page-*.ts` (the script the page runs, in an isolated world: setup, the author's CSS index, values, elements, states, focus, and page checks), `lint-color.ts` (token sets and OKLab distance); `analyze` calls its phases in `lint-analyze-system.ts` (color, font, size), `lint-analyze-contrast.ts`, `lint-analyze-page.ts`, and `lint-analyze-util.ts` |
|
|
167
|
-
| `design/lint-suggest.ts` | Which token a check suggests for a color: what a token is for, how the page uses the color, and the order of preference |
|
|
168
|
-
| `design/fix.ts` | `applyExactFixes`: one-tap fixes; a literal that equals a token exactly becomes `var(--token)`, only in `<style>` and `style=""`, only where the place is certain |
|
|
169
|
-
| `design/check-cli.ts` | The check for CI (`npm run design:check`): `checkDesign` on an HTML file and a `.pi/design` folder; exit 0 when clean, 1 on an error, 2 on bad arguments or no Chromium |
|
|
170
|
-
| `design/docsite.ts` | `renderSystemDoc`: the documentation page of a system; `docsite-core.ts` (the context, counts, and the nonce CSP), one file for each section (`docsite-color-section.ts`, `docsite-type.ts`, `docsite-space.ts`, `docsite-shadows.ts`, `docsite-motion.ts`, `docsite-components.ts`, `docsite-reference.ts`), `docsite-sanitize.ts` (the allowlist sanitizer and CSS parser for component specimens, drawn in shadow roots), `docsite-css-*.ts` and `docsite-js-*.ts` (the page's style and script, joined in `docsite-assets.ts`), `docsite-color.ts`, `docsite-markdown.ts` |
|
|
171
|
-
| `design/guide.ts` | The prompt section: a page skeleton, craft rules, and the design system's summary as fenced, untrusted data |
|
|
143
|
+
| File | Owns |
|
|
144
|
+
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
145
|
+
| `design/index.ts` | `designTools(host)` (`design_preview`, `design_export`, `design_system`), `designGuide(host)` (the prompt section), and `designRoutes(web, host)` (`POST /api/x/design/c/:conversation/export`, steer access) |
|
|
146
|
+
| `design/bundle.ts` | `readBundle`: a version's page and assets from the artifact documents, by hash, in a tool call or a route (no `PocketApp` reader) |
|
|
147
|
+
| `design/render.ts` | Private headless Chromium renders: a process and profile for each render, a loopback endpoint under a random path that serves one bundle, public fetches only, limits (2 at once, 90 s); deck slide size and slides |
|
|
148
|
+
| `design/export.ts` | `saveDesignExport` (shared by the tool and the route): PNG, PDF, PPTX, and the HTML zip, written to `exports/` by default |
|
|
149
|
+
| `design/files.ts` | Where an export may be written: inside the session folder, never through a link, replaced atomically |
|
|
150
|
+
| `design/pptx.ts` | The PPTX writer: one image for each slide, at the deck's slide size (16:9 by default), with the slide's text as speaker notes, through `zip.ts` |
|
|
151
|
+
| `design/system-types.ts` | The shared shapes: `DesignSystem`, `ResolvedToken`, `ComponentSpec`, `SystemChange`, `CheckReport`, `CheckFinding` |
|
|
152
|
+
| `design/tokens.ts` | The tokens engine: `loadDesignSystem`, `writeDesignSystem` (validate, atomic writes, rebuild `dist/`), `compileDesignSystem`, `systemSummary`; `tokens-model.ts` (`buildSystem`: the phases in order) with `tokens-model-defs.ts` (definitions and modes), `tokens-model-resolve.ts` (types and references), `tokens-model-checks.ts` (the warnings and contrast), and `tokens-model-report.ts` (the problem list), `tokens-values.ts` (value forms), `tokens-ramps.ts` (the ramp-order warning), `tokens-compile.ts` (`tokens.css`, `components.css`), `tokens-tailwind.ts` (the Tailwind v4 theme), `tokens-names.ts` (the names table, `names.md`), `tokens-dtcg.ts` (the DTCG files for each mode, the 2025.10 forms, and `tokens.studio.json`), `tokens-io.ts` (bounded reads without links), `tokens-summary.ts` (the prompt summary: roles and components first), `tokens-base.ts` |
|
|
153
|
+
| `design/components.ts` | Component specimens: `components/<slug>.html` with its metadata, CSS, and one template for each state |
|
|
154
|
+
| `design/color.ts` | Color math: re-exports `extensions/design/color.js` (every CSS color syntax and DTCG color objects, OKLab and OKLCH, WCAG luminance and contrast, hex), the one copy that the server and the System view share, and adds `mixColors` |
|
|
155
|
+
| `design/system.ts` | `design_system`: the actions on `.pi/design/` and the 0.26 `.pi/design-system.md`, its parameters, bounded, read and written without following links, output fenced as project data |
|
|
156
|
+
| `design/scan.ts` | `design_system` scan: a bounded walk that follows no link, and the structured draft, from CSS custom properties and declarations (with dark scopes and channel colors), literal Sass and Less variables, Tailwind (`@theme`, the v3 config's `theme`), and token files (DTCG, Style Dictionary JSON, Tokens Studio); `scan-files.ts` (the walk), `scan-parse.ts`, `scan-facts*.ts` (the facts), `scan-import*.ts` (token files, one reading in `scan-import-eval.ts`), `scan-variables.ts`, `scan-prepare.ts`, `scan-infer.ts` (the phases), `scan-colors.ts`, `scan-roles.ts`, `scan-palette.ts`, `scan-scales.ts`, `scan-categorize.ts`, `scan-tree.ts`, `scan-tailwind.ts` (Tailwind's default palette and the v3 config reader) |
|
|
157
|
+
| `design/scan-worker.ts` | The static scan in a worker thread, which `scanProject` starts: the server goes on meanwhile, and a scan past 20 s or a 256 MB heap is stopped |
|
|
158
|
+
| `design/scan-render.ts` | The rendered scan: a project's HTML pages shown offline in the private Chromium, once as they are and once in dark mode, and read as the browser computed them; the static scan wins where it is sure, the rendered values fill the rest |
|
|
159
|
+
| `design/scan-render-pages.ts` | The pages the rendered scan shows: the project's HTML (and its built output), the files they need, and the custom property names and dark-mode switches the stylesheets name; a bounded walk that follows no link |
|
|
160
|
+
| `design/scan-render-probe.ts` | The script that reads a rendered page in an isolated world: only values the author's styles set (it reads the page again with all styles off), as bounded plain data |
|
|
161
|
+
| `design/lint.ts` | `checkDesign` and `checkPage`: the page checks of `design_preview`, the Check tab, and the CLI; `lint-page.ts` and `lint-page-*.ts` (the script the page runs, in an isolated world: setup, the author's CSS index, values, elements, states, focus, and page checks), `lint-color.ts` (token sets and OKLab distance); `analyze` calls its phases in `lint-analyze-system.ts` (color, font, size), `lint-analyze-contrast.ts`, `lint-analyze-page.ts`, and `lint-analyze-util.ts` |
|
|
162
|
+
| `design/lint-suggest.ts` | Which token a check suggests for a color: what a token is for, how the page uses the color, and the order of preference |
|
|
163
|
+
| `design/fix.ts` | `applyExactFixes`: one-tap fixes; a literal that equals a token exactly becomes `var(--token)`, only in `<style>` and `style=""`, only where the place is certain |
|
|
164
|
+
| `design/docsite.ts` | `renderSystemDoc`: the documentation page of a system; `docsite-core.ts` (the context, counts, and the nonce CSP), one file for each group of sections (`docsite-color-section.ts`, `docsite-type.ts`, `docsite-space.ts`, `docsite-components.ts`, `docsite-reference.ts`), `docsite-sanitize.ts` (the allowlist sanitizer and CSS parser for component specimens, drawn in shadow roots), `docsite-css.ts` and `docsite-js.ts` (the page's one sheet and one script), `docsite-markdown.ts` |
|
|
165
|
+
| `design/guide.ts` | The prompt section: a page skeleton, craft rules, and the design system's summary as fenced, untrusted data |
|
|
172
166
|
|
|
173
167
|
### Elsewhere
|
|
174
168
|
|
|
175
169
|
| File | Owns |
|
|
176
170
|
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
177
171
|
| `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 |
|
|
172
|
+
| `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 |
|
|
178
173
|
| `public-fetch.ts` | `host.fetchPublic`: fetch that reaches only public addresses, checked where each connection is made and at each redirect |
|
|
179
174
|
| `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 |
|
|
180
175
|
| `gallery/entry.ts` | The index's format, read strictly: entries, file names in the drop-in folder's rules, limits, compatibility, addresses. The index repository's checks import it too |
|
|
@@ -192,7 +187,7 @@ Outside `src/`: `flake.nix` and `nix/` build Pi Pocket with Nix (`nix/package.ni
|
|
|
192
187
|
|
|
193
188
|
## Extensions: `src/server/extensions/`
|
|
194
189
|
|
|
195
|
-
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` and `artifact_inline` tools: one store, `publish`, and bundles: `assets`, `removeAssets`, `group`, `kind`), `browser` (browser tool and its prompt section; through `host.browsers`), `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),
|
|
190
|
+
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` and `artifact_inline` tools: one store, `publish`, and bundles: `assets`, `removeAssets`, `group`, `kind`), `browser` (browser tool and its prompt section; through `host.browsers`), `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).
|
|
196
191
|
|
|
197
192
|
## Web: `web/` (Preact and htm, no build)
|
|
198
193
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-pocket",
|
|
3
|
-
"version": "0.27.0-beta.
|
|
3
|
+
"version": "0.27.0-beta.9",
|
|
4
4
|
"description": "A durable, multiplayer, mobile-first web app for Pi agents, built on Pi Durable",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"dev": "node bin/pi-pocket.js --cwd .",
|
|
46
46
|
"check": "tsc --noEmit -p . && node test/types-file.ts && node docs-site/check-reference.mjs",
|
|
47
47
|
"test": "node --test --test-concurrency=4 test/*.test.ts",
|
|
48
|
-
"design:check": "node --import ./bin/strip-types.js src/server/design/check-cli.ts",
|
|
49
48
|
"site:publish": "gh workflow run pages.yml",
|
|
50
49
|
"format": "eslint --fix . && prettier --write .",
|
|
51
50
|
"format:check": "prettier --check . && eslint .",
|