loopable-cli 0.1.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 (133) hide show
  1. package/.output/nitro.json +17 -0
  2. package/.output/public/apple-touch-icon.png +0 -0
  3. package/.output/public/assets/_connectorId-BWjYn5tm.js +1 -0
  4. package/.output/public/assets/_loopId-Ds4RkyEc.js +1 -0
  5. package/.output/public/assets/_taskId-BOzICXDf.js +1 -0
  6. package/.output/public/assets/alert-Bn9-Zm0l.js +1 -0
  7. package/.output/public/assets/arrow-left-BF9juV9T.js +1 -0
  8. package/.output/public/assets/arrow-right-CzqvnOY1.js +1 -0
  9. package/.output/public/assets/button-HCY6DCY-.js +1 -0
  10. package/.output/public/assets/connection-status-CYZB8kLy.js +1 -0
  11. package/.output/public/assets/connector-icon-BZ_MUJV_.js +1 -0
  12. package/.output/public/assets/connectors-BvzttfSu.js +1 -0
  13. package/.output/public/assets/connectors-DdJNwRN_.js +1 -0
  14. package/.output/public/assets/external-link-D46X-bXa.js +1 -0
  15. package/.output/public/assets/gaps-D-I6xiDc.js +1 -0
  16. package/.output/public/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  17. package/.output/public/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  18. package/.output/public/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  19. package/.output/public/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  20. package/.output/public/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  21. package/.output/public/assets/inbox-BUUu9xxE.js +1 -0
  22. package/.output/public/assets/index-ztzex0FN.js +10 -0
  23. package/.output/public/assets/loader-CcBl2u8m.js +1 -0
  24. package/.output/public/assets/loop-form-dB3CLcZb.js +1 -0
  25. package/.output/public/assets/loops-DRunQrxL.js +1 -0
  26. package/.output/public/assets/loops-oSdqMd29.js +1 -0
  27. package/.output/public/assets/manifests-DNMqf7Vi.js +7 -0
  28. package/.output/public/assets/new-uyFxVjuB.js +1 -0
  29. package/.output/public/assets/preload-helper-ORbuV86A.js +3 -0
  30. package/.output/public/assets/runners-DSU3r5Ww.js +1 -0
  31. package/.output/public/assets/setting-fields-ixkpdBb-.js +3 -0
  32. package/.output/public/assets/styles-DZL5V1o7.css +2 -0
  33. package/.output/public/assets/switch-d5ummmHY.js +1 -0
  34. package/.output/public/assets/task-list-BpOStt9v.js +1 -0
  35. package/.output/public/assets/tasks-B8MsKgic.js +1 -0
  36. package/.output/public/assets/trash-2-D6u6NpzO.js +1 -0
  37. package/.output/public/favicon.svg +9 -0
  38. package/.output/server/_chunks/ssr-renderer.mjs +26 -0
  39. package/.output/server/_connectorId-8nb5yOzG.mjs +421 -0
  40. package/.output/server/_libs/@base-ui/react+[...].mjs +12841 -0
  41. package/.output/server/_libs/@tanstack/react-router+[...].mjs +14349 -0
  42. package/.output/server/_libs/class-variance-authority+clsx.mjs +69 -0
  43. package/.output/server/_libs/dijkstrajs.mjs +118 -0
  44. package/.output/server/_libs/drizzle-orm.mjs +4349 -0
  45. package/.output/server/_libs/h3+rou3+srvx.mjs +1361 -0
  46. package/.output/server/_libs/lucide-react.mjs +911 -0
  47. package/.output/server/_libs/next-themes.mjs +53 -0
  48. package/.output/server/_libs/pngjs.mjs +1680 -0
  49. package/.output/server/_libs/qrcode.mjs +2583 -0
  50. package/.output/server/_libs/sonner.mjs +955 -0
  51. package/.output/server/_libs/tailwind-merge.mjs +3380 -0
  52. package/.output/server/_libs/tanstack__history.mjs +341 -0
  53. package/.output/server/_libs/ufo.mjs +64 -0
  54. package/.output/server/_loopId-BsUL1SeL.mjs +272 -0
  55. package/.output/server/_runtime.mjs +35 -0
  56. package/.output/server/_ssr/access-zIl15o8y.mjs +42 -0
  57. package/.output/server/_ssr/agents-Btql102J.mjs +657 -0
  58. package/.output/server/_ssr/agents-DAOZPgO2.mjs +76 -0
  59. package/.output/server/_ssr/alert-NEiOCTOl.mjs +37 -0
  60. package/.output/server/_ssr/callback-CUINvl7M.mjs +62 -0
  61. package/.output/server/_ssr/client-CKkOfh-s.mjs +335 -0
  62. package/.output/server/_ssr/connection-status-Bi5peUAk.mjs +31 -0
  63. package/.output/server/_ssr/connections-qnw2GVlP.mjs +2542 -0
  64. package/.output/server/_ssr/connector-icon-DZXQLLFo.mjs +37 -0
  65. package/.output/server/_ssr/connectors-BHNwuIMj.mjs +106 -0
  66. package/.output/server/_ssr/connectors-C28g0i4c.mjs +83 -0
  67. package/.output/server/_ssr/createServerRpc-DPDrnFdH.mjs +12 -0
  68. package/.output/server/_ssr/empty-plugin-adapters-BJ4m9L8g.mjs +5 -0
  69. package/.output/server/_ssr/gaps-RAFSXLZf.mjs +53 -0
  70. package/.output/server/_ssr/inbox-k5zHergU.mjs +35 -0
  71. package/.output/server/_ssr/loop-form-DlObSewZ.mjs +412 -0
  72. package/.output/server/_ssr/loops-APFcP0y6.mjs +311 -0
  73. package/.output/server/_ssr/loops-xt2Bn7_q.mjs +222 -0
  74. package/.output/server/_ssr/new-DfKyd2Wa.mjs +169 -0
  75. package/.output/server/_ssr/router-3WmpE5b_.mjs +1553 -0
  76. package/.output/server/_ssr/runners-By-mwc3F.mjs +32 -0
  77. package/.output/server/_ssr/runners-DI_NxpHC.mjs +116 -0
  78. package/.output/server/_ssr/runners-DtXs4Q8a.mjs +106 -0
  79. package/.output/server/_ssr/secrets-Hqti-niS.mjs +199 -0
  80. package/.output/server/_ssr/setting-fields-8vKFj4df.mjs +92 -0
  81. package/.output/server/_ssr/ssr.mjs +6605 -0
  82. package/.output/server/_ssr/start-Bdc2GJUI.mjs +51 -0
  83. package/.output/server/_ssr/switch-ReNglgH6.mjs +18 -0
  84. package/.output/server/_ssr/task-list-CUITIqkb.mjs +186 -0
  85. package/.output/server/_ssr/tasks-SAjNovX6.mjs +110 -0
  86. package/.output/server/_ssr/tasks-vcoodp_D.mjs +533 -0
  87. package/.output/server/_tanstack-start-manifest_v-C0cP5F0M.mjs +125 -0
  88. package/.output/server/_taskId-CXS3lod0.mjs +249 -0
  89. package/.output/server/index.mjs +541 -0
  90. package/README.md +81 -0
  91. package/dist/cli.mjs +165 -0
  92. package/dist/dispatcher.mjs +9871 -0
  93. package/dist/runner.mjs +657 -0
  94. package/drizzle/0000_cold_demogoblin.sql +29 -0
  95. package/drizzle/0001_fancy_blonde_phantom.sql +13 -0
  96. package/drizzle/0002_spooky_smiling_tiger.sql +16 -0
  97. package/drizzle/0003_small_golden_guardian.sql +25 -0
  98. package/drizzle/0004_wonderful_thunderbolts.sql +39 -0
  99. package/drizzle/0005_named_workflows.sql +7 -0
  100. package/drizzle/0006_signals.sql +18 -0
  101. package/drizzle/0007_review_comments.sql +1 -0
  102. package/drizzle/0008_held_signals.sql +1 -0
  103. package/drizzle/0009_work_item_ref.sql +58 -0
  104. package/drizzle/0010_signal_payload.sql +2 -0
  105. package/drizzle/0011_rule_poll_cursor.sql +1 -0
  106. package/drizzle/0012_loops.sql +63 -0
  107. package/drizzle/0013_loop_owns_action_and_prompt.sql +154 -0
  108. package/drizzle/0014_loop_poll_every.sql +4 -0
  109. package/drizzle/0015_machines.sql +10 -0
  110. package/drizzle/0016_task_machine.sql +1 -0
  111. package/drizzle/0017_loop_machine.sql +1 -0
  112. package/drizzle/0018_runners.sql +1 -0
  113. package/drizzle/0019_task_runner.sql +1 -0
  114. package/drizzle/0020_loop_runner.sql +1 -0
  115. package/drizzle/0021_drop_runner_kind.sql +1 -0
  116. package/drizzle/0022_drop_loop_runner.sql +1 -0
  117. package/drizzle/0023_shared_host.sql +6 -0
  118. package/drizzle/meta/0000_snapshot.json +206 -0
  119. package/drizzle/meta/0001_snapshot.json +284 -0
  120. package/drizzle/meta/0002_snapshot.json +390 -0
  121. package/drizzle/meta/0003_snapshot.json +566 -0
  122. package/drizzle/meta/0004_snapshot.json +633 -0
  123. package/drizzle/meta/0005_snapshot.json +626 -0
  124. package/drizzle/meta/0006_snapshot.json +752 -0
  125. package/drizzle/meta/0007_snapshot.json +759 -0
  126. package/drizzle/meta/0008_snapshot.json +766 -0
  127. package/drizzle/meta/0009_snapshot.json +752 -0
  128. package/drizzle/meta/0010_snapshot.json +766 -0
  129. package/drizzle/meta/0011_snapshot.json +773 -0
  130. package/drizzle/meta/0012_snapshot.json +773 -0
  131. package/drizzle/meta/0013_snapshot.json +817 -0
  132. package/drizzle/meta/_journal.json +174 -0
  133. package/package.json +88 -0
@@ -0,0 +1,37 @@
1
+ import { U as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
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
5
+ var import_jsx_runtime = require_jsx_runtime();
6
+ function mark(viewBox, d) {
7
+ return function Mark({ className }) {
8
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
9
+ viewBox,
10
+ fill: "currentColor",
11
+ "aria-hidden": true,
12
+ className,
13
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d })
14
+ });
15
+ };
16
+ }
17
+ /**
18
+ * Manifests name their icon as a string so no connector ships a component into
19
+ * the client bundle. Names resolve here, explicitly, to keep the bundle from
20
+ * pulling in a whole icon set.
21
+ */
22
+ var ICONS = {
23
+ Github: mark("0 0 16 16", "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-2.65-.89-2.65-2.5 0-.77.27-1.4.72-1.9-.07-.18-.31-.9.07-1.87 0 0 .59-.19 1.93.72a6.5 6.5 0 0 1 1.76-.24c.6 0 1.2.08 1.76.24 1.34-.91 1.93-.72 1.93-.72.38.97.14 1.69.07 1.87.45.5.72 1.13.72 1.9 0 1.62-.88 2.3-2.66 2.5.28.24.52.71.52 1.44 0 1.03-.01 1.87-.01 2.13 0 .21.15.46.55.38A7.99 7.99 0 0 0 16 8c0-4.42-3.58-8-8-8Z"),
24
+ Gmail: mark("0 0 24 24", "M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-.904.732-1.636 1.636-1.636h.749L12 10.907l9.615-7.086h.749c.904 0 1.636.732 1.636 1.636Z"),
25
+ Wechat: mark("0 0 24 24", "M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 4.882-2.235 7.621-1.552-.983-3.29-4.269-5.653-8.163-5.653zm-2.877 3.63a1.09 1.09 0 0 1 1.089 1.089 1.09 1.09 0 0 1-1.089 1.09 1.09 1.09 0 0 1-1.089-1.09 1.09 1.09 0 0 1 1.09-1.089zm5.807 0a1.09 1.09 0 0 1 1.089 1.089 1.09 1.09 0 0 1-1.09 1.09 1.09 1.09 0 0 1-1.088-1.09 1.09 1.09 0 0 1 1.089-1.089zm5.463 3.573C13.008 9.39 9.9 12.06 9.9 15.354c0 1.874 1.017 3.582 2.67 4.834a.492.492 0 0 1 .177.554l-.324 1.235c-.016.058-.04.117-.04.177 0 .136.108.246.242.246a.271.271 0 0 0 .14-.045l1.586-.928a.72.72 0 0 1 .597-.082c.786.226 1.633.336 2.517.336 4 0 7.245-2.741 7.245-6.122 0-3.38-3.245-6.121-7.245-6.121zm-2.203 3.026a.908.908 0 0 1 .907.907.908.908 0 0 1-.907.908.908.908 0 0 1-.908-.908.908.908 0 0 1 .908-.907zm4.839 0a.908.908 0 0 1 .907.907.908.908 0 0 1-.907.908.908.908 0 0 1-.908-.908.908.908 0 0 1 .908-.907z"),
26
+ Clock,
27
+ Plug
28
+ };
29
+ function ConnectorIcon({ icon, accent, className }) {
30
+ const Icon = ICONS[icon] ?? Plug;
31
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
32
+ className: cn("flex size-9 shrink-0 items-center justify-center rounded-lg", accent, className),
33
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "size-5" })
34
+ });
35
+ }
36
+ //#endregion
37
+ export { ConnectorIcon as t };
@@ -0,0 +1,106 @@
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 } from "../_libs/@tanstack/react-router+[...].mjs";
4
+ import { t as CONNECTOR_MANIFESTS, u as needsAccount } from "./connections-qnw2GVlP.mjs";
5
+ import { M as CircleAlert, z as ArrowRight } from "../_libs/lucide-react.mjs";
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
11
+ var import_react = /* @__PURE__ */ __toESM(require_react());
12
+ var import_jsx_runtime = require_jsx_runtime();
13
+ function ConnectorsPage() {
14
+ const overview = Route$15.useLoaderData();
15
+ const { connected, error } = Route$15.useSearch();
16
+ const navigate = Route$15.useNavigate();
17
+ (0, import_react.useEffect)(() => {
18
+ if (!connected && !error) return;
19
+ if (connected) toast.success(`Connected as ${connected}`);
20
+ if (error) toast.error(error);
21
+ navigate({
22
+ search: {},
23
+ replace: true
24
+ });
25
+ }, [
26
+ connected,
27
+ error,
28
+ navigate
29
+ ]);
30
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
31
+ className: "flex flex-col gap-6",
32
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
33
+ className: "text-2xl font-semibold tracking-tight",
34
+ children: "Connectors"
35
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
36
+ className: "mt-1 text-sm text-muted-foreground",
37
+ children: "Connect the services a loop should watch. Credentials stay with Loopable."
38
+ })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
39
+ className: "flex flex-col gap-4",
40
+ children: CONNECTOR_MANIFESTS.filter((manifest) => needsAccount(manifest.id)).map((manifest) => {
41
+ const state = overview.find((entry) => entry.connectorId === manifest.id);
42
+ const connections = state?.connections ?? [];
43
+ const readiness = state?.readiness;
44
+ const unavailable = readiness && !readiness.ready ? readiness : null;
45
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardHeader, {
46
+ className: "flex flex-row items-start gap-4",
47
+ children: [
48
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConnectorIcon, {
49
+ icon: manifest.icon,
50
+ accent: manifest.accent
51
+ }),
52
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
53
+ className: "flex-1",
54
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
55
+ className: "flex items-center gap-2",
56
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
57
+ className: "font-medium",
58
+ children: manifest.name
59
+ }), connections.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
60
+ variant: "secondary",
61
+ children: [
62
+ connections.length,
63
+ " account",
64
+ connections.length > 1 ? "s" : ""
65
+ ]
66
+ }) : null]
67
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
68
+ className: "mt-1 text-sm text-muted-foreground",
69
+ children: manifest.tagline
70
+ })]
71
+ }),
72
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
73
+ variant: "outline",
74
+ render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
75
+ to: "/connectors/$connectorId",
76
+ params: { connectorId: manifest.id }
77
+ }),
78
+ children: [connections.length > 0 ? "Manage" : "Set up", /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowRight, {})]
79
+ })
80
+ ]
81
+ }), (connections.length > 0 || unavailable) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardContent, {
82
+ className: "flex flex-col gap-2 border-t pt-4",
83
+ children: [unavailable ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
84
+ className: "flex items-start gap-2 text-sm text-muted-foreground",
85
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CircleAlert, { className: "mt-0.5 size-4 shrink-0" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: unavailable.reason })]
86
+ }) : null, connections.map((connection) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
87
+ className: "flex items-center gap-3 text-sm",
88
+ children: [
89
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
90
+ className: "font-medium",
91
+ children: connection.accountLabel
92
+ }),
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConnectionStatusBadge, { status: connection.status }),
94
+ connection.lastError ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
95
+ className: "truncate text-muted-foreground",
96
+ children: connection.lastError
97
+ }) : null
98
+ ]
99
+ }, connection.id))]
100
+ })] }, manifest.id);
101
+ })
102
+ })]
103
+ });
104
+ }
105
+ //#endregion
106
+ export { ConnectorsPage as component };
@@ -0,0 +1,83 @@
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";
3
+ import { t as createServerRpc } from "./createServerRpc-DPDrnFdH.mjs";
4
+ import { t as require_lib } from "../_libs/qrcode.mjs";
5
+ //#region node_modules/.nitro/vite/services/ssr/assets/connectors-C28g0i4c.js
6
+ var import_lib = require_lib();
7
+ var getConnectorOverview_createServerFn_handler = createServerRpc({
8
+ id: "0e209afb63fad4a95a5cfeaf4831610f23673145cbf5b8054765d79804a62d31",
9
+ name: "getConnectorOverview",
10
+ filename: "src/server/functions/connectors.ts"
11
+ }, (opts) => getConnectorOverview.__executeServer(opts));
12
+ var getConnectorOverview = createServerFn({ method: "GET" }).handler(getConnectorOverview_createServerFn_handler, async () => {
13
+ const all = await listConnections();
14
+ return Promise.all(CONNECTOR_MANIFESTS.map(async (manifest) => ({
15
+ connectorId: manifest.id,
16
+ readiness: await connectorRuntime(manifest.id).readiness(),
17
+ connections: all.filter((connection) => connection.connectorId === manifest.id)
18
+ })));
19
+ });
20
+ var beginQrLogin_createServerFn_handler = createServerRpc({
21
+ id: "794964d675b97edaa881ab5cb209225ef0a4507e3d2771d6577658a058e7621f",
22
+ name: "beginQrLogin",
23
+ filename: "src/server/functions/connectors.ts"
24
+ }, (opts) => beginQrLogin.__executeServer(opts));
25
+ var beginQrLogin = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(beginQrLogin_createServerFn_handler, async ({ data }) => {
26
+ const runtime = connectorRuntime(data.connectorId);
27
+ if (!runtime.auth.startQrLogin) throw new Error(`${data.connectorId} does not connect by scanning.`);
28
+ const challenge = await runtime.auth.startQrLogin();
29
+ return {
30
+ attempt: challenge.attempt,
31
+ image: await (0, import_lib.toDataURL)(challenge.encode, {
32
+ margin: 1,
33
+ width: 240
34
+ }),
35
+ expiresInMs: challenge.expiresInMs
36
+ };
37
+ });
38
+ var continueQrLogin_createServerFn_handler = createServerRpc({
39
+ id: "43b97e3644ad73286fe5de3e99134bff099e1a8704f1ae91fe643d419eceba73",
40
+ name: "continueQrLogin",
41
+ filename: "src/server/functions/connectors.ts"
42
+ }, (opts) => continueQrLogin.__executeServer(opts));
43
+ var continueQrLogin = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(continueQrLogin_createServerFn_handler, async ({ data }) => {
44
+ const runtime = connectorRuntime(data.connectorId);
45
+ if (!runtime.auth.pollQrLogin) throw new Error(`${data.connectorId} does not connect by scanning.`);
46
+ const outcome = await runtime.auth.pollQrLogin(data.attempt);
47
+ if (outcome.state === "confirmed") return {
48
+ state: "connected",
49
+ accountLabel: (await saveAuthorizedConnection(data.connectorId, outcome.result)).accountLabel
50
+ };
51
+ if (outcome.state === "expired") return {
52
+ state: "expired",
53
+ reason: outcome.reason
54
+ };
55
+ return {
56
+ state: "pending",
57
+ attempt: outcome.attempt,
58
+ hint: outcome.hint
59
+ };
60
+ });
61
+ var disconnectConnection_createServerFn_handler = createServerRpc({
62
+ id: "f94f0787ce6704ea24f18add66832e0367a0feb9a690d8ad6454abec5e5df193",
63
+ name: "disconnectConnection",
64
+ filename: "src/server/functions/connectors.ts"
65
+ }, (opts) => disconnectConnection.__executeServer(opts));
66
+ var disconnectConnection = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(disconnectConnection_createServerFn_handler, async ({ data }) => {
67
+ await removeConnection(data.id);
68
+ return { ok: true };
69
+ });
70
+ var verifyConnection_createServerFn_handler = createServerRpc({
71
+ id: "f9ade3084971078ee9f2bc16fcdcdfb5a8d66a0f9b634803bb611287c14e21d7",
72
+ name: "verifyConnection",
73
+ filename: "src/server/functions/connectors.ts"
74
+ }, (opts) => verifyConnection.__executeServer(opts));
75
+ var verifyConnection = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(verifyConnection_createServerFn_handler, async ({ data }) => await checkConnection(data.id));
76
+ var saveConnectionSettings_createServerFn_handler = createServerRpc({
77
+ id: "18bae5deb2a19571893f0067e374e537f16d6774f9b4e04f9b7349360f6f8fdc",
78
+ name: "saveConnectionSettings",
79
+ filename: "src/server/functions/connectors.ts"
80
+ }, (opts) => saveConnectionSettings.__executeServer(opts));
81
+ var saveConnectionSettings = createServerFn({ method: "POST" }).inputValidator((data) => data).handler(saveConnectionSettings_createServerFn_handler, async ({ data }) => await updateConnectionSettings(data.id, data.settings));
82
+ //#endregion
83
+ export { beginQrLogin_createServerFn_handler, continueQrLogin_createServerFn_handler, disconnectConnection_createServerFn_handler, getConnectorOverview_createServerFn_handler, saveConnectionSettings_createServerFn_handler, verifyConnection_createServerFn_handler };
@@ -0,0 +1,12 @@
1
+ import { r as TSS_SERVER_FUNCTION } from "./ssr.mjs";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/createServerRpc-DPDrnFdH.js
3
+ var createServerRpc = (serverFnMeta, splitImportFn) => {
4
+ const url = "/_serverFn/" + serverFnMeta.id;
5
+ return Object.assign(splitImportFn, {
6
+ url,
7
+ serverFnMeta,
8
+ [TSS_SERVER_FUNCTION]: true
9
+ });
10
+ };
11
+ //#endregion
12
+ export { createServerRpc as t };
@@ -0,0 +1,5 @@
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/empty-plugin-adapters-BJ4m9L8g.js
2
+ var pluginSerializationAdapters = [];
3
+ var hasPluginAdapters = false;
4
+ //#endregion
5
+ export { hasPluginAdapters, pluginSerializationAdapters };
@@ -0,0 +1,53 @@
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
4
+ function agentName(id) {
5
+ return agentManifest(id)?.name ?? id;
6
+ }
7
+ function wantedAgent(loop, readiness) {
8
+ return loop.agentId ?? readiness.defaultAgentId;
9
+ }
10
+ function needsHost(loop) {
11
+ return connectorWorkflow(loop.connectorId, loop.workflowId)?.runsIn === "folder";
12
+ }
13
+ /**
14
+ * Why this loop cannot run right now. Empty when it can, or when it is off.
15
+ */
16
+ function issuesFor(readiness, loop) {
17
+ if (!loop.enabled) return [];
18
+ const issues = [];
19
+ const agentId = wantedAgent(loop, readiness);
20
+ const pool = needsHost(loop) ? readiness.hostAgentIds : readiness.availableAgentIds;
21
+ if (!agentId) issues.push(loop.agentId ? `${loop.name} uses ${agentName(loop.agentId)}, which no online runner has signed in.` : "No default agent is chosen, so this loop cannot run.");
22
+ else if (!pool.includes(agentId)) issues.push(needsHost(loop) ? `${loop.name} needs a runner on this host with ${agentName(agentId)} signed in.` : `${loop.name} uses ${agentName(agentId)}, which no online runner has signed in.`);
23
+ return issues;
24
+ }
25
+ /**
26
+ * What stands between the loops someone has written and any of them running.
27
+ *
28
+ * Kept apart from the page that shows it because the interesting part is which
29
+ * things count as a gap and how they are worded, and neither is worth
30
+ * rendering a component to check.
31
+ */
32
+ function gapsFor(readiness, loops) {
33
+ const missing = [];
34
+ const connected = new Set(readiness.connectedConnectorIds);
35
+ if (connected.size === 0) missing.push("No account is connected yet, so no signal can arrive.");
36
+ if (readiness.availableAgentIds.length === 0) missing.push("No coding agent is signed in on any runner, so nothing can be prepared.");
37
+ else if (!readiness.defaultAgentId) missing.push("No default agent is chosen, so loops that do not name one cannot run.");
38
+ if (connected.size > 0) {
39
+ const name = (id) => connectorManifest(id)?.name ?? id;
40
+ for (const loop of loops) {
41
+ if (!loop.enabled) continue;
42
+ if (needsAccount(loop.connectorId) && !connected.has(loop.connectorId)) missing.push(`${loop.name} watches ${name(loop.connectorId)}, which has no account.`);
43
+ if (needsAccount(loop.actionConnectorId) && !connected.has(loop.actionConnectorId)) missing.push(`${loop.name} answers on ${name(loop.actionConnectorId)}, which has no account.`);
44
+ }
45
+ }
46
+ if (readiness.availableAgentIds.length > 0) for (const loop of loops) for (const issue of issuesFor(readiness, loop)) {
47
+ if (issue === "No default agent is chosen, so this loop cannot run.") continue;
48
+ missing.push(issue);
49
+ }
50
+ return missing;
51
+ }
52
+ //#endregion
53
+ export { issuesFor as n, gapsFor as t };
@@ -0,0 +1,35 @@
1
+ import { U as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
+ import { f as Link } from "../_libs/@tanstack/react-router+[...].mjs";
3
+ import { l as Route$13 } from "./router-3WmpE5b_.mjs";
4
+ import { n as TaskList } from "./task-list-CUITIqkb.mjs";
5
+ //#region node_modules/.nitro/vite/services/ssr/assets/inbox-k5zHergU.js
6
+ var import_jsx_runtime = require_jsx_runtime();
7
+ function InboxPage() {
8
+ const { tasks } = Route$13.useLoaderData();
9
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
10
+ className: "flex flex-col gap-6",
11
+ children: [
12
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
13
+ className: "text-2xl font-semibold tracking-tight",
14
+ children: "Inbox"
15
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
16
+ className: "mt-1 text-sm text-muted-foreground",
17
+ children: "Every run, in the order it happened, whether it wrote something or decided there was nothing to say."
18
+ })] }),
19
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TaskList, {
20
+ tasks,
21
+ empty: "Nothing has run yet. Open a loop and try it against a pull request or issue link."
22
+ }),
23
+ tasks.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
24
+ className: "text-center text-sm text-muted-foreground",
25
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
26
+ to: "/loops",
27
+ className: "underline",
28
+ children: "Go to loops"
29
+ })
30
+ }) : null
31
+ ]
32
+ });
33
+ }
34
+ //#endregion
35
+ export { InboxPage as component };