tuturuuu 0.27.0 → 0.28.1-dev.10.83523f0

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 (725) hide show
  1. package/bin/ttr.cjs +13 -0
  2. package/dist/_portable/internal-api/client.d.ts +56 -0
  3. package/dist/_portable/internal-api/client.d.ts.map +1 -0
  4. package/dist/_portable/internal-api/client.js +601 -0
  5. package/dist/_portable/internal-api/client.js.map +1 -0
  6. package/dist/_portable/internal-api/external-projects.d.ts +620 -0
  7. package/dist/_portable/internal-api/external-projects.d.ts.map +1 -0
  8. package/dist/_portable/internal-api/external-projects.js +652 -0
  9. package/dist/_portable/internal-api/external-projects.js.map +1 -0
  10. package/dist/_portable/internal-api/hidden-workspaces.d.ts +10 -0
  11. package/dist/_portable/internal-api/hidden-workspaces.d.ts.map +1 -0
  12. package/dist/_portable/internal-api/hidden-workspaces.js +17 -0
  13. package/dist/_portable/internal-api/hidden-workspaces.js.map +1 -0
  14. package/dist/_portable/internal-api/internal-api-error.d.ts +7 -0
  15. package/dist/_portable/internal-api/internal-api-error.d.ts.map +1 -0
  16. package/dist/_portable/internal-api/internal-api-error.js +53 -0
  17. package/dist/_portable/internal-api/internal-api-error.js.map +1 -0
  18. package/dist/_portable/internal-api/product-feedback.d.ts +58 -0
  19. package/dist/_portable/internal-api/product-feedback.d.ts.map +1 -0
  20. package/dist/_portable/internal-api/product-feedback.js +76 -0
  21. package/dist/_portable/internal-api/product-feedback.js.map +1 -0
  22. package/dist/_portable/internal-api/profile-banner.d.ts +13 -0
  23. package/dist/_portable/internal-api/profile-banner.d.ts.map +1 -0
  24. package/dist/_portable/internal-api/profile-banner.js +76 -0
  25. package/dist/_portable/internal-api/profile-banner.js.map +1 -0
  26. package/dist/_portable/internal-api/profile-media-optimize.d.ts +12 -0
  27. package/dist/_portable/internal-api/profile-media-optimize.d.ts.map +1 -0
  28. package/dist/_portable/internal-api/profile-media-optimize.js +64 -0
  29. package/dist/_portable/internal-api/profile-media-optimize.js.map +1 -0
  30. package/dist/_portable/internal-api/profile-media.d.ts +21 -0
  31. package/dist/_portable/internal-api/profile-media.d.ts.map +1 -0
  32. package/dist/_portable/internal-api/profile-media.js +80 -0
  33. package/dist/_portable/internal-api/profile-media.js.map +1 -0
  34. package/dist/_portable/internal-api/request-headers.d.ts +2 -0
  35. package/dist/_portable/internal-api/request-headers.d.ts.map +1 -0
  36. package/dist/_portable/internal-api/request-headers.js +22 -0
  37. package/dist/_portable/internal-api/request-headers.js.map +1 -0
  38. package/dist/_portable/internal-api/storage.d.ts +210 -0
  39. package/dist/_portable/internal-api/storage.d.ts.map +1 -0
  40. package/dist/_portable/internal-api/storage.js +418 -0
  41. package/dist/_portable/internal-api/storage.js.map +1 -0
  42. package/dist/_portable/internal-api/task-list-options.d.ts +41 -0
  43. package/dist/_portable/internal-api/task-list-options.d.ts.map +1 -0
  44. package/dist/_portable/internal-api/task-list-options.js +3 -0
  45. package/dist/_portable/internal-api/task-list-options.js.map +1 -0
  46. package/dist/_portable/internal-api/task-media-filename.d.ts +2 -0
  47. package/dist/_portable/internal-api/task-media-filename.d.ts.map +1 -0
  48. package/dist/_portable/internal-api/task-media-filename.js +34 -0
  49. package/dist/_portable/internal-api/task-media-filename.js.map +1 -0
  50. package/dist/_portable/internal-api/tasks-dashboard.d.ts +21 -0
  51. package/dist/_portable/internal-api/tasks-dashboard.d.ts.map +1 -0
  52. package/dist/_portable/internal-api/tasks-dashboard.js +34 -0
  53. package/dist/_portable/internal-api/tasks-dashboard.js.map +1 -0
  54. package/dist/_portable/internal-api/tasks.d.ts +936 -0
  55. package/dist/_portable/internal-api/tasks.d.ts.map +1 -0
  56. package/dist/_portable/internal-api/tasks.js +937 -0
  57. package/dist/_portable/internal-api/tasks.js.map +1 -0
  58. package/dist/_portable/internal-api/user-config-types.d.ts +7 -0
  59. package/dist/_portable/internal-api/user-config-types.d.ts.map +1 -0
  60. package/dist/_portable/internal-api/user-config-types.js +3 -0
  61. package/dist/_portable/internal-api/user-config-types.js.map +1 -0
  62. package/dist/_portable/internal-api/user-profile-types.d.ts +22 -0
  63. package/dist/_portable/internal-api/user-profile-types.d.ts.map +1 -0
  64. package/dist/_portable/internal-api/user-profile-types.js +3 -0
  65. package/dist/_portable/internal-api/user-profile-types.js.map +1 -0
  66. package/dist/_portable/internal-api/users.d.ts +378 -0
  67. package/dist/_portable/internal-api/users.d.ts.map +1 -0
  68. package/dist/_portable/internal-api/users.js +556 -0
  69. package/dist/_portable/internal-api/users.js.map +1 -0
  70. package/dist/_portable/internal-api/workspaces.d.ts +176 -0
  71. package/dist/_portable/internal-api/workspaces.d.ts.map +1 -0
  72. package/dist/_portable/internal-api/workspaces.js +275 -0
  73. package/dist/_portable/internal-api/workspaces.js.map +1 -0
  74. package/dist/_portable/utils/playground-schema.d.ts +92 -0
  75. package/dist/_portable/utils/playground-schema.d.ts.map +1 -0
  76. package/dist/_portable/utils/playground-schema.js +140 -0
  77. package/dist/_portable/utils/playground-schema.js.map +1 -0
  78. package/dist/_portable/utils/task-description-codec.d.ts +31 -0
  79. package/dist/_portable/utils/task-description-codec.d.ts.map +1 -0
  80. package/dist/_portable/utils/task-description-codec.js +435 -0
  81. package/dist/_portable/utils/task-description-codec.js.map +1 -0
  82. package/dist/_portable/utils/task-description-content.d.ts +7 -0
  83. package/dist/_portable/utils/task-description-content.d.ts.map +1 -0
  84. package/dist/_portable/utils/task-description-content.js +227 -0
  85. package/dist/_portable/utils/task-description-content.js.map +1 -0
  86. package/dist/_portable/utils/text-helper.d.ts +33 -0
  87. package/dist/_portable/utils/text-helper.d.ts.map +1 -0
  88. package/dist/_portable/utils/text-helper.js +423 -0
  89. package/dist/_portable/utils/text-helper.js.map +1 -0
  90. package/dist/_portable/utils/yjs-helper.d.ts +5 -0
  91. package/dist/_portable/utils/yjs-helper.d.ts.map +1 -0
  92. package/dist/_portable/utils/yjs-helper.js +186 -0
  93. package/dist/_portable/utils/yjs-helper.js.map +1 -0
  94. package/dist/cli/args.d.ts.map +1 -1
  95. package/dist/cli/args.js.map +1 -1
  96. package/dist/cli/atomic-file.d.ts +8 -0
  97. package/dist/cli/atomic-file.d.ts.map +1 -0
  98. package/dist/cli/atomic-file.js +103 -0
  99. package/dist/cli/atomic-file.js.map +1 -0
  100. package/dist/cli/auth.d.ts +1 -1
  101. package/dist/cli/auth.d.ts.map +1 -1
  102. package/dist/cli/auth.js +14 -6
  103. package/dist/cli/auth.js.map +1 -1
  104. package/dist/cli/browser.d.ts.map +1 -1
  105. package/dist/cli/browser.js.map +1 -1
  106. package/dist/cli/build-identity.d.ts +11 -0
  107. package/dist/cli/build-identity.d.ts.map +1 -0
  108. package/dist/cli/build-identity.js +31 -0
  109. package/dist/cli/build-identity.js.map +1 -0
  110. package/dist/cli/calendar-admin.d.ts +1 -1
  111. package/dist/cli/calendar-admin.d.ts.map +1 -1
  112. package/dist/cli/calendar-admin.js +21 -21
  113. package/dist/cli/calendar-admin.js.map +1 -1
  114. package/dist/cli/calendar-feedback-dispatch.d.ts +9 -0
  115. package/dist/cli/calendar-feedback-dispatch.d.ts.map +1 -0
  116. package/dist/cli/calendar-feedback-dispatch.js +23 -0
  117. package/dist/cli/calendar-feedback-dispatch.js.map +1 -0
  118. package/dist/cli/calendar-integrations.d.ts +1 -1
  119. package/dist/cli/calendar-integrations.d.ts.map +1 -1
  120. package/dist/cli/calendar-integrations.js +21 -21
  121. package/dist/cli/calendar-integrations.js.map +1 -1
  122. package/dist/cli/calendar-payloads.d.ts +3 -3
  123. package/dist/cli/calendar-payloads.d.ts.map +1 -1
  124. package/dist/cli/calendar-payloads.js +3 -3
  125. package/dist/cli/calendar-payloads.js.map +1 -1
  126. package/dist/cli/calendar.d.ts +1 -1
  127. package/dist/cli/calendar.d.ts.map +1 -1
  128. package/dist/cli/calendar.js +15 -15
  129. package/dist/cli/calendar.js.map +1 -1
  130. package/dist/cli/command-config.d.ts +3 -0
  131. package/dist/cli/command-config.d.ts.map +1 -0
  132. package/dist/cli/command-config.js +28 -0
  133. package/dist/cli/command-config.js.map +1 -0
  134. package/dist/cli/commands.d.ts +5 -5
  135. package/dist/cli/commands.d.ts.map +1 -1
  136. package/dist/cli/commands.js +242 -255
  137. package/dist/cli/commands.js.map +1 -1
  138. package/dist/cli/config.d.ts.map +1 -1
  139. package/dist/cli/config.js.map +1 -1
  140. package/dist/cli/delegated-commands.d.ts +3 -0
  141. package/dist/cli/delegated-commands.d.ts.map +1 -0
  142. package/dist/cli/delegated-commands.js +15 -0
  143. package/dist/cli/delegated-commands.js.map +1 -0
  144. package/dist/cli/devbox-agent-capabilities.d.ts +1 -1
  145. package/dist/cli/devbox-agent-capabilities.d.ts.map +1 -1
  146. package/dist/cli/devbox-agent-capabilities.js +33 -6
  147. package/dist/cli/devbox-agent-capabilities.js.map +1 -1
  148. package/dist/cli/devbox-agent-network.d.ts +22 -0
  149. package/dist/cli/devbox-agent-network.d.ts.map +1 -0
  150. package/dist/cli/devbox-agent-network.js +68 -0
  151. package/dist/cli/devbox-agent-network.js.map +1 -0
  152. package/dist/cli/devbox-agent.d.ts +5 -1
  153. package/dist/cli/devbox-agent.d.ts.map +1 -1
  154. package/dist/cli/devbox-agent.js +124 -27
  155. package/dist/cli/devbox-agent.js.map +1 -1
  156. package/dist/cli/devbox-auto-upgrade.d.ts.map +1 -1
  157. package/dist/cli/devbox-auto-upgrade.js +6 -6
  158. package/dist/cli/devbox-auto-upgrade.js.map +1 -1
  159. package/dist/cli/devbox-command-templates.d.ts +1 -1
  160. package/dist/cli/devbox-command-templates.d.ts.map +1 -1
  161. package/dist/cli/devbox-command-templates.js +10 -10
  162. package/dist/cli/devbox-command-templates.js.map +1 -1
  163. package/dist/cli/devbox-commit-run.d.ts +28 -0
  164. package/dist/cli/devbox-commit-run.d.ts.map +1 -0
  165. package/dist/cli/devbox-commit-run.js +147 -0
  166. package/dist/cli/devbox-commit-run.js.map +1 -0
  167. package/dist/cli/devbox-connect.d.ts +2 -2
  168. package/dist/cli/devbox-connect.d.ts.map +1 -1
  169. package/dist/cli/devbox-connect.js +18 -16
  170. package/dist/cli/devbox-connect.js.map +1 -1
  171. package/dist/cli/devbox-docker-metadata-diagnostic.d.ts +12 -0
  172. package/dist/cli/devbox-docker-metadata-diagnostic.d.ts.map +1 -0
  173. package/dist/cli/devbox-docker-metadata-diagnostic.js +110 -0
  174. package/dist/cli/devbox-docker-metadata-diagnostic.js.map +1 -0
  175. package/dist/cli/devbox-docker-metadata.d.ts.map +1 -1
  176. package/dist/cli/devbox-docker-metadata.js +20 -1
  177. package/dist/cli/devbox-docker-metadata.js.map +1 -1
  178. package/dist/cli/devbox-doctor.d.ts +1 -1
  179. package/dist/cli/devbox-doctor.d.ts.map +1 -1
  180. package/dist/cli/devbox-doctor.js +2 -2
  181. package/dist/cli/devbox-doctor.js.map +1 -1
  182. package/dist/cli/devbox-duration.d.ts.map +1 -1
  183. package/dist/cli/devbox-duration.js.map +1 -1
  184. package/dist/cli/devbox-fleet.d.ts +2 -2
  185. package/dist/cli/devbox-fleet.d.ts.map +1 -1
  186. package/dist/cli/devbox-fleet.js +35 -13
  187. package/dist/cli/devbox-fleet.js.map +1 -1
  188. package/dist/cli/devbox-host-protection.d.ts +1 -1
  189. package/dist/cli/devbox-host-protection.d.ts.map +1 -1
  190. package/dist/cli/devbox-host-protection.js.map +1 -1
  191. package/dist/cli/devbox-isolation-acl.d.ts +3 -0
  192. package/dist/cli/devbox-isolation-acl.d.ts.map +1 -0
  193. package/dist/cli/devbox-isolation-acl.js +106 -0
  194. package/dist/cli/devbox-isolation-acl.js.map +1 -0
  195. package/dist/cli/devbox-isolation-command.d.ts +13 -0
  196. package/dist/cli/devbox-isolation-command.d.ts.map +1 -0
  197. package/dist/cli/devbox-isolation-command.js +46 -0
  198. package/dist/cli/devbox-isolation-command.js.map +1 -0
  199. package/dist/cli/devbox-isolation-credential.d.ts +9 -0
  200. package/dist/cli/devbox-isolation-credential.d.ts.map +1 -0
  201. package/dist/cli/devbox-isolation-credential.js +164 -0
  202. package/dist/cli/devbox-isolation-credential.js.map +1 -0
  203. package/dist/cli/devbox-isolation.d.ts +61 -0
  204. package/dist/cli/devbox-isolation.d.ts.map +1 -0
  205. package/dist/cli/devbox-isolation.js +154 -0
  206. package/dist/cli/devbox-isolation.js.map +1 -0
  207. package/dist/cli/devbox-job-process.d.ts +23 -0
  208. package/dist/cli/devbox-job-process.d.ts.map +1 -0
  209. package/dist/cli/devbox-job-process.js +122 -0
  210. package/dist/cli/devbox-job-process.js.map +1 -0
  211. package/dist/cli/devbox-judge-case-batch.d.ts.map +1 -1
  212. package/dist/cli/devbox-judge-case-batch.js +2 -2
  213. package/dist/cli/devbox-judge-case-batch.js.map +1 -1
  214. package/dist/cli/devbox-judge-containers.d.ts +8 -0
  215. package/dist/cli/devbox-judge-containers.d.ts.map +1 -0
  216. package/dist/cli/devbox-judge-containers.js +68 -0
  217. package/dist/cli/devbox-judge-containers.js.map +1 -0
  218. package/dist/cli/devbox-judge-languages.d.ts.map +1 -1
  219. package/dist/cli/devbox-judge-languages.js.map +1 -1
  220. package/dist/cli/devbox-judge-sandbox.d.ts +2 -2
  221. package/dist/cli/devbox-judge-sandbox.d.ts.map +1 -1
  222. package/dist/cli/devbox-judge-sandbox.js +23 -20
  223. package/dist/cli/devbox-judge-sandbox.js.map +1 -1
  224. package/dist/cli/devbox-maintenance.d.ts +1 -1
  225. package/dist/cli/devbox-maintenance.d.ts.map +1 -1
  226. package/dist/cli/devbox-maintenance.js +5 -5
  227. package/dist/cli/devbox-maintenance.js.map +1 -1
  228. package/dist/cli/devbox-persisted-setting.d.ts.map +1 -1
  229. package/dist/cli/devbox-persisted-setting.js.map +1 -1
  230. package/dist/cli/devbox-playground-files.d.ts.map +1 -1
  231. package/dist/cli/devbox-playground-files.js.map +1 -1
  232. package/dist/cli/devbox-playground-runtime-diagnostics.d.ts +1 -1
  233. package/dist/cli/devbox-playground-runtime-diagnostics.d.ts.map +1 -1
  234. package/dist/cli/devbox-playground-runtime-diagnostics.js +2 -2
  235. package/dist/cli/devbox-playground-runtime-diagnostics.js.map +1 -1
  236. package/dist/cli/devbox-playground-sandbox.d.ts +1 -1
  237. package/dist/cli/devbox-playground-sandbox.d.ts.map +1 -1
  238. package/dist/cli/devbox-playground-sandbox.js +30 -30
  239. package/dist/cli/devbox-playground-sandbox.js.map +1 -1
  240. package/dist/cli/devbox-repair.d.ts +8 -5
  241. package/dist/cli/devbox-repair.d.ts.map +1 -1
  242. package/dist/cli/devbox-repair.js +42 -25
  243. package/dist/cli/devbox-repair.js.map +1 -1
  244. package/dist/cli/devbox-runner.d.ts +7 -2
  245. package/dist/cli/devbox-runner.d.ts.map +1 -1
  246. package/dist/cli/devbox-runner.js +154 -55
  247. package/dist/cli/devbox-runner.js.map +1 -1
  248. package/dist/cli/devbox-sandbox-pids.d.ts.map +1 -1
  249. package/dist/cli/devbox-sandbox-pids.js.map +1 -1
  250. package/dist/cli/devbox-sandbox-process.d.ts.map +1 -1
  251. package/dist/cli/devbox-sandbox-process.js.map +1 -1
  252. package/dist/cli/devbox-sandbox-slots.d.ts.map +1 -1
  253. package/dist/cli/devbox-sandbox-slots.js.map +1 -1
  254. package/dist/cli/devbox-service-mode-guard.d.ts +8 -0
  255. package/dist/cli/devbox-service-mode-guard.d.ts.map +1 -0
  256. package/dist/cli/devbox-service-mode-guard.js +65 -0
  257. package/dist/cli/devbox-service-mode-guard.js.map +1 -0
  258. package/dist/cli/devbox-session.d.ts +2 -2
  259. package/dist/cli/devbox-session.d.ts.map +1 -1
  260. package/dist/cli/devbox-session.js +2 -2
  261. package/dist/cli/devbox-session.js.map +1 -1
  262. package/dist/cli/devbox-setup-checkout.d.ts +1 -1
  263. package/dist/cli/devbox-setup-checkout.d.ts.map +1 -1
  264. package/dist/cli/devbox-setup-checkout.js.map +1 -1
  265. package/dist/cli/devbox-setup-command.d.ts.map +1 -1
  266. package/dist/cli/devbox-setup-command.js.map +1 -1
  267. package/dist/cli/devbox-setup-env.d.ts.map +1 -1
  268. package/dist/cli/devbox-setup-env.js.map +1 -1
  269. package/dist/cli/devbox-setup-service-templates.d.ts +11 -3
  270. package/dist/cli/devbox-setup-service-templates.d.ts.map +1 -1
  271. package/dist/cli/devbox-setup-service-templates.js +37 -9
  272. package/dist/cli/devbox-setup-service-templates.js.map +1 -1
  273. package/dist/cli/devbox-setup-service.d.ts +16 -10
  274. package/dist/cli/devbox-setup-service.d.ts.map +1 -1
  275. package/dist/cli/devbox-setup-service.js +81 -54
  276. package/dist/cli/devbox-setup-service.js.map +1 -1
  277. package/dist/cli/devbox-setup.d.ts +10 -8
  278. package/dist/cli/devbox-setup.d.ts.map +1 -1
  279. package/dist/cli/devbox-setup.js +29 -27
  280. package/dist/cli/devbox-setup.js.map +1 -1
  281. package/dist/cli/devbox-upgrade-lock.d.ts.map +1 -1
  282. package/dist/cli/devbox-upgrade-lock.js.map +1 -1
  283. package/dist/cli/devbox.d.ts +4 -4
  284. package/dist/cli/devbox.d.ts.map +1 -1
  285. package/dist/cli/devbox.js +53 -48
  286. package/dist/cli/devbox.js.map +1 -1
  287. package/dist/cli/external-admin.d.ts +2 -2
  288. package/dist/cli/external-admin.d.ts.map +1 -1
  289. package/dist/cli/external-admin.js +8 -8
  290. package/dist/cli/external-admin.js.map +1 -1
  291. package/dist/cli/external-projects.d.ts +2 -2
  292. package/dist/cli/external-projects.d.ts.map +1 -1
  293. package/dist/cli/external-projects.js +7 -6
  294. package/dist/cli/external-projects.js.map +1 -1
  295. package/dist/cli/feedback.d.ts +35 -0
  296. package/dist/cli/feedback.d.ts.map +1 -0
  297. package/dist/cli/feedback.js +262 -0
  298. package/dist/cli/feedback.js.map +1 -0
  299. package/dist/cli/finance-pagination.d.ts +1 -1
  300. package/dist/cli/finance-pagination.d.ts.map +1 -1
  301. package/dist/cli/finance-pagination.js.map +1 -1
  302. package/dist/cli/finance-payloads.d.ts +2 -2
  303. package/dist/cli/finance-payloads.d.ts.map +1 -1
  304. package/dist/cli/finance-payloads.js +18 -18
  305. package/dist/cli/finance-payloads.js.map +1 -1
  306. package/dist/cli/finance-recurring.d.ts +1 -1
  307. package/dist/cli/finance-recurring.d.ts.map +1 -1
  308. package/dist/cli/finance-recurring.js +9 -9
  309. package/dist/cli/finance-recurring.js.map +1 -1
  310. package/dist/cli/finance-resources.d.ts.map +1 -1
  311. package/dist/cli/finance-resources.js.map +1 -1
  312. package/dist/cli/finance.d.ts +2 -2
  313. package/dist/cli/finance.d.ts.map +1 -1
  314. package/dist/cli/finance.js +48 -48
  315. package/dist/cli/finance.js.map +1 -1
  316. package/dist/cli/help-devbox.d.ts.map +1 -1
  317. package/dist/cli/help-devbox.js +9 -1
  318. package/dist/cli/help-devbox.js.map +1 -1
  319. package/dist/cli/help-format.d.ts +9 -0
  320. package/dist/cli/help-format.d.ts.map +1 -0
  321. package/dist/cli/help-format.js +26 -0
  322. package/dist/cli/help-format.js.map +1 -0
  323. package/dist/cli/help-global.d.ts.map +1 -1
  324. package/dist/cli/help-global.js +2 -0
  325. package/dist/cli/help-global.js.map +1 -1
  326. package/dist/cli/help.d.ts +1 -1
  327. package/dist/cli/help.d.ts.map +1 -1
  328. package/dist/cli/help.js +16 -35
  329. package/dist/cli/help.js.map +1 -1
  330. package/dist/cli/index.d.ts.map +1 -1
  331. package/dist/cli/index.js +20 -2
  332. package/dist/cli/index.js.map +1 -1
  333. package/dist/cli/operational-cli.d.ts +3 -0
  334. package/dist/cli/operational-cli.d.ts.map +1 -0
  335. package/dist/cli/operational-cli.js +272 -0
  336. package/dist/cli/operational-cli.js.map +1 -0
  337. package/dist/cli/operational-domain.d.ts +156 -0
  338. package/dist/cli/operational-domain.d.ts.map +1 -0
  339. package/dist/cli/operational-domain.js +159 -0
  340. package/dist/cli/operational-domain.js.map +1 -0
  341. package/dist/cli/operational-evidence.d.ts +13 -0
  342. package/dist/cli/operational-evidence.d.ts.map +1 -0
  343. package/dist/cli/operational-evidence.js +57 -0
  344. package/dist/cli/operational-evidence.js.map +1 -0
  345. package/dist/cli/operational-files.d.ts +6 -0
  346. package/dist/cli/operational-files.d.ts.map +1 -0
  347. package/dist/cli/operational-files.js +70 -0
  348. package/dist/cli/operational-files.js.map +1 -0
  349. package/dist/cli/operational-graph.d.ts +2 -0
  350. package/dist/cli/operational-graph.d.ts.map +1 -0
  351. package/dist/cli/operational-graph.js +118 -0
  352. package/dist/cli/operational-graph.js.map +1 -0
  353. package/dist/cli/operational-receipts.d.ts +609 -0
  354. package/dist/cli/operational-receipts.d.ts.map +1 -0
  355. package/dist/cli/operational-receipts.js +218 -0
  356. package/dist/cli/operational-receipts.js.map +1 -0
  357. package/dist/cli/operational-schema.d.ts +274 -0
  358. package/dist/cli/operational-schema.d.ts.map +1 -0
  359. package/dist/cli/operational-schema.js +180 -0
  360. package/dist/cli/operational-schema.js.map +1 -0
  361. package/dist/cli/operational-search.d.ts +228 -0
  362. package/dist/cli/operational-search.d.ts.map +1 -0
  363. package/dist/cli/operational-search.js +291 -0
  364. package/dist/cli/operational-search.js.map +1 -0
  365. package/dist/cli/operational-store.d.ts +121 -0
  366. package/dist/cli/operational-store.d.ts.map +1 -0
  367. package/dist/cli/operational-store.js +321 -0
  368. package/dist/cli/operational-store.js.map +1 -0
  369. package/dist/cli/operational-transfer.d.ts +289 -0
  370. package/dist/cli/operational-transfer.d.ts.map +1 -0
  371. package/dist/cli/operational-transfer.js +254 -0
  372. package/dist/cli/operational-transfer.js.map +1 -0
  373. package/dist/cli/render.d.ts.map +1 -1
  374. package/dist/cli/render.js +8 -8
  375. package/dist/cli/render.js.map +1 -1
  376. package/dist/cli/resources-activity.d.ts +32 -0
  377. package/dist/cli/resources-activity.d.ts.map +1 -0
  378. package/dist/cli/resources-activity.js +150 -0
  379. package/dist/cli/resources-activity.js.map +1 -0
  380. package/dist/cli/resources-adaptive.d.ts +41 -0
  381. package/dist/cli/resources-adaptive.d.ts.map +1 -0
  382. package/dist/cli/resources-adaptive.js +109 -0
  383. package/dist/cli/resources-adaptive.js.map +1 -0
  384. package/dist/cli/resources-box-offload.d.ts +45 -0
  385. package/dist/cli/resources-box-offload.d.ts.map +1 -0
  386. package/dist/cli/resources-box-offload.js +335 -0
  387. package/dist/cli/resources-box-offload.js.map +1 -0
  388. package/dist/cli/resources-budget.d.ts +102 -0
  389. package/dist/cli/resources-budget.d.ts.map +1 -0
  390. package/dist/cli/resources-budget.js +337 -0
  391. package/dist/cli/resources-budget.js.map +1 -0
  392. package/dist/cli/resources-command.d.ts +15 -1
  393. package/dist/cli/resources-command.d.ts.map +1 -1
  394. package/dist/cli/resources-command.js +418 -13
  395. package/dist/cli/resources-command.js.map +1 -1
  396. package/dist/cli/resources-compatibility.d.ts +4 -0
  397. package/dist/cli/resources-compatibility.d.ts.map +1 -0
  398. package/dist/cli/resources-compatibility.js +71 -0
  399. package/dist/cli/resources-compatibility.js.map +1 -0
  400. package/dist/cli/resources-config.d.ts +40 -9
  401. package/dist/cli/resources-config.d.ts.map +1 -1
  402. package/dist/cli/resources-config.js +173 -12
  403. package/dist/cli/resources-config.js.map +1 -1
  404. package/dist/cli/resources-diagnostics.d.ts.map +1 -1
  405. package/dist/cli/resources-diagnostics.js.map +1 -1
  406. package/dist/cli/resources-disk-gate.d.ts +16 -0
  407. package/dist/cli/resources-disk-gate.d.ts.map +1 -0
  408. package/dist/cli/resources-disk-gate.js +110 -0
  409. package/dist/cli/resources-disk-gate.js.map +1 -0
  410. package/dist/cli/resources-entry.d.ts.map +1 -1
  411. package/dist/cli/resources-entry.js +2 -2
  412. package/dist/cli/resources-entry.js.map +1 -1
  413. package/dist/cli/resources-hosts-cli.d.ts +14 -0
  414. package/dist/cli/resources-hosts-cli.d.ts.map +1 -0
  415. package/dist/cli/resources-hosts-cli.js +141 -0
  416. package/dist/cli/resources-hosts-cli.js.map +1 -0
  417. package/dist/cli/resources-hosts-config.d.ts +136 -0
  418. package/dist/cli/resources-hosts-config.d.ts.map +1 -0
  419. package/dist/cli/resources-hosts-config.js +149 -0
  420. package/dist/cli/resources-hosts-config.js.map +1 -0
  421. package/dist/cli/resources-hosts-dispatch.d.ts +51 -0
  422. package/dist/cli/resources-hosts-dispatch.d.ts.map +1 -0
  423. package/dist/cli/resources-hosts-dispatch.js +208 -0
  424. package/dist/cli/resources-hosts-dispatch.js.map +1 -0
  425. package/dist/cli/resources-hosts-ledger.d.ts +97 -0
  426. package/dist/cli/resources-hosts-ledger.d.ts.map +1 -0
  427. package/dist/cli/resources-hosts-ledger.js +343 -0
  428. package/dist/cli/resources-hosts-ledger.js.map +1 -0
  429. package/dist/cli/resources-hosts-plan.d.ts +53 -0
  430. package/dist/cli/resources-hosts-plan.d.ts.map +1 -0
  431. package/dist/cli/resources-hosts-plan.js +158 -0
  432. package/dist/cli/resources-hosts-plan.js.map +1 -0
  433. package/dist/cli/resources-hosts-sim.d.ts +42 -0
  434. package/dist/cli/resources-hosts-sim.d.ts.map +1 -0
  435. package/dist/cli/resources-hosts-sim.js +182 -0
  436. package/dist/cli/resources-hosts-sim.js.map +1 -0
  437. package/dist/cli/resources-hosts-trust.d.ts +15 -0
  438. package/dist/cli/resources-hosts-trust.d.ts.map +1 -0
  439. package/dist/cli/resources-hosts-trust.js +106 -0
  440. package/dist/cli/resources-hosts-trust.js.map +1 -0
  441. package/dist/cli/resources-offload-control.d.ts +35 -0
  442. package/dist/cli/resources-offload-control.d.ts.map +1 -0
  443. package/dist/cli/resources-offload-control.js +81 -0
  444. package/dist/cli/resources-offload-control.js.map +1 -0
  445. package/dist/cli/resources-queue.d.ts +110 -16
  446. package/dist/cli/resources-queue.d.ts.map +1 -1
  447. package/dist/cli/resources-queue.js +345 -152
  448. package/dist/cli/resources-queue.js.map +1 -1
  449. package/dist/cli/resources-setup.d.ts +44 -7
  450. package/dist/cli/resources-setup.d.ts.map +1 -1
  451. package/dist/cli/resources-setup.js +246 -56
  452. package/dist/cli/resources-setup.js.map +1 -1
  453. package/dist/cli/resources-slots.d.ts +123 -0
  454. package/dist/cli/resources-slots.d.ts.map +1 -0
  455. package/dist/cli/resources-slots.js +575 -0
  456. package/dist/cli/resources-slots.js.map +1 -0
  457. package/dist/cli/resources-status.d.ts +54 -0
  458. package/dist/cli/resources-status.d.ts.map +1 -0
  459. package/dist/cli/resources-status.js +83 -0
  460. package/dist/cli/resources-status.js.map +1 -0
  461. package/dist/cli/resources-turbo-summary.d.ts +38 -0
  462. package/dist/cli/resources-turbo-summary.d.ts.map +1 -0
  463. package/dist/cli/resources-turbo-summary.js +174 -0
  464. package/dist/cli/resources-turbo-summary.js.map +1 -0
  465. package/dist/cli/resources.d.ts +11 -0
  466. package/dist/cli/resources.d.ts.map +1 -1
  467. package/dist/cli/resources.js +342 -39
  468. package/dist/cli/resources.js.map +1 -1
  469. package/dist/cli/select.d.ts.map +1 -1
  470. package/dist/cli/select.js.map +1 -1
  471. package/dist/cli/selection.d.ts +6 -6
  472. package/dist/cli/selection.d.ts.map +1 -1
  473. package/dist/cli/selection.js +32 -32
  474. package/dist/cli/selection.js.map +1 -1
  475. package/dist/cli/storage-analyze.d.ts +66 -0
  476. package/dist/cli/storage-analyze.d.ts.map +1 -0
  477. package/dist/cli/storage-analyze.js +298 -0
  478. package/dist/cli/storage-analyze.js.map +1 -0
  479. package/dist/cli/storage-docker-local.d.ts +15 -0
  480. package/dist/cli/storage-docker-local.d.ts.map +1 -0
  481. package/dist/cli/storage-docker-local.js +57 -0
  482. package/dist/cli/storage-docker-local.js.map +1 -0
  483. package/dist/cli/storage-headroom.d.ts +74 -0
  484. package/dist/cli/storage-headroom.d.ts.map +1 -0
  485. package/dist/cli/storage-headroom.js +212 -0
  486. package/dist/cli/storage-headroom.js.map +1 -0
  487. package/dist/cli/storage-holds.d.ts +31 -0
  488. package/dist/cli/storage-holds.d.ts.map +1 -0
  489. package/dist/cli/storage-holds.js +112 -0
  490. package/dist/cli/storage-holds.js.map +1 -0
  491. package/dist/cli/storage-liveness.d.ts +106 -0
  492. package/dist/cli/storage-liveness.d.ts.map +1 -0
  493. package/dist/cli/storage-liveness.js +251 -0
  494. package/dist/cli/storage-liveness.js.map +1 -0
  495. package/dist/cli/storage-measure.d.ts +32 -0
  496. package/dist/cli/storage-measure.d.ts.map +1 -0
  497. package/dist/cli/storage-measure.js +185 -0
  498. package/dist/cli/storage-measure.js.map +1 -0
  499. package/dist/cli/storage-privacy.d.ts +26 -0
  500. package/dist/cli/storage-privacy.d.ts.map +1 -0
  501. package/dist/cli/storage-privacy.js +92 -0
  502. package/dist/cli/storage-privacy.js.map +1 -0
  503. package/dist/cli/storage-prune-checkouts.d.ts +7 -0
  504. package/dist/cli/storage-prune-checkouts.d.ts.map +1 -0
  505. package/dist/cli/storage-prune-checkouts.js +274 -0
  506. package/dist/cli/storage-prune-checkouts.js.map +1 -0
  507. package/dist/cli/storage-prune-machine.d.ts +15 -0
  508. package/dist/cli/storage-prune-machine.d.ts.map +1 -0
  509. package/dist/cli/storage-prune-machine.js +376 -0
  510. package/dist/cli/storage-prune-machine.js.map +1 -0
  511. package/dist/cli/storage-prune.d.ts +124 -0
  512. package/dist/cli/storage-prune.d.ts.map +1 -0
  513. package/dist/cli/storage-prune.js +246 -0
  514. package/dist/cli/storage-prune.js.map +1 -0
  515. package/dist/cli/storage-safe-remove.d.ts +45 -0
  516. package/dist/cli/storage-safe-remove.d.ts.map +1 -0
  517. package/dist/cli/storage-safe-remove.js +132 -0
  518. package/dist/cli/storage-safe-remove.js.map +1 -0
  519. package/dist/cli/storage-scratch.d.ts +27 -0
  520. package/dist/cli/storage-scratch.d.ts.map +1 -0
  521. package/dist/cli/storage-scratch.js +85 -0
  522. package/dist/cli/storage-scratch.js.map +1 -0
  523. package/dist/cli/storage-suggest.d.ts +25 -0
  524. package/dist/cli/storage-suggest.d.ts.map +1 -0
  525. package/dist/cli/storage-suggest.js +294 -0
  526. package/dist/cli/storage-suggest.js.map +1 -0
  527. package/dist/cli/storage-targets.d.ts +81 -0
  528. package/dist/cli/storage-targets.d.ts.map +1 -0
  529. package/dist/cli/storage-targets.js +319 -0
  530. package/dist/cli/storage-targets.js.map +1 -0
  531. package/dist/cli/storage-worktrees.d.ts +99 -0
  532. package/dist/cli/storage-worktrees.d.ts.map +1 -0
  533. package/dist/cli/storage-worktrees.js +368 -0
  534. package/dist/cli/storage-worktrees.js.map +1 -0
  535. package/dist/cli/storage.d.ts +29 -0
  536. package/dist/cli/storage.d.ts.map +1 -0
  537. package/dist/cli/storage.js +286 -0
  538. package/dist/cli/storage.js.map +1 -0
  539. package/dist/cli/task-description.d.ts +5 -5
  540. package/dist/cli/task-description.d.ts.map +1 -1
  541. package/dist/cli/task-description.js +28 -28
  542. package/dist/cli/task-description.js.map +1 -1
  543. package/dist/cli/task-template-command.d.ts +6 -6
  544. package/dist/cli/task-template-command.d.ts.map +1 -1
  545. package/dist/cli/task-template-command.js +34 -34
  546. package/dist/cli/task-template-command.js.map +1 -1
  547. package/dist/cli/task-templates.d.ts +1 -1
  548. package/dist/cli/task-templates.d.ts.map +1 -1
  549. package/dist/cli/task-templates.js +4 -3
  550. package/dist/cli/task-templates.js.map +1 -1
  551. package/dist/cli/timezone.d.ts +1 -1
  552. package/dist/cli/timezone.d.ts.map +1 -1
  553. package/dist/cli/timezone.js.map +1 -1
  554. package/dist/cli/tiptap.d.ts +1 -1
  555. package/dist/cli/tiptap.d.ts.map +1 -1
  556. package/dist/cli/tiptap.js +22 -22
  557. package/dist/cli/tiptap.js.map +1 -1
  558. package/dist/cli/update.d.ts +3 -2
  559. package/dist/cli/update.d.ts.map +1 -1
  560. package/dist/cli/update.js +4 -2
  561. package/dist/cli/update.js.map +1 -1
  562. package/dist/cli/upgrade.d.ts.map +1 -1
  563. package/dist/cli/upgrade.js.map +1 -1
  564. package/dist/cms-site.d.ts.map +1 -1
  565. package/dist/cms-site.js.map +1 -1
  566. package/dist/devbox-fleet-types.d.ts +74 -0
  567. package/dist/devbox-fleet-types.d.ts.map +1 -0
  568. package/dist/devbox-fleet-types.js +84 -0
  569. package/dist/devbox-fleet-types.js.map +1 -0
  570. package/dist/epm.d.ts +1 -1
  571. package/dist/epm.d.ts.map +1 -1
  572. package/dist/epm.js +12 -12
  573. package/dist/epm.js.map +1 -1
  574. package/dist/errors.d.ts +1 -1
  575. package/dist/errors.d.ts.map +1 -1
  576. package/dist/errors.js.map +1 -1
  577. package/dist/external-projects-public-assets-node.d.ts +5 -5
  578. package/dist/external-projects-public-assets-node.d.ts.map +1 -1
  579. package/dist/external-projects-public-assets-node.js +11 -11
  580. package/dist/external-projects-public-assets-node.js.map +1 -1
  581. package/dist/external-projects-public-assets.d.ts +1 -1
  582. package/dist/external-projects-public-assets.d.ts.map +1 -1
  583. package/dist/external-projects-public-assets.js.map +1 -1
  584. package/dist/external-projects.d.ts +5 -5
  585. package/dist/external-projects.d.ts.map +1 -1
  586. package/dist/external-projects.js +14 -14
  587. package/dist/external-projects.js.map +1 -1
  588. package/dist/index.d.ts +25 -25
  589. package/dist/index.d.ts.map +1 -1
  590. package/dist/index.js +68 -68
  591. package/dist/index.js.map +1 -1
  592. package/dist/operational-graph/contracts.d.ts +461 -0
  593. package/dist/operational-graph/contracts.d.ts.map +1 -0
  594. package/dist/operational-graph/contracts.js +144 -0
  595. package/dist/operational-graph/contracts.js.map +1 -0
  596. package/dist/operational-graph/domain.d.ts +181 -0
  597. package/dist/operational-graph/domain.d.ts.map +1 -0
  598. package/dist/operational-graph/domain.js +166 -0
  599. package/dist/operational-graph/domain.js.map +1 -0
  600. package/dist/operational-graph/duplicate.d.ts +218 -0
  601. package/dist/operational-graph/duplicate.d.ts.map +1 -0
  602. package/dist/operational-graph/duplicate.js +161 -0
  603. package/dist/operational-graph/duplicate.js.map +1 -0
  604. package/dist/operational-graph/projection.d.ts +5 -0
  605. package/dist/operational-graph/projection.d.ts.map +1 -0
  606. package/dist/operational-graph/projection.js +111 -0
  607. package/dist/operational-graph/projection.js.map +1 -0
  608. package/dist/operational-graph/reader.d.ts +333 -0
  609. package/dist/operational-graph/reader.d.ts.map +1 -0
  610. package/dist/operational-graph/reader.js +52 -0
  611. package/dist/operational-graph/reader.js.map +1 -0
  612. package/dist/operational-graph/store.d.ts +118 -0
  613. package/dist/operational-graph/store.d.ts.map +1 -0
  614. package/dist/operational-graph/store.js +58 -0
  615. package/dist/operational-graph/store.js.map +1 -0
  616. package/dist/operational-planner/assignment.d.ts +14 -0
  617. package/dist/operational-planner/assignment.d.ts.map +1 -0
  618. package/dist/operational-planner/assignment.js +146 -0
  619. package/dist/operational-planner/assignment.js.map +1 -0
  620. package/dist/operational-planner/contracts.d.ts +563 -0
  621. package/dist/operational-planner/contracts.d.ts.map +1 -0
  622. package/dist/operational-planner/contracts.js +127 -0
  623. package/dist/operational-planner/contracts.js.map +1 -0
  624. package/dist/operational-planner/planner.d.ts +24 -0
  625. package/dist/operational-planner/planner.d.ts.map +1 -0
  626. package/dist/operational-planner/planner.js +96 -0
  627. package/dist/operational-planner/planner.js.map +1 -0
  628. package/dist/operational-search/artifact.d.ts +70 -0
  629. package/dist/operational-search/artifact.d.ts.map +1 -0
  630. package/dist/operational-search/artifact.js +97 -0
  631. package/dist/operational-search/artifact.js.map +1 -0
  632. package/dist/operational-search/cache.d.ts +46 -0
  633. package/dist/operational-search/cache.d.ts.map +1 -0
  634. package/dist/operational-search/cache.js +248 -0
  635. package/dist/operational-search/cache.js.map +1 -0
  636. package/dist/operational-search/download.d.ts +17 -0
  637. package/dist/operational-search/download.d.ts.map +1 -0
  638. package/dist/operational-search/download.js +283 -0
  639. package/dist/operational-search/download.js.map +1 -0
  640. package/dist/operational-search/index.d.ts +58 -0
  641. package/dist/operational-search/index.d.ts.map +1 -0
  642. package/dist/operational-search/index.js +156 -0
  643. package/dist/operational-search/index.js.map +1 -0
  644. package/dist/operational-search/lexical.d.ts +28 -0
  645. package/dist/operational-search/lexical.d.ts.map +1 -0
  646. package/dist/operational-search/lexical.js +88 -0
  647. package/dist/operational-search/lexical.js.map +1 -0
  648. package/dist/operational-search/python-adapter-code.d.ts +58 -0
  649. package/dist/operational-search/python-adapter-code.d.ts.map +1 -0
  650. package/dist/operational-search/python-adapter-code.js +12 -0
  651. package/dist/operational-search/python-adapter-code.js.map +1 -0
  652. package/dist/operational-search/python-runtime.d.ts +65 -0
  653. package/dist/operational-search/python-runtime.d.ts.map +1 -0
  654. package/dist/operational-search/python-runtime.js +348 -0
  655. package/dist/operational-search/python-runtime.js.map +1 -0
  656. package/dist/operational-search/query.d.ts +42 -0
  657. package/dist/operational-search/query.d.ts.map +1 -0
  658. package/dist/operational-search/query.js +89 -0
  659. package/dist/operational-search/query.js.map +1 -0
  660. package/dist/operational-search/runtime.d.ts +6 -0
  661. package/dist/operational-search/runtime.d.ts.map +1 -0
  662. package/dist/operational-search/runtime.js +13 -0
  663. package/dist/operational-search/runtime.js.map +1 -0
  664. package/dist/operational-sync/engine.d.ts +9 -0
  665. package/dist/operational-sync/engine.d.ts.map +1 -0
  666. package/dist/operational-sync/engine.js +191 -0
  667. package/dist/operational-sync/engine.js.map +1 -0
  668. package/dist/operational-sync/protocol.d.ts +985 -0
  669. package/dist/operational-sync/protocol.d.ts.map +1 -0
  670. package/dist/operational-sync/protocol.js +212 -0
  671. package/dist/operational-sync/protocol.js.map +1 -0
  672. package/dist/operational-sync/replica.d.ts +595 -0
  673. package/dist/operational-sync/replica.d.ts.map +1 -0
  674. package/dist/operational-sync/replica.js +214 -0
  675. package/dist/operational-sync/replica.js.map +1 -0
  676. package/dist/platform-calendar-types.d.ts +1 -1
  677. package/dist/platform-calendar-types.d.ts.map +1 -1
  678. package/dist/platform-calendar-types.js.map +1 -1
  679. package/dist/platform-calendar.d.ts +3 -3
  680. package/dist/platform-calendar.d.ts.map +1 -1
  681. package/dist/platform-calendar.js +23 -23
  682. package/dist/platform-calendar.js.map +1 -1
  683. package/dist/platform-devbox-fleet.d.ts +21 -36
  684. package/dist/platform-devbox-fleet.d.ts.map +1 -1
  685. package/dist/platform-devbox-fleet.js +42 -5
  686. package/dist/platform-devbox-fleet.js.map +1 -1
  687. package/dist/platform-devbox.d.ts +42 -9
  688. package/dist/platform-devbox.d.ts.map +1 -1
  689. package/dist/platform-devbox.js +37 -16
  690. package/dist/platform-devbox.js.map +1 -1
  691. package/dist/platform-external-admin.d.ts +2 -2
  692. package/dist/platform-external-admin.d.ts.map +1 -1
  693. package/dist/platform-external-admin.js +6 -6
  694. package/dist/platform-external-admin.js.map +1 -1
  695. package/dist/platform-finance-pagination.d.ts.map +1 -1
  696. package/dist/platform-finance-pagination.js.map +1 -1
  697. package/dist/platform-finance.d.ts +3 -3
  698. package/dist/platform-finance.d.ts.map +1 -1
  699. package/dist/platform-finance.js +46 -46
  700. package/dist/platform-finance.js.map +1 -1
  701. package/dist/platform-sdk-auth.d.ts.map +1 -1
  702. package/dist/platform-sdk-auth.js.map +1 -1
  703. package/dist/platform.d.ts +46 -46
  704. package/dist/platform.d.ts.map +1 -1
  705. package/dist/platform.js +90 -90
  706. package/dist/platform.js.map +1 -1
  707. package/dist/portable-sources.json +25 -0
  708. package/dist/query.d.ts +2 -2
  709. package/dist/query.d.ts.map +1 -1
  710. package/dist/query.js.map +1 -1
  711. package/dist/storage.d.ts +3 -3
  712. package/dist/storage.d.ts.map +1 -1
  713. package/dist/storage.js +43 -43
  714. package/dist/storage.js.map +1 -1
  715. package/dist/task-templates.d.ts +1 -1
  716. package/dist/task-templates.d.ts.map +1 -1
  717. package/dist/task-templates.js +13 -13
  718. package/dist/task-templates.js.map +1 -1
  719. package/dist/types.d.ts.map +1 -1
  720. package/dist/types.js.map +1 -1
  721. package/package.json +27 -15
  722. package/dist/cli/devbox-playground-runtime.acceptance.d.ts +0 -2
  723. package/dist/cli/devbox-playground-runtime.acceptance.d.ts.map +0 -1
  724. package/dist/cli/devbox-playground-runtime.acceptance.js +0 -216
  725. package/dist/cli/devbox-playground-runtime.acceptance.js.map +0 -1
package/bin/ttr.cjs ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bun
2
+
3
+ const { existsSync } = require('node:fs');
4
+ const { join } = require('node:path');
5
+
6
+ if (existsSync(join(__dirname, '../src/cli/index.ts'))) {
7
+ console.error(
8
+ 'Workspace ttr bin is disabled: its dist may be stale. Use ~/.bun/bin/ttr or bun ttr. For source development run bun packages/sdk/src/cli/index.ts from the repo root with a disposable TTR_RESOURCES_HOME.'
9
+ );
10
+ process.exitCode = 1;
11
+ } else {
12
+ require(join(__dirname, '../dist/cli/index.js'));
13
+ }
@@ -0,0 +1,56 @@
1
+ export type InternalApiQueryValue = string | number | boolean | null | undefined;
2
+ export type InternalApiQuery = Record<string, InternalApiQueryValue>;
3
+ export type InternalApiFetchInit = Omit<RequestInit, 'headers'> & {
4
+ baseUrl?: string;
5
+ headers?: HeadersInit;
6
+ query?: InternalApiQuery;
7
+ };
8
+ export type InternalApiClientOptions = {
9
+ baseUrl?: string;
10
+ defaultHeaders?: HeadersInit;
11
+ fetch?: typeof fetch;
12
+ };
13
+ type HeaderAccessor = Pick<Headers, 'get'>;
14
+ export { InternalApiError } from "./internal-api-error.js";
15
+ export declare function encodePathSegment(value: string): string;
16
+ export declare function getConfiguredInternalApiBaseUrl(): string;
17
+ export declare function getConfiguredTasksApiBaseUrl(): string;
18
+ export declare function withTaskApiBaseUrl(options?: InternalApiClientOptions): InternalApiClientOptions;
19
+ export declare function getConfiguredMailApiBaseUrl(): string;
20
+ export declare function withMailApiBaseUrl(options?: InternalApiClientOptions): InternalApiClientOptions;
21
+ export declare function getConfiguredLearnApiBaseUrl(): string;
22
+ export declare function withLearnApiBaseUrl(options?: InternalApiClientOptions): InternalApiClientOptions;
23
+ export declare function getConfiguredTeachApiBaseUrl(): string;
24
+ export declare function withTeachApiBaseUrl(options?: InternalApiClientOptions): InternalApiClientOptions;
25
+ export declare function getConfiguredPayApiBaseUrl(): string;
26
+ export declare function withPayApiBaseUrl(options?: InternalApiClientOptions): InternalApiClientOptions;
27
+ export declare function getConfiguredContactsApiBaseUrl(): string;
28
+ export declare function withContactsApiBaseUrl(options?: InternalApiClientOptions): InternalApiClientOptions;
29
+ /**
30
+ * `/api/v1/tulearn/bootstrap` is owned by apps/learn but is also consumed by
31
+ * apps/teach. Pin the call to the CALLING app's own origin so its app-session
32
+ * audience (learn or teach) matches — never cross-pin teach → learn (learn's
33
+ * proxy would reject a teach-audience session).
34
+ */
35
+ export declare function withEducationBootstrapBaseUrl(options?: InternalApiClientOptions): InternalApiClientOptions;
36
+ export declare function getConfiguredFinanceApiBaseUrl(): string;
37
+ export declare function withFinanceApiBaseUrl(options?: InternalApiClientOptions): InternalApiClientOptions;
38
+ export declare function resolveInternalApiUrl(path: string, baseUrl?: string): string;
39
+ export declare function createInternalApiClient(options?: InternalApiClientOptions): {
40
+ fetch: (path: string, init?: InternalApiFetchInit) => Promise<Response>;
41
+ json<T>(path: string, init?: InternalApiFetchInit): Promise<T>;
42
+ };
43
+ /**
44
+ * Creates Internal API client options that forward auth-relevant headers
45
+ * from an incoming request context (for example `next/headers()` in RSC).
46
+ */
47
+ export declare function withForwardedInternalApiAuth(requestHeaders: HeaderAccessor, options?: InternalApiClientOptions): InternalApiClientOptions;
48
+ export declare const internalApiClient: {
49
+ fetch: (path: string, init?: InternalApiFetchInit) => Promise<Response>;
50
+ json<T>(path: string, init?: InternalApiFetchInit): Promise<T>;
51
+ };
52
+ export declare function getInternalApiClient(options?: InternalApiClientOptions): {
53
+ fetch: (path: string, init?: InternalApiFetchInit) => Promise<Response>;
54
+ json<T>(path: string, init?: InternalApiFetchInit): Promise<T>;
55
+ };
56
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../node_modules/.cache/sdk-portable-boUk2G/src/_portable/internal-api/client.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,CAAC;AACd,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;AACrE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB,CAAC;AAEF,KAAK,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AA0D3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAwE3D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,UAE9C;AAiDD,wBAAgB,+BAA+B,WAY9C;AA+BD,wBAAgB,4BAA4B,WAW3C;AAED,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,wBAA6B,GACrC,wBAAwB,CAS1B;AAED,wBAAgB,2BAA2B,WAS1C;AAED,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,wBAA6B,GACrC,wBAAwB,CAS1B;AA8CD,wBAAgB,4BAA4B,WAS3C;AAED,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,wBAA6B,GACrC,wBAAwB,CAS1B;AAED,wBAAgB,4BAA4B,WAS3C;AAED,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,wBAA6B,GACrC,wBAAwB,CAS1B;AASD,wBAAgB,0BAA0B,WASzC;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,wBAAwB,CAS1B;AAWD,wBAAgB,+BAA+B,WAS9C;AAED,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,wBAA6B,GACrC,wBAAwB,CAS1B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,wBAA6B,GACrC,wBAAwB,CAgB1B;AASD,wBAAgB,8BAA8B,WAS7C;AAED,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,wBAA6B,GACrC,wBAAwB,CAS1B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,UAkBnE;AAqGD,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAA6B;IAgBpC,KAAK,SAdgB,MAAM,SAAQ,oBAAoB;IAgBjD,IAAI,CAAC,CAAC,QAAQ,MAAM,SAAQ,oBAAoB,GAAQ,OAAO,CAAC,CAAC,CAAC;EAY3E;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,cAAc,EAC9B,OAAO,GAAE,wBAA6B,GACrC,wBAAwB,CAgJ1B;AAED,eAAO,MAAM,iBAAiB;kBAvLL,MAAM,SAAQ,oBAAoB;SAgB5C,CAAC,QAAQ,MAAM,SAAQ,oBAAoB,GAAQ,OAAO,CAAC,CAAC,CAAC;CAuKlB,CAAC;AAE3D,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,wBAAwB;kBAzL9C,MAAM,SAAQ,oBAAoB;SAgB5C,CAAC,QAAQ,MAAM,SAAQ,oBAAoB,GAAQ,OAAO,CAAC,CAAC,CAAC;EA2K3E"}
@@ -0,0 +1,601 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.internalApiClient = exports.InternalApiError = void 0;
4
+ exports.encodePathSegment = encodePathSegment;
5
+ exports.getConfiguredInternalApiBaseUrl = getConfiguredInternalApiBaseUrl;
6
+ exports.getConfiguredTasksApiBaseUrl = getConfiguredTasksApiBaseUrl;
7
+ exports.withTaskApiBaseUrl = withTaskApiBaseUrl;
8
+ exports.getConfiguredMailApiBaseUrl = getConfiguredMailApiBaseUrl;
9
+ exports.withMailApiBaseUrl = withMailApiBaseUrl;
10
+ exports.getConfiguredLearnApiBaseUrl = getConfiguredLearnApiBaseUrl;
11
+ exports.withLearnApiBaseUrl = withLearnApiBaseUrl;
12
+ exports.getConfiguredTeachApiBaseUrl = getConfiguredTeachApiBaseUrl;
13
+ exports.withTeachApiBaseUrl = withTeachApiBaseUrl;
14
+ exports.getConfiguredPayApiBaseUrl = getConfiguredPayApiBaseUrl;
15
+ exports.withPayApiBaseUrl = withPayApiBaseUrl;
16
+ exports.getConfiguredContactsApiBaseUrl = getConfiguredContactsApiBaseUrl;
17
+ exports.withContactsApiBaseUrl = withContactsApiBaseUrl;
18
+ exports.withEducationBootstrapBaseUrl = withEducationBootstrapBaseUrl;
19
+ exports.getConfiguredFinanceApiBaseUrl = getConfiguredFinanceApiBaseUrl;
20
+ exports.withFinanceApiBaseUrl = withFinanceApiBaseUrl;
21
+ exports.resolveInternalApiUrl = resolveInternalApiUrl;
22
+ exports.createInternalApiClient = createInternalApiClient;
23
+ exports.withForwardedInternalApiAuth = withForwardedInternalApiAuth;
24
+ exports.getInternalApiClient = getInternalApiClient;
25
+ const internal_api_error_js_1 = require("./internal-api-error.js");
26
+ const request_headers_js_1 = require("./request-headers.js");
27
+ const APP_SESSION_COOKIE_NAME = 'tuturuuu_app_session';
28
+ const SUPABASE_AUTH_COOKIE_PATTERN = /^sb-[a-z0-9-]+-auth-token(?:\.\d+)?$/i;
29
+ const KNOWN_CUSTOM_SATELLITE_HOSTS = new Set(['nova.ai.vn', 'rewise.me']);
30
+ const KNOWN_NON_PLATFORM_TUTURUUU_HOSTS = new Set([
31
+ 'apps.tuturuuu.com',
32
+ 'cms.tuturuuu.com',
33
+ 'calendar.tuturuuu.com',
34
+ 'chat.tuturuuu.com',
35
+ 'drive.tuturuuu.com',
36
+ 'mail.tuturuuu.com',
37
+ 'meet.tuturuuu.com',
38
+ 'qr.tuturuuu.com',
39
+ 'mira.tuturuuu.com',
40
+ 'tasks.tuturuuu.com',
41
+ 'finance.tuturuuu.com',
42
+ 'inventory.tuturuuu.com',
43
+ 'storefront.tuturuuu.com',
44
+ 'tanstack.tuturuuu.com',
45
+ 'track.tuturuuu.com',
46
+ 'learn.tuturuuu.com',
47
+ 'teach.tuturuuu.com',
48
+ 'pay.tuturuuu.com',
49
+ 'contacts.tuturuuu.com',
50
+ 'forms.tuturuuu.com',
51
+ 'lettin.tuturuuu.com',
52
+ 'git.tuturuuu.com',
53
+ 'hive.tuturuuu.com',
54
+ 'mind.tuturuuu.com',
55
+ ]);
56
+ const KNOWN_NON_PLATFORM_LOCALHOST_PORTS = new Set([
57
+ '7804',
58
+ '7805',
59
+ '7806',
60
+ '7807',
61
+ '7808',
62
+ '7809',
63
+ '7810',
64
+ '7811',
65
+ '7812',
66
+ '7813',
67
+ '7814',
68
+ '7815',
69
+ '7816',
70
+ '7817',
71
+ '7818',
72
+ '7819',
73
+ '7820',
74
+ '7821',
75
+ '7822',
76
+ '7824',
77
+ '7826',
78
+ '7827',
79
+ '7828',
80
+ '7830',
81
+ '7833',
82
+ ]);
83
+ var internal_api_error_js_2 = require("./internal-api-error.js");
84
+ Object.defineProperty(exports, "InternalApiError", { enumerable: true, get: function () { return internal_api_error_js_2.InternalApiError; } });
85
+ function tryParseAbsoluteUrl(value) {
86
+ try {
87
+ return new URL(value);
88
+ }
89
+ catch {
90
+ return null;
91
+ }
92
+ }
93
+ function resolveConfiguredOrigin(value) {
94
+ if (!value) {
95
+ return null;
96
+ }
97
+ const [firstValue] = value
98
+ .split(/[,\n]/u)
99
+ .map((entry) => entry.trim())
100
+ .filter(Boolean);
101
+ if (!firstValue) {
102
+ return null;
103
+ }
104
+ const normalized = /^[a-z]+:\/\//iu.test(firstValue)
105
+ ? firstValue
106
+ : `https://${firstValue}`;
107
+ return tryParseAbsoluteUrl(normalized)?.origin ?? null;
108
+ }
109
+ function isKnownNonPlatformSatelliteOrigin(origin) {
110
+ const url = tryParseAbsoluteUrl(origin);
111
+ if (!url) {
112
+ return false;
113
+ }
114
+ const hostname = url.hostname.toLowerCase();
115
+ if (KNOWN_CUSTOM_SATELLITE_HOSTS.has(hostname)) {
116
+ return true;
117
+ }
118
+ if (KNOWN_NON_PLATFORM_TUTURUUU_HOSTS.has(hostname)) {
119
+ return true;
120
+ }
121
+ if (hostname.endsWith('.tuturuuu.localhost')) {
122
+ return true;
123
+ }
124
+ if (['localhost', '127.0.0.1', '::1', '[::1]'].includes(hostname) &&
125
+ KNOWN_NON_PLATFORM_LOCALHOST_PORTS.has(url.port)) {
126
+ return true;
127
+ }
128
+ return false;
129
+ }
130
+ function resolveNextPublicAppUrlAsWebOrigin() {
131
+ const origin = resolveConfiguredOrigin(process.env.NEXT_PUBLIC_APP_URL);
132
+ if (!origin || isKnownNonPlatformSatelliteOrigin(origin)) {
133
+ return null;
134
+ }
135
+ return origin;
136
+ }
137
+ function encodePathSegment(value) {
138
+ return encodeURIComponent(value);
139
+ }
140
+ function normalizeBaseUrl(baseUrl) {
141
+ let end = baseUrl.length;
142
+ while (end > 0 && baseUrl.charCodeAt(end - 1) === 47) {
143
+ end -= 1;
144
+ }
145
+ return end === baseUrl.length ? baseUrl : baseUrl.slice(0, end);
146
+ }
147
+ function isProductionDeployment() {
148
+ if (process.env.VERCEL_ENV) {
149
+ return process.env.VERCEL_ENV === 'production';
150
+ }
151
+ return process.env.NODE_ENV === 'production';
152
+ }
153
+ function normalizePath(path) {
154
+ if (/^https?:\/\//.test(path)) {
155
+ return path;
156
+ }
157
+ return path.startsWith('/') ? path : `/${path}`;
158
+ }
159
+ function appendQuery(path, query) {
160
+ if (!query || Object.keys(query).length === 0) {
161
+ return path;
162
+ }
163
+ const normalizedPath = normalizePath(path);
164
+ const isAbsoluteUrl = /^https?:\/\//.test(normalizedPath);
165
+ const url = isAbsoluteUrl
166
+ ? new URL(normalizedPath)
167
+ : new URL(normalizedPath, 'http://internal-api.local');
168
+ for (const [key, value] of Object.entries(query)) {
169
+ if (value === undefined || value === null) {
170
+ continue;
171
+ }
172
+ url.searchParams.set(key, String(value));
173
+ }
174
+ return isAbsoluteUrl ? url.toString() : `${url.pathname}${url.search}`;
175
+ }
176
+ function getConfiguredInternalApiBaseUrl() {
177
+ return normalizeBaseUrl(resolveConfiguredOrigin(process.env.INTERNAL_WEB_API_ORIGIN) ||
178
+ resolveConfiguredOrigin(process.env.WEB_APP_URL) ||
179
+ resolveConfiguredOrigin(process.env.NEXT_PUBLIC_WEB_APP_URL) ||
180
+ resolveNextPublicAppUrlAsWebOrigin() ||
181
+ resolveConfiguredOrigin(process.env.COOLIFY_URL) ||
182
+ resolveConfiguredOrigin(process.env.COOLIFY_FQDN) ||
183
+ (isProductionDeployment()
184
+ ? 'https://tuturuuu.com'
185
+ : 'https://tuturuuu.localhost'));
186
+ }
187
+ function isTasksApiProxyBrowserRuntime() {
188
+ const runtimeLocation = typeof globalThis === 'object' && 'location' in globalThis
189
+ ? globalThis.location
190
+ : undefined;
191
+ const hostname = runtimeLocation?.hostname?.toLowerCase();
192
+ return /^(?:tasks|calendar)\.tuturuuu\.(?:com|localhost)$/u.test(hostname ?? '');
193
+ }
194
+ function isMailAppRuntime() {
195
+ if (typeof process === 'undefined') {
196
+ return false;
197
+ }
198
+ const packageName = process.env.npm_package_name;
199
+ if (packageName === '@tuturuuu/mail') {
200
+ return true;
201
+ }
202
+ try {
203
+ return process.cwd().replace(/\\/gu, '/').endsWith('/apps/mail');
204
+ }
205
+ catch {
206
+ return false;
207
+ }
208
+ }
209
+ function getConfiguredTasksApiBaseUrl() {
210
+ return normalizeBaseUrl(resolveConfiguredOrigin(process.env.TASKS_APP_URL) ||
211
+ resolveConfiguredOrigin(process.env.NEXT_PUBLIC_TASKS_APP_URL) ||
212
+ resolveConfiguredOrigin(process.env.TUTURUUU_TASKS_BASE_URL) ||
213
+ resolveConfiguredOrigin(process.env.TUDO_APP_URL) ||
214
+ resolveConfiguredOrigin(process.env.NEXT_PUBLIC_TUDO_APP_URL) ||
215
+ (isProductionDeployment()
216
+ ? 'https://tasks.tuturuuu.com'
217
+ : 'https://tasks.tuturuuu.localhost'));
218
+ }
219
+ function withTaskApiBaseUrl(options = {}) {
220
+ if (options.baseUrl || isTasksApiProxyBrowserRuntime()) {
221
+ return options;
222
+ }
223
+ return {
224
+ ...options,
225
+ baseUrl: getConfiguredTasksApiBaseUrl(),
226
+ };
227
+ }
228
+ function getConfiguredMailApiBaseUrl() {
229
+ return normalizeBaseUrl(resolveConfiguredOrigin(process.env.MAIL_APP_URL) ||
230
+ resolveConfiguredOrigin(process.env.NEXT_PUBLIC_MAIL_APP_URL) ||
231
+ resolveConfiguredOrigin(process.env.TUTURUUU_MAIL_BASE_URL) ||
232
+ (isProductionDeployment()
233
+ ? 'https://mail.tuturuuu.com'
234
+ : 'https://mail.tuturuuu.localhost'));
235
+ }
236
+ function withMailApiBaseUrl(options = {}) {
237
+ if (options.baseUrl || isMailAppRuntime()) {
238
+ return options;
239
+ }
240
+ return {
241
+ ...options,
242
+ baseUrl: getConfiguredMailApiBaseUrl(),
243
+ };
244
+ }
245
+ function isCurrentBrowserHostname(...hostnames) {
246
+ const runtimeLocation = typeof globalThis === 'object' && 'location' in globalThis
247
+ ? globalThis.location
248
+ : undefined;
249
+ const hostname = runtimeLocation?.hostname?.toLowerCase();
250
+ return hostname !== undefined && hostnames.includes(hostname);
251
+ }
252
+ function isCurrentAppServerRuntime(packageName, appDir) {
253
+ if (typeof process === 'undefined') {
254
+ return false;
255
+ }
256
+ if (process.env.npm_package_name === packageName) {
257
+ return true;
258
+ }
259
+ try {
260
+ return process.cwd().replace(/\\/gu, '/').endsWith(appDir);
261
+ }
262
+ catch {
263
+ return false;
264
+ }
265
+ }
266
+ function isLearnAppRuntime() {
267
+ return (isCurrentBrowserHostname('learn.tuturuuu.com', 'learn.tuturuuu.localhost') || isCurrentAppServerRuntime('@tuturuuu/learn', '/apps/learn'));
268
+ }
269
+ function isTeachAppRuntime() {
270
+ return (isCurrentBrowserHostname('teach.tuturuuu.com', 'teach.tuturuuu.localhost') || isCurrentAppServerRuntime('@tuturuuu/teach', '/apps/teach'));
271
+ }
272
+ function getConfiguredLearnApiBaseUrl() {
273
+ return normalizeBaseUrl(resolveConfiguredOrigin(process.env.LEARN_APP_URL) ||
274
+ resolveConfiguredOrigin(process.env.NEXT_PUBLIC_LEARN_APP_URL) ||
275
+ resolveConfiguredOrigin(process.env.TUTURUUU_LEARN_BASE_URL) ||
276
+ (isProductionDeployment()
277
+ ? 'https://learn.tuturuuu.com'
278
+ : 'https://learn.tuturuuu.localhost'));
279
+ }
280
+ function withLearnApiBaseUrl(options = {}) {
281
+ if (options.baseUrl || isLearnAppRuntime()) {
282
+ return options;
283
+ }
284
+ return {
285
+ ...options,
286
+ baseUrl: getConfiguredLearnApiBaseUrl(),
287
+ };
288
+ }
289
+ function getConfiguredTeachApiBaseUrl() {
290
+ return normalizeBaseUrl(resolveConfiguredOrigin(process.env.TEACH_APP_URL) ||
291
+ resolveConfiguredOrigin(process.env.NEXT_PUBLIC_TEACH_APP_URL) ||
292
+ resolveConfiguredOrigin(process.env.TUTURUUU_TEACH_BASE_URL) ||
293
+ (isProductionDeployment()
294
+ ? 'https://teach.tuturuuu.com'
295
+ : 'https://teach.tuturuuu.localhost'));
296
+ }
297
+ function withTeachApiBaseUrl(options = {}) {
298
+ if (options.baseUrl || isTeachAppRuntime()) {
299
+ return options;
300
+ }
301
+ return {
302
+ ...options,
303
+ baseUrl: getConfiguredTeachApiBaseUrl(),
304
+ };
305
+ }
306
+ function isPayAppRuntime() {
307
+ return (isCurrentBrowserHostname('pay.tuturuuu.com', 'pay.tuturuuu.localhost') ||
308
+ isCurrentAppServerRuntime('@tuturuuu/pay', '/apps/pay'));
309
+ }
310
+ function getConfiguredPayApiBaseUrl() {
311
+ return normalizeBaseUrl(resolveConfiguredOrigin(process.env.PAY_APP_URL) ||
312
+ resolveConfiguredOrigin(process.env.NEXT_PUBLIC_PAY_APP_URL) ||
313
+ resolveConfiguredOrigin(process.env.TUTURUUU_PAY_BASE_URL) ||
314
+ (isProductionDeployment()
315
+ ? 'https://pay.tuturuuu.com'
316
+ : 'https://pay.tuturuuu.localhost'));
317
+ }
318
+ function withPayApiBaseUrl(options = {}) {
319
+ if (options.baseUrl || isPayAppRuntime()) {
320
+ return options;
321
+ }
322
+ return {
323
+ ...options,
324
+ baseUrl: getConfiguredPayApiBaseUrl(),
325
+ };
326
+ }
327
+ function isContactsAppRuntime() {
328
+ return (isCurrentBrowserHostname('contacts.tuturuuu.com', 'contacts.tuturuuu.localhost') || isCurrentAppServerRuntime('@tuturuuu/contacts', '/apps/contacts'));
329
+ }
330
+ function getConfiguredContactsApiBaseUrl() {
331
+ return normalizeBaseUrl(resolveConfiguredOrigin(process.env.CONTACTS_APP_URL) ||
332
+ resolveConfiguredOrigin(process.env.NEXT_PUBLIC_CONTACTS_APP_URL) ||
333
+ resolveConfiguredOrigin(process.env.TUTURUUU_CONTACTS_BASE_URL) ||
334
+ (isProductionDeployment()
335
+ ? 'https://contacts.tuturuuu.com'
336
+ : 'https://contacts.tuturuuu.localhost'));
337
+ }
338
+ function withContactsApiBaseUrl(options = {}) {
339
+ if (options.baseUrl || isContactsAppRuntime()) {
340
+ return options;
341
+ }
342
+ return {
343
+ ...options,
344
+ baseUrl: getConfiguredContactsApiBaseUrl(),
345
+ };
346
+ }
347
+ /**
348
+ * `/api/v1/tulearn/bootstrap` is owned by apps/learn but is also consumed by
349
+ * apps/teach. Pin the call to the CALLING app's own origin so its app-session
350
+ * audience (learn or teach) matches — never cross-pin teach → learn (learn's
351
+ * proxy would reject a teach-audience session).
352
+ */
353
+ function withEducationBootstrapBaseUrl(options = {}) {
354
+ if (options.baseUrl) {
355
+ return options;
356
+ }
357
+ if (isTeachAppRuntime()) {
358
+ return {
359
+ ...options,
360
+ baseUrl: getConfiguredTeachApiBaseUrl(),
361
+ };
362
+ }
363
+ return {
364
+ ...options,
365
+ baseUrl: getConfiguredLearnApiBaseUrl(),
366
+ };
367
+ }
368
+ function isFinanceBrowserRuntime() {
369
+ return isCurrentBrowserHostname('finance.tuturuuu.com', 'finance.tuturuuu.localhost');
370
+ }
371
+ function getConfiguredFinanceApiBaseUrl() {
372
+ return normalizeBaseUrl(resolveConfiguredOrigin(process.env.FINANCE_APP_URL) ||
373
+ resolveConfiguredOrigin(process.env.NEXT_PUBLIC_FINANCE_APP_URL) ||
374
+ resolveConfiguredOrigin(process.env.TUTURUUU_FINANCE_BASE_URL) ||
375
+ (isProductionDeployment()
376
+ ? 'https://finance.tuturuuu.com'
377
+ : 'https://finance.tuturuuu.localhost'));
378
+ }
379
+ function withFinanceApiBaseUrl(options = {}) {
380
+ if (options.baseUrl || isFinanceBrowserRuntime()) {
381
+ return options;
382
+ }
383
+ return {
384
+ ...options,
385
+ baseUrl: getConfiguredFinanceApiBaseUrl(),
386
+ };
387
+ }
388
+ function resolveInternalApiUrl(path, baseUrl) {
389
+ const normalizedPath = normalizePath(path);
390
+ if (/^https?:\/\//.test(normalizedPath)) {
391
+ return normalizedPath;
392
+ }
393
+ const resolvedBaseUrl = baseUrl
394
+ ? normalizeBaseUrl(baseUrl)
395
+ : typeof window === 'undefined'
396
+ ? getConfiguredInternalApiBaseUrl()
397
+ : undefined;
398
+ if (!resolvedBaseUrl) {
399
+ return normalizedPath;
400
+ }
401
+ return new URL(normalizedPath, resolvedBaseUrl).toString();
402
+ }
403
+ function getCookieName(cookiePart) {
404
+ return cookiePart.trim().split('=')[0]?.trim() ?? '';
405
+ }
406
+ function hasAppSessionCookie(cookieHeader) {
407
+ return cookieHeader
408
+ .split(';')
409
+ .some((part) => getCookieName(part) === APP_SESSION_COOKIE_NAME);
410
+ }
411
+ function getSupabaseAuthStorageKey(url) {
412
+ return `sb-${new URL(url).hostname.split('.')[0]}-auth-token`;
413
+ }
414
+ function getConfiguredSupabaseAuthStorageKeys() {
415
+ return [
416
+ process.env.NEXT_PUBLIC_SUPABASE_URL,
417
+ process.env.SUPABASE_SERVER_URL,
418
+ process.env.SUPABASE_URL,
419
+ ]
420
+ .flatMap((url) => {
421
+ if (!url) {
422
+ return [];
423
+ }
424
+ try {
425
+ return [getSupabaseAuthStorageKey(url)];
426
+ }
427
+ catch {
428
+ return [];
429
+ }
430
+ })
431
+ .filter((value, index, values) => values.indexOf(value) === index);
432
+ }
433
+ function isSupabaseAuthCookieChunkForStorageKey(cookieName, storageKey) {
434
+ if (cookieName === storageKey) {
435
+ return true;
436
+ }
437
+ if (!cookieName.startsWith(`${storageKey}.`)) {
438
+ return false;
439
+ }
440
+ return /^\d+$/u.test(cookieName.slice(storageKey.length + 1));
441
+ }
442
+ function isSharedSupabaseCookieHostname(hostname) {
443
+ return (hostname === 'tuturuuu.com' ||
444
+ hostname.endsWith('.tuturuuu.com') ||
445
+ hostname === 'tuturuuu.localhost' ||
446
+ hostname.endsWith('.tuturuuu.localhost'));
447
+ }
448
+ function shouldPreserveSupabaseAuthCookie(cookieName, targetOrigin) {
449
+ if (!targetOrigin) {
450
+ return false;
451
+ }
452
+ const targetUrl = tryParseAbsoluteUrl(targetOrigin);
453
+ if (!targetUrl || !isSharedSupabaseCookieHostname(targetUrl.hostname)) {
454
+ return false;
455
+ }
456
+ return getConfiguredSupabaseAuthStorageKeys().some((storageKey) => isSupabaseAuthCookieChunkForStorageKey(cookieName, storageKey));
457
+ }
458
+ function sanitizeForwardedCookieHeader(cookieHeader, targetOrigin) {
459
+ if (!cookieHeader || !hasAppSessionCookie(cookieHeader)) {
460
+ return cookieHeader;
461
+ }
462
+ const cookies = cookieHeader
463
+ .split(';')
464
+ .map((part) => part.trim())
465
+ .filter(Boolean)
466
+ .filter((part) => {
467
+ const cookieName = getCookieName(part);
468
+ return (!SUPABASE_AUTH_COOKIE_PATTERN.test(cookieName) ||
469
+ shouldPreserveSupabaseAuthCookie(cookieName, targetOrigin));
470
+ });
471
+ return cookies.length > 0 ? cookies.join('; ') : null;
472
+ }
473
+ function createInternalApiClient(options = {}) {
474
+ const doFetch = (path, init = {}) => {
475
+ const fetchImpl = options.fetch ?? globalThis.fetch;
476
+ const { baseUrl, headers: requestHeaders, query, ...requestInit } = init;
477
+ const requestPath = appendQuery(path, query);
478
+ const url = resolveInternalApiUrl(requestPath, baseUrl || options.baseUrl);
479
+ const headers = (0, request_headers_js_1.mergeHeaders)(options.defaultHeaders, requestHeaders);
480
+ return fetchImpl(url, {
481
+ ...requestInit,
482
+ headers,
483
+ });
484
+ };
485
+ return {
486
+ fetch: doFetch,
487
+ async json(path, init = {}) {
488
+ const response = await doFetch(path, init);
489
+ if (!response.ok)
490
+ throw await (0, internal_api_error_js_1.parseInternalApiError)(response);
491
+ if (response.status === 204) {
492
+ return undefined;
493
+ }
494
+ return (await response.json());
495
+ },
496
+ };
497
+ }
498
+ /**
499
+ * Creates Internal API client options that forward auth-relevant headers
500
+ * from an incoming request context (for example `next/headers()` in RSC).
501
+ */
502
+ function withForwardedInternalApiAuth(requestHeaders, options = {}) {
503
+ const authorizationHeader = requestHeaders.get('authorization');
504
+ const allowedOrigins = new Set();
505
+ if (options.baseUrl) {
506
+ const parsed = tryParseAbsoluteUrl(normalizeBaseUrl(options.baseUrl));
507
+ if (parsed) {
508
+ allowedOrigins.add(parsed.origin);
509
+ }
510
+ }
511
+ const configuredBaseUrl = tryParseAbsoluteUrl(getConfiguredInternalApiBaseUrl());
512
+ if (configuredBaseUrl) {
513
+ allowedOrigins.add(configuredBaseUrl.origin);
514
+ }
515
+ const configuredTasksBaseUrl = tryParseAbsoluteUrl(getConfiguredTasksApiBaseUrl());
516
+ if (configuredTasksBaseUrl) {
517
+ allowedOrigins.add(configuredTasksBaseUrl.origin);
518
+ }
519
+ const configuredMailBaseUrl = tryParseAbsoluteUrl(getConfiguredMailApiBaseUrl());
520
+ if (configuredMailBaseUrl) {
521
+ allowedOrigins.add(configuredMailBaseUrl.origin);
522
+ }
523
+ const configuredLearnBaseUrl = tryParseAbsoluteUrl(getConfiguredLearnApiBaseUrl());
524
+ if (configuredLearnBaseUrl) {
525
+ allowedOrigins.add(configuredLearnBaseUrl.origin);
526
+ }
527
+ const configuredTeachBaseUrl = tryParseAbsoluteUrl(getConfiguredTeachApiBaseUrl());
528
+ if (configuredTeachBaseUrl) {
529
+ allowedOrigins.add(configuredTeachBaseUrl.origin);
530
+ }
531
+ const configuredFinanceBaseUrl = tryParseAbsoluteUrl(getConfiguredFinanceApiBaseUrl());
532
+ if (configuredFinanceBaseUrl) {
533
+ allowedOrigins.add(configuredFinanceBaseUrl.origin);
534
+ }
535
+ const configuredPayBaseUrl = tryParseAbsoluteUrl(getConfiguredPayApiBaseUrl());
536
+ if (configuredPayBaseUrl) {
537
+ allowedOrigins.add(configuredPayBaseUrl.origin);
538
+ }
539
+ const configuredContactsBaseUrl = tryParseAbsoluteUrl(getConfiguredContactsApiBaseUrl());
540
+ if (configuredContactsBaseUrl) {
541
+ allowedOrigins.add(configuredContactsBaseUrl.origin);
542
+ }
543
+ const targetOrigin = (options.baseUrl
544
+ ? tryParseAbsoluteUrl(normalizeBaseUrl(options.baseUrl))?.origin
545
+ : null) ??
546
+ configuredBaseUrl?.origin ??
547
+ null;
548
+ const cookieHeader = sanitizeForwardedCookieHeader(requestHeaders.get('cookie'), targetOrigin);
549
+ if (!cookieHeader && !authorizationHeader) {
550
+ return options;
551
+ }
552
+ const runtimeLocation = typeof globalThis === 'object' && 'location' in globalThis
553
+ ? globalThis.location
554
+ : undefined;
555
+ if (runtimeLocation?.origin) {
556
+ allowedOrigins.add(runtimeLocation.origin);
557
+ }
558
+ const baseFetch = options.fetch || globalThis.fetch;
559
+ const forwardedFetch = async (input, init) => {
560
+ const requestUrl = typeof input === 'string'
561
+ ? input
562
+ : input instanceof URL
563
+ ? input.toString()
564
+ : input.url;
565
+ const isRelativeRequest = typeof requestUrl === 'string' && requestUrl.startsWith('/');
566
+ const parsedRequestUrl = isRelativeRequest
567
+ ? null
568
+ : tryParseAbsoluteUrl(requestUrl);
569
+ const shouldForwardAuth = isRelativeRequest ||
570
+ (parsedRequestUrl ? allowedOrigins.has(parsedRequestUrl.origin) : false);
571
+ if (!shouldForwardAuth) {
572
+ return baseFetch(input, init);
573
+ }
574
+ const headers = new Headers(input instanceof Request ? input.headers : undefined);
575
+ if (init?.headers) {
576
+ const initHeaders = new Headers(init.headers);
577
+ initHeaders.forEach((value, key) => {
578
+ headers.set(key, value);
579
+ });
580
+ }
581
+ if (cookieHeader && !headers.has('cookie')) {
582
+ headers.set('cookie', cookieHeader);
583
+ }
584
+ if (authorizationHeader && !headers.has('authorization')) {
585
+ headers.set('authorization', authorizationHeader);
586
+ }
587
+ return baseFetch(input, {
588
+ ...init,
589
+ headers,
590
+ });
591
+ };
592
+ return {
593
+ ...options,
594
+ fetch: forwardedFetch,
595
+ };
596
+ }
597
+ exports.internalApiClient = createInternalApiClient();
598
+ function getInternalApiClient(options) {
599
+ return options ? createInternalApiClient(options) : exports.internalApiClient;
600
+ }
601
+ //# sourceMappingURL=client.js.map