@hearsay-tools/squawk 0.19.0-dev.8845 → 0.19.0-dev.8872

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 (113) hide show
  1. package/dist/boot.d.ts +1 -1
  2. package/dist/boot.js +4 -1
  3. package/dist/boot.js.map +1 -1
  4. package/dist/built-in-forges.d.ts +8 -0
  5. package/dist/built-in-forges.js +15 -0
  6. package/dist/built-in-forges.js.map +1 -0
  7. package/dist/contract/health.d.ts +2 -2
  8. package/dist/contract/index.js +6 -4
  9. package/dist/contract/projects.d.ts +6 -6
  10. package/dist/core/forge-registry.d.ts +113 -0
  11. package/dist/core/forge-registry.js +127 -0
  12. package/dist/core/forge-registry.js.map +1 -0
  13. package/dist/features/automations/github-repository.js +2 -1
  14. package/dist/features/automations/github-repository.js.map +1 -1
  15. package/dist/features/automations/task-template.js +1 -1
  16. package/dist/features/automations/task-template.js.map +1 -1
  17. package/dist/git-diff-base.d.ts +22 -0
  18. package/dist/git-diff-base.js +30 -11
  19. package/dist/git-diff-base.js.map +1 -1
  20. package/dist/git-private-index.js +50 -3
  21. package/dist/git-private-index.js.map +1 -1
  22. package/dist/git-worktree.js +9 -11
  23. package/dist/git-worktree.js.map +1 -1
  24. package/dist/plugin/api.d.ts +4 -0
  25. package/dist/plugin/api.js +10 -1
  26. package/dist/plugin/api.js.map +1 -1
  27. package/dist/plugin/cli.js +1 -1
  28. package/dist/plugin/cli.js.map +1 -1
  29. package/dist/plugin/index.d.ts +1 -0
  30. package/dist/plugin/index.js.map +1 -1
  31. package/dist/server/forge/draft-pr.d.ts +6 -0
  32. package/dist/server/forge/draft-pr.js +11 -3
  33. package/dist/server/forge/draft-pr.js.map +1 -1
  34. package/dist/server/forge/github-forge.d.ts +4 -0
  35. package/dist/server/forge/github-forge.js +80 -0
  36. package/dist/server/forge/github-forge.js.map +1 -0
  37. package/dist/server/forge/index.d.ts +0 -19
  38. package/dist/server/forge/index.js +6 -29
  39. package/dist/server/forge/index.js.map +1 -1
  40. package/dist/server/forge/types.d.ts +2 -1
  41. package/dist/server/live-routes.d.ts +6 -6
  42. package/dist/server/projects-routes.d.ts +9 -9
  43. package/dist/server/runs-routes.d.ts +682 -682
  44. package/dist/server/server.d.ts +74 -74
  45. package/dist/server/workspace-live-routes.d.ts +6 -6
  46. package/dist/workspace/projects.d.ts +4 -5
  47. package/dist/workspace/projects.js +1 -1
  48. package/dist/workspace/projects.js.map +1 -1
  49. package/package.json +4 -4
  50. package/scripts/benchmark-project-probes.mjs +4 -0
  51. package/web/dist/assets/{accounts-section-C95W9tft.js → accounts-section-BDtqUWb3.js} +1 -1
  52. package/web/dist/assets/{activity-motion-COcLCDd5.js → activity-motion-BXoeTgQ0.js} +1 -1
  53. package/web/dist/assets/{activity-route-0AoutPRj.js → activity-route-C6vB-67V.js} +1 -1
  54. package/web/dist/assets/{agent-config-section-Cz65qZDc.js → agent-config-section-CYKtNSOq.js} +1 -1
  55. package/web/dist/assets/{agent-defaults-section-tbJ4RMFy.js → agent-defaults-section-Cxi5hgqw.js} +1 -1
  56. package/web/dist/assets/{appearance-BcrW0Qbi.js → appearance-DpiBlg6s.js} +1 -1
  57. package/web/dist/assets/{archive-on-merge-field-D3OBzagt.js → archive-on-merge-field-BkwRlcuT.js} +1 -1
  58. package/web/dist/assets/attention-ILOaW2-t.js +1 -0
  59. package/web/dist/assets/{automations-route-DVEH6T0o.js → automations-route-B7pZjn4t.js} +1 -1
  60. package/web/dist/assets/{commit-list-etjXhtQY.js → commit-list-DmvUQRfc.js} +1 -1
  61. package/web/dist/assets/{diff-controls-VI32bLW4.js → diff-controls-DDd5C9KF.js} +1 -1
  62. package/web/dist/assets/{diff-CqHH_7uE.js → diff-pvABbnFN.js} +2 -2
  63. package/web/dist/assets/{diff-view-DVW3793i.js → diff-view-y0rJAqxu.js} +1 -1
  64. package/web/dist/assets/{file-preview-BQ7gHPWH.js → file-preview-CtLbHTJd.js} +1 -1
  65. package/web/dist/assets/{folder-browser-BKpkblOg.js → folder-browser-B_jJl4is.js} +1 -1
  66. package/web/dist/assets/{git-toolbar-ryXExKED.js → git-toolbar-BNu4FVNt.js} +1 -1
  67. package/web/dist/assets/{github-BNNMCYM8.js → github-P8iLt9Ze.js} +1 -1
  68. package/web/dist/assets/{global-activity-route-BA2YYKbv.js → global-activity-route-DmlKf3HJ.js} +1 -1
  69. package/web/dist/assets/{index-02QMWGsE.js → index-CtmR0Rih.js} +5 -5
  70. package/web/dist/assets/{label-r2EmPWPF.js → label-DMC9mkYa.js} +1 -1
  71. package/web/dist/assets/{markdown-DddMrtUC.js → markdown-Ccc5GQS7.js} +1 -1
  72. package/web/dist/assets/{notifications-section-DDEFRzq5.js → notifications-section-A6faaEDe.js} +1 -1
  73. package/web/dist/assets/{open-in-menu-DURN-8Iq.js → open-in-menu-VhRao_Jk.js} +1 -1
  74. package/web/dist/assets/{preview-pane-connected-BCALv_bS.js → preview-pane-connected-gDJgoJyx.js} +1 -1
  75. package/web/dist/assets/{project-location-BVh3MyY6.js → project-location-DATkk1gA.js} +1 -1
  76. package/web/dist/assets/{project-router-1ohBdsN0.js → project-router-B9FTk0rB.js} +1 -1
  77. package/web/dist/assets/{projects-section-B-JVwTeX.js → projects-section-Bo9w_srQ.js} +1 -1
  78. package/web/dist/assets/{prompt-templates-section-DHsOmtAs.js → prompt-templates-section-CA-GCYAc.js} +1 -1
  79. package/web/dist/assets/{queries-ScB0s5Ar.js → queries-hzlF788B.js} +1 -1
  80. package/web/dist/assets/{reference-chip-BlcXVXRe.js → reference-chip-Dgo5aKeb.js} +1 -1
  81. package/web/dist/assets/{remote-settings-notice-zQv0O_2v.js → remote-settings-notice-CEmfxzke.js} +1 -1
  82. package/web/dist/assets/{repo-git-CXS8YlRN.js → repo-git-CslX0xWz.js} +1 -1
  83. package/web/dist/assets/{report-reader-BGbH6bLq.js → report-reader-C70mj6S6.js} +1 -1
  84. package/web/dist/assets/{report-selection-TxRk0uQB.js → report-selection-C-2DJb8L.js} +1 -1
  85. package/web/dist/assets/{reports-B1QVvyYi.js → reports-C7BHDLLE.js} +1 -1
  86. package/web/dist/assets/{resources-section-BVZYiYSk.js → resources-section-DEczWFga.js} +1 -1
  87. package/web/dist/assets/{review-panel-kzEoeeGt.js → review-panel-XIuCglMi.js} +1 -1
  88. package/web/dist/assets/{run-detail-refresh-Dd21Z89D.js → run-detail-refresh-Ye2jcT7n.js} +1 -1
  89. package/web/dist/assets/{run-header-DhGLC4am.js → run-header-gQnKz92B.js} +1 -1
  90. package/web/dist/assets/{select-D8tuiSID.js → select-VMOFW67M.js} +1 -1
  91. package/web/dist/assets/{session-context-section-CHWBjN41.js → session-context-section-Dh1KSiWq.js} +1 -1
  92. package/web/dist/assets/{settings-agent-picker-Bl6ugpb9.js → settings-agent-picker-QEhmK2uD.js} +1 -1
  93. package/web/dist/assets/{settings-shell-Da0ky57l.js → settings-shell-DTu-GViz.js} +1 -1
  94. package/web/dist/assets/{sidebar-section-DHks7GAm.js → sidebar-section-CIKjtt38.js} +1 -1
  95. package/web/dist/assets/{skills-K9LxDYPE.js → skills-CdtSD18y.js} +1 -1
  96. package/web/dist/assets/{tab-link-vUBbOMng.js → tab-link-BlZX-nKP.js} +1 -1
  97. package/web/dist/assets/{task-changes-CVH52Yc2.js → task-changes-CHlKuW-X.js} +1 -1
  98. package/web/dist/assets/{task-commits-BITdXvi7.js → task-commits-nF4skyb7.js} +1 -1
  99. package/web/dist/assets/{task-file-scope-CDRDcGvR.js → task-file-scope-MfwFcMP-.js} +1 -1
  100. package/web/dist/assets/{task-files-Dhvvb1ON.js → task-files-DtFAAilW.js} +1 -1
  101. package/web/dist/assets/{task-github-item-DgfDyeFq.js → task-github-item-7NfAP9Cc.js} +1 -1
  102. package/web/dist/assets/{task-groups-BHP2J8M9.js → task-groups-DD46syqv.js} +1 -1
  103. package/web/dist/assets/{task-thread-DgG_ygLm.js → task-thread-BythIUIj.js} +1 -1
  104. package/web/dist/assets/{tasks-table-DdTcZx0f.js → tasks-table-D17JLOhe.js} +1 -1
  105. package/web/dist/assets/{thread-state-BJ8eA3Zp.js → thread-state-D9Q1UDJa.js} +1 -1
  106. package/web/dist/assets/toaster-fWyfEGWF.js +4 -0
  107. package/web/dist/assets/{use-hand-to-agent-state-B7vxnSK_.js → use-hand-to-agent-state-D9nrW-0i.js} +1 -1
  108. package/web/dist/assets/{workflows-Brt6a-aI.js → workflows-CNc4Vs8I.js} +1 -1
  109. package/web/dist/assets/{workspace-tools-BfRmz2-R.js → workspace-tools-C5y6_0Cv.js} +1 -1
  110. package/web/dist/assets/{worktrees-section-HNAy7tOH.js → worktrees-section-CJCdE5Yx.js} +1 -1
  111. package/web/dist/index.html +13 -13
  112. package/web/dist/assets/attention-DBS2iaFI.js +0 -1
  113. package/web/dist/assets/toaster-CRikzxTs.js +0 -4
@@ -528,7 +528,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
528
528
  forge: {
529
529
  available?: boolean | undefined;
530
530
  reason?: string;
531
- kind: "github";
531
+ kind: string;
532
532
  } | null;
533
533
  capabilities: {
534
534
  [x: string]: boolean | undefined;
@@ -2095,7 +2095,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
2095
2095
  source: "checkout" | "local";
2096
2096
  status: "missing" | "not-git" | "ok";
2097
2097
  branch?: string | undefined;
2098
- forge?: "github" | undefined;
2098
+ forge?: string | undefined;
2099
2099
  repoUrl?: string | undefined;
2100
2100
  maxParallel?: number | undefined;
2101
2101
  tags?: string[] | undefined;
@@ -2147,7 +2147,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
2147
2147
  source: "checkout" | "local";
2148
2148
  status: "missing" | "not-git" | "ok";
2149
2149
  branch?: string | undefined;
2150
- forge?: "github" | undefined;
2150
+ forge?: string | undefined;
2151
2151
  repoUrl?: string | undefined;
2152
2152
  maxParallel?: number | undefined;
2153
2153
  tags?: string[] | undefined;
@@ -2187,7 +2187,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
2187
2187
  source: "checkout" | "local";
2188
2188
  status: "missing" | "not-git" | "ok";
2189
2189
  branch?: string | undefined;
2190
- forge?: "github" | undefined;
2190
+ forge?: string | undefined;
2191
2191
  repoUrl?: string | undefined;
2192
2192
  maxParallel?: number | undefined;
2193
2193
  tags?: string[] | undefined;
@@ -2322,7 +2322,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
2322
2322
  source: "checkout" | "local";
2323
2323
  status: "missing" | "not-git" | "ok";
2324
2324
  branch?: string | undefined;
2325
- forge?: "github" | undefined;
2325
+ forge?: string | undefined;
2326
2326
  repoUrl?: string | undefined;
2327
2327
  maxParallel?: number | undefined;
2328
2328
  tags?: string[] | undefined;
@@ -2436,7 +2436,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
2436
2436
  source: "checkout" | "local";
2437
2437
  status: "missing" | "not-git" | "ok";
2438
2438
  branch?: string | undefined;
2439
- forge?: "github" | undefined;
2439
+ forge?: string | undefined;
2440
2440
  repoUrl?: string | undefined;
2441
2441
  maxParallel?: number | undefined;
2442
2442
  tags?: string[] | undefined;
@@ -2522,7 +2522,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
2522
2522
  source: "checkout" | "local";
2523
2523
  status: "missing" | "not-git" | "ok";
2524
2524
  branch?: string | undefined;
2525
- forge?: "github" | undefined;
2525
+ forge?: string | undefined;
2526
2526
  repoUrl?: string | undefined;
2527
2527
  maxParallel?: number | undefined;
2528
2528
  tags?: string[] | undefined;
@@ -2621,7 +2621,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
2621
2621
  source: "checkout" | "local";
2622
2622
  status: "missing" | "not-git" | "ok";
2623
2623
  branch?: string | undefined;
2624
- forge?: "github" | undefined;
2624
+ forge?: string | undefined;
2625
2625
  repoUrl?: string | undefined;
2626
2626
  maxParallel?: number | undefined;
2627
2627
  tags?: string[] | undefined;
@@ -2755,7 +2755,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
2755
2755
  source: "checkout" | "local";
2756
2756
  status: "missing" | "not-git" | "ok";
2757
2757
  branch?: string | undefined;
2758
- forge?: "github" | undefined;
2758
+ forge?: string | undefined;
2759
2759
  repoUrl?: string | undefined;
2760
2760
  maxParallel?: number | undefined;
2761
2761
  tags?: string[] | undefined;
@@ -2837,7 +2837,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
2837
2837
  source: "checkout" | "local";
2838
2838
  status: "missing" | "not-git" | "ok";
2839
2839
  branch?: string | undefined;
2840
- forge?: "github" | undefined;
2840
+ forge?: string | undefined;
2841
2841
  repoUrl?: string | undefined;
2842
2842
  maxParallel?: number | undefined;
2843
2843
  tags?: string[] | undefined;
@@ -3041,12 +3041,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
3041
3041
  output: {
3042
3042
  generation: string;
3043
3043
  results: ({
3044
- projectId: string;
3045
- runId: string;
3046
- type: "error" | "reset";
3047
- status: 400 | 404 | 409 | 413 | 503;
3048
- error: string;
3049
- } | {
3050
3044
  projectId: string;
3051
3045
  runId: string;
3052
3046
  type: "batch";
@@ -3067,6 +3061,12 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
3067
3061
  cursor: string;
3068
3062
  afterSeq: number;
3069
3063
  hasMore: boolean;
3064
+ } | {
3065
+ projectId: string;
3066
+ runId: string;
3067
+ type: "error" | "reset";
3068
+ status: 400 | 404 | 409 | 413 | 503;
3069
+ error: string;
3070
3070
  })[];
3071
3071
  };
3072
3072
  outputFormat: "json";
@@ -7355,24 +7355,22 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
7355
7355
  };
7356
7356
  } | {
7357
7357
  output: {
7358
- workerId: string;
7359
- state: "complete" | "incomplete";
7360
- work?: {
7361
- uncommittedFiles: number;
7362
- commits: number;
7358
+ readonly code: "capacity_limit" | "denied_scope" | "incompatible_state" | "incomplete_cleanup" | "invalid_baseline" | "invalid_input" | "unauthenticated" | "unavailable_diff" | "unavailable_transport";
7359
+ readonly error: string;
7360
+ readonly modelChoices?: {
7361
+ runner: string;
7362
+ requestedModel: string;
7363
+ availableModels: {
7364
+ id: string;
7365
+ label: string;
7366
+ description: string;
7367
+ effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
7368
+ }[];
7369
+ otherRunners: string[];
7363
7370
  } | undefined;
7364
- deleted?: ({
7365
- kind: "worktree";
7366
- path: string;
7367
- } | {
7368
- kind: "branch";
7369
- ref: string;
7370
- })[] | undefined;
7371
- remaining: ("branch" | "process" | "worktree")[];
7372
- error?: string | undefined;
7373
7371
  };
7374
7372
  outputFormat: "json";
7375
- status: 200;
7373
+ status: 400 | 401 | 403 | 409 | 503;
7376
7374
  input: {
7377
7375
  query: {
7378
7376
  [x: string]: string | string[];
@@ -7405,7 +7403,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
7405
7403
  error?: string | undefined;
7406
7404
  };
7407
7405
  outputFormat: "json";
7408
- status: 409;
7406
+ status: 200;
7409
7407
  input: {
7410
7408
  query: {
7411
7409
  [x: string]: string | string[];
@@ -7421,22 +7419,24 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
7421
7419
  };
7422
7420
  } | {
7423
7421
  output: {
7424
- readonly code: "capacity_limit" | "denied_scope" | "incompatible_state" | "incomplete_cleanup" | "invalid_baseline" | "invalid_input" | "unauthenticated" | "unavailable_diff" | "unavailable_transport";
7425
- readonly error: string;
7426
- readonly modelChoices?: {
7427
- runner: string;
7428
- requestedModel: string;
7429
- availableModels: {
7430
- id: string;
7431
- label: string;
7432
- description: string;
7433
- effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
7434
- }[];
7435
- otherRunners: string[];
7422
+ workerId: string;
7423
+ state: "complete" | "incomplete";
7424
+ work?: {
7425
+ uncommittedFiles: number;
7426
+ commits: number;
7436
7427
  } | undefined;
7428
+ deleted?: ({
7429
+ kind: "worktree";
7430
+ path: string;
7431
+ } | {
7432
+ kind: "branch";
7433
+ ref: string;
7434
+ })[] | undefined;
7435
+ remaining: ("branch" | "process" | "worktree")[];
7436
+ error?: string | undefined;
7437
7437
  };
7438
7438
  outputFormat: "json";
7439
- status: 400 | 401 | 403 | 409 | 503;
7439
+ status: 409;
7440
7440
  input: {
7441
7441
  query: {
7442
7442
  [x: string]: string | string[];
@@ -22787,24 +22787,22 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
22787
22787
  };
22788
22788
  } | {
22789
22789
  output: {
22790
- workerId: string;
22791
- state: "complete" | "incomplete";
22792
- work?: {
22793
- uncommittedFiles: number;
22794
- commits: number;
22790
+ readonly code: "capacity_limit" | "denied_scope" | "incompatible_state" | "incomplete_cleanup" | "invalid_baseline" | "invalid_input" | "unauthenticated" | "unavailable_diff" | "unavailable_transport";
22791
+ readonly error: string;
22792
+ readonly modelChoices?: {
22793
+ runner: string;
22794
+ requestedModel: string;
22795
+ availableModels: {
22796
+ id: string;
22797
+ label: string;
22798
+ description: string;
22799
+ effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
22800
+ }[];
22801
+ otherRunners: string[];
22795
22802
  } | undefined;
22796
- deleted?: ({
22797
- kind: "worktree";
22798
- path: string;
22799
- } | {
22800
- kind: "branch";
22801
- ref: string;
22802
- })[] | undefined;
22803
- remaining: ("branch" | "process" | "worktree")[];
22804
- error?: string | undefined;
22805
22803
  };
22806
22804
  outputFormat: "json";
22807
- status: 200;
22805
+ status: 400 | 401 | 403 | 409 | 503;
22808
22806
  input: {
22809
22807
  query: {
22810
22808
  [x: string]: string | string[];
@@ -22837,7 +22835,7 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
22837
22835
  error?: string | undefined;
22838
22836
  };
22839
22837
  outputFormat: "json";
22840
- status: 409;
22838
+ status: 200;
22841
22839
  input: {
22842
22840
  query: {
22843
22841
  [x: string]: string | string[];
@@ -22853,22 +22851,24 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
22853
22851
  };
22854
22852
  } | {
22855
22853
  output: {
22856
- readonly code: "capacity_limit" | "denied_scope" | "incompatible_state" | "incomplete_cleanup" | "invalid_baseline" | "invalid_input" | "unauthenticated" | "unavailable_diff" | "unavailable_transport";
22857
- readonly error: string;
22858
- readonly modelChoices?: {
22859
- runner: string;
22860
- requestedModel: string;
22861
- availableModels: {
22862
- id: string;
22863
- label: string;
22864
- description: string;
22865
- effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
22866
- }[];
22867
- otherRunners: string[];
22854
+ workerId: string;
22855
+ state: "complete" | "incomplete";
22856
+ work?: {
22857
+ uncommittedFiles: number;
22858
+ commits: number;
22868
22859
  } | undefined;
22860
+ deleted?: ({
22861
+ kind: "worktree";
22862
+ path: string;
22863
+ } | {
22864
+ kind: "branch";
22865
+ ref: string;
22866
+ })[] | undefined;
22867
+ remaining: ("branch" | "process" | "worktree")[];
22868
+ error?: string | undefined;
22869
22869
  };
22870
22870
  outputFormat: "json";
22871
- status: 400 | 401 | 403 | 409 | 503;
22871
+ status: 409;
22872
22872
  input: {
22873
22873
  query: {
22874
22874
  [x: string]: string | string[];
@@ -7,6 +7,12 @@ export declare function createWorkspaceLiveRoutes(live: Parameters<typeof create
7
7
  output: {
8
8
  generation: string;
9
9
  results: ({
10
+ projectId: string;
11
+ runId: string;
12
+ type: "error" | "reset";
13
+ status: 400 | 404 | 409 | 413 | 503;
14
+ error: string;
15
+ } | {
10
16
  projectId: string;
11
17
  runId: string;
12
18
  type: "batch";
@@ -27,12 +33,6 @@ export declare function createWorkspaceLiveRoutes(live: Parameters<typeof create
27
33
  cursor: string;
28
34
  afterSeq: number;
29
35
  hasMore: boolean;
30
- } | {
31
- projectId: string;
32
- runId: string;
33
- type: "error" | "reset";
34
- status: 400 | 404 | 409 | 413 | 503;
35
- error: string;
36
36
  })[];
37
37
  };
38
38
  outputFormat: "json";
@@ -1,6 +1,5 @@
1
1
  import type { Home } from '../home/home.ts';
2
2
  import type { ProjectWebhook, WebhookTrigger } from '../contract/index.js';
3
- import { type ForgeKind } from '../server/forge/index.ts';
4
3
  import { type WorkspaceProject } from './config.ts';
5
4
  /**
6
5
  * Registry operations: canonical-root registration and slug allocation through merge writes,
@@ -77,11 +76,11 @@ export interface ProjectListEntry extends WorkspaceProjectWithoutWebhook {
77
76
  status: ProjectStatus;
78
77
  /** Current branch when cheaply available (omitted e.g. on an unborn HEAD). */
79
78
  branch?: string;
80
- /** Which forge the root's remote belongs to (#698) — classified from the
81
- * remote URL alone, no `gh` probe. Omitted when there is no forge remote.
79
+ /** The forge id of the root's remote (#698) — the first registered forge that matches the
80
+ * remote URL alone, no `gh` probe. Omitted when no forge matches.
82
81
  * The sidebar gates each project group's GitHub tab on this, instead of on
83
82
  * the boot folder's health-level forge answer. */
84
- forge?: ForgeKind;
83
+ forge?: string;
85
84
  /** The remote's web root (`https://github.com/owner/repo`), rebuilt from the
86
85
  * parsed remote so it can never carry credentials. What lets a cross-project
87
86
  * surface link a reference the run knows only by NUMBER — the global Tasks
@@ -91,7 +90,7 @@ export interface ProjectListEntry extends WorkspaceProjectWithoutWebhook {
91
90
  export interface RootProbe {
92
91
  status: ProjectStatus;
93
92
  branch?: string | undefined;
94
- forge?: ForgeKind | undefined;
93
+ forge?: string | undefined;
95
94
  repoUrl?: string | undefined;
96
95
  }
97
96
  /**
@@ -5,7 +5,7 @@ import { homedir } from 'node:os';
5
5
  import { basename, join, resolve } from 'node:path';
6
6
  import { PROJECT_TAGS_MAX, PROJECT_TAG_MAX_LENGTH } from '../contract/index.js';
7
7
  import { projectWebhooks, redactWebhook } from './webhooks.js';
8
- import { forgeKindOfRemote, forgeWebRoot } from '../server/forge/index.js';
8
+ import { forgeKindOfRemote, forgeWebRoot } from '../core/forge-registry.js';
9
9
  import { createRootProbeCache } from './root-probe-cache.js';
10
10
  import { getRepoInfo } from '../core/git.js';
11
11
  import { mergeWriteWorkspaceConfig, loadWorkspaceConfig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,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CACnG,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAAU,EAAE,IAAU;IACxD,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,WAA+B,CAAC;IACpC,MAAM,yBAAyB,CAAC,CAAC,MAAM,EAAE,EAAE;QACzC,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACxD,OAAO,GAAG,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QACjD,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;IACzB,CAAC,EAAE,IAAI,CAAC,CAAC;IACT,IAAI,WAAW;QAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;IACrD,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hearsay-tools/squawk",
3
- "version": "0.19.0-dev.8845",
3
+ "version": "0.19.0-dev.8872",
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.8845",
73
- "@open-mercato/cezar-contract": "0.19.0-dev.8845",
72
+ "@open-mercato/cezar-api-client": "0.19.0-dev.8872",
73
+ "@open-mercato/cezar-contract": "0.19.0-dev.8872",
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": "c468d96882a80b477b05cbfa76511e1e4f2e2d2a"
90
+ "gitHead": "7c30cb988eb26d81d38e30d5569dd14fc6a520e6"
91
91
  }
@@ -41,6 +41,10 @@ async function serveFixture() {
41
41
  },
42
42
  });
43
43
  syncBuiltinESMExports();
44
+ // A project's forge comes from the sealed forge registry, as boot.ts leaves it.
45
+ const { registerBuiltInForges, sealBuiltInForges } = await import('../src/built-in-forges.ts');
46
+ registerBuiltInForges();
47
+ sealBuiltInForges();
44
48
  const { listProjects, clearProjectProbeCache } = await import('../src/workspace/projects.ts');
45
49
  const { mergeWriteWorkspaceConfig } = await import('../src/workspace/config.ts');
46
50
  const { resolveHome } = await import('../src/home/resolve.ts');
@@ -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,Gt as o,It as s,Nt as c,Qt as l,Xt as u,Yt as d,dn as f,dt as p,mt as m,on as h,pt as g,rn as _,ut as v,wt as y,yt as b}from"./queries-ScB0s5Ar.js";import{Fn as x,Fr as S,In as C,hi as w,ii as T,n as E,sn as ee,zn as D}from"./toaster-CRikzxTs.js";import{f as O}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as k}from"./design-icons-CzEoMH9c.js";import{t as te}from"./createLucideIcon-BHp8sXmF.js";import{t as ne}from"./folder-browser-BKpkblOg.js";import{t as A}from"./button-B7MKxYjT.js";import{t as re}from"./badge-DQ3U69Ht.js";import{a as ie,i as ae,o as oe,r as se,s as ce,t as j}from"./dialog-B531GGAo.js";import{t as M}from"./status-dot-BRzVlF2X.js";import{n as N}from"./agents-settings-path-7X6_cvUg.js";import{t as P}from"./centered-state-V15AR_qo.js";import{Gt as F,Ht as I,Jt as L,Kt as R,N as z,Tn as B,Ut as V,Wt as H,Yt as U,j as W,qt as G,wn as K,xn as le}from"./index-02QMWGsE.js";import{t as q}from"./settings-select-CCIMGnyA.js";import{n as J,r as ue,t as de}from"./settings-agent-picker-Bl6ugpb9.js";import{n as fe,r as pe,t as me}from"./remote-settings-notice-zQv0O_2v.js";var he=te(`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(),ge=`~/.claude-second`;function _e({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=_().data,[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(r??n[0]??`claude`),[p,h]=(0,Y.useState)(``),[g,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=m(),S=g.trim();return(0,X.jsx)(j,{open:e,onOpenChange:t,children:(0,X.jsxs)(se,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(oe,{children:[(0,X.jsx)(ce,{children:`Add agent account`}),(0,X.jsx)(ae,{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,onChange:e=>f(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:u(i,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:p,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:g,placeholder:l(i,d)?.accountFolderExample??ge,onChange:e=>{v(e.target.value),c(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)(A,{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)(ne,{path:a,selected:s,onSelect:e=>{c(e),v(e.path),x.reset()},onEnter:e=>{o(e),c(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)(ie,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(A,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(A,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:d,configDir:S,...p.trim()?{label:p.trim()}:{}},{onSuccess:()=>{t(!1),h(``),v(``),c(null),b(!1),E(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function ve(e){return D(await C.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ye(e,t){return D(await C.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var be={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function xe(e){let t=b().data?.capabilities?.settingsAdmin===!0,n=w(),r=[`runner-install`,e],i=T({queryKey:r,queryFn:()=>ve(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=f({mutationFn:t=>ye(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 Se({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)(A,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function Ce({runner:e}){let t=xe(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?` · ${be[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(Se,{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 we={connected:B(`connected`),disconnected:B(`disconnected`),"not-installed":B(`not-installed`),unknown:B(`unknown`)};function Te(){let e=p(),t=_();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)(P,{icon:(0,X.jsx)(he,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(Oe,{data:e.data,runners:t.data})}function Ee(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function De(){let{hash:e}=O();(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 Oe({data:e,runners:t}){let n=b(),[r,i]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=a();return De(),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)(je,{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)(Me,{runners:t}),r===null?null:(0,X.jsx)(_e,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(I,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,X.jsxs)(F,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(L,{children:[(0,X.jsxs)(U,{children:[`Remove “`,o?.label,`”?`]}),(0,X.jsxs)(R,{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)(H,{children:`Cancel`}),(0,X.jsx)(V,{"data-action":`accounts-remove-confirm`,disabled:c.isPending,onClick:()=>{let e=o;e&&c.mutate(e.id,{onSuccess:()=>{s(null),E(`Removed ${e.label}`)},onError:e=>E(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function ke({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:K(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)(Z,{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 Z({version:e}){return K(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 Ae({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)(Ae,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function je({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=`${N(l)}-title`,m=i&&o?(0,X.jsx)(A,{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)(ke,{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:N(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)(Ce,{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 Me({runners:e}){let[t,n]=(0,Y.useState)(null),a=w(),c=s(),l=i(),u=h(r(e)),p=f({mutationFn:e=>ee(e),onSuccess:e=>a.setQueryData(o.config,e),onError:e=>E(e.message,{tone:`danger`})});if(c.data===void 0)return null;let m=ue([],e),g=c.data.agentDefaults.runner??`claude`,_=d(t??g,r(e))??t??g,v=c.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)(de,{rows:m,runner:g,accountFor:()=>null,providerStatus:l,disabled:p.isPending,onPick:e=>{e!==g&&p.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:_,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===_).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(k,{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:v[t.id]??``,disabled:p.isPending,onChange:e=>p.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:[z(t.id,e,u[t.id]?.data,[v[t.id]]).map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,X.jsx)(Ne,{runner:t.id,runners:e,catalog:u[t.id]})]})]},t.id))]})]})}function Ne({runner:e,runners:t,catalog:n}){let r=W(e,t,n);return r?(0,X.jsx)(`option`,{disabled:!0,children:r}):null}function Pe({account:e,runners:t,status:n,editable:r}){let i=g();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&l(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`&&l(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:i.isPending,onClick:()=>i.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>E(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>E(e instanceof x&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Fe(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 ${u(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=S(e),o=y(),s=v(a,e.status===void 0),c=e.status??s.data?.status,l=c?we[c.status]:void 0,u=Fe(e,t,c,n),d=u?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:l?`Sign-in: ${l.label}`:void 0,children:[(0,X.jsx)(M,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":u.slot,className:`text-foreground`,children:u.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(M,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:l?.label??`Checking…`})]}),f=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Pe,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>E(e.message,{tone:`danger`})}),children:`Check again`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(re,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-xs font-normal text-muted-foreground`,children:`discovered`}):null]}),m=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Ee(e.configDir)}):null,h=u?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:u.guidance}):null,g=c?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:c.hint}):null,_=n&&!e.isDefault?(0,X.jsx)(Ie,{account:e,onRemove:r}):null,b=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[p,d]}),m,h,g]});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:[f,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[b,_?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:_}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[b,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[f,_]})]})}function Ie({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=c();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)(A,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>E(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(A,{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{Te 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,Gt as o,It as s,Nt as c,Qt as l,Xt as u,Yt as d,dn as f,dt as p,mt as m,on as h,pt as g,rn as _,ut as v,wt as y,yt as b}from"./queries-hzlF788B.js";import{Fn as x,Fr as S,In as C,hi as w,ii as T,n as E,sn as ee,zn as D}from"./toaster-fWyfEGWF.js";import{f as O}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as k}from"./design-icons-CzEoMH9c.js";import{t as te}from"./createLucideIcon-BHp8sXmF.js";import{t as ne}from"./folder-browser-B_jJl4is.js";import{t as A}from"./button-B7MKxYjT.js";import{t as re}from"./badge-DQ3U69Ht.js";import{a as ie,i as ae,o as oe,r as se,s as ce,t as j}from"./dialog-B531GGAo.js";import{t as M}from"./status-dot-BRzVlF2X.js";import{n as N}from"./agents-settings-path-7X6_cvUg.js";import{t as P}from"./centered-state-V15AR_qo.js";import{Gt as F,Ht as I,Jt as L,Kt as R,N as z,Tn as B,Ut as V,Wt as H,Yt as U,j as W,qt as G,wn as K,xn as le}from"./index-CtmR0Rih.js";import{t as q}from"./settings-select-CCIMGnyA.js";import{n as J,r as ue,t as de}from"./settings-agent-picker-QEhmK2uD.js";import{n as fe,r as pe,t as me}from"./remote-settings-notice-CEmfxzke.js";var he=te(`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(),ge=`~/.claude-second`;function _e({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=_().data,[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(r??n[0]??`claude`),[p,h]=(0,Y.useState)(``),[g,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=m(),S=g.trim();return(0,X.jsx)(j,{open:e,onOpenChange:t,children:(0,X.jsxs)(se,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(oe,{children:[(0,X.jsx)(ce,{children:`Add agent account`}),(0,X.jsx)(ae,{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,onChange:e=>f(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:u(i,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:p,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:g,placeholder:l(i,d)?.accountFolderExample??ge,onChange:e=>{v(e.target.value),c(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)(A,{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)(ne,{path:a,selected:s,onSelect:e=>{c(e),v(e.path),x.reset()},onEnter:e=>{o(e),c(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)(ie,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(A,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(A,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:d,configDir:S,...p.trim()?{label:p.trim()}:{}},{onSuccess:()=>{t(!1),h(``),v(``),c(null),b(!1),E(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function ve(e){return D(await C.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ye(e,t){return D(await C.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var be={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function xe(e){let t=b().data?.capabilities?.settingsAdmin===!0,n=w(),r=[`runner-install`,e],i=T({queryKey:r,queryFn:()=>ve(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=f({mutationFn:t=>ye(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 Se({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)(A,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function Ce({runner:e}){let t=xe(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?` · ${be[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(Se,{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 we={connected:B(`connected`),disconnected:B(`disconnected`),"not-installed":B(`not-installed`),unknown:B(`unknown`)};function Te(){let e=p(),t=_();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)(P,{icon:(0,X.jsx)(he,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(Oe,{data:e.data,runners:t.data})}function Ee(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function De(){let{hash:e}=O();(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 Oe({data:e,runners:t}){let n=b(),[r,i]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=a();return De(),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)(je,{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)(Me,{runners:t}),r===null?null:(0,X.jsx)(_e,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(I,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,X.jsxs)(F,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(L,{children:[(0,X.jsxs)(U,{children:[`Remove “`,o?.label,`”?`]}),(0,X.jsxs)(R,{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)(H,{children:`Cancel`}),(0,X.jsx)(V,{"data-action":`accounts-remove-confirm`,disabled:c.isPending,onClick:()=>{let e=o;e&&c.mutate(e.id,{onSuccess:()=>{s(null),E(`Removed ${e.label}`)},onError:e=>E(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function ke({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:K(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)(Z,{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 Z({version:e}){return K(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 Ae({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)(Ae,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function je({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=`${N(l)}-title`,m=i&&o?(0,X.jsx)(A,{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)(ke,{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:N(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)(Ce,{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 Me({runners:e}){let[t,n]=(0,Y.useState)(null),a=w(),c=s(),l=i(),u=h(r(e)),p=f({mutationFn:e=>ee(e),onSuccess:e=>a.setQueryData(o.config,e),onError:e=>E(e.message,{tone:`danger`})});if(c.data===void 0)return null;let m=ue([],e),g=c.data.agentDefaults.runner??`claude`,_=d(t??g,r(e))??t??g,v=c.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)(de,{rows:m,runner:g,accountFor:()=>null,providerStatus:l,disabled:p.isPending,onPick:e=>{e!==g&&p.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:_,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===_).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(k,{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:v[t.id]??``,disabled:p.isPending,onChange:e=>p.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:[z(t.id,e,u[t.id]?.data,[v[t.id]]).map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,X.jsx)(Ne,{runner:t.id,runners:e,catalog:u[t.id]})]})]},t.id))]})]})}function Ne({runner:e,runners:t,catalog:n}){let r=W(e,t,n);return r?(0,X.jsx)(`option`,{disabled:!0,children:r}):null}function Pe({account:e,runners:t,status:n,editable:r}){let i=g();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&l(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`&&l(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:i.isPending,onClick:()=>i.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>E(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>E(e instanceof x&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Fe(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 ${u(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=S(e),o=y(),s=v(a,e.status===void 0),c=e.status??s.data?.status,l=c?we[c.status]:void 0,u=Fe(e,t,c,n),d=u?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:l?`Sign-in: ${l.label}`:void 0,children:[(0,X.jsx)(M,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":u.slot,className:`text-foreground`,children:u.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(M,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:l?.label??`Checking…`})]}),f=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Pe,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>E(e.message,{tone:`danger`})}),children:`Check again`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(re,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-xs font-normal text-muted-foreground`,children:`discovered`}):null]}),m=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Ee(e.configDir)}):null,h=u?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:u.guidance}):null,g=c?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:c.hint}):null,_=n&&!e.isDefault?(0,X.jsx)(Ie,{account:e,onRemove:r}):null,b=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[p,d]}),m,h,g]});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:[f,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[b,_?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:_}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[b,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[f,_]})]})}function Ie({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=c();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)(A,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>E(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(A,{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{Te as GlobalAgentsSection};