@agiflowai/agent-cli 0.2.0 → 0.2.2
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/CHANGELOG.md +4 -0
- package/dist/claudeNotification.js +884 -874
- package/dist/claudePermissionRequest.js +1327 -1317
- package/dist/claudePostToolUse.js +1 -1
- package/dist/claudePreToolUse.js +1 -1
- package/dist/claudeSessionEnd.js +1 -1
- package/dist/claudeSessionStart.js +1 -1
- package/dist/claudeStop.js +2 -2
- package/dist/cli.js +1 -1
- package/dist/daemon.js +174 -135
- package/dist/daemon.js.map +1 -1
- package/dist/{index-B3XUySII.mjs → index-C0rzZTeN.mjs} +4930 -4844
- package/dist/index-C0rzZTeN.mjs.map +1 -0
- package/dist/{index-DfQZBy9H.mjs → index-C_8Nd03u.mjs} +2 -2
- package/dist/index-C_8Nd03u.mjs.map +1 -0
- package/dist/{index-CCniDARu.mjs → index-DFH7PylK.mjs} +2 -2
- package/dist/index-DFH7PylK.mjs.map +1 -0
- package/dist/index.js +2 -2
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/index-B3XUySII.mjs.map +0 -1
- package/dist/index-CCniDARu.mjs.map +0 -1
- package/dist/index-DfQZBy9H.mjs.map +0 -1
package/dist/daemon.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { bh as g, bi as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useDispatch as
|
|
4
|
-
import { useRef as
|
|
5
|
-
const
|
|
6
|
-
const { Box: s, Text: n } = g(),
|
|
7
|
-
return
|
|
1
|
+
import { bh as g, bi as I, bj as e, bk as B, bl as M, bm as y, bn as w, bo as P, bp as _, bq as F, br as L, bs as R, bt as q, bu as W, bv as z } from "./index-C0rzZTeN.mjs";
|
|
2
|
+
import { useQueryClient as K, useQuery as G, useMutation as U, QueryClientProvider as $, QueryClient as Q } from "@tanstack/react-query";
|
|
3
|
+
import { useDispatch as J, useSelector as l, shallowEqual as Y, Provider as X } from "react-redux";
|
|
4
|
+
import k, { useRef as V, useEffect as j, useState as D, useMemo as H } from "react";
|
|
5
|
+
const Z = ({ children: o }) => {
|
|
6
|
+
const { Box: s, Text: n } = g(), r = J(), u = l((a) => a.daemonStatus.status), i = l((a) => a.daemonStatus.error), t = V(!1);
|
|
7
|
+
return j(() => (r(I()), B(async () => {
|
|
8
8
|
if (!t.current) {
|
|
9
9
|
t.current = !0;
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const p = y.get(w.DaemonManager);
|
|
12
|
+
p.isRunning() && await p.stop();
|
|
13
13
|
} catch {
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}), () => {
|
|
17
|
-
|
|
18
|
-
}), [
|
|
17
|
+
M();
|
|
18
|
+
}), [r]), u === "starting" ? /* @__PURE__ */ e.jsxDEV(s, { flexDirection: "column", padding: 1, children: /* @__PURE__ */ e.jsxDEV(n, { color: "yellow", children: "Connecting to Agiflow..." }, void 0, !1, {
|
|
19
19
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
|
|
20
20
|
lineNumber: 52,
|
|
21
21
|
columnNumber: 9
|
|
@@ -23,13 +23,13 @@ const Q = ({ children: i }) => {
|
|
|
23
23
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
|
|
24
24
|
lineNumber: 51,
|
|
25
25
|
columnNumber: 7
|
|
26
|
-
}, void 0) :
|
|
26
|
+
}, void 0) : u === "error" ? /* @__PURE__ */ e.jsxDEV(s, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "red", children: [
|
|
27
27
|
/* @__PURE__ */ e.jsxDEV(n, { color: "red", bold: !0, children: "Connection Error" }, void 0, !1, {
|
|
28
28
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
|
|
29
29
|
lineNumber: 60,
|
|
30
30
|
columnNumber: 9
|
|
31
31
|
}, void 0),
|
|
32
|
-
/* @__PURE__ */ e.jsxDEV(n, { children:
|
|
32
|
+
/* @__PURE__ */ e.jsxDEV(n, { children: i }, void 0, !1, {
|
|
33
33
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
|
|
34
34
|
lineNumber: 63,
|
|
35
35
|
columnNumber: 9
|
|
@@ -43,21 +43,21 @@ const Q = ({ children: i }) => {
|
|
|
43
43
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
|
|
44
44
|
lineNumber: 59,
|
|
45
45
|
columnNumber: 7
|
|
46
|
-
}, void 0) :
|
|
46
|
+
}, void 0) : u === "connected" ? /* @__PURE__ */ e.jsxDEV(e.Fragment, { children: o }, void 0, !1, {
|
|
47
47
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/DaemonConnectionManager.tsx",
|
|
48
48
|
lineNumber: 70,
|
|
49
49
|
columnNumber: 12
|
|
50
50
|
}, void 0) : null;
|
|
51
|
-
},
|
|
52
|
-
const { Box: n, Text:
|
|
53
|
-
return
|
|
54
|
-
if (d.ctrl &&
|
|
55
|
-
|
|
51
|
+
}, ee = ({ onSubmit: o, onCancel: s }) => {
|
|
52
|
+
const { Box: n, Text: r, useInput: u } = g(), [i, t] = D(""), a = V("");
|
|
53
|
+
return u((p, d) => {
|
|
54
|
+
if (d.ctrl && p === "c" && a.current.length > 0) {
|
|
55
|
+
a.current = "", t("");
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
if (d.return) {
|
|
59
|
-
const
|
|
60
|
-
|
|
59
|
+
const m = a.current.trim();
|
|
60
|
+
m && o(m);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
if (d.escape) {
|
|
@@ -65,17 +65,17 @@ const Q = ({ children: i }) => {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
if (d.backspace || d.delete) {
|
|
68
|
-
const
|
|
69
|
-
|
|
68
|
+
const m = a.current.slice(0, -1);
|
|
69
|
+
a.current = m, t(m);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
|
|
72
|
+
if (p && !d.ctrl && !d.meta) {
|
|
73
|
+
const m = a.current + p;
|
|
74
|
+
a.current = m, t(m);
|
|
75
75
|
}
|
|
76
76
|
}), /* @__PURE__ */ e.jsxDEV(n, { flexDirection: "column", children: [
|
|
77
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
78
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
77
|
+
/* @__PURE__ */ e.jsxDEV(r, { children: [
|
|
78
|
+
/* @__PURE__ */ e.jsxDEV(r, { bold: !0, color: "cyan", children: [
|
|
79
79
|
"Token:",
|
|
80
80
|
" "
|
|
81
81
|
] }, void 0, !0, {
|
|
@@ -83,7 +83,7 @@ const Q = ({ children: i }) => {
|
|
|
83
83
|
lineNumber: 52,
|
|
84
84
|
columnNumber: 9
|
|
85
85
|
}, void 0),
|
|
86
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
86
|
+
/* @__PURE__ */ e.jsxDEV(r, { color: "green", children: i.length > 0 ? `${i.slice(0, 20)}...` : /* @__PURE__ */ e.jsxDEV(r, { dimColor: !0, children: "(paste token)" }, void 0, !1, {
|
|
87
87
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/TokenInput.tsx",
|
|
88
88
|
lineNumber: 55,
|
|
89
89
|
columnNumber: 78
|
|
@@ -97,14 +97,14 @@ const Q = ({ children: i }) => {
|
|
|
97
97
|
lineNumber: 51,
|
|
98
98
|
columnNumber: 7
|
|
99
99
|
}, void 0),
|
|
100
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
101
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
100
|
+
/* @__PURE__ */ e.jsxDEV(r, { dimColor: !0, children: [
|
|
101
|
+
/* @__PURE__ */ e.jsxDEV(r, { bold: !0, children: "Enter" }, void 0, !1, {
|
|
102
102
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/TokenInput.tsx",
|
|
103
103
|
lineNumber: 58,
|
|
104
104
|
columnNumber: 9
|
|
105
105
|
}, void 0),
|
|
106
106
|
" to submit • ",
|
|
107
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
107
|
+
/* @__PURE__ */ e.jsxDEV(r, { bold: !0, children: "Esc" }, void 0, !1, {
|
|
108
108
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/TokenInput.tsx",
|
|
109
109
|
lineNumber: 58,
|
|
110
110
|
columnNumber: 45
|
|
@@ -120,58 +120,58 @@ const Q = ({ children: i }) => {
|
|
|
120
120
|
lineNumber: 50,
|
|
121
121
|
columnNumber: 5
|
|
122
122
|
}, void 0);
|
|
123
|
-
},
|
|
124
|
-
const { Box: s, Text: n, Newline:
|
|
123
|
+
}, ne = ({ children: o }) => {
|
|
124
|
+
const { Box: s, Text: n, Newline: r, Static: u, Link: i } = g(), t = K(), [a, p] = D(null), [d, m] = D(!1), b = y.get(w.DeviceCodeAuthService), E = y.get(w.CredentialsService), { data: x, isLoading: T } = G({
|
|
125
125
|
queryKey: ["auth", "check"],
|
|
126
126
|
queryFn: async () => {
|
|
127
|
-
const
|
|
128
|
-
return
|
|
127
|
+
const c = await E.load();
|
|
128
|
+
return c && c.apiKey && c.expiresAt && b.isTokenValid(c.expiresAt) ? { authenticated: !0 } : { authenticated: !1 };
|
|
129
129
|
},
|
|
130
130
|
retry: !1
|
|
131
|
-
}),
|
|
131
|
+
}), N = U({
|
|
132
132
|
mutationFn: async () => {
|
|
133
|
-
const
|
|
133
|
+
const c = b.getServerUrl(), f = b.getClientId(), h = await fetch(`${c}/api/v1/oauth/device/authorize`, {
|
|
134
134
|
method: "POST",
|
|
135
135
|
headers: { "Content-Type": "application/json" },
|
|
136
136
|
body: JSON.stringify({
|
|
137
|
-
client_id:
|
|
137
|
+
client_id: f,
|
|
138
138
|
scope: "openid profile email"
|
|
139
139
|
})
|
|
140
140
|
});
|
|
141
141
|
if (!h.ok) {
|
|
142
|
-
const
|
|
143
|
-
throw new Error(
|
|
142
|
+
const A = await h.json();
|
|
143
|
+
throw new Error(A.error_description || `Device authorization failed: ${h.status}`);
|
|
144
144
|
}
|
|
145
145
|
return h.json();
|
|
146
146
|
},
|
|
147
|
-
onSuccess: (
|
|
148
|
-
|
|
147
|
+
onSuccess: (c) => {
|
|
148
|
+
p(c), m(!0);
|
|
149
149
|
}
|
|
150
|
-
}), v =
|
|
151
|
-
mutationFn: async (
|
|
152
|
-
if (!
|
|
150
|
+
}), v = U({
|
|
151
|
+
mutationFn: async (c) => {
|
|
152
|
+
if (!a)
|
|
153
153
|
throw new Error("Device code not available");
|
|
154
|
-
const
|
|
155
|
-
return await
|
|
156
|
-
apiKey:
|
|
157
|
-
organizationId:
|
|
158
|
-
expiresAt:
|
|
159
|
-
deviceId:
|
|
154
|
+
const f = await b.exchangeTokenForApiKey(c, a.device_code);
|
|
155
|
+
return await E.setApiKey({
|
|
156
|
+
apiKey: f.api_key,
|
|
157
|
+
organizationId: f.organization_id,
|
|
158
|
+
expiresAt: f.expires_at,
|
|
159
|
+
deviceId: f.device_id
|
|
160
160
|
}), { success: !0 };
|
|
161
161
|
},
|
|
162
162
|
onSuccess: () => {
|
|
163
163
|
t.invalidateQueries({ queryKey: ["auth", "check"] });
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
|
-
if (
|
|
167
|
-
x && !x.authenticated && !
|
|
168
|
-
}, [x,
|
|
169
|
-
return /* @__PURE__ */ e.jsxDEV(e.Fragment, { children:
|
|
166
|
+
if (j(() => {
|
|
167
|
+
x && !x.authenticated && !N.isPending && !a && N.mutate();
|
|
168
|
+
}, [x, N, a]), x?.authenticated)
|
|
169
|
+
return /* @__PURE__ */ e.jsxDEV(e.Fragment, { children: o({ isAuthenticated: !0 }) }, void 0, !1, {
|
|
170
170
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
171
171
|
lineNumber: 94,
|
|
172
172
|
columnNumber: 12
|
|
173
173
|
}, void 0);
|
|
174
|
-
if (
|
|
174
|
+
if (T)
|
|
175
175
|
return /* @__PURE__ */ e.jsxDEV(s, { flexDirection: "column", padding: 1, children: [
|
|
176
176
|
/* @__PURE__ */ e.jsxDEV(s, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }, void 0, !1, {
|
|
177
177
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
@@ -211,7 +211,7 @@ const Q = ({ children: i }) => {
|
|
|
211
211
|
lineNumber: 100,
|
|
212
212
|
columnNumber: 7
|
|
213
213
|
}, void 0);
|
|
214
|
-
if (
|
|
214
|
+
if (N.isPending)
|
|
215
215
|
return /* @__PURE__ */ e.jsxDEV(s, { flexDirection: "column", padding: 1, children: [
|
|
216
216
|
/* @__PURE__ */ e.jsxDEV(s, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }, void 0, !1, {
|
|
217
217
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
@@ -269,10 +269,10 @@ const Q = ({ children: i }) => {
|
|
|
269
269
|
lineNumber: 121,
|
|
270
270
|
columnNumber: 7
|
|
271
271
|
}, void 0);
|
|
272
|
-
if (
|
|
273
|
-
const
|
|
272
|
+
if (a) {
|
|
273
|
+
const c = `${a.verification_uri}?code=${encodeURIComponent(a.user_code)}`;
|
|
274
274
|
return /* @__PURE__ */ e.jsxDEV(e.Fragment, { children: [
|
|
275
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
275
|
+
/* @__PURE__ */ e.jsxDEV(u, { items: [1], children: () => /* @__PURE__ */ e.jsxDEV(s, { flexDirection: "column", padding: 1, children: [
|
|
276
276
|
/* @__PURE__ */ e.jsxDEV(s, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }, void 0, !1, {
|
|
277
277
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
278
278
|
lineNumber: 153,
|
|
@@ -346,7 +346,7 @@ const Q = ({ children: i }) => {
|
|
|
346
346
|
lineNumber: 177,
|
|
347
347
|
columnNumber: 19
|
|
348
348
|
}, void 0),
|
|
349
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
349
|
+
/* @__PURE__ */ e.jsxDEV(r, {}, void 0, !1, {
|
|
350
350
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
351
351
|
lineNumber: 180,
|
|
352
352
|
columnNumber: 19
|
|
@@ -370,7 +370,7 @@ const Q = ({ children: i }) => {
|
|
|
370
370
|
lineNumber: 182,
|
|
371
371
|
columnNumber: 19
|
|
372
372
|
}, void 0),
|
|
373
|
-
/* @__PURE__ */ e.jsxDEV(s, { paddingLeft: 3, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(
|
|
373
|
+
/* @__PURE__ */ e.jsxDEV(s, { paddingLeft: 3, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(i, { url: c, children: /* @__PURE__ */ e.jsxDEV(n, { color: "blue", bold: !0, children: c }, void 0, !1, {
|
|
374
374
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
375
375
|
lineNumber: 190,
|
|
376
376
|
columnNumber: 23
|
|
@@ -402,7 +402,7 @@ const Q = ({ children: i }) => {
|
|
|
402
402
|
lineNumber: 196,
|
|
403
403
|
columnNumber: 19
|
|
404
404
|
}, void 0),
|
|
405
|
-
/* @__PURE__ */ e.jsxDEV(s, { paddingLeft: 3, marginBottom: 1, borderStyle: "single", borderColor: "green", paddingX: 2, children: /* @__PURE__ */ e.jsxDEV(n, { color: "green", bold: !0, children:
|
|
405
|
+
/* @__PURE__ */ e.jsxDEV(s, { paddingLeft: 3, marginBottom: 1, borderStyle: "single", borderColor: "green", paddingX: 2, children: /* @__PURE__ */ e.jsxDEV(n, { color: "green", bold: !0, children: a.user_code }, void 0, !1, {
|
|
406
406
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
407
407
|
lineNumber: 203,
|
|
408
408
|
columnNumber: 21
|
|
@@ -430,7 +430,7 @@ const Q = ({ children: i }) => {
|
|
|
430
430
|
lineNumber: 208,
|
|
431
431
|
columnNumber: 19
|
|
432
432
|
}, void 0),
|
|
433
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
433
|
+
/* @__PURE__ */ e.jsxDEV(r, {}, void 0, !1, {
|
|
434
434
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
435
435
|
lineNumber: 214,
|
|
436
436
|
columnNumber: 19
|
|
@@ -454,7 +454,7 @@ const Q = ({ children: i }) => {
|
|
|
454
454
|
lineNumber: 216,
|
|
455
455
|
columnNumber: 19
|
|
456
456
|
}, void 0),
|
|
457
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
457
|
+
/* @__PURE__ */ e.jsxDEV(r, {}, void 0, !1, {
|
|
458
458
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
459
459
|
lineNumber: 222,
|
|
460
460
|
columnNumber: 19
|
|
@@ -476,7 +476,7 @@ const Q = ({ children: i }) => {
|
|
|
476
476
|
/* @__PURE__ */ e.jsxDEV(s, { borderStyle: "round", borderColor: "gray", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(s, { flexDirection: "column", children: [
|
|
477
477
|
/* @__PURE__ */ e.jsxDEV(n, { dimColor: !0, children: [
|
|
478
478
|
"⏱️ Expires in: ",
|
|
479
|
-
Math.floor(
|
|
479
|
+
Math.floor(a.expires_in / 60),
|
|
480
480
|
" minutes"
|
|
481
481
|
] }, void 0, !0, {
|
|
482
482
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
@@ -507,10 +507,10 @@ const Q = ({ children: i }) => {
|
|
|
507
507
|
columnNumber: 9
|
|
508
508
|
}, void 0),
|
|
509
509
|
d && /* @__PURE__ */ e.jsxDEV(s, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ e.jsxDEV(
|
|
510
|
-
|
|
510
|
+
ee,
|
|
511
511
|
{
|
|
512
|
-
onSubmit: (
|
|
513
|
-
onCancel: () =>
|
|
512
|
+
onSubmit: (f) => v.mutate(f),
|
|
513
|
+
onCancel: () => m(!1)
|
|
514
514
|
},
|
|
515
515
|
void 0,
|
|
516
516
|
!1,
|
|
@@ -571,8 +571,8 @@ const Q = ({ children: i }) => {
|
|
|
571
571
|
lineNumber: 253,
|
|
572
572
|
columnNumber: 7
|
|
573
573
|
}, void 0);
|
|
574
|
-
if (
|
|
575
|
-
const
|
|
574
|
+
if (N.isError || v.isError) {
|
|
575
|
+
const c = N.error || v.error;
|
|
576
576
|
return /* @__PURE__ */ e.jsxDEV(s, { flexDirection: "column", padding: 1, children: [
|
|
577
577
|
/* @__PURE__ */ e.jsxDEV(s, { marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { bold: !0, color: "red", children: "❌ Authentication Error" }, void 0, !1, {
|
|
578
578
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
@@ -583,7 +583,7 @@ const Q = ({ children: i }) => {
|
|
|
583
583
|
lineNumber: 276,
|
|
584
584
|
columnNumber: 9
|
|
585
585
|
}, void 0),
|
|
586
|
-
/* @__PURE__ */ e.jsxDEV(s, { borderStyle: "round", borderColor: "red", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { color: "red", children:
|
|
586
|
+
/* @__PURE__ */ e.jsxDEV(s, { borderStyle: "round", borderColor: "red", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e.jsxDEV(n, { color: "red", children: c?.message || "Unknown error occurred" }, void 0, !1, {
|
|
587
587
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
588
588
|
lineNumber: 282,
|
|
589
589
|
columnNumber: 11
|
|
@@ -618,7 +618,7 @@ const Q = ({ children: i }) => {
|
|
|
618
618
|
lineNumber: 290,
|
|
619
619
|
columnNumber: 13
|
|
620
620
|
}, void 0),
|
|
621
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
621
|
+
/* @__PURE__ */ e.jsxDEV(r, {}, void 0, !1, {
|
|
622
622
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/guards/OauthSetup.tsx",
|
|
623
623
|
lineNumber: 291,
|
|
624
624
|
columnNumber: 13
|
|
@@ -644,66 +644,105 @@ const Q = ({ children: i }) => {
|
|
|
644
644
|
}, void 0);
|
|
645
645
|
}
|
|
646
646
|
return null;
|
|
647
|
-
},
|
|
648
|
-
const
|
|
649
|
-
|
|
647
|
+
}, se = process.platform === "darwin", S = k.memo(({ tabId: o }) => {
|
|
648
|
+
const s = l((r) => r.agentTabs.tabs.find((u) => u.id === o)?.unreadCount), n = l((r) => r.agentTabs.activeTabId === o);
|
|
649
|
+
return !s || s <= 0 || n ? null : /* @__PURE__ */ e.jsxDEV(e.Fragment, { children: [
|
|
650
|
+
" (",
|
|
651
|
+
s,
|
|
652
|
+
")"
|
|
653
|
+
] }, void 0, !0, {
|
|
654
|
+
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
655
|
+
lineNumber: 35,
|
|
656
|
+
columnNumber: 10
|
|
657
|
+
}, void 0);
|
|
658
|
+
});
|
|
659
|
+
S.displayName = "UnreadCount";
|
|
660
|
+
const O = k.memo(({ tabId: o }) => {
|
|
661
|
+
const { Text: s } = g(), n = l(
|
|
662
|
+
(u) => u.agentTabs.tabs.find((i) => i.id === o)?.waitingInput
|
|
663
|
+
), r = l((u) => u.agentTabs.activeTabId === o);
|
|
664
|
+
return !n || r ? null : /* @__PURE__ */ e.jsxDEV(s, { color: "red", children: "● " }, void 0, !1, {
|
|
665
|
+
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
666
|
+
lineNumber: 55,
|
|
667
|
+
columnNumber: 10
|
|
668
|
+
}, void 0);
|
|
669
|
+
});
|
|
670
|
+
O.displayName = "WaitingInputIndicator";
|
|
671
|
+
const C = k.memo(({ tabId: o, index: s }) => {
|
|
672
|
+
const { Box: n, Text: r } = g(), u = l((a) => a.agentTabs.tabs.find((p) => p.id === o)?.label), i = l((a) => a.agentTabs.activeTabId === o), t = `^F${s + 1}`;
|
|
673
|
+
return /* @__PURE__ */ e.jsxDEV(n, { marginRight: 2, borderStyle: i ? "round" : void 0, children: [
|
|
674
|
+
/* @__PURE__ */ e.jsxDEV(O, { tabId: o }, void 0, !1, {
|
|
675
|
+
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
676
|
+
lineNumber: 73,
|
|
677
|
+
columnNumber: 7
|
|
678
|
+
}, void 0),
|
|
679
|
+
/* @__PURE__ */ e.jsxDEV(r, { color: "#d1d5db", bold: i, dimColor: !i, children: [
|
|
680
|
+
"[",
|
|
681
|
+
t,
|
|
682
|
+
"] ",
|
|
683
|
+
u,
|
|
684
|
+
/* @__PURE__ */ e.jsxDEV(S, { tabId: o }, void 0, !1, {
|
|
685
|
+
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
686
|
+
lineNumber: 76,
|
|
687
|
+
columnNumber: 9
|
|
688
|
+
}, void 0)
|
|
689
|
+
] }, void 0, !0, {
|
|
690
|
+
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
691
|
+
lineNumber: 74,
|
|
692
|
+
columnNumber: 7
|
|
693
|
+
}, void 0),
|
|
694
|
+
/* @__PURE__ */ e.jsxDEV(_, { tabId: o }, void 0, !1, {
|
|
695
|
+
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
696
|
+
lineNumber: 78,
|
|
697
|
+
columnNumber: 7
|
|
698
|
+
}, void 0)
|
|
699
|
+
] }, void 0, !0, {
|
|
700
|
+
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
701
|
+
lineNumber: 72,
|
|
702
|
+
columnNumber: 5
|
|
703
|
+
}, void 0);
|
|
704
|
+
});
|
|
705
|
+
C.displayName = "TabItem";
|
|
706
|
+
const oe = () => {
|
|
707
|
+
const { Box: o, Text: s } = g(), n = l((i) => i.agentTabs.tabs.map((t) => t.id), Y), r = l((i) => i.agentTabs.activeTabId), u = H(() => {
|
|
708
|
+
if (!r) return null;
|
|
650
709
|
try {
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
653
|
-
return
|
|
710
|
+
const t = y.get(w.AgentManager).getAgentContainer(r);
|
|
711
|
+
if (t)
|
|
712
|
+
return t.get(P.AgentConfigService).getEffectiveWorkingDir();
|
|
654
713
|
} catch {
|
|
655
714
|
}
|
|
656
|
-
return
|
|
657
|
-
}, [
|
|
658
|
-
return /* @__PURE__ */ e.jsxDEV(
|
|
659
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
660
|
-
const r = `^F${t + 1}`;
|
|
661
|
-
return /* @__PURE__ */ e.jsxDEV(i, { marginRight: 2, borderStyle: o === a.id ? "round" : void 0, children: [
|
|
662
|
-
/* @__PURE__ */ e.jsxDEV(s, { color: "#d1d5db", bold: o === a.id, dimColor: o !== a.id, children: [
|
|
663
|
-
"[",
|
|
664
|
-
r,
|
|
665
|
-
"] ",
|
|
666
|
-
a.label,
|
|
667
|
-
a.unreadCount && a.unreadCount > 0 && a.id !== o ? ` (${a.unreadCount})` : ""
|
|
668
|
-
] }, void 0, !0, {
|
|
669
|
-
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
670
|
-
lineNumber: 47,
|
|
671
|
-
columnNumber: 15
|
|
672
|
-
}, void 0),
|
|
673
|
-
/* @__PURE__ */ e.jsxDEV(I, { tab: a }, void 0, !1, {
|
|
674
|
-
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
675
|
-
lineNumber: 51,
|
|
676
|
-
columnNumber: 15
|
|
677
|
-
}, void 0)
|
|
678
|
-
] }, a.id, !0, {
|
|
679
|
-
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
680
|
-
lineNumber: 46,
|
|
681
|
-
columnNumber: 13
|
|
682
|
-
}, void 0);
|
|
683
|
-
}) }, void 0, !1, {
|
|
715
|
+
return process.cwd();
|
|
716
|
+
}, [r]);
|
|
717
|
+
return /* @__PURE__ */ e.jsxDEV(o, { flexDirection: "column", marginTop: 1, children: [
|
|
718
|
+
/* @__PURE__ */ e.jsxDEV(o, { alignItems: "center", borderTop: !0, borderTopColor: "#d1d5db", borderDimColor: !0, children: n.map((i, t) => /* @__PURE__ */ e.jsxDEV(C, { tabId: i, index: t }, i, !1, {
|
|
684
719
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
685
|
-
lineNumber:
|
|
720
|
+
lineNumber: 114,
|
|
721
|
+
columnNumber: 11
|
|
722
|
+
}, void 0)) }, void 0, !1, {
|
|
723
|
+
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
724
|
+
lineNumber: 112,
|
|
686
725
|
columnNumber: 7
|
|
687
726
|
}, void 0),
|
|
688
|
-
|
|
727
|
+
u && /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: u }, void 0, !1, {
|
|
689
728
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
690
|
-
lineNumber:
|
|
729
|
+
lineNumber: 117,
|
|
691
730
|
columnNumber: 28
|
|
692
731
|
}, void 0),
|
|
693
|
-
|
|
732
|
+
se && /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "Press fn + Shift + F[num] to switch tabs" }, void 0, !1, {
|
|
694
733
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
695
|
-
lineNumber:
|
|
734
|
+
lineNumber: 118,
|
|
696
735
|
columnNumber: 19
|
|
697
736
|
}, void 0)
|
|
698
737
|
] }, void 0, !0, {
|
|
699
738
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/components/AgentTabs.tsx",
|
|
700
|
-
lineNumber:
|
|
739
|
+
lineNumber: 111,
|
|
701
740
|
columnNumber: 5
|
|
702
741
|
}, void 0);
|
|
703
|
-
},
|
|
704
|
-
const { Box:
|
|
705
|
-
return /* @__PURE__ */ e.jsxDEV(
|
|
706
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
742
|
+
}, re = () => {
|
|
743
|
+
const { Box: o } = g(), s = l((n) => n.agentTabs.activeTabId);
|
|
744
|
+
return /* @__PURE__ */ e.jsxDEV(o, { flexDirection: "column", flexGrow: 1, children: [
|
|
745
|
+
/* @__PURE__ */ e.jsxDEV(F, { children: /* @__PURE__ */ e.jsxDEV(L, {}, s, !1, {
|
|
707
746
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Agents/index.tsx",
|
|
708
747
|
lineNumber: 19,
|
|
709
748
|
columnNumber: 9
|
|
@@ -712,7 +751,7 @@ const Q = ({ children: i }) => {
|
|
|
712
751
|
lineNumber: 18,
|
|
713
752
|
columnNumber: 7
|
|
714
753
|
}, void 0),
|
|
715
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
754
|
+
/* @__PURE__ */ e.jsxDEV(R, { children: /* @__PURE__ */ e.jsxDEV(oe, {}, void 0, !1, {
|
|
716
755
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Agents/index.tsx",
|
|
717
756
|
lineNumber: 22,
|
|
718
757
|
columnNumber: 9
|
|
@@ -721,7 +760,7 @@ const Q = ({ children: i }) => {
|
|
|
721
760
|
lineNumber: 21,
|
|
722
761
|
columnNumber: 7
|
|
723
762
|
}, void 0),
|
|
724
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
763
|
+
/* @__PURE__ */ e.jsxDEV(q, {}, void 0, !1, {
|
|
725
764
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Agents/index.tsx",
|
|
726
765
|
lineNumber: 24,
|
|
727
766
|
columnNumber: 7
|
|
@@ -731,15 +770,15 @@ const Q = ({ children: i }) => {
|
|
|
731
770
|
lineNumber: 17,
|
|
732
771
|
columnNumber: 5
|
|
733
772
|
}, void 0);
|
|
734
|
-
},
|
|
735
|
-
const { Box:
|
|
736
|
-
return /* @__PURE__ */ e.jsxDEV(
|
|
773
|
+
}, ae = () => {
|
|
774
|
+
const { Box: o, Text: s } = g();
|
|
775
|
+
return /* @__PURE__ */ e.jsxDEV(o, { flexDirection: "column", borderStyle: "round", borderColor: "green", padding: 1, flexGrow: 1, children: [
|
|
737
776
|
/* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "green", children: "Welcome to Agent CLI Daemon!" }, void 0, !1, {
|
|
738
777
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
|
|
739
778
|
lineNumber: 9,
|
|
740
779
|
columnNumber: 7
|
|
741
780
|
}, void 0),
|
|
742
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
781
|
+
/* @__PURE__ */ e.jsxDEV(o, { marginTop: 1, children: /* @__PURE__ */ e.jsxDEV(s, { children: "It looks like you don't have any active agent sessions." }, void 0, !1, {
|
|
743
782
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
|
|
744
783
|
lineNumber: 13,
|
|
745
784
|
columnNumber: 9
|
|
@@ -748,7 +787,7 @@ const Q = ({ children: i }) => {
|
|
|
748
787
|
lineNumber: 12,
|
|
749
788
|
columnNumber: 7
|
|
750
789
|
}, void 0),
|
|
751
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
790
|
+
/* @__PURE__ */ e.jsxDEV(o, { marginTop: 1, children: /* @__PURE__ */ e.jsxDEV(s, { children: [
|
|
752
791
|
"Please use the Agiflow UI Dashboard to start a",
|
|
753
792
|
" ",
|
|
754
793
|
/* @__PURE__ */ e.jsxDEV(s, { bold: !0, color: "blue", children: "Project Plan" }, void 0, !1, {
|
|
@@ -781,7 +820,7 @@ const Q = ({ children: i }) => {
|
|
|
781
820
|
lineNumber: 15,
|
|
782
821
|
columnNumber: 7
|
|
783
822
|
}, void 0),
|
|
784
|
-
/* @__PURE__ */ e.jsxDEV(
|
|
823
|
+
/* @__PURE__ */ e.jsxDEV(o, { marginTop: 1, children: /* @__PURE__ */ e.jsxDEV(s, { dimColor: !0, children: "The Agiflow UI Dashboard can be accessed in your browser." }, void 0, !1, {
|
|
785
824
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/screens/Onboarding/index.tsx",
|
|
786
825
|
lineNumber: 33,
|
|
787
826
|
columnNumber: 9
|
|
@@ -795,7 +834,7 @@ const Q = ({ children: i }) => {
|
|
|
795
834
|
lineNumber: 8,
|
|
796
835
|
columnNumber: 5
|
|
797
836
|
}, void 0);
|
|
798
|
-
},
|
|
837
|
+
}, ie = new Q({
|
|
799
838
|
defaultOptions: {
|
|
800
839
|
queries: {
|
|
801
840
|
retry: !1,
|
|
@@ -806,13 +845,13 @@ const Q = ({ children: i }) => {
|
|
|
806
845
|
// Consider data stale after 30 seconds
|
|
807
846
|
}
|
|
808
847
|
}
|
|
809
|
-
}),
|
|
810
|
-
const { Box:
|
|
811
|
-
return /* @__PURE__ */ e.jsxDEV(
|
|
848
|
+
}), ue = () => {
|
|
849
|
+
const { Box: o } = g(), n = l((r) => r.agentTabs.tabs).length > 0;
|
|
850
|
+
return /* @__PURE__ */ e.jsxDEV(ne, { children: ({ isAuthenticated: r }) => /* @__PURE__ */ e.jsxDEV(Z, { children: /* @__PURE__ */ e.jsxDEV(o, { flexGrow: 1, flexDirection: "column", children: r && !n ? /* @__PURE__ */ e.jsxDEV(ae, {}, void 0, !1, {
|
|
812
851
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
|
|
813
852
|
lineNumber: 35,
|
|
814
853
|
columnNumber: 49
|
|
815
|
-
}, void 0) : /* @__PURE__ */ e.jsxDEV(
|
|
854
|
+
}, void 0) : /* @__PURE__ */ e.jsxDEV(re, {}, void 0, !1, {
|
|
816
855
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
|
|
817
856
|
lineNumber: 35,
|
|
818
857
|
columnNumber: 66
|
|
@@ -829,7 +868,7 @@ const Q = ({ children: i }) => {
|
|
|
829
868
|
lineNumber: 31,
|
|
830
869
|
columnNumber: 5
|
|
831
870
|
}, void 0);
|
|
832
|
-
},
|
|
871
|
+
}, te = () => /* @__PURE__ */ e.jsxDEV(W, { children: /* @__PURE__ */ e.jsxDEV(X, { store: z, children: /* @__PURE__ */ e.jsxDEV($, { client: ie, children: /* @__PURE__ */ e.jsxDEV(ue, {}, void 0, !1, {
|
|
833
872
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
|
|
834
873
|
lineNumber: 48,
|
|
835
874
|
columnNumber: 11
|
|
@@ -845,8 +884,8 @@ const Q = ({ children: i }) => {
|
|
|
845
884
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
|
|
846
885
|
lineNumber: 45,
|
|
847
886
|
columnNumber: 5
|
|
848
|
-
}, void 0),
|
|
849
|
-
const { render:
|
|
887
|
+
}, void 0), de = async () => {
|
|
888
|
+
const { render: o } = await import("ink"), { waitUntilExit: s } = o(/* @__PURE__ */ e.jsxDEV(te, {}, void 0, !1, {
|
|
850
889
|
fileName: "/Users/vuongngo/workspace/monorepo/apps/agent-cli/src/systems/cli/apps/daemon/index.tsx",
|
|
851
890
|
lineNumber: 59,
|
|
852
891
|
columnNumber: 36
|
|
@@ -858,6 +897,6 @@ const Q = ({ children: i }) => {
|
|
|
858
897
|
return s();
|
|
859
898
|
};
|
|
860
899
|
export {
|
|
861
|
-
|
|
900
|
+
de as startDaemonApp
|
|
862
901
|
};
|
|
863
902
|
//# sourceMappingURL=daemon.js.map
|