@agentproto/apps 0.11.0 → 0.13.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.
Files changed (70) hide show
  1. package/dist/agents-overview/panel.mjs +39 -67
  2. package/dist/agents-overview/panel.mjs.map +1 -1
  3. package/dist/agents-overview.mjs +38 -68
  4. package/dist/agents-overview.mjs.map +1 -1
  5. package/dist/bin/sync.d.ts.map +1 -1
  6. package/dist/bin/sync.mjs +2374 -2
  7. package/dist/bin/sync.mjs.map +1 -1
  8. package/dist/bureau-sessions/panel.mjs +39 -67
  9. package/dist/bureau-sessions/panel.mjs.map +1 -1
  10. package/dist/bureau-sessions.mjs +38 -68
  11. package/dist/bureau-sessions.mjs.map +1 -1
  12. package/dist/config/fragment.d.ts +50 -0
  13. package/dist/config/fragment.d.ts.map +1 -0
  14. package/dist/config/index.d.ts +23 -0
  15. package/dist/config/index.d.ts.map +1 -0
  16. package/dist/config/ui.d.ts +43 -0
  17. package/dist/config/ui.d.ts.map +1 -0
  18. package/dist/config.mjs +2373 -0
  19. package/dist/config.mjs.map +1 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.mjs +3200 -150
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/live-session/logic.d.ts +2 -0
  25. package/dist/live-session/logic.d.ts.map +1 -1
  26. package/dist/live-session/panel.d.ts.map +1 -1
  27. package/dist/live-session/panel.mjs +52 -74
  28. package/dist/live-session/panel.mjs.map +1 -1
  29. package/dist/live-session.mjs +51 -75
  30. package/dist/live-session.mjs.map +1 -1
  31. package/dist/panel-bridge.d.ts +11 -6
  32. package/dist/panel-bridge.d.ts.map +1 -1
  33. package/dist/session-chat/blob-embed.d.ts +53 -0
  34. package/dist/session-chat/blob-embed.d.ts.map +1 -0
  35. package/dist/session-chat/index.d.ts +13 -0
  36. package/dist/session-chat/index.d.ts.map +1 -1
  37. package/dist/session-chat/panel.d.ts +38 -2
  38. package/dist/session-chat/panel.d.ts.map +1 -1
  39. package/dist/session-chat/panel.mjs +556 -6
  40. package/dist/session-chat/panel.mjs.map +1 -1
  41. package/dist/session-chat.mjs +591 -14
  42. package/dist/session-chat.mjs.map +1 -1
  43. package/dist/session-story/panel.mjs +39 -67
  44. package/dist/session-story/panel.mjs.map +1 -1
  45. package/dist/session-story.mjs +38 -68
  46. package/dist/session-story.mjs.map +1 -1
  47. package/dist/session-viewer/ui.d.ts.map +1 -1
  48. package/dist/session-viewer.mjs +10 -0
  49. package/dist/session-viewer.mjs.map +1 -1
  50. package/dist/sessions-panel/panel.d.ts.map +1 -1
  51. package/dist/sessions-panel/panel.mjs +40 -67
  52. package/dist/sessions-panel/panel.mjs.map +1 -1
  53. package/dist/sessions-panel.mjs +39 -68
  54. package/dist/sessions-panel.mjs.map +1 -1
  55. package/dist/work-board/panel.d.ts +1 -1
  56. package/dist/work-board/panel.d.ts.map +1 -1
  57. package/dist/work-board/panel.generated.d.ts +1 -1
  58. package/dist/work-board/panel.generated.d.ts.map +1 -1
  59. package/dist/work-board/panel.mjs +318 -62
  60. package/dist/work-board/panel.mjs.map +1 -1
  61. package/dist/work-board.mjs +318 -62
  62. package/dist/work-board.mjs.map +1 -1
  63. package/package.json +12 -4
  64. package/repo-maintenance/.agentproto/APP.md +22 -0
  65. package/repo-maintenance/.agentproto/agents/repo-maintenance-reviewer/AGENT.md +142 -0
  66. package/repo-maintenance/.agentproto/workflows/maintain/WORKFLOW.md +262 -0
  67. package/repo-maintenance/.agentproto/workflows/maintain/entry.mjs +672 -0
  68. package/repo-maintenance/README.md +79 -0
  69. package/repo-maintenance/routines/repo-maintenance-daily/ROUTINE.md +77 -0
  70. package/repo-maintenance/routines/repo-maintenance-weekly/ROUTINE.md +82 -0
@@ -34,6 +34,7 @@ import { type AppHandle } from "@agentproto/app-kit";
34
34
  import type { AgnoMcpApp } from "../mcp-app-types.js";
35
35
  import { SESSION_CHAT_FALLBACK_HTML, sessionChatEmbedHtml } from "./panel.js";
36
36
  export { SESSION_CHAT_FALLBACK_HTML, sessionChatEmbedHtml };
37
+ export { BLOB_BOOT_MESSAGE_TYPE, blobEmbedScript } from "./blob-embed.js";
37
38
  /** The installed studio app this builtin widget is a launcher for. */
38
39
  export declare const SESSION_CHAT_APP_ID = "@agentik/session-chat";
39
40
  export declare const sessionChatInputSchema: z.ZodObject<{
@@ -46,6 +47,13 @@ export interface SessionChatOutput {
46
47
  installed: boolean;
47
48
  /** The app's standalone deep-link url when installed, else null. */
48
49
  url: string | null;
50
+ /** A live per-boot embed token, when the host daemon supplies one (see
51
+ * `SessionChatOps.mintEmbedToken`). The panel adopts it over the token
52
+ * baked into its resource HTML, which dies with the daemon boot that
53
+ * rendered it — hosts that cache the widget per conversation (Claude
54
+ * Desktop) otherwise replay a dead token and 403 forever after a daemon
55
+ * restart. Absent when the deep link is unavailable anyway. */
56
+ embedToken?: string;
49
57
  }
50
58
  export interface SessionChatOps {
51
59
  /** The daemon's own HTTP origin, e.g. "http://127.0.0.1:18790" — the
@@ -55,6 +63,11 @@ export interface SessionChatOps {
55
63
  * block. The runtime supplies this from its AppRegistry; optional so
56
64
  * tests/consumers without a registry can omit it (treated as false). */
57
65
  isSessionChatInstalled?: () => boolean;
66
+ /** A live per-boot embed token for the panel to adopt (runtime
67
+ * embed-tokens.ts `stableAppEmbedToken`). Optional: consumers without a
68
+ * token registry (tests, docs) omit it and the panel keeps whatever was
69
+ * baked into its HTML. */
70
+ mintEmbedToken?: () => string;
58
71
  }
59
72
  /**
60
73
  * Deep-link into the installed app's standalone UI — the same url shape the
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session-chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KA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AE7E,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,CAAA;AAC3D,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEzE,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,0BAA0B,CAAA;AAE1D,eAAO,MAAM,sBAAsB;;iBAQjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,MAAM,WAAW,iBAAiB;IAChC;gDAC4C;IAC5C,SAAS,EAAE,OAAO,CAAA;IAClB,oEAAoE;IACpE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB;;;;;oEAKgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B;0DACsD;IACtD,WAAW,EAAE,MAAM,CAAA;IACnB;;6EAEyE;IACzE,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAA;IACtC;;;+BAG2B;IAC3B,cAAc,CAAC,EAAE,MAAM,MAAM,CAAA;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAMjF;AAWD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,GAClB,UAAU,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAmCjD;AAED,eAAO,MAAM,cAAc,EAAE,SA0B3B,CAAA"}
@@ -4,7 +4,9 @@
4
4
  * (`SESSION_CHAT_FALLBACK_HTML`) served as the
5
5
  * `ui://agentproto_session_chat/view` resource by `registerMcpApps` (see
6
6
  * ../mcp-app-types.ts and runtime's mcp-apps-adapter.ts). Mounted via the
7
- * `agentproto_session_chat` tool defined in ./index.ts.
7
+ * `agentproto_session_chat` tool defined in ./index.ts, AND bound to
8
+ * `agent_start` (runtime agent-tools.ts `_meta.ui.resourceUri`) so a launch
9
+ * card opens the chat of the session it just spawned.
8
10
  *
9
11
  * Deliberately NOT a chat UI reimplementation: the real chat lives in the
10
12
  * installed `@agentik/session-chat` app, served by the daemon's standalone
@@ -15,6 +17,40 @@
15
17
  * http-server.ts handleAppUiPage) and the VS Code chat-panel webview
16
18
  * already uses. No second chat bundle exists anywhere in agentproto/ts.
17
19
  *
20
+ * Self-bootstrapping (same pattern as live-session/panel.ts): the static
21
+ * ui:// resource is rendered ONCE at server-registration time with EMPTY
22
+ * initData (mcp-apps-adapter.ts registerMcpApps), so the deep link can't
23
+ * be baked in. The page resolves it at runtime, in priority order:
24
+ * 1. `initData.url` when the html was rendered with a real tool output
25
+ * (tests, and any host that re-renders per call) — iframe is inline.
26
+ * 2. The host's `ui/notifications/tool-result` push of the tool call that
27
+ * mounted the widget. An `agent_start` result IS the spawned session's
28
+ * descriptor (`{ id: "sess_…", … }`) → the widget calls
29
+ * `agentproto_session_chat({ sessionId })` over the bridge to turn that
30
+ * id into the deep link; an `agentproto_session_chat` result already
31
+ * carries `{ installed, url }` and mounts directly.
32
+ * 3. Otherwise (opened bare from the catalog) `agentproto_session_chat({})`
33
+ * → the app's session picker.
34
+ * Both orders of (2) vs. bridge init are handled: a result that lands
35
+ * before `initBridge()` resolves is held and applied once it does.
36
+ *
37
+ * Mount order (see `mount()` below):
38
+ * 1. Blob pass-through, when a per-boot embed token is baked in (i.e. an
39
+ * MCP-Apps host rendered this resource): fetch the chat html with the
40
+ * token, rewrite it (./blob-embed.ts `transformChatHtmlForBlob`) and
41
+ * mount it as a `blob:` document. Claude Desktop / Codex widget frames
42
+ * run `frame-src 'self' blob: data:` and do not merge our declared
43
+ * `csp.frameDomains`, so a direct daemon iframe is refused host-side —
44
+ * `blob:` is the pass-through. The blob document must post a boot ack
45
+ * within a settle window (`armBlobBootProbe`); a missing ack (host CSP
46
+ * killed its inline scripts, or refused the blob frame) tears it down
47
+ * and falls through to 2.
48
+ * 2. Direct-src iframe of the deep link (VS Code HTTP-iframe panels, a
49
+ * standalone tab — no token, and their origin already passes the
50
+ * daemon's checks; or the blob path's fallback). If the host refuses
51
+ * the frame, `armBlockProbe` removes it and the launcher card becomes
52
+ * the interactive surface.
53
+ *
18
54
  * A persistent header with the deep link stays visible above the iframe, so
19
55
  * if the frame is refused (older daemon without the embed relaxation, or a
20
56
  * host whose own CSP blocks daemon frames) the user still has a one-click
@@ -23,6 +59,6 @@
23
59
  * fallback branch, never a vendored UI.
24
60
  */
25
61
  import type { SessionChatOutput } from "./index.js";
26
- export declare function sessionChatEmbedHtml(initData: SessionChatOutput): string;
62
+ export declare function sessionChatEmbedHtml(initData: Partial<SessionChatOutput>): string;
27
63
  export declare const SESSION_CHAT_FALLBACK_HTML = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<title>Session Chat \u2014 not installed</title>\n<style>\n*{box-sizing:border-box;margin:0;padding:0}\nhtml,body{height:100%;font-family:system-ui,-apple-system,sans-serif;background:#0d1117;color:#e6edf3}\n#wrap{max-width:560px;margin:0 auto;padding:48px 24px;line-height:1.6}\nh1{font-size:18px;margin-bottom:12px}\ncode{background:#161b22;border:1px solid #30363d;border-radius:4px;padding:2px 6px;font-size:13px}\np{margin:8px 0;color:#8b949e;font-size:13px}\n</style>\n</head>\n<body>\n<div id=\"wrap\">\n <h1>Session Chat is not installed</h1>\n <p>This panel is a thin launcher for the <code>@agentik/session-chat</code> app &#8212;\n it does not bundle the chat UI itself.</p>\n <p>To use it, install the app into this daemon:</p>\n <p><code>agentproto app install @agentik/session-chat</code></p>\n <p>Once installed, call <code>agentproto_session_chat</code> again (optionally with a\n <code>sessionId</code>) and the panel will embed the app's chat UI deep-linked to that\n session.</p>\n</div>\n</body>\n</html>";
28
64
  //# sourceMappingURL=panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/session-chat/panel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAOnD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CA6BxE;AAED,eAAO,MAAM,0BAA0B,gqCA2B/B,CAAA"}
1
+ {"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/session-chat/panel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAOnD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,MAAM,CA0XjF;AAED,eAAO,MAAM,0BAA0B,gqCA2B/B,CAAA"}