@agiflowai/agent-cli 0.2.5 → 0.2.6

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.
package/dist/daemon.js CHANGED
@@ -1,879 +1,304 @@
1
- import { bi as g, bj as G, bk as e, bl as Q, bm as K, bn as k, bo as E, bp as Y, bq as $, br as X, bs as H, bt as J, bu as Z, bv as ee, bw as se } from "./index-BJ8bzXQe.mjs";
2
- import { useQueryClient as ne, useQuery as oe, useMutation as C, QueryClientProvider as re, QueryClient as ae } from "@tanstack/react-query";
3
- import { useDispatch as ie, useSelector as c, shallowEqual as ue, Provider as te } from "react-redux";
4
- import T, { useRef as B, useEffect as A, useState as b, useCallback as le, useMemo as ce } from "react";
5
- const me = ({ children: r }) => {
6
- const { Box: n, Text: s } = g(), a = ie(), u = c((m) => m.daemonStatus.status), i = c((m) => m.daemonStatus.error), l = B(!1);
7
- return A(() => (a(G()), Q(async () => {
8
- if (!l.current) {
9
- l.current = !0;
1
+ import { jsx as e, jsxs as i, Fragment as F } from "react/jsx-runtime";
2
+ import { bi as b, bj as V, bk as Y, bl as $, bm as S, bn as D, bo as X, bp as H, bq as J, br as Z, bs as ee, bt as re, bu as ne, bv as oe } from "./index-CPSRdi5k.mjs";
3
+ import { useQueryClient as ie, useQuery as te, useMutation as M, QueryClientProvider as ce, QueryClient as le } from "@tanstack/react-query";
4
+ import { useDispatch as de, useSelector as u, shallowEqual as ae, Provider as se } from "react-redux";
5
+ import P, { useRef as L, useEffect as _, useState as C, useCallback as ue, useMemo as he } from "react";
6
+ const ge = ({ children: t }) => {
7
+ const { Box: n, Text: r } = b(), c = de(), d = u((h) => h.daemonStatus.status), l = u((h) => h.daemonStatus.error), s = L(!1);
8
+ return _(() => (c(V()), Y(async () => {
9
+ if (!s.current) {
10
+ s.current = !0;
10
11
  try {
11
- const d = k.get(E.DaemonManager);
12
- d.isRunning() && await d.stop();
12
+ const g = S.get(D.DaemonManager);
13
+ g.isRunning() && await g.stop();
13
14
  } catch {
14
15
  }
15
16
  }
16
17
  }), () => {
17
- K();
18
- }), [a]), u === "starting" ? /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", padding: 1, children: /* @__PURE__ */ e.jsxDEV(s, { color: "yellow", children: "Connecting to Agiflow..." }, void 0, !1, {
19
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
20
- lineNumber: 52,
21
- columnNumber: 9
22
- }, void 0) }, void 0, !1, {
23
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
24
- lineNumber: 51,
25
- columnNumber: 7
26
- }, void 0) : u === "error" ? /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "red", children: [
27
- /* @__PURE__ */ e.jsxDEV(s, { color: "red", bold: !0, children: "Connection Error" }, void 0, !1, {
28
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
29
- lineNumber: 60,
30
- columnNumber: 9
31
- }, void 0),
32
- /* @__PURE__ */ e.jsxDEV(s, { children: i }, void 0, !1, {
33
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
34
- lineNumber: 63,
35
- columnNumber: 9
36
- }, void 0),
37
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "Retrying in background..." }, void 0, !1, {
38
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
39
- lineNumber: 64,
40
- columnNumber: 9
41
- }, void 0)
42
- ] }, void 0, !0, {
43
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
44
- lineNumber: 59,
45
- columnNumber: 7
46
- }, void 0) : u === "connected" ? /* @__PURE__ */ e.jsxDEV(e.Fragment, { children: r }, void 0, !1, {
47
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
48
- lineNumber: 70,
49
- columnNumber: 12
50
- }, void 0) : null;
51
- }, de = ({ children: r }) => {
52
- const { Box: n, Text: s, Newline: a, Static: u, Link: i, useInput: l } = g(), m = ne(), [d, P] = b(null), [U, q] = b(null), [x, L] = b([]), [N, I] = b(0), [f, p] = b("checking"), [R, w] = b(""), j = B(null), v = k.get(E.DeviceCodeAuthService), M = k.get(E.CredentialsService), { data: D, isLoading: V } = oe({
18
+ $();
19
+ }), [c]), d === "starting" ? /* @__PURE__ */ e(n, { flexDirection: "column", padding: 1, children: /* @__PURE__ */ e(r, { color: "yellow", children: "Connecting to Agiflow..." }) }) : d === "error" ? /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "red", children: [
20
+ /* @__PURE__ */ e(r, { color: "red", bold: !0, children: "Connection Error" }),
21
+ /* @__PURE__ */ e(r, { children: l }),
22
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "Retrying in background..." })
23
+ ] }) : d === "connected" ? /* @__PURE__ */ e(F, { children: t }) : null;
24
+ }, me = ({ children: t }) => {
25
+ const { Box: n, Text: r, Newline: c, Static: d, Link: l, useInput: s } = b(), h = ie(), [g, G] = C(null), [k, N] = C(null), [y, Q] = C([]), [p, O] = C(0), [f, m] = C("checking"), [j, A] = C(""), I = L(null), x = S.get(D.DeviceCodeAuthService), q = S.get(D.CredentialsService), { data: w, isLoading: B } = te({
53
26
  queryKey: ["auth", "check"],
54
27
  queryFn: async () => {
55
- const o = await M.load();
56
- return o && o.apiKey && o.expiresAt && v.isTokenValid(o.expiresAt) ? { authenticated: !0 } : { authenticated: !1 };
28
+ const o = await q.load();
29
+ return o && o.apiKey && o.expiresAt && x.isTokenValid(o.expiresAt) ? { authenticated: !0 } : { authenticated: !1 };
57
30
  },
58
31
  retry: !1
59
- }), h = C({
60
- mutationFn: async () => (p("requesting_code"), v.requestDeviceCode("openid profile email")),
32
+ }), v = M({
33
+ mutationFn: async () => (m("requesting_code"), x.requestDeviceCode("openid profile email")),
61
34
  onSuccess: (o) => {
62
- P(o), p("polling"), S.mutate(o);
35
+ G(o), m("polling"), E.mutate(o);
63
36
  },
64
37
  onError: (o) => {
65
- p("error"), w(o instanceof Error ? o.message : "Failed to request device code");
38
+ m("error"), A(o instanceof Error ? o.message : "Failed to request device code");
66
39
  }
67
- }), S = C({
40
+ }), E = M({
68
41
  mutationFn: async (o) => {
69
- j.current = new AbortController();
70
- const t = await v.pollForToken(o.device_code, o.interval || 5, {
71
- signal: j.current.signal
72
- }), y = await v.listOrganizations(t.access_token);
73
- return { accessToken: t.access_token, organizations: y };
42
+ I.current = new AbortController();
43
+ const a = await x.pollForToken(o.device_code, o.interval || 5, {
44
+ signal: I.current.signal
45
+ }), T = await x.listOrganizations(a.access_token);
46
+ return { accessToken: a.access_token, organizations: T };
74
47
  },
75
48
  onSuccess: (o) => {
76
- q(o.accessToken), L(o.organizations), o.organizations.length === 0 ? (p("error"), w("You have no organizations. Please create one first.")) : o.organizations.length === 1 ? O.mutate({ accessToken: o.accessToken, organizationId: o.organizations[0].id }) : p("selecting_org");
49
+ N(o.accessToken), Q(o.organizations), o.organizations.length === 0 ? (m("error"), A("You have no organizations. Please create one first.")) : o.organizations.length === 1 ? z.mutate({ accessToken: o.accessToken, organizationId: o.organizations[0].id }) : m("selecting_org");
77
50
  },
78
51
  onError: (o) => {
79
- p("error"), w(o instanceof Error ? o.message : "Failed to poll for token");
52
+ m("error"), A(o instanceof Error ? o.message : "Failed to poll for token");
80
53
  }
81
- }), O = C({
82
- mutationFn: async ({ accessToken: o, organizationId: t }) => (p("exchanging"), v.exchangeForAgentApiKey(o, t)),
54
+ }), z = M({
55
+ mutationFn: async ({ accessToken: o, organizationId: a }) => (m("exchanging"), x.exchangeForAgentApiKey(o, a)),
83
56
  onSuccess: async (o) => {
84
- await M.setApiKey({
57
+ await q.setApiKey({
85
58
  apiKey: o.api_key,
86
59
  organizationId: o.organization_id,
87
60
  expiresAt: o.expires_at,
88
61
  deviceId: o.device_id
89
- }), p("authenticated"), m.invalidateQueries({ queryKey: ["auth", "check"] });
62
+ }), m("authenticated"), h.invalidateQueries({ queryKey: ["auth", "check"] });
90
63
  },
91
64
  onError: (o) => {
92
- p("error"), w(o instanceof Error ? o.message : "Failed to exchange for agent API key");
65
+ m("error"), A(o instanceof Error ? o.message : "Failed to exchange for agent API key");
93
66
  }
94
- }), W = le(() => {
95
- U && x[N] && O.mutate({
96
- accessToken: U,
97
- organizationId: x[N].id
67
+ }), K = ue(() => {
68
+ k && y[p] && z.mutate({
69
+ accessToken: k,
70
+ organizationId: y[p].id
98
71
  });
99
- }, [U, x, N, O]);
100
- if (l(
101
- (o, t) => {
102
- f === "selecting_org" && (t.upArrow ? I((y) => Math.max(0, y - 1)) : t.downArrow ? I((y) => Math.min(x.length - 1, y + 1)) : t.return && W());
72
+ }, [k, y, p, z]);
73
+ if (s(
74
+ (o, a) => {
75
+ f === "selecting_org" && (a.upArrow ? O((T) => Math.max(0, T - 1)) : a.downArrow ? O((T) => Math.min(y.length - 1, T + 1)) : a.return && K());
103
76
  },
104
77
  { isActive: f === "selecting_org" }
105
- ), A(() => () => {
106
- j.current?.abort();
107
- }, []), A(() => {
108
- D && !D.authenticated && f === "checking" && !V && h.mutate();
109
- }, [D, f, V, h]), D?.authenticated)
110
- return /* @__PURE__ */ e.jsxDEV(e.Fragment, { children: r({ isAuthenticated: !0 }) }, void 0, !1, {
111
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
112
- lineNumber: 168,
113
- columnNumber: 12
114
- }, void 0);
115
- if (V)
116
- return /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", padding: 1, children: [
117
- /* @__PURE__ */ e.jsxDEV(n, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }, void 0, !1, {
118
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
119
- lineNumber: 176,
120
- columnNumber: 11
121
- }, void 0) }, void 0, !1, {
122
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
123
- lineNumber: 175,
124
- columnNumber: 9
125
- }, void 0),
126
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: /* @__PURE__ */ e.jsxDEV(s, { children: [
127
- /* @__PURE__ */ e.jsxDEV(s, { color: "cyan", children: "◉ " }, void 0, !1, {
128
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
129
- lineNumber: 183,
130
- columnNumber: 15
131
- }, void 0),
132
- /* @__PURE__ */ e.jsxDEV(s, { children: "Checking existing credentials..." }, void 0, !1, {
133
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
134
- lineNumber: 184,
135
- columnNumber: 15
136
- }, void 0)
137
- ] }, void 0, !0, {
138
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
139
- lineNumber: 182,
140
- columnNumber: 13
141
- }, void 0) }, void 0, !1, {
142
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
143
- lineNumber: 181,
144
- columnNumber: 11
145
- }, void 0) }, void 0, !1, {
146
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
147
- lineNumber: 180,
148
- columnNumber: 9
149
- }, void 0)
150
- ] }, void 0, !0, {
151
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
152
- lineNumber: 174,
153
- columnNumber: 7
154
- }, void 0);
155
- if (h.isPending)
156
- return /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", padding: 1, children: [
157
- /* @__PURE__ */ e.jsxDEV(n, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }, void 0, !1, {
158
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
159
- lineNumber: 197,
160
- columnNumber: 11
161
- }, void 0) }, void 0, !1, {
162
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
163
- lineNumber: 196,
164
- columnNumber: 9
165
- }, void 0),
166
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: [
167
- /* @__PURE__ */ e.jsxDEV(s, { children: [
168
- /* @__PURE__ */ e.jsxDEV(s, { color: "green", children: "✓ " }, void 0, !1, {
169
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
170
- lineNumber: 204,
171
- columnNumber: 15
172
- }, void 0),
173
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "Checked existing credentials" }, void 0, !1, {
174
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
175
- lineNumber: 205,
176
- columnNumber: 15
177
- }, void 0)
178
- ] }, void 0, !0, {
179
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
180
- lineNumber: 203,
181
- columnNumber: 13
182
- }, void 0),
183
- /* @__PURE__ */ e.jsxDEV(s, { children: [
184
- /* @__PURE__ */ e.jsxDEV(s, { color: "cyan", children: "◉ " }, void 0, !1, {
185
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
186
- lineNumber: 208,
187
- columnNumber: 15
188
- }, void 0),
189
- /* @__PURE__ */ e.jsxDEV(s, { children: "Requesting device authorization..." }, void 0, !1, {
190
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
191
- lineNumber: 209,
192
- columnNumber: 15
193
- }, void 0)
194
- ] }, void 0, !0, {
195
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
196
- lineNumber: 207,
197
- columnNumber: 13
198
- }, void 0)
199
- ] }, void 0, !0, {
200
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
201
- lineNumber: 202,
202
- columnNumber: 11
203
- }, void 0) }, void 0, !1, {
204
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
205
- lineNumber: 201,
206
- columnNumber: 9
207
- }, void 0)
208
- ] }, void 0, !0, {
209
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
210
- lineNumber: 195,
211
- columnNumber: 7
212
- }, void 0);
213
- if (d) {
214
- const o = `${d.verification_uri}?code=${encodeURIComponent(d.user_code)}`;
215
- return /* @__PURE__ */ e.jsxDEV(u, { items: [1], children: () => /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", padding: 1, children: [
216
- /* @__PURE__ */ e.jsxDEV(n, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }, void 0, !1, {
217
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
218
- lineNumber: 226,
219
- columnNumber: 15
220
- }, void 0) }, void 0, !1, {
221
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
222
- lineNumber: 225,
223
- columnNumber: 13
224
- }, void 0),
225
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "round", borderColor: "green", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: [
226
- /* @__PURE__ */ e.jsxDEV(s, { children: [
227
- /* @__PURE__ */ e.jsxDEV(s, { color: "green", children: "✓ " }, void 0, !1, {
228
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
229
- lineNumber: 234,
230
- columnNumber: 19
231
- }, void 0),
232
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "Checked existing credentials" }, void 0, !1, {
233
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
234
- lineNumber: 235,
235
- columnNumber: 19
236
- }, void 0)
237
- ] }, void 0, !0, {
238
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
239
- lineNumber: 233,
240
- columnNumber: 17
241
- }, void 0),
242
- /* @__PURE__ */ e.jsxDEV(s, { children: [
243
- /* @__PURE__ */ e.jsxDEV(s, { color: "green", children: "✓ " }, void 0, !1, {
244
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
245
- lineNumber: 238,
246
- columnNumber: 19
247
- }, void 0),
248
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "Device authorization requested" }, void 0, !1, {
249
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
250
- lineNumber: 239,
251
- columnNumber: 19
252
- }, void 0)
253
- ] }, void 0, !0, {
254
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
255
- lineNumber: 237,
256
- columnNumber: 17
257
- }, void 0),
258
- /* @__PURE__ */ e.jsxDEV(s, { children: [
259
- /* @__PURE__ */ e.jsxDEV(s, { color: "cyan", children: "◉ " }, void 0, !1, {
260
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
261
- lineNumber: 242,
262
- columnNumber: 19
263
- }, void 0),
264
- /* @__PURE__ */ e.jsxDEV(s, { bold: !0, children: "Polling for authorization..." }, void 0, !1, {
265
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
266
- lineNumber: 243,
267
- columnNumber: 19
268
- }, void 0)
269
- ] }, void 0, !0, {
270
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
271
- lineNumber: 241,
272
- columnNumber: 17
273
- }, void 0)
274
- ] }, void 0, !0, {
275
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
276
- lineNumber: 232,
277
- columnNumber: 15
278
- }, void 0) }, void 0, !1, {
279
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
280
- lineNumber: 231,
281
- columnNumber: 13
282
- }, void 0),
283
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "double", borderColor: "yellow", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: [
284
- /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "yellow", children: "📋 Authentication Steps:" }, void 0, !1, {
285
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
286
- lineNumber: 250,
287
- columnNumber: 17
288
- }, void 0),
289
- /* @__PURE__ */ e.jsxDEV(a, {}, void 0, !1, {
290
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
291
- lineNumber: 253,
292
- columnNumber: 17
293
- }, void 0),
294
- /* @__PURE__ */ e.jsxDEV(s, { children: [
295
- /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "cyan", children: [
78
+ ), _(() => () => {
79
+ I.current?.abort();
80
+ }, []), _(() => {
81
+ w && !w.authenticated && f === "checking" && !B && v.mutate();
82
+ }, [w, f, B, v]), w?.authenticated)
83
+ return /* @__PURE__ */ e(F, { children: t({ isAuthenticated: !0 }) });
84
+ if (B)
85
+ return /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
86
+ /* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }) }),
87
+ /* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ e(n, { flexDirection: "column", children: /* @__PURE__ */ i(r, { children: [
88
+ /* @__PURE__ */ e(r, { color: "cyan", children: "◉ " }),
89
+ /* @__PURE__ */ e(r, { children: "Checking existing credentials..." })
90
+ ] }) }) })
91
+ ] });
92
+ if (v.isPending)
93
+ return /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
94
+ /* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }) }),
95
+ /* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
96
+ /* @__PURE__ */ i(r, { children: [
97
+ /* @__PURE__ */ e(r, { color: "green", children: "✓ " }),
98
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "Checked existing credentials" })
99
+ ] }),
100
+ /* @__PURE__ */ i(r, { children: [
101
+ /* @__PURE__ */ e(r, { color: "cyan", children: "◉ " }),
102
+ /* @__PURE__ */ e(r, { children: "Requesting device authorization..." })
103
+ ] })
104
+ ] }) })
105
+ ] });
106
+ if (g) {
107
+ const o = `${g.verification_uri}?code=${encodeURIComponent(g.user_code)}`;
108
+ return /* @__PURE__ */ e(d, { items: [1], children: () => /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
109
+ /* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }) }),
110
+ /* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "green", padding: 1, marginBottom: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
111
+ /* @__PURE__ */ i(r, { children: [
112
+ /* @__PURE__ */ e(r, { color: "green", children: "✓ " }),
113
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "Checked existing credentials" })
114
+ ] }),
115
+ /* @__PURE__ */ i(r, { children: [
116
+ /* @__PURE__ */ e(r, { color: "green", children: "✓ " }),
117
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "Device authorization requested" })
118
+ ] }),
119
+ /* @__PURE__ */ i(r, { children: [
120
+ /* @__PURE__ */ e(r, { color: "cyan", children: "◉ " }),
121
+ /* @__PURE__ */ e(r, { bold: !0, children: "Polling for authorization..." })
122
+ ] })
123
+ ] }) }),
124
+ /* @__PURE__ */ e(n, { borderStyle: "double", borderColor: "yellow", padding: 1, marginBottom: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
125
+ /* @__PURE__ */ e(r, { bold: !0, color: "yellow", children: "📋 Authentication Steps:" }),
126
+ /* @__PURE__ */ e(c, {}),
127
+ /* @__PURE__ */ i(r, { children: [
128
+ /* @__PURE__ */ i(r, { bold: !0, color: "cyan", children: [
296
129
  "1.",
297
130
  " "
298
- ] }, void 0, !0, {
299
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
300
- lineNumber: 256,
301
- columnNumber: 19
302
- }, void 0),
303
- /* @__PURE__ */ e.jsxDEV(s, { children: "Open this URL in your browser:" }, void 0, !1, {
304
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
305
- lineNumber: 259,
306
- columnNumber: 19
307
- }, void 0)
308
- ] }, void 0, !0, {
309
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
310
- lineNumber: 255,
311
- columnNumber: 17
312
- }, void 0),
313
- /* @__PURE__ */ e.jsxDEV(n, { paddingLeft: 3, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(i, { url: o, children: /* @__PURE__ */ e.jsxDEV(s, { color: "blue", bold: !0, children: o }, void 0, !1, {
314
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
315
- lineNumber: 263,
316
- columnNumber: 21
317
- }, void 0) }, void 0, !1, {
318
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
319
- lineNumber: 262,
320
- columnNumber: 19
321
- }, void 0) }, void 0, !1, {
322
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
323
- lineNumber: 261,
324
- columnNumber: 17
325
- }, void 0),
326
- /* @__PURE__ */ e.jsxDEV(s, { children: [
327
- /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "cyan", children: [
131
+ ] }),
132
+ /* @__PURE__ */ e(r, { children: "Open this URL in your browser:" })
133
+ ] }),
134
+ /* @__PURE__ */ e(n, { paddingLeft: 3, marginBottom: 1, children: /* @__PURE__ */ e(l, { url: o, children: /* @__PURE__ */ e(r, { color: "blue", bold: !0, children: o }) }) }),
135
+ /* @__PURE__ */ i(r, { children: [
136
+ /* @__PURE__ */ i(r, { bold: !0, color: "cyan", children: [
328
137
  "2.",
329
138
  " "
330
- ] }, void 0, !0, {
331
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
332
- lineNumber: 270,
333
- columnNumber: 19
334
- }, void 0),
335
- /* @__PURE__ */ e.jsxDEV(s, { children: "Enter this verification code:" }, void 0, !1, {
336
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
337
- lineNumber: 273,
338
- columnNumber: 19
339
- }, void 0)
340
- ] }, void 0, !0, {
341
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
342
- lineNumber: 269,
343
- columnNumber: 17
344
- }, void 0),
345
- /* @__PURE__ */ e.jsxDEV(n, { paddingLeft: 3, marginBottom: 1, borderStyle: "single", borderColor: "green", paddingX: 2, children: /* @__PURE__ */ e.jsxDEV(s, { color: "green", bold: !0, children: d.user_code }, void 0, !1, {
346
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
347
- lineNumber: 276,
348
- columnNumber: 19
349
- }, void 0) }, void 0, !1, {
350
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
351
- lineNumber: 275,
352
- columnNumber: 17
353
- }, void 0),
354
- /* @__PURE__ */ e.jsxDEV(s, { children: [
355
- /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "cyan", children: [
139
+ ] }),
140
+ /* @__PURE__ */ e(r, { children: "Enter this verification code:" })
141
+ ] }),
142
+ /* @__PURE__ */ e(n, { paddingLeft: 3, marginBottom: 1, borderStyle: "single", borderColor: "green", paddingX: 2, children: /* @__PURE__ */ e(r, { color: "green", bold: !0, children: g.user_code }) }),
143
+ /* @__PURE__ */ i(r, { children: [
144
+ /* @__PURE__ */ i(r, { bold: !0, color: "cyan", children: [
356
145
  "3.",
357
146
  " "
358
- ] }, void 0, !0, {
359
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
360
- lineNumber: 282,
361
- columnNumber: 19
362
- }, void 0),
363
- /* @__PURE__ */ e.jsxDEV(s, { children: "Sign in and approve the device" }, void 0, !1, {
364
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
365
- lineNumber: 285,
366
- columnNumber: 19
367
- }, void 0)
368
- ] }, void 0, !0, {
369
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
370
- lineNumber: 281,
371
- columnNumber: 17
372
- }, void 0),
373
- /* @__PURE__ */ e.jsxDEV(a, {}, void 0, !1, {
374
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
375
- lineNumber: 287,
376
- columnNumber: 17
377
- }, void 0),
378
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "The CLI will automatically detect when you approve the device." }, void 0, !1, {
379
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
380
- lineNumber: 289,
381
- columnNumber: 17
382
- }, void 0)
383
- ] }, void 0, !0, {
384
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
385
- lineNumber: 249,
386
- columnNumber: 15
387
- }, void 0) }, void 0, !1, {
388
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
389
- lineNumber: 248,
390
- columnNumber: 13
391
- }, void 0),
392
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "round", borderColor: "gray", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: [
393
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: [
147
+ ] }),
148
+ /* @__PURE__ */ e(r, { children: "Sign in and approve the device" })
149
+ ] }),
150
+ /* @__PURE__ */ e(c, {}),
151
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "The CLI will automatically detect when you approve the device." })
152
+ ] }) }),
153
+ /* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "gray", padding: 1, marginBottom: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
154
+ /* @__PURE__ */ i(r, { dimColor: !0, children: [
394
155
  "⏱️ Expires in: ",
395
- Math.floor(d.expires_in / 60),
156
+ Math.floor(g.expires_in / 60),
396
157
  " minutes"
397
- ] }, void 0, !0, {
398
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
399
- lineNumber: 295,
400
- columnNumber: 17
401
- }, void 0),
402
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "💡 Tip: The URL includes your verification code for convenience" }, void 0, !1, {
403
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
404
- lineNumber: 296,
405
- columnNumber: 17
406
- }, void 0)
407
- ] }, void 0, !0, {
408
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
409
- lineNumber: 294,
410
- columnNumber: 15
411
- }, void 0) }, void 0, !1, {
412
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
413
- lineNumber: 293,
414
- columnNumber: 13
415
- }, void 0)
416
- ] }, void 0, !0, {
417
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
418
- lineNumber: 224,
419
- columnNumber: 11
420
- }, void 0) }, void 0, !1, {
421
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
422
- lineNumber: 222,
423
- columnNumber: 7
424
- }, void 0);
158
+ ] }),
159
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "💡 Tip: The URL includes your verification code for convenience" })
160
+ ] }) })
161
+ ] }) });
425
162
  }
426
163
  if (f === "selecting_org")
427
- return /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", padding: 1, children: [
428
- /* @__PURE__ */ e.jsxDEV(n, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }, void 0, !1, {
429
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
430
- lineNumber: 310,
431
- columnNumber: 11
432
- }, void 0) }, void 0, !1, {
433
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
434
- lineNumber: 309,
435
- columnNumber: 9
436
- }, void 0),
437
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "round", borderColor: "green", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: [
438
- /* @__PURE__ */ e.jsxDEV(s, { children: [
439
- /* @__PURE__ */ e.jsxDEV(s, { color: "green", children: "" }, void 0, !1, {
440
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
441
- lineNumber: 318,
442
- columnNumber: 15
443
- }, void 0),
444
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "Device authorized successfully" }, void 0, !1, {
445
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
446
- lineNumber: 319,
447
- columnNumber: 15
448
- }, void 0)
449
- ] }, void 0, !0, {
450
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
451
- lineNumber: 317,
452
- columnNumber: 13
453
- }, void 0),
454
- /* @__PURE__ */ e.jsxDEV(s, { children: [
455
- /* @__PURE__ */ e.jsxDEV(s, { color: "cyan", children: "◉ " }, void 0, !1, {
456
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
457
- lineNumber: 322,
458
- columnNumber: 15
459
- }, void 0),
460
- /* @__PURE__ */ e.jsxDEV(s, { bold: !0, children: "Select an organization" }, void 0, !1, {
461
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
462
- lineNumber: 323,
463
- columnNumber: 15
464
- }, void 0)
465
- ] }, void 0, !0, {
466
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
467
- lineNumber: 321,
468
- columnNumber: 13
469
- }, void 0)
470
- ] }, void 0, !0, {
471
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
472
- lineNumber: 316,
473
- columnNumber: 11
474
- }, void 0) }, void 0, !1, {
475
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
476
- lineNumber: 315,
477
- columnNumber: 9
478
- }, void 0),
479
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "double", borderColor: "yellow", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: [
480
- /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "yellow", children: "📋 Select Organization:" }, void 0, !1, {
481
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
482
- lineNumber: 330,
483
- columnNumber: 13
484
- }, void 0),
485
- /* @__PURE__ */ e.jsxDEV(a, {}, void 0, !1, {
486
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
487
- lineNumber: 333,
488
- columnNumber: 13
489
- }, void 0),
490
- x.map((o, t) => /* @__PURE__ */ e.jsxDEV(s, { children: [
491
- /* @__PURE__ */ e.jsxDEV(s, { color: t === N ? "green" : "gray", children: t === N ? "❯ " : " " }, void 0, !1, {
492
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
493
- lineNumber: 336,
494
- columnNumber: 17
495
- }, void 0),
496
- /* @__PURE__ */ e.jsxDEV(s, { bold: t === N, children: o.name }, void 0, !1, {
497
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
498
- lineNumber: 339,
499
- columnNumber: 17
500
- }, void 0),
501
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: [
164
+ return /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
165
+ /* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }) }),
166
+ /* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "green", padding: 1, marginBottom: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
167
+ /* @__PURE__ */ i(r, { children: [
168
+ /* @__PURE__ */ e(r, { color: "green", children: "✓ " }),
169
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "Device authorized successfully" })
170
+ ] }),
171
+ /* @__PURE__ */ i(r, { children: [
172
+ /* @__PURE__ */ e(r, { color: "cyan", children: "◉ " }),
173
+ /* @__PURE__ */ e(r, { bold: !0, children: "Select an organization" })
174
+ ] })
175
+ ] }) }),
176
+ /* @__PURE__ */ e(n, { borderStyle: "double", borderColor: "yellow", padding: 1, marginBottom: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
177
+ /* @__PURE__ */ e(r, { bold: !0, color: "yellow", children: "📋 Select Organization:" }),
178
+ /* @__PURE__ */ e(c, {}),
179
+ y.map((o, a) => /* @__PURE__ */ i(r, { children: [
180
+ /* @__PURE__ */ e(r, { color: a === p ? "green" : "gray", children: a === p ? "❯ " : " " }),
181
+ /* @__PURE__ */ e(r, { bold: a === p, children: o.name }),
182
+ /* @__PURE__ */ i(r, { dimColor: !0, children: [
502
183
  " (",
503
184
  o.slug,
504
185
  ")"
505
- ] }, void 0, !0, {
506
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
507
- lineNumber: 340,
508
- columnNumber: 17
509
- }, void 0)
510
- ] }, o.id, !0, {
511
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
512
- lineNumber: 335,
513
- columnNumber: 15
514
- }, void 0)),
515
- /* @__PURE__ */ e.jsxDEV(a, {}, void 0, !1, {
516
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
517
- lineNumber: 343,
518
- columnNumber: 13
519
- }, void 0),
520
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "Use ↑/↓ arrows to navigate, Enter to select" }, void 0, !1, {
521
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
522
- lineNumber: 344,
523
- columnNumber: 13
524
- }, void 0)
525
- ] }, void 0, !0, {
526
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
527
- lineNumber: 329,
528
- columnNumber: 11
529
- }, void 0) }, void 0, !1, {
530
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
531
- lineNumber: 328,
532
- columnNumber: 9
533
- }, void 0)
534
- ] }, void 0, !0, {
535
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
536
- lineNumber: 308,
537
- columnNumber: 7
538
- }, void 0);
186
+ ] })
187
+ ] }, o.id)),
188
+ /* @__PURE__ */ e(c, {}),
189
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "Use ↑/↓ arrows to navigate, Enter to select" })
190
+ ] }) })
191
+ ] });
539
192
  if (f === "exchanging")
540
- return /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", padding: 1, children: [
541
- /* @__PURE__ */ e.jsxDEV(n, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }, void 0, !1, {
542
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
543
- lineNumber: 356,
544
- columnNumber: 11
545
- }, void 0) }, void 0, !1, {
546
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
547
- lineNumber: 355,
548
- columnNumber: 9
549
- }, void 0),
550
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: [
551
- /* @__PURE__ */ e.jsxDEV(s, { children: [
552
- /* @__PURE__ */ e.jsxDEV(s, { color: "green", children: " " }, void 0, !1, {
553
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
554
- lineNumber: 363,
555
- columnNumber: 15
556
- }, void 0),
557
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "Device authorized" }, void 0, !1, {
558
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
559
- lineNumber: 364,
560
- columnNumber: 15
561
- }, void 0)
562
- ] }, void 0, !0, {
563
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
564
- lineNumber: 362,
565
- columnNumber: 13
566
- }, void 0),
567
- /* @__PURE__ */ e.jsxDEV(s, { children: [
568
- /* @__PURE__ */ e.jsxDEV(s, { color: "green", children: "✓ " }, void 0, !1, {
569
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
570
- lineNumber: 367,
571
- columnNumber: 15
572
- }, void 0),
573
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "Organization selected" }, void 0, !1, {
574
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
575
- lineNumber: 368,
576
- columnNumber: 15
577
- }, void 0)
578
- ] }, void 0, !0, {
579
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
580
- lineNumber: 366,
581
- columnNumber: 13
582
- }, void 0),
583
- /* @__PURE__ */ e.jsxDEV(s, { children: [
584
- /* @__PURE__ */ e.jsxDEV(s, { color: "cyan", children: "◉ " }, void 0, !1, {
585
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
586
- lineNumber: 371,
587
- columnNumber: 15
588
- }, void 0),
589
- /* @__PURE__ */ e.jsxDEV(s, { children: "Creating agent credentials..." }, void 0, !1, {
590
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
591
- lineNumber: 372,
592
- columnNumber: 15
593
- }, void 0)
594
- ] }, void 0, !0, {
595
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
596
- lineNumber: 370,
597
- columnNumber: 13
598
- }, void 0)
599
- ] }, void 0, !0, {
600
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
601
- lineNumber: 361,
602
- columnNumber: 11
603
- }, void 0) }, void 0, !1, {
604
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
605
- lineNumber: 360,
606
- columnNumber: 9
607
- }, void 0)
608
- ] }, void 0, !0, {
609
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
610
- lineNumber: 354,
611
- columnNumber: 7
612
- }, void 0);
613
- if (f === "error" || h.isError || S.isError) {
614
- const o = h.error || S.error, t = R || o?.message || "Unknown error occurred";
615
- return /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", padding: 1, children: [
616
- /* @__PURE__ */ e.jsxDEV(n, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "red", children: "❌ Authentication Error" }, void 0, !1, {
617
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
618
- lineNumber: 387,
619
- columnNumber: 11
620
- }, void 0) }, void 0, !1, {
621
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
622
- lineNumber: 386,
623
- columnNumber: 9
624
- }, void 0),
625
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "round", borderColor: "red", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(s, { color: "red", children: t }, void 0, !1, {
626
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
627
- lineNumber: 392,
628
- columnNumber: 11
629
- }, void 0) }, void 0, !1, {
630
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
631
- lineNumber: 391,
632
- columnNumber: 9
633
- }, void 0),
634
- /* @__PURE__ */ e.jsxDEV(n, { borderStyle: "single", borderColor: "gray", padding: 1, children: /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: [
635
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "💡 Troubleshooting:" }, void 0, !1, {
636
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
637
- lineNumber: 396,
638
- columnNumber: 13
639
- }, void 0),
640
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: " • Check your internet connection" }, void 0, !1, {
641
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
642
- lineNumber: 397,
643
- columnNumber: 13
644
- }, void 0),
645
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: " • Verify the server URL is correct" }, void 0, !1, {
646
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
647
- lineNumber: 398,
648
- columnNumber: 13
649
- }, void 0),
650
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: " • Ensure the token is valid and not expired" }, void 0, !1, {
651
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
652
- lineNumber: 399,
653
- columnNumber: 13
654
- }, void 0),
655
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: " • Try running the daemon again" }, void 0, !1, {
656
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
657
- lineNumber: 400,
658
- columnNumber: 13
659
- }, void 0),
660
- /* @__PURE__ */ e.jsxDEV(a, {}, void 0, !1, {
661
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
662
- lineNumber: 401,
663
- columnNumber: 13
664
- }, void 0),
665
- /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "⌨️ Press Ctrl+C to exit" }, void 0, !1, {
666
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
667
- lineNumber: 402,
668
- columnNumber: 13
669
- }, void 0)
670
- ] }, void 0, !0, {
671
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
672
- lineNumber: 395,
673
- columnNumber: 11
674
- }, void 0) }, void 0, !1, {
675
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
676
- lineNumber: 394,
677
- columnNumber: 9
678
- }, void 0)
679
- ] }, void 0, !0, {
680
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
681
- lineNumber: 385,
682
- columnNumber: 7
683
- }, void 0);
193
+ return /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
194
+ /* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }) }),
195
+ /* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
196
+ /* @__PURE__ */ i(r, { children: [
197
+ /* @__PURE__ */ e(r, { color: "green", children: "✓ " }),
198
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "Device authorized" })
199
+ ] }),
200
+ /* @__PURE__ */ i(r, { children: [
201
+ /* @__PURE__ */ e(r, { color: "green", children: "✓ " }),
202
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "Organization selected" })
203
+ ] }),
204
+ /* @__PURE__ */ i(r, { children: [
205
+ /* @__PURE__ */ e(r, { color: "cyan", children: " " }),
206
+ /* @__PURE__ */ e(r, { children: "Creating agent credentials..." })
207
+ ] })
208
+ ] }) })
209
+ ] });
210
+ if (f === "error" || v.isError || E.isError) {
211
+ const o = v.error || E.error, a = j || o?.message || "Unknown error occurred";
212
+ return /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
213
+ /* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "red", children: "❌ Authentication Error" }) }),
214
+ /* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "red", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e(r, { color: "red", children: a }) }),
215
+ /* @__PURE__ */ e(n, { borderStyle: "single", borderColor: "gray", padding: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
216
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "💡 Troubleshooting:" }),
217
+ /* @__PURE__ */ e(r, { dimColor: !0, children: " • Check your internet connection" }),
218
+ /* @__PURE__ */ e(r, { dimColor: !0, children: " • Verify the server URL is correct" }),
219
+ /* @__PURE__ */ e(r, { dimColor: !0, children: " • Ensure the token is valid and not expired" }),
220
+ /* @__PURE__ */ e(r, { dimColor: !0, children: " • Try running the daemon again" }),
221
+ /* @__PURE__ */ e(c, {}),
222
+ /* @__PURE__ */ e(r, { dimColor: !0, children: "⌨️ Press Ctrl+C to exit" })
223
+ ] }) })
224
+ ] });
684
225
  }
685
226
  return null;
686
- }, pe = process.platform === "darwin", z = T.memo(({ tabId: r }) => {
687
- const n = c((a) => a.agentTabs.tabs.find((u) => u.id === r)?.unreadCount), s = c((a) => a.agentTabs.activeTabId === r);
688
- return !n || n <= 0 || s ? null : /* @__PURE__ */ e.jsxDEV(e.Fragment, { children: [
227
+ }, be = process.platform === "darwin", U = P.memo(({ tabId: t }) => {
228
+ const n = u((c) => c.agentTabs.tabs.find((d) => d.id === t)?.unreadCount), r = u((c) => c.agentTabs.activeTabId === t);
229
+ return !n || n <= 0 || r ? null : /* @__PURE__ */ i(F, { children: [
689
230
  " (",
690
231
  n,
691
232
  ")"
692
- ] }, void 0, !0, {
693
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
694
- lineNumber: 35,
695
- columnNumber: 10
696
- }, void 0);
233
+ ] });
697
234
  });
698
- z.displayName = "UnreadCount";
699
- const _ = T.memo(({ tabId: r }) => {
700
- const { Text: n } = g(), s = c(
701
- (u) => u.agentTabs.tabs.find((i) => i.id === r)?.waitingInput
702
- ), a = c((u) => u.agentTabs.activeTabId === r);
703
- return !s || a ? null : /* @__PURE__ */ e.jsxDEV(n, { color: "red", children: "● " }, void 0, !1, {
704
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
705
- lineNumber: 55,
706
- columnNumber: 10
707
- }, void 0);
235
+ U.displayName = "UnreadCount";
236
+ const R = P.memo(({ tabId: t }) => {
237
+ const { Text: n } = b(), r = u(
238
+ (d) => d.agentTabs.tabs.find((l) => l.id === t)?.waitingInput
239
+ ), c = u((d) => d.agentTabs.activeTabId === t);
240
+ return !r || c ? null : /* @__PURE__ */ e(n, { color: "red", children: "● " });
708
241
  });
709
- _.displayName = "WaitingInputIndicator";
710
- const F = T.memo(({ tabId: r, index: n }) => {
711
- const { Box: s, Text: a } = g(), u = c((m) => m.agentTabs.tabs.find((d) => d.id === r)?.label), i = c((m) => m.agentTabs.activeTabId === r), l = `^F${n + 1}`;
712
- return /* @__PURE__ */ e.jsxDEV(s, { marginRight: 2, borderStyle: i ? "round" : void 0, children: [
713
- /* @__PURE__ */ e.jsxDEV(_, { tabId: r }, void 0, !1, {
714
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
715
- lineNumber: 73,
716
- columnNumber: 7
717
- }, void 0),
718
- /* @__PURE__ */ e.jsxDEV(a, { color: "#d1d5db", bold: i, dimColor: !i, children: [
242
+ R.displayName = "WaitingInputIndicator";
243
+ const W = P.memo(({ tabId: t, index: n }) => {
244
+ const { Box: r, Text: c } = b(), d = u((h) => h.agentTabs.tabs.find((g) => g.id === t)?.label), l = u((h) => h.agentTabs.activeTabId === t), s = `^F${n + 1}`;
245
+ return /* @__PURE__ */ i(r, { marginRight: 2, borderStyle: l ? "round" : void 0, children: [
246
+ /* @__PURE__ */ e(R, { tabId: t }),
247
+ /* @__PURE__ */ i(c, { color: "#d1d5db", bold: l, dimColor: !l, children: [
719
248
  "[",
720
- l,
249
+ s,
721
250
  "] ",
722
- u,
723
- /* @__PURE__ */ e.jsxDEV(z, { tabId: r }, void 0, !1, {
724
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
725
- lineNumber: 76,
726
- columnNumber: 9
727
- }, void 0)
728
- ] }, void 0, !0, {
729
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
730
- lineNumber: 74,
731
- columnNumber: 7
732
- }, void 0),
733
- /* @__PURE__ */ e.jsxDEV($, { tabId: r }, void 0, !1, {
734
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
735
- lineNumber: 78,
736
- columnNumber: 7
737
- }, void 0)
738
- ] }, void 0, !0, {
739
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
740
- lineNumber: 72,
741
- columnNumber: 5
742
- }, void 0);
251
+ d,
252
+ /* @__PURE__ */ e(U, { tabId: t })
253
+ ] }),
254
+ /* @__PURE__ */ e(H, { tabId: t })
255
+ ] });
743
256
  });
744
- F.displayName = "TabItem";
745
- const ge = () => {
746
- const { Box: r, Text: n } = g(), s = c((i) => i.agentTabs.tabs.map((l) => l.id), ue), a = c((i) => i.agentTabs.activeTabId), u = ce(() => {
747
- if (!a) return null;
257
+ W.displayName = "TabItem";
258
+ const fe = () => {
259
+ const { Box: t, Text: n } = b(), r = u((l) => l.agentTabs.tabs.map((s) => s.id), ae), c = u((l) => l.agentTabs.activeTabId), d = he(() => {
260
+ if (!c) return null;
748
261
  try {
749
- const l = k.get(E.AgentManager).getAgentContainer(a);
750
- if (l)
751
- return l.get(Y.AgentConfigService).getEffectiveWorkingDir();
262
+ const s = S.get(D.AgentManager).getAgentContainer(c);
263
+ if (s)
264
+ return s.get(X.AgentConfigService).getEffectiveWorkingDir();
752
265
  } catch {
753
266
  }
754
267
  return process.cwd();
755
- }, [a]);
756
- return /* @__PURE__ */ e.jsxDEV(r, { flexDirection: "column", marginTop: 1, children: [
757
- /* @__PURE__ */ e.jsxDEV(r, { alignItems: "center", borderTop: !0, borderTopColor: "#d1d5db", borderDimColor: !0, children: s.map((i, l) => /* @__PURE__ */ e.jsxDEV(F, { tabId: i, index: l }, i, !1, {
758
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
759
- lineNumber: 114,
760
- columnNumber: 11
761
- }, void 0)) }, void 0, !1, {
762
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
763
- lineNumber: 112,
764
- columnNumber: 7
765
- }, void 0),
766
- u && /* @__PURE__ */ e.jsxDEV(n, { dimColor: !0, children: u }, void 0, !1, {
767
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
768
- lineNumber: 117,
769
- columnNumber: 28
770
- }, void 0),
771
- pe && /* @__PURE__ */ e.jsxDEV(n, { dimColor: !0, children: "Press fn + Shift + F[num] to switch tabs" }, void 0, !1, {
772
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
773
- lineNumber: 118,
774
- columnNumber: 19
775
- }, void 0)
776
- ] }, void 0, !0, {
777
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
778
- lineNumber: 111,
779
- columnNumber: 5
780
- }, void 0);
781
- }, fe = () => {
782
- const { Box: r } = g(), n = c((s) => s.agentTabs.activeTabId);
783
- return /* @__PURE__ */ e.jsxDEV(r, { flexDirection: "column", flexGrow: 1, children: [
784
- /* @__PURE__ */ e.jsxDEV(X, { children: /* @__PURE__ */ e.jsxDEV(H, {}, n, !1, {
785
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Agents/index.tsx",
786
- lineNumber: 19,
787
- columnNumber: 9
788
- }, void 0) }, void 0, !1, {
789
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Agents/index.tsx",
790
- lineNumber: 18,
791
- columnNumber: 7
792
- }, void 0),
793
- /* @__PURE__ */ e.jsxDEV(J, { children: /* @__PURE__ */ e.jsxDEV(ge, {}, void 0, !1, {
794
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Agents/index.tsx",
795
- lineNumber: 22,
796
- columnNumber: 9
797
- }, void 0) }, void 0, !1, {
798
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Agents/index.tsx",
799
- lineNumber: 21,
800
- columnNumber: 7
801
- }, void 0),
802
- /* @__PURE__ */ e.jsxDEV(Z, {}, void 0, !1, {
803
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Agents/index.tsx",
804
- lineNumber: 24,
805
- columnNumber: 7
806
- }, void 0)
807
- ] }, void 0, !0, {
808
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Agents/index.tsx",
809
- lineNumber: 17,
810
- columnNumber: 5
811
- }, void 0);
812
- }, Ne = () => {
813
- const { Box: r, Text: n } = g();
814
- return /* @__PURE__ */ e.jsxDEV(r, { flexDirection: "column", borderStyle: "round", borderColor: "green", padding: 1, flexGrow: 1, children: [
815
- /* @__PURE__ */ e.jsxDEV(n, { bold: !0, color: "green", children: "Welcome to Agent CLI Daemon!" }, void 0, !1, {
816
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
817
- lineNumber: 9,
818
- columnNumber: 7
819
- }, void 0),
820
- /* @__PURE__ */ e.jsxDEV(r, { marginTop: 1, children: /* @__PURE__ */ e.jsxDEV(n, { children: "It looks like you don't have any active agent sessions." }, void 0, !1, {
821
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
822
- lineNumber: 13,
823
- columnNumber: 9
824
- }, void 0) }, void 0, !1, {
825
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
826
- lineNumber: 12,
827
- columnNumber: 7
828
- }, void 0),
829
- /* @__PURE__ */ e.jsxDEV(r, { marginTop: 1, children: /* @__PURE__ */ e.jsxDEV(n, { children: [
268
+ }, [c]);
269
+ return /* @__PURE__ */ i(t, { flexDirection: "column", marginTop: 1, children: [
270
+ /* @__PURE__ */ e(t, { alignItems: "center", borderTop: !0, borderTopColor: "#d1d5db", borderDimColor: !0, children: r.map((l, s) => /* @__PURE__ */ e(W, { tabId: l, index: s }, l)) }),
271
+ d && /* @__PURE__ */ e(n, { dimColor: !0, children: d }),
272
+ be && /* @__PURE__ */ e(n, { dimColor: !0, children: "Press fn + Shift + F[num] to switch tabs" })
273
+ ] });
274
+ }, pe = () => {
275
+ const { Box: t } = b(), n = u((r) => r.agentTabs.activeTabId);
276
+ return /* @__PURE__ */ i(t, { flexDirection: "column", flexGrow: 1, children: [
277
+ /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(Z, {}, n) }),
278
+ /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(fe, {}) }),
279
+ /* @__PURE__ */ e(re, {})
280
+ ] });
281
+ }, Ce = () => {
282
+ const { Box: t, Text: n } = b();
283
+ return /* @__PURE__ */ i(t, { flexDirection: "column", borderStyle: "round", borderColor: "green", padding: 1, flexGrow: 1, children: [
284
+ /* @__PURE__ */ e(n, { bold: !0, color: "green", children: "Welcome to Agent CLI Daemon!" }),
285
+ /* @__PURE__ */ e(t, { marginTop: 1, children: /* @__PURE__ */ e(n, { children: "It looks like you don't have any active agent sessions." }) }),
286
+ /* @__PURE__ */ e(t, { marginTop: 1, children: /* @__PURE__ */ i(n, { children: [
830
287
  "Please use the Agiflow UI Dashboard to start a",
831
288
  " ",
832
- /* @__PURE__ */ e.jsxDEV(n, { bold: !0, color: "blue", children: "Project Plan" }, void 0, !1, {
833
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
834
- lineNumber: 18,
835
- columnNumber: 11
836
- }, void 0),
289
+ /* @__PURE__ */ e(n, { bold: !0, color: "blue", children: "Project Plan" }),
837
290
  ",",
838
291
  " ",
839
- /* @__PURE__ */ e.jsxDEV(n, { bold: !0, color: "blue", children: "Work Unit" }, void 0, !1, {
840
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
841
- lineNumber: 22,
842
- columnNumber: 11
843
- }, void 0),
292
+ /* @__PURE__ */ e(n, { bold: !0, color: "blue", children: "Work Unit" }),
844
293
  ", or",
845
294
  " ",
846
- /* @__PURE__ */ e.jsxDEV(n, { bold: !0, color: "blue", children: "Task Chat" }, void 0, !1, {
847
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
848
- lineNumber: 26,
849
- columnNumber: 11
850
- }, void 0),
295
+ /* @__PURE__ */ e(n, { bold: !0, color: "blue", children: "Task Chat" }),
851
296
  " ",
852
297
  "to begin."
853
- ] }, void 0, !0, {
854
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
855
- lineNumber: 16,
856
- columnNumber: 9
857
- }, void 0) }, void 0, !1, {
858
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
859
- lineNumber: 15,
860
- columnNumber: 7
861
- }, void 0),
862
- /* @__PURE__ */ e.jsxDEV(r, { marginTop: 1, children: /* @__PURE__ */ e.jsxDEV(n, { dimColor: !0, children: "The Agiflow UI Dashboard can be accessed in your browser." }, void 0, !1, {
863
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
864
- lineNumber: 33,
865
- columnNumber: 9
866
- }, void 0) }, void 0, !1, {
867
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
868
- lineNumber: 32,
869
- columnNumber: 7
870
- }, void 0)
871
- ] }, void 0, !0, {
872
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
873
- lineNumber: 8,
874
- columnNumber: 5
875
- }, void 0);
876
- }, be = new ae({
298
+ ] }) }),
299
+ /* @__PURE__ */ e(t, { marginTop: 1, children: /* @__PURE__ */ e(n, { dimColor: !0, children: "The Agiflow UI Dashboard can be accessed in your browser." }) })
300
+ ] });
301
+ }, ye = new le({
877
302
  defaultOptions: {
878
303
  queries: {
879
304
  retry: !1,
@@ -885,50 +310,10 @@ const ge = () => {
885
310
  }
886
311
  }
887
312
  }), xe = () => {
888
- const { Box: r } = g(), s = c((a) => a.agentTabs.tabs).length > 0;
889
- return /* @__PURE__ */ e.jsxDEV(de, { children: ({ isAuthenticated: a }) => /* @__PURE__ */ e.jsxDEV(me, { children: /* @__PURE__ */ e.jsxDEV(r, { flexGrow: 1, flexDirection: "column", children: a && !s ? /* @__PURE__ */ e.jsxDEV(Ne, {}, void 0, !1, {
890
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
891
- lineNumber: 35,
892
- columnNumber: 49
893
- }, void 0) : /* @__PURE__ */ e.jsxDEV(fe, {}, void 0, !1, {
894
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
895
- lineNumber: 35,
896
- columnNumber: 66
897
- }, void 0) }, void 0, !1, {
898
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
899
- lineNumber: 34,
900
- columnNumber: 11
901
- }, void 0) }, void 0, !1, {
902
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
903
- lineNumber: 33,
904
- columnNumber: 9
905
- }, void 0) }, void 0, !1, {
906
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
907
- lineNumber: 31,
908
- columnNumber: 5
909
- }, void 0);
910
- }, ve = () => /* @__PURE__ */ e.jsxDEV(ee, { children: /* @__PURE__ */ e.jsxDEV(te, { store: se, children: /* @__PURE__ */ e.jsxDEV(re, { client: be, children: /* @__PURE__ */ e.jsxDEV(xe, {}, void 0, !1, {
911
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
912
- lineNumber: 48,
913
- columnNumber: 11
914
- }, void 0) }, void 0, !1, {
915
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
916
- lineNumber: 47,
917
- columnNumber: 9
918
- }, void 0) }, void 0, !1, {
919
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
920
- lineNumber: 46,
921
- columnNumber: 7
922
- }, void 0) }, void 0, !1, {
923
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
924
- lineNumber: 45,
925
- columnNumber: 5
926
- }, void 0), ke = async () => {
927
- const { render: r } = await import("ink"), { waitUntilExit: n } = r(/* @__PURE__ */ e.jsxDEV(ve, {}, void 0, !1, {
928
- fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
929
- lineNumber: 59,
930
- columnNumber: 36
931
- }, void 0), {
313
+ const { Box: t } = b(), r = u((c) => c.agentTabs.tabs).length > 0;
314
+ return /* @__PURE__ */ e(me, { children: ({ isAuthenticated: c }) => /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(t, { flexGrow: 1, flexDirection: "column", children: c && !r ? /* @__PURE__ */ e(Ce, {}) : /* @__PURE__ */ e(pe, {}) }) }) });
315
+ }, ve = () => /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(se, { store: oe, children: /* @__PURE__ */ e(ce, { client: ye, children: /* @__PURE__ */ e(xe, {}) }) }) }), ke = async () => {
316
+ const { render: t } = await import("ink"), { waitUntilExit: n } = t(/* @__PURE__ */ e(ve, {}), {
932
317
  stdin: process.stdin,
933
318
  stdout: process.stdout,
934
319
  stderr: process.stderr