@vibesdotdev/code-sessions 0.0.0-stage → 1.0.0-rc.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 (217) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +165 -2
  3. package/dist/agent/coordinator.agent.descriptor.d.ts +69 -0
  4. package/dist/agent/coordinator.agent.descriptor.d.ts.map +1 -0
  5. package/dist/agent/coordinator.agent.descriptor.js +60 -0
  6. package/dist/agent/coordinator.agent.descriptor.js.map +1 -0
  7. package/dist/agent/coordinator.prompt.descriptor.d.ts +135 -0
  8. package/dist/agent/coordinator.prompt.descriptor.d.ts.map +1 -0
  9. package/dist/agent/coordinator.prompt.descriptor.js +29 -0
  10. package/dist/agent/coordinator.prompt.descriptor.js.map +1 -0
  11. package/dist/agent/coordinator.system-prompt.d.ts +3 -0
  12. package/dist/agent/coordinator.system-prompt.d.ts.map +1 -0
  13. package/dist/agent/coordinator.system-prompt.js +18 -0
  14. package/dist/agent/coordinator.system-prompt.js.map +1 -0
  15. package/dist/agent/developer.agent.descriptor.d.ts +74 -0
  16. package/dist/agent/developer.agent.descriptor.d.ts.map +1 -0
  17. package/dist/agent/developer.agent.descriptor.js +138 -0
  18. package/dist/agent/developer.agent.descriptor.js.map +1 -0
  19. package/dist/agent/developer.prompt.descriptor.d.ts +137 -0
  20. package/dist/agent/developer.prompt.descriptor.d.ts.map +1 -0
  21. package/dist/agent/developer.prompt.descriptor.js +29 -0
  22. package/dist/agent/developer.prompt.descriptor.js.map +1 -0
  23. package/dist/agent/reviewer.agent.descriptor.d.ts +69 -0
  24. package/dist/agent/reviewer.agent.descriptor.d.ts.map +1 -0
  25. package/dist/agent/reviewer.agent.descriptor.js +60 -0
  26. package/dist/agent/reviewer.agent.descriptor.js.map +1 -0
  27. package/dist/agent/reviewer.prompt.descriptor.d.ts +135 -0
  28. package/dist/agent/reviewer.prompt.descriptor.d.ts.map +1 -0
  29. package/dist/agent/reviewer.prompt.descriptor.js +29 -0
  30. package/dist/agent/reviewer.prompt.descriptor.js.map +1 -0
  31. package/dist/agent/reviewer.system-prompt.d.ts +3 -0
  32. package/dist/agent/reviewer.system-prompt.d.ts.map +1 -0
  33. package/dist/agent/reviewer.system-prompt.js +17 -0
  34. package/dist/agent/reviewer.system-prompt.js.map +1 -0
  35. package/dist/agent/system-prompt.d.ts +12 -0
  36. package/dist/agent/system-prompt.d.ts.map +1 -0
  37. package/dist/agent/system-prompt.js +28 -0
  38. package/dist/agent/system-prompt.js.map +1 -0
  39. package/dist/api/code-sessions.api-client.descriptor.d.ts +25 -0
  40. package/dist/api/code-sessions.api-client.descriptor.d.ts.map +1 -0
  41. package/dist/api/code-sessions.api-client.descriptor.js +26 -0
  42. package/dist/api/code-sessions.api-client.descriptor.js.map +1 -0
  43. package/dist/api/code-sessions.api-client.impl.d.ts +156 -0
  44. package/dist/api/code-sessions.api-client.impl.d.ts.map +1 -0
  45. package/dist/api/code-sessions.api-client.impl.js +852 -0
  46. package/dist/api/code-sessions.api-client.impl.js.map +1 -0
  47. package/dist/api/code-sessions.api-client.schemas.d.ts +2 -0
  48. package/dist/api/code-sessions.api-client.schemas.d.ts.map +1 -0
  49. package/dist/api/code-sessions.api-client.schemas.js +2 -0
  50. package/dist/api/code-sessions.api-client.schemas.js.map +1 -0
  51. package/dist/api/code-sessions.api-client.types.d.ts +252 -0
  52. package/dist/api/code-sessions.api-client.types.d.ts.map +1 -0
  53. package/dist/api/code-sessions.api-client.types.js +77 -0
  54. package/dist/api/code-sessions.api-client.types.js.map +1 -0
  55. package/dist/api/index.d.ts +13 -0
  56. package/dist/api/index.d.ts.map +1 -0
  57. package/dist/api/index.js +20 -0
  58. package/dist/api/index.js.map +1 -0
  59. package/dist/capability.d.ts +9 -0
  60. package/dist/capability.d.ts.map +1 -0
  61. package/dist/capability.js +9 -0
  62. package/dist/capability.js.map +1 -0
  63. package/dist/catalog/index.d.ts +2 -0
  64. package/dist/catalog/index.d.ts.map +1 -0
  65. package/dist/catalog/index.js +2 -0
  66. package/dist/catalog/index.js.map +1 -0
  67. package/dist/catalog/session-catalog.d.ts +131 -0
  68. package/dist/catalog/session-catalog.d.ts.map +1 -0
  69. package/dist/catalog/session-catalog.impl.consumer.worker.d.ts +113 -0
  70. package/dist/catalog/session-catalog.impl.consumer.worker.d.ts.map +1 -0
  71. package/dist/catalog/session-catalog.impl.consumer.worker.js +32 -0
  72. package/dist/catalog/session-catalog.impl.consumer.worker.js.map +1 -0
  73. package/dist/catalog/session-catalog.js +126 -0
  74. package/dist/catalog/session-catalog.js.map +1 -0
  75. package/dist/clock/clock.client.d.ts +18 -0
  76. package/dist/clock/clock.client.d.ts.map +1 -0
  77. package/dist/clock/clock.client.js +43 -0
  78. package/dist/clock/clock.client.js.map +1 -0
  79. package/dist/code-sessions.consumer.plugin.d.ts +4 -0
  80. package/dist/code-sessions.consumer.plugin.d.ts.map +1 -0
  81. package/dist/code-sessions.consumer.plugin.js +16 -0
  82. package/dist/code-sessions.consumer.plugin.js.map +1 -0
  83. package/dist/code-sessions.plugin.d.ts +15 -0
  84. package/dist/code-sessions.plugin.d.ts.map +1 -0
  85. package/dist/code-sessions.plugin.js +65 -0
  86. package/dist/code-sessions.plugin.js.map +1 -0
  87. package/dist/config/index.d.ts +9 -0
  88. package/dist/config/index.d.ts.map +1 -0
  89. package/dist/config/index.js +9 -0
  90. package/dist/config/index.js.map +1 -0
  91. package/dist/config/preparation.d.ts +2 -0
  92. package/dist/config/preparation.d.ts.map +1 -0
  93. package/dist/config/preparation.js +2 -0
  94. package/dist/config/preparation.js.map +1 -0
  95. package/dist/docs/code-sessions.docs.descriptor.d.ts +4 -0
  96. package/dist/docs/code-sessions.docs.descriptor.d.ts.map +1 -0
  97. package/dist/docs/code-sessions.docs.descriptor.js +241 -0
  98. package/dist/docs/code-sessions.docs.descriptor.js.map +1 -0
  99. package/dist/index.d.ts +26 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +28 -0
  102. package/dist/index.js.map +1 -0
  103. package/dist/pull-request-plan.d.ts +68 -0
  104. package/dist/pull-request-plan.d.ts.map +1 -0
  105. package/dist/pull-request-plan.js +94 -0
  106. package/dist/pull-request-plan.js.map +1 -0
  107. package/dist/schemas/preparation.d.ts +51 -0
  108. package/dist/schemas/preparation.d.ts.map +1 -0
  109. package/dist/schemas/preparation.js +20 -0
  110. package/dist/schemas/preparation.js.map +1 -0
  111. package/dist/schemas/requests.d.ts +411 -0
  112. package/dist/schemas/requests.d.ts.map +1 -0
  113. package/dist/schemas/requests.js +87 -0
  114. package/dist/schemas/requests.js.map +1 -0
  115. package/dist/schemas/responses.d.ts +275 -0
  116. package/dist/schemas/responses.d.ts.map +1 -0
  117. package/dist/schemas/responses.js +90 -0
  118. package/dist/schemas/responses.js.map +1 -0
  119. package/dist/svelte/actions.d.ts +70 -0
  120. package/dist/svelte/actions.d.ts.map +1 -0
  121. package/dist/svelte/actions.js +280 -0
  122. package/dist/svelte/clock.svelte.d.ts +6 -0
  123. package/dist/svelte/clock.svelte.d.ts.map +1 -0
  124. package/dist/svelte/clock.svelte.js +33 -0
  125. package/dist/svelte/components/CreateSessionDialog.svelte +470 -0
  126. package/dist/svelte/components/CreateSessionDialog.svelte.d.ts +57 -0
  127. package/dist/svelte/components/CreateSessionDialog.svelte.d.ts.map +1 -0
  128. package/dist/svelte/components/SessionCard.svelte +216 -0
  129. package/dist/svelte/components/SessionCard.svelte.d.ts +27 -0
  130. package/dist/svelte/components/SessionCard.svelte.d.ts.map +1 -0
  131. package/dist/svelte/components/SessionList.svelte +86 -0
  132. package/dist/svelte/components/SessionList.svelte.d.ts +23 -0
  133. package/dist/svelte/components/SessionList.svelte.d.ts.map +1 -0
  134. package/dist/svelte/components/SessionSeed.svelte +60 -0
  135. package/dist/svelte/components/SessionSeed.svelte.d.ts +9 -0
  136. package/dist/svelte/components/SessionSeed.svelte.d.ts.map +1 -0
  137. package/dist/svelte/components/TranscriptView.svelte +360 -0
  138. package/dist/svelte/components/TranscriptView.svelte.d.ts +26 -0
  139. package/dist/svelte/components/TranscriptView.svelte.d.ts.map +1 -0
  140. package/dist/svelte/create-session-form.d.ts +84 -0
  141. package/dist/svelte/create-session-form.d.ts.map +1 -0
  142. package/dist/svelte/create-session-form.js +107 -0
  143. package/dist/svelte/index.d.ts +20 -0
  144. package/dist/svelte/index.d.ts.map +1 -0
  145. package/dist/svelte/index.js +18 -0
  146. package/dist/svelte/live-session.d.ts +156 -0
  147. package/dist/svelte/live-session.d.ts.map +1 -0
  148. package/dist/svelte/live-session.js +152 -0
  149. package/dist/svelte/loaders.d.ts +74 -0
  150. package/dist/svelte/loaders.d.ts.map +1 -0
  151. package/dist/svelte/loaders.js +124 -0
  152. package/dist/svelte/outcome.d.ts +46 -0
  153. package/dist/svelte/outcome.d.ts.map +1 -0
  154. package/dist/svelte/outcome.js +49 -0
  155. package/dist/svelte/relative-time.d.ts +32 -0
  156. package/dist/svelte/relative-time.d.ts.map +1 -0
  157. package/dist/svelte/relative-time.js +51 -0
  158. package/dist/svelte/session-list-item.d.ts +23 -0
  159. package/dist/svelte/session-list-item.d.ts.map +1 -0
  160. package/dist/svelte/session-list-item.js +1 -0
  161. package/dist/svelte/styles.css +8 -0
  162. package/dist/svelte/transcript-input.d.ts +45 -0
  163. package/dist/svelte/transcript-input.d.ts.map +1 -0
  164. package/dist/svelte/transcript-input.js +188 -0
  165. package/dist/tui/code-sessions-tui.plugin.d.ts +10 -0
  166. package/dist/tui/code-sessions-tui.plugin.d.ts.map +1 -0
  167. package/dist/tui/code-sessions-tui.plugin.js +29 -0
  168. package/dist/tui/code-sessions-tui.plugin.js.map +1 -0
  169. package/dist/tui/code-sessions.tui-app.descriptor.d.ts +7 -0
  170. package/dist/tui/code-sessions.tui-app.descriptor.d.ts.map +1 -0
  171. package/dist/tui/code-sessions.tui-app.descriptor.js +30 -0
  172. package/dist/tui/code-sessions.tui-app.descriptor.js.map +1 -0
  173. package/dist/tui/code-sessions.tui-app.impl.consumer.d.ts +14 -0
  174. package/dist/tui/code-sessions.tui-app.impl.consumer.d.ts.map +1 -0
  175. package/dist/tui/code-sessions.tui-app.impl.consumer.js +453 -0
  176. package/dist/tui/code-sessions.tui-app.impl.consumer.js.map +1 -0
  177. package/dist/tui/code-sessions.tui-client.d.ts +22 -0
  178. package/dist/tui/code-sessions.tui-client.d.ts.map +1 -0
  179. package/dist/tui/code-sessions.tui-client.js +95 -0
  180. package/dist/tui/code-sessions.tui-client.js.map +1 -0
  181. package/dist/tui/code-sessions.tui-open.descriptor.d.ts +7 -0
  182. package/dist/tui/code-sessions.tui-open.descriptor.d.ts.map +1 -0
  183. package/dist/tui/code-sessions.tui-open.descriptor.js +16 -0
  184. package/dist/tui/code-sessions.tui-open.descriptor.js.map +1 -0
  185. package/dist/tui/code-sessions.tui-open.impl.consumer.d.ts +7 -0
  186. package/dist/tui/code-sessions.tui-open.impl.consumer.d.ts.map +1 -0
  187. package/dist/tui/code-sessions.tui-open.impl.consumer.js +11 -0
  188. package/dist/tui/code-sessions.tui-open.impl.consumer.js.map +1 -0
  189. package/dist/tui/code-sessions.tui-state.descriptor.d.ts +16 -0
  190. package/dist/tui/code-sessions.tui-state.descriptor.d.ts.map +1 -0
  191. package/dist/tui/code-sessions.tui-state.descriptor.js +50 -0
  192. package/dist/tui/code-sessions.tui-state.descriptor.js.map +1 -0
  193. package/dist/tui/code-sessions.tui-state.impl.consumer.d.ts +30 -0
  194. package/dist/tui/code-sessions.tui-state.impl.consumer.d.ts.map +1 -0
  195. package/dist/tui/code-sessions.tui-state.impl.consumer.js +533 -0
  196. package/dist/tui/code-sessions.tui-state.impl.consumer.js.map +1 -0
  197. package/dist/tui/code-sessions.tui-state.key.d.ts +322 -0
  198. package/dist/tui/code-sessions.tui-state.key.d.ts.map +1 -0
  199. package/dist/tui/code-sessions.tui-state.key.js +104 -0
  200. package/dist/tui/code-sessions.tui-state.key.js.map +1 -0
  201. package/dist/tui/index.d.ts +9 -0
  202. package/dist/tui/index.d.ts.map +1 -0
  203. package/dist/tui/index.js +8 -0
  204. package/dist/tui/index.js.map +1 -0
  205. package/dist/workspace/index.d.ts +2 -0
  206. package/dist/workspace/index.d.ts.map +1 -0
  207. package/dist/workspace/index.js +2 -0
  208. package/dist/workspace/index.js.map +1 -0
  209. package/dist/workspace/workspace-binding.d.ts +74 -0
  210. package/dist/workspace/workspace-binding.d.ts.map +1 -0
  211. package/dist/workspace/workspace-binding.impl.consumer.worker.d.ts +17 -0
  212. package/dist/workspace/workspace-binding.impl.consumer.worker.d.ts.map +1 -0
  213. package/dist/workspace/workspace-binding.impl.consumer.worker.js +134 -0
  214. package/dist/workspace/workspace-binding.impl.consumer.worker.js.map +1 -0
  215. package/dist/workspace/workspace-binding.js +72 -0
  216. package/dist/workspace/workspace-binding.js.map +1 -0
  217. package/package.json +238 -4
@@ -0,0 +1,3 @@
1
+ /** The reviewer agent's system prompt: an independent, read-only judge of someone else's change. */
2
+ export declare const reviewerAgentSystemPrompt = "You are Reviewer, an independent code reviewer working inside a Vibes workspace.\n\nYour job is to judge a change someone else made. You are read-only: never create, edit, move or delete files, and never run anything that writes or changes state. Put every change you would make in your findings; if a file changes during your review, the coordinator takes that change over.\n\nHow to review:\n- Start from what you were given: the diff, the checks' results, and the standards or documents the request names, including the project's definition of correct. Those standards are the bar.\n- Read the code around the change, not only the diff. Find callers, schemas and tests it affects (use workspace-search, workspace-atlas, file-read, git).\n- Look for: behavior that does not do what it claims; failures that are hidden, swallowed or downgraded; type assertions or casts covering a real type problem; skipped or weakened tests; a fix in the wrong place (a symptom patched instead of its cause); a second implementation of something that already exists; changes outside what the request allowed.\n- Look for removed capability: a command, option, fallback, export, kind or default behavior that is gone without evidence that it exists in a more canonical or more effective form elsewhere (its owner and entrypoint named). Having no importers is not evidence; without that evidence the change fails.\n- Look for overfit: a test, check or special case fitted to one incident instead of the promises the unit's specification makes.\n- Passing checks are necessary, not sufficient. A change that turns checks green by weakening them fails.\n- Pass a change only when what you observed, in the real code and under the conditions you observed it, meets the standard. If you could not observe what the standard needs, say what is missing; that is not a pass.\n- Be specific: name the file and line, and say what is wrong and what correct looks like.\n\nAnswer in exactly the format the request asks for. When it asks for a verdict, end with one line: `VERDICT: PASS` or `VERDICT: FAIL: <the reason>`.";
3
+ //# sourceMappingURL=reviewer.system-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewer.system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/reviewer.system-prompt.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,eAAO,MAAM,yBAAyB,ijEAckH,CAAC"}
@@ -0,0 +1,17 @@
1
+ /** The reviewer agent's system prompt: an independent, read-only judge of someone else's change. */
2
+ export const reviewerAgentSystemPrompt = `You are Reviewer, an independent code reviewer working inside a Vibes workspace.
3
+
4
+ Your job is to judge a change someone else made. You are read-only: never create, edit, move or delete files, and never run anything that writes or changes state. Put every change you would make in your findings; if a file changes during your review, the coordinator takes that change over.
5
+
6
+ How to review:
7
+ - Start from what you were given: the diff, the checks' results, and the standards or documents the request names, including the project's definition of correct. Those standards are the bar.
8
+ - Read the code around the change, not only the diff. Find callers, schemas and tests it affects (use workspace-search, workspace-atlas, file-read, git).
9
+ - Look for: behavior that does not do what it claims; failures that are hidden, swallowed or downgraded; type assertions or casts covering a real type problem; skipped or weakened tests; a fix in the wrong place (a symptom patched instead of its cause); a second implementation of something that already exists; changes outside what the request allowed.
10
+ - Look for removed capability: a command, option, fallback, export, kind or default behavior that is gone without evidence that it exists in a more canonical or more effective form elsewhere (its owner and entrypoint named). Having no importers is not evidence; without that evidence the change fails.
11
+ - Look for overfit: a test, check or special case fitted to one incident instead of the promises the unit's specification makes.
12
+ - Passing checks are necessary, not sufficient. A change that turns checks green by weakening them fails.
13
+ - Pass a change only when what you observed, in the real code and under the conditions you observed it, meets the standard. If you could not observe what the standard needs, say what is missing; that is not a pass.
14
+ - Be specific: name the file and line, and say what is wrong and what correct looks like.
15
+
16
+ Answer in exactly the format the request asks for. When it asks for a verdict, end with one line: \`VERDICT: PASS\` or \`VERDICT: FAIL: <the reason>\`.`;
17
+ //# sourceMappingURL=reviewer.system-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewer.system-prompt.js","sourceRoot":"","sources":["../../src/agent/reviewer.system-prompt.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;wJAc+G,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Developer agent identity.
3
+ *
4
+ * Canonical content for `prompts/manifest` id `developer`. The agent
5
+ * descriptor keeps the same string as a fallback when the prompt catalog is
6
+ * not mounted. A chat mode may add tools; it does not replace this identity.
7
+ *
8
+ * Written for any bound workspace, not for the Vibes repository-collection.
9
+ */
10
+ export declare const developerAgentSystemPrompt: string;
11
+ export default developerAgentSystemPrompt;
12
+ //# sourceMappingURL=system-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,QAgB3B,CAAC;AAEb,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Developer agent identity.
3
+ *
4
+ * Canonical content for `prompts/manifest` id `developer`. The agent
5
+ * descriptor keeps the same string as a fallback when the prompt catalog is
6
+ * not mounted. A chat mode may add tools; it does not replace this identity.
7
+ *
8
+ * Written for any bound workspace, not for the Vibes repository-collection.
9
+ */
10
+ export const developerAgentSystemPrompt = [
11
+ 'You are a coding agent in the user\'s editor, working in the currently bound workspace.',
12
+ '',
13
+ 'You sit in a sandbox attached to that folder. You cannot see the project until you look. Your job is to complete the user\'s request in THIS repository, using its own conventions, scripts, and tests — not habits from another product.',
14
+ '',
15
+ 'How to succeed in any project:',
16
+ '- Orient first. Find how this repo is laid out, how it builds, how it tests, and whether it has its own agent or contributor instructions (README, AGENTS.md, CONTRIBUTING, package scripts). Those outrank habit.',
17
+ '- Read before you edit. Match naming, error handling, and test style already in the file.',
18
+ '- Prefer the smallest change that satisfies the request. Prefer editing an existing file over adding a new one. Search for an existing pattern before inventing one.',
19
+ '- Verify by observing: run this project\'s own checks and real entrypoints, and report what you ran and what it printed. "Should work" is not a result. Write tests for the promises your change makes, not for the one incident that exposed it.',
20
+ '- Keep every capability. Remove a feature, option, fallback or export only when it already exists in a more canonical or more effective form elsewhere, and name where; otherwise keep it, or ask through the project\'s approval tool when its instructions provide one.',
21
+ '- If you cannot see the workspace, or a needed tool is missing, say so and ask. Do not invent file contents.',
22
+ '',
23
+ 'Tools: use the tools you actually have on this turn. Runtime tools (file-read, file-write, workspace-fs, workspace-search, run-command, git) execute directly against the bound workspace with the session\'s write authority, even when a host harness reports its own built-in shell as read-only. Prefer file-read, file-write, and workspace-search over shell cat, ls, or grep. Prefer the git tool over shell git. Use run-command for this project\'s install, build, test, and dev commands (argv, not a shell). Open or update a pull request only when the user asked to ship, or when this workspace\'s own instructions say that is the deliverable.',
24
+ '',
25
+ 'Talk: lead with the result. Name failures, including your own. No ceremony, no flattery, no long narration of what you are about to do.'
26
+ ].join('\n');
27
+ export default developerAgentSystemPrompt;
28
+ //# sourceMappingURL=system-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACzC,yFAAyF;IACzF,EAAE;IACF,2OAA2O;IAC3O,EAAE;IACF,gCAAgC;IAChC,oNAAoN;IACpN,2FAA2F;IAC3F,sKAAsK;IACtK,mPAAmP;IACnP,2QAA2Q;IAC3Q,8GAA8G;IAC9G,EAAE;IACF,koBAAkoB;IACloB,EAAE;IACF,yIAAyI;CACzI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Code Sessions runtime/client descriptor.
3
+ *
4
+ * Declares the canonical `runtime/client` surface for cross-origin code-session
5
+ * data access. Per docs/architecture/FEATURE-API-CLIENT-RUNTIME-KIND.md the
6
+ * FEATURE PACKAGE (this one) owns the descriptor; callers resolve an instance
7
+ * via `getVibesClient<CodeSessionsClient>('code-sessions', runtime)`.
8
+ *
9
+ * Session data lives in `apps/platform-web` (D1 via `userDescriptorData` +
10
+ * `platform.code-sessions` descriptor) and is exposed via
11
+ * `apps/platform-web/src/routes/api/code-sessions/*`. The consumer variant
12
+ * talks to `platform.vibes.dev` over HTTP. No cloud variant is registered: all
13
+ * apps (hq-web, consumer hq) use the consumer HTTP path — in-process access
14
+ * would require co-location with platform-web's Drizzle, which is platform-web
15
+ * only.
16
+ */
17
+ export declare const codeSessionsApiClientDescriptor: {
18
+ kind: "runtime/client";
19
+ id: string;
20
+ name: string;
21
+ description: string;
22
+ surfaces: string[];
23
+ };
24
+ export default codeSessionsApiClientDescriptor;
25
+ //# sourceMappingURL=code-sessions.api-client.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-sessions.api-client.descriptor.d.ts","sourceRoot":"","sources":["../../src/api/code-sessions.api-client.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,eAAO,MAAM,+BAA+B;;;;;;CAO1C,CAAC;AAEH,eAAe,+BAA+B,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Code Sessions runtime/client descriptor.
3
+ *
4
+ * Declares the canonical `runtime/client` surface for cross-origin code-session
5
+ * data access. Per docs/architecture/FEATURE-API-CLIENT-RUNTIME-KIND.md the
6
+ * FEATURE PACKAGE (this one) owns the descriptor; callers resolve an instance
7
+ * via `getVibesClient<CodeSessionsClient>('code-sessions', runtime)`.
8
+ *
9
+ * Session data lives in `apps/platform-web` (D1 via `userDescriptorData` +
10
+ * `platform.code-sessions` descriptor) and is exposed via
11
+ * `apps/platform-web/src/routes/api/code-sessions/*`. The consumer variant
12
+ * talks to `platform.vibes.dev` over HTTP. No cloud variant is registered: all
13
+ * apps (hq-web, consumer hq) use the consumer HTTP path — in-process access
14
+ * would require co-location with platform-web's Drizzle, which is platform-web
15
+ * only.
16
+ */
17
+ import { createRuntimeAsset } from '@vibesdotdev/kernel';
18
+ export const codeSessionsApiClientDescriptor = createRuntimeAsset({
19
+ kind: 'runtime/client',
20
+ id: 'code-sessions',
21
+ name: 'Code Sessions Client',
22
+ description: 'Canonical client for code-session management (list, get, create, delete). Resolves sessions against platform.vibes.dev/api/code-sessions. A session\'s hostTarget determines capability: PTY-capable host = interactive; CF Sandbox = transcript-only.',
23
+ surfaces: ['cli', 'browser', 'sveltekit', 'cloud']
24
+ });
25
+ export default codeSessionsApiClientDescriptor;
26
+ //# sourceMappingURL=code-sessions.api-client.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-sessions.api-client.descriptor.js","sourceRoot":"","sources":["../../src/api/code-sessions.api-client.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,CAAC,MAAM,+BAA+B,GAAG,kBAAkB,CAAC;IACjE,IAAI,EAAE,gBAAgB;IACtB,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACV,wPAAwP;IACzP,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC;CAClD,CAAC,CAAC;AAEH,eAAe,+BAA+B,CAAC"}
@@ -0,0 +1,156 @@
1
+ import type { SsrCodeSessionsClientOptions } from '../schemas/requests.ts';
2
+ /**
3
+ * Code Sessions API Client — universal HTTP implementation.
4
+ *
5
+ * Cross-origin HTTP client against `${platformOrigin}/api/code-sessions/*`.
6
+ * Loaded in cli/browser/sveltekit/cloud scopes by the code-sessions plugin
7
+ * loader.
8
+ *
9
+ * Origin: explicit override, else the `platform` infra/service catalog origin.
10
+ *
11
+ * Authentication: `Authorization: Bearer <user-jwt>` (cli/ssr/cross-app), or
12
+ * same-origin `credentials: 'include'` in the browser. SSR never forwards a
13
+ * request cookie as a credential.
14
+ *
15
+ * Failures are typed (`CapabilityError` code and reason): a platform error
16
+ * status is a `CodeSessionsApiError` whose body is a bounded, redacted excerpt;
17
+ * an unreachable platform, an unreadable or malformed answer and every caller
18
+ * refusal carry their own reason. Every success body is parsed at this
19
+ * boundary before a caller sees it. Diagnostics go through the handed
20
+ * runtime's logger only.
21
+ *
22
+ * NEVER logs the bearer token.
23
+ */
24
+ import { BaseRuntimeClient, type RuntimeClientDescriptor } from '@vibesdotdev/kernel/client';
25
+ import { type KindContext, type RuntimeScope, type VibesRuntime } from '@vibesdotdev/kernel';
26
+ import { type PreparedCodeSession } from '../config/preparation.ts';
27
+ import { type CodeSessionsClient, type SessionWithCapability, type CodeSessionStartOptions, type RunCommandResponse, type PushBranchResponse, type CreatePullRequestResponse } from './code-sessions.api-client.types.ts';
28
+ /**
29
+ * Whether a browser runtime may ride its page's same-origin Platform session
30
+ * cookies. Only a browser surface does, and never the packaged Desktop
31
+ * renderer (`cef`), which renders from `file://` with neither a same-origin
32
+ * Platform session nor permission to probe the network speculatively. Cloud
33
+ * functionality is admitted there later through an explicit bearer-backed
34
+ * runtime client; local sessions remain independently available offline.
35
+ */
36
+ export declare function canUseBrowserSessionCookies(scope: Pick<RuntimeScope, 'surface' | 'qualifiers'>): boolean;
37
+ /**
38
+ * Runtime port `VibesRuntime` (Runtime SPEC `./client`): the caller bearer
39
+ * reads `declaredScope`, which `RuntimeRef` does not carry, directly and
40
+ * through auth's `resolveCallerBearer` port.
41
+ */
42
+ export declare class CodeSessionsApiClientConsumer extends BaseRuntimeClient<VibesRuntime> implements CodeSessionsClient {
43
+ private originOverride;
44
+ private tokenOverride;
45
+ private httpOverrides;
46
+ private serviceAssertion?;
47
+ private readonly localSessions;
48
+ private localSessionInFlight;
49
+ private startOptionsInFlight;
50
+ constructor(descriptor?: RuntimeClientDescriptor, context?: KindContext<VibesRuntime>, runtime?: VibesRuntime);
51
+ configureHttp(value: unknown): void;
52
+ private configureHttpValidated;
53
+ /** A request-scoped copy of this client on the same runtime. */
54
+ private fork;
55
+ forRequest(value: unknown): CodeSessionsClient;
56
+ forServiceRequest(input: unknown): CodeSessionsClient;
57
+ private forServiceRequestValidated;
58
+ prepare(input: unknown): Promise<PreparedCodeSession>;
59
+ private prepareValidated;
60
+ /**
61
+ * True when a bearer is configured or the caller's bearer resolves. A
62
+ * signed-out caller is `false`; any other resolution failure propagates.
63
+ */
64
+ isAuthenticated(): Promise<boolean>;
65
+ noSessionHint(): string;
66
+ private canAttemptPlatformRequest;
67
+ private localSession;
68
+ private resolveLocalSession;
69
+ private platformClient;
70
+ private rememberLocalHandle;
71
+ private discoverLocalSessions;
72
+ private findLocalSession;
73
+ /**
74
+ * The host's workspace, offered as the "current workspace" source. A host
75
+ * that binds no workspace (C1) offers none; any other failure propagates.
76
+ */
77
+ private runtimeWorkspacePath;
78
+ private resolveStartTarget;
79
+ private runtimeStartTargets;
80
+ getStartOptions(value?: unknown): Promise<CodeSessionStartOptions>;
81
+ private getStartOptionsValidated;
82
+ private resolveConfiguredOrigin;
83
+ /**
84
+ * An explicit token wins; a browser host presents none (same-origin
85
+ * credentials); otherwise the caller's bearer from auth's `resolveCallerBearer`.
86
+ */
87
+ private resolveConfiguredToken;
88
+ /**
89
+ * The caller's bearer: a token, `null` when none is configured (a browser or
90
+ * anonymous caller), or the typed signed-out refusal carrying the resolution
91
+ * failure. Any other resolution failure propagates.
92
+ */
93
+ private callerBearer;
94
+ /** The configured bearer, `null` when the caller presents none or is signed out. */
95
+ private signedInBearer;
96
+ private requestCredentials;
97
+ /** Refuse before resolving either execution plane or dispatching a request. */
98
+ private assertStandardAccess;
99
+ /**
100
+ * One request to the platform: the response when it is ok, `null` when a
101
+ * failed status is the confirmed absence `absence` declares, otherwise a typed
102
+ * refusal. The bearer and service credential never reach a failure's text.
103
+ */
104
+ private send;
105
+ /** The response body parsed by `schema`, or the typed `platform-response-invalid` refusal. */
106
+ private readJson;
107
+ private requestJson;
108
+ private requestJsonUnlessAbsent;
109
+ list(value?: unknown): Promise<SessionWithCapability[]>;
110
+ private listValidated;
111
+ get(value: unknown): Promise<SessionWithCapability | null>;
112
+ /**
113
+ * PLATFORM-AUTHORITATIVE read: never consults the local plane.
114
+ *
115
+ * `get()` is local-plane-first, and the local relay implementation attaches
116
+ * any well-formed relay id via the service credential WITHOUT an ownership
117
+ * check — fine for a surface reading its own machine, but never evidence of
118
+ * ownership. Authorization decisions (e.g. binding an MCP caller to a code
119
+ * session) MUST use this method: the platform's `/api/code-sessions/[id]`
120
+ * route is owner-scoped and answers 404 for a foreign session. Fails closed
121
+ * with null only for absence or signed-out callers; transport failures propagate.
122
+ */
123
+ getOwned(value: unknown): Promise<SessionWithCapability | null>;
124
+ private getOwnedValidated;
125
+ create(value: unknown): Promise<SessionWithCapability>;
126
+ private createValidated;
127
+ link(value: unknown, relationship: unknown): Promise<SessionWithCapability>;
128
+ private linkValidated;
129
+ run(value: unknown): Promise<RunCommandResponse>;
130
+ push(value: unknown): Promise<PushBranchResponse>;
131
+ private pushValidated;
132
+ createPullRequest(value: unknown): Promise<CreatePullRequestResponse>;
133
+ private createPullRequestValidated;
134
+ delete(value: unknown): Promise<void>;
135
+ private deleteValidated;
136
+ }
137
+ export default CodeSessionsApiClientConsumer;
138
+ /**
139
+ * Options for creating an SSR-mode code-sessions client.
140
+ * SSR callers send `Authorization: Bearer <locals.sessionToken>`.
141
+ */
142
+ export type { SsrCodeSessionsClientOptions } from '../schemas/requests.ts';
143
+ /**
144
+ * Create a CodeSessionsApiClientConsumer configured for SSR use. It configures
145
+ * the client through the same public `configureHttp` path every request fork
146
+ * uses; it never touches private implementation fields.
147
+ *
148
+ * Usage:
149
+ * const client = createSsrCodeSessionsClient(event.locals.runtime, {
150
+ * origin: platformOrigin,
151
+ * token: event.locals.sessionToken
152
+ * });
153
+ * const sessions = await client.list();
154
+ */
155
+ export declare function createSsrCodeSessionsClient(runtime: VibesRuntime, opts: SsrCodeSessionsClientOptions): CodeSessionsApiClientConsumer;
156
+ //# sourceMappingURL=code-sessions.api-client.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-sessions.api-client.impl.d.ts","sourceRoot":"","sources":["../../src/api/code-sessions.api-client.impl.ts"],"names":[],"mappings":"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"}