@agiflowai/agent-cli 0.2.18 → 0.2.20
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 +6 -0
- package/dist/claudeNotification.js +1 -1
- package/dist/claudePermissionRequest.js +1 -1
- 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 +1 -1
- package/dist/cli.js +1 -1
- package/dist/daemon.js +87 -82
- package/dist/daemon.js.map +1 -1
- package/dist/{index-BvnfhTPZ.mjs → index-BTFqCNWK.mjs} +3423 -3383
- package/dist/index-BTFqCNWK.mjs.map +1 -0
- package/dist/{index-CkE7X3P2.mjs → index-Bj67IiuQ.mjs} +2 -2
- package/dist/index-Bj67IiuQ.mjs.map +1 -0
- package/dist/{index-Ba8ZwafA.mjs → index-DJUIuhbN.mjs} +2 -2
- package/dist/index-DJUIuhbN.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 +1 -1
- package/dist/index-Ba8ZwafA.mjs.map +0 -1
- package/dist/index-BvnfhTPZ.mjs.map +0 -1
- package/dist/index-CkE7X3P2.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -12962,7 +12962,7 @@ let Hr = class {
|
|
|
12962
12962
|
this.runtimeConfig = Eb.parse(e), this.appConfig = Db.parse({
|
|
12963
12963
|
VITE_INJECT_AGIFLOW_APP_ENDPOINT: "https://agiflow.io",
|
|
12964
12964
|
VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT: "https://agiflow.io",
|
|
12965
|
-
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.
|
|
12965
|
+
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.15",
|
|
12966
12966
|
VITE_AGENT_CLI_DOCKER_NETWORK: "",
|
|
12967
12967
|
VITE_SAVE_RAW: "",
|
|
12968
12968
|
VITE_MULTIPLEX_SOCKET_PATH: ""
|
|
@@ -12961,7 +12961,7 @@ let Hr = class {
|
|
|
12961
12961
|
this.runtimeConfig = Tb.parse(e), this.appConfig = Db.parse({
|
|
12962
12962
|
VITE_INJECT_AGIFLOW_APP_ENDPOINT: "https://agiflow.io",
|
|
12963
12963
|
VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT: "https://agiflow.io",
|
|
12964
|
-
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.
|
|
12964
|
+
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.15",
|
|
12965
12965
|
VITE_AGENT_CLI_DOCKER_NETWORK: "",
|
|
12966
12966
|
VITE_SAVE_RAW: "",
|
|
12967
12967
|
VITE_MULTIPLEX_SOCKET_PATH: ""
|
|
@@ -12953,7 +12953,7 @@ let Hr = class {
|
|
|
12953
12953
|
this.runtimeConfig = Eb.parse(e), this.appConfig = Tb.parse({
|
|
12954
12954
|
VITE_INJECT_AGIFLOW_APP_ENDPOINT: "https://agiflow.io",
|
|
12955
12955
|
VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT: "https://agiflow.io",
|
|
12956
|
-
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.
|
|
12956
|
+
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.15",
|
|
12957
12957
|
VITE_AGENT_CLI_DOCKER_NETWORK: "",
|
|
12958
12958
|
VITE_SAVE_RAW: "",
|
|
12959
12959
|
VITE_MULTIPLEX_SOCKET_PATH: ""
|
package/dist/claudePreToolUse.js
CHANGED
|
@@ -12881,7 +12881,7 @@ let Jr = class {
|
|
|
12881
12881
|
this.runtimeConfig = Ib.parse(e), this.appConfig = zb.parse({
|
|
12882
12882
|
VITE_INJECT_AGIFLOW_APP_ENDPOINT: "https://agiflow.io",
|
|
12883
12883
|
VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT: "https://agiflow.io",
|
|
12884
|
-
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.
|
|
12884
|
+
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.15",
|
|
12885
12885
|
VITE_AGENT_CLI_DOCKER_NETWORK: "",
|
|
12886
12886
|
VITE_SAVE_RAW: "",
|
|
12887
12887
|
VITE_MULTIPLEX_SOCKET_PATH: ""
|
package/dist/claudeSessionEnd.js
CHANGED
|
@@ -12881,7 +12881,7 @@ let Gr = class {
|
|
|
12881
12881
|
this.runtimeConfig = Sb.parse(e), this.appConfig = kb.parse({
|
|
12882
12882
|
VITE_INJECT_AGIFLOW_APP_ENDPOINT: "https://agiflow.io",
|
|
12883
12883
|
VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT: "https://agiflow.io",
|
|
12884
|
-
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.
|
|
12884
|
+
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.15",
|
|
12885
12885
|
VITE_AGENT_CLI_DOCKER_NETWORK: "",
|
|
12886
12886
|
VITE_SAVE_RAW: "",
|
|
12887
12887
|
VITE_MULTIPLEX_SOCKET_PATH: ""
|
|
@@ -12961,7 +12961,7 @@ let Hr = class {
|
|
|
12961
12961
|
this.runtimeConfig = Tb.parse(e), this.appConfig = Db.parse({
|
|
12962
12962
|
VITE_INJECT_AGIFLOW_APP_ENDPOINT: "https://agiflow.io",
|
|
12963
12963
|
VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT: "https://agiflow.io",
|
|
12964
|
-
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.
|
|
12964
|
+
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.15",
|
|
12965
12965
|
VITE_AGENT_CLI_DOCKER_NETWORK: "",
|
|
12966
12966
|
VITE_SAVE_RAW: "",
|
|
12967
12967
|
VITE_MULTIPLEX_SOCKET_PATH: ""
|
package/dist/claudeStop.js
CHANGED
|
@@ -12955,7 +12955,7 @@ let Hr = class {
|
|
|
12955
12955
|
this.runtimeConfig = zb.parse(e), this.appConfig = xb.parse({
|
|
12956
12956
|
VITE_INJECT_AGIFLOW_APP_ENDPOINT: "https://agiflow.io",
|
|
12957
12957
|
VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT: "https://agiflow.io",
|
|
12958
|
-
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.
|
|
12958
|
+
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.15",
|
|
12959
12959
|
VITE_AGENT_CLI_DOCKER_NETWORK: "",
|
|
12960
12960
|
VITE_SAVE_RAW: "",
|
|
12961
12961
|
VITE_MULTIPLEX_SOCKET_PATH: ""
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { bx as z,
|
|
2
|
+
import { bx as z, bl as H, by as P, bm as M } from "./index-BTFqCNWK.mjs";
|
|
3
3
|
import Q from "node:events";
|
|
4
4
|
import X from "node:child_process";
|
|
5
5
|
import Z from "node:path";
|
package/dist/daemon.js
CHANGED
|
@@ -1,87 +1,92 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import { bj as f, bk as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
import { useDispatch as de, useSelector as
|
|
5
|
-
import P, { useRef as
|
|
2
|
+
import { bj as f, bk as Y, bl as A, bm as D, bn as $, bo as X, bp as H, bq as J, br as Z, bs as ee, bt as re, bu as ne, bv as oe, bw as ie } from "./index-BTFqCNWK.mjs";
|
|
3
|
+
import { useQueryClient as U, useQuery as te, useMutation as q, QueryClientProvider as ce, QueryClient as le } from "@tanstack/react-query";
|
|
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 B, useState as y, useCallback as ue, useMemo as he } from "react";
|
|
6
6
|
const ge = ({ children: t }) => {
|
|
7
|
-
const { Box: n, Text: r } = f(), c = de(), d =
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
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 B(() => {
|
|
9
|
+
l === "error" && (async () => {
|
|
10
|
+
const p = await A.get(D.CredentialsService).load();
|
|
11
|
+
(!p || !p.apiKey) && d.invalidateQueries({ queryKey: ["auth", "check"] });
|
|
12
|
+
})();
|
|
13
|
+
}, [l, d]), B(() => (c(Y()), $(async () => {
|
|
14
|
+
if (!g.current) {
|
|
15
|
+
g.current = !0;
|
|
11
16
|
try {
|
|
12
|
-
const
|
|
13
|
-
|
|
17
|
+
const x = A.get(D.DaemonManager);
|
|
18
|
+
x.isRunning() && await x.stop();
|
|
14
19
|
} catch {
|
|
15
20
|
}
|
|
16
21
|
}
|
|
17
22
|
}), () => {
|
|
18
|
-
|
|
19
|
-
}), [c]),
|
|
23
|
+
X();
|
|
24
|
+
}), [c]), l === "starting" ? /* @__PURE__ */ e(n, { flexDirection: "column", padding: 1, children: /* @__PURE__ */ e(r, { color: "yellow", children: "Connecting to Agiflow..." }) }) : l === "error" ? /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "red", children: [
|
|
20
25
|
/* @__PURE__ */ e(r, { color: "red", bold: !0, children: "Connection Error" }),
|
|
21
|
-
/* @__PURE__ */ e(r, { children:
|
|
26
|
+
/* @__PURE__ */ e(r, { children: u }),
|
|
22
27
|
/* @__PURE__ */ e(r, { dimColor: !0, children: "Retrying in background..." })
|
|
23
|
-
] }) :
|
|
28
|
+
] }) : l === "connected" ? /* @__PURE__ */ e(F, { children: t }) : null;
|
|
24
29
|
}, me = ({ children: t }) => {
|
|
25
|
-
const { Box: n, Text: r, Newline: c, Static: d, Link: l, useInput:
|
|
30
|
+
const { Box: n, Text: r, Newline: c, Static: d, Link: l, useInput: u } = f(), g = U(), [s, x] = y(null), [p, Q] = y(null), [v, N] = y([]), [C, O] = y(0), [b, m] = y("checking"), [j, k] = y(""), E = R(null), T = A.get(D.DeviceCodeAuthService), L = A.get(D.CredentialsService), { data: I, isLoading: z } = te({
|
|
26
31
|
queryKey: ["auth", "check"],
|
|
27
32
|
queryFn: async () => {
|
|
28
|
-
const o = await
|
|
29
|
-
return o && o.apiKey && o.expiresAt &&
|
|
33
|
+
const o = await L.load();
|
|
34
|
+
return o && o.apiKey && o.expiresAt && T.isTokenValid(o.expiresAt) ? { authenticated: !0 } : { authenticated: !1 };
|
|
30
35
|
},
|
|
31
36
|
retry: !1
|
|
32
|
-
}),
|
|
33
|
-
mutationFn: async () => (m("requesting_code"),
|
|
37
|
+
}), w = q({
|
|
38
|
+
mutationFn: async () => (m("requesting_code"), T.requestDeviceCode("openid profile email")),
|
|
34
39
|
onSuccess: (o) => {
|
|
35
|
-
|
|
40
|
+
x(o), m("polling"), M.mutate(o);
|
|
36
41
|
},
|
|
37
42
|
onError: (o) => {
|
|
38
|
-
m("error"),
|
|
43
|
+
m("error"), k(o instanceof Error ? o.message : "Failed to request device code");
|
|
39
44
|
}
|
|
40
|
-
}),
|
|
45
|
+
}), M = q({
|
|
41
46
|
mutationFn: async (o) => {
|
|
42
|
-
|
|
43
|
-
const a = await
|
|
44
|
-
signal:
|
|
45
|
-
}),
|
|
46
|
-
return { accessToken: a.access_token, organizations:
|
|
47
|
+
E.current = new AbortController();
|
|
48
|
+
const a = await T.pollForToken(o.device_code, o.interval || 5, {
|
|
49
|
+
signal: E.current.signal
|
|
50
|
+
}), S = await T.listOrganizations(a.access_token);
|
|
51
|
+
return { accessToken: a.access_token, organizations: S };
|
|
47
52
|
},
|
|
48
53
|
onSuccess: (o) => {
|
|
49
|
-
|
|
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");
|
|
50
55
|
},
|
|
51
56
|
onError: (o) => {
|
|
52
|
-
m("error"),
|
|
57
|
+
m("error"), k(o instanceof Error ? o.message : "Failed to poll for token");
|
|
53
58
|
}
|
|
54
|
-
}),
|
|
55
|
-
mutationFn: async ({ accessToken: o, organizationId: a }) => (m("exchanging"),
|
|
59
|
+
}), _ = q({
|
|
60
|
+
mutationFn: async ({ accessToken: o, organizationId: a }) => (m("exchanging"), T.exchangeForAgentApiKey(o, a)),
|
|
56
61
|
onSuccess: async (o) => {
|
|
57
|
-
await
|
|
62
|
+
await L.setApiKey({
|
|
58
63
|
apiKey: o.api_key,
|
|
59
64
|
organizationId: o.organization_id,
|
|
60
65
|
expiresAt: o.expires_at,
|
|
61
66
|
deviceId: o.device_id
|
|
62
|
-
}), m("authenticated"),
|
|
67
|
+
}), m("authenticated"), g.invalidateQueries({ queryKey: ["auth", "check"] });
|
|
63
68
|
},
|
|
64
69
|
onError: (o) => {
|
|
65
|
-
m("error"),
|
|
70
|
+
m("error"), k(o instanceof Error ? o.message : "Failed to exchange for agent API key");
|
|
66
71
|
}
|
|
67
|
-
}),
|
|
68
|
-
|
|
69
|
-
accessToken:
|
|
70
|
-
organizationId:
|
|
72
|
+
}), V = ue(() => {
|
|
73
|
+
p && v[C] && _.mutate({
|
|
74
|
+
accessToken: p,
|
|
75
|
+
organizationId: v[C].id
|
|
71
76
|
});
|
|
72
|
-
}, [
|
|
73
|
-
if (
|
|
77
|
+
}, [p, v, C, _]);
|
|
78
|
+
if (u(
|
|
74
79
|
(o, a) => {
|
|
75
|
-
b === "selecting_org" && (a.upArrow ? O((
|
|
80
|
+
b === "selecting_org" && (a.upArrow ? O((S) => Math.max(0, S - 1)) : a.downArrow ? O((S) => Math.min(v.length - 1, S + 1)) : a.return && V());
|
|
76
81
|
},
|
|
77
82
|
{ isActive: b === "selecting_org" }
|
|
78
|
-
),
|
|
79
|
-
|
|
80
|
-
}, []),
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
+
), B(() => () => {
|
|
84
|
+
E.current?.abort();
|
|
85
|
+
}, []), B(() => {
|
|
86
|
+
I && !I.authenticated && b === "checking" && !z && w.mutate();
|
|
87
|
+
}, [I, b, z, w]), I?.authenticated)
|
|
83
88
|
return /* @__PURE__ */ e(F, { children: t({ isAuthenticated: !0 }) });
|
|
84
|
-
if (
|
|
89
|
+
if (z)
|
|
85
90
|
return /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
|
|
86
91
|
/* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }) }),
|
|
87
92
|
/* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ e(n, { flexDirection: "column", children: /* @__PURE__ */ i(r, { children: [
|
|
@@ -89,7 +94,7 @@ const ge = ({ children: t }) => {
|
|
|
89
94
|
/* @__PURE__ */ e(r, { children: "Checking existing credentials..." })
|
|
90
95
|
] }) }) })
|
|
91
96
|
] });
|
|
92
|
-
if (
|
|
97
|
+
if (w.isPending)
|
|
93
98
|
return /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
|
|
94
99
|
/* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }) }),
|
|
95
100
|
/* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "cyan", padding: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
|
|
@@ -103,8 +108,8 @@ const ge = ({ children: t }) => {
|
|
|
103
108
|
] })
|
|
104
109
|
] }) })
|
|
105
110
|
] });
|
|
106
|
-
if (
|
|
107
|
-
const o = `${
|
|
111
|
+
if (s && b === "polling") {
|
|
112
|
+
const o = `${s.verification_uri}?code=${encodeURIComponent(s.user_code)}`;
|
|
108
113
|
return /* @__PURE__ */ e(d, { items: [1], children: () => /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
|
|
109
114
|
/* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "cyan", children: "🔐 Agiflow Authentication" }) }),
|
|
110
115
|
/* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "green", padding: 1, marginBottom: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
|
|
@@ -139,7 +144,7 @@ const ge = ({ children: t }) => {
|
|
|
139
144
|
] }),
|
|
140
145
|
/* @__PURE__ */ e(r, { children: "Enter this verification code:" })
|
|
141
146
|
] }),
|
|
142
|
-
/* @__PURE__ */ e(n, { paddingLeft: 3, marginBottom: 1, borderStyle: "single", borderColor: "green", paddingX: 2, children: /* @__PURE__ */ e(r, { color: "green", bold: !0, children:
|
|
147
|
+
/* @__PURE__ */ e(n, { paddingLeft: 3, marginBottom: 1, borderStyle: "single", borderColor: "green", paddingX: 2, children: /* @__PURE__ */ e(r, { color: "green", bold: !0, children: s.user_code }) }),
|
|
143
148
|
/* @__PURE__ */ i(r, { children: [
|
|
144
149
|
/* @__PURE__ */ i(r, { bold: !0, color: "cyan", children: [
|
|
145
150
|
"3.",
|
|
@@ -153,7 +158,7 @@ const ge = ({ children: t }) => {
|
|
|
153
158
|
/* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "gray", padding: 1, marginBottom: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
|
|
154
159
|
/* @__PURE__ */ i(r, { dimColor: !0, children: [
|
|
155
160
|
"⏱️ Expires in: ",
|
|
156
|
-
Math.floor(
|
|
161
|
+
Math.floor(s.expires_in / 60),
|
|
157
162
|
" minutes"
|
|
158
163
|
] }),
|
|
159
164
|
/* @__PURE__ */ e(r, { dimColor: !0, children: "💡 Tip: The URL includes your verification code for convenience" })
|
|
@@ -176,9 +181,9 @@ const ge = ({ children: t }) => {
|
|
|
176
181
|
/* @__PURE__ */ e(n, { borderStyle: "double", borderColor: "yellow", padding: 1, marginBottom: 1, children: /* @__PURE__ */ i(n, { flexDirection: "column", children: [
|
|
177
182
|
/* @__PURE__ */ e(r, { bold: !0, color: "yellow", children: "📋 Select Organization:" }),
|
|
178
183
|
/* @__PURE__ */ e(c, {}),
|
|
179
|
-
|
|
180
|
-
/* @__PURE__ */ e(r, { color: a ===
|
|
181
|
-
/* @__PURE__ */ e(r, { bold: a ===
|
|
184
|
+
v.map((o, a) => /* @__PURE__ */ i(r, { children: [
|
|
185
|
+
/* @__PURE__ */ e(r, { color: a === C ? "green" : "gray", children: a === C ? "❯ " : " " }),
|
|
186
|
+
/* @__PURE__ */ e(r, { bold: a === C, children: o.name }),
|
|
182
187
|
/* @__PURE__ */ i(r, { dimColor: !0, children: [
|
|
183
188
|
" (",
|
|
184
189
|
o.slug,
|
|
@@ -207,8 +212,8 @@ const ge = ({ children: t }) => {
|
|
|
207
212
|
] })
|
|
208
213
|
] }) })
|
|
209
214
|
] });
|
|
210
|
-
if (b === "error" ||
|
|
211
|
-
const o =
|
|
215
|
+
if (b === "error" || w.isError || M.isError) {
|
|
216
|
+
const o = w.error || M.error, a = j || o?.message || "Unknown error occurred";
|
|
212
217
|
return /* @__PURE__ */ i(n, { flexDirection: "column", padding: 1, children: [
|
|
213
218
|
/* @__PURE__ */ e(n, { marginBottom: 1, children: /* @__PURE__ */ e(r, { bold: !0, color: "red", children: "❌ Authentication Error" }) }),
|
|
214
219
|
/* @__PURE__ */ e(n, { borderStyle: "round", borderColor: "red", padding: 1, marginBottom: 1, children: /* @__PURE__ */ e(r, { color: "red", children: a }) }),
|
|
@@ -224,59 +229,59 @@ const ge = ({ children: t }) => {
|
|
|
224
229
|
] });
|
|
225
230
|
}
|
|
226
231
|
return null;
|
|
227
|
-
}, be = process.platform === "darwin",
|
|
228
|
-
const n =
|
|
232
|
+
}, be = process.platform === "darwin", W = P.memo(({ tabId: t }) => {
|
|
233
|
+
const n = h((c) => c.agentTabs.tabs.find((d) => d.id === t)?.unreadCount), r = h((c) => c.agentTabs.activeTabId === t);
|
|
229
234
|
return !n || n <= 0 || r ? null : /* @__PURE__ */ i(F, { children: [
|
|
230
235
|
" (",
|
|
231
236
|
n,
|
|
232
237
|
")"
|
|
233
238
|
] });
|
|
234
239
|
});
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
const { Text: n } = f(), r =
|
|
240
|
+
W.displayName = "UnreadCount";
|
|
241
|
+
const G = P.memo(({ tabId: t }) => {
|
|
242
|
+
const { Text: n } = f(), r = h(
|
|
238
243
|
(d) => d.agentTabs.tabs.find((l) => l.id === t)?.waitingInput
|
|
239
|
-
), c =
|
|
244
|
+
), c = h((d) => d.agentTabs.activeTabId === t);
|
|
240
245
|
return !r || c ? null : /* @__PURE__ */ e(n, { color: "red", children: "● " });
|
|
241
246
|
});
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
const { Box: r, Text: c } = f(), d =
|
|
247
|
+
G.displayName = "WaitingInputIndicator";
|
|
248
|
+
const K = P.memo(({ tabId: t, index: n }) => {
|
|
249
|
+
const { Box: r, Text: c } = f(), d = h((g) => g.agentTabs.tabs.find((s) => s.id === t)?.label), l = h((g) => g.agentTabs.activeTabId === t), u = `^F${n + 1}`;
|
|
245
250
|
return /* @__PURE__ */ i(r, { marginRight: 2, borderStyle: l ? "round" : void 0, children: [
|
|
246
|
-
/* @__PURE__ */ e(
|
|
251
|
+
/* @__PURE__ */ e(G, { tabId: t }),
|
|
247
252
|
/* @__PURE__ */ i(c, { color: "#d1d5db", bold: l, dimColor: !l, children: [
|
|
248
253
|
"[",
|
|
249
|
-
|
|
254
|
+
u,
|
|
250
255
|
"] ",
|
|
251
256
|
d,
|
|
252
|
-
/* @__PURE__ */ e(
|
|
257
|
+
/* @__PURE__ */ e(W, { tabId: t })
|
|
253
258
|
] }),
|
|
254
|
-
/* @__PURE__ */ e(
|
|
259
|
+
/* @__PURE__ */ e(J, { tabId: t })
|
|
255
260
|
] });
|
|
256
261
|
});
|
|
257
|
-
|
|
262
|
+
K.displayName = "TabItem";
|
|
258
263
|
const fe = () => {
|
|
259
|
-
const { Box: t, Text: n } = f(), r =
|
|
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(() => {
|
|
260
265
|
if (!c) return null;
|
|
261
266
|
try {
|
|
262
|
-
const
|
|
263
|
-
if (
|
|
264
|
-
return
|
|
267
|
+
const u = A.get(D.AgentManager).getAgentContainer(c);
|
|
268
|
+
if (u)
|
|
269
|
+
return u.get(H.AgentConfigService).getEffectiveWorkingDir();
|
|
265
270
|
} catch {
|
|
266
271
|
}
|
|
267
272
|
return process.cwd();
|
|
268
273
|
}, [c]);
|
|
269
274
|
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,
|
|
275
|
+
/* @__PURE__ */ e(t, { alignItems: "center", borderTop: !0, borderTopColor: "#d1d5db", borderDimColor: !0, children: r.map((l, u) => /* @__PURE__ */ e(K, { tabId: l, index: u }, l)) }),
|
|
271
276
|
d && /* @__PURE__ */ e(n, { dimColor: !0, children: d }),
|
|
272
277
|
be && /* @__PURE__ */ e(n, { dimColor: !0, children: "Press fn + Shift + F[num] to switch tabs" })
|
|
273
278
|
] });
|
|
274
279
|
}, pe = () => {
|
|
275
|
-
const { Box: t } = f(), n =
|
|
280
|
+
const { Box: t } = f(), n = h((r) => r.agentTabs.activeTabId);
|
|
276
281
|
return /* @__PURE__ */ i(t, { flexDirection: "column", flexGrow: 1, children: [
|
|
277
|
-
/* @__PURE__ */ e(
|
|
278
|
-
/* @__PURE__ */ e(
|
|
279
|
-
/* @__PURE__ */ e(
|
|
282
|
+
/* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(ee, {}, n) }),
|
|
283
|
+
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(fe, {}) }),
|
|
284
|
+
/* @__PURE__ */ e(ne, {})
|
|
280
285
|
] });
|
|
281
286
|
}, Ce = () => {
|
|
282
287
|
const { Box: t, Text: n } = f();
|
|
@@ -310,9 +315,9 @@ const fe = () => {
|
|
|
310
315
|
}
|
|
311
316
|
}
|
|
312
317
|
}), xe = () => {
|
|
313
|
-
const { Box: t } = f(), r =
|
|
318
|
+
const { Box: t } = f(), r = h((c) => c.agentTabs.tabs).length > 0;
|
|
314
319
|
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(
|
|
320
|
+
}, ve = () => /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(se, { store: ie, children: /* @__PURE__ */ e(ce, { client: ye, children: /* @__PURE__ */ e(xe, {}) }) }) }), ke = async () => {
|
|
316
321
|
const { render: t } = await import("ink"), { waitUntilExit: n } = t(/* @__PURE__ */ e(ve, {}), {
|
|
317
322
|
stdin: process.stdin,
|
|
318
323
|
stdout: process.stdout,
|