pi-note 0.27.0 → 0.29.0

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/LOCAL.md ADDED
@@ -0,0 +1,415 @@
1
+ # Local-only Pi extension
2
+
3
+ [npm](https://www.npmjs.com/package/pi-note) · [Pi package directory](https://pi.dev/packages/pi-note)
4
+
5
+ Persistent [pinote](https://github.com/kvidzibo/pinote) tasks and Markdown handoffs
6
+ in Pi: selected-task footer status, `/pi-note`, and agent current-task read/update,
7
+ add, and tag-listing tools.
8
+ The extension and Python app share a repository but install separately.
9
+
10
+ The package now defaults to the [standalone HTTP extension](README.md).
11
+ This existing local-only extension remains available explicitly for machines using
12
+ an on-device `note` CLI. It does not share notes with remote machines and must not
13
+ be loaded alongside `remote.ts`. Neither mode needs the MCP gateway.
14
+
15
+ ## Install
16
+
17
+ Requires Pi 0.99.1+, Node.js 22.19+ and **pinote 0.3.0+** (`note` on PATH). Add and tag listing need **pinote 0.4.0+**.
18
+ From a checkout, load this mode explicitly:
19
+
20
+ ```sh
21
+ pi --extension /absolute/path/to/pinote/pi/index.ts
22
+ ```
23
+
24
+ Do not install the package's default HTTP extension in the same session.
25
+ Loading this file does not run Python installers.
26
+
27
+ ### CLI setup and upgrades
28
+
29
+ Install [uv](https://docs.astral.sh/uv/getting-started/installation/) first and
30
+ restart Pi with `uv` on PATH. At startup the extension checks `note --version`
31
+ against its bundled CLI version (currently 0.4.0), without network requests:
32
+
33
+ - Missing/unrecognized CLI: `/pi-note` opens Settings directly, where **Install CLI** is available.
34
+ - Older CLI: `/pi-note` opens Settings directly, where **Upgrade CLI** is available.
35
+ - Equal/newer CLI: neither installation action is shown; no upgrade notification.
36
+
37
+ Install and upgrade recheck the CLI version and ask before installing into uv's
38
+ isolated tool environment. Restart Pi or `/reload` after external CLI changes;
39
+ installation actions never reinstall an equal/newer CLI or intentionally downgrade it.
40
+ Python 3.11+ is required; uv can download a suitable interpreter when missing.
41
+ Installation downloads a pinned GitHub source archive and build dependencies,
42
+ not a similarly named PyPI package. It does not install GTK dependencies, edit
43
+ shell configuration, or change tasks. This checks the Python CLI bundled with
44
+ the installed extension, not the latest npm/GitHub release. Update the extension
45
+ first to receive a newer bundled CLI.
46
+
47
+ Back up your database before upgrading and update an optional GUI separately.
48
+ For checkout development, use `uv tool install --reinstall .` at the repo root
49
+ instead, so local Python changes are installed.
50
+
51
+ If setup reports a PATH problem, run `uv tool dir --bin` in your terminal,
52
+ put that directory before older `note` executables on PATH, and restart Pi.
53
+ Check `note --version`, then restart Pi or `/reload`. Network/build failures and
54
+ conflicting executables are reported without forcibly overwriting another
55
+ installer's commands. Fix the reported cause and retry; installs time out after
56
+ three minutes. Installation actions are unavailable while installation runs.
57
+ Setup hints direct users to `/pi-note` → Settings.
58
+ Missing uv is reported with its installation link, not installed
59
+ automatically. The [GTK desktop app](../README.md#optional-gtk-checklist) is optional
60
+ and still requires separate system dependencies.
61
+
62
+ The extension probes `note --version` before task commands: older CLIs interpret
63
+ unknown commands as note text and must be rejected before use. Remove the old
64
+ standalone `settings/pi/extensions/pinote.ts` entry if installed; load only one copy.
65
+
66
+ ## Use
67
+
68
+ When the CLI is ready and no task is selected, `/pi-note` opens the task picker.
69
+ It marks the chosen task in progress and adds this default prompt to the editor:
70
+ “Read the current Pinote task. Summarize your understanding, but don’t start work yet.”
71
+ If the CLI is missing or older than the bundled version, `/pi-note` opens Settings
72
+ directly so the relevant CLI installation action remains accessible. **Tab** opens
73
+ Settings from the picker or task view; **Tab** from Settings returns to tasks.
74
+ The agent fetches current task text and saved handoff fields when you submit;
75
+ they are not copied into the draft. The default prompt asks for a summary, not implementation.
76
+ Existing drafts are preserved; nothing is submitted automatically.
77
+ With a selected task, `/pi-note` offers **Continue**, **Done**, **Switch task**, and
78
+ **Settings**. Settings provides **Preview task**, **Complete task (new session)**,
79
+ **Accept suggestion**, and **Dismiss suggestion** when applicable, plus
80
+ **Install CLI** or **Upgrade CLI** only when needed. Settings also lists fields found
81
+ on the current task, so existing values can be configured without creating another task.
82
+ Type in the task picker to filter by text, ID, tag, or state (all words must match).
83
+ Use ↑/↓ and Enter to select, or Esc to cancel. Rows show **●** for in progress or
84
+ **○** for active, followed by the tag (`[Untagged]` when absent).
85
+ The normal Pi status area shows selected-task controls and title without replacing other footers. The footer omits the task ID and state and shows only the first line, bounded by `footer.titleWidth` (default 60 terminal columns including the pin, controls, tag and title). Overflow ends with `...`. The title remains clickable for preview; task controls are separate. At very small widths controls are hidden (pin only). The pin and controls are bundled in `icons/note.txt`, `icons/check.txt`, `icons/cross.txt`, and `icons/add.txt`; they use terminal fonts, not a Nerd Font or icon theme. Icons are bold; their apparent weight depends on the terminal font, and emoji may look unchanged.
86
+
87
+ ### Display-only preview
88
+
89
+ Use **Preview task** in Settings to print the selected task's full Markdown text
90
+ and saved agent fields in the transcript. The preview is labeled **display only · not sent
91
+ to model**: it is a local custom session entry, excluded from subsequent model
92
+ requests, compaction and branch summaries. It survives session resume but does not
93
+ modify the note, editor draft or task selection, and never starts a model call.
94
+ The agent can still read the task separately with `pinote_get_current`.
95
+ Click previews work while the agent is running, provided no other Pinote operation
96
+ is open. Each click saves a fresh snapshot in the transcript, above any currently
97
+ streaming response. Later output scrolls it upward; it does not expire. Preview
98
+ reads never lock out the agent's task updates. Settings also works during a running turn.
99
+
100
+ ![Preview above a running response](../docs/images/pi-note-active-preview.png)
101
+
102
+ On Linux, the task text (pin, tag and title) is a clickable OSC 8 link to a
103
+ private per-session Unix socket. Overflow at the configured title width stays linked.
104
+ The package ships [a Kitty configuration example](kitty/open-actions.conf).
105
+ Append its block to `~/.config/kitty/open-actions.conf`, preserving existing
106
+ actions. Replace `/absolute/path/to/pi-note` with the installed package directory
107
+ containing `preview-click.cjs`; for this checkout, that directory is `pi/`.
108
+ Keep `${URL}` literal: Kitty substitutes the clicked task's link.
109
+
110
+ ```conf
111
+ protocol pi-note-preview
112
+ action launch --type=background node /absolute/path/to/pi-note/preview-click.cjs ${URL}
113
+ ```
114
+
115
+ Do not replace or symlink your entire Kitty configuration to the example: it
116
+ contains only Pinote's handler. Package installation does not edit Kitty files.
117
+
118
+ Reload Kitty with **Ctrl+Shift+F5**. In Pi's regular mode, click the task text; in
119
+ fullscreen mode, use **Ctrl+Shift+click** so Kitty handles the link instead of
120
+ Pi's system URL opener. The helper sends only an authenticated selection
121
+ identifier, never note content or a model prompt. Stale links after task switching, tree navigation, reload or session exit
122
+ are rejected. The **Preview task** Settings action is also available when the
123
+ socket cannot start; the task remains visible without a link.
124
+
125
+ Each Pi session remembers its own task, including several sessions in one folder.
126
+ Resume restores that session's task. `/new` keeps the current task selected and
127
+ prepopulates the editor with `newSessionPrompt`; nothing is submitted automatically.
128
+ A fresh Pi launch starts unselected and does not import an older per-folder selection.
129
+ Completion still starts a clean, unselected session. Retention requires normal
130
+ file-backed Pi sessions; `--no-session` does not retain the selection across `/new`. Pi saves the session after the first submitted message;
131
+ quitting before that leaves the next launch unselected, while the task stays in progress.
132
+ Use **Continue**
133
+ to insert the same configured prompt. Completing, removing, or scheduling a task clears it
134
+ from sessions that refresh it. Switching does not complete or reset the previous task.
135
+ Task fields such as `Worktree` and `PR` stay on the task, so sessions can use separate
136
+ worktrees and pull requests. Task status refreshes at session start, before/after
137
+ agent activity, and after commands/tools. The CLI's per-directory `agent selected`
138
+ command is not this session memory.
139
+
140
+ ### Personal configuration
141
+
142
+ Configure `~/.pi/agent/pi-note.json` (or the agent directory set by
143
+ `PI_CODING_AGENT_DIR`):
144
+
145
+ ```json
146
+ {
147
+ "handoffPrompt": "Read the current Pinote task. Summarize your understanding and proposed approach, but don’t start work yet.",
148
+ "newSessionPrompt": "Read the current Pinote task. Summarize your understanding and proposed approach, but don’t start work yet.",
149
+ "taskOfferPolicy": "github-remote"
150
+ }
151
+ ```
152
+
153
+ `taskOfferPolicy` controls the agent's task-offer guidance:
154
+
155
+ With no selected task, suggest a note only when implementation is expected to
156
+ span multiple turns. Skip questions, investigation, recon, and small edits (such
157
+ as changing a few configuration lines). If investigation develops into substantial
158
+ implementation, suggest then. No plan is required: a short title identifies the
159
+ work. Explicit user requests to create a task remain allowed under every policy.
160
+
161
+ - `always` (default): offer for qualifying implementation in any repository.
162
+ - `github-remote`: for qualifying implementation, first verify with Git that the
163
+ repository has an HTTPS or SSH remote hosted on `github.com`; otherwise do not
164
+ offer. Local paths and other
165
+ hosts do not qualify. This is agent guidance, not a network or PR-access check.
166
+ - `never`: do not offer tasks; explicit requests to create one remain allowed.
167
+
168
+ All policies preserve the existing creation tools, user-consent requirement,
169
+ and selected tasks. Run `/reload` after changing this setting. Invalid policy
170
+ values or unreadable/malformed configuration suppress offers; interactive startup
171
+ warns until you fix the file and reload. No project-local configuration is read.
172
+
173
+ In `/pi-note → Settings`, select **Task prompt** to edit the text inserted after
174
+ selection or **Continue**. **Shift+Enter** or **Ctrl+J** adds a newline; **Enter** saves it
175
+ globally, **Ctrl+C** clears the edit, and **Esc** cancels that unfinished edit.
176
+
177
+ **New session prompt** edits the separate draft inserted by `/new` when a task is
178
+ retained. Its default matches the built-in task prompt; an empty/whitespace-only
179
+ value disables insertion without clearing the task. `/new` rereads it each time,
180
+ so changes need no `/reload`. Invalid configuration warns and leaves the retained
181
+ task selected without inserting a prompt. Both prompts are literal text, not templates.
182
+
183
+ Settings and fields save automatically after each confirmed change; no separate
184
+ Save action is needed. Leaving Settings with **Esc** or **Tab** keeps saved changes
185
+ and discards only unfinished input. Saving never changes existing editor input or submits anything.
186
+
187
+ Task selection and **Continue** reread `handoffPrompt` each time; changing that
188
+ field needs no `/reload`. Its value is literal text, not a prompt template; use
189
+ `\n` in JSON strings for multiple lines. It must be a nonblank string without control
190
+ characters other than tabs and newlines. A missing file or key uses the default.
191
+ Invalid/unreadable configuration reports an error without starting/switching a
192
+ task or changing the editor. Menu **Done**, footer completion, and agent tools are
193
+ unaffected. If configuration is invalid or unreadable, Settings shows only task,
194
+ suggestion, and CLI actions; repair `pi-note.json` before editing preferences.
195
+ Invalid configuration is never replaced with defaults. This is user-level
196
+ configuration only; project-local files are not read.
197
+
198
+ ### Agent tools
199
+
200
+ - `pinote_get_current`: read this session's selected task, including its revision.
201
+ Takes no arguments; returns null when this session has no selected task.
202
+ - `pinote_update_current`: supply `expected_updated_at` from that read and arbitrary
203
+ `set` label/value pairs or `remove` labels. Updates the selected task only, with no
204
+ ID argument. Updates merge fields, never replace the task text or tag. Fails if
205
+ no task is selected or the selection changes during the operation. If another
206
+ process changed the task, read again before retrying.
207
+ - `pinote_fields`: read the user's global footer definitions (names, display labels,
208
+ links, formats, widths), even without a task. Agents should read this before
209
+ populating relevant values with `pinote_update_current`. Empty/missing values
210
+ stay hidden; this tool does not edit configuration.
211
+ - `pinote_tags`: list saved tag names.
212
+ - `pinote_propose`: show a suggested task beside the pin icon in the footer without
213
+ creating a note. Optional `tag`; full text is retained, but the footer shows only
214
+ its title. Requires a TUI with no selected task. A new proposal replaces the
215
+ unaccepted suggestion without waiting for dismissal. The agent continues your
216
+ work while the suggestion awaits your choice.
217
+ - `pinote_add`: create an active task. Optional `tag`. `select: true` starts and
218
+ remembers it for this session only; use that only after the user agrees.
219
+
220
+ Version 0.7.0 replaces `pinote_get`/`pinote_update` with these current-task tools
221
+ and removes `pinote_tag`, without aliases. Agents cannot read/update tasks by ID
222
+ or retag existing tasks; use `/pi-note` to select an existing task.
223
+
224
+ When allowed by `taskOfferPolicy`, the agent uses `pinote_propose` instead of
225
+ asking in chat. The pin footer shows a pending suggestion, distinct from a selected task:
226
+
227
+ ```text
228
+ 📌 ✖ ✚ · [tag] Task title...
229
+ 📌 ✔ · [tag] Task title...
230
+ ```
231
+
232
+ ![Suggested task controls](../docs/images/pi-task-suggestion.png)
233
+ ![Selected task with Done control](../docs/images/pi-task-selected.png)
234
+
235
+ - Muted **✖** dismisses only the current suggestion without creating a note; the agent can suggest another task while none is selected.
236
+ - Accent **✚** creates, starts, and selects the suggested task.
237
+ - Green **✔** completes the selected task, starts a clean unselected session, and reloads Pi without a completion prompt. Menu **Done** and **Complete task** in Settings do the same.
238
+
239
+ Done occupies the former ✖ position, not the ✚ position, so clicking Add twice cannot accidentally complete the new task. The selected row removes the former ✚ cell's padding. The selected task's title is a separate preview link.
240
+
241
+ The configured `footer.titleWidth` bounds the entire row (default 60 columns). Controls stay first; the tag is dropped before truncating the first-line title with `...`. Tiny widths hide controls (pin only). Pi can still clip the combined status row on narrow terminals.
242
+
243
+ Controls use the [Kitty preview handler](#display-only-preview), with no additional configuration. Fullscreen Kitty uses **Ctrl+Shift+click**. The Settings actions **Accept suggestion** and **Dismiss suggestion** perform the corresponding footer actions. No action submits input or starts an agent turn. Add and Dismiss preserve editor drafts; **Complete task** starts a clean session and reloads Pi, discarding the editor draft, so save unfinished input before completing a task.
244
+
245
+ Completion requires an idle Pi session and no pending Pinote operation. It rejects stale selected-task links and externally changed revisions. Accepted mutations drain even if the helper disconnects. On an error, check `/pi-note` before retrying, because a write may already have committed. Failed or stale writes never restart Pi. If another extension cancels the new session, the task remains completed and Pi reports the cancellation. The reload runs through the new session's fresh context; retired contexts are not reused.
246
+
247
+ If another task fits better, the agent can replace an unaccepted suggestion by calling `pinote_propose` again, without waiting for dismissal. Replacement invalidates the old ✚/✖ links; only the latest suggestion can be accepted or dismissed. Pending suggestions survive `/reload` and session resume, including their full text and tag; new links replace stale capabilities. Accepted or dismissed suggestions never reappear on reload, but dismissal does not block new proposals—even in sessions saved by older versions. New sessions and forks start without a suggestion; selecting a task or navigating the tree clears it. Suggestion state is local, display-only session metadata, not model context. Pi saves the session after the first submitted message; quitting before that can still lose unsaved session state. Repeated acceptance cannot duplicate a note. A busy Pinote operation blocks acceptance. Noninteractive agents still ask in chat before using `pinote_add` with `select: true`. An existing selection is not replaced unless the user asks to switch. Reuse a saved
248
+ tag name when it fits.
249
+
250
+ ![Pending suggestion replaced without creating a task](../docs/images/pi-task-replacement.png)
251
+
252
+ Task text starts with a short, action-oriented title (aim for at most 60 characters).
253
+ Put context, URLs, commands, and acceptance criteria after a blank line; the title
254
+ should not contain implementation details. This is agent guidance, not a storage limit.
255
+
256
+ Agents are guided to keep notes to three short bullets total: relevant outcome,
257
+ blocker, and next action. Replace stale notes; omit narration, repeated task text,
258
+ and routine test logs. Keep a GitHub pull request in `PR`. Set configured footer
259
+ fields with Markdown values; remove a field to hide it. Without a configured field
260
+ list, append its label to `Bar`, one label per line. Do not list `PR` in `Bar`.
261
+ Agents use `pinote_update_current`; there is no separate `add_to_bottom_bar` tool.
262
+ This is guidance, not truncation or a storage limit.
263
+
264
+ Values are Markdown strings; no fields are required. `PR` can display a clickable link without GitHub polling.
265
+ `Bar` chooses extra footer fields unless configuration overrides it:
266
+
267
+ ```markdown
268
+ ## Agent
269
+ PR: [Task selection #42](https://github.com/org/repo/pull/42)
270
+ Dashboard: [Metrics](http://127.0.0.1:3000/d/app)
271
+ Next: Address review comments
272
+ Bar: Dashboard
273
+ Next
274
+ Jira: [PROJ-123](https://example.atlassian.net/browse/PROJ-123)
275
+ CWD: `/home/me/project`
276
+ ```
277
+
278
+ The GTK preview renders this section using its existing safe Markdown renderer.
279
+ Fields are stored separately from task text, retained in history, and survive
280
+ sessions. Labels are case-sensitive (trimmed, Unicode-normalized), at most 64
281
+ characters; values are at most 4096 characters. Maximum 64 fields / 32 KiB JSON
282
+ per task. Use removal rather than empty values.
283
+
284
+ ### Footer configuration
285
+
286
+ Add `footer` to `~/.pi/agent/pi-note.json` (or `pi-note.json` under
287
+ `PI_CODING_AGENT_DIR`), preserving any existing `handoffPrompt`:
288
+
289
+ ```json
290
+ {
291
+ "footer": {
292
+ "titleWidth": 40,
293
+ "fieldWidth": 30,
294
+ "maxFields": 4,
295
+ "fields": [
296
+ { "name": "PR", "label": "", "link": true, "format": "#<number>" },
297
+ { "name": "Dashboard", "label": "Dashboard", "link": true, "format": "<value>" },
298
+ { "name": "Next", "label": "", "link": false, "format": "<value>", "width": 24 }
299
+ ]
300
+ }
301
+ }
302
+ ```
303
+
304
+ Widths are terminal columns, including the pin, tags or field labels, and must be
305
+ integers from 3 to 1000. Defaults: `titleWidth: 60`, `fieldWidth: 60`,
306
+ `maxFields: 4` (allowed 0–64). Each field can override `fieldWidth` with `width`.
307
+ `fields` selects task field names in order, regardless of a task's `Bar`.
308
+ Names are case-sensitive, trimmed and NFC-normalized, at most 64 characters;
309
+ `Bar` is reserved and duplicate names are rejected. Up to 64 definitions are
310
+ accepted. Missing/blank values do not display and do not consume the field limit.
311
+ `[]` or `maxFields: 0` hides configured fields, including PR.
312
+
313
+ In `/pi-note → Settings`, **Add field** adds a global display definition, not a
314
+ task value. Select any field to edit **Link**, **Label**, **Format**, and **Width**.
315
+ Label starts as the field name; clear it for no prefix. Link off displays plain
316
+ text without a clickable link. Toggles, field additions/removals, and edits confirmed
317
+ with **Enter** save immediately. **Esc** returns from a field to settings without
318
+ undoing saved changes. Invalid edits and failed saves stay open with an error;
319
+ failed saves leave saved values unchanged and can be retried. Saves include the task
320
+ prompt, preserve unrelated settings (such as `taskOfferPolicy`), and reject external
321
+ configuration changes made since opening settings or the last successful save.
322
+ Concurrent saves use `pi-note.json.lock`; remove stale locks only when no save is
323
+ running. Symlinked configuration must be edited manually; saves never replace the link.
324
+
325
+ Formats support `<value>` (Markdown display text), `<url>` (one safe link target),
326
+ and `<number>` (a GitHub PR number or numeric field value). With a blank label,
327
+ PR format `#<number>` displays `#123`; Link on makes it clickable. An unavailable
328
+ placeholder hides the field. The template is literal text, not executable code
329
+ or Markdown. Default format is `<value>`, or `#<number>` for PR.
330
+ String definitions and the older `{ "label": "Next", "width": 24 }` form still
331
+ work. Absent/`null` fields retain the legacy automatic PR link plus `Bar` fields;
332
+ the first Settings save turns this legacy list into explicit global definitions.
333
+
334
+ Settings saves include both prompts and apply immediately in this Pi session. Run `/reload` after manual
335
+ footer edits or in other running sessions; settings are also reread on session start.
336
+ Invalid footer configuration warns and uses footer defaults; missing files silently
337
+ use defaults. The task prompt is also read separately on selection/Continue as
338
+ described above; prompt changes need no reload in any running session.
339
+ This is user-level configuration, not task data; agents should not change it
340
+ without approval. Task values still come from `pinote_update_current`.
341
+
342
+ ### Footer links
343
+
344
+ The selected active or in-progress task can show fields after its title.
345
+ Legacy configuration automatically shows a valid `PR` as **PR #123**.
346
+ With an explicit field list, PR presentation is configured like any other field.
347
+ Configured `fields`, or otherwise `Bar`, selects field names. Each listed value is
348
+ Markdown: the footer shows its text, and links in it are clickable for any scheme
349
+ except `javascript:`, `data:`, and `vbscript:`. Credentials, control characters,
350
+ and targets over 2048 characters after serialization are shown as text but not
351
+ linked. `Bar` itself is never displayed.
352
+ By default, at most four extra fields are shown, each truncated to 60 columns.
353
+ Overflow ends with `...`, including cuts between Markdown/link segments. Removing
354
+ a listed field hides it even if configuration or `Bar` still names it. Terminal
355
+ OSC 8 support is required for clicking links. Pi joins footer statuses on one
356
+ line and truncates the combined line with `...` when the terminal is narrow.
357
+ Pi's final ellipsis is plain text; click the remaining task text to preview it.
358
+ This extension does not replace other footers. Other fields, such as `Jira` and
359
+ `CWD` in the example, stay off the footer unless selected.
360
+
361
+ ### PR links without polling
362
+
363
+ Set `PR` with `pinote_update_current` to one `https://github.com/owner/repo/pull/123`
364
+ URL or Markdown link. Legacy footer settings show clickable **PR #123**; global
365
+ field settings can change or hide it. PR and other field links are rendered locally
366
+ for the active selection and disappear when that selection is cleared.
367
+
368
+ Pinote no longer polls GitHub, runs `gh`, watches completed tasks, or prompts on
369
+ PR merges. No GitHub authentication is required. `PINOTE_PR_POLL_SECONDS` is no
370
+ longer used. Other separately installed Pi PR/Git extensions are unaffected.
371
+
372
+ Tools work without a TUI. `/pi-note` works in a TUI while the agent is running:
373
+ you can select/switch tasks, use Continue, preview tasks, respond to suggestions,
374
+ and edit settings without interrupting the turn or submitting input. Completion
375
+ and CLI installation/upgrades still require an idle session. Another pending
376
+ Pinote operation blocks the menu. Open menus do not block agent handoff updates.
377
+ This package does not synchronize databases or paths between machines. Note text
378
+ and fields loaded into Pi are sent to the configured model when used as context;
379
+ avoid secrets. Agent commands do not send desktop notifications.
380
+
381
+ ## Development and releases
382
+
383
+ From the repository root:
384
+
385
+ ```sh
386
+ uv sync --locked
387
+ npm --prefix pi ci --ignore-scripts
388
+ npm --prefix pi test
389
+ (cd pi && npm pack --dry-run)
390
+ ```
391
+
392
+ The load test uses the real Pi loader and checkout's `.venv/bin/note` with temporary
393
+ data. Run visual checks under Xvfb/private D-Bus; never use personal task data.
394
+
395
+ `.github/workflows/publish.yml` follows the other Pi packages: every push to
396
+ `main` runs the full Python/GTK/Pi tests, then publishes a new npm version using
397
+ OIDC trusted publishing and provenance. Existing versions are skipped; registry
398
+ failures fail the workflow. No npm token is stored in GitHub.
399
+
400
+ Only a package's first publication needs this manual bootstrap (not part of
401
+ installation). `pi-note` is already published; use automated releases above.
402
+
403
+ 1. From `pi/`, run `npm login`, then `npm publish --ignore-scripts --access public`
404
+ to bootstrap `pi-note` after checking name availability.
405
+ 2. In npm's package settings configure the GitHub trusted publisher: owner
406
+ `kvidzibo`, repository `pinote`, workflow `publish.yml`, no environment.
407
+
408
+ The CLI source pin in `setup.ts` must point to a verified immutable commit with a
409
+ compatible Python package. Update it and the bundled-version setup text together
410
+ when releasing Python changes; verify installation in a temporary uv tool directory.
411
+
412
+ Subsequent releases: run `npm version patch|minor|major --no-git-tag-version`
413
+ inside `pi/`, commit both version files in a PR, and merge through the normal
414
+ review/check process. Python and npm versions are independent; update the stated
415
+ minimum CLI version whenever the integration contract changes.