feat(plugins): prompt shortcuts leave the core for the prompt-shortcuts plugin #17

Closed
gabrielvidal wants to merge 0 commits from prompt-shortcuts-plugin into main
pull from: prompt-shortcuts-plugin
Owner

Summary

Prompt shortcuts leave the core for a new prompt-shortcuts live plugin (companion PR in ai-agent-plugins, same branch name). Everything moves, per Gabriel's form prompt-shortcuts-into-a-plugin_dkhipt:

  • the owner's library, with who gets each chip;
  • its editor and audience matrix;
  • the guest sharing, and guests' own shortcuts and preferences;
  • the built-in Changes ⇄ No changes chip.

The core keeps what draws and sends the chips: the composer's chips engine, the always-on notify line and the thread's prompt pills. Skills & agents, the old page's second tab, becomes its own core Settings entry.

Key changes

  • New platform hooks (generic; the keyboard-shortcuts move reuses them):
    • ui.pages[].nav: "settings" with optional group and after. It is routed at /settings/p/<id>/<page> and listed in the Settings panel, the bottom bar's drawers, the settings search and the command palette (business/settings/pluginEntries.tsx, visibleEntries(a, extra)).
    • A top-level "seed": true: an app plugin installed once from the seed dir at start (carryover.seed_typed_plugins).
    • composer.shortcuts now honours "position": "first", keeps runners: [] and hidden, and allows 64 chips. A POSTed action of a provider drops its cache and publishes composer-shortcuts to everyone, guests included.
    • New frame bridges aiAgentPlugin.pickIcon (the app's glyph picker in a host dialog) and iconSvg(keys) (business/plugins/iconBridge.tsx). A page's init now carries lang.
  • Carry-over (carryover.prompt_shortcuts, once):
    • The owner's promptShortcuts → the plugin's library.json, with each audience spelled out. A pre-v4 blob first folds in the old guest list.
    • Each guest's promptShortcuts + shortcutPrefs → their personal.json.
  • Removed from core:
    • settings/shortcuts.py, which upgraded blobs on read;
    • /api/me sharedShortcuts, and promptShortcuts from /api/guest-defaults (OpenAPI and client regenerated);
    • the editor components (ShortcutEditor, AudienceMatrix, GuestShortcuts, PromptShortcuts page).
    • The settings store's v7 migration drops promptShortcuts / shortcutPrefs.
  • Composer: business/settings/shortcuts.ts reads every chip from the providers. PromptShortcut moves to lib/promptShortcut.ts; CHANGES_SHORTCUT_ID / NO_CHANGES_GUIDELINE move to lib/guidelineDag.ts. A prompt pill links to its plugin's page.
  • Settings → Skills & agents (/settings/setup, pages/SkillsSetup.tsx) holds the setup matrix and Repo plugins. /settings/shortcuts forwards to the plugin's page, and #skills to /settings/setup. Saved panel and drawer layouts expand the old shortcuts key in place.
  • Mock, telemetry features, French dictionary, CLAUDE.md, docs/plugins.md, docs/settings.md and docs/multi-user.md are updated.

Key decisions

  • A general nav: "settings" hook, not a core registry entry pointing at a plugin path. The page sits where Prompt shortcuts was (You, after Keyboard), and other moves reuse it. after also matches another plugin page's id, so it chains to the keyboard-shortcuts plugin's Keyboard page; when nothing matches, the entry goes to the end of its group.
  • Seeded at start ("seed": true) rather than installed by hand. Without the plugin every composer loses its Changes chip, so there must be no gap after the deploy. An uninstall still sticks.
  • The carry-over writes the plugin's files whether or not it is installed. The data is safe before the frontend's v7 migration strips the keys, and the ui-state blobs themselves are left untouched.
  • position: "first" in the provider answer keeps the library ahead of ask-form's Form chip (providers run in plugin-id order). A manifest-level priority was rejected as heavier.
  • A refresh after any POSTed action of a provider, like app.banner: an owner's save reaches every open composer, guests' too, without a per-action flag.
  • The hidden flag stays in a guest's answer. The composer drops a hidden chip, but the thread's pills can still name a line it wrote.
  • A narrow plugin-id alias stays in core: /settings/shortcuts and the saved-layout renames, like the /forms and /memories redirects.

Changelog

  • Changed: Prompt shortcuts are now their own plugin (seeded automatically), still in Settings → You right after Keyboard, for the owner and every guest.
  • Changed: Skills & agents has its own Settings entry (Your logins & tools), separate from prompt shortcuts.
  • Added: plugins can add a page to Settings, seed themselves on a hub, and use the app's icon picker.

Test notes

  • Backend (bwrap with a throwaway /data):
    • New test_plugin_prompt_shortcuts.py (10 tests): carry-over v4 / pre-v4 / once / keep, seeding, the manifest's settings page, position-first, the refresh.
    • These also pass: test_guests, test_plugin_deps_agents, test_batch1_platform, test_authz, test_authz_matrix, test_telemetry, test_plugin_telemetry, test_plugin_gaps, test_guest_cli.
    • test_typed_plugins keeps one failure that main has too (a missing harness-pi fixture).
  • Frontend: tsc --noEmit is clean. vitest: 1,057 pass, 3 fail; those 3 fail on main too (useShareTarget ×2, CacheExpiredNotice). New tests cover registry placement and after chaining, the panel, the drawers with the old layout, and the composer chips through the providers.
  • Live local hub (this branch + the plugin's branch as PLUGINS_SEED_DIR, ui-state seeded with an owner library and a guest "dom"):
    • The plugin was seeded at start, and the carry-over wrote the library and dom's own file.
    • The owner's chips keep their audiences, and dom's view is the guest slice: Changes' child trimmed, Explain flagged hidden, dom's own chip last.
    • After installing ask-form, the order was the library first, then Form.
    • Driven with puppeteer: pickIcon opens the host picker and the pick saves; ticking Guests on a chip reached dom's chips at once; the composer shows Changes / Screenshots / Form; the guest page and drawer render; no page errors.
  • Not deployed from the EVOX2. Order on the Homelab: merge the ai-agent-plugins PR first (the seed dir must hold the plugin), then this one, then the blue-green deploy. At first start the hub seeds the plugin and runs the carry-over. Check /data/plugins/data/_hub/prompt-shortcuts/library.json afterwards.

🤖 Generated with Claude Code

Screenshots

owner-page.png
guest-page.png
owner-icon-picker.png
owner-composer.png
owner-page-mobile-dark.png

## Summary Prompt shortcuts leave the core for a new `prompt-shortcuts` live plugin (companion PR in ai-agent-plugins, same branch name). Everything moves, per Gabriel's form `prompt-shortcuts-into-a-plugin_dkhipt`: - the owner's library, with who gets each chip; - its editor and audience matrix; - the guest sharing, and guests' own shortcuts and preferences; - the built-in Changes ⇄ No changes chip. The core keeps what draws and sends the chips: the composer's chips engine, the always-on notify line and the thread's prompt pills. Skills & agents, the old page's second tab, becomes its own core Settings entry. ## Key changes - **New platform hooks** (generic; the keyboard-shortcuts move reuses them): - `ui.pages[].nav: "settings"` with optional `group` and `after`. It is routed at `/settings/p/<id>/<page>` and listed in the Settings panel, the bottom bar's drawers, the settings search and the command palette (`business/settings/pluginEntries.tsx`, `visibleEntries(a, extra)`). - A top-level `"seed": true`: an app plugin installed once from the seed dir at start (`carryover.seed_typed_plugins`). - `composer.shortcuts` now honours `"position": "first"`, keeps `runners: []` and `hidden`, and allows 64 chips. A POSTed action of a provider drops its cache and publishes `composer-shortcuts` to everyone, guests included. - New frame bridges `aiAgentPlugin.pickIcon` (the app's glyph picker in a host dialog) and `iconSvg(keys)` (`business/plugins/iconBridge.tsx`). A page's `init` now carries `lang`. - **Carry-over** (`carryover.prompt_shortcuts`, once): - The owner's `promptShortcuts` → the plugin's `library.json`, with each audience spelled out. A pre-v4 blob first folds in the old guest list. - Each guest's `promptShortcuts` + `shortcutPrefs` → their `personal.json`. - **Removed from core:** - `settings/shortcuts.py`, which upgraded blobs on read; - `/api/me` `sharedShortcuts`, and `promptShortcuts` from `/api/guest-defaults` (OpenAPI and client regenerated); - the editor components (`ShortcutEditor`, `AudienceMatrix`, `GuestShortcuts`, `PromptShortcuts` page). - The settings store's v7 migration drops `promptShortcuts` / `shortcutPrefs`. - **Composer:** `business/settings/shortcuts.ts` reads every chip from the providers. `PromptShortcut` moves to `lib/promptShortcut.ts`; `CHANGES_SHORTCUT_ID` / `NO_CHANGES_GUIDELINE` move to `lib/guidelineDag.ts`. A prompt pill links to its plugin's page. - **Settings → Skills & agents** (`/settings/setup`, `pages/SkillsSetup.tsx`) holds the setup matrix and Repo plugins. `/settings/shortcuts` forwards to the plugin's page, and `#skills` to `/settings/setup`. Saved panel and drawer layouts expand the old `shortcuts` key in place. - Mock, telemetry features, French dictionary, CLAUDE.md, `docs/plugins.md`, `docs/settings.md` and `docs/multi-user.md` are updated. ## Key decisions - **A general `nav: "settings"` hook, not a core registry entry pointing at a plugin path.** The page sits where Prompt shortcuts was (You, after Keyboard), and other moves reuse it. `after` also matches another plugin page's id, so it chains to the keyboard-shortcuts plugin's Keyboard page; when nothing matches, the entry goes to the end of its group. - **Seeded at start (`"seed": true`) rather than installed by hand.** Without the plugin every composer loses its Changes chip, so there must be no gap after the deploy. An uninstall still sticks. - **The carry-over writes the plugin's files whether or not it is installed.** The data is safe before the frontend's v7 migration strips the keys, and the ui-state blobs themselves are left untouched. - **`position: "first"` in the provider answer** keeps the library ahead of ask-form's Form chip (providers run in plugin-id order). A manifest-level priority was rejected as heavier. - **A refresh after any POSTed action of a provider**, like `app.banner`: an owner's save reaches every open composer, guests' too, without a per-action flag. - **The `hidden` flag stays in a guest's answer.** The composer drops a hidden chip, but the thread's pills can still name a line it wrote. - **A narrow plugin-id alias stays in core:** `/settings/shortcuts` and the saved-layout renames, like the `/forms` and `/memories` redirects. ## Changelog - Changed: Prompt shortcuts are now their own plugin (seeded automatically), still in Settings → You right after Keyboard, for the owner and every guest. - Changed: Skills & agents has its own Settings entry (Your logins & tools), separate from prompt shortcuts. - Added: plugins can add a page to Settings, seed themselves on a hub, and use the app's icon picker. ## Test notes - **Backend** (bwrap with a throwaway `/data`): - New `test_plugin_prompt_shortcuts.py` (10 tests): carry-over v4 / pre-v4 / once / keep, seeding, the manifest's settings page, position-first, the refresh. - These also pass: `test_guests`, `test_plugin_deps_agents`, `test_batch1_platform`, `test_authz`, `test_authz_matrix`, `test_telemetry`, `test_plugin_telemetry`, `test_plugin_gaps`, `test_guest_cli`. - `test_typed_plugins` keeps one failure that main has too (a missing `harness-pi` fixture). - **Frontend:** `tsc --noEmit` is clean. `vitest`: 1,057 pass, 3 fail; those 3 fail on main too (`useShareTarget` ×2, `CacheExpiredNotice`). New tests cover registry placement and `after` chaining, the panel, the drawers with the old layout, and the composer chips through the providers. - **Live local hub** (this branch + the plugin's branch as `PLUGINS_SEED_DIR`, ui-state seeded with an owner library and a guest "dom"): - The plugin was seeded at start, and the carry-over wrote the library and dom's own file. - The owner's chips keep their audiences, and dom's view is the guest slice: Changes' child trimmed, Explain flagged `hidden`, dom's own chip last. - After installing ask-form, the order was the library first, then Form. - Driven with puppeteer: `pickIcon` opens the host picker and the pick saves; ticking Guests on a chip reached dom's chips at once; the composer shows Changes / Screenshots / Form; the guest page and drawer render; no page errors. - **Not deployed from the EVOX2.** Order on the Homelab: merge the ai-agent-plugins PR first (the seed dir must hold the plugin), then this one, then the blue-green deploy. At first start the hub seeds the plugin and runs the carry-over. Check `/data/plugins/data/_hub/prompt-shortcuts/library.json` afterwards. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Screenshots ![owner-page.png](https://git.gabvdl.xyz/attachments/6d5915f7-ad38-4425-accf-b3782bf9a19a) ![guest-page.png](https://git.gabvdl.xyz/attachments/af284b8b-9c07-4cdb-bae9-bec5a079f3d4) ![owner-icon-picker.png](https://git.gabvdl.xyz/attachments/053397cf-6bff-44f3-b3fe-fa672b26b679) ![owner-composer.png](https://git.gabvdl.xyz/attachments/1a6dad47-b32d-4a80-a70d-e26c437535a1) ![owner-page-mobile-dark.png](https://git.gabvdl.xyz/attachments/2177405c-e508-4232-b94e-f55591f05a54)
gabrielvidal self-assigned this 2026-11-27 01:04:21 +01:00
gabrielvidal added 1 commit 2026-11-27 01:04:22 +01:00
Gabriel's form prompt-shortcuts-into-a-plugin_dkhipt: everything moves —
the owner's library, its editor and audience matrix, the guest sharing,
guests' own shortcuts and prefs, the built-in Changes chip. The core keeps
the composer's chips engine, the always-on notify line and the prompt pills.

Platform hooks (generic, reused by the keyboard-shortcuts move):
- ui.pages[].nav "settings" (+ group, after): a Settings entry routed at
  /settings/p/<id>/<page>, listed in the panel, the drawers, the search and
  the palette, right after the entry `after` names (a core id or another
  plugin page's id; else the end of its group).
- top-level "seed": true: an app plugin installed once from the seed dir at
  start, like provider-* / harness-*.
- composer.shortcuts: "position": "first", runners: [] and hidden kept, 64
  chips; a POSTed action of a provider drops its cache and publishes
  composer-shortcuts (guests too) so every composer refetches.
- frame bridges aiAgentPlugin.pickIcon (the app's glyph picker in a host
  dialog) and iconSvg(keys); a page's init.lang.

The move:
- carryover.prompt_shortcuts: the owner's promptShortcuts (audience made
  explicit, a pre-v4 blob folding the old guest list) → library.json, each
  guest's promptShortcuts + shortcutPrefs → their personal.json, once.
- settings v7 drops promptShortcuts / shortcutPrefs; settings/shortcuts.py,
  /api/me sharedShortcuts and guest-defaults promptShortcuts are gone.
- Settings → Skills & agents (/settings/setup) is its own entry;
  /settings/shortcuts forwards to the plugin's page (#skills → setup), saved
  panel and drawer layouts keep the old slot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner
Merged into `main` as fcdde7290c723739b69852c6b579d3f4e59bc875 by the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/01a21a60-f657-7368-89c8-21d61ac8f575.
gabrielvidal closed this pull request 2026-11-27 01:40:40 +01:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gabrielvidal/ai-agent#17