feat(plugins): What's new leaves the core for the whats-new plugin — app.launch opens a plugin modal on opening the app #14

Closed
gabrielvidal wants to merge 0 commits from whats-new-plugin into main
pull from: whats-new-plugin
Owner

Summary

What's new (the guests' feature carousel) leaves the core for the whats-new live plugin (companion PR: gabrielvidal/ai-agent-plugins#6). This is move F of the ai-agent → ai-agent-plugins migration (form ai-agent-moves-to-ai-agent-plugins_o2qxmd). The core keeps only generic platform pieces:

  • provides: {"app.launch": …}: a plugin may open one of its app.modal slots when someone opens the app, which works on an iPhone where overlays don't;
  • impersonatedBy in actions;
  • init.lang in frames;
  • createdAt on users.read;
  • a whatsnew.index bridge for App usage.

Key changes

  • backend/plugins/launch.py + GET /api/plugins/app-launch?reason=load|foreground&path= (plugins.use):
    • Fans out to the caller's active app.launch providers, including a guest's granted managed plugins, as the caller with their grant (≤ 10 s each).
    • Answers {open: [{pluginId, slotId, init, closeAction?}]}. The slot must be the plugin's own app.modal, the init ≤ 16 KB, and closeAction a declared action.
    • Schemas AppLaunchModal / AppLaunchResponse. manifest._PROVIDES gains app.launch (with a consent line) and whatsnew.index.
  • frontend/src/business/plugins/components/PluginLaunchHost.tsx (replaces WhatsNewHost in App.tsx):
    • Asks once per load and on each return to the foreground, only when a plugin provides app.launch.
    • Plays the answers one after the other in PluginModalHost, never over an open modal or a ?modal= / ?form= link.
    • Runs closeAction with {trigger: "app.launch.closed", init, result} however the modal closes.
  • plugins/routes.py _invoke_action: AIA_USER_CONTEXT.impersonatedBy while the owner impersonates a guest.
  • Smaller generic pieces:
    • hubbridge._safe_user: createdAt.
    • PluginSandboxFrame: init.lang.
    • PluginCustomPage: the page label goes through t().
    • nav.ts settingsOwns: a Settings entry pointing at a plugin page puts it in the Settings section.
  • backend/plugins/whatsnew_bridge.py (provider whatsnew.index, 30 s cache): telemetry/views.py reads App usage's What's new list through it.
  • plugins/carryover.py whats_new:
    • The whats_new / whats_new_seen tables (read-only, left in place) → the plugin's shared entries.json / seen.json.
    • Each whatsNew: false guest → grant autoOpen: false once the plugin is installed.
    • Runs once, with a .carried-over marker.
  • Removed:
    • backend/whatsnew/, schemas/whatsnew.py, the six /api/whats-new* routes (authz table + golden), deps.whats_new, the whats-new SSE pass;
    • users.json whatsNew from the user API;
    • frontend/src/business/whatsNew/, mock/whatsNew.ts, i18n/fr/whatsnew.ts, the User page's What's new panel;
    • cli/whats_new.py and ai-agent whats-new.
  • Redirects and registry:
    • /whats-new → /plugins/whats-new/news and /settings/whats-new → /plugins/whats-new/editor.
    • The registry entries news and whats-new point at those pages.
    • The telemetry features follow the new paths. whatsNew.carousel becomes the generic plugins.launchModal.
  • Generated files: frontend/openapi.json was re-dumped and src/generated regenerated (only the app-launch additions and the What's new removals).
  • Docs: docs/plugins.md → "App launch" and CLAUDE.md → What's new, which now covers the plugin and the ai-agent plugin whats-new flow for sessions shipping a feature.

Key decisions

  • A launch provider, not ui.sheets[] with open/close bridges. The app.modal slot place and openModal / modal.close already exist (scheduled-conversations). What was missing was "open something when the app opens" and "tell the plugin when it closed". app.launch + closeAction add exactly that and stay generic. The paused fresh-context move could open its sheet the same way.
  • Server-side fan-out: one request per opening covers every provider, and a guest's managed grants resolve on the hub. Nothing is cached, because the answer depends on what the guest saw.
  • The route needs plugins.use, not self, since a caller without it can't load plugin frames anyway. A Viewer therefore no longer gets What's new (tests updated).
  • impersonatedBy is host-vouched context, so the owner's look through a guest's eyes still never counts as the guest's visit.
  • The core keeps no What's new copy. Without the plugin there's no carousel and App usage shows no entries, as with Plans or Memories.

Changelog

  • Changed: What's new now comes from the What's new plugin, and the carousel also opens on an iPhone.
  • Changed: The switch that keeps the carousel from opening for a guest moved to Users → → Managed plugins → What's new.
  • Removed: ai-agent whats-new. Use ai-agent plugin whats-new ls | fields | add | rm.

Test notes

  • Backend, every module under bwrap with a throwaway /data, one process each: all pass but two that fail the same way on the base commit or main.
    • test_tool_proxy_media fails on its quota date, a date edge, also on the base.
    • test_typed_plugins::test_records_carry_kind is path-dependent: it fails from a /home checkout, as on main.
    • New test_plugin_launch.py (13 tests): the route, the cleaning, a guest's managed grant, impersonation in both launch and actions, createdAt, the bridge and the carry-over.
    • test_authz_matrix uses the golden regenerated with UPDATE_GOLDEN=1: +app-launch, −whats-new.
    • CLI test_ai_agent.py: 53 passed.
  • Frontend:
    • tsc --noEmit is clean.
    • Full vitest: 1065 tests, the 3 known failures from main (useShareTarget ×2, FreshContext). New PluginLaunchHost.test.tsx.
    • features.json regenerated.
    • npm run build and build:mock both pass.
  • Live local hub (port 8136, plugin installed from the companion branch), French guest on an iPhone viewport:
    • the carousel opens once on sign-in in the host sheet, in French;
    • Terminé closes it;
    • /whats-new redirects to the plugin page under Moi;
    • nothing opens on the next load.
    • Owner: editor, open entry, Users page grant (screenshots below).
  • Not deployed from the EVOX2. Homelab steps, in this order (the live hub's validate_manifest rejects the plugin until the core PR is deployed: provides.app.launch / provides.whatsnew.index are unknown and the app.modal slot place is invalid there):
    1. Merge ai-agent #14 and ai-agent-plugins #6.
    2. Deploy the hub with ai-agent-deploy. The carry-over copies the old entries and seen marks into the plugin's shared dir at start. The autoOpen: false grants wait until the plugin is installed (retried at each start).
    3. ai-agent plugin install ~/projects/ai-agent-plugins/plugins/whats-new, and approve users.read + askform.bridge.
    4. Reload clarifier (1.0.1).
  • Between steps 2 and 3, guests see no carousel, and /whats-new (and /settings/whats-new) redirect to a plugin page that isn't there yet. Keep that window short.
  • Conflicts to expect with the sibling moves A–E: one-line neighbours in authz/routes.py, users/routes.py, User.tsx, nav.ts, root.tsx, CLAUDE.md, and openapi.json / src/generated. Regenerate those last two after rebasing.

🤖 Generated with Claude Code

Screenshots

1-guest-carousel-phone.png
3-guest-whats-new-page-phone.png
5-owner-editor-entry-open.png
6-owner-user-managed-plugins.png

## Summary What's new (the guests' feature carousel) leaves the core for the `whats-new` live plugin (companion PR: https://git.gabvdl.xyz/gabrielvidal/ai-agent-plugins/pulls/6). This is move F of the ai-agent → ai-agent-plugins migration (form `ai-agent-moves-to-ai-agent-plugins_o2qxmd`). The core keeps only generic platform pieces: - `provides: {"app.launch": …}`: a plugin may open one of its `app.modal` slots when someone opens the app, which works on an iPhone where overlays don't; - `impersonatedBy` in actions; - `init.lang` in frames; - `createdAt` on `users.read`; - a `whatsnew.index` bridge for App usage. ## Key changes - **`backend/plugins/launch.py`** + `GET /api/plugins/app-launch?reason=load|foreground&path=` (`plugins.use`): - Fans out to the caller's active `app.launch` providers, including a guest's granted managed plugins, as the caller with their grant (≤ 10 s each). - Answers `{open: [{pluginId, slotId, init, closeAction?}]}`. The slot must be the plugin's own `app.modal`, the init ≤ 16 KB, and `closeAction` a declared action. - Schemas `AppLaunchModal` / `AppLaunchResponse`. `manifest._PROVIDES` gains `app.launch` (with a consent line) and `whatsnew.index`. - **`frontend/src/business/plugins/components/PluginLaunchHost.tsx`** (replaces `WhatsNewHost` in `App.tsx`): - Asks once per load and on each return to the foreground, only when a plugin provides `app.launch`. - Plays the answers one after the other in `PluginModalHost`, never over an open modal or a `?modal=` / `?form=` link. - Runs `closeAction` with `{trigger: "app.launch.closed", init, result}` however the modal closes. - **`plugins/routes.py` `_invoke_action`**: `AIA_USER_CONTEXT.impersonatedBy` while the owner impersonates a guest. - **Smaller generic pieces**: - `hubbridge._safe_user`: `createdAt`. - `PluginSandboxFrame`: `init.lang`. - `PluginCustomPage`: the page label goes through `t()`. - `nav.ts` `settingsOwns`: a Settings entry pointing at a plugin page puts it in the Settings section. - **`backend/plugins/whatsnew_bridge.py`** (provider `whatsnew.index`, 30 s cache): `telemetry/views.py` reads App usage's What's new list through it. - **`plugins/carryover.py` `whats_new`**: - The `whats_new` / `whats_new_seen` tables (read-only, left in place) → the plugin's shared `entries.json` / `seen.json`. - Each `whatsNew: false` guest → grant `autoOpen: false` once the plugin is installed. - Runs once, with a `.carried-over` marker. - **Removed**: - `backend/whatsnew/`, `schemas/whatsnew.py`, the six `/api/whats-new*` routes (authz table + golden), `deps.whats_new`, the `whats-new` SSE pass; - `users.json` `whatsNew` from the user API; - `frontend/src/business/whatsNew/`, `mock/whatsNew.ts`, `i18n/fr/whatsnew.ts`, the User page's What's new panel; - `cli/whats_new.py` and `ai-agent whats-new`. - **Redirects and registry**: - `/whats-new` → `/plugins/whats-new/news` and `/settings/whats-new` → `/plugins/whats-new/editor`. - The registry entries `news` and `whats-new` point at those pages. - The telemetry features follow the new paths. `whatsNew.carousel` becomes the generic `plugins.launchModal`. - **Generated files**: `frontend/openapi.json` was re-dumped and `src/generated` regenerated (only the app-launch additions and the What's new removals). - **Docs**: `docs/plugins.md` → "App launch" and `CLAUDE.md` → What's new, which now covers the plugin and the `ai-agent plugin whats-new` flow for sessions shipping a feature. ## Key decisions - **A launch provider, not `ui.sheets[]` with open/close bridges.** The `app.modal` slot place and `openModal` / `modal.close` already exist (scheduled-conversations). What was missing was "open something when the app opens" and "tell the plugin when it closed". `app.launch` + `closeAction` add exactly that and stay generic. The paused fresh-context move could open its sheet the same way. - **Server-side fan-out**: one request per opening covers every provider, and a guest's managed grants resolve on the hub. Nothing is cached, because the answer depends on what the guest saw. - **The route needs `plugins.use`, not `self`**, since a caller without it can't load plugin frames anyway. A Viewer therefore no longer gets What's new (tests updated). - **`impersonatedBy` is host-vouched context**, so the owner's look through a guest's eyes still never counts as the guest's visit. - **The core keeps no What's new copy.** Without the plugin there's no carousel and App usage shows no entries, as with Plans or Memories. ## Changelog - Changed: What's new now comes from the What's new plugin, and the carousel also opens on an iPhone. - Changed: The switch that keeps the carousel from opening for a guest moved to Users → <guest> → Managed plugins → What's new. - Removed: `ai-agent whats-new`. Use `ai-agent plugin whats-new ls | fields | add | rm`. ## Test notes - **Backend**, every module under bwrap with a throwaway `/data`, one process each: all pass but two that fail the same way on the base commit or main. - `test_tool_proxy_media` fails on its quota date, a date edge, also on the base. - `test_typed_plugins::test_records_carry_kind` is path-dependent: it fails from a `/home` checkout, as on main. - New `test_plugin_launch.py` (13 tests): the route, the cleaning, a guest's managed grant, impersonation in both launch and actions, `createdAt`, the bridge and the carry-over. - `test_authz_matrix` uses the golden regenerated with `UPDATE_GOLDEN=1`: +app-launch, −whats-new. - CLI `test_ai_agent.py`: 53 passed. - **Frontend**: - `tsc --noEmit` is clean. - Full `vitest`: 1065 tests, the 3 known failures from main (useShareTarget ×2, FreshContext). New `PluginLaunchHost.test.tsx`. - `features.json` regenerated. - `npm run build` and `build:mock` both pass. - **Live local hub** (port 8136, plugin installed from the companion branch), French guest on an iPhone viewport: - the carousel opens once on sign-in in the host sheet, in French; - Terminé closes it; - `/whats-new` redirects to the plugin page under *Moi*; - nothing opens on the next load. - Owner: editor, open entry, Users page grant (screenshots below). - **Not deployed from the EVOX2. Homelab steps, in this order** (the live hub's `validate_manifest` rejects the plugin until the core PR is deployed: `provides.app.launch` / `provides.whatsnew.index` are unknown and the `app.modal` slot place is invalid there): 1. Merge ai-agent #14 and ai-agent-plugins #6. 2. Deploy the hub with `ai-agent-deploy`. The carry-over copies the old entries and seen marks into the plugin's shared dir at start. The `autoOpen: false` grants wait until the plugin is installed (retried at each start). 3. `ai-agent plugin install ~/projects/ai-agent-plugins/plugins/whats-new`, and approve `users.read` + `askform.bridge`. 4. Reload `clarifier` (1.0.1). - **Between steps 2 and 3**, guests see no carousel, and `/whats-new` (and `/settings/whats-new`) redirect to a plugin page that isn't there yet. Keep that window short. - **Conflicts to expect** with the sibling moves A–E: one-line neighbours in `authz/routes.py`, `users/routes.py`, `User.tsx`, `nav.ts`, `root.tsx`, `CLAUDE.md`, and `openapi.json` / `src/generated`. Regenerate those last two after rebasing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Screenshots ![1-guest-carousel-phone.png](https://git.gabvdl.xyz/attachments/6869b8f2-4c5b-455f-8762-46c9b7afed64) ![3-guest-whats-new-page-phone.png](https://git.gabvdl.xyz/attachments/6fcc981b-c988-4e95-bb90-929747e58df8) ![5-owner-editor-entry-open.png](https://git.gabvdl.xyz/attachments/06a7d881-9ae0-4dc1-93f1-275c2b512014) ![6-owner-user-managed-plugins.png](https://git.gabvdl.xyz/attachments/96c4cb34-181c-4891-b91f-0c9def8acd52)
gabrielvidal self-assigned this 2026-11-27 00:14:28 +01:00
gabrielvidal added 1 commit 2026-11-27 00:14:28 +01:00
- app.launch: GET /api/plugins/app-launch (plugins/launch.py) asked once per
  opening (load / foreground) by PluginLaunchHost; answers open a plugin's
  app.modal slot in the host modal (iPhone-safe), closeAction runs on close
- impersonatedBy in an action's AIA_USER_CONTEXT; users.read createdAt;
  init.lang in every frame; plugin page labels through t()
- whatsnew.index bridge for App usage; Settings entries may point at plugin pages
- carryover.whats_new: the core tables -> the plugin's shared files, whatsNew:false -> autoOpen:false
- gone: backend/whatsnew, /api/whats-new*, business/whatsNew, cli/whats_new.py,
  ai-agent whats-new, users.json whatsNew in the API, the User page panel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged into main as 44c25c7e (batch merge of the EVOX2 plugin moves on top of main 0797e454, all ai-agent suites green) and deployed: ai-agent @ 7c397fbc live since 2026-11-27 00:57. whats-new installed, clarifier reloaded (1.0.1).

Merged into `main` as 44c25c7e (batch merge of the EVOX2 plugin moves on top of main 0797e454, all ai-agent suites green) and deployed: ai-agent @ 7c397fbc live since 2026-11-27 00:57. whats-new installed, clarifier reloaded (1.0.1).
gabrielvidal closed this pull request 2026-11-27 00:58:15 +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#14