@hearsay-tools/squawk 0.19.0-pr4426.8671 → 0.19.0-pr4428.8677

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 (87) hide show
  1. package/dist/contract/index.js +2 -32
  2. package/dist/contract/repo-requests.d.ts +1 -9
  3. package/dist/contract/repo.d.ts +2 -39
  4. package/dist/git-worktree.d.ts +0 -9
  5. package/dist/git-worktree.js +3 -113
  6. package/dist/git-worktree.js.map +1 -1
  7. package/dist/preview/chromium.d.ts +3 -2
  8. package/dist/preview/chromium.js +5 -1
  9. package/dist/preview/chromium.js.map +1 -1
  10. package/dist/runs/retention.d.ts +0 -6
  11. package/dist/runs/retention.js +3 -7
  12. package/dist/runs/retention.js.map +1 -1
  13. package/dist/server/repo-routes.d.ts +14 -40
  14. package/dist/server/repo-routes.js +15 -30
  15. package/dist/server/repo-routes.js.map +1 -1
  16. package/dist/server/run-checkout.d.ts +1 -1
  17. package/dist/server/run-checkout.js +7 -20
  18. package/dist/server/run-checkout.js.map +1 -1
  19. package/dist/server/server.d.ts +60 -112
  20. package/dist/server/worktree-size-cache.d.ts +0 -11
  21. package/dist/server/worktree-size-cache.js +1 -3
  22. package/dist/server/worktree-size-cache.js.map +1 -1
  23. package/package.json +4 -4
  24. package/web/dist/assets/{accounts-section-vKkfS7YX.js → accounts-section-RDVTJfi7.js} +1 -1
  25. package/web/dist/assets/{activity-motion-DQoK98JL.js → activity-motion-B7km8QVK.js} +1 -1
  26. package/web/dist/assets/{activity-route-snD0tuxO.js → activity-route-CjE0yxn0.js} +1 -1
  27. package/web/dist/assets/{agent-config-section-DoleNTpD.js → agent-config-section-DQ1RaVK2.js} +1 -1
  28. package/web/dist/assets/{agent-defaults-section-ysitxF4K.js → agent-defaults-section-Dzm7jIza.js} +1 -1
  29. package/web/dist/assets/{appearance-DVdKOCpj.js → appearance-DQLHHfI4.js} +1 -1
  30. package/web/dist/assets/{archive-on-merge-field-DrgP61Ey.js → archive-on-merge-field-C7_Fwy2A.js} +1 -1
  31. package/web/dist/assets/attention-CBCeJN5w.js +1 -0
  32. package/web/dist/assets/{automations-route-FZreqZEC.js → automations-route-BcdL5f0K.js} +1 -1
  33. package/web/dist/assets/{commit-list-_lCNrPe9.js → commit-list-CN1zX-0X.js} +1 -1
  34. package/web/dist/assets/{diff-controls-BEdzHFBp.js → diff-controls-BRa3141W.js} +1 -1
  35. package/web/dist/assets/{diff-B5kvGFig.js → diff-hxqBOfZH.js} +2 -2
  36. package/web/dist/assets/{diff-view-Cn75jglS.js → diff-view-CwlKCj5V.js} +1 -1
  37. package/web/dist/assets/{file-preview-DOCPVTlT.js → file-preview-VvCzp02k.js} +1 -1
  38. package/web/dist/assets/{folder-browser-DAam7eGA.js → folder-browser-B7IbnF0d.js} +1 -1
  39. package/web/dist/assets/{git-toolbar-CZVQtcyI.js → git-toolbar-BulcGzsv.js} +1 -1
  40. package/web/dist/assets/{github-B4nythBc.js → github-By3yOcFH.js} +1 -1
  41. package/web/dist/assets/{global-activity-route-CRiXcL16.js → global-activity-route-C4-bmfh_.js} +1 -1
  42. package/web/dist/assets/{image-preview-BHVPu_Ot.js → image-preview-Pgf8bnzY.js} +1 -1
  43. package/web/dist/assets/index-C69_Sk06.css +1 -0
  44. package/web/dist/assets/{index-CFtjrhlQ.js → index-DNQcTHxV.js} +5 -5
  45. package/web/dist/assets/{label-BqslTY3y.js → label-Bt8n7Spq.js} +1 -1
  46. package/web/dist/assets/{live-reads-CYQJSB0x.js → live-reads-Crd6fVGH.js} +1 -1
  47. package/web/dist/assets/{markdown-ZJPe40Kg.js → markdown-9L65ixU6.js} +1 -1
  48. package/web/dist/assets/{notifications-section-BAxVmNvS.js → notifications-section-QWmuj2j2.js} +1 -1
  49. package/web/dist/assets/{open-in-menu-C8XOuvhZ.js → open-in-menu-BPp88ouw.js} +1 -1
  50. package/web/dist/assets/{preview-pane-connected-o04x4ut2.js → preview-pane-connected-DAM2Snwh.js} +1 -1
  51. package/web/dist/assets/{project-location-C5wL8Cmv.js → project-location-BRxXN249.js} +1 -1
  52. package/web/dist/assets/{project-router-Djen61eU.js → project-router-CLJTc7gv.js} +1 -1
  53. package/web/dist/assets/{project-scope-context-DBPcPWqF.js → project-scope-context-Rv6S_BXt.js} +1 -1
  54. package/web/dist/assets/{projects-section-DjW4lZdo.js → projects-section-DxubjpZI.js} +1 -1
  55. package/web/dist/assets/{prompt-templates-section-BZ9kPTz8.js → prompt-templates-section-CkQneT1G.js} +1 -1
  56. package/web/dist/assets/{queries-B27CAXOU.js → queries-qCF-eOqZ.js} +1 -1
  57. package/web/dist/assets/{reference-chip-BvcSKzIw.js → reference-chip-D0v0keVC.js} +1 -1
  58. package/web/dist/assets/{remote-settings-notice-B7px6Rjz.js → remote-settings-notice-COojb6XK.js} +1 -1
  59. package/web/dist/assets/repo-git-Mgk4Qcmo.js +1 -0
  60. package/web/dist/assets/{report-reader-CFDdbV9p.js → report-reader-zWwalJDN.js} +1 -1
  61. package/web/dist/assets/{reports-C_oLuf2Z.js → reports-BCHWt3zy.js} +1 -1
  62. package/web/dist/assets/{resources-section-DPKpkT00.js → resources-section-Cb2WIqNv.js} +1 -1
  63. package/web/dist/assets/{run-header-Cvjx6fLe.js → run-header-DeprqSP7.js} +1 -1
  64. package/web/dist/assets/{select-DCgMFs3P.js → select-y3oRuA2s.js} +1 -1
  65. package/web/dist/assets/{session-context-section-DUDyUnD6.js → session-context-section-CiPNMiL7.js} +1 -1
  66. package/web/dist/assets/{settings-agent-picker-Dj9w9Rqy.js → settings-agent-picker-CJJJncuA.js} +1 -1
  67. package/web/dist/assets/{settings-shell-Dj0lpmcY.js → settings-shell-CLToW28f.js} +1 -1
  68. package/web/dist/assets/{sidebar-section-CFausX6G.js → sidebar-section-VOYJarPd.js} +1 -1
  69. package/web/dist/assets/{skills-C59hjIpW.js → skills-BySF3yBA.js} +1 -1
  70. package/web/dist/assets/{tab-link-B7UoArdY.js → tab-link-Bu1g-ArE.js} +1 -1
  71. package/web/dist/assets/{task-changes-HqrNlmGK.js → task-changes-NUwvUglx.js} +1 -1
  72. package/web/dist/assets/{task-commits-QHeItJLu.js → task-commits-CpV1Hz9L.js} +1 -1
  73. package/web/dist/assets/{task-files-QFVIGaz9.js → task-files-Bu-L_NRW.js} +1 -1
  74. package/web/dist/assets/{task-github-item-UKsVEOul.js → task-github-item-DhiTqCjk.js} +1 -1
  75. package/web/dist/assets/{task-groups-BwdcbABY.js → task-groups-4tzKGROI.js} +1 -1
  76. package/web/dist/assets/{task-thread-CnGokWLH.js → task-thread-CKkTeQdi.js} +1 -1
  77. package/web/dist/assets/{tasks-table-Y4sDrQge.js → tasks-table-C5uoZMFs.js} +1 -1
  78. package/web/dist/assets/{thread-state-Cu4CGztL.js → thread-state-B_ZqjjRr.js} +1 -1
  79. package/web/dist/assets/{toaster-DXCOcLoK.js → toaster-BXnLIU3z.js} +1 -1
  80. package/web/dist/assets/{use-hand-to-agent-state-Cxrl8yfx.js → use-hand-to-agent-state-K864D69i.js} +1 -1
  81. package/web/dist/assets/{workflows-Dl7hrImQ.js → workflows-DlTkuM0J.js} +1 -1
  82. package/web/dist/assets/{workspace-tools-ti_LJ2EA.js → workspace-tools-BRK7f1Hk.js} +1 -1
  83. package/web/dist/assets/{worktrees-section-CpVznl7Q.js → worktrees-section-BXI0-7HH.js} +1 -1
  84. package/web/dist/index.html +14 -14
  85. package/web/dist/assets/attention-CcwTbcYb.js +0 -1
  86. package/web/dist/assets/index-COOMjwiP.css +0 -1
  87. package/web/dist/assets/repo-git-OhYxFr6e.js +0 -1
@@ -3984,17 +3984,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
3984
3984
  finishedAt: string | null;
3985
3985
  reclaimable: boolean;
3986
3986
  pastKeep: boolean;
3987
- reclaimBlocker: {
3988
- kind: "dirty";
3989
- uncommittedFiles: number;
3990
- detachedHead: boolean;
3991
- } | {
3992
- kind: "detached-head";
3993
- } | {
3994
- kind: "submodules";
3995
- } | {
3996
- kind: "invalid";
3997
- } | null;
3998
3987
  }[];
3999
3988
  totalBytes: number | null;
4000
3989
  keep: number;
@@ -4014,10 +4003,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4014
4003
  status: import("hono/utils/http-status").ContentfulStatusCode;
4015
4004
  input: {
4016
4005
  json: {
4017
- discardWork: true;
4018
- runIds: string[];
4019
- } | {
4020
- discardWork?: false | undefined;
4006
+ [x: string]: unknown;
4021
4007
  };
4022
4008
  };
4023
4009
  };
@@ -4035,10 +4021,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4035
4021
  param: {
4036
4022
  runId: string;
4037
4023
  };
4038
- } & {
4039
- json: {
4040
- discardWork?: boolean | undefined;
4041
- };
4042
4024
  };
4043
4025
  } | {
4044
4026
  output: {
@@ -4050,10 +4032,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4050
4032
  param: {
4051
4033
  runId: string;
4052
4034
  };
4053
- } & {
4054
- json: {
4055
- discardWork?: boolean | undefined;
4056
- };
4057
4035
  };
4058
4036
  } | {
4059
4037
  output: {
@@ -4066,10 +4044,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4066
4044
  param: {
4067
4045
  runId: string;
4068
4046
  };
4069
- } & {
4070
- json: {
4071
- discardWork?: boolean | undefined;
4072
- };
4073
4047
  };
4074
4048
  };
4075
4049
  };
@@ -4746,6 +4720,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4746
4720
  } & {
4747
4721
  "/repo/commit/:sha": {
4748
4722
  $get: {
4723
+ output: string;
4724
+ outputFormat: "text";
4725
+ status: import("hono/utils/http-status").ContentfulStatusCode;
4726
+ input: {
4727
+ query: {
4728
+ structured?: string | undefined;
4729
+ };
4730
+ } & {
4731
+ param: {
4732
+ sha: string;
4733
+ };
4734
+ };
4735
+ } | {
4749
4736
  output: {
4750
4737
  error: string;
4751
4738
  code?: "invalid_input" | undefined;
@@ -4809,19 +4796,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4809
4796
  sha: string;
4810
4797
  };
4811
4798
  };
4812
- } | {
4813
- output: string;
4814
- outputFormat: "text";
4815
- status: import("hono/utils/http-status").ContentfulStatusCode;
4816
- input: {
4817
- query: {
4818
- structured?: string | undefined;
4819
- };
4820
- } & {
4821
- param: {
4822
- sha: string;
4823
- };
4824
- };
4825
4799
  };
4826
4800
  };
4827
4801
  } & {
@@ -19316,20 +19290,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
19316
19290
  } & {
19317
19291
  "/runs/:id/handoff": {
19318
19292
  $get: {
19319
- output: {
19320
- error: string;
19321
- };
19322
- outputFormat: "json";
19323
- status: 404;
19293
+ output: string;
19294
+ outputFormat: "text";
19295
+ status: 200;
19324
19296
  input: {
19325
19297
  param: {
19326
19298
  id: string;
19327
19299
  };
19328
19300
  };
19329
19301
  } | {
19330
- output: string;
19331
- outputFormat: "text";
19332
- status: 200;
19302
+ output: {
19303
+ error: string;
19304
+ };
19305
+ outputFormat: "json";
19306
+ status: 404;
19333
19307
  input: {
19334
19308
  param: {
19335
19309
  id: string;
@@ -19367,20 +19341,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
19367
19341
  } & {
19368
19342
  "/runs/:id/diff": {
19369
19343
  $get: {
19370
- output: {
19371
- error: string;
19372
- };
19373
- outputFormat: "json";
19374
- status: 404 | 409;
19344
+ output: string;
19345
+ outputFormat: "text";
19346
+ status: import("hono/utils/http-status").ContentfulStatusCode;
19375
19347
  input: {
19376
19348
  param: {
19377
19349
  id: string;
19378
19350
  };
19379
19351
  };
19380
19352
  } | {
19381
- output: string;
19382
- outputFormat: "text";
19383
- status: import("hono/utils/http-status").ContentfulStatusCode;
19353
+ output: {
19354
+ error: string;
19355
+ };
19356
+ outputFormat: "json";
19357
+ status: 404 | 409;
19384
19358
  input: {
19385
19359
  param: {
19386
19360
  id: string;
@@ -20779,17 +20753,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
20779
20753
  finishedAt: string | null;
20780
20754
  reclaimable: boolean;
20781
20755
  pastKeep: boolean;
20782
- reclaimBlocker: {
20783
- kind: "dirty";
20784
- uncommittedFiles: number;
20785
- detachedHead: boolean;
20786
- } | {
20787
- kind: "detached-head";
20788
- } | {
20789
- kind: "submodules";
20790
- } | {
20791
- kind: "invalid";
20792
- } | null;
20793
20756
  }[];
20794
20757
  totalBytes: number | null;
20795
20758
  keep: number;
@@ -20809,10 +20772,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
20809
20772
  status: import("hono/utils/http-status").ContentfulStatusCode;
20810
20773
  input: {
20811
20774
  json: {
20812
- discardWork: true;
20813
- runIds: string[];
20814
- } | {
20815
- discardWork?: false | undefined;
20775
+ [x: string]: unknown;
20816
20776
  };
20817
20777
  };
20818
20778
  };
@@ -20830,10 +20790,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
20830
20790
  param: {
20831
20791
  runId: string;
20832
20792
  };
20833
- } & {
20834
- json: {
20835
- discardWork?: boolean | undefined;
20836
- };
20837
20793
  };
20838
20794
  } | {
20839
20795
  output: {
@@ -20845,10 +20801,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
20845
20801
  param: {
20846
20802
  runId: string;
20847
20803
  };
20848
- } & {
20849
- json: {
20850
- discardWork?: boolean | undefined;
20851
- };
20852
20804
  };
20853
20805
  } | {
20854
20806
  output: {
@@ -20861,10 +20813,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
20861
20813
  param: {
20862
20814
  runId: string;
20863
20815
  };
20864
- } & {
20865
- json: {
20866
- discardWork?: boolean | undefined;
20867
- };
20868
20816
  };
20869
20817
  };
20870
20818
  };
@@ -21541,6 +21489,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
21541
21489
  } & {
21542
21490
  "/repo/commit/:sha": {
21543
21491
  $get: {
21492
+ output: string;
21493
+ outputFormat: "text";
21494
+ status: import("hono/utils/http-status").ContentfulStatusCode;
21495
+ input: {
21496
+ query: {
21497
+ structured?: string | undefined;
21498
+ };
21499
+ } & {
21500
+ param: {
21501
+ sha: string;
21502
+ };
21503
+ };
21504
+ } | {
21544
21505
  output: {
21545
21506
  error: string;
21546
21507
  code?: "invalid_input" | undefined;
@@ -21604,19 +21565,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
21604
21565
  sha: string;
21605
21566
  };
21606
21567
  };
21607
- } | {
21608
- output: string;
21609
- outputFormat: "text";
21610
- status: import("hono/utils/http-status").ContentfulStatusCode;
21611
- input: {
21612
- query: {
21613
- structured?: string | undefined;
21614
- };
21615
- } & {
21616
- param: {
21617
- sha: string;
21618
- };
21619
- };
21620
21568
  };
21621
21569
  };
21622
21570
  } & {
@@ -36111,20 +36059,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
36111
36059
  } & {
36112
36060
  "/runs/:id/handoff": {
36113
36061
  $get: {
36114
- output: {
36115
- error: string;
36116
- };
36117
- outputFormat: "json";
36118
- status: 404;
36062
+ output: string;
36063
+ outputFormat: "text";
36064
+ status: 200;
36119
36065
  input: {
36120
36066
  param: {
36121
36067
  id: string;
36122
36068
  };
36123
36069
  };
36124
36070
  } | {
36125
- output: string;
36126
- outputFormat: "text";
36127
- status: 200;
36071
+ output: {
36072
+ error: string;
36073
+ };
36074
+ outputFormat: "json";
36075
+ status: 404;
36128
36076
  input: {
36129
36077
  param: {
36130
36078
  id: string;
@@ -36162,20 +36110,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
36162
36110
  } & {
36163
36111
  "/runs/:id/diff": {
36164
36112
  $get: {
36165
- output: {
36166
- error: string;
36167
- };
36168
- outputFormat: "json";
36169
- status: 404 | 409;
36113
+ output: string;
36114
+ outputFormat: "text";
36115
+ status: import("hono/utils/http-status").ContentfulStatusCode;
36170
36116
  input: {
36171
36117
  param: {
36172
36118
  id: string;
36173
36119
  };
36174
36120
  };
36175
36121
  } | {
36176
- output: string;
36177
- outputFormat: "text";
36178
- status: import("hono/utils/http-status").ContentfulStatusCode;
36122
+ output: {
36123
+ error: string;
36124
+ };
36125
+ outputFormat: "json";
36126
+ status: 404 | 409;
36179
36127
  input: {
36180
36128
  param: {
36181
36129
  id: string;
@@ -1,14 +1,3 @@
1
1
  export declare const cachedWorktreeSizeBytes: (path: string) => Promise<number | null>;
2
- export declare const queuedWorktreeReclaimBlocker: (repoRoot: string, path: string) => Promise<{
3
- kind: "dirty";
4
- uncommittedFiles: number;
5
- detachedHead: boolean;
6
- } | {
7
- kind: "detached-head";
8
- } | {
9
- kind: "submodules";
10
- } | {
11
- kind: "invalid";
12
- } | null>;
13
2
  export declare const forgetWorktreeSize: (path: string) => void;
14
3
  export declare const clearWorktreeSizeCacheForTests: () => void;
@@ -1,10 +1,8 @@
1
- import { inspectWorktreeReclaimBlocker, worktreeSizeBytes } from '../git-worktree.js';
1
+ import { worktreeSizeBytes } from '../git-worktree.js';
2
2
  import { boundedReadCache, readQueue } from './bounded-read-cache.js';
3
3
  const sizes = boundedReadCache(30_000, 512);
4
4
  const queue = readQueue(6);
5
- const blockerQueue = readQueue(6);
6
5
  export const cachedWorktreeSizeBytes = (path) => sizes.read(path, () => queue(() => worktreeSizeBytes(path)));
7
- export const queuedWorktreeReclaimBlocker = (repoRoot, path) => blockerQueue(() => inspectWorktreeReclaimBlocker(repoRoot, path));
8
6
  export const forgetWorktreeSize = (path) => sizes.forget(path);
9
7
  export const clearWorktreeSizeCacheForTests = () => sizes.clear();
10
8
  //# sourceMappingURL=worktree-size-cache.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worktree-size-cache.js","sourceRoot":"","sources":["../../src/server/worktree-size-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,KAAK,GAAG,gBAAgB,CAAgB,MAAM,EAAE,GAAG,CAAC,CAAC;AAC3D,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC3B,MAAM,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,QAAgB,EAAE,IAAY,EAAE,EAAE,CAC7E,YAAY,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"worktree-size-cache.js","sourceRoot":"","sources":["../../src/server/worktree-size-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,KAAK,GAAG,gBAAgB,CAAgB,MAAM,EAAE,GAAG,CAAC,CAAC;AAC3D,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC3B,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hearsay-tools/squawk",
3
- "version": "0.19.0-pr4426.8671",
3
+ "version": "0.19.0-pr4428.8677",
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-pr4426.8671",
73
- "@open-mercato/cezar-contract": "0.19.0-pr4426.8671",
72
+ "@open-mercato/cezar-api-client": "0.19.0-pr4428.8677",
73
+ "@open-mercato/cezar-contract": "0.19.0-pr4428.8677",
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": "749b3113eb2b67b46138dfa1ecb53b97bab58fed"
90
+ "gitHead": "bfd9007bb48d999520befc9e9392bae9a2c05b6e"
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{l as r,m as i,o as a,s as o,u as s}from"./live-reads-CYQJSB0x.js";import{Ln as c,Nn as l,Nr as u,Pn as d,an as f,pi as p,ti as m}from"./project-scope-context-DBPcPWqF.js";import{n as h}from"./toaster-DXCOcLoK.js";import{Ct as g,Et as _,Ft as v,Mt as y,Qt as b,St as x,Vt as S,ft as ee,lt as te,pt as C,qt as w,ut as T,vt as E}from"./queries-B27CAXOU.js";import{f as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as re}from"./design-icons-CzEoMH9c.js";import{t as ie}from"./createLucideIcon-BHp8sXmF.js";import{t as ae}from"./folder-browser-DAam7eGA.js";import{t as D}from"./button-B7MKxYjT.js";import{t as oe}from"./badge-DQ3U69Ht.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dialog-B531GGAo.js";import{t as P}from"./status-dot-BRzVlF2X.js";import{n as F}from"./agents-settings-path-7X6_cvUg.js";import{t as I}from"./centered-state-V15AR_qo.js";import{Gt as L,Ht as R,Jt as z,Kt as B,N as V,Ut as H,Wt as U,Yt as W,j as G,qt as K}from"./index-CFtjrhlQ.js";import{t as q}from"./settings-select-CCIMGnyA.js";import{n as J,r as se,t as ce}from"./settings-agent-picker-Dj9w9Rqy.js";import{n as le,r as ue,t as de}from"./remote-settings-notice-B7px6Rjz.js";var fe=ie(`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(),pe=`~/.claude-second`;function me({open:e,onOpenChange:t,providers:n,initialProvider:a}){let s=i().data,[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null),[f,p]=(0,Y.useState)(a??n[0]??`claude`),[m,g]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=C(),S=_.trim();return(0,X.jsx)(N,{open:e,onOpenChange:t,children:(0,X.jsxs)(j,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(A,{children:[(0,X.jsx)(M,{children:`Add agent account`}),(0,X.jsx)(k,{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:f,onChange:e=>p(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,X.jsx)(`option`,{value:e,children:o(s,e)},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=>g(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:r(s,f)?.accountFolderExample??pe,onChange:e=>{v(e.target.value),d(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)(D,{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)(ae,{path:c,selected:u,onSelect:e=>{d(e),v(e.path),x.reset()},onEnter:e=>{l(e),d(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)(O,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(D,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(D,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:f,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),g(``),v(``),d(null),b(!1),h(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function he(e){return c(await d.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ge(e,t){return c(await d.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var _e={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function ve(e){let t=E().data?.capabilities?.settingsAdmin===!0,n=p(),r=[`runner-install`,e],i=m({queryKey:r,queryFn:()=>he(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=>ge(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 ye({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)(D,{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)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function be({runner:e}){let t=ve(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?` · ${_e[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(ye,{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 xe={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 Se(){let e=T(),t=i();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)(I,{icon:(0,X.jsx)(fe,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(Te,{data:e.data,runners:t.data})}function Ce(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function we(){let{hash:e}=ne();(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 Te({data:e,runners:t}){let n=E(),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),s=_();return we(),ue(),(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)(le,{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:de}),` 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)(Ae,{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,X.jsx)(je,{runners:t}),r===null?null:(0,X.jsx)(me,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(R,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,X.jsxs)(L,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(z,{children:[(0,X.jsxs)(W,{children:[`Remove “`,a?.label,`”?`]}),(0,X.jsxs)(B,{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,X.jsxs)(K,{children:[(0,X.jsx)(U,{children:`Cancel`}),(0,X.jsx)(H,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),h(`Removed ${e.label}`)},onError:e=>h(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Ee({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:`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)(Oe,{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]})}var De=/^mock \(\w*DRY_RUN=1\)$/;function Oe({version:e}){return De.test(e)?(0,X.jsx)(`span`,{"data-slot":`agent-version`,"data-dry-run":``,title:e,className:`rounded bg-muted/60 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground`,children:`Dry run`}):(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 ke({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 Z({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)(ke,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Ae({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=`${F(l)}-title`,m=i&&o?(0,X.jsx)(D,{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)(Ee,{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:F(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)(Z,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(be,{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 je({runners:e}){let[t,n]=(0,Y.useState)(null),r=p(),i=v(),o=x(),c=w(s(e)),l=b({mutationFn:e=>f(e),onSuccess:e=>r.setQueryData(S.config,e),onError:e=>h(e.message,{tone:`danger`})});if(i.data===void 0)return null;let u=se([],e),d=i.data.agentDefaults.runner??`claude`,m=a(t??d,s(e))??t??d,g=i.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.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,X.jsx)(ce,{rows:u,runner:d,accountFor:()=>null,providerStatus:o,disabled:l.isPending,onPick:e=>{e!==d&&l.mutate({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`,value:m,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===m).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(re,{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.jsxs)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:g[t.id]??``,disabled:l.isPending,onChange:e=>l.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-64 max-w-full 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:[V(t.id,e,c[t.id]?.data,[g[t.id]]).map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,X.jsx)(Q,{runner:t.id,runners:e,catalog:c[t.id]})]})]},t.id))]})]})}function Q({runner:e,runners:t,catalog:n}){let r=G(e,t,n);return r?(0,X.jsx)(`option`,{disabled:!0,children:r}):null}function Me({account:e,runners:t,status:n,editable:i}){let a=ee();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&r(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,i&&n&&n.status!==`connected`&&r(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:a.isPending,onClick:()=>a.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>h(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>h(e instanceof l&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ne(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 ${o(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=u(e),o=g(),s=te(a,e.status===void 0),c=e.status??s.data?.status,l=c?xe[c.status]:void 0,d=Ne(e,t,c,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:l?`Sign-in: ${l.label}`:void 0,children:[(0,X.jsx)(P,{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)(P,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:l?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(D,{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=>h(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)(oe,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-[11px] font-normal text-muted-foreground`,children:`discovered`}):null]}),_=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Ce(e.configDir)}):null,v=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=c?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:c.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Pe,{account:e,onRemove:r}):null,x=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),_,v,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)(Z,{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:[x,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:[x,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Pe({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=y();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)(D,{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=>h(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(D,{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{Se 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{l as r,m as i,o as a,s as o,u as s}from"./live-reads-Crd6fVGH.js";import{Ln as c,Nn as l,Nr as u,Pn as d,an as f,pi as p,ti as m}from"./project-scope-context-Rv6S_BXt.js";import{n as h}from"./toaster-BXnLIU3z.js";import{Ct as g,Et as _,Ft as v,Mt as y,Qt as b,St as x,Vt as S,ft as ee,lt as te,pt as C,qt as w,ut as T,vt as E}from"./queries-qCF-eOqZ.js";import{f as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as re}from"./design-icons-CzEoMH9c.js";import{t as ie}from"./createLucideIcon-BHp8sXmF.js";import{t as ae}from"./folder-browser-B7IbnF0d.js";import{t as D}from"./button-B7MKxYjT.js";import{t as oe}from"./badge-DQ3U69Ht.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dialog-B531GGAo.js";import{t as P}from"./status-dot-BRzVlF2X.js";import{n as F}from"./agents-settings-path-7X6_cvUg.js";import{t as I}from"./centered-state-V15AR_qo.js";import{Gt as L,Ht as R,Jt as z,Kt as B,N as V,Ut as H,Wt as U,Yt as W,j as G,qt as K}from"./index-DNQcTHxV.js";import{t as q}from"./settings-select-CCIMGnyA.js";import{n as J,r as se,t as ce}from"./settings-agent-picker-CJJJncuA.js";import{n as le,r as ue,t as de}from"./remote-settings-notice-COojb6XK.js";var fe=ie(`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(),pe=`~/.claude-second`;function me({open:e,onOpenChange:t,providers:n,initialProvider:a}){let s=i().data,[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null),[f,p]=(0,Y.useState)(a??n[0]??`claude`),[m,g]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=C(),S=_.trim();return(0,X.jsx)(N,{open:e,onOpenChange:t,children:(0,X.jsxs)(j,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(A,{children:[(0,X.jsx)(M,{children:`Add agent account`}),(0,X.jsx)(k,{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:f,onChange:e=>p(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,X.jsx)(`option`,{value:e,children:o(s,e)},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=>g(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:r(s,f)?.accountFolderExample??pe,onChange:e=>{v(e.target.value),d(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)(D,{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)(ae,{path:c,selected:u,onSelect:e=>{d(e),v(e.path),x.reset()},onEnter:e=>{l(e),d(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)(O,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(D,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(D,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:f,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),g(``),v(``),d(null),b(!1),h(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function he(e){return c(await d.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ge(e,t){return c(await d.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var _e={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function ve(e){let t=E().data?.capabilities?.settingsAdmin===!0,n=p(),r=[`runner-install`,e],i=m({queryKey:r,queryFn:()=>he(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=>ge(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 ye({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)(D,{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)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function be({runner:e}){let t=ve(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?` · ${_e[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(ye,{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 xe={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 Se(){let e=T(),t=i();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)(I,{icon:(0,X.jsx)(fe,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(Te,{data:e.data,runners:t.data})}function Ce(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function we(){let{hash:e}=ne();(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 Te({data:e,runners:t}){let n=E(),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),s=_();return we(),ue(),(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)(le,{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:de}),` 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)(Ae,{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,X.jsx)(je,{runners:t}),r===null?null:(0,X.jsx)(me,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(R,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,X.jsxs)(L,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(z,{children:[(0,X.jsxs)(W,{children:[`Remove “`,a?.label,`”?`]}),(0,X.jsxs)(B,{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,X.jsxs)(K,{children:[(0,X.jsx)(U,{children:`Cancel`}),(0,X.jsx)(H,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),h(`Removed ${e.label}`)},onError:e=>h(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Ee({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:`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)(Oe,{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]})}var De=/^mock \(\w*DRY_RUN=1\)$/;function Oe({version:e}){return De.test(e)?(0,X.jsx)(`span`,{"data-slot":`agent-version`,"data-dry-run":``,title:e,className:`rounded bg-muted/60 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground`,children:`Dry run`}):(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 ke({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 Z({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)(ke,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Ae({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=`${F(l)}-title`,m=i&&o?(0,X.jsx)(D,{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)(Ee,{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:F(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)(Z,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(be,{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 je({runners:e}){let[t,n]=(0,Y.useState)(null),r=p(),i=v(),o=x(),c=w(s(e)),l=b({mutationFn:e=>f(e),onSuccess:e=>r.setQueryData(S.config,e),onError:e=>h(e.message,{tone:`danger`})});if(i.data===void 0)return null;let u=se([],e),d=i.data.agentDefaults.runner??`claude`,m=a(t??d,s(e))??t??d,g=i.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.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,X.jsx)(ce,{rows:u,runner:d,accountFor:()=>null,providerStatus:o,disabled:l.isPending,onPick:e=>{e!==d&&l.mutate({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`,value:m,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===m).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(re,{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.jsxs)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:g[t.id]??``,disabled:l.isPending,onChange:e=>l.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-64 max-w-full 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:[V(t.id,e,c[t.id]?.data,[g[t.id]]).map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,X.jsx)(Q,{runner:t.id,runners:e,catalog:c[t.id]})]})]},t.id))]})]})}function Q({runner:e,runners:t,catalog:n}){let r=G(e,t,n);return r?(0,X.jsx)(`option`,{disabled:!0,children:r}):null}function Me({account:e,runners:t,status:n,editable:i}){let a=ee();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&r(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,i&&n&&n.status!==`connected`&&r(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:a.isPending,onClick:()=>a.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>h(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>h(e instanceof l&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ne(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 ${o(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=u(e),o=g(),s=te(a,e.status===void 0),c=e.status??s.data?.status,l=c?xe[c.status]:void 0,d=Ne(e,t,c,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:l?`Sign-in: ${l.label}`:void 0,children:[(0,X.jsx)(P,{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)(P,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:l?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(D,{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=>h(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)(oe,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-[11px] font-normal text-muted-foreground`,children:`discovered`}):null]}),_=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Ce(e.configDir)}):null,v=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=c?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:c.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Pe,{account:e,onRemove:r}):null,x=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),_,v,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)(Z,{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:[x,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:[x,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Pe({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=y();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)(D,{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=>h(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(D,{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{Se as GlobalAgentsSection};