@agiflowai/agent-cli 0.2.19 → 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 CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.20
4
+ - Fix error handling on API key expired.
5
+
3
6
  ## 0.2.19
4
7
  - Fix missing environment variable.
5
8
 
@@ -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.14",
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.14",
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.14",
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: ""
@@ -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.14",
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: ""
@@ -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.14",
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.14",
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: ""
@@ -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.14",
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, bn as H, by as P, bo as M } from "./index-oo6DLQ9J.mjs";
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 V, bl as Y, bm as $, bn as S, bo as D, bp as X, bq as H, br as J, bs as Z, bt as ee, bu as re, bv as ne, bw as oe } from "./index-oo6DLQ9J.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";
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 = 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;
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 g = S.get(D.DaemonManager);
13
- g.isRunning() && await g.stop();
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]), 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: [
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: l }),
26
+ /* @__PURE__ */ e(r, { children: u }),
22
27
  /* @__PURE__ */ e(r, { dimColor: !0, children: "Retrying in background..." })
23
- ] }) : d === "connected" ? /* @__PURE__ */ e(F, { children: t }) : null;
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: s } = f(), h = ie(), [g, G] = C(null), [k, N] = C(null), [y, Q] = C([]), [p, O] = C(0), [b, m] = C("checking"), [j, w] = C(""), I = L(null), x = S.get(D.DeviceCodeAuthService), q = S.get(D.CredentialsService), { data: A, isLoading: B } = te({
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 q.load();
29
- return o && o.apiKey && o.expiresAt && x.isTokenValid(o.expiresAt) ? { authenticated: !0 } : { authenticated: !1 };
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
- }), v = M({
33
- mutationFn: async () => (m("requesting_code"), x.requestDeviceCode("openid profile email")),
37
+ }), w = q({
38
+ mutationFn: async () => (m("requesting_code"), T.requestDeviceCode("openid profile email")),
34
39
  onSuccess: (o) => {
35
- G(o), m("polling"), E.mutate(o);
40
+ x(o), m("polling"), M.mutate(o);
36
41
  },
37
42
  onError: (o) => {
38
- m("error"), w(o instanceof Error ? o.message : "Failed to request device code");
43
+ m("error"), k(o instanceof Error ? o.message : "Failed to request device code");
39
44
  }
40
- }), E = M({
45
+ }), M = q({
41
46
  mutationFn: async (o) => {
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 };
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
- N(o.accessToken), Q(o.organizations), o.organizations.length === 0 ? (m("error"), w("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");
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"), w(o instanceof Error ? o.message : "Failed to poll for token");
57
+ m("error"), k(o instanceof Error ? o.message : "Failed to poll for token");
53
58
  }
54
- }), z = M({
55
- mutationFn: async ({ accessToken: o, organizationId: a }) => (m("exchanging"), x.exchangeForAgentApiKey(o, a)),
59
+ }), _ = q({
60
+ mutationFn: async ({ accessToken: o, organizationId: a }) => (m("exchanging"), T.exchangeForAgentApiKey(o, a)),
56
61
  onSuccess: async (o) => {
57
- await q.setApiKey({
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"), h.invalidateQueries({ queryKey: ["auth", "check"] });
67
+ }), m("authenticated"), g.invalidateQueries({ queryKey: ["auth", "check"] });
63
68
  },
64
69
  onError: (o) => {
65
- m("error"), w(o instanceof Error ? o.message : "Failed to exchange for agent API key");
70
+ m("error"), k(o instanceof Error ? o.message : "Failed to exchange for agent API key");
66
71
  }
67
- }), K = ue(() => {
68
- k && y[p] && z.mutate({
69
- accessToken: k,
70
- organizationId: y[p].id
72
+ }), V = ue(() => {
73
+ p && v[C] && _.mutate({
74
+ accessToken: p,
75
+ organizationId: v[C].id
71
76
  });
72
- }, [k, y, p, z]);
73
- if (s(
77
+ }, [p, v, C, _]);
78
+ if (u(
74
79
  (o, a) => {
75
- b === "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());
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
- I.current?.abort();
80
- }, []), _(() => {
81
- A && !A.authenticated && b === "checking" && !B && v.mutate();
82
- }, [A, b, B, v]), A?.authenticated)
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 (B)
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 (v.isPending)
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 (g && b === "polling") {
107
- const o = `${g.verification_uri}?code=${encodeURIComponent(g.user_code)}`;
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: g.user_code }) }),
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(g.expires_in / 60),
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
- 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 }),
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" || v.isError || E.isError) {
211
- const o = v.error || E.error, a = j || o?.message || "Unknown error occurred";
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", 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);
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
- U.displayName = "UnreadCount";
236
- const R = P.memo(({ tabId: t }) => {
237
- const { Text: n } = f(), r = u(
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 = u((d) => d.agentTabs.activeTabId === t);
244
+ ), c = h((d) => d.agentTabs.activeTabId === t);
240
245
  return !r || c ? null : /* @__PURE__ */ e(n, { color: "red", children: "● " });
241
246
  });
242
- R.displayName = "WaitingInputIndicator";
243
- const W = P.memo(({ tabId: t, index: n }) => {
244
- const { Box: r, Text: c } = f(), d = u((h) => h.agentTabs.tabs.find((g) => g.id === t)?.label), l = u((h) => h.agentTabs.activeTabId === t), s = `^F${n + 1}`;
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(R, { tabId: t }),
251
+ /* @__PURE__ */ e(G, { tabId: t }),
247
252
  /* @__PURE__ */ i(c, { color: "#d1d5db", bold: l, dimColor: !l, children: [
248
253
  "[",
249
- s,
254
+ u,
250
255
  "] ",
251
256
  d,
252
- /* @__PURE__ */ e(U, { tabId: t })
257
+ /* @__PURE__ */ e(W, { tabId: t })
253
258
  ] }),
254
- /* @__PURE__ */ e(H, { tabId: t })
259
+ /* @__PURE__ */ e(J, { tabId: t })
255
260
  ] });
256
261
  });
257
- W.displayName = "TabItem";
262
+ K.displayName = "TabItem";
258
263
  const fe = () => {
259
- const { Box: t, Text: n } = f(), r = u((l) => l.agentTabs.tabs.map((s) => s.id), ae), c = u((l) => l.agentTabs.activeTabId), d = he(() => {
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 s = S.get(D.AgentManager).getAgentContainer(c);
263
- if (s)
264
- return s.get(X.AgentConfigService).getEffectiveWorkingDir();
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, s) => /* @__PURE__ */ e(W, { tabId: l, index: s }, 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 = u((r) => r.agentTabs.activeTabId);
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(J, { children: /* @__PURE__ */ e(Z, {}, n) }),
278
- /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(fe, {}) }),
279
- /* @__PURE__ */ e(re, {})
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 = u((c) => c.agentTabs.tabs).length > 0;
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(ne, { children: /* @__PURE__ */ e(se, { store: oe, children: /* @__PURE__ */ e(ce, { client: ye, children: /* @__PURE__ */ e(xe, {}) }) }) }), ke = async () => {
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,