@hearsay-tools/squawk 0.19.0-dev.8936 → 0.19.0-dev.8945

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 (62) hide show
  1. package/dist/ci-wait/controller.d.ts +7 -7
  2. package/dist/delegation/transport.d.ts +65 -65
  3. package/dist/server/activity-routes.d.ts +23 -23
  4. package/dist/server/runs-routes.d.ts +22 -22
  5. package/package.json +4 -4
  6. package/web/dist/assets/{accounts-section-BWs_Op4q.js → accounts-section-WIehcyGw.js} +1 -1
  7. package/web/dist/assets/{activity-motion-D_lzlbol.js → activity-motion-C6MkKVNw.js} +1 -1
  8. package/web/dist/assets/{activity-route-npBjTy91.js → activity-route-DnkJg2yC.js} +1 -1
  9. package/web/dist/assets/{agent-config-section-CBwn34fV.js → agent-config-section-D9CmEBGB.js} +1 -1
  10. package/web/dist/assets/{agent-defaults-section-BLeHBg4E.js → agent-defaults-section-Dpo7uqt7.js} +1 -1
  11. package/web/dist/assets/{appearance-LEzL_45W.js → appearance-C4ZeV0d7.js} +1 -1
  12. package/web/dist/assets/{archive-on-merge-field-ave6eYwU.js → archive-on-merge-field-CLz5wdcX.js} +1 -1
  13. package/web/dist/assets/automations-route-dvKhqCE2.js +2 -0
  14. package/web/dist/assets/{automations-route-CzqZXK0W.css → automations-route-mn5aFSDU.css} +1 -1
  15. package/web/dist/assets/{commit-list-BpFn0yy-.js → commit-list-BBOPi-5c.js} +1 -1
  16. package/web/dist/assets/{diff-controls-BlMnNuV4.js → diff-controls-RoNLKGo8.js} +1 -1
  17. package/web/dist/assets/{diff-C9prkoMN.js → diff-o1vDSmjJ.js} +2 -2
  18. package/web/dist/assets/{diff-view-B4HIRvi0.js → diff-view--upGtYuH.js} +1 -1
  19. package/web/dist/assets/{discard-changes-dialog-DSEAPMnA.js → discard-changes-dialog-C4edQj7U.js} +1 -1
  20. package/web/dist/assets/{file-preview-BT_5H3ms.js → file-preview-Ba2kwvIA.js} +1 -1
  21. package/web/dist/assets/{git-toolbar-DK4_0Ylw.js → git-toolbar-DXDZQtTO.js} +1 -1
  22. package/web/dist/assets/{github-NIisNx1G.js → github-CZrdkYl7.js} +1 -1
  23. package/web/dist/assets/{global-activity-route-E8K9u2n2.js → global-activity-route-H0_KUbFo.js} +1 -1
  24. package/web/dist/assets/{index-DCiyvOmJ.js → index-BdwJdyhu.js} +4 -4
  25. package/web/dist/assets/index-erIRmS_2.css +1 -0
  26. package/web/dist/assets/{markdown-BUeamWrQ.js → markdown-BrCnMalC.js} +1 -1
  27. package/web/dist/assets/{option-select-Cdd2UPAV.js → option-select-DYOZPdHh.js} +1 -1
  28. package/web/dist/assets/{preferences-section-XoysgB81.js → preferences-section-DAHLqdBx.js} +1 -1
  29. package/web/dist/assets/{preview-pane-connected-Dgx7IuKI.js → preview-pane-connected-CZ8K6fgu.js} +1 -1
  30. package/web/dist/assets/{project-location-BGsUFEoZ.js → project-location-BtpH7PdN.js} +1 -1
  31. package/web/dist/assets/{projects-section-DImMzOUS.js → projects-section-C3uSUuUa.js} +1 -1
  32. package/web/dist/assets/{prompt-templates-section-DmEZQQiJ.js → prompt-templates-section-BqTyw9qv.js} +1 -1
  33. package/web/dist/assets/{remote-settings-notice-De6tIJ-L.js → remote-settings-notice-C8ISDWAZ.js} +1 -1
  34. package/web/dist/assets/{repo-git-DRAJhkDz.js → repo-git-op-Z42-r.js} +1 -1
  35. package/web/dist/assets/{report-reader-DTgtThoF.js → report-reader-Czn67eDi.js} +1 -1
  36. package/web/dist/assets/{reports-BcNh-ewR.js → reports-CUTmDw8a.js} +1 -1
  37. package/web/dist/assets/{resources-section-CLGNYsEI.js → resources-section-CrFBkbzV.js} +1 -1
  38. package/web/dist/assets/{review-panel-DJrz0DKA.js → review-panel-DnKKu0ED.js} +1 -1
  39. package/web/dist/assets/{run-header-rOZ7Bfbt.js → run-header-BuWI-Izb.js} +1 -1
  40. package/web/dist/assets/{select-BRh3a5hj.js → select-BNkI-J23.js} +1 -1
  41. package/web/dist/assets/{session-context-section-Cx7XfXh7.js → session-context-section-Cbnd7mET.js} +1 -1
  42. package/web/dist/assets/{settings-agent-picker-BJ4aWg6X.js → settings-agent-picker-Cc9EbxOn.js} +1 -1
  43. package/web/dist/assets/{settings-save-bar-CoztcQSE.js → settings-save-bar-CXPbykSw.js} +1 -1
  44. package/web/dist/assets/{settings-shell-D9jjYoK8.js → settings-shell-he41aRWc.js} +1 -1
  45. package/web/dist/assets/{sidebar-section-YRmC93zR.js → sidebar-section-DnBL1i6S.js} +1 -1
  46. package/web/dist/assets/{skills-7RaRLcTg.js → skills-C0ExMlKn.js} +1 -1
  47. package/web/dist/assets/{task-changes-CHfNtrjT.js → task-changes-CkZAXYzq.js} +1 -1
  48. package/web/dist/assets/{task-commits-oONZqAkn.js → task-commits-DvbEh5Ej.js} +1 -1
  49. package/web/dist/assets/{task-file-scope-DkIxyIoZ.js → task-file-scope-u9ReDUkm.js} +1 -1
  50. package/web/dist/assets/{task-files-BRdhOHRY.js → task-files-_ViDE2KM.js} +1 -1
  51. package/web/dist/assets/{task-github-item-DRFTfSWl.js → task-github-item-D6HlV5w7.js} +1 -1
  52. package/web/dist/assets/{task-thread-hcPcygid.js → task-thread-DufVSXBG.js} +1 -1
  53. package/web/dist/assets/{thread-state-DDyUg5uH.js → thread-state-DyL-5CT_.js} +1 -1
  54. package/web/dist/assets/{use-hand-to-agent-state-BvvZrw7O.js → use-hand-to-agent-state-Bbno11XR.js} +1 -1
  55. package/web/dist/assets/use-path-bases-DqgqcOdM.js +1 -0
  56. package/web/dist/assets/{workflows-DhW8Xvde.js → workflows-OsxhDzG9.js} +1 -1
  57. package/web/dist/assets/{workspace-tools-DzOGYPoN.js → workspace-tools-D6uFs3zu.js} +1 -1
  58. package/web/dist/assets/{worktrees-section-CfyXCPMF.js → worktrees-section-CzM3pU2A.js} +1 -1
  59. package/web/dist/index.html +2 -2
  60. package/web/dist/assets/automations-route-BxEJmAn2.js +0 -2
  61. package/web/dist/assets/index-DfudDolc.css +0 -1
  62. package/web/dist/assets/use-path-bases-DuMOLy3W.js +0 -1
@@ -121,12 +121,9 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
121
121
  } & {
122
122
  "/api/v1/tools/:name": {
123
123
  $post: {
124
- output: {
125
- code: string;
126
- message: string;
127
- };
124
+ output: never;
128
125
  outputFormat: "json";
129
- status: 401;
126
+ status: import("hono/utils/http-status").ContentfulStatusCode;
130
127
  input: {
131
128
  json: unknown;
132
129
  } & {
@@ -149,9 +146,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
149
146
  };
150
147
  };
151
148
  } | {
152
- output: never;
149
+ output: {
150
+ code: string;
151
+ message: string;
152
+ };
153
153
  outputFormat: "json";
154
- status: import("hono/utils/http-status").ContentfulStatusCode;
154
+ status: 401;
155
155
  input: {
156
156
  json: unknown;
157
157
  } & {
@@ -2,6 +2,18 @@ import type { DelegationRoutes } from './routes.ts';
2
2
  export declare function createDelegationApp(routes: DelegationRoutes): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
3
3
  "/list": {
4
4
  $get: {
5
+ output: {
6
+ error: string;
7
+ code?: "invalid_input" | undefined;
8
+ };
9
+ outputFormat: "json";
10
+ status: 400;
11
+ input: {
12
+ query: {
13
+ offset?: string | undefined;
14
+ };
15
+ };
16
+ } | {
5
17
  output: {
6
18
  workers: {
7
19
  workerId: string;
@@ -54,18 +66,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
54
66
  offset?: string | undefined;
55
67
  };
56
68
  };
57
- } | {
58
- output: {
59
- error: string;
60
- code?: "invalid_input" | undefined;
61
- };
62
- outputFormat: "json";
63
- status: 400;
64
- input: {
65
- query: {
66
- offset?: string | undefined;
67
- };
68
- };
69
69
  };
70
70
  };
71
71
  } & {
@@ -652,6 +652,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
652
652
  } & {
653
653
  "/:workerId": {
654
654
  $get: {
655
+ output: {
656
+ error: string;
657
+ code?: "invalid_input" | undefined;
658
+ };
659
+ outputFormat: "json";
660
+ status: 400;
661
+ input: {
662
+ param: {
663
+ workerId: string;
664
+ };
665
+ };
666
+ } | {
655
667
  output: {
656
668
  workerId: string;
657
669
  settled: boolean;
@@ -776,7 +788,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
776
788
  workerId: string;
777
789
  };
778
790
  };
779
- } | {
791
+ };
792
+ };
793
+ } & {
794
+ "/:workerId/collect": {
795
+ $post: {
780
796
  output: {
781
797
  error: string;
782
798
  code?: "invalid_input" | undefined;
@@ -787,12 +803,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
787
803
  param: {
788
804
  workerId: string;
789
805
  };
806
+ } & {
807
+ json: Record<string, never>;
790
808
  };
791
- };
792
- };
793
- } & {
794
- "/:workerId/collect": {
795
- $post: {
809
+ } | {
796
810
  output: {
797
811
  workerId: string;
798
812
  parentRunId: string;
@@ -915,7 +929,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
915
929
  } & {
916
930
  json: Record<string, never>;
917
931
  };
918
- } | {
932
+ };
933
+ };
934
+ } & {
935
+ "/:workerId/steer": {
936
+ $post: {
919
937
  output: {
920
938
  error: string;
921
939
  code?: "invalid_input" | undefined;
@@ -927,13 +945,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
927
945
  workerId: string;
928
946
  };
929
947
  } & {
930
- json: Record<string, never>;
948
+ json: {
949
+ text: string;
950
+ };
931
951
  };
932
- };
933
- };
934
- } & {
935
- "/:workerId/steer": {
936
- $post: {
952
+ } | {
937
953
  output: {
938
954
  workerId: string;
939
955
  state: "delivered" | "queued";
@@ -949,7 +965,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
949
965
  text: string;
950
966
  };
951
967
  };
952
- } | {
968
+ };
969
+ };
970
+ } & {
971
+ "/:workerId/stop": {
972
+ $post: {
953
973
  output: {
954
974
  error: string;
955
975
  code?: "invalid_input" | undefined;
@@ -961,15 +981,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
961
981
  workerId: string;
962
982
  };
963
983
  } & {
964
- json: {
965
- text: string;
966
- };
984
+ json: Record<string, never>;
967
985
  };
968
- };
969
- };
970
- } & {
971
- "/:workerId/stop": {
972
- $post: {
986
+ } | {
973
987
  output: {
974
988
  workerId: string;
975
989
  state: "stopping" | "terminated";
@@ -983,7 +997,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
983
997
  } & {
984
998
  json: Record<string, never>;
985
999
  };
986
- } | {
1000
+ };
1001
+ };
1002
+ } & {
1003
+ "/:workerId/destroy": {
1004
+ $post: {
987
1005
  output: {
988
1006
  error: string;
989
1007
  code?: "invalid_input" | undefined;
@@ -995,13 +1013,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
995
1013
  workerId: string;
996
1014
  };
997
1015
  } & {
998
- json: Record<string, never>;
1016
+ json: {
1017
+ discardWork?: true | undefined;
1018
+ };
999
1019
  };
1000
- };
1001
- };
1002
- } & {
1003
- "/:workerId/destroy": {
1004
- $post: {
1020
+ } | {
1005
1021
  output: {
1006
1022
  workerId: string;
1007
1023
  state: "complete" | "incomplete";
@@ -1030,22 +1046,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1030
1046
  discardWork?: true | undefined;
1031
1047
  };
1032
1048
  };
1033
- } | {
1034
- output: {
1035
- error: string;
1036
- code?: "invalid_input" | undefined;
1037
- };
1038
- outputFormat: "json";
1039
- status: 400;
1040
- input: {
1041
- param: {
1042
- workerId: string;
1043
- };
1044
- } & {
1045
- json: {
1046
- discardWork?: true | undefined;
1047
- };
1048
- };
1049
1049
  } | {
1050
1050
  output: {
1051
1051
  workerId: string;
@@ -1081,13 +1081,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1081
1081
  "/:workerId/diff": {
1082
1082
  $get: {
1083
1083
  output: {
1084
- workerId: string;
1085
- baselineSha: string;
1086
- diff: string;
1087
- truncated: boolean;
1084
+ error: string;
1085
+ code?: "invalid_input" | undefined;
1088
1086
  };
1089
1087
  outputFormat: "json";
1090
- status: 200;
1088
+ status: 400;
1091
1089
  input: {
1092
1090
  param: {
1093
1091
  workerId: string;
@@ -1095,11 +1093,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1095
1093
  };
1096
1094
  } | {
1097
1095
  output: {
1098
- error: string;
1099
- code?: "invalid_input" | undefined;
1096
+ workerId: string;
1097
+ baselineSha: string;
1098
+ diff: string;
1099
+ truncated: boolean;
1100
1100
  };
1101
1101
  outputFormat: "json";
1102
- status: 400;
1102
+ status: 200;
1103
1103
  input: {
1104
1104
  param: {
1105
1105
  workerId: string;
@@ -58,6 +58,29 @@ export declare function ciProgressPlugs(): {
58
58
  export declare function createActivityRoutes(routeDeps: ActivityRouteDeps): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
59
59
  "/workspace/activity": {
60
60
  $get: {
61
+ output: {
62
+ error: string;
63
+ code?: "invalid_input" | undefined;
64
+ };
65
+ outputFormat: "json";
66
+ status: 400;
67
+ input: {
68
+ query: {
69
+ project?: string | undefined;
70
+ };
71
+ };
72
+ } | {
73
+ output: {
74
+ error: string;
75
+ };
76
+ outputFormat: "json";
77
+ status: 404 | 409 | 503;
78
+ input: {
79
+ query: {
80
+ project?: string | undefined;
81
+ };
82
+ };
83
+ } | {
61
84
  output: {
62
85
  generatedAt: string;
63
86
  projects: {
@@ -308,29 +331,6 @@ export declare function createActivityRoutes(routeDeps: ActivityRouteDeps): impo
308
331
  project?: string | undefined;
309
332
  };
310
333
  };
311
- } | {
312
- output: {
313
- error: string;
314
- code?: "invalid_input" | undefined;
315
- };
316
- outputFormat: "json";
317
- status: 400;
318
- input: {
319
- query: {
320
- project?: string | undefined;
321
- };
322
- };
323
- } | {
324
- output: {
325
- error: string;
326
- };
327
- outputFormat: "json";
328
- status: 404 | 409 | 503;
329
- input: {
330
- query: {
331
- project?: string | undefined;
332
- };
333
- };
334
334
  };
335
335
  };
336
336
  }, "/", "/workspace/activity">;
@@ -94,6 +94,8 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
94
94
  } | undefined;
95
95
  invalidAsk?: boolean | undefined;
96
96
  delegation?: {
97
+ role: "invalid";
98
+ } | {
97
99
  role: "root";
98
100
  conversation?: {
99
101
  messages: {
@@ -328,8 +330,6 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
328
330
  } | undefined;
329
331
  executionRevision?: number | undefined;
330
332
  executionStartSeq?: number | undefined;
331
- } | {
332
- role: "invalid";
333
333
  } | undefined;
334
334
  agentInputs?: {
335
335
  conversation?: {
@@ -1956,6 +1956,8 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
1956
1956
  } | undefined;
1957
1957
  invalidAsk?: boolean | undefined;
1958
1958
  delegation?: {
1959
+ role: "invalid";
1960
+ } | {
1959
1961
  role: "root";
1960
1962
  conversation?: {
1961
1963
  messages: {
@@ -2190,8 +2192,6 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
2190
2192
  } | undefined;
2191
2193
  executionRevision?: number | undefined;
2192
2194
  executionStartSeq?: number | undefined;
2193
- } | {
2194
- role: "invalid";
2195
2195
  } | undefined;
2196
2196
  agentInputs?: {
2197
2197
  conversation?: {
@@ -3171,6 +3171,8 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
3171
3171
  } | undefined;
3172
3172
  invalidAsk?: boolean | undefined;
3173
3173
  delegation?: {
3174
+ role: "invalid";
3175
+ } | {
3174
3176
  role: "root";
3175
3177
  conversation?: {
3176
3178
  messages: {
@@ -3405,8 +3407,6 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
3405
3407
  } | undefined;
3406
3408
  executionRevision?: number | undefined;
3407
3409
  executionStartSeq?: number | undefined;
3408
- } | {
3409
- role: "invalid";
3410
3410
  } | undefined;
3411
3411
  agentInputs?: {
3412
3412
  conversation?: {
@@ -5142,6 +5142,8 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
5142
5142
  currentStepId?: string | undefined;
5143
5143
  error?: string | undefined;
5144
5144
  delegation?: {
5145
+ role: "invalid";
5146
+ } | {
5145
5147
  role: "root";
5146
5148
  conversation?: {
5147
5149
  messages: {
@@ -5376,8 +5378,6 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
5376
5378
  } | undefined;
5377
5379
  executionRevision?: number | undefined;
5378
5380
  executionStartSeq?: number | undefined;
5379
- } | {
5380
- role: "invalid";
5381
5381
  } | undefined;
5382
5382
  lastWaitsError?: string | undefined;
5383
5383
  automaticWakes?: number | undefined;
@@ -5626,6 +5626,8 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
5626
5626
  } | undefined;
5627
5627
  invalidAsk?: boolean | undefined;
5628
5628
  delegation?: {
5629
+ role: "invalid";
5630
+ } | {
5629
5631
  role: "root";
5630
5632
  conversation?: {
5631
5633
  messages: {
@@ -5860,8 +5862,6 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
5860
5862
  } | undefined;
5861
5863
  executionRevision?: number | undefined;
5862
5864
  executionStartSeq?: number | undefined;
5863
- } | {
5864
- role: "invalid";
5865
5865
  } | undefined;
5866
5866
  agentInputs?: {
5867
5867
  conversation?: {
@@ -6817,6 +6817,8 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
6817
6817
  } | undefined;
6818
6818
  invalidAsk?: boolean | undefined;
6819
6819
  delegation?: {
6820
+ role: "invalid";
6821
+ } | {
6820
6822
  role: "root";
6821
6823
  conversation?: {
6822
6824
  messages: {
@@ -7051,8 +7053,6 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
7051
7053
  } | undefined;
7052
7054
  executionRevision?: number | undefined;
7053
7055
  executionStartSeq?: number | undefined;
7054
- } | {
7055
- role: "invalid";
7056
7056
  } | undefined;
7057
7057
  agentInputs?: {
7058
7058
  conversation?: {
@@ -8735,6 +8735,8 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
8735
8735
  currentStepId?: string | undefined;
8736
8736
  error?: string | undefined;
8737
8737
  delegation?: {
8738
+ role: "invalid";
8739
+ } | {
8738
8740
  role: "root";
8739
8741
  conversation?: {
8740
8742
  messages: {
@@ -8969,8 +8971,6 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
8969
8971
  } | undefined;
8970
8972
  executionRevision?: number | undefined;
8971
8973
  executionStartSeq?: number | undefined;
8972
- } | {
8973
- role: "invalid";
8974
8974
  } | undefined;
8975
8975
  lastWaitsError?: string | undefined;
8976
8976
  automaticWakes?: number | undefined;
@@ -9279,6 +9279,8 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
9279
9279
  } | undefined;
9280
9280
  invalidAsk?: boolean | undefined;
9281
9281
  delegation?: {
9282
+ role: "invalid";
9283
+ } | {
9282
9284
  role: "root";
9283
9285
  conversation?: {
9284
9286
  messages: {
@@ -9513,8 +9515,6 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
9513
9515
  } | undefined;
9514
9516
  executionRevision?: number | undefined;
9515
9517
  executionStartSeq?: number | undefined;
9516
- } | {
9517
- role: "invalid";
9518
9518
  } | undefined;
9519
9519
  agentInputs?: {
9520
9520
  conversation?: {
@@ -11387,6 +11387,8 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
11387
11387
  currentStepId?: string | undefined;
11388
11388
  error?: string | undefined;
11389
11389
  delegation?: {
11390
+ role: "invalid";
11391
+ } | {
11390
11392
  role: "root";
11391
11393
  conversation?: {
11392
11394
  messages: {
@@ -11621,8 +11623,6 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
11621
11623
  } | undefined;
11622
11624
  executionRevision?: number | undefined;
11623
11625
  executionStartSeq?: number | undefined;
11624
- } | {
11625
- role: "invalid";
11626
11626
  } | undefined;
11627
11627
  lastWaitsError?: string | undefined;
11628
11628
  automaticWakes?: number | undefined;
@@ -12496,9 +12496,9 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
12496
12496
  status: import("hono/utils/http-status").ContentfulStatusCode;
12497
12497
  input: {
12498
12498
  param: {
12499
- id: string;
12500
- } & {
12501
12499
  sha: string;
12500
+ } & {
12501
+ id: string;
12502
12502
  };
12503
12503
  };
12504
12504
  } | {
@@ -12509,9 +12509,9 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
12509
12509
  status: 404 | 409;
12510
12510
  input: {
12511
12511
  param: {
12512
- id: string;
12513
- } & {
12514
12512
  sha: string;
12513
+ } & {
12514
+ id: string;
12515
12515
  };
12516
12516
  };
12517
12517
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hearsay-tools/squawk",
3
- "version": "0.19.0-dev.8936",
3
+ "version": "0.19.0-dev.8945",
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",
@@ -69,8 +69,8 @@
69
69
  "devDependencies": {
70
70
  "@babel/parser": "^8.0.8",
71
71
  "@babel/types": "^8.0.8",
72
- "@open-mercato/cezar-api-client": "0.19.0-dev.8936",
73
- "@open-mercato/cezar-contract": "0.19.0-dev.8936",
72
+ "@open-mercato/cezar-api-client": "0.19.0-dev.8945",
73
+ "@open-mercato/cezar-contract": "0.19.0-dev.8945",
74
74
  "@types/node": "^24.19.1",
75
75
  "@types/ws": "^8.18.1",
76
76
  "esbuild": "^0.28.1",
@@ -87,5 +87,5 @@
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  },
90
- "gitHead": "6abbbcd1a020c3e1bcaee71b72099ceb8f7ca8a9"
90
+ "gitHead": "6c1c3b16451cefa368ff6b525d745f8cdfa0a528"
91
91
  }
@@ -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{$t as r,Ct as i,Dt as a,It as o,Nt as s,Qt as c,Xt as l,Yt as u,dn as d,dt as f,mt as p,on as m,pt as h,rn as g,ut as _,wt as v,yt as y}from"./queries-CIeJg62Y.js";import{Fn as b,Fr as x,In as S,hi as ee,ii as C,n as w,zn as T}from"./toaster-D0HMoto5.js";import{f as E}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{b as D}from"./design-icons-BZt8Kqs9.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as te}from"./folder-browser-BSGB9hhQ.js";import{t as k}from"./button-C8jUIs8Q.js";import{t as ne}from"./badge-B6B-xYQQ.js";import{a as re,i as ie,o as ae,r as oe,s as se,t as A}from"./dialog-CB9ZhEk2.js";import{t as j}from"./status-dot-BXf-Ubd0.js";import{n as M}from"./agents-settings-path-7X6_cvUg.js";import{t as N}from"./centered-state-BgSV4e79.js";import{A as P,Dn as F,Gt as I,Jt as L,Kt as R,M as z,On as B,P as V,Rn as H,Wt as U,Xt as W,Yt as G,Zt as K,qt as ce,wn as le}from"./index-DCiyvOmJ.js";import{t as q}from"./option-select-Cdd2UPAV.js";import{n as J,r as ue,t as de}from"./settings-agent-picker-BJ4aWg6X.js";import{n as fe,r as pe,t as me}from"./remote-settings-notice-De6tIJ-L.js";import{n as he,t as ge}from"./save-cue-CpHgT93o.js";import{t as _e}from"./use-path-bases-DuMOLy3W.js";import{t as ve}from"./use-workspace-config-save-bZksgjRK.js";var ye=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`}]]),Y=e(t(),1),X=n(),be=`~/.claude-second`;function xe({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=g().data,[a,o]=(0,Y.useState)(null),[s,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(r??n[0]??`claude`),[m,h]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=p(),S=_.trim();return(0,X.jsx)(A,{open:e,onOpenChange:t,children:(0,X.jsxs)(oe,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(ae,{children:[(0,X.jsx)(se,{children:`Add agent account`}),(0,X.jsx)(ie,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,X.jsx)(q,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:d,onValueChange:e=>f(e),className:`settings-select max-w-full bg-card text-[13px]`,options:n.map(e=>({value:e,label:l(i,e)}))})]}),(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,X.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:m,placeholder:`Work`,onChange:e=>h(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,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,X.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:_,placeholder:c(i,d)?.accountFolderExample??be,onChange:e=>{v(e.target.value),u(null),x.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,X.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":y,onClick:()=>b(e=>!e),children:y?`Hide folders`:`Browse…`})]}),(0,X.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[`A `,(0,X.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),y?(0,X.jsx)(te,{path:a,selected:s,onSelect:e=>{u(e),v(e.path),x.reset()},onEnter:e=>{o(e),u(null),x.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,x.isError?(0,X.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:x.error instanceof Error?x.error.message:`could not add that folder`}):null,(0,X.jsxs)(re,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(k,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(k,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:d,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),h(``),v(``),u(null),b(!1),w(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function Se(e){return T(await S.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function Ce(e,t){return T(await S.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var we={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function Te(e){let t=y().data?.capabilities?.settingsAdmin===!0,n=ee(),r=[`runner-install`,e],i=C({queryKey:r,queryFn:()=>Se(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=d({mutationFn:t=>Ce(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),o=i.data;return{allowed:t,data:o,busy:a.isPending||!!o&&o.phase!==`idle`&&o.phase!==`failed`,error:a.error?.message??i.error?.message??o?.error,action:a,status:i}}function Ee({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,X.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function De({runner:e}){let t=Te(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,X.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,X.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?` · ${we[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(Ee,{state:t}),r?.installedVersion?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var Oe={connected:B(`connected`),disconnected:B(`disconnected`),"not-installed":B(`not-installed`),unknown:B(`unknown`)};function ke(){let e=f(),t=g();if(e.isPending||t.isPending)return(0,X.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,X.jsx)(N,{icon:(0,X.jsx)(ye,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(je,{data:e.data,runners:t.data})}function Z(e,t){let n=H(e,t),r=n.split(`/`);return r.length>4?`…/${r.slice(-3).join(`/`)}`:n}function Ae(){let{hash:e}=E();(0,Y.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function je({data:e,runners:t}){let n=y(),[r,i]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=a();return Ae(),pe(),(0,X.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,X.jsx)(fe,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,X.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-muted-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,X.jsx)(`code`,{children:me}),` on the host to add, edit, or sign in to accounts here.`]}),(0,X.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-3`,children:t.runners.map(r=>(0,X.jsx)(Fe,{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:s},r.id))}),(0,X.jsx)(Ie,{runners:t}),r===null?null:(0,X.jsx)(xe,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(U,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,X.jsxs)(ce,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(W,{children:[(0,X.jsxs)(K,{children:[`Remove “`,o?.label,`”?`]}),(0,X.jsxs)(L,{children:[`This only forgets the account. Nothing in `,o?.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,X.jsxs)(G,{children:[(0,X.jsx)(R,{children:`Cancel`}),(0,X.jsx)(I,{"data-action":`accounts-remove-confirm`,disabled:c.isPending,onClick:()=>{let e=o;e&&c.mutate(e.id,{onSuccess:()=>{s(null),w(`Removed ${e.label}`)},onError:e=>w(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Me({entry:e,check:t}){return t===void 0?(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking CLI…`}):t.available?(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:F(t.version)?`CLI simulated`:`CLI installed`}),t.version?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}),(0,X.jsx)(Ne,{version:t.version})]}):null]}):(0,X.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`CLI not installed`,e.installHint?(0,X.jsxs)(X.Fragment,{children:[` — `,(0,X.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}function Ne({version:e}){return F(e)?(0,X.jsx)(`span`,{"data-slot":`agent-version`,"data-dry-run":``,title:e,className:`rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:le.label}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`, version `}),(0,X.jsx)(`span`,{"data-slot":`agent-version`,className:`text-muted-foreground`,children:e})]})}function Pe({items:e}){let t=e.filter(e=>e!=null&&e!==!1);return t.length===0?null:(0,X.jsx)(`p`,{"data-slot":`agent-summary`,className:`settings-agent-summary`,children:t.map((e,t)=>(0,X.jsxs)(`span`,{className:`settings-agent-summary-item`,children:[t>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}):null,e]},t))})}function Q({titleId:e,title:t,summary:n,actions:r,actionsSlot:i}){return(0,X.jsxs)(`div`,{"data-slot":`agent-head`,className:`settings-agent-head`,children:[(0,X.jsxs)(`div`,{className:`settings-agent-heading`,children:[(0,X.jsx)(`h3`,{id:e,className:`settings-account-provider-title`,children:t}),(0,X.jsx)(Pe,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Fe({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.displayName,d=e.managedInstall===!0&&n,f=a.filter(e=>e.isDefault).length,p=`${M(l)}-title`,m=i&&o?(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`}):null,h={titleId:p,title:u,facts:[d?null:(0,X.jsx)(Me,{entry:e,check:t}),i||a.length>0?(0,X.jsxs)(`span`,{className:`settings-account-count`,title:`${f} discovered, ${a.length-f} added`,children:[a.length,` `,a.length===1?`account`:`accounts`]}):null],addButton:m},[g,..._]=a;return(0,X.jsxs)(`section`,{id:M(l),tabIndex:-1,"aria-labelledby":p,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col rounded-lg border border-border bg-card`,children:[g===void 0?(0,X.jsx)(Q,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(De,{runner:l}):null,g===void 0?null:(0,X.jsxs)(`ul`,{className:`settings-agent-accounts`,children:[(0,X.jsx)($,{account:g,runners:r,editable:i,onRemove:()=>c(g),agent:h}),_.map(e=>(0,X.jsx)($,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))]}),i&&!o?(0,X.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`settings-agent-note`,children:[`One account only: `,u,` keeps its login outside its config folder, so a second folder would change settings without changing who is billed.`]}):!i&&a.length===0&&e.browserLogin?(0,X.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`settings-agent-note flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(`span`,{children:`Discovered account`}),(0,X.jsx)(J,{provider:l,label:u})]}):null]})}function Ie({runners:e}){let[t,n]=(0,Y.useState)(null),a=o(),s=i(),c=m(r(e)),l=ve(),d=he(),f=e=>l.mutate(e,{onSuccess:d.flash});if(a.data===void 0)return null;let p=ue([],e),h=a.data.agentDefaults.runner??`claude`,g=u(t??h,r(e))??t??h,_=a.data.agentDefaults.models??{};return(0,X.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,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,X.jsxs)(`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,X.jsx)(ge,{saved:d.saved})]})]}),(0,X.jsx)(de,{rows:p,runner:h,accountFor:()=>null,providerStatus:s,disabled:l.isPending,onPick:e=>{e!==h&&f({agentDefaults:{runner:e}})}}),(0,X.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,X.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,X.jsx)(`span`,{children:`Default model for`}),(0,X.jsx)(q,{"aria-label":`Model agent`,className:`settings-select max-w-full`,value:g,onValueChange:e=>n(e),options:e.runners.map(e=>({value:e.id,label:e.displayName}))})]}),e.runners.filter(e=>e.id===g).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(D,{className:`size-4 text-accent-icon shrink-0`}),(0,X.jsx)(`span`,{className:`w-28 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,X.jsx)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:_[t.id]??``,disabled:l.isPending,onValueChange:e=>f({agentDefaults:{models:{[t.id]:e||null}}}),className:`settings-select w-64 max-w-full bg-card`,options:[...V(t.id,e,c[t.id]?.data,[_[t.id]]).map(e=>({value:e.id,label:e.label})),...Le(t.id,e,c[t.id])]})]},t.id))]})]})}function Le(e,t,n){let r=z(e,t,n);return r?[{value:P,label:r,disabled:!0}]:[]}function Re({account:e,runners:t,status:n,editable:r}){let i=h();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&c(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,r&&n&&n.status!==`connected`&&c(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(k,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:i.isPending,onClick:()=>i.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>w(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>w(e instanceof b&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function ze(e,t,n,r){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?{slot:`account-unrecognised`,label:`Unrecognized folder`,guidance:`This folder does not look like ${l(t,e.provider)} config yet.`}:null:{slot:`account-missing`,label:`Not initialized`,guidance:r?n.status===`connected`?`Folder not created yet. Use Check again to refresh.`:`Folder not created yet. Connect will make it.`:`Folder not created on the host yet.`}}function $({account:e,runners:t,editable:n,onRemove:r,agent:i}){let a=x(e),o=v(),s=_e(),c=_(a,e.status===void 0),l=e.status??c.data?.status,u=l?Oe[l.status]:void 0,d=ze(e,t,l,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:u?`Sign-in: ${u.label}`:void 0,children:[(0,X.jsx)(j,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":d.slot,className:`text-foreground`,children:d.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(j,{tone:u?.tone??`neutral`,pulse:u===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:u?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Re,{account:e,runners:t,status:l,editable:n}),(0,X.jsx)(k,{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=>w(e.message,{tone:`danger`})}),children:`Check again`})]}),m=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(ne,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-xs font-normal text-muted-foreground`,children:`discovered`}):null]}),h=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Z(e.configDir,s)}):null,g=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=l?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:l.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Be,{account:e,onRemove:r}):null,S=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),h,g,y]});return i?(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,"data-primary":``,className:`settings-account-primary`,children:[(0,X.jsx)(Q,{titleId:i.titleId,title:i.title,summary:i.facts,actions:(0,X.jsxs)(X.Fragment,{children:[p,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[S,b?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:b}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[S,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Be({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=s();return(0,X.jsx)(X.Fragment,{children:e.isDefault?null:(0,X.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.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,X.jsx)(k,{type:`button`,variant:`outline`,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=>w(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{ke 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{$t as r,Ct as i,Dt as a,It as o,Nt as s,Qt as c,Xt as l,Yt as u,dn as d,dt as f,mt as p,on as m,pt as h,rn as g,ut as _,wt as v,yt as y}from"./queries-CIeJg62Y.js";import{Fn as b,Fr as x,In as S,hi as ee,ii as C,n as w,zn as T}from"./toaster-D0HMoto5.js";import{f as E}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{b as D}from"./design-icons-BZt8Kqs9.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as te}from"./folder-browser-BSGB9hhQ.js";import{t as k}from"./button-C8jUIs8Q.js";import{t as ne}from"./badge-B6B-xYQQ.js";import{a as re,i as ie,o as ae,r as oe,s as se,t as A}from"./dialog-CB9ZhEk2.js";import{t as j}from"./status-dot-BXf-Ubd0.js";import{n as M}from"./agents-settings-path-7X6_cvUg.js";import{t as N}from"./centered-state-BgSV4e79.js";import{A as P,Dn as F,Gt as I,Jt as L,Kt as R,M as z,On as B,P as V,Rn as H,Wt as U,Xt as W,Yt as G,Zt as K,qt as ce,wn as le}from"./index-BdwJdyhu.js";import{t as q}from"./option-select-DYOZPdHh.js";import{n as J,r as ue,t as de}from"./settings-agent-picker-Cc9EbxOn.js";import{n as fe,r as pe,t as me}from"./remote-settings-notice-C8ISDWAZ.js";import{n as he,t as ge}from"./save-cue-CpHgT93o.js";import{t as _e}from"./use-path-bases-DqgqcOdM.js";import{t as ve}from"./use-workspace-config-save-bZksgjRK.js";var ye=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`}]]),Y=e(t(),1),X=n(),be=`~/.claude-second`;function xe({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=g().data,[a,o]=(0,Y.useState)(null),[s,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(r??n[0]??`claude`),[m,h]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=p(),S=_.trim();return(0,X.jsx)(A,{open:e,onOpenChange:t,children:(0,X.jsxs)(oe,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(ae,{children:[(0,X.jsx)(se,{children:`Add agent account`}),(0,X.jsx)(ie,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,X.jsx)(q,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:d,onValueChange:e=>f(e),className:`settings-select max-w-full bg-card text-[13px]`,options:n.map(e=>({value:e,label:l(i,e)}))})]}),(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,X.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:m,placeholder:`Work`,onChange:e=>h(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,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,X.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:_,placeholder:c(i,d)?.accountFolderExample??be,onChange:e=>{v(e.target.value),u(null),x.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,X.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":y,onClick:()=>b(e=>!e),children:y?`Hide folders`:`Browse…`})]}),(0,X.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[`A `,(0,X.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),y?(0,X.jsx)(te,{path:a,selected:s,onSelect:e=>{u(e),v(e.path),x.reset()},onEnter:e=>{o(e),u(null),x.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,x.isError?(0,X.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:x.error instanceof Error?x.error.message:`could not add that folder`}):null,(0,X.jsxs)(re,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(k,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(k,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:d,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),h(``),v(``),u(null),b(!1),w(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function Se(e){return T(await S.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function Ce(e,t){return T(await S.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var we={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function Te(e){let t=y().data?.capabilities?.settingsAdmin===!0,n=ee(),r=[`runner-install`,e],i=C({queryKey:r,queryFn:()=>Se(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=d({mutationFn:t=>Ce(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),o=i.data;return{allowed:t,data:o,busy:a.isPending||!!o&&o.phase!==`idle`&&o.phase!==`failed`,error:a.error?.message??i.error?.message??o?.error,action:a,status:i}}function Ee({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,X.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function De({runner:e}){let t=Te(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,X.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,X.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?` · ${we[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(Ee,{state:t}),r?.installedVersion?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var Oe={connected:B(`connected`),disconnected:B(`disconnected`),"not-installed":B(`not-installed`),unknown:B(`unknown`)};function ke(){let e=f(),t=g();if(e.isPending||t.isPending)return(0,X.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,X.jsx)(N,{icon:(0,X.jsx)(ye,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(je,{data:e.data,runners:t.data})}function Z(e,t){let n=H(e,t),r=n.split(`/`);return r.length>4?`…/${r.slice(-3).join(`/`)}`:n}function Ae(){let{hash:e}=E();(0,Y.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function je({data:e,runners:t}){let n=y(),[r,i]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=a();return Ae(),pe(),(0,X.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,X.jsx)(fe,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,X.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-muted-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,X.jsx)(`code`,{children:me}),` on the host to add, edit, or sign in to accounts here.`]}),(0,X.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-3`,children:t.runners.map(r=>(0,X.jsx)(Fe,{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:s},r.id))}),(0,X.jsx)(Ie,{runners:t}),r===null?null:(0,X.jsx)(xe,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(U,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,X.jsxs)(ce,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(W,{children:[(0,X.jsxs)(K,{children:[`Remove “`,o?.label,`”?`]}),(0,X.jsxs)(L,{children:[`This only forgets the account. Nothing in `,o?.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,X.jsxs)(G,{children:[(0,X.jsx)(R,{children:`Cancel`}),(0,X.jsx)(I,{"data-action":`accounts-remove-confirm`,disabled:c.isPending,onClick:()=>{let e=o;e&&c.mutate(e.id,{onSuccess:()=>{s(null),w(`Removed ${e.label}`)},onError:e=>w(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Me({entry:e,check:t}){return t===void 0?(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking CLI…`}):t.available?(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:F(t.version)?`CLI simulated`:`CLI installed`}),t.version?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}),(0,X.jsx)(Ne,{version:t.version})]}):null]}):(0,X.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`CLI not installed`,e.installHint?(0,X.jsxs)(X.Fragment,{children:[` — `,(0,X.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}function Ne({version:e}){return F(e)?(0,X.jsx)(`span`,{"data-slot":`agent-version`,"data-dry-run":``,title:e,className:`rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:le.label}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`, version `}),(0,X.jsx)(`span`,{"data-slot":`agent-version`,className:`text-muted-foreground`,children:e})]})}function Pe({items:e}){let t=e.filter(e=>e!=null&&e!==!1);return t.length===0?null:(0,X.jsx)(`p`,{"data-slot":`agent-summary`,className:`settings-agent-summary`,children:t.map((e,t)=>(0,X.jsxs)(`span`,{className:`settings-agent-summary-item`,children:[t>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}):null,e]},t))})}function Q({titleId:e,title:t,summary:n,actions:r,actionsSlot:i}){return(0,X.jsxs)(`div`,{"data-slot":`agent-head`,className:`settings-agent-head`,children:[(0,X.jsxs)(`div`,{className:`settings-agent-heading`,children:[(0,X.jsx)(`h3`,{id:e,className:`settings-account-provider-title`,children:t}),(0,X.jsx)(Pe,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Fe({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.displayName,d=e.managedInstall===!0&&n,f=a.filter(e=>e.isDefault).length,p=`${M(l)}-title`,m=i&&o?(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`}):null,h={titleId:p,title:u,facts:[d?null:(0,X.jsx)(Me,{entry:e,check:t}),i||a.length>0?(0,X.jsxs)(`span`,{className:`settings-account-count`,title:`${f} discovered, ${a.length-f} added`,children:[a.length,` `,a.length===1?`account`:`accounts`]}):null],addButton:m},[g,..._]=a;return(0,X.jsxs)(`section`,{id:M(l),tabIndex:-1,"aria-labelledby":p,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col rounded-lg border border-border bg-card`,children:[g===void 0?(0,X.jsx)(Q,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(De,{runner:l}):null,g===void 0?null:(0,X.jsxs)(`ul`,{className:`settings-agent-accounts`,children:[(0,X.jsx)($,{account:g,runners:r,editable:i,onRemove:()=>c(g),agent:h}),_.map(e=>(0,X.jsx)($,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))]}),i&&!o?(0,X.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`settings-agent-note`,children:[`One account only: `,u,` keeps its login outside its config folder, so a second folder would change settings without changing who is billed.`]}):!i&&a.length===0&&e.browserLogin?(0,X.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`settings-agent-note flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(`span`,{children:`Discovered account`}),(0,X.jsx)(J,{provider:l,label:u})]}):null]})}function Ie({runners:e}){let[t,n]=(0,Y.useState)(null),a=o(),s=i(),c=m(r(e)),l=ve(),d=he(),f=e=>l.mutate(e,{onSuccess:d.flash});if(a.data===void 0)return null;let p=ue([],e),h=a.data.agentDefaults.runner??`claude`,g=u(t??h,r(e))??t??h,_=a.data.agentDefaults.models??{};return(0,X.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,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,X.jsxs)(`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,X.jsx)(ge,{saved:d.saved})]})]}),(0,X.jsx)(de,{rows:p,runner:h,accountFor:()=>null,providerStatus:s,disabled:l.isPending,onPick:e=>{e!==h&&f({agentDefaults:{runner:e}})}}),(0,X.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,X.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,X.jsx)(`span`,{children:`Default model for`}),(0,X.jsx)(q,{"aria-label":`Model agent`,className:`settings-select max-w-full`,value:g,onValueChange:e=>n(e),options:e.runners.map(e=>({value:e.id,label:e.displayName}))})]}),e.runners.filter(e=>e.id===g).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(D,{className:`size-4 text-accent-icon shrink-0`}),(0,X.jsx)(`span`,{className:`w-28 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,X.jsx)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:_[t.id]??``,disabled:l.isPending,onValueChange:e=>f({agentDefaults:{models:{[t.id]:e||null}}}),className:`settings-select w-64 max-w-full bg-card`,options:[...V(t.id,e,c[t.id]?.data,[_[t.id]]).map(e=>({value:e.id,label:e.label})),...Le(t.id,e,c[t.id])]})]},t.id))]})]})}function Le(e,t,n){let r=z(e,t,n);return r?[{value:P,label:r,disabled:!0}]:[]}function Re({account:e,runners:t,status:n,editable:r}){let i=h();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&c(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,r&&n&&n.status!==`connected`&&c(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(k,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:i.isPending,onClick:()=>i.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>w(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>w(e instanceof b&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function ze(e,t,n,r){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?{slot:`account-unrecognised`,label:`Unrecognized folder`,guidance:`This folder does not look like ${l(t,e.provider)} config yet.`}:null:{slot:`account-missing`,label:`Not initialized`,guidance:r?n.status===`connected`?`Folder not created yet. Use Check again to refresh.`:`Folder not created yet. Connect will make it.`:`Folder not created on the host yet.`}}function $({account:e,runners:t,editable:n,onRemove:r,agent:i}){let a=x(e),o=v(),s=_e(),c=_(a,e.status===void 0),l=e.status??c.data?.status,u=l?Oe[l.status]:void 0,d=ze(e,t,l,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:u?`Sign-in: ${u.label}`:void 0,children:[(0,X.jsx)(j,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":d.slot,className:`text-foreground`,children:d.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(j,{tone:u?.tone??`neutral`,pulse:u===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:u?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Re,{account:e,runners:t,status:l,editable:n}),(0,X.jsx)(k,{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=>w(e.message,{tone:`danger`})}),children:`Check again`})]}),m=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(ne,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-xs font-normal text-muted-foreground`,children:`discovered`}):null]}),h=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Z(e.configDir,s)}):null,g=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=l?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:l.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Be,{account:e,onRemove:r}):null,S=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),h,g,y]});return i?(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,"data-primary":``,className:`settings-account-primary`,children:[(0,X.jsx)(Q,{titleId:i.titleId,title:i.title,summary:i.facts,actions:(0,X.jsxs)(X.Fragment,{children:[p,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[S,b?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:b}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[S,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Be({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=s();return(0,X.jsx)(X.Fragment,{children:e.isDefault?null:(0,X.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.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,X.jsx)(k,{type:`button`,variant:`outline`,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=>w(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{ke as GlobalAgentsSection};