loopable-cli 0.2.0 → 0.3.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 (138) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/_connectorId-CDCuSgpN.js +1 -0
  3. package/.output/public/assets/_loopId-DOnIsVTW.js +1 -0
  4. package/.output/public/assets/_taskId-BO5MZnlZ.js +1 -0
  5. package/.output/public/assets/agents-CBozi7oi.js +1 -0
  6. package/.output/public/assets/alert-Bn_wjgTX.js +1 -0
  7. package/.output/public/assets/button-K3ypIhAZ.js +1 -0
  8. package/.output/public/assets/card-DiVnaTIE.js +1 -0
  9. package/.output/public/assets/chevron-right-BrctLtFK.js +1 -0
  10. package/.output/public/assets/connection-status-DKWelvLO.js +1 -0
  11. package/.output/public/assets/connector-icon-CEbdE71G.js +1 -0
  12. package/.output/public/assets/connectors-JyX3IzJj.js +1 -0
  13. package/.output/public/assets/gaps-PjmcbaWo.js +1 -0
  14. package/.output/public/assets/inbox-CujRR0Cz.js +1 -0
  15. package/.output/public/assets/index-C9SQ_Baq.js +16 -0
  16. package/.output/public/assets/loop-form-Dw3cuTzw.js +1 -0
  17. package/.output/public/assets/loops-DcEfZa2_.js +1 -0
  18. package/.output/public/assets/manifests-yJpevyye.js +1 -0
  19. package/.output/public/assets/new-CwsnNuRW.js +1 -0
  20. package/.output/public/assets/page-bvnfRMum.js +1 -0
  21. package/.output/public/assets/play-yHLs4DjK.js +1 -0
  22. package/.output/public/assets/plus-Ber25lrU.js +1 -0
  23. package/.output/public/assets/preload-helper-BoU_7EQC.js +3 -0
  24. package/.output/public/assets/refresh-cw-BzSY7M8I.js +1 -0
  25. package/.output/public/assets/rotate-ccw-DLv9EfCX.js +1 -0
  26. package/.output/public/assets/runners-DzX-RU3i.js +2 -0
  27. package/.output/public/assets/select-C9grIFwG.js +1 -0
  28. package/.output/public/assets/setting-fields-DUc3npgh.js +3 -0
  29. package/.output/public/assets/styles-B9B98zLk.css +2 -0
  30. package/.output/public/assets/switch-DwABVI6d.js +1 -0
  31. package/.output/public/assets/task-list-Ddk8-qt7.js +1 -0
  32. package/.output/public/assets/textarea-Ds-gIYUQ.js +1 -0
  33. package/.output/public/assets/time-goBWd-5J.js +1 -0
  34. package/.output/public/assets/use-live-tasks-DZNNuECy.js +1 -0
  35. package/.output/public/assets/useCompositeListItem-P4Nmmn7j.js +1 -0
  36. package/.output/public/assets/usePositioner-B7i9Ejzh.js +1 -0
  37. package/.output/server/_chunks/ssr-renderer.mjs +1 -1
  38. package/.output/server/_connectorId-COuQN02a.mjs +512 -0
  39. package/.output/server/_libs/@base-ui/react+[...].mjs +1410 -804
  40. package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
  41. package/.output/server/_libs/lucide-react.mjs +93 -84
  42. package/.output/server/_libs/next-themes.mjs +1 -1
  43. package/.output/server/_libs/sonner.mjs +1 -1
  44. package/.output/server/_loopId-CZh6_Yhr.mjs +310 -0
  45. package/.output/server/_ssr/{callback-D20cVD2w.mjs → access-DTttr563.mjs} +37 -20
  46. package/.output/server/_ssr/{agents-CrUmIQpi.mjs → agents-B_qo1gpL.mjs} +196 -7
  47. package/.output/server/_ssr/{agents-Dms_6TBF.mjs → agents-Bz10gz_m.mjs} +8 -8
  48. package/.output/server/_ssr/agents-CjbOUp3Z.mjs +206 -0
  49. package/.output/server/_ssr/{alert-DQvzE7bu.mjs → alert-C2WBWfzo.mjs} +2 -2
  50. package/.output/server/_ssr/card-r1cV-PCN.mjs +36 -0
  51. package/.output/server/_ssr/{client-BtVRVhQ2.mjs → client-Dk3SD8Il.mjs} +5 -1
  52. package/.output/server/_ssr/connection-status-BogAL-Fj.mjs +32 -0
  53. package/.output/server/_ssr/{connections-ypex3qUd.mjs → connections-Cqvb6Gw2.mjs} +1109 -263
  54. package/.output/server/_ssr/connector-icon-DrhVbhs6.mjs +190 -0
  55. package/.output/server/_ssr/connectors-BfS5tQKr.mjs +81 -0
  56. package/.output/server/_ssr/{connectors-BZly0yGF.mjs → connectors-DJI-rzPU.mjs} +21 -10
  57. package/.output/server/_ssr/{createServerRpc-DPDrnFdH.mjs → createServerRpc-DDrp2nLT.mjs} +2 -2
  58. package/.output/server/_ssr/{gaps-D2Zh8sEo.mjs → gaps-CcvHiLcj.mjs} +18 -10
  59. package/.output/server/_ssr/inbox-D1ef761v.mjs +178 -0
  60. package/.output/server/_ssr/loop-form-DWwOR05R.mjs +346 -0
  61. package/.output/server/_ssr/{loops-Og_G3KyZ.mjs → loops-6WhUe_lc.mjs} +228 -25
  62. package/.output/server/_ssr/loops-DHPjzG-t.mjs +217 -0
  63. package/.output/server/_ssr/new-ChKBdcXJ.mjs +245 -0
  64. package/.output/server/_ssr/page-DZVxKvdn.mjs +120 -0
  65. package/.output/server/_ssr/{router-BbrBz36P.mjs → router-DdwREiOf.mjs} +167 -489
  66. package/.output/server/_ssr/runners-CK9Cx9fS.mjs +217 -0
  67. package/.output/server/_ssr/runners-CrznFPHt.mjs +140 -0
  68. package/.output/server/_ssr/runners-W-pgo5yo.mjs +55 -0
  69. package/.output/server/_ssr/{secrets-CRnpwGBh.mjs → secrets-CV5scFlt.mjs} +2 -2
  70. package/.output/server/_ssr/select-BtndHhHb.mjs +76 -0
  71. package/.output/server/_ssr/{setting-fields-mpXfGftI.mjs → setting-fields-LNgywAW7.mjs} +25 -20
  72. package/.output/server/_ssr/ssr.mjs +49 -40
  73. package/.output/server/_ssr/{start-BgTj-h_C.mjs → start-C_j-e4vF.mjs} +10 -6
  74. package/.output/server/_ssr/{switch-1pnd_bPJ.mjs → switch-odxNO_S4.mjs} +3 -3
  75. package/.output/server/_ssr/task-list-Dnmq_WeE.mjs +150 -0
  76. package/.output/server/_ssr/{tasks-LIi-W4cy.mjs → tasks-D-kXLgVP.mjs} +13 -13
  77. package/.output/server/_ssr/{tasks-B_QmDFVs.mjs → tasks-D7aUvA33.mjs} +55 -17
  78. package/.output/server/_ssr/{textarea-CHJTKtsJ.mjs → textarea-D2c_vTIC.mjs} +2 -2
  79. package/.output/server/_ssr/time-Cy8TZP0Z.mjs +13 -0
  80. package/.output/server/_ssr/use-live-tasks-BzhTkEOL.mjs +40 -0
  81. package/.output/server/_tanstack-start-manifest_v-2HUdn-2E.mjs +166 -0
  82. package/.output/server/_taskId-D3KkNJW1.mjs +263 -0
  83. package/.output/server/index.mjs +204 -162
  84. package/README.md +54 -19
  85. package/dist/cli.mjs +185 -67
  86. package/dist/dispatcher.mjs +1443 -277
  87. package/dist/runner.mjs +333 -46
  88. package/drizzle/0025_prompt_tasks_done.sql +2 -0
  89. package/drizzle/0026_guidance_into_prompt.sql +3 -0
  90. package/drizzle/0027_relative_folders.sql +5 -0
  91. package/drizzle/0028_runner_version.sql +5 -0
  92. package/drizzle/meta/_journal.json +29 -1
  93. package/package.json +23 -17
  94. package/.output/public/assets/_connectorId-m67WbiJ8.js +0 -1
  95. package/.output/public/assets/_loopId-Bf4K5sdd.js +0 -1
  96. package/.output/public/assets/_taskId-eCKkcVOx.js +0 -1
  97. package/.output/public/assets/alert-BT2EVMJP.js +0 -1
  98. package/.output/public/assets/arrow-left-CWUZt6k2.js +0 -1
  99. package/.output/public/assets/arrow-right-dy_oOg_c.js +0 -1
  100. package/.output/public/assets/connection-status-DCqqmY_6.js +0 -1
  101. package/.output/public/assets/connector-icon-qGpNsPgH.js +0 -1
  102. package/.output/public/assets/connectors-DxXlc9zF.js +0 -1
  103. package/.output/public/assets/external-link-DC11orFA.js +0 -1
  104. package/.output/public/assets/gaps-CoTA-PzA.js +0 -1
  105. package/.output/public/assets/inbox-CLEXUXCI.js +0 -1
  106. package/.output/public/assets/index-Cndsw84p.js +0 -16
  107. package/.output/public/assets/loader-B4Epchm_.js +0 -1
  108. package/.output/public/assets/loop-form-BvizlZdR.js +0 -1
  109. package/.output/public/assets/loops-Dbe_mf5T.js +0 -1
  110. package/.output/public/assets/new-DPEaXKAY.js +0 -1
  111. package/.output/public/assets/play-DD4xQgvi.js +0 -1
  112. package/.output/public/assets/preload-helper-CfdAYKD7.js +0 -3
  113. package/.output/public/assets/rolldown-runtime-CbXtAM7H.js +0 -1
  114. package/.output/public/assets/runners-BVBggS5B.js +0 -1
  115. package/.output/public/assets/select-Cppu-hti.js +0 -1
  116. package/.output/public/assets/setting-fields-BT1naVJX.js +0 -3
  117. package/.output/public/assets/styles-D3sonCfX.css +0 -2
  118. package/.output/public/assets/switch-hRIbNGOj.js +0 -1
  119. package/.output/public/assets/task-list-CrptnI1N.js +0 -1
  120. package/.output/public/assets/textarea-Fyuzi6Vp.js +0 -1
  121. package/.output/public/assets/trash-2-BXZzBsoV.js +0 -1
  122. package/.output/public/assets/useValueChanged-VVyq4hb9.js +0 -1
  123. package/.output/server/_connectorId-DcSnoRjk.mjs +0 -421
  124. package/.output/server/_loopId-G_TAkYtS.mjs +0 -272
  125. package/.output/server/_ssr/access-B7TcOZ7F.mjs +0 -42
  126. package/.output/server/_ssr/connection-status-BZr3Y-IC.mjs +0 -31
  127. package/.output/server/_ssr/connector-icon-CFrrHjzR.mjs +0 -37
  128. package/.output/server/_ssr/connectors-4yzKb0KG.mjs +0 -106
  129. package/.output/server/_ssr/inbox-C2VBGLa5.mjs +0 -114
  130. package/.output/server/_ssr/loop-form-D-U-kU4k.mjs +0 -413
  131. package/.output/server/_ssr/loops-D0XJ8eBb.mjs +0 -222
  132. package/.output/server/_ssr/new-CajvgIog.mjs +0 -169
  133. package/.output/server/_ssr/runners-B_WuF8UJ.mjs +0 -32
  134. package/.output/server/_ssr/runners-D-0_lfiq.mjs +0 -106
  135. package/.output/server/_ssr/runners-zqF_zbEc.mjs +0 -116
  136. package/.output/server/_ssr/task-list-BnQJ94Dk.mjs +0 -187
  137. package/.output/server/_tanstack-start-manifest_v-BCHAazE8.mjs +0 -129
  138. package/.output/server/_taskId-CIv0ajIx.mjs +0 -256
@@ -1,16 +1,17 @@
1
1
  import { n as __exportAll } from "../_runtime.mjs";
2
- import { U as require_jsx_runtime, W as require_react } from "../_libs/@base-ui/react+[...].mjs";
2
+ import { K as require_jsx_runtime, q as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
3
  import { n as defineHandlerCallback, o as RouterProvider, t as renderRouterToStream } from "../_libs/@tanstack/react-router+[...].mjs";
4
4
  import { PassThrough, Readable } from "node:stream";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  //#region node_modules/.nitro/vite/services/ssr/index.js
7
7
  var ssr_exports = /* @__PURE__ */ __exportAll({
8
+ a: () => getServerFnById,
8
9
  createServerEntry: () => createServerEntry,
9
10
  default: () => server_default,
10
- i: () => getServerFnById,
11
- n: () => createServerFn,
12
- r: () => TSS_SERVER_FUNCTION,
13
- t: () => createMiddleware
11
+ i: () => TSS_SERVER_FUNCTION,
12
+ n: () => createMiddleware,
13
+ r: () => createServerFn,
14
+ t: () => createCsrfMiddleware
14
15
  });
15
16
  require_react();
16
17
  var import_jsx_runtime = require_jsx_runtime();
@@ -4107,7 +4108,7 @@ var defaultSerovalPlugins = [
4107
4108
  * the dev styles URL for route-scoped CSS collection.
4108
4109
  */
4109
4110
  async function getStartManifest(matchedRoutes) {
4110
- const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-BCHAazE8.mjs");
4111
+ const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-2HUdn-2E.mjs");
4111
4112
  const startManifest = tsrStartManifest();
4112
4113
  let routes = startManifest.routes;
4113
4114
  routes[rootRouteId];
@@ -4129,127 +4130,135 @@ async function getStartManifest(matchedRoutes) {
4129
4130
  var manifest = {
4130
4131
  "0033ef7c619c027b1428a722dff188d315ed335645afcb1033528630b7c95e88": {
4131
4132
  functionName: "getTaskById_createServerFn_handler",
4132
- importer: () => import("./tasks-LIi-W4cy.mjs")
4133
+ importer: () => import("./tasks-D-kXLgVP.mjs")
4133
4134
  },
4134
4135
  "0e209afb63fad4a95a5cfeaf4831610f23673145cbf5b8054765d79804a62d31": {
4135
4136
  functionName: "getConnectorOverview_createServerFn_handler",
4136
- importer: () => import("./connectors-BZly0yGF.mjs")
4137
+ importer: () => import("./connectors-DJI-rzPU.mjs")
4137
4138
  },
4138
4139
  "0fa144f67263a4a51c51e8baf134a15b89c0afdf9b92b64660520a5bce247eec": {
4139
4140
  functionName: "pauseDispatcher_createServerFn_handler",
4140
- importer: () => import("./tasks-LIi-W4cy.mjs")
4141
+ importer: () => import("./tasks-D-kXLgVP.mjs")
4141
4142
  },
4142
4143
  "143ea51f7421d9eebec9ad31c2df8eed5aa2e5d8035473dbfad39913fd7d54c0": {
4143
4144
  functionName: "chooseDefaultAgent_createServerFn_handler",
4144
- importer: () => import("./agents-Dms_6TBF.mjs")
4145
+ importer: () => import("./agents-Bz10gz_m.mjs")
4145
4146
  },
4146
4147
  "18bae5deb2a19571893f0067e374e537f16d6774f9b4e04f9b7349360f6f8fdc": {
4147
4148
  functionName: "saveConnectionSettings_createServerFn_handler",
4148
- importer: () => import("./connectors-BZly0yGF.mjs")
4149
+ importer: () => import("./connectors-DJI-rzPU.mjs")
4149
4150
  },
4150
4151
  "3f938fac3e5ec1631e700a2fdd4790e78abbefeb732ecfbbe6864cc19f0d5aac": {
4151
4152
  functionName: "getLoopTasks_createServerFn_handler",
4152
- importer: () => import("./tasks-LIi-W4cy.mjs")
4153
+ importer: () => import("./tasks-D-kXLgVP.mjs")
4153
4154
  },
4154
4155
  "3fc8a7de98be979f9820a4f5a0ca2e234ed8a7df8e692abb8c4437765474eca0": {
4155
4156
  functionName: "toggleLoop_createServerFn_handler",
4156
- importer: () => import("./loops-Og_G3KyZ.mjs")
4157
+ importer: () => import("./loops-6WhUe_lc.mjs")
4157
4158
  },
4158
4159
  "43b97e3644ad73286fe5de3e99134bff099e1a8704f1ae91fe643d419eceba73": {
4159
4160
  functionName: "continueQrLogin_createServerFn_handler",
4160
- importer: () => import("./connectors-BZly0yGF.mjs")
4161
+ importer: () => import("./connectors-DJI-rzPU.mjs")
4161
4162
  },
4162
4163
  "45dbbb612763589268984d236edcd17f5868ecf716df9625bfa46e7fec691f4e": {
4163
4164
  functionName: "getRunnersPage_createServerFn_handler",
4164
- importer: () => import("./runners-B_WuF8UJ.mjs")
4165
+ importer: () => import("./runners-W-pgo5yo.mjs")
4165
4166
  },
4166
4167
  "48bc32df9d6f69f45df8dfbc6e798e1f99152dbd4b4ed65b149fa2612c65e687": {
4167
4168
  functionName: "getInbox_createServerFn_handler",
4168
- importer: () => import("./tasks-LIi-W4cy.mjs")
4169
+ importer: () => import("./tasks-D-kXLgVP.mjs")
4169
4170
  },
4170
4171
  "4fd3855e3e9ed954e102071a55b98d91651c9b1e353161f7223768ed6f2b8c28": {
4171
4172
  functionName: "getLoopPollState_createServerFn_handler",
4172
- importer: () => import("./loops-Og_G3KyZ.mjs")
4173
+ importer: () => import("./loops-6WhUe_lc.mjs")
4173
4174
  },
4174
4175
  "611491b32d9583ccaae637ddf9fb2f842ff75994f50513ecd8273e305e889eb8": {
4175
4176
  functionName: "removeRunner_createServerFn_handler",
4176
- importer: () => import("./runners-B_WuF8UJ.mjs")
4177
+ importer: () => import("./runners-W-pgo5yo.mjs")
4177
4178
  },
4178
4179
  "65494cbfd06143dbd9a012808fbba21163d9902e387869503fb8b68b0674902b": {
4179
4180
  functionName: "runLoopBacklog_createServerFn_handler",
4180
- importer: () => import("./loops-Og_G3KyZ.mjs")
4181
+ importer: () => import("./loops-6WhUe_lc.mjs")
4181
4182
  },
4182
4183
  "6d5a90e9ec4ebf70d8e2ac4aff960533a5e68d21b289033cc7e0751d00554c93": {
4183
4184
  functionName: "getLoopsPage_createServerFn_handler",
4184
- importer: () => import("./loops-Og_G3KyZ.mjs")
4185
+ importer: () => import("./loops-6WhUe_lc.mjs")
4185
4186
  },
4186
4187
  "7258ce5fc6f23acf3aab039ecd4acdb006d42b2ddbf3ab8629b4000e101b51dc": {
4187
4188
  functionName: "runLoopNow_createServerFn_handler",
4188
- importer: () => import("./tasks-LIi-W4cy.mjs")
4189
+ importer: () => import("./tasks-D-kXLgVP.mjs")
4189
4190
  },
4190
4191
  "794964d675b97edaa881ab5cb209225ef0a4507e3d2771d6577658a058e7621f": {
4191
4192
  functionName: "beginQrLogin_createServerFn_handler",
4192
- importer: () => import("./connectors-BZly0yGF.mjs")
4193
+ importer: () => import("./connectors-DJI-rzPU.mjs")
4193
4194
  },
4194
4195
  "7d7d5f80a4f0d2b3bb659d7dc2a91ea5983880648b9d1aa24356e7340505930f": {
4195
4196
  functionName: "reorderLoop_createServerFn_handler",
4196
- importer: () => import("./loops-Og_G3KyZ.mjs")
4197
+ importer: () => import("./loops-6WhUe_lc.mjs")
4197
4198
  },
4198
4199
  "80883b912a5a0aba2aa583b505e4e289d765a3f7fbb793a97692f439e7f960ba": {
4199
4200
  functionName: "saveAgent_createServerFn_handler",
4200
- importer: () => import("./agents-Dms_6TBF.mjs")
4201
+ importer: () => import("./agents-Bz10gz_m.mjs")
4201
4202
  },
4202
4203
  "81a1af559b2a373901872aa9f9a6546f2f3bda8157d81c21a36ba0d1d337613b": {
4203
4204
  functionName: "getLoopById_createServerFn_handler",
4204
- importer: () => import("./loops-Og_G3KyZ.mjs")
4205
+ importer: () => import("./loops-6WhUe_lc.mjs")
4205
4206
  },
4206
4207
  "81f567724371f0d6f24e636906e2e9ea5b7384422ac583c86a1050fb838664ce": {
4207
4208
  functionName: "getTaskLog_createServerFn_handler",
4208
- importer: () => import("./tasks-LIi-W4cy.mjs")
4209
+ importer: () => import("./tasks-D-kXLgVP.mjs")
4209
4210
  },
4210
4211
  "921b049ebafe3c6fb5206fbe3e2100608d3333b944e18385e57da62a28233bc6": {
4211
4212
  functionName: "getDispatcherState_createServerFn_handler",
4212
- importer: () => import("./tasks-LIi-W4cy.mjs")
4213
+ importer: () => import("./tasks-D-kXLgVP.mjs")
4214
+ },
4215
+ "965ff21ee2f1e1f5a1cb78d50570cbad6f58ccdbdcc7955f02f816a9c0684f8e": {
4216
+ functionName: "lookLoopNow_createServerFn_handler",
4217
+ importer: () => import("./loops-6WhUe_lc.mjs")
4213
4218
  },
4214
4219
  "997d2dd097598c44811fe97def167b79d33e4349c51e783058da648e860c7c1f": {
4215
4220
  functionName: "getLoopReadiness_createServerFn_handler",
4216
- importer: () => import("./loops-Og_G3KyZ.mjs")
4221
+ importer: () => import("./loops-6WhUe_lc.mjs")
4217
4222
  },
4218
4223
  "a57f49c322cc5afa2996e4a5777fa533fd963755d614d4a14eb32e51fb198d9d": {
4219
4224
  functionName: "stopTask_createServerFn_handler",
4220
- importer: () => import("./tasks-LIi-W4cy.mjs")
4225
+ importer: () => import("./tasks-D-kXLgVP.mjs")
4221
4226
  },
4222
4227
  "b0878f841b35f46b5f2dc9cbd71c5be5895ae1b8903b3b24c24dfcf86291d3e4": {
4223
4228
  functionName: "runAgentTest_createServerFn_handler",
4224
- importer: () => import("./agents-Dms_6TBF.mjs")
4229
+ importer: () => import("./agents-Bz10gz_m.mjs")
4225
4230
  },
4226
4231
  "b4f7a66e1bb69cc14ab84d8f5dc7f85119c9a9b1d065a6b4e51dd0ba84c3f60c": {
4227
4232
  functionName: "rotateRunnerJoinToken_createServerFn_handler",
4228
- importer: () => import("./runners-B_WuF8UJ.mjs")
4233
+ importer: () => import("./runners-W-pgo5yo.mjs")
4229
4234
  },
4230
4235
  "b5a89ca2d07f4ccf2827b5132ca52e7c7a42d584e702b0ab3963b2d5763c35b0": {
4231
4236
  functionName: "removeLoop_createServerFn_handler",
4232
- importer: () => import("./loops-Og_G3KyZ.mjs")
4237
+ importer: () => import("./loops-6WhUe_lc.mjs")
4233
4238
  },
4234
4239
  "bde588e9b0b81a4ee619a63872d6b8b76e22db006c7a3c4351bcd56e5f76bbed": {
4235
4240
  functionName: "getAgentsPage_createServerFn_handler",
4236
- importer: () => import("./agents-Dms_6TBF.mjs")
4241
+ importer: () => import("./agents-Bz10gz_m.mjs")
4237
4242
  },
4238
4243
  "bef559b165754b06d6d5cf7c6dccde3d5a6a326462430c621eb131f78665d6e1": {
4239
4244
  functionName: "runPrompt_createServerFn_handler",
4240
- importer: () => import("./tasks-LIi-W4cy.mjs")
4245
+ importer: () => import("./tasks-D-kXLgVP.mjs")
4241
4246
  },
4242
4247
  "e91fc2fd51633c7ca9184fea4beb66fe775ed0b4e6323111a4690da916a78b00": {
4243
4248
  functionName: "saveLoop_createServerFn_handler",
4244
- importer: () => import("./loops-Og_G3KyZ.mjs")
4249
+ importer: () => import("./loops-6WhUe_lc.mjs")
4245
4250
  },
4246
4251
  "f94f0787ce6704ea24f18add66832e0367a0feb9a690d8ad6454abec5e5df193": {
4247
4252
  functionName: "disconnectConnection_createServerFn_handler",
4248
- importer: () => import("./connectors-BZly0yGF.mjs")
4253
+ importer: () => import("./connectors-DJI-rzPU.mjs")
4249
4254
  },
4250
4255
  "f9ade3084971078ee9f2bc16fcdcdfb5a8d66a0f9b634803bb611287c14e21d7": {
4251
4256
  functionName: "verifyConnection_createServerFn_handler",
4252
- importer: () => import("./connectors-BZly0yGF.mjs")
4257
+ importer: () => import("./connectors-DJI-rzPU.mjs")
4258
+ },
4259
+ "fbf19a0d12b4046a23a8a41e106a79443b174cf1cad922b029e23fb4679b20db": {
4260
+ functionName: "connectWithToken_createServerFn_handler",
4261
+ importer: () => import("./connectors-DJI-rzPU.mjs")
4253
4262
  }
4254
4263
  };
4255
4264
  async function getServerFnById(id, access) {
@@ -6160,8 +6169,8 @@ var getBaseManifest = getProdBaseManifest;
6160
6169
  var createEarlyHintsForRequest = createEarlyHintsCollector;
6161
6170
  async function loadEntries() {
6162
6171
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
6163
- import("./router-BbrBz36P.mjs").then((n) => n.t),
6164
- import("./start-BgTj-h_C.mjs"),
6172
+ import("./router-DdwREiOf.mjs").then((n) => n.t),
6173
+ import("./start-C_j-e4vF.mjs"),
6165
6174
  import("./empty-plugin-adapters-BJ4m9L8g.mjs")
6166
6175
  ]);
6167
6176
  return {
@@ -6606,4 +6615,4 @@ function createServerEntry(entry) {
6606
6615
  }
6607
6616
  var server_default = createServerEntry({ fetch: fetch$1 });
6608
6617
  //#endregion
6609
- export { ssr_exports as a, createServerEntry, server_default as default, getServerFnById as i, createServerFn as n, TSS_SERVER_FUNCTION as r, createMiddleware as t };
6618
+ export { getServerFnById as a, createServerEntry, server_default as default, TSS_SERVER_FUNCTION as i, createMiddleware as n, ssr_exports as o, createServerFn as r, createCsrfMiddleware as t };
@@ -1,8 +1,7 @@
1
- import { t as createMiddleware } from "./ssr.mjs";
2
- import { l as migrateIfNeeded } from "./client-BtVRVhQ2.mjs";
3
- import { r as isLoopbackHost } from "./callback-D20cVD2w.mjs";
4
- import { a as readAppToken, i as isPublicApiPath, n as assertAppAccess, t as appAccessCookie } from "./access-B7TcOZ7F.mjs";
5
- //#region node_modules/.nitro/vite/services/ssr/assets/start-BgTj-h_C.js
1
+ import { n as createMiddleware, t as createCsrfMiddleware } from "./ssr.mjs";
2
+ import { l as migrateIfNeeded } from "./client-Dk3SD8Il.mjs";
3
+ import { c as readAppToken, o as isLoopbackHost, r as assertAppAccess, s as isPublicApiPath, t as appAccessCookie } from "./access-DTttr563.mjs";
4
+ //#region node_modules/.nitro/vite/services/ssr/assets/start-C_j-e4vF.js
6
5
  function dedupeSerializationAdapters(deduped, serializationAdapters) {
7
6
  for (let i = 0, len = serializationAdapters.length; i < len; i++) {
8
7
  const current = serializationAdapters[i];
@@ -46,6 +45,11 @@ var appAccess = createMiddleware({ type: "request" }).server(async ({ next, requ
46
45
  if (token && expected && token === expected && !isLoopbackHost(new URL(request.url).hostname)) result.response.headers.append("Set-Cookie", appAccessCookie(token));
47
46
  return result;
48
47
  });
49
- var startInstance = createStart(() => ({ requestMiddleware: [appAccess] }));
48
+ /**
49
+ * Server functions are only ever called by the app's own pages, so a request
50
+ * from another site is refused. Runners use the /api routes, which this skips.
51
+ */
52
+ var sameOrigin = createCsrfMiddleware({ filter: (ctx) => ctx.handlerType === "serverFn" });
53
+ var startInstance = createStart(() => ({ requestMiddleware: [appAccess, sameOrigin] }));
50
54
  //#endregion
51
55
  export { startInstance };
@@ -1,6 +1,6 @@
1
- import { U as require_jsx_runtime, c as SwitchThumb, l as SwitchRoot } from "../_libs/@base-ui/react+[...].mjs";
2
- import { H as cn } from "./router-BbrBz36P.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/switch-1pnd_bPJ.js
1
+ import { K as require_jsx_runtime, d as SwitchThumb, f as SwitchRoot } from "../_libs/@base-ui/react+[...].mjs";
2
+ import { P as cn } from "./router-DdwREiOf.mjs";
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/switch-odxNO_S4.js
4
4
  var import_jsx_runtime = require_jsx_runtime();
5
5
  function Switch$1({ className, size = "default", ...props }) {
6
6
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchRoot, {
@@ -0,0 +1,150 @@
1
+ import { K as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
+ import { f as Link } from "../_libs/@tanstack/react-router+[...].mjs";
3
+ import { s as connectorManifest } from "./connections-Cqvb6Gw2.mjs";
4
+ import { n as agentManifest } from "./agents-B_qo1gpL.mjs";
5
+ import { E as CircleX, M as CircleCheck, O as CircleSlash, T as Clock, b as FileText, g as Loader, j as CircleMinus, z as Bot } from "../_libs/lucide-react.mjs";
6
+ import { P as cn, _ as Badge } from "./router-DdwREiOf.mjs";
7
+ import { t as ConnectorIcon } from "./connector-icon-DrhVbhs6.mjs";
8
+ import { a as List, t as Empty } from "./page-DZVxKvdn.mjs";
9
+ import { t as ago } from "./time-Cy8TZP0Z.mjs";
10
+ import { r as useLiveTasks } from "./use-live-tasks-BzhTkEOL.mjs";
11
+ //#region node_modules/.nitro/vite/services/ssr/assets/task-list-Dnmq_WeE.js
12
+ var import_jsx_runtime = require_jsx_runtime();
13
+ var STATES = {
14
+ queued: {
15
+ label: "Queued",
16
+ icon: Clock,
17
+ tone: "text-muted-foreground"
18
+ },
19
+ preparing: {
20
+ label: "Working",
21
+ icon: Loader,
22
+ tone: "text-muted-foreground"
23
+ },
24
+ awaiting_agent: {
25
+ label: "On a runner",
26
+ icon: Bot,
27
+ tone: "text-muted-foreground"
28
+ },
29
+ applying: {
30
+ label: "Writing",
31
+ icon: Loader,
32
+ tone: "text-muted-foreground"
33
+ },
34
+ prepared: {
35
+ label: "Prepared",
36
+ icon: FileText,
37
+ tone: "text-muted-foreground"
38
+ },
39
+ done: {
40
+ label: "Written",
41
+ icon: CircleCheck,
42
+ tone: "text-emerald-600"
43
+ },
44
+ skipped: {
45
+ label: "Nothing to say",
46
+ icon: CircleMinus,
47
+ tone: "text-muted-foreground"
48
+ },
49
+ failed: {
50
+ label: "Failed",
51
+ icon: CircleX,
52
+ tone: "text-destructive"
53
+ },
54
+ cancelled: {
55
+ label: "Stopped",
56
+ icon: CircleSlash,
57
+ tone: "text-muted-foreground"
58
+ }
59
+ };
60
+ function TaskStateLabel({ state }) {
61
+ const meta = STATES[state];
62
+ const Icon = meta.icon;
63
+ const spinning = state === "preparing" || state === "awaiting_agent" || state === "applying";
64
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
65
+ className: cn("flex items-center gap-1.5 text-xs", meta.tone),
66
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: cn("size-3.5", spinning && "animate-spin") }), meta.label]
67
+ });
68
+ }
69
+ /** A queued task has no title yet: the connector has not fetched it. */
70
+ function taskTitle(task) {
71
+ return task.sourceTitle ?? task.sourceRef;
72
+ }
73
+ /**
74
+ * Kinds whose reference a person can read. A repository and a number say
75
+ * where the work is; a mail or a message id is a handle for fetching it
76
+ * again and means nothing on a page.
77
+ */
78
+ var NAMED_REF = /* @__PURE__ */ new Set(["pull_request", "issue"]);
79
+ /** What to call the thing a task is about, where a sentence needs a noun. */
80
+ var KIND_LABEL = {
81
+ pull_request: "Pull request",
82
+ issue: "Issue",
83
+ message: "Message",
84
+ email: "Email",
85
+ occurrence: "Scheduled run",
86
+ prompt: "Test run"
87
+ };
88
+ function TaskList({ tasks, showLoop = true, empty }) {
89
+ useLiveTasks(tasks);
90
+ if (tasks.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Empty, { children: empty });
91
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(List, { children: tasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
92
+ to: "/inbox/$taskId",
93
+ params: { taskId: task.id },
94
+ className: "flex items-start gap-3 px-4 py-3 transition-colors hover:bg-muted/50",
95
+ children: [task.sourceKind === "prompt" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
96
+ className: "flex size-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",
97
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Bot, { className: "size-4" })
98
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConnectorIcon, {
99
+ icon: connectorManifest(task.connectorId)?.icon ?? "Plug",
100
+ accent: connectorManifest(task.connectorId)?.accent ?? "bg-muted",
101
+ className: "size-7 shrink-0"
102
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
103
+ className: "min-w-0 flex-1",
104
+ children: [
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
106
+ className: "flex items-center gap-2",
107
+ children: [
108
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
109
+ className: "min-w-0 flex-1 truncate text-sm font-medium",
110
+ children: taskTitle(task)
111
+ }),
112
+ task.dryRun ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
113
+ variant: "outline",
114
+ children: "Dry run"
115
+ }) : null,
116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TaskStateLabel, { state: task.state })
117
+ ]
118
+ }),
119
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TaskMeta, {
120
+ task,
121
+ showLoop
122
+ }),
123
+ task.output ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
124
+ className: "mt-1 line-clamp-1 text-xs text-muted-foreground",
125
+ children: task.output
126
+ }) : task.error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
127
+ className: "mt-1 line-clamp-1 text-xs text-destructive",
128
+ children: task.error
129
+ }) : null
130
+ ]
131
+ })]
132
+ }, task.id)) });
133
+ }
134
+ /** One quiet line: which item, which loop, which agent, when. */
135
+ function TaskMeta({ task, showLoop }) {
136
+ const agent = task.agentId ? agentManifest(task.agentId) : void 0;
137
+ const parts = [
138
+ NAMED_REF.has(task.sourceKind) && task.sourceTitle ? task.sourceRef : null,
139
+ showLoop ? task.loopName : null,
140
+ agent?.name,
141
+ ago(task.createdAt)
142
+ ].filter(Boolean);
143
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
144
+ suppressHydrationWarning: true,
145
+ className: "mt-0.5 truncate text-xs text-muted-foreground",
146
+ children: parts.join(" · ")
147
+ });
148
+ }
149
+ //#endregion
150
+ export { taskTitle as i, TaskList as n, TaskStateLabel as r, KIND_LABEL as t };
@@ -1,11 +1,11 @@
1
- import { n as createServerFn } from "./ssr.mjs";
1
+ import { r as createServerFn } from "./ssr.mjs";
2
2
  import { f as eq } from "../_libs/drizzle-orm.mjs";
3
- import { r as appSettings, s as db } from "./client-BtVRVhQ2.mjs";
4
- import { l as onlineRunnerCount } from "./runners-D-0_lfiq.mjs";
5
- import { a as getTask, c as listRunnableAgents, d as requestCancel, i as enqueueTask, l as listTasks, n as enqueuePrompt, u as readTaskLog } from "./tasks-B_QmDFVs.mjs";
6
- import { t as createServerRpc } from "./createServerRpc-DPDrnFdH.mjs";
3
+ import { r as appSettings, s as db } from "./client-Dk3SD8Il.mjs";
4
+ import { u as onlineRunnerCount } from "./runners-CK9Cx9fS.mjs";
5
+ import { a as enqueueTask, d as listRunnableAgents, f as listTasks, h as requestCancel, m as readTaskLog, r as enqueuePrompt, s as getTask } from "./tasks-D7aUvA33.mjs";
6
+ import { t as createServerRpc } from "./createServerRpc-DDrp2nLT.mjs";
7
7
  import { randomUUID } from "node:crypto";
8
- //#region node_modules/.nitro/vite/services/ssr/assets/tasks-LIi-W4cy.js
8
+ //#region node_modules/.nitro/vite/services/ssr/assets/tasks-D-kXLgVP.js
9
9
  async function readSetting(key, fallback) {
10
10
  const row = await db().select().from(appSettings).where(eq(appSettings.key, key)).get();
11
11
  return row === void 0 ? fallback : row.value;
@@ -68,37 +68,37 @@ var getLoopTasks_createServerFn_handler = createServerRpc({
68
68
  name: "getLoopTasks",
69
69
  filename: "src/server/functions/tasks.ts"
70
70
  }, (opts) => getLoopTasks.__executeServer(opts));
71
- var getLoopTasks = createServerFn({ method: "GET" }).inputValidator((data) => data).handler(getLoopTasks_createServerFn_handler, async ({ data }) => await listTasks({ loopId: data.loopId }));
71
+ var getLoopTasks = createServerFn({ method: "GET" }).validator((data) => data).handler(getLoopTasks_createServerFn_handler, async ({ data }) => await listTasks({ loopId: data.loopId }));
72
72
  var getTaskById_createServerFn_handler = createServerRpc({
73
73
  id: "0033ef7c619c027b1428a722dff188d315ed335645afcb1033528630b7c95e88",
74
74
  name: "getTaskById",
75
75
  filename: "src/server/functions/tasks.ts"
76
76
  }, (opts) => getTaskById.__executeServer(opts));
77
- var getTaskById = createServerFn({ method: "GET" }).inputValidator((data) => data).handler(getTaskById_createServerFn_handler, async ({ data }) => await getTask(data.id));
77
+ var getTaskById = createServerFn({ method: "GET" }).validator((data) => data).handler(getTaskById_createServerFn_handler, async ({ data }) => await getTask(data.id));
78
78
  var getTaskLog_createServerFn_handler = createServerRpc({
79
79
  id: "81f567724371f0d6f24e636906e2e9ea5b7384422ac583c86a1050fb838664ce",
80
80
  name: "getTaskLog",
81
81
  filename: "src/server/functions/tasks.ts"
82
82
  }, (opts) => getTaskLog.__executeServer(opts));
83
- var getTaskLog = createServerFn({ method: "GET" }).inputValidator((data) => data).handler(getTaskLog_createServerFn_handler, async ({ data }) => await readTaskLog(data.id));
83
+ var getTaskLog = createServerFn({ method: "GET" }).validator((data) => data).handler(getTaskLog_createServerFn_handler, async ({ data }) => await readTaskLog(data.id));
84
84
  var runPrompt_createServerFn_handler = createServerRpc({
85
85
  id: "bef559b165754b06d6d5cf7c6dccde3d5a6a326462430c621eb131f78665d6e1",
86
86
  name: "runPrompt",
87
87
  filename: "src/server/functions/tasks.ts"
88
88
  }, (opts) => runPrompt.__executeServer(opts));
89
- var runPrompt = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(runPrompt_createServerFn_handler, async ({ data }) => await enqueuePrompt(data));
89
+ var runPrompt = createServerFn({ method: "POST" }).validator((data) => data).handler(runPrompt_createServerFn_handler, async ({ data }) => await enqueuePrompt(data));
90
90
  var runLoopNow_createServerFn_handler = createServerRpc({
91
91
  id: "7258ce5fc6f23acf3aab039ecd4acdb006d42b2ddbf3ab8629b4000e101b51dc",
92
92
  name: "runLoopNow",
93
93
  filename: "src/server/functions/tasks.ts"
94
94
  }, (opts) => runLoopNow.__executeServer(opts));
95
- var runLoopNow = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(runLoopNow_createServerFn_handler, async ({ data }) => await enqueueTask(data));
95
+ var runLoopNow = createServerFn({ method: "POST" }).validator((data) => data).handler(runLoopNow_createServerFn_handler, async ({ data }) => await enqueueTask(data));
96
96
  var stopTask_createServerFn_handler = createServerRpc({
97
97
  id: "a57f49c322cc5afa2996e4a5777fa533fd963755d614d4a14eb32e51fb198d9d",
98
98
  name: "stopTask",
99
99
  filename: "src/server/functions/tasks.ts"
100
100
  }, (opts) => stopTask.__executeServer(opts));
101
- var stopTask = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(stopTask_createServerFn_handler, async ({ data }) => await requestCancel(data.id));
101
+ var stopTask = createServerFn({ method: "POST" }).validator((data) => data).handler(stopTask_createServerFn_handler, async ({ data }) => await requestCancel(data.id));
102
102
  var getDispatcherState_createServerFn_handler = createServerRpc({
103
103
  id: "921b049ebafe3c6fb5206fbe3e2100608d3333b944e18385e57da62a28233bc6",
104
104
  name: "getDispatcherState",
@@ -114,6 +114,6 @@ var pauseDispatcher_createServerFn_handler = createServerRpc({
114
114
  name: "pauseDispatcher",
115
115
  filename: "src/server/functions/tasks.ts"
116
116
  }, (opts) => pauseDispatcher.__executeServer(opts));
117
- var pauseDispatcher = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(pauseDispatcher_createServerFn_handler, async ({ data }) => await setDispatcherPaused(data.paused));
117
+ var pauseDispatcher = createServerFn({ method: "POST" }).validator((data) => data).handler(pauseDispatcher_createServerFn_handler, async ({ data }) => await setDispatcherPaused(data.paused));
118
118
  //#endregion
119
119
  export { getDispatcherState_createServerFn_handler, getInbox_createServerFn_handler, getLoopTasks_createServerFn_handler, getTaskById_createServerFn_handler, getTaskLog_createServerFn_handler, pauseDispatcher_createServerFn_handler, runLoopNow_createServerFn_handler, runPrompt_createServerFn_handler, stopTask_createServerFn_handler };
@@ -1,12 +1,12 @@
1
1
  import { f as eq, u as desc } from "../_libs/drizzle-orm.mjs";
2
- import { c as loops, d as runDir, g as tasks, s as db } from "./client-BtVRVhQ2.mjs";
3
- import { a as connectorManifest, c as credentialForConnector, i as connectorAction, o as connectorRuntime, s as connectorWorkflow } from "./connections-ypex3qUd.mjs";
4
- import { n as agentManifest, o as settingsFor, r as listAgents } from "./agents-CrUmIQpi.mjs";
5
- import { t as availableAgentIds } from "./runners-D-0_lfiq.mjs";
2
+ import { c as loops, d as runDir, g as tasks, s as db } from "./client-Dk3SD8Il.mjs";
3
+ import { c as connectorRuntime, l as connectorWorkflow, o as connectorAction, s as connectorManifest, u as credentialForConnector } from "./connections-Cqvb6Gw2.mjs";
4
+ import { n as availableAgentIds } from "./runners-CK9Cx9fS.mjs";
5
+ import { i as listAgents, n as agentManifest, s as settingsFor } from "./agents-B_qo1gpL.mjs";
6
6
  import { randomUUID } from "node:crypto";
7
- import { existsSync, readFileSync, statSync, writeFileSync } from "node:fs";
7
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
8
8
  import { isAbsolute, join } from "node:path";
9
- //#region node_modules/.nitro/vite/services/ssr/assets/tasks-B_QmDFVs.js
9
+ //#region node_modules/.nitro/vite/services/ssr/assets/tasks-D7aUvA33.js
10
10
  /** The agent says this when the honest answer is silence. */
11
11
  var AGENT_NOTHING = "NOTHING_TO_DO";
12
12
  function isAgentNothing(text) {
@@ -14,11 +14,38 @@ function isAgentNothing(text) {
14
14
  return compact(text) === compact(AGENT_NOTHING);
15
15
  }
16
16
  /**
17
- * Folder jobs name a path that only exists on Loopable's host.
18
- * A runner on another hostname cannot see that folder.
17
+ * Stands in a prompt for the runner's own workspace, which the dispatcher
18
+ * cannot know. The runner replaces it before the agent sees the prompt.
19
+ */
20
+ var WORKSPACE = "{{loopable:workspace}}";
21
+ /**
22
+ * A loop's folder is relative to the home folder, because each runner keeps
23
+ * its checkouts under its own home. "~/code/web" and "code/web" are the same.
24
+ * An absolute path is from before that, and only means something on the host
25
+ * it was written on.
26
+ */
27
+ function normalizeFolder(folder) {
28
+ const trimmed = folder.trim();
29
+ if (trimmed === "~") return "";
30
+ return trimmed.startsWith("~/") ? trimmed.slice(2) : trimmed;
31
+ }
32
+ function folderIsLegacy(folder) {
33
+ return isAbsolute(folder.trim());
34
+ }
35
+ /**
36
+ * Only an old absolute folder ties a job to Loopable's host. A relative one
37
+ * goes to any runner, which looks for it under its own home.
19
38
  */
20
39
  function jobRequiresHost(job) {
21
- return Boolean(job.cwd);
40
+ return Boolean(job.cwd && folderIsLegacy(job.cwd));
41
+ }
42
+ /**
43
+ * The oldest runner protocol that can do this job. A relative folder and the
44
+ * workspace placeholder are both protocol 2; an older runner would run the
45
+ * agent in the wrong place and hand it a path that does not exist.
46
+ */
47
+ function jobMinProtocol(job) {
48
+ return job.cwd && !folderIsLegacy(job.cwd) ? 2 : 0;
22
49
  }
23
50
  /**
24
51
  * Appended to the workflow's prompt, because the shape of the answer is the
@@ -399,12 +426,13 @@ var TaskCancelled = class extends Error {
399
426
  * left to the agent, which would otherwise run somewhere unexpected and answer
400
427
  * confidently about the wrong code.
401
428
  */
429
+ /**
430
+ * The loop's folder as it is stored: relative to a runner's home. Whether it
431
+ * exists is the runner's to find out, since only it can look.
432
+ */
402
433
  function folderFor(loop) {
403
- const folder = typeof loop.settings.folder === "string" ? loop.settings.folder.trim() : "";
434
+ const folder = typeof loop.settings.folder === "string" ? normalizeFolder(loop.settings.folder) : "";
404
435
  if (!folder) throw new Error("This loop has no folder set. Set one and try again.");
405
- if (!isAbsolute(folder)) throw new Error(`The folder must be an absolute path: ${folder}`);
406
- if (!existsSync(folder)) throw new Error(`There is no folder at ${folder}.`);
407
- if (!statSync(folder).isDirectory()) throw new Error(`${folder} is not a folder.`);
408
436
  return folder;
409
437
  }
410
438
  var KIND_NOUN = {
@@ -522,7 +550,6 @@ async function jobForTask(id) {
522
550
  }
523
551
  const { task, loop, workflow, item } = await loadWork(id);
524
552
  if (!task.agentId) throw new Error("This task has no agent yet.");
525
- const workspace = runDir(id);
526
553
  const cwd = workflow.runsIn === "folder" ? folderFor(loop) : void 0;
527
554
  const branch = workflow.answer === "code" ? branchFor({
528
555
  ref: item.ref,
@@ -538,7 +565,7 @@ async function jobForTask(id) {
538
565
  ask: loop.prompt,
539
566
  guidance: loop.guidance,
540
567
  item,
541
- files: item.context.map((file) => cwd ? join(workspace, file.name) : file.name),
568
+ files: item.context.map((file) => cwd ? `${WORKSPACE}/${file.name}` : file.name),
542
569
  branch
543
570
  }),
544
571
  settings,
@@ -568,7 +595,7 @@ async function absorbAgentOutput(id, raw) {
568
595
  output: said,
569
596
  comments: []
570
597
  });
571
- await finish(id, existing, { state: "prepared" });
598
+ await finish(id, existing, { state: "done" });
572
599
  return await getTask(id);
573
600
  }
574
601
  const { task, workflow, action, item } = await loadWork(id);
@@ -608,5 +635,16 @@ async function finish(id, task, values) {
608
635
  leaseUntil: null
609
636
  });
610
637
  }
638
+ async function defaultAgentFor(pinned) {
639
+ if (pinned) {
640
+ if (!agentManifest(pinned)) throw new Error(`Unknown agent: ${pinned}`);
641
+ return pinned;
642
+ }
643
+ const available = await availableAgentIds();
644
+ const chosen = (await listAgents()).find((agent) => agent.isDefault)?.agentId ?? null;
645
+ if (chosen && available.includes(chosen)) return chosen;
646
+ if (available.length === 1) return available[0];
647
+ throw new Error("No agent is available. Start a runner with an agent signed in.");
648
+ }
611
649
  //#endregion
612
- export { getTask as a, listRunnableAgents as c, requestCancel as d, taskRow as f, enqueueTask as i, listTasks as l, enqueuePrompt as n, jobForTask as o, updateTask as p, enqueueSignal as r, jobRequiresHost as s, absorbAgentOutput as t, readTaskLog as u };
650
+ export { updateTask as _, enqueueTask as a, jobForTask as c, listRunnableAgents as d, listTasks as f, taskRow as g, requestCancel as h, enqueueSignal as i, jobMinProtocol as l, readTaskLog as m, defaultAgentFor as n, folderIsLegacy as o, normalizeFolder as p, enqueuePrompt as r, getTask as s, absorbAgentOutput as t, jobRequiresHost as u };
@@ -1,6 +1,6 @@
1
1
  import "../_runtime.mjs";
2
- import { U as require_jsx_runtime, W as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
- import { H as cn } from "./router-BbrBz36P.mjs";
2
+ import { K as require_jsx_runtime, q as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
+ import { P as cn } from "./router-DdwREiOf.mjs";
4
4
  require_react();
5
5
  var import_jsx_runtime = require_jsx_runtime();
6
6
  function Textarea({ className, ...props }) {
@@ -0,0 +1,13 @@
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/time-Cy8TZP0Z.js
2
+ /** "just now", "5m ago", "3h ago", or a date. */
3
+ function ago(iso) {
4
+ const seconds = Math.round((Date.now() - new Date(iso).getTime()) / 1e3);
5
+ if (seconds < 60) return "just now";
6
+ const minutes = Math.round(seconds / 60);
7
+ if (minutes < 60) return `${minutes}m ago`;
8
+ const hours = Math.round(minutes / 60);
9
+ if (hours < 24) return `${hours}h ago`;
10
+ return new Date(iso).toLocaleDateString();
11
+ }
12
+ //#endregion
13
+ export { ago as t };