loopable-cli 0.1.0 → 0.2.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 (98) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/_connectorId-m67WbiJ8.js +1 -0
  3. package/.output/public/assets/_loopId-Bf4K5sdd.js +1 -0
  4. package/.output/public/assets/_taskId-eCKkcVOx.js +1 -0
  5. package/.output/public/assets/alert-BT2EVMJP.js +1 -0
  6. package/.output/public/assets/arrow-left-CWUZt6k2.js +1 -0
  7. package/.output/public/assets/arrow-right-dy_oOg_c.js +1 -0
  8. package/.output/public/assets/connection-status-DCqqmY_6.js +1 -0
  9. package/.output/public/assets/connector-icon-qGpNsPgH.js +1 -0
  10. package/.output/public/assets/connectors-DxXlc9zF.js +1 -0
  11. package/.output/public/assets/{external-link-D46X-bXa.js → external-link-DC11orFA.js} +1 -1
  12. package/.output/public/assets/gaps-CoTA-PzA.js +1 -0
  13. package/.output/public/assets/inbox-CLEXUXCI.js +1 -0
  14. package/.output/public/assets/index-Cndsw84p.js +16 -0
  15. package/.output/public/assets/{loader-CcBl2u8m.js → loader-B4Epchm_.js} +1 -1
  16. package/.output/public/assets/loop-form-BvizlZdR.js +1 -0
  17. package/.output/public/assets/loops-Dbe_mf5T.js +1 -0
  18. package/.output/public/assets/new-DPEaXKAY.js +1 -0
  19. package/.output/public/assets/play-DD4xQgvi.js +1 -0
  20. package/.output/public/assets/preload-helper-CfdAYKD7.js +3 -0
  21. package/.output/public/assets/rolldown-runtime-CbXtAM7H.js +1 -0
  22. package/.output/public/assets/runners-BVBggS5B.js +1 -0
  23. package/.output/public/assets/select-Cppu-hti.js +1 -0
  24. package/.output/public/assets/setting-fields-BT1naVJX.js +3 -0
  25. package/.output/public/assets/{styles-DZL5V1o7.css → styles-D3sonCfX.css} +1 -1
  26. package/.output/public/assets/switch-hRIbNGOj.js +1 -0
  27. package/.output/public/assets/task-list-CrptnI1N.js +1 -0
  28. package/.output/public/assets/textarea-Fyuzi6Vp.js +1 -0
  29. package/.output/public/assets/{trash-2-D6u6NpzO.js → trash-2-BXZzBsoV.js} +1 -1
  30. package/.output/public/assets/useValueChanged-VVyq4hb9.js +1 -0
  31. package/.output/server/{_connectorId-8nb5yOzG.mjs → _connectorId-DcSnoRjk.mjs} +8 -8
  32. package/.output/server/_libs/@base-ui/react+[...].mjs +427 -427
  33. package/.output/server/{_loopId-BsUL1SeL.mjs → _loopId-G_TAkYtS.mjs} +8 -8
  34. package/.output/server/_ssr/{access-zIl15o8y.mjs → access-B7TcOZ7F.mjs} +2 -2
  35. package/.output/server/_ssr/{agents-Btql102J.mjs → agents-CrUmIQpi.mjs} +3 -3
  36. package/.output/server/_ssr/{agents-DAOZPgO2.mjs → agents-Dms_6TBF.mjs} +3 -3
  37. package/.output/server/_ssr/{alert-NEiOCTOl.mjs → alert-DQvzE7bu.mjs} +1 -1
  38. package/.output/server/_ssr/{callback-CUINvl7M.mjs → callback-D20cVD2w.mjs} +21 -4
  39. package/.output/server/_ssr/{client-CKkOfh-s.mjs → client-BtVRVhQ2.mjs} +4 -2
  40. package/.output/server/_ssr/{connection-status-Bi5peUAk.mjs → connection-status-BZr3Y-IC.mjs} +2 -2
  41. package/.output/server/_ssr/{connections-qnw2GVlP.mjs → connections-ypex3qUd.mjs} +3 -3
  42. package/.output/server/_ssr/{connector-icon-DZXQLLFo.mjs → connector-icon-CFrrHjzR.mjs} +2 -2
  43. package/.output/server/_ssr/{connectors-BHNwuIMj.mjs → connectors-4yzKb0KG.mjs} +5 -5
  44. package/.output/server/_ssr/{connectors-C28g0i4c.mjs → connectors-BZly0yGF.mjs} +2 -2
  45. package/.output/server/_ssr/{gaps-RAFSXLZf.mjs → gaps-D2Zh8sEo.mjs} +3 -3
  46. package/.output/server/_ssr/inbox-C2VBGLa5.mjs +114 -0
  47. package/.output/server/_ssr/{loop-form-DlObSewZ.mjs → loop-form-D-U-kU4k.mjs} +8 -7
  48. package/.output/server/_ssr/{loops-xt2Bn7_q.mjs → loops-D0XJ8eBb.mjs} +8 -8
  49. package/.output/server/_ssr/{loops-APFcP0y6.mjs → loops-Og_G3KyZ.mjs} +6 -6
  50. package/.output/server/_ssr/{new-DfKyd2Wa.mjs → new-CajvgIog.mjs} +5 -5
  51. package/.output/server/_ssr/{router-3WmpE5b_.mjs → router-BbrBz36P.mjs} +63 -62
  52. package/.output/server/_ssr/{runners-By-mwc3F.mjs → runners-B_WuF8UJ.mjs} +3 -3
  53. package/.output/server/_ssr/{runners-DtXs4Q8a.mjs → runners-D-0_lfiq.mjs} +3 -3
  54. package/.output/server/_ssr/{runners-DI_NxpHC.mjs → runners-zqF_zbEc.mjs} +4 -4
  55. package/.output/server/_ssr/{secrets-Hqti-niS.mjs → secrets-CRnpwGBh.mjs} +2 -2
  56. package/.output/server/_ssr/{setting-fields-8vKFj4df.mjs → setting-fields-mpXfGftI.mjs} +6 -13
  57. package/.output/server/_ssr/ssr.mjs +37 -33
  58. package/.output/server/_ssr/{start-Bdc2GJUI.mjs → start-BgTj-h_C.mjs} +4 -4
  59. package/.output/server/_ssr/{switch-ReNglgH6.mjs → switch-1pnd_bPJ.mjs} +2 -2
  60. package/.output/server/_ssr/{task-list-CUITIqkb.mjs → task-list-BnQJ94Dk.mjs} +9 -8
  61. package/.output/server/_ssr/{tasks-vcoodp_D.mjs → tasks-B_QmDFVs.mjs} +87 -8
  62. package/.output/server/_ssr/{tasks-SAjNovX6.mjs → tasks-LIi-W4cy.mjs} +15 -6
  63. package/.output/server/_ssr/textarea-CHJTKtsJ.mjs +14 -0
  64. package/.output/server/{_tanstack-start-manifest_v-C0cP5F0M.mjs → _tanstack-start-manifest_v-BCHAazE8.mjs} +52 -48
  65. package/.output/server/{_taskId-CXS3lod0.mjs → _taskId-CIv0ajIx.mjs} +17 -10
  66. package/.output/server/index.mjs +160 -160
  67. package/README.md +3 -3
  68. package/dist/cli.mjs +7181 -16
  69. package/dist/dispatcher.mjs +33 -2
  70. package/drizzle/0024_prompt_tasks.sql +44 -0
  71. package/drizzle/meta/_journal.json +7 -0
  72. package/package.json +1 -1
  73. package/.output/public/assets/_connectorId-BWjYn5tm.js +0 -1
  74. package/.output/public/assets/_loopId-Ds4RkyEc.js +0 -1
  75. package/.output/public/assets/_taskId-BOzICXDf.js +0 -1
  76. package/.output/public/assets/alert-Bn9-Zm0l.js +0 -1
  77. package/.output/public/assets/arrow-left-BF9juV9T.js +0 -1
  78. package/.output/public/assets/arrow-right-CzqvnOY1.js +0 -1
  79. package/.output/public/assets/button-HCY6DCY-.js +0 -1
  80. package/.output/public/assets/connection-status-CYZB8kLy.js +0 -1
  81. package/.output/public/assets/connector-icon-BZ_MUJV_.js +0 -1
  82. package/.output/public/assets/connectors-BvzttfSu.js +0 -1
  83. package/.output/public/assets/connectors-DdJNwRN_.js +0 -1
  84. package/.output/public/assets/gaps-D-I6xiDc.js +0 -1
  85. package/.output/public/assets/inbox-BUUu9xxE.js +0 -1
  86. package/.output/public/assets/index-ztzex0FN.js +0 -10
  87. package/.output/public/assets/loop-form-dB3CLcZb.js +0 -1
  88. package/.output/public/assets/loops-DRunQrxL.js +0 -1
  89. package/.output/public/assets/loops-oSdqMd29.js +0 -1
  90. package/.output/public/assets/manifests-DNMqf7Vi.js +0 -7
  91. package/.output/public/assets/new-uyFxVjuB.js +0 -1
  92. package/.output/public/assets/preload-helper-ORbuV86A.js +0 -3
  93. package/.output/public/assets/runners-DSU3r5Ww.js +0 -1
  94. package/.output/public/assets/setting-fields-ixkpdBb-.js +0 -3
  95. package/.output/public/assets/switch-d5ummmHY.js +0 -1
  96. package/.output/public/assets/task-list-BpOStt9v.js +0 -1
  97. package/.output/public/assets/tasks-B8MsKgic.js +0 -1
  98. package/.output/server/_ssr/inbox-k5zHergU.mjs +0 -35
@@ -2,16 +2,16 @@ import { i as __toESM } from "./_runtime.mjs";
2
2
  import { U as require_jsx_runtime, W as require_react, i as TabsRoot, n as TabsPanel, r as TabsTab, t as TabsList$1 } from "./_libs/@base-ui/react+[...].mjs";
3
3
  import { f as Link, m as useRouter } from "./_libs/@tanstack/react-router+[...].mjs";
4
4
  import { t as cva } from "./_libs/class-variance-authority+clsx.mjs";
5
- import { a as connectorManifest } from "./_ssr/connections-qnw2GVlP.mjs";
5
+ import { a as connectorManifest } from "./_ssr/connections-ypex3qUd.mjs";
6
6
  import { B as ArrowLeft, M as CircleAlert, S as Eye, f as Play } from "./_libs/lucide-react.mjs";
7
7
  import { n as toast } from "./_libs/sonner.mjs";
8
- import { C as Button$1, E as runLoopBacklog, L as Card, R as CardContent, S as Input$1, V as cn, b as Label, f as useLiveRefresh, k as runLoopNow, o as Route$10 } from "./_ssr/router-3WmpE5b_.mjs";
9
- import { t as Switch$1 } from "./_ssr/switch-ReNglgH6.mjs";
10
- import { n as AlertDescription, r as AlertTitle, t as Alert } from "./_ssr/alert-NEiOCTOl.mjs";
11
- import { n as TaskList } from "./_ssr/task-list-CUITIqkb.mjs";
12
- import { t as LoopForm } from "./_ssr/loop-form-DlObSewZ.mjs";
13
- import { n as issuesFor } from "./_ssr/gaps-RAFSXLZf.mjs";
14
- //#region node_modules/.nitro/vite/services/ssr/assets/_loopId-BsUL1SeL.js
8
+ import { H as cn, L as Button$1, O as runLoopNow, R as Card, S as Input$1, T as runLoopBacklog, b as Label, f as useLiveRefresh, o as Route$10, z as CardContent } from "./_ssr/router-BbrBz36P.mjs";
9
+ import { t as Switch$1 } from "./_ssr/switch-1pnd_bPJ.mjs";
10
+ import { n as AlertDescription, r as AlertTitle, t as Alert } from "./_ssr/alert-DQvzE7bu.mjs";
11
+ import { n as TaskList } from "./_ssr/task-list-BnQJ94Dk.mjs";
12
+ import { t as LoopForm } from "./_ssr/loop-form-D-U-kU4k.mjs";
13
+ import { n as issuesFor } from "./_ssr/gaps-D2Zh8sEo.mjs";
14
+ //#region node_modules/.nitro/vite/services/ssr/assets/_loopId-G_TAkYtS.js
15
15
  var import_react = /* @__PURE__ */ __toESM(require_react());
16
16
  var import_jsx_runtime = require_jsx_runtime();
17
17
  function Tabs$1({ className, orientation = "horizontal", ...props }) {
@@ -1,5 +1,5 @@
1
- import { r as isLoopbackHost } from "./callback-CUINvl7M.mjs";
2
- //#region node_modules/.nitro/vite/services/ssr/assets/access-zIl15o8y.js
1
+ import { r as isLoopbackHost } from "./callback-D20cVD2w.mjs";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/access-B7TcOZ7F.js
3
3
  var APP_ACCESS_COOKIE = "loopable_access";
4
4
  function bearer(request) {
5
5
  const header = request.headers.get("authorization") ?? "";
@@ -1,12 +1,12 @@
1
1
  import { f as eq } from "../_libs/drizzle-orm.mjs";
2
- import { n as agentSettings, r as appSettings, s as db } from "./client-CKkOfh-s.mjs";
3
- import { n as isHosted } from "./secrets-Hqti-niS.mjs";
2
+ import { n as agentSettings, r as appSettings, s as db } from "./client-BtVRVhQ2.mjs";
3
+ import { n as isHosted } from "./secrets-CRnpwGBh.mjs";
4
4
  import { accessSync, constants, createWriteStream, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
5
5
  import { join } from "node:path";
6
6
  import { homedir, tmpdir } from "node:os";
7
7
  import { execFile, spawn } from "node:child_process";
8
8
  import { promisify } from "node:util";
9
- //#region node_modules/.nitro/vite/services/ssr/assets/agents-Btql102J.js
9
+ //#region node_modules/.nitro/vite/services/ssr/assets/agents-CrUmIQpi.js
10
10
  function defineAgentManifest(manifest) {
11
11
  return manifest;
12
12
  }
@@ -1,8 +1,8 @@
1
1
  import { n as createServerFn } from "./ssr.mjs";
2
- import { a as setDefaultAgent, i as saveAgentSettings, r as listAgents, s as testAgent } from "./agents-Btql102J.mjs";
3
- import { c as listRunners, t as availableAgentIds } from "./runners-DtXs4Q8a.mjs";
2
+ import { a as setDefaultAgent, i as saveAgentSettings, r as listAgents, s as testAgent } from "./agents-CrUmIQpi.mjs";
3
+ import { c as listRunners, t as availableAgentIds } from "./runners-D-0_lfiq.mjs";
4
4
  import { t as createServerRpc } from "./createServerRpc-DPDrnFdH.mjs";
5
- //#region node_modules/.nitro/vite/services/ssr/assets/agents-DAOZPgO2.js
5
+ //#region node_modules/.nitro/vite/services/ssr/assets/agents-Dms_6TBF.js
6
6
  async function withRunners(agents) {
7
7
  const runners = await listRunners();
8
8
  const available = await availableAgentIds();
@@ -1,7 +1,7 @@
1
1
  import "../_runtime.mjs";
2
2
  import { U as require_jsx_runtime, W as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
3
  import { t as cva } from "../_libs/class-variance-authority+clsx.mjs";
4
- import { V as cn } from "./router-3WmpE5b_.mjs";
4
+ import { H as cn } from "./router-BbrBz36P.mjs";
5
5
  require_react();
6
6
  var import_jsx_runtime = require_jsx_runtime();
7
7
  var alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
@@ -1,4 +1,5 @@
1
- //#region node_modules/.nitro/vite/services/ssr/assets/callback-CUINvl7M.js
1
+ import { networkInterfaces } from "node:os";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/callback-D20cVD2w.js
2
3
  function configuredOrigin() {
3
4
  return process.env.LOOPABLE_BASE_URL?.replace(/\/$/, "") || null;
4
5
  }
@@ -54,9 +55,25 @@ function registrableCallbackUrl(connectorId) {
54
55
  if (hosted) return `${hosted}/api/connectors/${connectorId}/callback`;
55
56
  return `http://127.0.0.1/api/connectors/${connectorId}/callback`;
56
57
  }
57
- /** Where runners and people should address this Loopable. May be a LAN IP. */
58
- function loopableOrigin() {
59
- return configuredOrigin() ?? "http://127.0.0.1:4321";
58
+ /** First non-internal IPv4, preferring typical LAN ranges. */
59
+ function lanIPv4(nics = networkInterfaces()) {
60
+ const found = [];
61
+ for (const addrs of Object.values(nics)) for (const addr of addrs ?? []) {
62
+ if (addr.internal) continue;
63
+ if (!["IPv4", "4"].includes(String(addr.family))) continue;
64
+ found.push(addr.address);
65
+ }
66
+ return found.find((ip) => ip.startsWith("192.168.")) ?? found.find((ip) => ip.startsWith("10.")) ?? found.find((ip) => {
67
+ const b = Number(ip.split(".")[1]);
68
+ return ip.startsWith("172.") && b >= 16 && b <= 31;
69
+ }) ?? found[0] ?? null;
70
+ }
71
+ /** Where runners should address this Loopable. A LAN IP when one exists. */
72
+ function loopableOrigin(nics = networkInterfaces()) {
73
+ const configured = configuredOrigin();
74
+ if (configured) return configured;
75
+ const port = process.env.PORT ?? process.env.NITRO_PORT ?? "4321";
76
+ return `http://${lanIPv4(nics) ?? "127.0.0.1"}:${port}`;
60
77
  }
61
78
  //#endregion
62
79
  export { registrableCallbackUrl as a, loopableOrigin as i, callbackUrl as n, isLoopbackHost as r, appOrigin as t };
@@ -4,7 +4,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";
4
4
  import { join } from "node:path";
5
5
  import { homedir } from "node:os";
6
6
  import { createClient } from "@libsql/client";
7
- //#region node_modules/.nitro/vite/services/ssr/assets/client-CKkOfh-s.js
7
+ //#region node_modules/.nitro/vite/services/ssr/assets/client-BtVRVhQ2.js
8
8
  var __defProp = Object.defineProperty;
9
9
  var __exportAll = (all, no_symbols) => {
10
10
  let target = {};
@@ -94,7 +94,7 @@ var authAttempts = sqliteTable("auth_attempts", {
94
94
  */
95
95
  var tasks = sqliteTable("tasks", {
96
96
  id: text("id").primaryKey(),
97
- loopId: text("loop_id").notNull().references(() => loops.id, { onDelete: "cascade" }),
97
+ loopId: text("loop_id").references(() => loops.id, { onDelete: "cascade" }),
98
98
  connectorId: text("connector_id").notNull(),
99
99
  state: text("state").$type().notNull().default("queued"),
100
100
  /** What the task is about, resolved once so the record survives the source. */
@@ -109,6 +109,8 @@ var tasks = sqliteTable("tasks", {
109
109
  * when the dispatcher fetches rather than when the task is queued.
110
110
  */
111
111
  sourceTitle: text("source_title"),
112
+ /** Inbox test runs: the ask itself. Loop runs leave this null and read loops.prompt. */
113
+ prompt: text("prompt"),
112
114
  /** Set when a run was asked to stop before writing anything. */
113
115
  dryRun: integer("dry_run", { mode: "boolean" }).notNull().default(false),
114
116
  agentId: text("agent_id"),
@@ -1,6 +1,6 @@
1
1
  import { U as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
- import { I as Badge } from "./router-3WmpE5b_.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/connection-status-Bi5peUAk.js
2
+ import { I as Badge } from "./router-BbrBz36P.mjs";
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/connection-status-BZr3Y-IC.js
4
4
  var import_jsx_runtime = require_jsx_runtime();
5
5
  var LABELS = {
6
6
  connected: {
@@ -1,10 +1,10 @@
1
1
  import { d as and, f as eq, h as lt, l as asc } from "../_libs/drizzle-orm.mjs";
2
- import { a as connections, i as authAttempts, s as db } from "./client-CKkOfh-s.mjs";
3
- import { i as readCredential, s as writeCredential, t as deleteCredential } from "./secrets-Hqti-niS.mjs";
2
+ import { a as connections, i as authAttempts, s as db } from "./client-BtVRVhQ2.mjs";
3
+ import { i as readCredential, s as writeCredential, t as deleteCredential } from "./secrets-CRnpwGBh.mjs";
4
4
  import { createHash, randomBytes, randomUUID } from "node:crypto";
5
5
  import { existsSync, readFileSync } from "node:fs";
6
6
  import { join } from "node:path";
7
- //#region node_modules/.nitro/vite/services/ssr/assets/connections-qnw2GVlP.js
7
+ //#region node_modules/.nitro/vite/services/ssr/assets/connections-ypex3qUd.js
8
8
  function defineManifest(manifest) {
9
9
  return manifest;
10
10
  }
@@ -1,7 +1,7 @@
1
1
  import { U as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
2
  import { d as Plug, w as Clock } from "../_libs/lucide-react.mjs";
3
- import { V as cn } from "./router-3WmpE5b_.mjs";
4
- //#region node_modules/.nitro/vite/services/ssr/assets/connector-icon-DZXQLLFo.js
3
+ import { H as cn } from "./router-BbrBz36P.mjs";
4
+ //#region node_modules/.nitro/vite/services/ssr/assets/connector-icon-CFrrHjzR.js
5
5
  var import_jsx_runtime = require_jsx_runtime();
6
6
  function mark(viewBox, d) {
7
7
  return function Mark({ className }) {
@@ -1,13 +1,13 @@
1
1
  import { i as __toESM } from "../_runtime.mjs";
2
2
  import { U as require_jsx_runtime, W as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
3
  import { f as Link } from "../_libs/@tanstack/react-router+[...].mjs";
4
- import { t as CONNECTOR_MANIFESTS, u as needsAccount } from "./connections-qnw2GVlP.mjs";
4
+ import { t as CONNECTOR_MANIFESTS, u as needsAccount } from "./connections-ypex3qUd.mjs";
5
5
  import { M as CircleAlert, z as ArrowRight } from "../_libs/lucide-react.mjs";
6
6
  import { n as toast } from "../_libs/sonner.mjs";
7
- import { C as Button$1, I as Badge, L as Card, R as CardContent, d as Route$15, z as CardHeader } from "./router-3WmpE5b_.mjs";
8
- import { t as ConnectionStatusBadge } from "./connection-status-Bi5peUAk.mjs";
9
- import { t as ConnectorIcon } from "./connector-icon-DZXQLLFo.mjs";
10
- //#region node_modules/.nitro/vite/services/ssr/assets/connectors-BHNwuIMj.js
7
+ import { B as CardHeader, I as Badge, L as Button$1, R as Card, d as Route$15, z as CardContent } from "./router-BbrBz36P.mjs";
8
+ import { t as ConnectionStatusBadge } from "./connection-status-BZr3Y-IC.mjs";
9
+ import { t as ConnectorIcon } from "./connector-icon-CFrrHjzR.mjs";
10
+ //#region node_modules/.nitro/vite/services/ssr/assets/connectors-4yzKb0KG.js
11
11
  var import_react = /* @__PURE__ */ __toESM(require_react());
12
12
  var import_jsx_runtime = require_jsx_runtime();
13
13
  function ConnectorsPage() {
@@ -1,8 +1,8 @@
1
1
  import { n as createServerFn } from "./ssr.mjs";
2
- import { d as removeConnection, f as saveAuthorizedConnection, h as updateConnectionSettings, l as listConnections, o as connectorRuntime, r as checkConnection, t as CONNECTOR_MANIFESTS } from "./connections-qnw2GVlP.mjs";
2
+ import { d as removeConnection, f as saveAuthorizedConnection, h as updateConnectionSettings, l as listConnections, o as connectorRuntime, r as checkConnection, t as CONNECTOR_MANIFESTS } from "./connections-ypex3qUd.mjs";
3
3
  import { t as createServerRpc } from "./createServerRpc-DPDrnFdH.mjs";
4
4
  import { t as require_lib } from "../_libs/qrcode.mjs";
5
- //#region node_modules/.nitro/vite/services/ssr/assets/connectors-C28g0i4c.js
5
+ //#region node_modules/.nitro/vite/services/ssr/assets/connectors-BZly0yGF.js
6
6
  var import_lib = require_lib();
7
7
  var getConnectorOverview_createServerFn_handler = createServerRpc({
8
8
  id: "0e209afb63fad4a95a5cfeaf4831610f23673145cbf5b8054765d79804a62d31",
@@ -1,6 +1,6 @@
1
- import { a as connectorManifest, s as connectorWorkflow, u as needsAccount } from "./connections-qnw2GVlP.mjs";
2
- import { n as agentManifest } from "./agents-Btql102J.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/gaps-RAFSXLZf.js
1
+ import { a as connectorManifest, s as connectorWorkflow, u as needsAccount } from "./connections-ypex3qUd.mjs";
2
+ import { n as agentManifest } from "./agents-CrUmIQpi.mjs";
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/gaps-D2Zh8sEo.js
4
4
  function agentName(id) {
5
5
  return agentManifest(id)?.name ?? id;
6
6
  }
@@ -0,0 +1,114 @@
1
+ import { i as __toESM } from "../_runtime.mjs";
2
+ import { U as require_jsx_runtime, W as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
+ import { f as Link, m as useRouter } from "../_libs/@tanstack/react-router+[...].mjs";
4
+ import { f as Play } from "../_libs/lucide-react.mjs";
5
+ import { n as toast } from "../_libs/sonner.mjs";
6
+ import { B as CardHeader, L as Button$1, R as Card, _ as SelectItem, b as Label, g as SelectContent, h as Select$1, k as runPrompt, l as Route$13, v as SelectTrigger, y as SelectValue, z as CardContent } from "./router-BbrBz36P.mjs";
7
+ import { t as Textarea } from "./textarea-CHJTKtsJ.mjs";
8
+ import { n as TaskList } from "./task-list-BnQJ94Dk.mjs";
9
+ //#region node_modules/.nitro/vite/services/ssr/assets/inbox-C2VBGLa5.js
10
+ var import_react = /* @__PURE__ */ __toESM(require_react());
11
+ var import_jsx_runtime = require_jsx_runtime();
12
+ function InboxPage() {
13
+ const { tasks, agents } = Route$13.useLoaderData();
14
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
15
+ className: "flex flex-col gap-6",
16
+ children: [
17
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
18
+ className: "text-2xl font-semibold tracking-tight",
19
+ children: "Inbox"
20
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
21
+ className: "mt-1 text-sm text-muted-foreground",
22
+ children: "Every run, in the order it happened, whether it wrote something or decided there was nothing to say."
23
+ })] }),
24
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PromptRunBox, { agents }),
25
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TaskList, {
26
+ tasks,
27
+ empty: "Nothing has run yet. Try a prompt above, or open a loop and try it against a pull request or issue link."
28
+ }),
29
+ tasks.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
30
+ className: "text-center text-sm text-muted-foreground",
31
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
32
+ to: "/loops",
33
+ className: "underline",
34
+ children: "Go to loops"
35
+ })
36
+ }) : null
37
+ ]
38
+ });
39
+ }
40
+ function PromptRunBox({ agents }) {
41
+ const router = useRouter();
42
+ const [prompt, setPrompt] = (0, import_react.useState)("");
43
+ const [agentId, setAgentId] = (0, import_react.useState)(agents[0]?.agentId ?? "");
44
+ const [running, setRunning] = (0, import_react.useState)(false);
45
+ (0, import_react.useEffect)(() => {
46
+ if (!agents.some((agent) => agent.agentId === agentId)) setAgentId(agents[0]?.agentId ?? "");
47
+ }, [agents, agentId]);
48
+ const canRun = Boolean(prompt.trim() && agentId && !running);
49
+ const run = async () => {
50
+ if (!canRun) return;
51
+ setRunning(true);
52
+ try {
53
+ await runPrompt({ data: {
54
+ prompt,
55
+ agentId
56
+ } });
57
+ await router.invalidate();
58
+ setPrompt("");
59
+ toast.success("Queued");
60
+ } catch (error) {
61
+ toast.error(error instanceof Error ? error.message : String(error));
62
+ } finally {
63
+ setRunning(false);
64
+ }
65
+ };
66
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardHeader, {
67
+ className: "text-base font-medium",
68
+ children: "Run a prompt"
69
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardContent, {
70
+ className: "flex flex-col gap-4",
71
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
72
+ className: "flex flex-col gap-2",
73
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, {
74
+ htmlFor: "inbox-prompt",
75
+ children: "Prompt"
76
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Textarea, {
77
+ id: "inbox-prompt",
78
+ value: prompt,
79
+ onChange: (event) => setPrompt(event.target.value),
80
+ placeholder: "Ask the agent something. The reply stays in Inbox; nothing is written back.",
81
+ rows: 4
82
+ })]
83
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
84
+ className: "flex flex-col gap-3 sm:flex-row sm:items-end",
85
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
86
+ className: "flex min-w-0 flex-1 flex-col gap-2",
87
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Label, {
88
+ htmlFor: "inbox-agent",
89
+ children: "Agent"
90
+ }), agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
91
+ className: "text-sm text-muted-foreground",
92
+ children: "Start a runner with an agent signed in, then you can run a prompt."
93
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Select$1, {
94
+ value: agentId,
95
+ onValueChange: (value) => value && setAgentId(value),
96
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectTrigger, {
97
+ id: "inbox-agent",
98
+ className: "w-full sm:max-w-xs",
99
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectValue, { children: (value) => agents.find((agent) => agent.agentId === value)?.name ?? value })
100
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContent, { children: agents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItem, {
101
+ value: agent.agentId,
102
+ children: agent.name
103
+ }, agent.agentId)) })]
104
+ })]
105
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
106
+ onClick: run,
107
+ disabled: !canRun || agents.length === 0,
108
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Play, {}), running ? "Queueing..." : "Run"]
109
+ })]
110
+ })]
111
+ })] });
112
+ }
113
+ //#endregion
114
+ export { InboxPage as component };
@@ -1,15 +1,16 @@
1
1
  import { i as __toESM } from "../_runtime.mjs";
2
2
  import { U as require_jsx_runtime, W as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
3
  import { p as useNavigate } from "../_libs/@tanstack/react-router+[...].mjs";
4
- import { a as connectorManifest, i as connectorAction, s as connectorWorkflow, t as CONNECTOR_MANIFESTS } from "./connections-qnw2GVlP.mjs";
5
- import { t as AGENT_MANIFESTS } from "./agents-Btql102J.mjs";
4
+ import { a as connectorManifest, i as connectorAction, s as connectorWorkflow, t as CONNECTOR_MANIFESTS } from "./connections-ypex3qUd.mjs";
5
+ import { t as AGENT_MANIFESTS } from "./agents-CrUmIQpi.mjs";
6
6
  import { L as Bell, z as ArrowRight } from "../_libs/lucide-react.mjs";
7
7
  import { n as toast } from "../_libs/sonner.mjs";
8
- import { C as Button$1, D as saveLoop, L as Card, R as CardContent, S as Input$1, _ as SelectItem, b as Label, g as SelectContent, h as Select$1, v as SelectTrigger, y as SelectValue } from "./router-3WmpE5b_.mjs";
9
- import { t as Switch$1 } from "./switch-ReNglgH6.mjs";
10
- import { n as Textarea, r as initialFieldValues, t as SettingFieldInputs } from "./setting-fields-8vKFj4df.mjs";
11
- import { n as AlertDescription, r as AlertTitle, t as Alert } from "./alert-NEiOCTOl.mjs";
12
- //#region node_modules/.nitro/vite/services/ssr/assets/loop-form-DlObSewZ.js
8
+ import { E as saveLoop, L as Button$1, R as Card, S as Input$1, _ as SelectItem, b as Label, g as SelectContent, h as Select$1, v as SelectTrigger, y as SelectValue, z as CardContent } from "./router-BbrBz36P.mjs";
9
+ import { t as Switch$1 } from "./switch-1pnd_bPJ.mjs";
10
+ import { t as Textarea } from "./textarea-CHJTKtsJ.mjs";
11
+ import { n as initialFieldValues, t as SettingFieldInputs } from "./setting-fields-mpXfGftI.mjs";
12
+ import { n as AlertDescription, r as AlertTitle, t as Alert } from "./alert-DQvzE7bu.mjs";
13
+ //#region node_modules/.nitro/vite/services/ssr/assets/loop-form-D-U-kU4k.js
13
14
  var import_react = /* @__PURE__ */ __toESM(require_react());
14
15
  var import_jsx_runtime = require_jsx_runtime();
15
16
  var DEFAULT_AGENT = "__default";
@@ -1,16 +1,16 @@
1
1
  import { i as __toESM } from "../_runtime.mjs";
2
2
  import { U as require_jsx_runtime, W as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
3
  import { f as Link, m as useRouter } from "../_libs/@tanstack/react-router+[...].mjs";
4
- import { a as connectorManifest, i as connectorAction, s as connectorWorkflow } from "./connections-qnw2GVlP.mjs";
5
- import { n as agentManifest } from "./agents-Btql102J.mjs";
4
+ import { a as connectorManifest, i as connectorAction, s as connectorWorkflow } from "./connections-ypex3qUd.mjs";
5
+ import { n as agentManifest } from "./agents-CrUmIQpi.mjs";
6
6
  import { M as CircleAlert, R as ArrowUp, V as ArrowDown, i as Trash2, u as Plus } from "../_libs/lucide-react.mjs";
7
7
  import { n as toast } from "../_libs/sonner.mjs";
8
- import { C as Button$1, I as Badge, L as Card, O as toggleLoop, R as CardContent, T as reorderLoop, f as useLiveRefresh, s as Route$11, w as removeLoop, z as CardHeader } from "./router-3WmpE5b_.mjs";
9
- import { t as Switch$1 } from "./switch-ReNglgH6.mjs";
10
- import { t as ConnectorIcon } from "./connector-icon-DZXQLLFo.mjs";
11
- import { n as AlertDescription, r as AlertTitle, t as Alert } from "./alert-NEiOCTOl.mjs";
12
- import { n as issuesFor, t as gapsFor } from "./gaps-RAFSXLZf.mjs";
13
- //#region node_modules/.nitro/vite/services/ssr/assets/loops-xt2Bn7_q.js
8
+ import { B as CardHeader, C as removeLoop, D as toggleLoop, I as Badge, L as Button$1, R as Card, f as useLiveRefresh, s as Route$11, w as reorderLoop, z as CardContent } from "./router-BbrBz36P.mjs";
9
+ import { t as Switch$1 } from "./switch-1pnd_bPJ.mjs";
10
+ import { t as ConnectorIcon } from "./connector-icon-CFrrHjzR.mjs";
11
+ import { n as AlertDescription, r as AlertTitle, t as Alert } from "./alert-DQvzE7bu.mjs";
12
+ import { n as issuesFor, t as gapsFor } from "./gaps-D2Zh8sEo.mjs";
13
+ //#region node_modules/.nitro/vite/services/ssr/assets/loops-D0XJ8eBb.js
14
14
  var import_react = /* @__PURE__ */ __toESM(require_react());
15
15
  var import_jsx_runtime = require_jsx_runtime();
16
16
  function LoopsPage() {
@@ -1,13 +1,13 @@
1
1
  import { n as createServerFn } from "./ssr.mjs";
2
2
  import { d as and, f as eq, l as asc, p as inArray, v as sql } from "../_libs/drizzle-orm.mjs";
3
- import { a as connections, c as loops, h as signals, s as db } from "./client-CKkOfh-s.mjs";
4
- import { a as connectorManifest, i as connectorAction, s as connectorWorkflow } from "./connections-qnw2GVlP.mjs";
5
- import { n as agentManifest, r as listAgents } from "./agents-Btql102J.mjs";
6
- import { t as availableAgentIds } from "./runners-DtXs4Q8a.mjs";
7
- import { n as enqueueSignal } from "./tasks-vcoodp_D.mjs";
3
+ import { a as connections, c as loops, h as signals, s as db } from "./client-BtVRVhQ2.mjs";
4
+ import { a as connectorManifest, i as connectorAction, s as connectorWorkflow } from "./connections-ypex3qUd.mjs";
5
+ import { n as agentManifest, r as listAgents } from "./agents-CrUmIQpi.mjs";
6
+ import { t as availableAgentIds } from "./runners-D-0_lfiq.mjs";
7
+ import { r as enqueueSignal } from "./tasks-B_QmDFVs.mjs";
8
8
  import { t as createServerRpc } from "./createServerRpc-DPDrnFdH.mjs";
9
9
  import { randomUUID } from "node:crypto";
10
- //#region node_modules/.nitro/vite/services/ssr/assets/loops-APFcP0y6.js
10
+ //#region node_modules/.nitro/vite/services/ssr/assets/loops-Og_G3KyZ.js
11
11
  var NAME_LIMIT = 80;
12
12
  var PROMPT_LIMIT = 8e3;
13
13
  var GUIDANCE_LIMIT = 4e3;
@@ -1,11 +1,11 @@
1
1
  import { U as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
2
  import { f as Link, p as useNavigate } from "../_libs/@tanstack/react-router+[...].mjs";
3
- import { a as connectorManifest, n as allWorkflows, s as connectorWorkflow } from "./connections-qnw2GVlP.mjs";
3
+ import { a as connectorManifest, n as allWorkflows, s as connectorWorkflow } from "./connections-ypex3qUd.mjs";
4
4
  import { B as ArrowLeft, z as ArrowRight } from "../_libs/lucide-react.mjs";
5
- import { C as Button$1, I as Badge, L as Card, R as CardContent, a as Route$9 } from "./router-3WmpE5b_.mjs";
6
- import { t as ConnectorIcon } from "./connector-icon-DZXQLLFo.mjs";
7
- import { t as LoopForm } from "./loop-form-DlObSewZ.mjs";
8
- //#region node_modules/.nitro/vite/services/ssr/assets/new-DfKyd2Wa.js
5
+ import { I as Badge, L as Button$1, R as Card, a as Route$9, z as CardContent } from "./router-BbrBz36P.mjs";
6
+ import { t as ConnectorIcon } from "./connector-icon-CFrrHjzR.mjs";
7
+ import { t as LoopForm } from "./loop-form-D-U-kU4k.mjs";
8
+ //#region node_modules/.nitro/vite/services/ssr/assets/new-CajvgIog.js
9
9
  var import_jsx_runtime = require_jsx_runtime();
10
10
  /**
11
11
  * One of a connector's workflows, as a loop nobody has saved yet.