@agiflowai/agent-cli 0.2.25 → 0.2.28
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/cli.js +168 -149
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +28 -28
- package/dist/{index-DTMl_vl1.mjs → index-2jHcytGJ.mjs} +12691 -8895
- package/dist/index-2jHcytGJ.mjs.map +1 -0
- package/dist/{index-B9Al3DuK.mjs → index-3ffr2u5d.mjs} +19 -17
- package/dist/index-3ffr2u5d.mjs.map +1 -0
- package/dist/index-BxTdyWuL.mjs.map +1 -1
- package/dist/{index-DxcGwY5j.mjs → index-DTa10g5B.mjs} +4 -4
- package/dist/index-DTa10g5B.mjs.map +1 -0
- package/dist/index.js +29 -28
- package/package.json +3 -3
- package/dist/claudeNotification.js +0 -14327
- package/dist/claudePermissionRequest.js +0 -14376
- package/dist/claudePostToolUse.js +0 -14331
- package/dist/claudePreToolUse.js +0 -14251
- package/dist/claudeSessionEnd.js +0 -14190
- package/dist/claudeSessionStart.js +0 -14339
- package/dist/claudeStop.js +0 -14315
- package/dist/codex.md +0 -386
- package/dist/index-B9Al3DuK.mjs.map +0 -1
- package/dist/index-DTMl_vl1.mjs.map +0 -1
- package/dist/index-DxcGwY5j.mjs.map +0 -1
- package/dist/package.json +0 -45
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/daemon.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { bn as f, bo as Y, bp as S, bq as D, br as $, bs as X, bt as H, bu as J, bv as Z, bw as ee, bx as re, by as ne, bz as oe, bA as ie } from "./index-2jHcytGJ.mjs";
|
|
3
3
|
import { useQueryClient as U, useQuery as te, useMutation as q, QueryClientProvider as ce, QueryClient as le } from "@tanstack/react-query";
|
|
4
4
|
import { useDispatch as de, useSelector as h, shallowEqual as ae, Provider as se } from "react-redux";
|
|
5
|
-
import P, { useRef as R, useEffect as
|
|
5
|
+
import P, { useRef as R, useEffect as z, useState as C, useCallback as ue, useMemo as he } from "react";
|
|
6
6
|
const ge = ({ children: t }) => {
|
|
7
7
|
const { Box: n, Text: r } = f(), c = de(), d = U(), l = h((s) => s.daemonStatus.status), u = h((s) => s.daemonStatus.error), g = R(!1);
|
|
8
|
-
return
|
|
8
|
+
return z(() => {
|
|
9
9
|
l === "error" && (async () => {
|
|
10
|
-
const p = await
|
|
10
|
+
const p = await S.get(D.CredentialsService).load();
|
|
11
11
|
(!p || !p.apiKey) && d.invalidateQueries({ queryKey: ["auth", "check"] });
|
|
12
12
|
})();
|
|
13
|
-
}, [l, d]),
|
|
13
|
+
}, [l, d]), z(() => (c(Y()), $(async () => {
|
|
14
14
|
if (!g.current) {
|
|
15
15
|
g.current = !0;
|
|
16
16
|
try {
|
|
17
|
-
const x =
|
|
17
|
+
const x = S.get(D.DaemonManager);
|
|
18
18
|
x.isRunning() && await x.stop();
|
|
19
19
|
} catch {
|
|
20
20
|
}
|
|
@@ -27,7 +27,7 @@ const ge = ({ children: t }) => {
|
|
|
27
27
|
/* @__PURE__ */ e(r, { dimColor: !0, children: "Retrying in background..." })
|
|
28
28
|
] }) : l === "connected" ? /* @__PURE__ */ e(F, { children: t }) : null;
|
|
29
29
|
}, me = ({ children: t }) => {
|
|
30
|
-
const { Box: n, Text: r, Newline: c, Static: d, Link: l, useInput: u } = f(), g = U(), [s, x] =
|
|
30
|
+
const { Box: n, Text: r, Newline: c, Static: d, Link: l, useInput: u } = f(), g = U(), [s, x] = C(null), [p, Q] = C(null), [v, N] = C([]), [y, O] = C(0), [b, m] = C("checking"), [j, k] = C(""), B = R(null), T = S.get(D.DeviceCodeAuthService), L = S.get(D.CredentialsService), { data: I, isLoading: E } = te({
|
|
31
31
|
queryKey: ["auth", "check"],
|
|
32
32
|
queryFn: async () => {
|
|
33
33
|
const o = await L.load();
|
|
@@ -44,11 +44,11 @@ const ge = ({ children: t }) => {
|
|
|
44
44
|
}
|
|
45
45
|
}), M = q({
|
|
46
46
|
mutationFn: async (o) => {
|
|
47
|
-
|
|
47
|
+
B.current = new AbortController();
|
|
48
48
|
const a = await T.pollForToken(o.device_code, o.interval || 5, {
|
|
49
|
-
signal:
|
|
50
|
-
}),
|
|
51
|
-
return { accessToken: a.access_token, organizations:
|
|
49
|
+
signal: B.current.signal
|
|
50
|
+
}), A = await T.listOrganizations(a.access_token);
|
|
51
|
+
return { accessToken: a.access_token, organizations: A };
|
|
52
52
|
},
|
|
53
53
|
onSuccess: (o) => {
|
|
54
54
|
Q(o.accessToken), N(o.organizations), o.organizations.length === 0 ? (m("error"), k("You have no organizations. Please create one first.")) : o.organizations.length === 1 ? _.mutate({ accessToken: o.accessToken, organizationId: o.organizations[0].id }) : m("selecting_org");
|
|
@@ -70,23 +70,23 @@ const ge = ({ children: t }) => {
|
|
|
70
70
|
m("error"), k(o instanceof Error ? o.message : "Failed to exchange for agent API key");
|
|
71
71
|
}
|
|
72
72
|
}), V = ue(() => {
|
|
73
|
-
p && v[
|
|
73
|
+
p && v[y] && _.mutate({
|
|
74
74
|
accessToken: p,
|
|
75
|
-
organizationId: v[
|
|
75
|
+
organizationId: v[y].id
|
|
76
76
|
});
|
|
77
|
-
}, [p, v,
|
|
77
|
+
}, [p, v, y, _]);
|
|
78
78
|
if (u(
|
|
79
79
|
(o, a) => {
|
|
80
|
-
b === "selecting_org" && (a.upArrow ? O((
|
|
80
|
+
b === "selecting_org" && (a.upArrow ? O((A) => Math.max(0, A - 1)) : a.downArrow ? O((A) => Math.min(v.length - 1, A + 1)) : a.return && V());
|
|
81
81
|
},
|
|
82
82
|
{ isActive: b === "selecting_org" }
|
|
83
|
-
),
|
|
84
|
-
|
|
85
|
-
}, []),
|
|
86
|
-
I && !I.authenticated && b === "checking" && !
|
|
87
|
-
}, [I, b,
|
|
83
|
+
), z(() => () => {
|
|
84
|
+
B.current?.abort();
|
|
85
|
+
}, []), z(() => {
|
|
86
|
+
I && !I.authenticated && b === "checking" && !E && w.mutate();
|
|
87
|
+
}, [I, b, E, w]), I?.authenticated)
|
|
88
88
|
return /* @__PURE__ */ e(F, { children: t({ isAuthenticated: !0 }) });
|
|
89
|
-
if (
|
|
89
|
+
if (E)
|
|
90
90
|
return /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
|
|
91
91
|
/* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }) }),
|
|
92
92
|
/* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ e(n, { flexDirection: "column", children: /* @__PURE__ */ i(r, { children: [
|
|
@@ -182,8 +182,8 @@ const ge = ({ children: t }) => {
|
|
|
182
182
|
/* @__PURE__ */ e(r, { bold: !0, color: "yellow", children: "📋 Select Organization:" }),
|
|
183
183
|
/* @__PURE__ */ e(c, {}),
|
|
184
184
|
v.map((o, a) => /* @__PURE__ */ i(r, { children: [
|
|
185
|
-
/* @__PURE__ */ e(r, { color: a ===
|
|
186
|
-
/* @__PURE__ */ e(r, { bold: a ===
|
|
185
|
+
/* @__PURE__ */ e(r, { color: a === y ? "green" : "gray", children: a === y ? "❯ " : " " }),
|
|
186
|
+
/* @__PURE__ */ e(r, { bold: a === y, children: o.name }),
|
|
187
187
|
/* @__PURE__ */ i(r, { dimColor: !0, children: [
|
|
188
188
|
" (",
|
|
189
189
|
o.slug,
|
|
@@ -264,7 +264,7 @@ const fe = () => {
|
|
|
264
264
|
const { Box: t, Text: n } = f(), r = h((l) => l.agentTabs.tabs.map((u) => u.id), ae), c = h((l) => l.agentTabs.activeTabId), d = he(() => {
|
|
265
265
|
if (!c) return null;
|
|
266
266
|
try {
|
|
267
|
-
const u =
|
|
267
|
+
const u = S.get(D.AgentManager).getAgentContainer(c);
|
|
268
268
|
if (u)
|
|
269
269
|
return u.get(H.AgentConfigService).getEffectiveWorkingDir();
|
|
270
270
|
} catch {
|
|
@@ -283,7 +283,7 @@ const fe = () => {
|
|
|
283
283
|
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(fe, {}) }),
|
|
284
284
|
/* @__PURE__ */ e(ne, {})
|
|
285
285
|
] });
|
|
286
|
-
},
|
|
286
|
+
}, ye = () => {
|
|
287
287
|
const { Box: t, Text: n } = f();
|
|
288
288
|
return /* @__PURE__ */ i(t, { flexDirection: "column", borderStyle: "round", borderColor: "green", padding: 1, flexGrow: 1, children: [
|
|
289
289
|
/* @__PURE__ */ e(n, { bold: !0, color: "green", children: "Welcome to Agent CLI Daemon!" }),
|
|
@@ -303,7 +303,7 @@ const fe = () => {
|
|
|
303
303
|
] }) }),
|
|
304
304
|
/* @__PURE__ */ e(t, { marginTop: 1, children: /* @__PURE__ */ e(n, { dimColor: !0, children: "The Agiflow UI Dashboard can be accessed in your browser." }) })
|
|
305
305
|
] });
|
|
306
|
-
},
|
|
306
|
+
}, Ce = new le({
|
|
307
307
|
defaultOptions: {
|
|
308
308
|
queries: {
|
|
309
309
|
retry: !1,
|
|
@@ -316,8 +316,8 @@ const fe = () => {
|
|
|
316
316
|
}
|
|
317
317
|
}), xe = () => {
|
|
318
318
|
const { Box: t } = f(), r = h((c) => c.agentTabs.tabs).length > 0;
|
|
319
|
-
return /* @__PURE__ */ e(me, { children: ({ isAuthenticated: c }) => /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(t, { flexGrow: 1, flexDirection: "column", children: c && !r ? /* @__PURE__ */ e(
|
|
320
|
-
}, ve = () => /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(se, { store: ie, children: /* @__PURE__ */ e(ce, { client:
|
|
319
|
+
return /* @__PURE__ */ e(me, { children: ({ isAuthenticated: c }) => /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(t, { flexGrow: 1, flexDirection: "column", children: c && !r ? /* @__PURE__ */ e(ye, {}) : /* @__PURE__ */ e(pe, {}) }) }) });
|
|
320
|
+
}, ve = () => /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(se, { store: ie, children: /* @__PURE__ */ e(ce, { client: Ce, children: /* @__PURE__ */ e(xe, {}) }) }) }), ke = async () => {
|
|
321
321
|
const { render: t } = await import("ink"), { waitUntilExit: n } = t(/* @__PURE__ */ e(ve, {}), {
|
|
322
322
|
stdin: process.stdin,
|
|
323
323
|
stdout: process.stdout,
|