@kortix/sdk 0.12.7 → 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 (287) hide show
  1. package/README.md +13 -6
  2. package/dist/browser/session-sync/session-sync-registry.d.ts +7 -2
  3. package/dist/browser/session-sync/session-sync-registry.d.ts.map +1 -1
  4. package/dist/browser/session-sync/session-sync-registry.js +33 -44
  5. package/dist/browser/session-sync/session-sync-registry.js.map +1 -1
  6. package/dist/browser/stores/opencode-compaction-store.d.ts +9 -3
  7. package/dist/browser/stores/opencode-compaction-store.d.ts.map +1 -1
  8. package/dist/browser/stores/opencode-compaction-store.js +5 -12
  9. package/dist/browser/stores/opencode-compaction-store.js.map +1 -1
  10. package/dist/browser/stores/sandbox-connection-store.d.ts +28 -17
  11. package/dist/browser/stores/sandbox-connection-store.d.ts.map +1 -1
  12. package/dist/browser/stores/sandbox-connection-store.js +32 -84
  13. package/dist/browser/stores/sandbox-connection-store.js.map +1 -1
  14. package/dist/browser/stores/session-working-store.d.ts +73 -0
  15. package/dist/browser/stores/session-working-store.d.ts.map +1 -0
  16. package/dist/browser/stores/session-working-store.js +86 -0
  17. package/dist/browser/stores/session-working-store.js.map +1 -0
  18. package/dist/browser/stores/sync-store/types.d.ts +14 -4
  19. package/dist/browser/stores/sync-store/types.d.ts.map +1 -1
  20. package/dist/browser/stores/sync-store.d.ts +140 -3
  21. package/dist/browser/stores/sync-store.d.ts.map +1 -1
  22. package/dist/browser/stores/sync-store.js +425 -36
  23. package/dist/browser/stores/sync-store.js.map +1 -1
  24. package/dist/core/client/kortix.d.ts +102 -1
  25. package/dist/core/client/kortix.d.ts.map +1 -1
  26. package/dist/core/client/kortix.js +78 -0
  27. package/dist/core/client/kortix.js.map +1 -1
  28. package/dist/core/files/client.d.ts +50 -2
  29. package/dist/core/files/client.d.ts.map +1 -1
  30. package/dist/core/files/client.js +253 -44
  31. package/dist/core/files/client.js.map +1 -1
  32. package/dist/core/files/types.d.ts +11 -0
  33. package/dist/core/files/types.d.ts.map +1 -1
  34. package/dist/core/http/abort-error.d.ts +89 -0
  35. package/dist/core/http/abort-error.d.ts.map +1 -0
  36. package/dist/core/http/abort-error.js +190 -0
  37. package/dist/core/http/abort-error.js.map +1 -0
  38. package/dist/core/http/api-client.d.ts.map +1 -1
  39. package/dist/core/http/api-client.js +28 -4
  40. package/dist/core/http/api-client.js.map +1 -1
  41. package/dist/core/http/impersonation.d.ts +58 -0
  42. package/dist/core/http/impersonation.d.ts.map +1 -0
  43. package/dist/core/http/impersonation.js +174 -0
  44. package/dist/core/http/impersonation.js.map +1 -0
  45. package/dist/core/rest/platform-client/github-app.d.ts +13 -0
  46. package/dist/core/rest/platform-client/github-app.d.ts.map +1 -1
  47. package/dist/core/rest/platform-client/github-app.js +2 -0
  48. package/dist/core/rest/platform-client/github-app.js.map +1 -1
  49. package/dist/core/rest/platform-client/members.d.ts +10 -64
  50. package/dist/core/rest/platform-client/members.d.ts.map +1 -1
  51. package/dist/core/rest/platform-client/members.js +10 -28
  52. package/dist/core/rest/platform-client/members.js.map +1 -1
  53. package/dist/core/rest/projects-client/accounts.d.ts +30 -1
  54. package/dist/core/rest/projects-client/accounts.d.ts.map +1 -1
  55. package/dist/core/rest/projects-client/accounts.js +1 -1
  56. package/dist/core/rest/projects-client/accounts.js.map +1 -1
  57. package/dist/core/rest/projects-client/agent-config.d.ts +21 -0
  58. package/dist/core/rest/projects-client/agent-config.d.ts.map +1 -1
  59. package/dist/core/rest/projects-client/agent-config.js +14 -0
  60. package/dist/core/rest/projects-client/agent-config.js.map +1 -1
  61. package/dist/core/rest/projects-client/apps.d.ts +13 -0
  62. package/dist/core/rest/projects-client/apps.d.ts.map +1 -1
  63. package/dist/core/rest/projects-client/apps.js.map +1 -1
  64. package/dist/core/rest/projects-client/assignments.d.ts +114 -0
  65. package/dist/core/rest/projects-client/assignments.d.ts.map +1 -0
  66. package/dist/core/rest/projects-client/assignments.js +91 -0
  67. package/dist/core/rest/projects-client/assignments.js.map +1 -0
  68. package/dist/core/rest/projects-client/billing.d.ts +80 -1
  69. package/dist/core/rest/projects-client/billing.d.ts.map +1 -1
  70. package/dist/core/rest/projects-client/billing.js +61 -2
  71. package/dist/core/rest/projects-client/billing.js.map +1 -1
  72. package/dist/core/rest/projects-client/connectors.d.ts +2 -0
  73. package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
  74. package/dist/core/rest/projects-client/connectors.js.map +1 -1
  75. package/dist/core/rest/projects-client/files.js +2 -2
  76. package/dist/core/rest/projects-client/files.js.map +1 -1
  77. package/dist/core/rest/projects-client/gateway.d.ts +51 -0
  78. package/dist/core/rest/projects-client/gateway.d.ts.map +1 -1
  79. package/dist/core/rest/projects-client/gateway.js.map +1 -1
  80. package/dist/core/rest/projects-client/iam.d.ts +51 -3
  81. package/dist/core/rest/projects-client/iam.d.ts.map +1 -1
  82. package/dist/core/rest/projects-client/iam.js +18 -1
  83. package/dist/core/rest/projects-client/iam.js.map +1 -1
  84. package/dist/core/rest/projects-client/index.d.ts +1 -0
  85. package/dist/core/rest/projects-client/index.d.ts.map +1 -1
  86. package/dist/core/rest/projects-client/index.js +1 -0
  87. package/dist/core/rest/projects-client/index.js.map +1 -1
  88. package/dist/core/rest/projects-client/projects.d.ts +1 -1
  89. package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
  90. package/dist/core/rest/projects-client/projects.js +3 -0
  91. package/dist/core/rest/projects-client/projects.js.map +1 -1
  92. package/dist/core/rest/projects-client/secrets.d.ts +11 -0
  93. package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
  94. package/dist/core/rest/projects-client/secrets.js +1 -1
  95. package/dist/core/rest/projects-client/secrets.js.map +1 -1
  96. package/dist/core/rest/projects-client/session-costs.d.ts +33 -0
  97. package/dist/core/rest/projects-client/session-costs.d.ts.map +1 -1
  98. package/dist/core/rest/projects-client/session-costs.js.map +1 -1
  99. package/dist/core/rest/projects-client/sessions.d.ts +253 -4
  100. package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
  101. package/dist/core/rest/projects-client/sessions.js +101 -4
  102. package/dist/core/rest/projects-client/sessions.js.map +1 -1
  103. package/dist/core/rest/projects-client/shared.d.ts +10 -1
  104. package/dist/core/rest/projects-client/shared.d.ts.map +1 -1
  105. package/dist/core/rest/projects-client/shared.js.map +1 -1
  106. package/dist/core/rest/projects-client/tokens.d.ts +13 -1
  107. package/dist/core/rest/projects-client/tokens.d.ts.map +1 -1
  108. package/dist/core/rest/projects-client/tokens.js +7 -2
  109. package/dist/core/rest/projects-client/tokens.js.map +1 -1
  110. package/dist/core/rest/projects-client/triggers.d.ts +69 -2
  111. package/dist/core/rest/projects-client/triggers.d.ts.map +1 -1
  112. package/dist/core/rest/projects-client/triggers.js +1 -1
  113. package/dist/core/rest/projects-client/triggers.js.map +1 -1
  114. package/dist/core/session/compaction.d.ts +98 -0
  115. package/dist/core/session/compaction.d.ts.map +1 -0
  116. package/dist/core/session/compaction.js +108 -0
  117. package/dist/core/session/compaction.js.map +1 -0
  118. package/dist/core/session/health.d.ts +22 -0
  119. package/dist/core/session/health.d.ts.map +1 -1
  120. package/dist/core/session/health.js +31 -5
  121. package/dist/core/session/health.js.map +1 -1
  122. package/dist/core/session/index.d.ts +2 -0
  123. package/dist/core/session/index.d.ts.map +1 -1
  124. package/dist/core/session/index.js +2 -0
  125. package/dist/core/session/index.js.map +1 -1
  126. package/dist/core/session/message-queue.d.ts +79 -15
  127. package/dist/core/session/message-queue.d.ts.map +1 -1
  128. package/dist/core/session/message-queue.js +73 -27
  129. package/dist/core/session/message-queue.js.map +1 -1
  130. package/dist/core/session/rewind.d.ts +76 -10
  131. package/dist/core/session/rewind.d.ts.map +1 -1
  132. package/dist/core/session/rewind.js +68 -11
  133. package/dist/core/session/rewind.js.map +1 -1
  134. package/dist/core/session/working.d.ts +241 -0
  135. package/dist/core/session/working.d.ts.map +1 -0
  136. package/dist/core/session/working.js +261 -0
  137. package/dist/core/session/working.js.map +1 -0
  138. package/dist/core/session-sync/session-sync-controller.d.ts +35 -20
  139. package/dist/core/session-sync/session-sync-controller.d.ts.map +1 -1
  140. package/dist/core/session-sync/session-sync-controller.js +48 -115
  141. package/dist/core/session-sync/session-sync-controller.js.map +1 -1
  142. package/dist/core/stream/event-stream.d.ts +22 -0
  143. package/dist/core/stream/event-stream.d.ts.map +1 -1
  144. package/dist/core/stream/event-stream.js +132 -36
  145. package/dist/core/stream/event-stream.js.map +1 -1
  146. package/dist/core/turns/classify.d.ts +5 -2
  147. package/dist/core/turns/classify.d.ts.map +1 -1
  148. package/dist/core/turns/classify.js +1 -0
  149. package/dist/core/turns/classify.js.map +1 -1
  150. package/dist/core/turns/errors.d.ts +11 -0
  151. package/dist/core/turns/errors.d.ts.map +1 -1
  152. package/dist/core/turns/errors.js +49 -2
  153. package/dist/core/turns/errors.js.map +1 -1
  154. package/dist/core/turns/grouping.d.ts +32 -2
  155. package/dist/core/turns/grouping.d.ts.map +1 -1
  156. package/dist/core/turns/grouping.js +31 -2
  157. package/dist/core/turns/grouping.js.map +1 -1
  158. package/dist/core/turns/index.d.ts +1 -0
  159. package/dist/core/turns/index.d.ts.map +1 -1
  160. package/dist/core/turns/index.js +1 -0
  161. package/dist/core/turns/index.js.map +1 -1
  162. package/dist/core/turns/open-turn.d.ts +81 -0
  163. package/dist/core/turns/open-turn.d.ts.map +1 -0
  164. package/dist/core/turns/open-turn.js +77 -0
  165. package/dist/core/turns/open-turn.js.map +1 -0
  166. package/dist/core/turns/state.d.ts +1 -1
  167. package/dist/core/turns/state.d.ts.map +1 -1
  168. package/dist/core/turns/state.js +29 -27
  169. package/dist/core/turns/state.js.map +1 -1
  170. package/dist/core/turns/types.d.ts +8 -0
  171. package/dist/core/turns/types.d.ts.map +1 -1
  172. package/dist/index.d.ts +3 -1
  173. package/dist/index.d.ts.map +1 -1
  174. package/dist/index.js +3 -1
  175. package/dist/index.js.map +1 -1
  176. package/dist/kortix.esm.min.js +25 -25
  177. package/dist/kortix.global.js +25 -25
  178. package/dist/node/server.d.ts.map +1 -1
  179. package/dist/node/server.js +14 -2
  180. package/dist/node/server.js.map +1 -1
  181. package/dist/react/index.d.ts +3 -1
  182. package/dist/react/index.d.ts.map +1 -1
  183. package/dist/react/index.js +8 -1
  184. package/dist/react/index.js.map +1 -1
  185. package/dist/react/initial-session-pin.d.ts +17 -0
  186. package/dist/react/initial-session-pin.d.ts.map +1 -1
  187. package/dist/react/initial-session-pin.js +58 -0
  188. package/dist/react/initial-session-pin.js.map +1 -1
  189. package/dist/react/opencode.d.ts +6 -2
  190. package/dist/react/opencode.d.ts.map +1 -1
  191. package/dist/react/opencode.js +5 -1
  192. package/dist/react/opencode.js.map +1 -1
  193. package/dist/react/prefetch-session-start.d.ts +10 -4
  194. package/dist/react/prefetch-session-start.d.ts.map +1 -1
  195. package/dist/react/prefetch-session-start.js +10 -4
  196. package/dist/react/prefetch-session-start.js.map +1 -1
  197. package/dist/react/query-keys.d.ts +8 -2
  198. package/dist/react/query-keys.d.ts.map +1 -1
  199. package/dist/react/query-keys.js +8 -2
  200. package/dist/react/query-keys.js.map +1 -1
  201. package/dist/react/session-start-stash.d.ts +25 -0
  202. package/dist/react/session-start-stash.d.ts.map +1 -1
  203. package/dist/react/session-start-stash.js +34 -3
  204. package/dist/react/session-start-stash.js.map +1 -1
  205. package/dist/react/session-title-sync.d.ts +5 -1
  206. package/dist/react/session-title-sync.d.ts.map +1 -1
  207. package/dist/react/session-title-sync.js +16 -4
  208. package/dist/react/session-title-sync.js.map +1 -1
  209. package/dist/react/use-admin-accounts.d.ts +121 -0
  210. package/dist/react/use-admin-accounts.d.ts.map +1 -1
  211. package/dist/react/use-admin-accounts.js +92 -0
  212. package/dist/react/use-admin-accounts.js.map +1 -1
  213. package/dist/react/use-can.d.ts +105 -0
  214. package/dist/react/use-can.d.ts.map +1 -0
  215. package/dist/react/use-can.js +190 -0
  216. package/dist/react/use-can.js.map +1 -0
  217. package/dist/react/use-canonical-opencode-session.d.ts +6 -1
  218. package/dist/react/use-canonical-opencode-session.d.ts.map +1 -1
  219. package/dist/react/use-canonical-opencode-session.js +46 -3
  220. package/dist/react/use-canonical-opencode-session.js.map +1 -1
  221. package/dist/react/use-impersonation.d.ts +54 -0
  222. package/dist/react/use-impersonation.d.ts.map +1 -0
  223. package/dist/react/use-impersonation.js +91 -0
  224. package/dist/react/use-impersonation.js.map +1 -0
  225. package/dist/react/use-opencode-events/handle-event.d.ts +10 -0
  226. package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -1
  227. package/dist/react/use-opencode-events/handle-event.js +76 -7
  228. package/dist/react/use-opencode-events/handle-event.js.map +1 -1
  229. package/dist/react/use-opencode-events/helpers.d.ts +21 -8
  230. package/dist/react/use-opencode-events/helpers.d.ts.map +1 -1
  231. package/dist/react/use-opencode-events/helpers.js +25 -26
  232. package/dist/react/use-opencode-events/helpers.js.map +1 -1
  233. package/dist/react/use-opencode-events/index.d.ts.map +1 -1
  234. package/dist/react/use-opencode-events/index.js +43 -26
  235. package/dist/react/use-opencode-events/index.js.map +1 -1
  236. package/dist/react/use-opencode-events/use-event-stream-refs.d.ts.map +1 -1
  237. package/dist/react/use-opencode-events/use-event-stream-refs.js +66 -3
  238. package/dist/react/use-opencode-events/use-event-stream-refs.js.map +1 -1
  239. package/dist/react/use-opencode-local.d.ts +17 -0
  240. package/dist/react/use-opencode-local.d.ts.map +1 -1
  241. package/dist/react/use-opencode-local.js +41 -7
  242. package/dist/react/use-opencode-local.js.map +1 -1
  243. package/dist/react/use-opencode-sessions/messages.d.ts +101 -1
  244. package/dist/react/use-opencode-sessions/messages.d.ts.map +1 -1
  245. package/dist/react/use-opencode-sessions/messages.js +481 -63
  246. package/dist/react/use-opencode-sessions/messages.js.map +1 -1
  247. package/dist/react/use-project-apps.d.ts +24 -1
  248. package/dist/react/use-project-apps.d.ts.map +1 -1
  249. package/dist/react/use-project-apps.js +5 -3
  250. package/dist/react/use-project-apps.js.map +1 -1
  251. package/dist/react/use-runtime-boot-stalled.d.ts +32 -0
  252. package/dist/react/use-runtime-boot-stalled.d.ts.map +1 -0
  253. package/dist/react/use-runtime-boot-stalled.js +48 -0
  254. package/dist/react/use-runtime-boot-stalled.js.map +1 -0
  255. package/dist/react/use-runtime-reconnect.d.ts +67 -1
  256. package/dist/react/use-runtime-reconnect.d.ts.map +1 -1
  257. package/dist/react/use-runtime-reconnect.js +116 -18
  258. package/dist/react/use-runtime-reconnect.js.map +1 -1
  259. package/dist/react/use-session-prompts.d.ts +113 -0
  260. package/dist/react/use-session-prompts.d.ts.map +1 -0
  261. package/dist/react/use-session-prompts.js +242 -0
  262. package/dist/react/use-session-prompts.js.map +1 -0
  263. package/dist/react/use-session-send.d.ts +169 -20
  264. package/dist/react/use-session-send.d.ts.map +1 -1
  265. package/dist/react/use-session-send.js +178 -29
  266. package/dist/react/use-session-send.js.map +1 -1
  267. package/dist/react/use-session-sync.d.ts +35 -2
  268. package/dist/react/use-session-sync.d.ts.map +1 -1
  269. package/dist/react/use-session-sync.js +46 -9
  270. package/dist/react/use-session-sync.js.map +1 -1
  271. package/dist/react/use-session-working.d.ts +57 -0
  272. package/dist/react/use-session-working.d.ts.map +1 -0
  273. package/dist/react/use-session-working.js +178 -0
  274. package/dist/react/use-session-working.js.map +1 -0
  275. package/dist/react/use-session.d.ts +122 -5
  276. package/dist/react/use-session.d.ts.map +1 -1
  277. package/dist/react/use-session.js +343 -69
  278. package/dist/react/use-session.js.map +1 -1
  279. package/package.json +2 -2
  280. package/dist/browser/stores/tab-store.d.ts +0 -91
  281. package/dist/browser/stores/tab-store.d.ts.map +0 -1
  282. package/dist/browser/stores/tab-store.js +0 -369
  283. package/dist/browser/stores/tab-store.js.map +0 -1
  284. package/dist/core/session/send-queue.d.ts +0 -70
  285. package/dist/core/session/send-queue.d.ts.map +0 -1
  286. package/dist/core/session/send-queue.js +0 -116
  287. package/dist/core/session/send-queue.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../../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 'admin' | 'member';
2
- export type ProjectRole = 'manager' | 'editor' | 'member';
2
+ /**
3
+ * The two built-in project roles. `member` is read + run; `manager` is
4
+ * everything (including members, delete, and every Customize surface).
5
+ *
6
+ * BREAKING (2026-08-18): the third role `editor` is removed. It held exactly
7
+ * what `manager` holds minus member-management and delete, and the extra tier
8
+ * bought nothing — every `editor` assignment became `manager`. The API rejects
9
+ * `editor` on write with `400`; it is never returned on read.
10
+ */
11
+ export type ProjectRole = 'manager' | 'member';
3
12
  export type ConnectorSharing = {
4
13
  mode: 'project';
5
14
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/shared.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEnE,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;I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AAI,CAAC,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IACvD,MAAM,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,EAAE;YACxC,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;gBAC3C,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;SACpD,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;QACzB,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAM,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -33,8 +33,20 @@ export interface CreatedAccountToken {
33
33
  expires_at: string | null;
34
34
  created_at: string;
35
35
  }
36
+ export interface ListAccountTokensOptions {
37
+ /**
38
+ * Narrow the list to the CALLER'S OWN hand-minted keys — no other member's
39
+ * keys, no session connector tokens, no service-account bearers. This is the
40
+ * read behind a person's own settings page; omit it for the administrative
41
+ * account-wide list.
42
+ *
43
+ * The narrowing is server-side on purpose: the response carries no
44
+ * `user_id`, `session_id` or `service_account_id`, so a client cannot do it.
45
+ */
46
+ mine?: boolean;
47
+ }
36
48
  /** List CLI PATs for an account (defaults to the caller's resolved account). */
37
- export declare function listAccountTokens(accountId?: string): Promise<AccountToken[]>;
49
+ export declare function listAccountTokens(accountId?: string, options?: ListAccountTokensOptions): Promise<AccountToken[]>;
38
50
  /** Mint a new account-scoped CLI PAT. The `secret_key` is returned once — the
39
51
  * caller must persist it immediately; subsequent reads only ever see `public_key`. */
40
52
  export declare function createAccountToken(input: CreateAccountTokenInput): Promise<CreatedAccountToken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E,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B;AAED,6EAA6E;AAC7E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,wCAI3D;AAED,4FAA4F;AAC5F,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,mCAQ1B;AAED,wBAAsB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;QAE5C,OAAO;GAIxC"}
@@ -10,8 +10,13 @@
10
10
  import { backendApi } from '../../http/api-client.js';
11
11
  import { unwrap } from './shared.js';
12
12
  /** List CLI PATs for an account (defaults to the caller's resolved account). */
13
- export async function listAccountTokens(accountId) {
14
- const qs = accountId ? `?account_id=${encodeURIComponent(accountId)}` : '';
13
+ export async function listAccountTokens(accountId, options) {
14
+ const params = new URLSearchParams();
15
+ if (accountId)
16
+ params.set('account_id', accountId);
17
+ if (options?.mine)
18
+ params.set('mine', 'true');
19
+ const qs = params.size > 0 ? `?${params.toString()}` : '';
15
20
  return unwrap(await backendApi.get(`/accounts/tokens${qs}`));
16
21
  }
17
22
  /** Mint a new account-scoped CLI PAT. The `secret_key` is returned once — the
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/tokens.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,oEAAoE;AACpE,0EAA0E;AAC1E,oEAAoE;AACpE,yEAAyE;AACzE,4EAA4E;AAC5E,mEAAmE;AACnE,yEAAyE;AACzE,wDAAwD;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAwClC,gFAAgF;AAChF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,SAAkB;IACxD,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,eAAe,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3E,OAAO,MAAM,CAAC,MAAM,UAAU,CAAC,GAAG,CAAiB,mBAAmB,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED;uFACuF;AACvF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAA8B;IACrE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACxD,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CAAsB,kBAAkB,EAAE;QAC7D,IAAI;QACJ,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChD,CAA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AS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3E,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,MAAM,CAAkB,oBAAoB,OAAO,GAAG,EAAE,EAAE,CAAC,CAC7E,CAAC;AACJ,CAAC;AAoCD,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,SAAiB;IAC1D,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAA8B,aAAa,SAAS,YAAY,CAAC,CACtF,CAAC;AACJ,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,SAAiB,EACjB,KAAyB;IAEzB,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CACnB,aAAa,SAAS,YAAY,EAClC,KAAK,IAAI,EAAE,CACZ,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,SAAiB,EAAE,OAAe;IAC5E,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,MAAM,CACrB,aAAa,SAAS,cAAc,OAAO,EAAE,CAC9C,CACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,14 @@
1
- export type ProjectTriggerType = 'cron' | 'webhook';
1
+ export type ProjectTriggerType = 'cron' | 'webhook' | 'monitor';
2
+ /**
3
+ * How the platform runs a `type: monitor` trigger's `run` command:
4
+ * - `poll` — run it every `interval`, print, exit.
5
+ * - `stream` — run it once and keep it alive.
6
+ *
7
+ * Both shapes emit events as stdout lines, so nothing downstream (filter →
8
+ * prompt template → session_mode) can tell them apart.
9
+ * See docs/specs/2026-08-12-monitors.md.
10
+ */
11
+ export type ProjectMonitorMode = 'poll' | 'stream';
2
12
  /**
3
13
  * How each fire uses sessions:
4
14
  * - `fresh` (default) — a brand-new session per run.
@@ -8,6 +18,15 @@ export type ProjectTriggerType = 'cron' | 'webhook';
8
18
  * trigger fans out into a session per chat / customer / repo.
9
19
  */
10
20
  export type ProjectTriggerSessionMode = 'fresh' | 'reuse' | 'pinned' | 'keyed';
21
+ /**
22
+ * Who may open sessions created by this trigger. The trigger agent remains the
23
+ * owner. Project managers always retain access, including in `private` mode.
24
+ */
25
+ export interface TriggerSessionAccess {
26
+ mode: 'private' | 'project' | 'members';
27
+ memberIds: string[];
28
+ groupIds: string[];
29
+ }
11
30
  /** Parsed trigger spec — what the listing endpoint returns. */
12
31
  export interface ProjectTrigger {
13
32
  /** URL-safe slug (the filename minus `.md`). */
@@ -29,6 +48,22 @@ export interface ProjectTrigger {
29
48
  timezone: string;
30
49
  /** project_secrets key holding the webhook HMAC secret. */
31
50
  secret_env: string | null;
51
+ /**
52
+ * For type='monitor' only — the repo-relative command the platform
53
+ * supervises 24/7 in the project's monitor box. Its stdout lines are the
54
+ * events; nothing else is. Null on cron/webhook.
55
+ */
56
+ run: string | null;
57
+ /** For type='monitor' only — see {@link ProjectMonitorMode}. Null otherwise. */
58
+ mode: ProjectMonitorMode | null;
59
+ /** For mode='poll' only — the poll period in whole seconds. Null otherwise. */
60
+ interval_seconds: number | null;
61
+ /**
62
+ * For type='monitor' only — the silence watchdog in whole seconds. No event
63
+ * inside this window synthesizes a `silent` lifecycle event, so a wedged
64
+ * monitor can never fail silently. Null when the monitor declares none.
65
+ */
66
+ expect_event_within_seconds: number | null;
32
67
  prompt_template: string;
33
68
  /** Session strategy — see {@link ProjectTriggerSessionMode}. */
34
69
  session_mode: ProjectTriggerSessionMode;
@@ -48,6 +83,8 @@ export interface ProjectTrigger {
48
83
  * when unfiltered.
49
84
  */
50
85
  filter: Record<string, string> | null;
86
+ /** Access policy applied to every session this trigger creates. */
87
+ session_access: TriggerSessionAccess;
51
88
  last_fired_at: string | null;
52
89
  /** Public fire URL for webhook triggers; null for cron. */
53
90
  webhook_url: string | null;
@@ -95,7 +132,22 @@ export interface CreateProjectTriggerInput {
95
132
  timezone?: string;
96
133
  /** For type='webhook'. Name of a project_secrets entry. */
97
134
  secret_env?: string;
98
- /** Session strategy across fires. Omit for the default 'fresh'. */
135
+ /** Required for type='monitor'. Repo-relative command whose stdout lines fire. */
136
+ run?: string;
137
+ /** Required for type='monitor'. See {@link ProjectMonitorMode}. */
138
+ mode?: ProjectMonitorMode;
139
+ /**
140
+ * Required for mode='poll', rejected on mode='stream'. Duration literal
141
+ * (`30s`, `5m`, `24h`, `7d`), floor 30s. Never a bare number.
142
+ */
143
+ interval?: string;
144
+ /** For type='monitor'. Silence watchdog as a duration literal; floor 5m. */
145
+ expect_event_within?: string;
146
+ /**
147
+ * Session strategy across fires. Omit for the type's default — 'fresh' on
148
+ * cron/webhook, 'reuse' on monitor (a monitor fires repeatedly by design, so
149
+ * 'fresh' would mint a session per event).
150
+ */
99
151
  session_mode?: ProjectTriggerSessionMode;
100
152
  /** Required when session_mode === 'pinned': the session id to loop. */
101
153
  session_id?: string | null;
@@ -107,6 +159,8 @@ export interface CreateProjectTriggerInput {
107
159
  session_key?: string | null;
108
160
  /** Payload paths mapped to the value they must equal for the trigger to fire. */
109
161
  filter?: Record<string, string> | null;
162
+ /** Defaults to private. This is account-local runtime state, not manifest config. */
163
+ session_access?: TriggerSessionAccess;
110
164
  }
111
165
  export interface UpdateProjectTriggerInput {
112
166
  name?: string;
@@ -120,12 +174,25 @@ export interface UpdateProjectTriggerInput {
120
174
  run_at?: string | null;
121
175
  timezone?: string;
122
176
  secret_env?: string;
177
+ /** For type='monitor'. Repo-relative command whose stdout lines fire. */
178
+ run?: string;
179
+ /** For type='monitor'. See {@link ProjectMonitorMode}. */
180
+ mode?: ProjectMonitorMode;
181
+ /**
182
+ * For mode='poll'. Duration literal (`30s`, `5m`, `24h`, `7d`), floor 30s.
183
+ * null clears it — required when switching a poll monitor to 'stream'.
184
+ */
185
+ interval?: string | null;
186
+ /** For type='monitor'. Duration literal, floor 5m. null clears the watchdog. */
187
+ expect_event_within?: string | null;
123
188
  session_mode?: ProjectTriggerSessionMode;
124
189
  session_id?: string | null;
125
190
  /** See {@link CreateProjectTriggerInput.session_key}. null clears it. */
126
191
  session_key?: string | null;
127
192
  /** null or {} clears the filter. */
128
193
  filter?: Record<string, string> | null;
194
+ /** Replaces the policy and updates prior sessions created by this trigger. */
195
+ session_access?: TriggerSessionAccess;
129
196
  }
130
197
  export declare function listProjectTriggers(projectId: string): Promise<ProjectTriggerListing>;
131
198
  export declare function createProjectTrigger(projectId: string, input: CreateProjectTriggerInput): Promise<ProjectTriggerListing>;
@@ -1 +1 @@
1
- {"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/triggers.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/E,+DAA+D;AAC/D,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb;6DACyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,kBAAkB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd;;kCAE8B;IAC9B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,wFAAwF;IACxF,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,YAAY,EAAE,yBAAyB,CAAC;IACxC,iFAAiF;IACjF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAA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.
1
+ // Triggers — cron/webhook/monitor triggers defined in the project manifest.
2
2
  import { backendApi } from '../../http/api-client.js';
3
3
  import { unwrap } from './shared.js';
4
4
  export async function listProjectTriggers(projectId) {
@@ -1 +1 @@
1
- {"version":3,"file":"triggers.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/triggers.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAkJlC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,SAAiB;IACzD,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAClB,aAAa,SAAS,WAAW,CAClC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,KAAgC;IAEhC,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CACnB,aAAa,SAAS,WAAW,EACjC,KAAK,CACN,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,IAAY,EACZ,KAAgC;IAEhC,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,KAAK,CACpB,aAAa,SAAS,aAAa,IAAI,EAAE,EACzC,KAAK,CACN,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,SAAiB,EAAE,IAAY;IACxE,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,MAAM,CACrB,aAAa,SAAS,aAAa,IAAI,EAAE,CAC1C,CACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,SAAiB,EACjB,MAAe;IAEf,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,KAAK,CACpB,aAAa,SAAS,sBAAsB,EAC5C,EAAE,MAAM,EAAE,CACX,CACF,CAAC;AACJ,CAAC;AASD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,SAAiB,EAAE,IAAY;IACtE,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CACnB,aAAa,SAAS,aAAa,IAAI,OAAO,EAC9C,EAAE,CACH,CACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"triggers.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/triggers.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAuNlC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,SAAiB;IACzD,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAClB,aAAa,SAAS,WAAW,CAClC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,KAAgC;IAEhC,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CACnB,aAAa,SAAS,WAAW,EACjC,KAAK,CACN,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,IAAY,EACZ,KAAgC;IAEhC,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,KAAK,CACpB,aAAa,SAAS,aAAa,IAAI,EAAE,EACzC,KAAK,CACN,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,SAAiB,EAAE,IAAY;IACxE,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,MAAM,CACrB,aAAa,SAAS,aAAa,IAAI,EAAE,CAC1C,CACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,SAAiB,EACjB,MAAe;IAEf,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,KAAK,CACpB,aAAa,SAAS,sBAAsB,EAC5C,EAAE,MAAM,EAAE,CACX,CACF,CAAC;AACJ,CAAC;AASD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,SAAiB,EAAE,IAAY;IACtE,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CACnB,aAAa,SAAS,aAAa,IAAI,OAAO,EAC9C,EAAE,CACH,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Is this session COMPACTING? One pure projection, shaped like `working.ts`.
3
+ *
4
+ * Compaction is not a turn — `GET .../turn` reports nothing for it and the
5
+ * working projection deliberately knows nothing about it — but the composer
6
+ * still has to hold while it runs, so it had its own answer. That answer was a
7
+ * client-only boolean set by `startCompaction` and cleared ONLY by the
8
+ * `session.compacted` SSE frame: an unbounded latch on a signal that can be
9
+ * lost, which is the same defect the working projection was built to end.
10
+ *
11
+ * Two honest inputs replace it:
12
+ *
13
+ * - `serverCompactingAtMs` — `Session.time.compacting`, the runtime's own
14
+ * record, which nothing in this repo read before. It is what makes a
15
+ * compaction started by a second device or a trigger visible here at all.
16
+ * - `optimisticAtMs` — this tab's own `/compact`, which is accepted locally
17
+ * long before the row exists, and is therefore BOUNDED.
18
+ */
19
+ /**
20
+ * How long this tab's own `/compact` may claim `compacting` on its own.
21
+ *
22
+ * Generous next to a real compaction (a summarize call against the whole
23
+ * transcript), and finite because the release signal is one SSE frame. Missing
24
+ * that frame — a backgrounded tab, a stream reconnect — used to pin the
25
+ * composer for the lifetime of the tab.
26
+ */
27
+ export declare const OPTIMISTIC_COMPACTION_MAX_MS = 60000;
28
+ export interface CompactionInputs {
29
+ /** ms epoch at which this tab issued `/compact`, or null. */
30
+ optimisticAtMs: number | null;
31
+ /** `Session.time.compacting` from the runtime session row, or null. */
32
+ serverCompactingAtMs: number | null;
33
+ nowMs: number;
34
+ }
35
+ /**
36
+ * Precedence, and there are only two rules:
37
+ *
38
+ * 1. The runtime says a compaction is open → compacting. It is an observation
39
+ * of the server's own row, so it is not bounded here; the row is cleared by
40
+ * the refetch `session.compacted` already triggers.
41
+ * 2. Otherwise this tab's own unanswered `/compact`, until it ages out.
42
+ */
43
+ export declare function projectCompacting(inputs: CompactionInputs): boolean;
44
+ /**
45
+ * The next instant at which {@link projectCompacting} could answer differently
46
+ * on its own — i.e. when the optimistic stamp ages out.
47
+ *
48
+ * The projection is pure and moves with `nowMs`, so something has to ask it
49
+ * again at that instant or the cap is never applied. Nothing else re-renders
50
+ * when a compaction quietly outlives its stamp: the store slot has not changed,
51
+ * the transcript is idle, and the lost frame is precisely the case where no
52
+ * further event arrives. Same mechanism, same reason, as `workingExpiryAtMs`.
53
+ *
54
+ * `null` when nothing is left to expire (deadlines already past are skipped, so
55
+ * re-arming from what this returns terminates).
56
+ */
57
+ export declare function compactionExpiryAtMs(inputs: CompactionInputs): number | null;
58
+ /**
59
+ * How long a SERVER-observed `Session.time.compacting` may go unconfirmed
60
+ * before the caller must force a fresh read instead of trusting the cached
61
+ * row forever.
62
+ *
63
+ * Rule 1 of {@link projectCompacting} treats any non-null
64
+ * `serverCompactingAtMs` as authoritative for as long as it is observed — by
65
+ * design, since it is the runtime's own record, not a guess, and
66
+ * {@link compactionExpiryAtMs} deliberately arms no timer for it. But the
67
+ * only event that is SUPPOSED to clear that cached row
68
+ * (`session.compacted`, handled in `use-opencode-events/handle-event.ts`) can
69
+ * be lost the exact same way any SSE frame can — a backgrounded tab, a
70
+ * stream reconnect — and the targeted refetch that handler fires is its own
71
+ * network call that can itself fail. `useOpenCodeSession`
72
+ * (`use-opencode-sessions/sessions.ts`) reads the row with
73
+ * `staleTime: Infinity` and nothing else ever refetches it, so without a
74
+ * ceiling here "authoritative" becomes "wedged for the tab's lifetime" the
75
+ * moment either of those is lost — reproducing the exact unbounded-latch
76
+ * class this module exists to end.
77
+ *
78
+ * This is that ceiling. It does not change `projectCompacting`'s answer —
79
+ * rule 1 stays authoritative right up to the deadline — it only tells the
80
+ * caller (`use-session.ts`) WHEN to stop trusting the cached row and ask the
81
+ * server again, independent of whether `session.compacted` ever arrives.
82
+ */
83
+ export declare const SERVER_COMPACTION_REVALIDATE_MS = 90000;
84
+ /**
85
+ * The next instant at which a server-observed compaction flag needs a live
86
+ * re-check (see {@link SERVER_COMPACTION_REVALIDATE_MS}), or `null` when no
87
+ * server flag is currently observed.
88
+ *
89
+ * Unlike {@link compactionExpiryAtMs}, this CAN return an instant already in
90
+ * the past: the deadline is anchored to `serverCompactingAtMs` (when the flag
91
+ * was FIRST observed), not to `nowMs`, so a session mounted well after
92
+ * compaction started — or one whose revalidation kept re-arming because the
93
+ * server kept confirming `compacting: true` — can already be overdue the
94
+ * moment this is read. The caller fires the re-check immediately in that
95
+ * case rather than skip it: a stale flag discovered late is still stale.
96
+ */
97
+ export declare function serverCompactionRevalidateAtMs(inputs: CompactionInputs): number | null;
98
+ //# sourceMappingURL=compaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../../src/core/session/compaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,uEAAuE;IACvE,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAInE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAK5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,+BAA+B,QAAS,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAGtF"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Is this session COMPACTING? One pure projection, shaped like `working.ts`.
3
+ *
4
+ * Compaction is not a turn — `GET .../turn` reports nothing for it and the
5
+ * working projection deliberately knows nothing about it — but the composer
6
+ * still has to hold while it runs, so it had its own answer. That answer was a
7
+ * client-only boolean set by `startCompaction` and cleared ONLY by the
8
+ * `session.compacted` SSE frame: an unbounded latch on a signal that can be
9
+ * lost, which is the same defect the working projection was built to end.
10
+ *
11
+ * Two honest inputs replace it:
12
+ *
13
+ * - `serverCompactingAtMs` — `Session.time.compacting`, the runtime's own
14
+ * record, which nothing in this repo read before. It is what makes a
15
+ * compaction started by a second device or a trigger visible here at all.
16
+ * - `optimisticAtMs` — this tab's own `/compact`, which is accepted locally
17
+ * long before the row exists, and is therefore BOUNDED.
18
+ */
19
+ /**
20
+ * How long this tab's own `/compact` may claim `compacting` on its own.
21
+ *
22
+ * Generous next to a real compaction (a summarize call against the whole
23
+ * transcript), and finite because the release signal is one SSE frame. Missing
24
+ * that frame — a backgrounded tab, a stream reconnect — used to pin the
25
+ * composer for the lifetime of the tab.
26
+ */
27
+ export const OPTIMISTIC_COMPACTION_MAX_MS = 60_000;
28
+ /**
29
+ * Precedence, and there are only two rules:
30
+ *
31
+ * 1. The runtime says a compaction is open → compacting. It is an observation
32
+ * of the server's own row, so it is not bounded here; the row is cleared by
33
+ * the refetch `session.compacted` already triggers.
34
+ * 2. Otherwise this tab's own unanswered `/compact`, until it ages out.
35
+ */
36
+ export function projectCompacting(inputs) {
37
+ if (inputs.serverCompactingAtMs !== null)
38
+ return true;
39
+ if (inputs.optimisticAtMs === null)
40
+ return false;
41
+ return inputs.nowMs - inputs.optimisticAtMs < OPTIMISTIC_COMPACTION_MAX_MS;
42
+ }
43
+ /**
44
+ * The next instant at which {@link projectCompacting} could answer differently
45
+ * on its own — i.e. when the optimistic stamp ages out.
46
+ *
47
+ * The projection is pure and moves with `nowMs`, so something has to ask it
48
+ * again at that instant or the cap is never applied. Nothing else re-renders
49
+ * when a compaction quietly outlives its stamp: the store slot has not changed,
50
+ * the transcript is idle, and the lost frame is precisely the case where no
51
+ * further event arrives. Same mechanism, same reason, as `workingExpiryAtMs`.
52
+ *
53
+ * `null` when nothing is left to expire (deadlines already past are skipped, so
54
+ * re-arming from what this returns terminates).
55
+ */
56
+ export function compactionExpiryAtMs(inputs) {
57
+ if (inputs.serverCompactingAtMs !== null)
58
+ return null;
59
+ if (inputs.optimisticAtMs === null)
60
+ return null;
61
+ const deadline = inputs.optimisticAtMs + OPTIMISTIC_COMPACTION_MAX_MS;
62
+ return deadline > inputs.nowMs ? deadline : null;
63
+ }
64
+ /**
65
+ * How long a SERVER-observed `Session.time.compacting` may go unconfirmed
66
+ * before the caller must force a fresh read instead of trusting the cached
67
+ * row forever.
68
+ *
69
+ * Rule 1 of {@link projectCompacting} treats any non-null
70
+ * `serverCompactingAtMs` as authoritative for as long as it is observed — by
71
+ * design, since it is the runtime's own record, not a guess, and
72
+ * {@link compactionExpiryAtMs} deliberately arms no timer for it. But the
73
+ * only event that is SUPPOSED to clear that cached row
74
+ * (`session.compacted`, handled in `use-opencode-events/handle-event.ts`) can
75
+ * be lost the exact same way any SSE frame can — a backgrounded tab, a
76
+ * stream reconnect — and the targeted refetch that handler fires is its own
77
+ * network call that can itself fail. `useOpenCodeSession`
78
+ * (`use-opencode-sessions/sessions.ts`) reads the row with
79
+ * `staleTime: Infinity` and nothing else ever refetches it, so without a
80
+ * ceiling here "authoritative" becomes "wedged for the tab's lifetime" the
81
+ * moment either of those is lost — reproducing the exact unbounded-latch
82
+ * class this module exists to end.
83
+ *
84
+ * This is that ceiling. It does not change `projectCompacting`'s answer —
85
+ * rule 1 stays authoritative right up to the deadline — it only tells the
86
+ * caller (`use-session.ts`) WHEN to stop trusting the cached row and ask the
87
+ * server again, independent of whether `session.compacted` ever arrives.
88
+ */
89
+ export const SERVER_COMPACTION_REVALIDATE_MS = 90_000;
90
+ /**
91
+ * The next instant at which a server-observed compaction flag needs a live
92
+ * re-check (see {@link SERVER_COMPACTION_REVALIDATE_MS}), or `null` when no
93
+ * server flag is currently observed.
94
+ *
95
+ * Unlike {@link compactionExpiryAtMs}, this CAN return an instant already in
96
+ * the past: the deadline is anchored to `serverCompactingAtMs` (when the flag
97
+ * was FIRST observed), not to `nowMs`, so a session mounted well after
98
+ * compaction started — or one whose revalidation kept re-arming because the
99
+ * server kept confirming `compacting: true` — can already be overdue the
100
+ * moment this is read. The caller fires the re-check immediately in that
101
+ * case rather than skip it: a stale flag discovered late is still stale.
102
+ */
103
+ export function serverCompactionRevalidateAtMs(inputs) {
104
+ if (inputs.serverCompactingAtMs === null)
105
+ return null;
106
+ return inputs.serverCompactingAtMs + SERVER_COMPACTION_REVALIDATE_MS;
107
+ }
108
+ //# sourceMappingURL=compaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compaction.js","sourceRoot":"","sources":["../../../src/core/session/compaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAUnD;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAwB;IACxD,IAAI,MAAM,CAAC,oBAAoB,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACtD,IAAI,MAAM,CAAC,cAAc,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACjD,OAAO,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,cAAc,GAAG,4BAA4B,CAAC;AAC7E,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAwB;IAC3D,IAAI,MAAM,CAAC,oBAAoB,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACtD,IAAI,MAAM,CAAC,cAAc,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChD,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc,GAAG,4BAA4B,CAAC;IACtE,OAAO,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,8BAA8B,CAAC,MAAwB;IACrE,IAAI,MAAM,CAAC,oBAAoB,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACtD,OAAO,MAAM,CAAC,oBAAoB,GAAG,+BAA+B,CAAC;AACvE,CAAC"}
@@ -22,6 +22,24 @@ export type SessionHealthResponse = {
22
22
  reason?: string | null;
23
23
  message?: string | null;
24
24
  };
25
+ /**
26
+ * Which hop of the sandbox proxy produced a failure, as the proxy itself
27
+ * reports it. Mirrors `apps/api/src/sandbox-proxy/proxy-hop.ts` — the two lists
28
+ * are one wire contract and must not drift.
29
+ *
30
+ * - `control_plane` — the platform answered from the session row; the box
31
+ * was never dialled.
32
+ * - `provider_ingress` — no address for the box, or its edge refused.
33
+ * - `daemon` — the box answers, the runtime process does not.
34
+ * - `upstream_port` — the user's own process on an app port is down.
35
+ *
36
+ * Only the middle two are evidence that the RUNTIME is unreachable.
37
+ */
38
+ export type ProxyHop = 'control_plane' | 'provider_ingress' | 'daemon' | 'upstream_port';
39
+ /** Narrow an untrusted header/body value to a hop, or null. Anything the proxy
40
+ * did not attribute — an intermediary's own 502, an older deployment — must
41
+ * read as "unattributed", never as a hop we happen to be lenient about. */
42
+ export declare function parseProxyHop(value: unknown): ProxyHop | null;
25
43
  export interface SessionHealthResult {
26
44
  /** HTTP status of the probe (0 when there is no active runtime URL). */
27
45
  status: number;
@@ -30,6 +48,10 @@ export interface SessionHealthResult {
30
48
  health: SessionHealthResponse | null;
31
49
  /** Raw response text — useful for non-ok diagnostics. */
32
50
  body: string;
51
+ /** Which proxy hop produced a failure, or null when nothing attributed it. */
52
+ hop: ProxyHop | null;
53
+ /** The status the failing hop itself returned, when it returned one. */
54
+ upstreamStatus: number | null;
33
55
  }
34
56
  /** Whether a health payload indicates the OpenCode runtime is ready. */
35
57
  export declare function isRuntimeReady(health: SessionHealthResponse | null): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../../src/core/session/health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,OAAO,CAAC;IACZ,iEAAiE;IACjE,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACrC,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,GAAG,OAAO,CAU5E;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,EAC1B,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAgB9B"}
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../../src/core/session/health.ts"],"names":[],"mappings":"AAA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rl } from './server-store/active.js';
18
+ const PROXY_HOPS = [
19
+ 'control_plane',
20
+ 'provider_ingress',
21
+ 'daemon',
22
+ 'upstream_port',
23
+ ];
24
+ /** Narrow an untrusted header/body value to a hop, or null. Anything the proxy
25
+ * did not attribute — an intermediary's own 502, an older deployment — must
26
+ * read as "unattributed", never as a hop we happen to be lenient about. */
27
+ export function parseProxyHop(value) {
28
+ return typeof value === 'string' && PROXY_HOPS.includes(value) ? value : null;
29
+ }
18
30
  /** Whether a health payload indicates the OpenCode runtime is ready. */
19
31
  export function isRuntimeReady(health) {
20
32
  if (!health)
@@ -42,16 +54,30 @@ export function isRuntimeReady(health) {
42
54
  export async function getSessionHealth(runtimeUrl, init) {
43
55
  const url = (runtimeUrl === undefined ? getActiveOpenCodeUrl() : runtimeUrl) || null;
44
56
  if (!url)
45
- return { status: 0, ok: false, health: null, body: '' };
57
+ return { status: 0, ok: false, health: null, body: '', hop: null, upstreamStatus: null };
46
58
  const res = await authenticatedFetch(`${url}/kortix/health`, { method: 'GET', ...init }, { retryOnAuthError: false });
47
59
  const body = await res.text().catch(() => '');
48
- let health = null;
60
+ let parsed = null;
49
61
  try {
50
- health = body ? JSON.parse(body) : null;
62
+ parsed = body ? JSON.parse(body) : null;
51
63
  }
52
64
  catch {
53
- health = null;
65
+ parsed = null;
54
66
  }
55
- return { status: res.status, ok: res.ok, health, body };
67
+ const health = parsed;
68
+ // Header first, body second. The header survives a HEAD and the proxy's HTML
69
+ // error page; the body fallback covers a deployment whose CORS config does not
70
+ // expose the header yet, where reading it would silently yield null.
71
+ const hop = parseProxyHop(res.headers.get('X-Kortix-Proxy-Hop')) ?? parseProxyHop(parsed?.hop);
72
+ // `Number(null)` and `Number('')` are both 0, so the `> 0` guard is what
73
+ // separates "absent" from a real status — there is no HTTP status 0.
74
+ const headerUpstream = Number(res.headers.get('X-Kortix-Upstream-Status'));
75
+ const bodyUpstream = parsed?.upstream_status;
76
+ const upstreamStatus = Number.isFinite(headerUpstream) && headerUpstream > 0
77
+ ? headerUpstream
78
+ : typeof bodyUpstream === 'number'
79
+ ? bodyUpstream
80
+ : null;
81
+ return { status: res.status, ok: res.ok, health, body, hop, upstreamStatus };
56
82
  }
57
83
  //# sourceMappingURL=health.js.map