@hearsay-tools/squawk 0.18.0-pr4329.8416 → 0.18.0-pr4330.8417

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.
Files changed (50) hide show
  1. package/dist/server/activity-routes.d.ts +23 -23
  2. package/dist/server/models-routes.d.ts +12 -12
  3. package/dist/server/providers-routes.d.ts +57 -57
  4. package/dist/server/repo-routes.d.ts +34 -34
  5. package/dist/server/reports-api.d.ts +2 -2
  6. package/dist/server/server.d.ts +58 -58
  7. package/dist/server/workspace-routes.d.ts +84 -84
  8. package/package.json +4 -4
  9. package/web/dist/assets/{accounts-section-DRvXECWe.js → accounts-section-DHmSLzpZ.js} +1 -1
  10. package/web/dist/assets/{activity-motion-sMBzLFB5.js → activity-motion-2GCO1zPd.js} +1 -1
  11. package/web/dist/assets/{activity-route-BGBcSk3x.js → activity-route-D9OAFNC4.js} +1 -1
  12. package/web/dist/assets/{agent-config-section-D1l-te0K.js → agent-config-section-Wotj8Dle.js} +1 -1
  13. package/web/dist/assets/{agent-defaults-section-BtFNaqXv.js → agent-defaults-section-DoGSC8-l.js} +1 -1
  14. package/web/dist/assets/{appearance-CVNPBV43.js → appearance-CjYdasRV.js} +1 -1
  15. package/web/dist/assets/{automations-route-CBjMJSRk.js → automations-route-BGkbQHSY.js} +1 -1
  16. package/web/dist/assets/{commit-diff-panel-D9dSOat1.js → commit-diff-panel-TrS_9ZM-.js} +1 -1
  17. package/web/dist/assets/{diff-D9_jdHNO.js → diff-DFiqumpD.js} +2 -2
  18. package/web/dist/assets/{diff-view-1_1pbWaA.js → diff-view-ta--6GkY.js} +1 -1
  19. package/web/dist/assets/{file-preview-DBLoHX-T.js → file-preview-B36Gbav6.js} +1 -1
  20. package/web/dist/assets/{git-toolbar-BCfVXip8.js → git-toolbar-BNNUwJJs.js} +1 -1
  21. package/web/dist/assets/{github-DbXMCvUR.js → github-C8PMPaH6.js} +1 -1
  22. package/web/dist/assets/{global-activity-route-CPsmPpEA.js → global-activity-route-BQr9uGTO.js} +1 -1
  23. package/web/dist/assets/{index-CGN3vFr8.js → index-D1QQrINC.js} +4 -4
  24. package/web/dist/assets/{markdown-DkV43aZB.js → markdown-BfwPX6zK.js} +3 -3
  25. package/web/dist/assets/{notifications-section-DYLtkl3w.js → notifications-section-COEMkxHJ.js} +1 -1
  26. package/web/dist/assets/{preview-pane-connected-D5wt4xz9.js → preview-pane-connected-kNT-A-Jg.js} +1 -1
  27. package/web/dist/assets/{projects-section-IgjbpxOG.js → projects-section-CBj6vwf8.js} +1 -1
  28. package/web/dist/assets/{prompt-templates-section-CrSWFTMN.js → prompt-templates-section-BGrB-hAd.js} +1 -1
  29. package/web/dist/assets/{remote-settings-notice-BiR9_90x.js → remote-settings-notice-7_VwBQzk.js} +1 -1
  30. package/web/dist/assets/{repo-git-C8Dgl0yB.js → repo-git-DvAIHL6M.js} +1 -1
  31. package/web/dist/assets/{report-reader-0igidIuT.js → report-reader-DpjS4XhI.js} +1 -1
  32. package/web/dist/assets/{reports-CvmO3tQ0.js → reports-BQcrO827.js} +1 -1
  33. package/web/dist/assets/{resources-section-ByIGobW9.js → resources-section-BHffEkFe.js} +1 -1
  34. package/web/dist/assets/{run-header-D71QloKE.js → run-header-B_bLMg9k.js} +1 -1
  35. package/web/dist/assets/{settings-agent-picker-Cpb_WqeU.js → settings-agent-picker-BI2-f3Kb.js} +1 -1
  36. package/web/dist/assets/{settings-shell-DNYCNI_o.js → settings-shell-DvjX61XY.js} +1 -1
  37. package/web/dist/assets/{sidebar-section-TDrWXs7N.js → sidebar-section-B5CsLxD-.js} +1 -1
  38. package/web/dist/assets/{skills-BeJ400g2.js → skills-DqCRIjHs.js} +1 -1
  39. package/web/dist/assets/{task-changes-BeqwOcK9.js → task-changes-rrNeqY-D.js} +1 -1
  40. package/web/dist/assets/{task-commits-c7LHkDiV.js → task-commits-BAblnosS.js} +1 -1
  41. package/web/dist/assets/{task-files-DdUioX7S.js → task-files-BZeFS-W2.js} +1 -1
  42. package/web/dist/assets/{task-github-item-CA1K7ipr.js → task-github-item-DNxKyv2r.js} +1 -1
  43. package/web/dist/assets/{task-thread-MYlUw6m3.js → task-thread-DtukKFDA.js} +9 -9
  44. package/web/dist/assets/thread-state-Cxpoqerm.js +4 -0
  45. package/web/dist/assets/{use-hand-to-agent-state-ekgFSmTK.js → use-hand-to-agent-state-DO9N-GHI.js} +1 -1
  46. package/web/dist/assets/{workflows-CUMHGav7.js → workflows-DGCLHeMT.js} +1 -1
  47. package/web/dist/assets/{workspace-tools-Bee6WFE3.js → workspace-tools-BiLzhtEl.js} +1 -1
  48. package/web/dist/assets/{worktrees-section-D6x1MIqH.js → worktrees-section-XX-F-oR7.js} +1 -1
  49. package/web/dist/index.html +1 -1
  50. package/web/dist/assets/thread-state-CSz2QE0e.js +0 -4
@@ -4609,19 +4609,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4609
4609
  } & {
4610
4610
  "/repo/commit/:sha": {
4611
4611
  $get: {
4612
- output: string;
4613
- outputFormat: "text";
4614
- status: import("hono/utils/http-status").ContentfulStatusCode;
4615
- input: {
4616
- query: {
4617
- structured?: string | undefined;
4618
- };
4619
- } & {
4620
- param: {
4621
- sha: string;
4622
- };
4623
- };
4624
- } | {
4625
4612
  output: {
4626
4613
  error: string;
4627
4614
  code?: "invalid_input" | undefined;
@@ -4685,6 +4672,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4685
4672
  sha: string;
4686
4673
  };
4687
4674
  };
4675
+ } | {
4676
+ output: string;
4677
+ outputFormat: "text";
4678
+ status: import("hono/utils/http-status").ContentfulStatusCode;
4679
+ input: {
4680
+ query: {
4681
+ structured?: string | undefined;
4682
+ };
4683
+ } & {
4684
+ param: {
4685
+ sha: string;
4686
+ };
4687
+ };
4688
4688
  };
4689
4689
  };
4690
4690
  } & {
@@ -19152,20 +19152,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
19152
19152
  } & {
19153
19153
  "/runs/:id/handoff": {
19154
19154
  $get: {
19155
- output: string;
19156
- outputFormat: "text";
19157
- status: 200;
19155
+ output: {
19156
+ error: string;
19157
+ };
19158
+ outputFormat: "json";
19159
+ status: 404;
19158
19160
  input: {
19159
19161
  param: {
19160
19162
  id: string;
19161
19163
  };
19162
19164
  };
19163
19165
  } | {
19164
- output: {
19165
- error: string;
19166
- };
19167
- outputFormat: "json";
19168
- status: 404;
19166
+ output: string;
19167
+ outputFormat: "text";
19168
+ status: 200;
19169
19169
  input: {
19170
19170
  param: {
19171
19171
  id: string;
@@ -19203,20 +19203,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
19203
19203
  } & {
19204
19204
  "/runs/:id/diff": {
19205
19205
  $get: {
19206
- output: string;
19207
- outputFormat: "text";
19208
- status: import("hono/utils/http-status").ContentfulStatusCode;
19206
+ output: {
19207
+ error: string;
19208
+ };
19209
+ outputFormat: "json";
19210
+ status: 404 | 409;
19209
19211
  input: {
19210
19212
  param: {
19211
19213
  id: string;
19212
19214
  };
19213
19215
  };
19214
19216
  } | {
19215
- output: {
19216
- error: string;
19217
- };
19218
- outputFormat: "json";
19219
- status: 404 | 409;
19217
+ output: string;
19218
+ outputFormat: "text";
19219
+ status: import("hono/utils/http-status").ContentfulStatusCode;
19220
19220
  input: {
19221
19221
  param: {
19222
19222
  id: string;
@@ -21250,19 +21250,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
21250
21250
  } & {
21251
21251
  "/repo/commit/:sha": {
21252
21252
  $get: {
21253
- output: string;
21254
- outputFormat: "text";
21255
- status: import("hono/utils/http-status").ContentfulStatusCode;
21256
- input: {
21257
- query: {
21258
- structured?: string | undefined;
21259
- };
21260
- } & {
21261
- param: {
21262
- sha: string;
21263
- };
21264
- };
21265
- } | {
21266
21253
  output: {
21267
21254
  error: string;
21268
21255
  code?: "invalid_input" | undefined;
@@ -21326,6 +21313,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
21326
21313
  sha: string;
21327
21314
  };
21328
21315
  };
21316
+ } | {
21317
+ output: string;
21318
+ outputFormat: "text";
21319
+ status: import("hono/utils/http-status").ContentfulStatusCode;
21320
+ input: {
21321
+ query: {
21322
+ structured?: string | undefined;
21323
+ };
21324
+ } & {
21325
+ param: {
21326
+ sha: string;
21327
+ };
21328
+ };
21329
21329
  };
21330
21330
  };
21331
21331
  } & {
@@ -35793,20 +35793,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
35793
35793
  } & {
35794
35794
  "/runs/:id/handoff": {
35795
35795
  $get: {
35796
- output: string;
35797
- outputFormat: "text";
35798
- status: 200;
35796
+ output: {
35797
+ error: string;
35798
+ };
35799
+ outputFormat: "json";
35800
+ status: 404;
35799
35801
  input: {
35800
35802
  param: {
35801
35803
  id: string;
35802
35804
  };
35803
35805
  };
35804
35806
  } | {
35805
- output: {
35806
- error: string;
35807
- };
35808
- outputFormat: "json";
35809
- status: 404;
35807
+ output: string;
35808
+ outputFormat: "text";
35809
+ status: 200;
35810
35810
  input: {
35811
35811
  param: {
35812
35812
  id: string;
@@ -35844,20 +35844,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
35844
35844
  } & {
35845
35845
  "/runs/:id/diff": {
35846
35846
  $get: {
35847
- output: string;
35848
- outputFormat: "text";
35849
- status: import("hono/utils/http-status").ContentfulStatusCode;
35847
+ output: {
35848
+ error: string;
35849
+ };
35850
+ outputFormat: "json";
35851
+ status: 404 | 409;
35850
35852
  input: {
35851
35853
  param: {
35852
35854
  id: string;
35853
35855
  };
35854
35856
  };
35855
35857
  } | {
35856
- output: {
35857
- error: string;
35858
- };
35859
- outputFormat: "json";
35860
- status: 404 | 409;
35858
+ output: string;
35859
+ outputFormat: "text";
35860
+ status: import("hono/utils/http-status").ContentfulStatusCode;
35861
35861
  input: {
35862
35862
  param: {
35863
35863
  id: string;
@@ -51,34 +51,10 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
51
51
  "/workspace/config": {
52
52
  $put: {
53
53
  output: {
54
- browseRoot: string;
55
- projectsDir: string;
56
- archiveOnMerge: boolean | null;
57
- effectiveArchiveOnMerge: boolean;
58
- archiveOnMergeSource: "default" | "environment" | "global";
59
- composerDefaults: {
60
- autonomous: boolean | null;
61
- worktree: boolean | null;
62
- inheritedAutonomous: "source-dependent" | boolean;
63
- inheritedWorktree: boolean;
64
- };
65
- resources: {
66
- maxParallel: number;
67
- maxMonitoringSessions: number;
68
- monitoringWakeIntervalMinutes: number | null;
69
- autoResumeOnUsageLimit: boolean;
70
- memoryLimitMb: number | null;
71
- worktreeRetentionDefault: number;
72
- };
73
- agentDefaults: {
74
- runner?: string | undefined;
75
- models?: {
76
- [x: string]: string | undefined;
77
- } | undefined;
78
- };
54
+ error: string;
79
55
  };
80
56
  outputFormat: "json";
81
- status: import("hono/utils/http-status").ContentfulStatusCode;
57
+ status: 400;
82
58
  input: {
83
59
  json: {
84
60
  browseRoot?: string | undefined;
@@ -107,7 +83,7 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
107
83
  error: string;
108
84
  };
109
85
  outputFormat: "json";
110
- status: 400;
86
+ status: 500;
111
87
  input: {
112
88
  json: {
113
89
  browseRoot?: string | undefined;
@@ -133,10 +109,34 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
133
109
  };
134
110
  } | {
135
111
  output: {
136
- error: string;
112
+ browseRoot: string;
113
+ projectsDir: string;
114
+ archiveOnMerge: boolean | null;
115
+ effectiveArchiveOnMerge: boolean;
116
+ archiveOnMergeSource: "default" | "environment" | "global";
117
+ composerDefaults: {
118
+ autonomous: boolean | null;
119
+ worktree: boolean | null;
120
+ inheritedAutonomous: "source-dependent" | boolean;
121
+ inheritedWorktree: boolean;
122
+ };
123
+ resources: {
124
+ maxParallel: number;
125
+ maxMonitoringSessions: number;
126
+ monitoringWakeIntervalMinutes: number | null;
127
+ autoResumeOnUsageLimit: boolean;
128
+ memoryLimitMb: number | null;
129
+ worktreeRetentionDefault: number;
130
+ };
131
+ agentDefaults: {
132
+ runner?: string | undefined;
133
+ models?: {
134
+ [x: string]: string | undefined;
135
+ } | undefined;
136
+ };
137
137
  };
138
138
  outputFormat: "json";
139
- status: 500;
139
+ status: import("hono/utils/http-status").ContentfulStatusCode;
140
140
  input: {
141
141
  json: {
142
142
  browseRoot?: string | undefined;
@@ -208,41 +208,10 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
208
208
  "/workspace/ui-state": {
209
209
  $put: {
210
210
  output: {
211
- [x: string]: import("hono/utils/types").JSONValue;
212
- sidebar?: {
213
- [x: string]: import("hono/utils/types").JSONValue;
214
- collapsed?: {
215
- [x: string]: boolean;
216
- } | undefined;
217
- projectOrder?: string[] | undefined;
218
- } | undefined;
219
- dismissedProviderAuthFailures?: {
220
- [x: string]: string | undefined;
221
- } | undefined;
222
- appearance?: {
223
- accent?: "cezarion" | "lime" | "violet" | undefined;
224
- density?: "comfortable" | "compact" | "ultra" | undefined;
225
- width?: "narrow" | "wide" | undefined;
226
- } | undefined;
227
- notifications?: {
228
- [x: string]: import("hono/utils/types").JSONValue;
229
- enabled?: boolean | undefined;
230
- } | undefined;
231
- taskTable?: {
232
- [x: string]: import("hono/utils/types").JSONValue;
233
- expandedColumns?: {
234
- [x: string]: boolean;
235
- } | undefined;
236
- } | undefined;
237
- lastLocation?: {
238
- projectId: string;
239
- pathname: string;
240
- search?: string | undefined;
241
- hash?: string | undefined;
242
- } | undefined;
211
+ error: string;
243
212
  };
244
213
  outputFormat: "json";
245
- status: import("hono/utils/http-status").ContentfulStatusCode;
214
+ status: 500;
246
215
  input: {
247
216
  json: {
248
217
  [x: string]: unknown;
@@ -275,10 +244,41 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
275
244
  };
276
245
  } | {
277
246
  output: {
278
- error: string;
247
+ [x: string]: import("hono/utils/types").JSONValue;
248
+ sidebar?: {
249
+ [x: string]: import("hono/utils/types").JSONValue;
250
+ collapsed?: {
251
+ [x: string]: boolean;
252
+ } | undefined;
253
+ projectOrder?: string[] | undefined;
254
+ } | undefined;
255
+ dismissedProviderAuthFailures?: {
256
+ [x: string]: string | undefined;
257
+ } | undefined;
258
+ appearance?: {
259
+ accent?: "cezarion" | "lime" | "violet" | undefined;
260
+ density?: "comfortable" | "compact" | "ultra" | undefined;
261
+ width?: "narrow" | "wide" | undefined;
262
+ } | undefined;
263
+ notifications?: {
264
+ [x: string]: import("hono/utils/types").JSONValue;
265
+ enabled?: boolean | undefined;
266
+ } | undefined;
267
+ taskTable?: {
268
+ [x: string]: import("hono/utils/types").JSONValue;
269
+ expandedColumns?: {
270
+ [x: string]: boolean;
271
+ } | undefined;
272
+ } | undefined;
273
+ lastLocation?: {
274
+ projectId: string;
275
+ pathname: string;
276
+ search?: string | undefined;
277
+ hash?: string | undefined;
278
+ } | undefined;
279
279
  };
280
280
  outputFormat: "json";
281
- status: 500;
281
+ status: import("hono/utils/http-status").ContentfulStatusCode;
282
282
  input: {
283
283
  json: {
284
284
  [x: string]: unknown;
@@ -329,10 +329,17 @@ export declare function createFsBrowseRoutes(workspaceBrowseRoot: () => Promise<
329
329
  };
330
330
  } | {
331
331
  output: {
332
- error: string;
332
+ path: string;
333
+ parent: string | null;
334
+ dirs: {
335
+ name: string;
336
+ path: string;
337
+ isRepo: boolean;
338
+ }[];
339
+ truncated: boolean;
333
340
  };
334
341
  outputFormat: "json";
335
- status: 400 | 403 | 404;
342
+ status: import("hono/utils/http-status").ContentfulStatusCode;
336
343
  input: {
337
344
  query: {
338
345
  path?: string | undefined;
@@ -341,17 +348,10 @@ export declare function createFsBrowseRoutes(workspaceBrowseRoot: () => Promise<
341
348
  };
342
349
  } | {
343
350
  output: {
344
- path: string;
345
- parent: string | null;
346
- dirs: {
347
- name: string;
348
- path: string;
349
- isRepo: boolean;
350
- }[];
351
- truncated: boolean;
351
+ error: string;
352
352
  };
353
353
  outputFormat: "json";
354
- status: import("hono/utils/http-status").ContentfulStatusCode;
354
+ status: 400 | 403 | 404;
355
355
  input: {
356
356
  query: {
357
357
  path?: string | undefined;
@@ -370,15 +370,6 @@ export interface WorkspaceEventsRouteDeps {
370
370
  export declare function createWorkspaceEventsRoutes(deps: WorkspaceEventsRouteDeps): import("hono/hono-base").HonoBase<ProjectApiEnv, {
371
371
  "/workspace/events": {
372
372
  $get: {
373
- output: {};
374
- outputFormat: string;
375
- status: import("hono/utils/http-status").StatusCode;
376
- input: {
377
- query: {
378
- runs?: "summary" | undefined;
379
- };
380
- };
381
- } | {
382
373
  output: {
383
374
  error: string;
384
375
  code?: "invalid_input" | undefined;
@@ -390,6 +381,15 @@ export declare function createWorkspaceEventsRoutes(deps: WorkspaceEventsRouteDe
390
381
  runs?: "summary" | undefined;
391
382
  };
392
383
  };
384
+ } | {
385
+ output: {};
386
+ outputFormat: string;
387
+ status: import("hono/utils/http-status").StatusCode;
388
+ input: {
389
+ query: {
390
+ runs?: "summary" | undefined;
391
+ };
392
+ };
393
393
  };
394
394
  };
395
395
  }, "/", "/workspace/events">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hearsay-tools/squawk",
3
- "version": "0.18.0-pr4329.8416",
3
+ "version": "0.18.0-pr4330.8417",
4
4
  "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -68,8 +68,8 @@
68
68
  "devDependencies": {
69
69
  "@babel/parser": "^8.0.8",
70
70
  "@babel/types": "^8.0.8",
71
- "@open-mercato/cezar-api-client": "0.18.0-pr4329.8416",
72
- "@open-mercato/cezar-contract": "0.18.0-pr4329.8416",
71
+ "@open-mercato/cezar-api-client": "0.18.0-pr4330.8417",
72
+ "@open-mercato/cezar-contract": "0.18.0-pr4330.8417",
73
73
  "@types/node": "^24.19.1",
74
74
  "@types/ws": "^8.18.1",
75
75
  "esbuild": "^0.28.1",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "7ee3c9534ec1efb74c1c30023678185483c47b7a"
89
+ "gitHead": "a4f43a568e685ea876ea8674472f353cb51405c0"
90
90
  }
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{An as r,Ar as i,Pn as a,ci as o,jn as s,nn as c}from"./project-scope-context-D9axDY18.js";import{$t as l,Ct as u,Gt as d,Ht as f,Kt as p,Mt as m,Rt as h,Ut as g,Xt as _,bt as v,ht as y,in as b,kt as x,lt as S,ot as C,st as w,ut as ee,yt as te}from"./queries-DzwCG927.js";import{t as ne}from"./useQuery-CzVHT8UE.js";import{f as T}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as E}from"./toaster-Bo5vCbz-.js";import{y as D}from"./design-icons-CzEoMH9c.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as k}from"./folder-browser-CffyHz8w.js";import{t as A}from"./button-BQ2y4XRB.js";import{t as j}from"./badge-D9JrXe0o.js";import{a as M,i as N,o as P,r as F,s as I,t as L}from"./dialog-BVF6dIeS.js";import{t as R}from"./status-dot-DtAOFiIi.js";import{n as z}from"./agents-settings-path-7X6_cvUg.js";import{t as B}from"./centered-state-V15AR_qo.js";import{Gt as V,Ht as H,Jt as U,Kt as W,N as G,Ut as K,Vt as q,Wt as J,j as re,qt as Y}from"./index-CGN3vFr8.js";import{n as X,r as ie,t as ae}from"./settings-agent-picker-Cpb_WqeU.js";import{n as oe,r as se,t as ce}from"./remote-settings-notice-BiR9_90x.js";var le=O(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Z=e(t(),1),Q=n(),ue=`~/.claude-second`;function de({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=_().data,[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(r??n[0]??`claude`),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,v]=(0,Z.useState)(!1),y=ee(),b=m.trim();return(0,Q.jsx)(L,{open:e,onOpenChange:t,children:(0,Q.jsxs)(F,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,Q.jsxs)(P,{children:[(0,Q.jsx)(I,{children:`Add agent account`}),(0,Q.jsx)(N,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,Q.jsx)(`select`,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:l,onChange:e=>u(e.target.value),className:`rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`,children:n.map(e=>(0,Q.jsx)(`option`,{value:e,children:e},e))})]}),(0,Q.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,Q.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:f,placeholder:`Work`,onChange:e=>p(e.target.value),className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,Q.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:m,placeholder:d(i,l)?.accountFolderExample??ue,onChange:e=>{h(e.target.value),c(null),y.reset()},className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 font-mono text-[13px] outline-none focus-visible:border-ring`}),(0,Q.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":g,onClick:()=>v(e=>!e),children:g?`Hide folders`:`Browse…`})]}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-soft-foreground`,children:[`A `,(0,Q.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),g?(0,Q.jsx)(k,{path:a,selected:s,onSelect:e=>{c(e),h(e.path),y.reset()},onEnter:e=>{o(e),c(null),y.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,y.isError?(0,Q.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:y.error instanceof Error?y.error.message:`could not add that folder`}):null,(0,Q.jsxs)(M,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,Q.jsx)(A,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,Q.jsx)(A,{"data-slot":`add-account-confirm`,disabled:b===``||y.isPending,onClick:()=>{b===``||y.isPending||y.mutate({provider:l,configDir:b,...f.trim()?{label:f.trim()}:{}},{onSuccess:()=>{t(!1),p(``),h(``),c(null),v(!1),E(`Account added — use Connect to sign in`)}})},children:y.isPending?`Adding…`:`Add account`})]})]})})}async function fe(e){return a(await s.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function pe(e,t){return a(await s.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var me={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function he(e){let t=y().data?.capabilities?.settingsAdmin===!0,n=o(),r=[`runner-install`,e],i=ne({queryKey:r,queryFn:()=>fe(e),enabled:t,retry:!1,refetchInterval:e=>{if(e.state.error)return!1;let t=e.state.data?.phase;return t&&t!==`idle`&&t!==`failed`?1e3:6e4}}),a=b({mutationFn:t=>pe(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),s=i.data;return{allowed:t,data:s,busy:a.isPending||!!s&&s.phase!==`idle`&&s.phase!==`failed`,error:a.error?.message??i.error?.message??s?.error,action:a,status:i}}function ge({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,Q.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function _e({runner:e}){let t=he(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,Q.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,Q.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[r?.installedVersion?`Installed CLI ${r.installedVersion}`:`CLI not installed`,r?.latestVersion?` · Latest ${r.latestVersion}`:``,i&&r?` · ${me[r.phase]}`:``]}),a?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,Q.jsx)(ge,{state:t}),r?.installedVersion?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var ve={connected:{label:`Connected`,tone:`success`},disconnected:{label:`Not connected`,tone:`pending`},"not-installed":{label:`Not installed`,tone:`neutral`},unknown:{label:`Could not verify`,tone:`danger`}};function ye(){let e=w(),t=_();if(e.isPending||t.isPending)return(0,Q.jsx)(`p`,{"data-slot":`accounts-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agents…`});let n=e.error??t.error;return n?(0,Q.jsx)(B,{icon:(0,Q.jsx)(le,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,Q.jsx)($,{data:e.data,runners:t.data})}function be(){let{hash:e}=T();(0,Z.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function $({data:e,runners:t}){let n=y(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),s=u();return be(),se(),(0,Q.jsxs)(`div`,{"data-slot":`accounts-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Install, update and sign in to each agent, and set what a project runs when it has not chosen.`}),(0,Q.jsx)(oe,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,Q.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-soft-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,Q.jsx)(`code`,{children:ce}),` on the host to add, edit, or sign in to accounts here.`]}),(0,Q.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-4`,children:t.runners.map(r=>(0,Q.jsx)(Se,{entry:r,check:n.data?.checks?.find(e=>e.name===r.id),settingsAdmin:n.data?.capabilities?.settingsAdmin===!0,runners:t,editable:e.editable,accounts:e.profiles.filter(e=>e.provider===r.id),canCarryAccounts:e.profileCapableProviders.includes(r.id),onAdd:()=>i(r.id),onRemove:o},r.id))}),(0,Q.jsx)(Ce,{runners:t}),r===null?null:(0,Q.jsx)(de,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,Q.jsx)(q,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,Q.jsxs)(J,{"data-slot":`accounts-remove-confirm`,children:[(0,Q.jsxs)(Y,{children:[(0,Q.jsxs)(U,{children:[`Remove “`,a?.label,`”?`]}),(0,Q.jsxs)(V,{children:[`This only forgets the account. Nothing in `,a?.configDir??`this account’s folder`,` is deleted — not your login, not your sessions. Projects using it fall back to the default account, and tasks that ran under it can no longer be resumed from here.`]})]}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(K,{children:`Cancel`}),(0,Q.jsx)(H,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),E(`Removed ${e.label}`)},onError:e=>E(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function xe({entry:e,check:t}){return t===void 0?(0,Q.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking…`}):t.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"data-slot":`agent-installed`,children:`Installed`}),t.version?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,Q.jsx)(`span`,{"data-slot":`agent-version`,children:t.version})]}):null]}):(0,Q.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`Not installed`,e.installHint?(0,Q.jsxs)(Q.Fragment,{children:[` — `,(0,Q.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}function Se({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.managedInstall===!0&&n,d=a.filter(e=>e.isDefault).length,f=`${z(l)}-title`;return(0,Q.jsxs)(`section`,{id:z(l),tabIndex:-1,"aria-labelledby":f,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col gap-4 rounded-lg border border-border bg-card p-4`,children:[(0,Q.jsx)(`h3`,{id:f,className:`settings-account-provider-title`,children:e.displayName}),u?(0,Q.jsx)(_e,{runner:l}):null,(0,Q.jsxs)(`div`,{className:`settings-account-installation settings-readout`,children:[u?null:(0,Q.jsx)(xe,{entry:e,check:t}),i||a.length>0?(0,Q.jsxs)(`span`,{className:`settings-account-count`,children:[a.length,` `,a.length===1?`account`:`accounts`,` (`,d,` discovered, `,a.length-d,` added)`]}):null]}),a.length>0?(0,Q.jsx)(`ul`,{children:a.map(e=>(0,Q.jsx)(De,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))}):null,i?o?(0,Q.jsx)(`div`,{className:`settings-account-add-row`,children:(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`})}):(0,Q.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`text-[11px] text-soft-foreground`,children:[e.displayName,` can only hold one account here: it keeps its credentials outside its config folder, so a second folder would change settings without changing the login — which would say “work account” while billing the other one.`]}):a.length===0&&e.browserLogin?(0,Q.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Discovered account`}),(0,Q.jsx)(X,{provider:l,label:e.displayName})]}):null]})}function Ce({runners:e}){let[t,n]=(0,Z.useState)(null),r=o(),i=m(),a=te(),s=l(p(e)),u=b({mutationFn:e=>c(e),onSuccess:e=>r.setQueryData(h.config,e),onError:e=>E(e.message,{tone:`danger`})});if(i.data===void 0)return null;let d=ie([],e),g=i.data.agentDefaults.runner??`claude`,_=f(t??g,p(e))??t??g,v=i.data.agentDefaults.models??{};return(0,Q.jsxs)(`section`,{"data-slot":`accounts-defaults`,className:`flex flex-col gap-3 rounded-lg border border-border bg-card/40 p-3.5`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`What a project runs when it has not chosen for itself — set once instead of per repository. A project that has chosen keeps its own.`})]}),(0,Q.jsx)(ae,{rows:d,runner:g,accountFor:()=>null,providerStatus:a,disabled:u.isPending,onPick:e=>{e!==g&&u.mutate({agentDefaults:{runner:e}})}}),(0,Q.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,Q.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,Q.jsx)(`span`,{children:`Default model for`}),(0,Q.jsx)(`select`,{"aria-label":`Model agent`,value:_,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===_).map(t=>(0,Q.jsxs)(`label`,{className:`settings-account-model flex items-center gap-3`,children:[(0,Q.jsx)(D,{className:`size-4 text-accent-icon shrink-0`}),(0,Q.jsx)(`span`,{className:`w-24 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,Q.jsxs)(`select`,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:v[t.id]??``,disabled:u.isPending,onChange:e=>u.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-full max-w-xs rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[G(t.id,e,s[t.id]?.data,[v[t.id]]).map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,Q.jsx)(we,{runner:t.id,runners:e,catalog:s[t.id]})]})]},t.id))]})]})}function we({runner:e,runners:t,catalog:n}){let r=re(e,t,n);return r?(0,Q.jsx)(`option`,{disabled:!0,children:r}):null}function Te({account:e,runners:t,status:n,editable:i}){let a=S();return(0,Q.jsxs)(Q.Fragment,{children:[n&&n.status!==`connected`&&d(t,e.provider)?.browserLogin?(0,Q.jsx)(X,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,i&&n&&n.status!==`connected`&&d(t,e.provider)?.terminalLogin!==!1?(0,Q.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:a.isPending,onClick:()=>a.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>E(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>E(e instanceof r&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ee({account:e,runners:t,status:n,editable:r}){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?(0,Q.jsxs)(`span`,{"data-slot":`account-unrecognised`,children:[`— this folder does not look like `,g(t,e.provider),` config yet`]}):null:(0,Q.jsx)(`span`,{"data-slot":`account-missing`,children:r?`— folder not created yet; Connect will make it`:`— not initialized on host yet`})}function De({account:e,runners:t,editable:n,onRemove:r}){let a=i(e),o=v(),s=C(a,e.status===void 0),c=e.status??s.data?.status,l=c?ve[c.status]:void 0;return(0,Q.jsx)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`flex flex-col gap-2 px-3.5 py-3`,children:(0,Q.jsxs)(`div`,{className:`settings-account-card`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-[13px] font-medium text-foreground`,children:e.label}),e.isDefault?(0,Q.jsx)(j,{variant:`ghost`,className:`shrink-0 text-[12px] text-muted-foreground`,children:`discovered`}):null]}),(0,Q.jsxs)(`div`,{className:`settings-account-readout settings-readout`,children:[e.configDir?(0,Q.jsx)(`p`,{"data-slot":`account-path`,className:`mt-0.5 truncate font-mono text-[11px] text-soft-foreground`,title:e.path,children:e.configDir}):null,(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(R,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,Q.jsx)(`span`,{"data-slot":`account-status`,children:l?.label??`Checking…`}),(0,Q.jsx)(Ee,{account:e,runners:t,status:c,editable:n})]}),c?.hint?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c.hint}):null]})]}),(0,Q.jsxs)(`div`,{className:`settings-account-actions`,children:[(0,Q.jsx)(Te,{account:e,runners:t,status:c,editable:n}),(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>E(e.message,{tone:`danger`})}),children:`Check again`}),n?(0,Q.jsx)(Oe,{account:e,onRemove:r}):null]})]})})}function Oe({account:e,onRemove:t}){let[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(e.label),o=x();return(0,Q.jsx)(Q.Fragment,{children:e.isDefault?null:(0,Q.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`input`,{type:`text`,autoFocus:!0,"aria-label":`Name for ${e.label}`,"data-slot":`account-rename-input`,value:i,onChange:e=>a(e.target.value),className:`w-48 rounded-md border border-input bg-card px-2 py-1 text-xs outline-none focus-visible:border-ring`}),(0,Q.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>E(e.message,{tone:`danger`})}),children:`Save`}),(0,Q.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{ye as GlobalAgentsSection};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{An as r,Ar as i,Pn as a,ci as o,jn as s,nn as c}from"./project-scope-context-D9axDY18.js";import{$t as l,Ct as u,Gt as d,Ht as f,Kt as p,Mt as m,Rt as h,Ut as g,Xt as _,bt as v,ht as y,in as b,kt as x,lt as S,ot as C,st as w,ut as ee,yt as te}from"./queries-DzwCG927.js";import{t as ne}from"./useQuery-CzVHT8UE.js";import{f as T}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as E}from"./toaster-Bo5vCbz-.js";import{y as D}from"./design-icons-CzEoMH9c.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as k}from"./folder-browser-CffyHz8w.js";import{t as A}from"./button-BQ2y4XRB.js";import{t as j}from"./badge-D9JrXe0o.js";import{a as M,i as N,o as P,r as F,s as I,t as L}from"./dialog-BVF6dIeS.js";import{t as R}from"./status-dot-DtAOFiIi.js";import{n as z}from"./agents-settings-path-7X6_cvUg.js";import{t as B}from"./centered-state-V15AR_qo.js";import{Gt as V,Ht as H,Jt as U,Kt as W,N as G,Ut as K,Vt as q,Wt as J,j as re,qt as Y}from"./index-D1QQrINC.js";import{n as X,r as ie,t as ae}from"./settings-agent-picker-BI2-f3Kb.js";import{n as oe,r as se,t as ce}from"./remote-settings-notice-7_VwBQzk.js";var le=O(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Z=e(t(),1),Q=n(),ue=`~/.claude-second`;function de({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=_().data,[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(r??n[0]??`claude`),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,v]=(0,Z.useState)(!1),y=ee(),b=m.trim();return(0,Q.jsx)(L,{open:e,onOpenChange:t,children:(0,Q.jsxs)(F,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,Q.jsxs)(P,{children:[(0,Q.jsx)(I,{children:`Add agent account`}),(0,Q.jsx)(N,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,Q.jsx)(`select`,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:l,onChange:e=>u(e.target.value),className:`rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`,children:n.map(e=>(0,Q.jsx)(`option`,{value:e,children:e},e))})]}),(0,Q.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,Q.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:f,placeholder:`Work`,onChange:e=>p(e.target.value),className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,Q.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:m,placeholder:d(i,l)?.accountFolderExample??ue,onChange:e=>{h(e.target.value),c(null),y.reset()},className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 font-mono text-[13px] outline-none focus-visible:border-ring`}),(0,Q.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":g,onClick:()=>v(e=>!e),children:g?`Hide folders`:`Browse…`})]}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-soft-foreground`,children:[`A `,(0,Q.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),g?(0,Q.jsx)(k,{path:a,selected:s,onSelect:e=>{c(e),h(e.path),y.reset()},onEnter:e=>{o(e),c(null),y.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,y.isError?(0,Q.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:y.error instanceof Error?y.error.message:`could not add that folder`}):null,(0,Q.jsxs)(M,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,Q.jsx)(A,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,Q.jsx)(A,{"data-slot":`add-account-confirm`,disabled:b===``||y.isPending,onClick:()=>{b===``||y.isPending||y.mutate({provider:l,configDir:b,...f.trim()?{label:f.trim()}:{}},{onSuccess:()=>{t(!1),p(``),h(``),c(null),v(!1),E(`Account added — use Connect to sign in`)}})},children:y.isPending?`Adding…`:`Add account`})]})]})})}async function fe(e){return a(await s.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function pe(e,t){return a(await s.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var me={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function he(e){let t=y().data?.capabilities?.settingsAdmin===!0,n=o(),r=[`runner-install`,e],i=ne({queryKey:r,queryFn:()=>fe(e),enabled:t,retry:!1,refetchInterval:e=>{if(e.state.error)return!1;let t=e.state.data?.phase;return t&&t!==`idle`&&t!==`failed`?1e3:6e4}}),a=b({mutationFn:t=>pe(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),s=i.data;return{allowed:t,data:s,busy:a.isPending||!!s&&s.phase!==`idle`&&s.phase!==`failed`,error:a.error?.message??i.error?.message??s?.error,action:a,status:i}}function ge({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,Q.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function _e({runner:e}){let t=he(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,Q.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,Q.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[r?.installedVersion?`Installed CLI ${r.installedVersion}`:`CLI not installed`,r?.latestVersion?` · Latest ${r.latestVersion}`:``,i&&r?` · ${me[r.phase]}`:``]}),a?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,Q.jsx)(ge,{state:t}),r?.installedVersion?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var ve={connected:{label:`Connected`,tone:`success`},disconnected:{label:`Not connected`,tone:`pending`},"not-installed":{label:`Not installed`,tone:`neutral`},unknown:{label:`Could not verify`,tone:`danger`}};function ye(){let e=w(),t=_();if(e.isPending||t.isPending)return(0,Q.jsx)(`p`,{"data-slot":`accounts-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agents…`});let n=e.error??t.error;return n?(0,Q.jsx)(B,{icon:(0,Q.jsx)(le,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,Q.jsx)($,{data:e.data,runners:t.data})}function be(){let{hash:e}=T();(0,Z.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function $({data:e,runners:t}){let n=y(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),s=u();return be(),se(),(0,Q.jsxs)(`div`,{"data-slot":`accounts-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Install, update and sign in to each agent, and set what a project runs when it has not chosen.`}),(0,Q.jsx)(oe,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,Q.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-soft-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,Q.jsx)(`code`,{children:ce}),` on the host to add, edit, or sign in to accounts here.`]}),(0,Q.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-4`,children:t.runners.map(r=>(0,Q.jsx)(Se,{entry:r,check:n.data?.checks?.find(e=>e.name===r.id),settingsAdmin:n.data?.capabilities?.settingsAdmin===!0,runners:t,editable:e.editable,accounts:e.profiles.filter(e=>e.provider===r.id),canCarryAccounts:e.profileCapableProviders.includes(r.id),onAdd:()=>i(r.id),onRemove:o},r.id))}),(0,Q.jsx)(Ce,{runners:t}),r===null?null:(0,Q.jsx)(de,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,Q.jsx)(q,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,Q.jsxs)(J,{"data-slot":`accounts-remove-confirm`,children:[(0,Q.jsxs)(Y,{children:[(0,Q.jsxs)(U,{children:[`Remove “`,a?.label,`”?`]}),(0,Q.jsxs)(V,{children:[`This only forgets the account. Nothing in `,a?.configDir??`this account’s folder`,` is deleted — not your login, not your sessions. Projects using it fall back to the default account, and tasks that ran under it can no longer be resumed from here.`]})]}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(K,{children:`Cancel`}),(0,Q.jsx)(H,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),E(`Removed ${e.label}`)},onError:e=>E(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function xe({entry:e,check:t}){return t===void 0?(0,Q.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking…`}):t.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"data-slot":`agent-installed`,children:`Installed`}),t.version?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,Q.jsx)(`span`,{"data-slot":`agent-version`,children:t.version})]}):null]}):(0,Q.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`Not installed`,e.installHint?(0,Q.jsxs)(Q.Fragment,{children:[` — `,(0,Q.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}function Se({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.managedInstall===!0&&n,d=a.filter(e=>e.isDefault).length,f=`${z(l)}-title`;return(0,Q.jsxs)(`section`,{id:z(l),tabIndex:-1,"aria-labelledby":f,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col gap-4 rounded-lg border border-border bg-card p-4`,children:[(0,Q.jsx)(`h3`,{id:f,className:`settings-account-provider-title`,children:e.displayName}),u?(0,Q.jsx)(_e,{runner:l}):null,(0,Q.jsxs)(`div`,{className:`settings-account-installation settings-readout`,children:[u?null:(0,Q.jsx)(xe,{entry:e,check:t}),i||a.length>0?(0,Q.jsxs)(`span`,{className:`settings-account-count`,children:[a.length,` `,a.length===1?`account`:`accounts`,` (`,d,` discovered, `,a.length-d,` added)`]}):null]}),a.length>0?(0,Q.jsx)(`ul`,{children:a.map(e=>(0,Q.jsx)(De,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))}):null,i?o?(0,Q.jsx)(`div`,{className:`settings-account-add-row`,children:(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`})}):(0,Q.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`text-[11px] text-soft-foreground`,children:[e.displayName,` can only hold one account here: it keeps its credentials outside its config folder, so a second folder would change settings without changing the login — which would say “work account” while billing the other one.`]}):a.length===0&&e.browserLogin?(0,Q.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Discovered account`}),(0,Q.jsx)(X,{provider:l,label:e.displayName})]}):null]})}function Ce({runners:e}){let[t,n]=(0,Z.useState)(null),r=o(),i=m(),a=te(),s=l(p(e)),u=b({mutationFn:e=>c(e),onSuccess:e=>r.setQueryData(h.config,e),onError:e=>E(e.message,{tone:`danger`})});if(i.data===void 0)return null;let d=ie([],e),g=i.data.agentDefaults.runner??`claude`,_=f(t??g,p(e))??t??g,v=i.data.agentDefaults.models??{};return(0,Q.jsxs)(`section`,{"data-slot":`accounts-defaults`,className:`flex flex-col gap-3 rounded-lg border border-border bg-card/40 p-3.5`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`What a project runs when it has not chosen for itself — set once instead of per repository. A project that has chosen keeps its own.`})]}),(0,Q.jsx)(ae,{rows:d,runner:g,accountFor:()=>null,providerStatus:a,disabled:u.isPending,onPick:e=>{e!==g&&u.mutate({agentDefaults:{runner:e}})}}),(0,Q.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,Q.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,Q.jsx)(`span`,{children:`Default model for`}),(0,Q.jsx)(`select`,{"aria-label":`Model agent`,value:_,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===_).map(t=>(0,Q.jsxs)(`label`,{className:`settings-account-model flex items-center gap-3`,children:[(0,Q.jsx)(D,{className:`size-4 text-accent-icon shrink-0`}),(0,Q.jsx)(`span`,{className:`w-24 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,Q.jsxs)(`select`,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:v[t.id]??``,disabled:u.isPending,onChange:e=>u.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-full max-w-xs rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[G(t.id,e,s[t.id]?.data,[v[t.id]]).map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,Q.jsx)(we,{runner:t.id,runners:e,catalog:s[t.id]})]})]},t.id))]})]})}function we({runner:e,runners:t,catalog:n}){let r=re(e,t,n);return r?(0,Q.jsx)(`option`,{disabled:!0,children:r}):null}function Te({account:e,runners:t,status:n,editable:i}){let a=S();return(0,Q.jsxs)(Q.Fragment,{children:[n&&n.status!==`connected`&&d(t,e.provider)?.browserLogin?(0,Q.jsx)(X,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,i&&n&&n.status!==`connected`&&d(t,e.provider)?.terminalLogin!==!1?(0,Q.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:a.isPending,onClick:()=>a.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>E(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>E(e instanceof r&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ee({account:e,runners:t,status:n,editable:r}){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?(0,Q.jsxs)(`span`,{"data-slot":`account-unrecognised`,children:[`— this folder does not look like `,g(t,e.provider),` config yet`]}):null:(0,Q.jsx)(`span`,{"data-slot":`account-missing`,children:r?`— folder not created yet; Connect will make it`:`— not initialized on host yet`})}function De({account:e,runners:t,editable:n,onRemove:r}){let a=i(e),o=v(),s=C(a,e.status===void 0),c=e.status??s.data?.status,l=c?ve[c.status]:void 0;return(0,Q.jsx)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`flex flex-col gap-2 px-3.5 py-3`,children:(0,Q.jsxs)(`div`,{className:`settings-account-card`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-[13px] font-medium text-foreground`,children:e.label}),e.isDefault?(0,Q.jsx)(j,{variant:`ghost`,className:`shrink-0 text-[12px] text-muted-foreground`,children:`discovered`}):null]}),(0,Q.jsxs)(`div`,{className:`settings-account-readout settings-readout`,children:[e.configDir?(0,Q.jsx)(`p`,{"data-slot":`account-path`,className:`mt-0.5 truncate font-mono text-[11px] text-soft-foreground`,title:e.path,children:e.configDir}):null,(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(R,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,Q.jsx)(`span`,{"data-slot":`account-status`,children:l?.label??`Checking…`}),(0,Q.jsx)(Ee,{account:e,runners:t,status:c,editable:n})]}),c?.hint?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c.hint}):null]})]}),(0,Q.jsxs)(`div`,{className:`settings-account-actions`,children:[(0,Q.jsx)(Te,{account:e,runners:t,status:c,editable:n}),(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>E(e.message,{tone:`danger`})}),children:`Check again`}),n?(0,Q.jsx)(Oe,{account:e,onRemove:r}):null]})]})})}function Oe({account:e,onRemove:t}){let[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(e.label),o=x();return(0,Q.jsx)(Q.Fragment,{children:e.isDefault?null:(0,Q.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`input`,{type:`text`,autoFocus:!0,"aria-label":`Name for ${e.label}`,"data-slot":`account-rename-input`,value:i,onChange:e=>a(e.target.value),className:`w-48 rounded-md border border-input bg-card px-2 py-1 text-xs outline-none focus-visible:border-ring`}),(0,Q.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>E(e.message,{tone:`danger`})}),children:`Save`}),(0,Q.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{ye as GlobalAgentsSection};