my-durable 0.0.0-stage → 0.0.2

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 (259) hide show
  1. package/.env.example +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +328 -2
  4. package/ai_docs/durable_pi/announcement.md +860 -0
  5. package/ai_docs/durable_pi/changelog.md +51 -0
  6. package/ai_docs/durable_pi/chord-delta-findings.md +362 -0
  7. package/ai_docs/durable_pi/coding-agent-integration.md +70 -0
  8. package/ai_docs/durable_pi/pico-v5-chord-usage.md +391 -0
  9. package/ai_docs/durable_pi/pico-v5-handoff.md +921 -0
  10. package/ai_docs/durable_pi/readme.md +617 -0
  11. package/ai_docs/durable_pi/sources.md +22 -0
  12. package/ai_docs/durable_pi/spec.md +4696 -0
  13. package/ai_docs/durable_pi/vacation-planner.md +57 -0
  14. package/ai_docs/pi/chord.md +268 -0
  15. package/ai_docs/pi/cli-integration.md +110 -0
  16. package/ai_docs/pi/cli.md +325 -0
  17. package/ai_docs/pi/codemode.md +211 -0
  18. package/ai_docs/pi/compaction.md +467 -0
  19. package/ai_docs/pi/configuration.md +51 -0
  20. package/ai_docs/pi/containerization.md +187 -0
  21. package/ai_docs/pi/custom-provider.md +177 -0
  22. package/ai_docs/pi/environment-variables.md +102 -0
  23. package/ai_docs/pi/extensions.md +278 -0
  24. package/ai_docs/pi/how-pi-works.md +53 -0
  25. package/ai_docs/pi/index.md +43 -0
  26. package/ai_docs/pi/json.md +230 -0
  27. package/ai_docs/pi/keybindings.md +198 -0
  28. package/ai_docs/pi/llama-cpp.md +118 -0
  29. package/ai_docs/pi/mcp.md +274 -0
  30. package/ai_docs/pi/message-types.md +265 -0
  31. package/ai_docs/pi/models.md +209 -0
  32. package/ai_docs/pi/overview.md +166 -0
  33. package/ai_docs/pi/packages.md +133 -0
  34. package/ai_docs/pi/pi-agent-core.md +568 -0
  35. package/ai_docs/pi/pi-ai.md +1942 -0
  36. package/ai_docs/pi/prompt-templates.md +63 -0
  37. package/ai_docs/pi/providers.md +204 -0
  38. package/ai_docs/pi/quickstart.md +140 -0
  39. package/ai_docs/pi/readme.md +99 -0
  40. package/ai_docs/pi/rpc-commands.md +864 -0
  41. package/ai_docs/pi/rpc-extension-ui.md +204 -0
  42. package/ai_docs/pi/rpc.md +197 -0
  43. package/ai_docs/pi/sdk.md +151 -0
  44. package/ai_docs/pi/security.md +103 -0
  45. package/ai_docs/pi/session-format.md +297 -0
  46. package/ai_docs/pi/sessions.md +70 -0
  47. package/ai_docs/pi/settings.md +173 -0
  48. package/ai_docs/pi/shell-aliases.md +97 -0
  49. package/ai_docs/pi/skills.md +97 -0
  50. package/ai_docs/pi/slash-commands.md +64 -0
  51. package/ai_docs/pi/sources.md +57 -0
  52. package/ai_docs/pi/terminal-setup.md +223 -0
  53. package/ai_docs/pi/termux.md +121 -0
  54. package/ai_docs/pi/themes.md +140 -0
  55. package/ai_docs/pi/tmux.md +59 -0
  56. package/ai_docs/pi/toolkit.md +168 -0
  57. package/ai_docs/pi/tui.md +129 -0
  58. package/ai_docs/pi/usage.md +98 -0
  59. package/ai_docs/pi/virtual-models.md +118 -0
  60. package/ai_docs/pi/windows.md +71 -0
  61. package/apps/dpi-backend/.nvmrc +1 -0
  62. package/apps/dpi-backend/API.md +99 -0
  63. package/apps/dpi-backend/README.md +119 -0
  64. package/apps/dpi-backend/deploy/backend.env.example +9 -0
  65. package/apps/dpi-backend/deploy/dpi-backend.plist +26 -0
  66. package/apps/dpi-backend/deploy/dpi-backend.service +22 -0
  67. package/apps/dpi-backend/package.json +33 -0
  68. package/apps/dpi-backend/prompts/one_sentence.md +3 -0
  69. package/apps/dpi-backend/prompts/smart_ass_opus_fix.md +169 -0
  70. package/apps/dpi-backend/scripts/check-contract.mjs +151 -0
  71. package/apps/dpi-backend/scripts/migrate-playground.ts +66 -0
  72. package/apps/dpi-backend/scripts/record-nested-fixture.mts +154 -0
  73. package/apps/dpi-backend/scripts/token.ts +57 -0
  74. package/apps/dpi-backend/src/addons.ts +139 -0
  75. package/apps/dpi-backend/src/auth.ts +20 -0
  76. package/apps/dpi-backend/src/config.ts +54 -0
  77. package/apps/dpi-backend/src/contract-check.ts +118 -0
  78. package/apps/dpi-backend/src/errors.ts +50 -0
  79. package/apps/dpi-backend/src/extensions.ts +510 -0
  80. package/apps/dpi-backend/src/faux.ts +80 -0
  81. package/apps/dpi-backend/src/history.ts +165 -0
  82. package/apps/dpi-backend/src/idempotency.ts +20 -0
  83. package/apps/dpi-backend/src/jev.ts +43 -0
  84. package/apps/dpi-backend/src/jobs.ts +790 -0
  85. package/apps/dpi-backend/src/main.ts +76 -0
  86. package/apps/dpi-backend/src/model-catalog.ts +180 -0
  87. package/apps/dpi-backend/src/pairing-files.ts +142 -0
  88. package/apps/dpi-backend/src/pairing.ts +459 -0
  89. package/apps/dpi-backend/src/routes.ts +217 -0
  90. package/apps/dpi-backend/src/shared-state.ts +85 -0
  91. package/apps/dpi-backend/src/store.ts +1240 -0
  92. package/apps/dpi-backend/src/streams.ts +256 -0
  93. package/apps/dpi-backend/src/tunnel.ts +955 -0
  94. package/apps/dpi-backend/tsconfig.json +13 -0
  95. package/apps/dpi-playground/README.md +83 -0
  96. package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-CFGc7lHT.js +77 -0
  97. package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-DFdKpwm_.css +1 -0
  98. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/anthropic.png +0 -0
  99. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/deepseek.png +0 -0
  100. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/durable-pi.svg +14 -0
  101. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/gemini.png +0 -0
  102. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/grok.png +0 -0
  103. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/kimi.png +0 -0
  104. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/lab.png +0 -0
  105. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/meta.png +0 -0
  106. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/minimax.png +0 -0
  107. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/openai.png +0 -0
  108. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/qwen.png +0 -0
  109. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/xiaomi.png +0 -0
  110. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/zai.png +0 -0
  111. package/apps/dpi-playground/apps/dpi-playground-fe/dist/index.html +16 -0
  112. package/apps/dpi-playground/apps/dpi-playground-fe/index.html +15 -0
  113. package/apps/dpi-playground/apps/dpi-playground-fe/package.json +5 -0
  114. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/anthropic.png +0 -0
  115. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/deepseek.png +0 -0
  116. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/durable-pi.svg +14 -0
  117. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/gemini.png +0 -0
  118. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/grok.png +0 -0
  119. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/kimi.png +0 -0
  120. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/lab.png +0 -0
  121. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/meta.png +0 -0
  122. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/minimax.png +0 -0
  123. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/openai.png +0 -0
  124. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/qwen.png +0 -0
  125. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/xiaomi.png +0 -0
  126. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/zai.png +0 -0
  127. package/apps/dpi-playground/apps/dpi-playground-fe/src/App.vue +180 -0
  128. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/commands.ts +119 -0
  129. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/composables.ts +129 -0
  130. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/hub.ts +40 -0
  131. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/icon-path.ts +7 -0
  132. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/ids.ts +2 -0
  133. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/jobs.ts +80 -0
  134. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/link-policy.ts +16 -0
  135. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/markdown-policy.ts +115 -0
  136. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/markdown.ts +60 -0
  137. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/pair-close.ts +23 -0
  138. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/pair-handoff.ts +56 -0
  139. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/pair.ts +166 -0
  140. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/qrcode.ts +323 -0
  141. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/signature.ts +146 -0
  142. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/store.ts +373 -0
  143. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/stream.ts +183 -0
  144. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/AgentView.vue +342 -0
  145. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/Composer.vue +198 -0
  146. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/ContextBar.vue +254 -0
  147. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/DeviceCredentialsDialog.vue +40 -0
  148. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/DeviceIcon.vue +56 -0
  149. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/DirBrowser.vue +95 -0
  150. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/ExtensionsPanel.vue +96 -0
  151. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/HelpDialog.vue +69 -0
  152. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/Inspector.vue +425 -0
  153. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/JobCard.vue +221 -0
  154. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/MobileNav.vue +39 -0
  155. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/ModelPicker.vue +71 -0
  156. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/NetworkSidebar.vue +236 -0
  157. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/NewSessionDialog.vue +114 -0
  158. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/OfflinePanel.vue +128 -0
  159. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/PairDeviceWizard.vue +433 -0
  160. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/PromptDialog.vue +89 -0
  161. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/StateEditor.vue +179 -0
  162. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TasksPanel.vue +280 -0
  163. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/Toast.vue +11 -0
  164. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TokenManager.vue +175 -0
  165. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TopBar.vue +114 -0
  166. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TranscriptItem.vue +152 -0
  167. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TreeRow.vue +195 -0
  168. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TunnelStatusBar.vue +107 -0
  169. package/apps/dpi-playground/apps/dpi-playground-fe/src/extensions.css +105 -0
  170. package/apps/dpi-playground/apps/dpi-playground-fe/src/jobs.css +655 -0
  171. package/apps/dpi-playground/apps/dpi-playground-fe/src/main.ts +22 -0
  172. package/apps/dpi-playground/apps/dpi-playground-fe/src/network.css +675 -0
  173. package/apps/dpi-playground/apps/dpi-playground-fe/src/style.css +3203 -0
  174. package/apps/dpi-playground/apps/dpi-playground-fe/tsconfig.json +16 -0
  175. package/apps/dpi-playground/apps/dpi-playground-fe/vite.config.ts +14 -0
  176. package/apps/dpi-playground/apps/dpi-playground-hub/package.json +5 -0
  177. package/apps/dpi-playground/apps/dpi-playground-hub/src/audit.ts +406 -0
  178. package/apps/dpi-playground/apps/dpi-playground-hub/src/client-ip.ts +72 -0
  179. package/apps/dpi-playground/apps/dpi-playground-hub/src/credentials.ts +265 -0
  180. package/apps/dpi-playground/apps/dpi-playground-hub/src/guard.ts +43 -0
  181. package/apps/dpi-playground/apps/dpi-playground-hub/src/http-errors.ts +156 -0
  182. package/apps/dpi-playground/apps/dpi-playground-hub/src/identity.ts +60 -0
  183. package/apps/dpi-playground/apps/dpi-playground-hub/src/limiter.ts +165 -0
  184. package/apps/dpi-playground/apps/dpi-playground-hub/src/main.ts +460 -0
  185. package/apps/dpi-playground/apps/dpi-playground-hub/src/monitor.ts +320 -0
  186. package/apps/dpi-playground/apps/dpi-playground-hub/src/mux.ts +277 -0
  187. package/apps/dpi-playground/apps/dpi-playground-hub/src/pairing.ts +816 -0
  188. package/apps/dpi-playground/apps/dpi-playground-hub/src/proxy.ts +128 -0
  189. package/apps/dpi-playground/apps/dpi-playground-hub/src/rotation.ts +583 -0
  190. package/apps/dpi-playground/apps/dpi-playground-hub/src/seed.ts +11 -0
  191. package/apps/dpi-playground/apps/dpi-playground-hub/src/transport.ts +108 -0
  192. package/apps/dpi-playground/apps/dpi-playground-hub/src/tunnel-token.ts +11 -0
  193. package/apps/dpi-playground/apps/dpi-playground-hub/src/tunnel-transport.ts +560 -0
  194. package/apps/dpi-playground/apps/dpi-playground-hub/src/tunnel.ts +873 -0
  195. package/apps/dpi-playground/apps/dpi-playground-hub/tsconfig.json +13 -0
  196. package/apps/dpi-playground/package.json +37 -0
  197. package/apps/dpi-sdk/README.md +74 -0
  198. package/apps/dpi-sdk/package.json +20 -0
  199. package/apps/dpi-sdk/scripts/net.ts +73 -0
  200. package/apps/dpi-sdk/src/api.ts +631 -0
  201. package/apps/dpi-sdk/src/app-state.ts +111 -0
  202. package/apps/dpi-sdk/src/client.ts +330 -0
  203. package/apps/dpi-sdk/src/errors.ts +16 -0
  204. package/apps/dpi-sdk/src/jobs.ts +99 -0
  205. package/apps/dpi-sdk/src/models.ts +472 -0
  206. package/apps/dpi-sdk/src/node/chunk.ts +488 -0
  207. package/apps/dpi-sdk/src/node/config.ts +175 -0
  208. package/apps/dpi-sdk/src/node/drivers.ts +402 -0
  209. package/apps/dpi-sdk/src/node/ops.ts +114 -0
  210. package/apps/dpi-sdk/src/node/private-dir.ts +48 -0
  211. package/apps/dpi-sdk/src/node/registry-migration.ts +549 -0
  212. package/apps/dpi-sdk/src/node/registry.ts +390 -0
  213. package/apps/dpi-sdk/src/node/sse-writer.ts +151 -0
  214. package/apps/dpi-sdk/src/protocol/backoff.ts +31 -0
  215. package/apps/dpi-sdk/src/protocol/limits.ts +199 -0
  216. package/apps/dpi-sdk/src/protocol/pairing.ts +311 -0
  217. package/apps/dpi-sdk/src/protocol/rest-routes.ts +105 -0
  218. package/apps/dpi-sdk/src/protocol/tunnel.ts +331 -0
  219. package/apps/dpi-sdk/src/sse.ts +117 -0
  220. package/apps/dpi-sdk/src/transcript.ts +291 -0
  221. package/apps/dpi-sdk/tsconfig.json +13 -0
  222. package/apps/dpi-sdk/w +20 -0
  223. package/apps/dpi-tui/README.md +54 -0
  224. package/apps/dpi-tui/bin/dpi-tui.mjs +5 -0
  225. package/apps/dpi-tui/package.json +20 -0
  226. package/apps/dpi-tui/src/app.ts +433 -0
  227. package/apps/dpi-tui/src/commands.ts +151 -0
  228. package/apps/dpi-tui/src/main.ts +122 -0
  229. package/apps/dpi-tui/src/pairing.ts +287 -0
  230. package/apps/dpi-tui/src/pickers.ts +238 -0
  231. package/apps/dpi-tui/src/render.ts +164 -0
  232. package/apps/dpi-tui/src/theme.ts +57 -0
  233. package/apps/dpi-tui/tsconfig.json +14 -0
  234. package/bin/device.mjs +5 -0
  235. package/bin/hub.mjs +5 -0
  236. package/bin/tui.mjs +5 -0
  237. package/deploy/Caddyfile +120 -0
  238. package/docs/verification.md +102 -0
  239. package/dpi-network.example.yaml +62 -0
  240. package/images/01_durable_agent_network.svg +185 -0
  241. package/images/02_pi_made_durable.svg +204 -0
  242. package/images/03_restart_mid_tool.svg +168 -0
  243. package/images/07_one_api_every_client.svg +123 -0
  244. package/images/08_device_session_agent.svg +123 -0
  245. package/images/09_compact_keep_history.svg +143 -0
  246. package/images/10_shared_app_state.svg +177 -0
  247. package/images/11_durable_jobs_wait.svg +141 -0
  248. package/images/12_tools_change_mid_run.svg +231 -0
  249. package/images/13_hook_blocks_tool.svg +122 -0
  250. package/images/14_fork_at_any_entry.svg +119 -0
  251. package/images/15_web_client.png +0 -0
  252. package/images/16_terminal_client.svg +43 -0
  253. package/images/17_devices_are_data.svg +182 -0
  254. package/images/18_should_every_agent_be_durable.svg +118 -0
  255. package/images/19_sqlite_on_every_device.svg +155 -0
  256. package/images/20_admission_and_effects.svg +134 -0
  257. package/justfile +33 -0
  258. package/package.json +41 -4
  259. package/scripts/verify.mjs +210 -0
@@ -0,0 +1,152 @@
1
+ <script setup lang="ts">
2
+ import { Activity, Braces, Check, GitFork, Info, Layers, Wrench } from "lucide-vue-next";
3
+ import type { TranscriptItem, ToolCallView } from "@sdk/transcript";
4
+ import { markdown } from "../client/markdown";
5
+ import { json } from "../client/store";
6
+ import { runByCall, runById } from "../client/jobs";
7
+ import JobCard from "./JobCard.vue";
8
+
9
+ defineProps<{ item: TranscriptItem }>();
10
+ const emit = defineEmits<{ fork: [entryId: number] }>();
11
+ const statusLabel = (call: ToolCallView) =>
12
+ call.status === "error" ? "Error" : call.status === "done" ? "Done" : call.status;
13
+ const entryClass = (item: TranscriptItem) =>
14
+ item.kind === "user"
15
+ ? "pi-user"
16
+ : item.kind === "assistant"
17
+ ? item.streaming
18
+ ? "live-generation"
19
+ : "pi-assistant"
20
+ : item.kind === "tool-result"
21
+ ? "pi-tool-result"
22
+ : item.kind === "tool"
23
+ ? "live-tool-entry"
24
+ : item.entryKind.replaceAll(".", "-");
25
+ </script>
26
+
27
+ <template>
28
+ <article class="entry" :class="entryClass(item)">
29
+ <template v-if="item.kind === 'user'"
30
+ ><div class="message-label">
31
+ YOU <span>#{{ item.id }}</span>
32
+ </div>
33
+ <div class="user-message">{{ item.text }}</div></template
34
+ >
35
+ <template v-else-if="item.kind === 'assistant'"
36
+ ><div class="message-label">
37
+ AGENT
38
+ <span v-if="item.streaming" class="streaming">Working</span
39
+ ><span v-else>#{{ item.id }}</span
40
+ ><button
41
+ v-if="!item.streaming"
42
+ class="fork-button"
43
+ :aria-label="`Fork at entry ${item.id}`"
44
+ title="Fork from this entry. App State stays shared."
45
+ @click="emit('fork', item.id as number)"
46
+ >
47
+ <GitFork :size="18" />Fork
48
+ </button>
49
+ </div>
50
+ <template v-for="(b, j) in item.blocks" :key="j"
51
+ ><div v-if="b.type === 'text'" class="markdown" v-html="markdown(b.text)" />
52
+ <details v-else-if="b.type === 'thinking'" class="thinking">
53
+ <summary>Thinking</summary>
54
+ <div>{{ b.text }}</div>
55
+ </details>
56
+ <details
57
+ v-else
58
+ class="tool-call"
59
+ :class="{ failed: b.call.status === 'error' }"
60
+ :data-call-id="b.call.callId"
61
+ >
62
+ <summary>
63
+ <Info v-if="b.call.status === 'error'" :size="18" />
64
+ <Check v-else-if="b.call.status === 'done'" :size="18" />
65
+ <Activity v-else-if="b.call.status === 'running'" :size="18" />
66
+ <Wrench v-else :size="18" /><strong>{{ b.call.name }}</strong
67
+ ><code>{{ json(b.call.args)?.slice(0, 90) }}</code>
68
+ <span class="tool-status">{{ statusLabel(b.call) }}</span>
69
+ </summary>
70
+ <div class="tool-section-label">Input</div>
71
+ <pre>{{ json(b.call.args) }}</pre>
72
+ <template v-if="b.call.result !== undefined">
73
+ <div class="tool-section-label">
74
+ <span>Result</span>
75
+ <button
76
+ v-if="b.call.resultEntryId !== undefined"
77
+ class="fork-button"
78
+ :aria-label="`Fork at entry ${b.call.resultEntryId}`"
79
+ title="Fork after this result"
80
+ @click="emit('fork', b.call.resultEntryId!)"
81
+ >
82
+ <GitFork :size="18" />Fork
83
+ </button>
84
+ </div>
85
+ <pre>{{ b.call.result }}</pre>
86
+ </template>
87
+ <template v-else-if="b.call.output">
88
+ <div class="tool-section-label">Live output</div>
89
+ <pre>{{ b.call.output }}</pre>
90
+ </template>
91
+ </details>
92
+ <JobCard
93
+ v-if="b.type === 'tool' && b.call.name === 'run_durable_job' && runByCall(b.call.callId)"
94
+ :run="runByCall(b.call.callId)!"
95
+ /></template>
96
+ <div v-if="item.streaming && !item.blocks.length" class="typing"><i /><i /><i /></div>
97
+ <div v-if="item.error" class="message-error">{{ item.error }}</div></template
98
+ >
99
+ <template v-else-if="item.kind === 'tool-result'"
100
+ ><details class="tool-result" :class="{ failed: item.isError }">
101
+ <summary>
102
+ <Check v-if="!item.isError" :size="18" /><Info v-else :size="18" /><strong>{{
103
+ item.name
104
+ }}</strong
105
+ ><span>{{ item.isError ? "error" : "result" }}</span
106
+ ><button
107
+ class="fork-button"
108
+ :aria-label="`Fork at entry ${item.id}`"
109
+ @click.prevent="emit('fork', item.id)"
110
+ >
111
+ <GitFork :size="18" />Fork
112
+ </button>
113
+ </summary>
114
+ <pre>{{ item.text }}</pre>
115
+ </details></template
116
+ >
117
+ <div v-else-if="item.kind === 'tool'" class="live-tool">
118
+ <div>
119
+ <Activity :size="18" /><strong>{{ item.call.name }}</strong
120
+ ><span>{{ item.call.status }}</span>
121
+ </div>
122
+ <pre v-if="item.call.output">{{ item.call.output }}</pre>
123
+ <JobCard
124
+ v-if="item.call.name === 'run_durable_job' && runByCall(item.call.callId)"
125
+ :run="runByCall(item.call.callId)!"
126
+ />
127
+ </div>
128
+ <JobCard
129
+ v-else-if="item.entryKind === 'demo.job' && runById((item.data as { taskId: number }).taskId)"
130
+ :run="runById((item.data as { taskId: number }).taskId)!"
131
+ />
132
+ <template v-else
133
+ ><div class="event-line">
134
+ <Braces v-if="item.entryKind === 'demo.state-change'" :size="18" /><Layers
135
+ v-else
136
+ :size="18"
137
+ /><span>{{ item.text }}</span
138
+ ><button
139
+ class="fork-button"
140
+ :aria-label="`Fork at entry ${item.id}`"
141
+ @click="emit('fork', item.id)"
142
+ >
143
+ <GitFork :size="18" />Fork
144
+ </button>
145
+ </div>
146
+ <details v-if="item.note" class="raw">
147
+ <summary>Context note</summary>
148
+ <pre>{{ item.note }}</pre>
149
+ </details></template
150
+ >
151
+ </article>
152
+ </template>
@@ -0,0 +1,195 @@
1
+ <script setup lang="ts">
2
+ import { computed } from "vue";
3
+ import {
4
+ ChevronDown,
5
+ ChevronRight,
6
+ CornerDownRight,
7
+ FolderOpen,
8
+ GitFork,
9
+ MessageSquare,
10
+ Pencil,
11
+ Plus,
12
+ RefreshCw,
13
+ Archive,
14
+ KeyRound,
15
+ } from "lucide-vue-next";
16
+ import DeviceIcon from "./DeviceIcon.vue";
17
+ import type { TreeNode } from "@sdk/models";
18
+ import { ago } from "../client/store";
19
+
20
+ const props = defineProps<{
21
+ node: TreeNode;
22
+ depth: number;
23
+ open: boolean;
24
+ selected: boolean;
25
+ focused: boolean;
26
+ online: boolean;
27
+ }>();
28
+ const emit = defineEmits<{ toggle: []; activate: []; action: [name: string] }>();
29
+
30
+ const hasChildren = computed(() => props.node.children.length > 0);
31
+ const device = computed(() => (props.node.type === "device" ? props.node.device : undefined));
32
+ const session = computed(() => (props.node.type === "session" ? props.node.session : undefined));
33
+ const agent = computed(() => (props.node.type === "agent" ? props.node.agent : undefined));
34
+ const background = computed(() =>
35
+ session.value
36
+ ? session.value.agents.reduce((n, a) => n + a.background, 0)
37
+ : (agent.value?.background ?? 0),
38
+ );
39
+ const busy = computed(() => session.value?.busy || agent.value?.busy);
40
+ const statusText = computed(() => {
41
+ const d = device.value;
42
+ if (!d) return "";
43
+ const count = d.tree?.sessions.length ?? 0;
44
+ switch (d.status) {
45
+ case "online":
46
+ return `${count} session${count === 1 ? "" : "s"}`;
47
+ case "checking":
48
+ return "checking…";
49
+ case "unauthorized":
50
+ return d.hasToken ? "token rejected" : "no token";
51
+ case "mismatch":
52
+ return "identity changed";
53
+ case "incompatible":
54
+ return "incompatible";
55
+ default:
56
+ return `offline · ${ago(d.lastSeenAt)}`;
57
+ }
58
+ });
59
+ const dot = computed(() => {
60
+ const s = device.value?.status;
61
+ return s === "online" ? "on" : s === "checking" ? "chk" : s === "offline" ? "off" : "err";
62
+ });
63
+ const label = computed(() => device.value?.id ?? session.value?.name ?? agent.value?.name ?? "");
64
+ const title = computed(() => {
65
+ if (device.value)
66
+ return `${device.value.name} · ${device.value.url}${device.value.error ? `\n${device.value.error}` : ""}`;
67
+ if (session.value) return `${session.value.name}\n${session.value.cwd}`;
68
+ const a = agent.value!;
69
+ return a.kind === "fork"
70
+ ? `Fork of agent #${a.parentId} at entry #${a.forkedAt}`
71
+ : a.kind === "subagent"
72
+ ? `Subagent owned by agent #${a.ownerAgentId}`
73
+ : "Root agent";
74
+ });
75
+ </script>
76
+
77
+ <template>
78
+ <div
79
+ class="tree-row"
80
+ :class="[node.type, { sel: selected, focus: focused, stale: node.stale }]"
81
+ :style="{ '--depth': depth }"
82
+ role="treeitem"
83
+ :aria-level="depth + 1"
84
+ :aria-expanded="hasChildren ? open : undefined"
85
+ :aria-selected="selected"
86
+ :data-key="node.key"
87
+ :title="title"
88
+ @click="emit('activate')"
89
+ >
90
+ <button
91
+ v-if="hasChildren"
92
+ class="chev"
93
+ tabindex="-1"
94
+ :aria-label="open ? `Collapse ${label}` : `Expand ${label}`"
95
+ @click.stop="emit('toggle')"
96
+ >
97
+ <ChevronDown v-if="open" :size="16" /><ChevronRight v-else :size="16" />
98
+ </button>
99
+ <span v-else class="chev" />
100
+ <template v-if="device">
101
+ <i class="dot" :class="dot" />
102
+ <DeviceIcon :device="device" :size="16" />
103
+ <b class="name">{{ label }}</b>
104
+ <span class="badge">{{ device.kind }}</span>
105
+ <span class="meta" :class="{ err: dot === 'err' }">{{ statusText }}</span>
106
+ <span class="acts" @click.stop>
107
+ <button
108
+ v-if="device.pairing"
109
+ class="icon-button"
110
+ :aria-label="`Manage credentials for ${label}`"
111
+ title="Manage device credentials, including while offline"
112
+ @click="emit('action', 'credentials')"
113
+ >
114
+ <KeyRound :size="16" />
115
+ </button>
116
+ <button
117
+ class="icon-button"
118
+ :disabled="!online"
119
+ :aria-label="`New session on ${label}`"
120
+ title="New session on this device"
121
+ @click="emit('action', 'new-session')"
122
+ >
123
+ <Plus :size="16" /></button
124
+ ><button
125
+ class="icon-button"
126
+ :aria-label="`Check ${label}`"
127
+ title="Check connection now"
128
+ @click="emit('action', 'check')"
129
+ >
130
+ <RefreshCw :size="16" />
131
+ </button>
132
+ </span>
133
+ </template>
134
+ <template v-else-if="session">
135
+ <FolderOpen class="ico" :size="16" />
136
+ <b class="name">{{ label }}</b>
137
+ <span class="path">…/{{ session.cwd.split("/").filter(Boolean).at(-1) }}</span>
138
+ <i v-if="busy" class="dot work" title="Working" />
139
+ <span v-if="background" class="bg-count" :title="`${background} background task(s)`"
140
+ ><i class="dot bg" />{{ background }} bg</span
141
+ >
142
+ <span class="acts" @click.stop>
143
+ <button
144
+ class="icon-button"
145
+ :disabled="!online"
146
+ :aria-label="`New agent in ${label}`"
147
+ title="New agent in this session"
148
+ @click="emit('action', 'new-agent')"
149
+ >
150
+ <Plus :size="16" /></button
151
+ ><button
152
+ class="icon-button"
153
+ :disabled="!online"
154
+ :aria-label="`Rename session ${label}`"
155
+ title="Rename session"
156
+ @click="emit('action', 'rename')"
157
+ >
158
+ <Pencil :size="16" /></button
159
+ ><button
160
+ class="icon-button"
161
+ :disabled="!online"
162
+ :aria-label="`Archive session ${label}`"
163
+ title="Archive session"
164
+ @click="emit('action', 'archive')"
165
+ >
166
+ <Archive :size="16" />
167
+ </button>
168
+ </span>
169
+ </template>
170
+ <template v-else-if="agent">
171
+ <GitFork v-if="agent.kind === 'fork'" class="ico" :size="16" />
172
+ <CornerDownRight v-else-if="agent.kind === 'subagent'" class="ico" :size="16" />
173
+ <MessageSquare v-else class="ico root" :size="16" />
174
+ <span class="name">{{ label }}</span>
175
+ <span v-if="agent.kind === 'fork' && agent.forkedAt !== undefined" class="meta"
176
+ >@ #{{ agent.forkedAt }}</span
177
+ >
178
+ <i v-if="busy" class="dot work" title="Working" />
179
+ <span v-if="background" class="bg-count" :title="`${background} background task(s)`"
180
+ ><i class="dot bg" />{{ background }}</span
181
+ >
182
+ <span class="acts" @click.stop>
183
+ <button
184
+ class="icon-button"
185
+ :disabled="!online"
186
+ :aria-label="`Rename agent ${label}`"
187
+ title="Rename agent"
188
+ @click="emit('action', 'rename')"
189
+ >
190
+ <Pencil :size="16" />
191
+ </button>
192
+ </span>
193
+ </template>
194
+ </div>
195
+ </template>
@@ -0,0 +1,107 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * P2-25 — TunnelStatusBar: two INDEPENDENT axes, both read straight from the
4
+ * network DTO (no invented state):
5
+ * 1. transport — how the hub reaches the device: LAN (url) or tunnel (WSS),
6
+ * with tunnel.state/readerCount when the hub exposes diagnostics.
7
+ * 2. monitor — the six-value probe status (checking/online/offline/
8
+ * unauthorized/mismatch/incompatible).
9
+ * url === null hides any endpoint link (tunnel devices have no hub-side URL);
10
+ * no retry countdown is fabricated — the hub does not expose one.
11
+ */
12
+ import { computed } from "vue";
13
+ import { Cable, Wifi, WifiOff } from "lucide-vue-next";
14
+ import type { NetworkDevice } from "@sdk/api";
15
+ import { ago } from "../client/store";
16
+
17
+ const props = defineProps<{ device: NetworkDevice }>();
18
+
19
+ const online = computed(() => props.device.status === "online");
20
+ const viaTunnel = computed(() => props.device.transport === "tunnel");
21
+ const transportLabel = computed(() =>
22
+ online.value
23
+ ? viaTunnel.value
24
+ ? "online · via tunnel"
25
+ : "online · LAN"
26
+ : viaTunnel.value
27
+ ? "tunnel"
28
+ : "LAN",
29
+ );
30
+ const tunnelLive = computed(() => props.device.tunnel?.state === "connected");
31
+ </script>
32
+
33
+ <template>
34
+ <span class="tunnel-status" :data-status="device.status">
35
+ <span
36
+ class="axis transport"
37
+ :title="viaTunnel ? 'Hub ⇄ device over the tunnel (WSS)' : 'Hub → device over LAN'"
38
+ >
39
+ <Cable v-if="viaTunnel" :size="13" :class="{ live: tunnelLive }" />
40
+ <Wifi v-else :size="13" :class="{ live: online }" />
41
+ {{ transportLabel }}
42
+ </span>
43
+ <span class="axis monitor" :class="device.status">
44
+ <WifiOff v-if="device.status === 'offline'" :size="13" />
45
+ <template v-else>{{ device.status }}</template>
46
+ </span>
47
+ <span
48
+ v-if="viaTunnel && tunnelLive && device.tunnel"
49
+ class="axis muted"
50
+ :title="`tunnel last seen ${ago(device.tunnel.lastSeenAt)}`"
51
+ >
52
+ {{ device.tunnel.readerCount }} reader{{ device.tunnel.readerCount === 1 ? "" : "s" }}
53
+ </span>
54
+ <a v-if="device.url" class="axis url" :href="device.url" target="_blank" rel="noreferrer">{{
55
+ device.url
56
+ }}</a>
57
+ <span
58
+ v-if="device.lastSeenAt"
59
+ class="axis muted"
60
+ :title="`last probe ${ago(device.lastSeenAt)}`"
61
+ >{{ ago(device.lastSeenAt) }}</span
62
+ >
63
+ </span>
64
+ </template>
65
+
66
+ <style>
67
+ .tunnel-status {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ gap: 0.5rem;
71
+ font-size: 0.75rem;
72
+ flex-wrap: wrap;
73
+ }
74
+ .tunnel-status .axis {
75
+ display: inline-flex;
76
+ align-items: center;
77
+ gap: 0.25rem;
78
+ padding: 0.1rem 0.5rem;
79
+ border-radius: 999px;
80
+ border: 1px solid var(--border, #333);
81
+ }
82
+ .tunnel-status .axis.transport {
83
+ color: var(--fg, #eee);
84
+ }
85
+ .tunnel-status .axis.monitor.offline {
86
+ color: var(--muted, #888);
87
+ }
88
+ .tunnel-status .axis.monitor.unauthorized,
89
+ .tunnel-status .axis.monitor.mismatch,
90
+ .tunnel-status .axis.monitor.incompatible {
91
+ color: var(--warn, #e0b040);
92
+ }
93
+ .tunnel-status .axis.monitor.online {
94
+ color: var(--ok, #6cc070);
95
+ }
96
+ .tunnel-status .axis.muted {
97
+ color: var(--muted, #888);
98
+ border-style: dashed;
99
+ }
100
+ .tunnel-status .axis.url {
101
+ color: var(--accent, #7ab8ff);
102
+ text-decoration: none;
103
+ }
104
+ .tunnel-status .live {
105
+ color: var(--ok, #6cc070);
106
+ }
107
+ </style>
@@ -0,0 +1,105 @@
1
+ /* The Extensions tab: one card per custom harness extension. */
2
+
3
+ .ext-card {
4
+ margin-top: 12px;
5
+ padding: 13px 14px;
6
+ border: 1px solid #453536;
7
+ border-left: 3px solid #5a3a3e;
8
+ border-radius: 8px;
9
+ background: #241819;
10
+ }
11
+ .ext-card.on {
12
+ border-left-color: var(--ok);
13
+ }
14
+ .ext-head {
15
+ display: flex;
16
+ align-items: center;
17
+ gap: 12px;
18
+ }
19
+ .ext-head > div {
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+ align-items: baseline;
23
+ gap: 4px 10px;
24
+ min-width: 0;
25
+ }
26
+ .ext-head strong {
27
+ font-size: 16px;
28
+ }
29
+ .ext-head code {
30
+ font-family: var(--font-mono);
31
+ font-size: 16px;
32
+ color: var(--secondary);
33
+ }
34
+ .ext-card > p {
35
+ margin: 8px 0 0;
36
+ font-size: 16px;
37
+ line-height: 1.5;
38
+ }
39
+ .ext-prompts {
40
+ list-style: none;
41
+ margin: 12px 0 0;
42
+ padding: 10px 0 0;
43
+ border-top: 1px solid #3c2b2d;
44
+ display: grid;
45
+ gap: 10px;
46
+ }
47
+ .ext-prompts.off {
48
+ opacity: 0.6;
49
+ }
50
+ .ext-prompts li {
51
+ display: grid;
52
+ gap: 4px;
53
+ font-size: 16px;
54
+ }
55
+ .ext-prompts label {
56
+ display: flex;
57
+ align-items: center;
58
+ gap: 8px;
59
+ cursor: pointer;
60
+ }
61
+ .ext-prompts code {
62
+ font-family: var(--font-mono);
63
+ font-size: 16px;
64
+ }
65
+ .ext-prompts li > span {
66
+ padding-left: 26px;
67
+ color: var(--secondary);
68
+ line-height: 1.45;
69
+ }
70
+ .ext-prompts details {
71
+ padding-left: 26px;
72
+ }
73
+ .ext-prompts summary {
74
+ cursor: pointer;
75
+ color: var(--accent);
76
+ }
77
+ .ext-prompts pre {
78
+ max-height: 260px;
79
+ overflow: auto;
80
+ margin: 6px 0 0;
81
+ padding: 9px;
82
+ white-space: pre-wrap;
83
+ background: #180f10;
84
+ border-radius: 6px;
85
+ font-size: 16px;
86
+ }
87
+
88
+ /* Tools tab: tools the agent's tool filter removes (read only) fade out. */
89
+ .tool-row.disabled summary > strong,
90
+ .tool-row.disabled summary > svg,
91
+ .tool-row.disabled > p,
92
+ .tool-row.disabled > pre,
93
+ .tool-row.disabled > small {
94
+ opacity: 0.45;
95
+ }
96
+ /* Sits right after the name; the replay tag keeps the row's right edge. */
97
+ .tool-row summary .tag.tool-disabled {
98
+ margin-left: 2px;
99
+ margin-right: auto;
100
+ color: var(--warn);
101
+ border-color: #6b5a24;
102
+ }
103
+ .tool-row summary .tag.tool-disabled + .tag {
104
+ margin-left: auto;
105
+ }