@hearsay-tools/squawk 0.19.0-dev.8893 → 0.19.0-dev.8902

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 (130) hide show
  1. package/dist/activity/requests.js +1 -1
  2. package/dist/activity/requests.js.map +1 -1
  3. package/dist/activity/text.d.ts +0 -2
  4. package/dist/activity/text.js +1 -7
  5. package/dist/activity/text.js.map +1 -1
  6. package/dist/activity/tool-activity.js +1 -1
  7. package/dist/activity/tool-activity.js.map +1 -1
  8. package/dist/activity/wait.js +1 -1
  9. package/dist/activity/wait.js.map +1 -1
  10. package/dist/ci-wait/errors.js +2 -2
  11. package/dist/ci-wait/errors.js.map +1 -1
  12. package/dist/ci-wait/github.d.ts +22 -30
  13. package/dist/ci-wait/github.js +27 -9
  14. package/dist/ci-wait/github.js.map +1 -1
  15. package/dist/ci-wait/pr-wait-kind.d.ts +2 -2
  16. package/dist/ci-wait/pr-wait-kind.js +3 -3
  17. package/dist/ci-wait/pr-wait-kind.js.map +1 -1
  18. package/dist/ci-wait/pr-wait-port.d.ts +44 -0
  19. package/dist/ci-wait/pr-wait-port.js +125 -0
  20. package/dist/ci-wait/pr-wait-port.js.map +1 -0
  21. package/dist/ci-wait/progress.d.ts +4 -5
  22. package/dist/ci-wait/progress.js +1 -1
  23. package/dist/ci-wait/progress.js.map +1 -1
  24. package/dist/ci-wait/supervisor.d.ts +13 -8
  25. package/dist/ci-wait/supervisor.js +59 -26
  26. package/dist/ci-wait/supervisor.js.map +1 -1
  27. package/dist/ci-wait/tool-catalog.js +1 -1
  28. package/dist/ci-wait/tool-catalog.js.map +1 -1
  29. package/dist/core/clamp-text.d.ts +2 -0
  30. package/dist/core/clamp-text.js +8 -0
  31. package/dist/core/clamp-text.js.map +1 -0
  32. package/dist/core/forge-pr-wait.d.ts +99 -0
  33. package/dist/core/forge-pr-wait.js +20 -0
  34. package/dist/core/forge-pr-wait.js.map +1 -0
  35. package/dist/core/forge-registry.d.ts +6 -2
  36. package/dist/core/forge-registry.js +5 -0
  37. package/dist/core/forge-registry.js.map +1 -1
  38. package/dist/features/automations/tools.d.ts +8 -8
  39. package/dist/plugin/index.d.ts +3 -0
  40. package/dist/plugin/index.js +2 -0
  41. package/dist/plugin/index.js.map +1 -1
  42. package/dist/runs/run-archive.d.ts +72 -72
  43. package/dist/server/forge/github-forge.js +3 -0
  44. package/dist/server/forge/github-forge.js.map +1 -1
  45. package/dist/server/live-routes.d.ts +6 -6
  46. package/dist/server/runs-routes.d.ts +17 -17
  47. package/dist/server/server.d.ts +1396 -1396
  48. package/dist/server/workspace-live-routes.d.ts +6 -6
  49. package/dist/workflows/input-acknowledgement.d.ts +24 -24
  50. package/dist/workflows/run/wait-input-descriptors.js +1 -1
  51. package/dist/workflows/run/wait-input-descriptors.js.map +1 -1
  52. package/dist/workflows/run/wait-kind-registry.d.ts +3 -2
  53. package/dist/workflows/run/wait-kind-registry.js.map +1 -1
  54. package/dist/workflows/run/wait-registration-tool.js +3 -1
  55. package/dist/workflows/run/wait-registration-tool.js.map +1 -1
  56. package/package.json +4 -4
  57. package/web/dist/assets/{accounts-section-DV18K14j.js → accounts-section-CL4_y1Ap.js} +1 -1
  58. package/web/dist/assets/{activity-motion-U0gkYTm-.js → activity-motion-1nxINCqs.js} +1 -1
  59. package/web/dist/assets/{activity-route-CKFb-IYI.js → activity-route-yCPzQHRl.js} +1 -1
  60. package/web/dist/assets/{agent-config-section-X66FRjsE.js → agent-config-section-CO-Bl7d7.js} +1 -1
  61. package/web/dist/assets/{agent-defaults-section-EEYiGk_Q.js → agent-defaults-section-C90pO0nt.js} +1 -1
  62. package/web/dist/assets/{appearance-D4I-ANZ_.js → appearance-dgwYTY63.js} +1 -1
  63. package/web/dist/assets/{archive-on-merge-field-D6y7pCov.js → archive-on-merge-field-DJZVhb_I.js} +1 -1
  64. package/web/dist/assets/{automations-route-4ahsnx6z.js → automations-route-BhSkU9kZ.js} +2 -2
  65. package/web/dist/assets/{command-ppU3xBNs.js → command-BMMjB5k9.js} +1 -1
  66. package/web/dist/assets/{commit-list-Dp0c_x8b.js → commit-list-mYh1t3BD.js} +1 -1
  67. package/web/dist/assets/{design-icons-CzEoMH9c.js → design-icons-BZt8Kqs9.js} +1 -1
  68. package/web/dist/assets/{dialog-DXCws12U.js → dialog-CB9ZhEk2.js} +1 -1
  69. package/web/dist/assets/{diff-n7BcLjSi.js → diff-B4l1BaZJ.js} +2 -2
  70. package/web/dist/assets/{diff-controls-7hWjGeWp.js → diff-controls-Bs58JOMz.js} +1 -1
  71. package/web/dist/assets/{diff-view-CJNrRCRI.js → diff-view-BGwOGavy.js} +1 -1
  72. package/web/dist/assets/{discard-changes-dialog-Bd3w4xOW.js → discard-changes-dialog-Cr1vlcjZ.js} +1 -1
  73. package/web/dist/assets/dropdown-menu-VFda6KAg.js +1 -0
  74. package/web/dist/assets/{file-preview-DS5j5uFi.js → file-preview-DqopZwES.js} +1 -1
  75. package/web/dist/assets/{git-toolbar-D5N_Ucqr.js → git-toolbar-pr68yTY4.js} +1 -1
  76. package/web/dist/assets/github-BY-X8L5Q.js +1 -0
  77. package/web/dist/assets/{global-activity-route-DqyHJiZz.js → global-activity-route-XkwjlnaD.js} +1 -1
  78. package/web/dist/assets/index-BOWGArJd.css +1 -0
  79. package/web/dist/assets/index-I4_drgNu.js +21 -0
  80. package/web/dist/assets/{markdown-9FIYg1nH.js → markdown-fuaT5ciN.js} +1 -1
  81. package/web/dist/assets/{open-in-menu-L5v_AQZt.js → open-in-menu-Uw-sJhbG.js} +1 -1
  82. package/web/dist/assets/{option-select-CYbw9rk4.js → option-select-_tHcMUWt.js} +1 -1
  83. package/web/dist/assets/{preferences-section-Do1nZwKg.js → preferences-section-Crh_5QfK.js} +1 -1
  84. package/web/dist/assets/{preview-pane-connected-o7nx7h4-.js → preview-pane-connected-CLWRxEhI.js} +1 -1
  85. package/web/dist/assets/{project-location-BFN7mvbZ.js → project-location-DmGO5Dqx.js} +1 -1
  86. package/web/dist/assets/{projects-section-Bq9DzRDF.js → projects-section-CLPN14JX.js} +1 -1
  87. package/web/dist/assets/{prompt-templates-section-CNa_K7AU.js → prompt-templates-section-CQHpVrcB.js} +2 -2
  88. package/web/dist/assets/{reference-chip-O8Bfl1Oi.js → reference-chip-Dk69XD7Q.js} +1 -1
  89. package/web/dist/assets/{remote-settings-notice-CbCCb3QA.js → remote-settings-notice-C8naX_yp.js} +1 -1
  90. package/web/dist/assets/{repo-git-Dz3fhj6j.js → repo-git-CTSdvalV.js} +1 -1
  91. package/web/dist/assets/{report-reader-BfsdCLq-.js → report-reader-DJJixZxy.js} +1 -1
  92. package/web/dist/assets/{report-selection-cuFCCxDW.js → report-selection-BH0M_8bk.js} +1 -1
  93. package/web/dist/assets/{reports-Df83TkE3.js → reports-DXfywo34.js} +1 -1
  94. package/web/dist/assets/{resources-section-CKJGgLWa.js → resources-section-CA-D1Vj2.js} +1 -1
  95. package/web/dist/assets/review-panel-UI6FQQmp.js +11 -0
  96. package/web/dist/assets/{run-header-BWNapiIC.js → run-header-DDQU9tCB.js} +2 -2
  97. package/web/dist/assets/select-QO8XlmjU.js +1 -0
  98. package/web/dist/assets/{session-context-section-CSDtUgJI.js → session-context-section-CTDQl-i5.js} +1 -1
  99. package/web/dist/assets/{settings-agent-picker-pMZcMiW4.js → settings-agent-picker-DE5zKJtS.js} +1 -1
  100. package/web/dist/assets/{settings-list-detail-Ch1KMPjr.js → settings-list-detail-DcRsGkGy.js} +1 -1
  101. package/web/dist/assets/{settings-save-bar-CFkofH5G.js → settings-save-bar-DM7T22Nr.js} +1 -1
  102. package/web/dist/assets/{settings-shell-B6-ofejE.js → settings-shell-EOUcgx1J.js} +1 -1
  103. package/web/dist/assets/{sidebar-section-DwcXrxn2.js → sidebar-section-C69ES3GL.js} +1 -1
  104. package/web/dist/assets/{skills-DD5hhynR.js → skills-DuaNQ6XW.js} +1 -1
  105. package/web/dist/assets/task-changes-midIkW0D.js +1 -0
  106. package/web/dist/assets/{task-commits-D8Pzk4b3.js → task-commits-DAT7-sIh.js} +1 -1
  107. package/web/dist/assets/{task-file-scope-DPJOeknI.js → task-file-scope-BYAH1Mj8.js} +1 -1
  108. package/web/dist/assets/{task-files-DJnNyynG.js → task-files-CJaZfp0y.js} +1 -1
  109. package/web/dist/assets/{task-github-item-Di9HWGn6.js → task-github-item-BnoxG2el.js} +1 -1
  110. package/web/dist/assets/task-thread-fsRo8vgf.js +2 -0
  111. package/web/dist/assets/{thread-state-B2dX4psn.js → thread-state-T5A2uz_q.js} +1 -1
  112. package/web/dist/assets/use-hand-to-agent-state-CqiCI37V.css +1 -0
  113. package/web/dist/assets/use-hand-to-agent-state-Cy6oaj7k.js +1 -0
  114. package/web/dist/assets/use-path-bases-x6weDx5i.js +1 -0
  115. package/web/dist/assets/workflows-CwZ1aiR4.js +7 -0
  116. package/web/dist/assets/{workspace-tools-6fvZHbrZ.js → workspace-tools-0-Yx7SCS.js} +1 -1
  117. package/web/dist/assets/{worktrees-section-C1fpzChO.js → worktrees-section-Cn8sFOCC.js} +1 -1
  118. package/web/dist/index.html +9 -9
  119. package/web/dist/assets/dropdown-menu-B60L-d_4.js +0 -1
  120. package/web/dist/assets/github-Bhj0PA8h.js +0 -1
  121. package/web/dist/assets/index-UMSYsh9P.css +0 -1
  122. package/web/dist/assets/index-i4Bu7SvU.js +0 -21
  123. package/web/dist/assets/review-panel-BaUd88ko.js +0 -11
  124. package/web/dist/assets/select-Cy2NunWj.js +0 -1
  125. package/web/dist/assets/task-changes-CbWxyOEd.js +0 -1
  126. package/web/dist/assets/task-thread-gXImKbGN.js +0 -2
  127. package/web/dist/assets/use-hand-to-agent-state-BHaqyTxa.css +0 -1
  128. package/web/dist/assets/use-hand-to-agent-state-DhUiLIQg.js +0 -1
  129. package/web/dist/assets/use-path-bases-BzlzA9bw.js +0 -1
  130. package/web/dist/assets/workflows-slzqyi2_.js +0 -7
@@ -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";
@@ -75,30 +75,6 @@ export declare function analyseAcknowledgedInput(runId: string, state: ActiveRun
75
75
  deadline: string;
76
76
  seconds: number;
77
77
  note?: string | undefined;
78
- } | {
79
- id: string;
80
- source: "agent" | "cezar";
81
- via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
82
- registeredAt: string;
83
- phase: "cancelled" | "delivered" | "open" | "resolved";
84
- resolvedAt?: string | undefined;
85
- deliveredAt?: string | undefined;
86
- cancelledAt?: string | undefined;
87
- turnId: string;
88
- kind: "process";
89
- deadline: string;
90
- timeoutSeconds: number;
91
- pid: number;
92
- startToken?: string | undefined;
93
- exitFile?: string | undefined;
94
- note?: string | undefined;
95
- result?: {
96
- outcome: "deadline" | "error" | "exit_file" | "exited";
97
- observedAt: string;
98
- exitCode?: number | undefined;
99
- exitFileNote?: "not-an-exit-code" | undefined;
100
- diagnostic?: string | undefined;
101
- } | undefined;
102
78
  } | {
103
79
  id: string;
104
80
  source: "agent" | "cezar";
@@ -160,6 +136,30 @@ export declare function analyseAcknowledgedInput(runId: string, state: ActiveRun
160
136
  reason: "outcome" | "timeout";
161
137
  } | undefined;
162
138
  wakeInputId?: string | undefined;
139
+ } | {
140
+ id: string;
141
+ source: "agent" | "cezar";
142
+ via: "ask-line" | "budget" | "cez-message-wait" | "cez-worker-wait" | "cezar_ask" | "cezar_wait" | "cezar_wait_for_ci" | "completion" | "monitoring-line" | "native-ask" | "native-subagents" | "no-wait" | "schedule-wakeup";
143
+ registeredAt: string;
144
+ phase: "cancelled" | "delivered" | "open" | "resolved";
145
+ resolvedAt?: string | undefined;
146
+ deliveredAt?: string | undefined;
147
+ cancelledAt?: string | undefined;
148
+ turnId: string;
149
+ kind: "process";
150
+ deadline: string;
151
+ timeoutSeconds: number;
152
+ pid: number;
153
+ startToken?: string | undefined;
154
+ exitFile?: string | undefined;
155
+ note?: string | undefined;
156
+ result?: {
157
+ outcome: "deadline" | "error" | "exit_file" | "exited";
158
+ observedAt: string;
159
+ exitCode?: number | undefined;
160
+ exitFileNote?: "not-an-exit-code" | undefined;
161
+ diagnostic?: string | undefined;
162
+ } | undefined;
163
163
  } | {
164
164
  id: string;
165
165
  source: "agent" | "cezar";
@@ -6,7 +6,7 @@ import { cliCommandAdvertised } from '../../core/cli-registry.js';
6
6
  const jobs = () => cliCommandAdvertised('job');
7
7
  const descriptions = {
8
8
  operation_id: 'Optional retry identity. Reuse it with exactly the same arguments after an unknown outcome; never use it for a different registration.',
9
- pr: 'kind "pr": the HTTPS GitHub pull request URL.',
9
+ pr: 'kind "pr": the HTTPS pull request URL.',
10
10
  until: 'kind "pr": "checks" (default) watches checks; "merge" waits for merge or closure and ignores queue removal. After requesting a merge, use "merge_or_blocked": wakes on merge, closure, conflict, or neither queue membership nor enabled auto-merge remaining. Pending checks or a queue slot alone do not end it. All targets retain their deadline and query-error exits. Only "merged" confirms success; "blocked" requires inspection and grants no permission to retry or merge.',
11
11
  wake_on_conflict: 'kind "pr": Default true for "checks" and "merge". Set false when your work depends on another PR merging and you want to ignore its conflicts. "merge_or_blocked" always reports conflicts, regardless of this setting. With "checks", a conflicting PR may have no checks, ending as no_checks or deadline.',
12
12
  checks: 'kind "pr" with until "checks": "required" (default) waits on the checks GitHub requires for this PR (branch protection or rulesets) and takes the outcome from them; with no required check on the PR it waits on every check, and the result says so. "all" waits on every check. The result names each check outside the scope that is still pending or failed.',
@@ -1 +1 @@
1
- {"version":3,"file":"wait-input-descriptors.js","sourceRoot":"","sources":["../../../src/workflows/run/wait-input-descriptors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE;uGACuG;AACvG,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;AAE/C,MAAM,YAAY,GAA2B;IAC3C,YAAY,EAAE,wIAAwI;IACtJ,EAAE,EAAE,+CAA+C;IACnD,KAAK,EAAE,udAAud;IAC9d,gBAAgB,EAAE,8SAA8S;IAChU,MAAM,EAAE,mWAAmW;IAC3W,QAAQ,EAAE,iLAAiL;IAC3L,UAAU,EAAE,mEAAmE;IAC/E,WAAW,EAAE,2HAA2H;IACxI,QAAQ,EAAE,wOAAwO;IAClP,IAAI,EAAE,2IAA2I;IACjJ,eAAe,EAAE,4LAA4L;IAC7M,OAAO,EAAE,iDAAiD;IAC1D,IAAI,GAAG;QACL,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,6FAA6F;YAC3G,CAAC,CAAC,oDAAoD,CAAC;IAC3D,CAAC;IACD,IAAI,SAAS;QACX,OAAO,6BAA6B,IAAI,EAAE,CAAC,CAAC,CAAC,kFAAkF,CAAC,CAAC,CAAC,GAAG,sNAAsN,CAAC;IAC9V,CAAC;IACD,IAAI,EAAE,8EAA8E;CACrF,CAAC;AACF,MAAM,gBAAgB,GAAG,uTAAuT,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAE7V,+FAA+F;AAC/F,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,8B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type { BuiltInWaitKindRow } from './wait-kinds.ts';
4
4
  import type { AskErrorCode, BuiltInSquawkWaitRequest, WaitErrorCode, WaitVia } from '../../contract/index.js';
5
- import type { CiPrIdentity, CiWait, CiWaitResult } from '../../contract/index.js';
5
+ import type { CiPrIdentity, CiWait, CiWaitResult, PrWaitUntil } from '../../contract/index.js';
6
6
  import type { RunRecord, RunStore } from '../../runs/store.ts';
7
7
  import type { ProcessWaitSupervisor } from '../../process-wait/supervisor.ts';
8
8
  import type { ExitFileRoots } from '../../process-wait/exit-file.ts';
@@ -22,7 +22,8 @@ export interface WaitInputDescriptor {
22
22
  /** The CI watch behind `pr` waits. The core declares this port and the forge's supervisor
23
23
  * implements it, so the core imports no feature (ADR 0065). */
24
24
  export interface CiWatchPort {
25
- resolve(pr: string, signal?: AbortSignal): Promise<CiPrIdentity>;
25
+ /** Refuses with `unsupported_host` when no forge serves the URL, or its forge cannot serve `until`. */
26
+ resolve(pr: string, signal?: AbortSignal, until?: PrWaitUntil): Promise<CiPrIdentity>;
26
27
  watch(wait: CiWait, signal: AbortSignal): Promise<CiWaitResult>;
27
28
  close(): void;
28
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wait-kind-registry.js","sourceRoot":"","sources":["../../../src/workflows/run/wait-kind-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAsI7D,MAAM,QAAQ,GAAG,mBAAmB,CAAsB;IACxD,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,+FAA+F;CAC1G,CAAC,CAAC;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,EAAuB,CAAC;AACrD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrH,uFAAuF;AACvF,MAAM,UAAU,yB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,CAAC,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,CAAC,MAAM,EAAE,OAAO;QAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,6BAA6B,CAAC,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACjH,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
@@ -3,6 +3,7 @@ import { randomUUID } from 'node:crypto';
3
3
  import { waitErrorCodeSchema } from '../../contract/index.js';
4
4
  import { squawkWaitRequestSchema } from '../../contract/index.js';
5
5
  import { waitErrorMessage } from '../../ci-wait/errors.js';
6
+ import { PrWaitRefusal } from '../../core/forge-pr-wait.js';
6
7
  import { openWaitList, waitAnswerKind } from '../waits.js';
7
8
  import { registrationIdentity, replayRegistration } from './wait-registration.js';
8
9
  function accepted(host, runId, wait, receipt, operationId, replayed) {
@@ -21,7 +22,8 @@ function refused(host, runId, request, error) {
21
22
  throw error;
22
23
  const retained = 'retainedWait' in fields ? openWaitList([fields.retainedWait])[0] : undefined;
23
24
  return { answer: { ok: false, effect: 'refused', operation_id: request.operation_id, code: code.data,
24
- message: waitErrorMessage(code.data), open_waits: openWaitList(host.store.getRun(runId)?.waits ?? []),
25
+ // A PR wait refusal names the forge and what it lacks (spec 2026-11-28-forge-plugin-seam, decision 4).
26
+ message: error instanceof PrWaitRefusal ? error.message : waitErrorMessage(code.data), open_waits: openWaitList(host.store.getRun(runId)?.waits ?? []),
25
27
  ...(retained ? { retained_wait: retained } : {}) } };
26
28
  }
27
29
  // Serialize only overlapping retries of one operation. Different operations retain their
@@ -1 +1 @@
1
- {"version":3,"file":"wait-registration-tool.js","sourceRoot":"","sources":["../../../src/workflows/run/wait-registration-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,mBA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Q,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YAC/E,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAAC,OAAO,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;YAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hearsay-tools/squawk",
3
- "version": "0.19.0-dev.8893",
3
+ "version": "0.19.0-dev.8902",
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.8893",
73
- "@open-mercato/cezar-contract": "0.19.0-dev.8893",
72
+ "@open-mercato/cezar-api-client": "0.19.0-dev.8902",
73
+ "@open-mercato/cezar-contract": "0.19.0-dev.8902",
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": "7fcda5e7cce4b2f1e6b986767ca3b96eb3303d98"
90
+ "gitHead": "3e85c5e2e22b164d3878c4c7c8c9d29e01a23db4"
91
91
  }
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$t as r,Ct as i,Dt as a,It as o,Nt as s,Qt as c,Xt as l,Yt as u,dn as d,dt as f,mt as p,on as m,pt as h,rn as g,ut as _,wt as v,yt as y}from"./queries-CIeJg62Y.js";import{Fn as b,Fr as x,In as S,hi as ee,ii as C,n as w,zn as T}from"./toaster-D0HMoto5.js";import{f as E}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as D}from"./design-icons-CzEoMH9c.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as te}from"./folder-browser-BSGB9hhQ.js";import{t as k}from"./button-C8jUIs8Q.js";import{t as ne}from"./badge-B6B-xYQQ.js";import{a as re,i as ie,o as ae,r as oe,s as se,t as A}from"./dialog-DXCws12U.js";import{t as j}from"./status-dot-BXf-Ubd0.js";import{n as M}from"./agents-settings-path-7X6_cvUg.js";import{t as N}from"./centered-state-BgSV4e79.js";import{A as P,Cn as F,Dn as I,En as L,Gt as R,Jt as z,Kt as B,Ln as V,M as H,P as U,Wt as W,Xt as G,Yt as K,Zt as ce,qt as le}from"./index-i4Bu7SvU.js";import{t as q}from"./option-select-CYbw9rk4.js";import{n as J,r as ue,t as de}from"./settings-agent-picker-pMZcMiW4.js";import{n as fe,r as pe,t as me}from"./remote-settings-notice-CbCCb3QA.js";import{n as he,t as ge}from"./save-cue-CpHgT93o.js";import{t as _e}from"./use-path-bases-BzlzA9bw.js";import{t as ve}from"./use-workspace-config-save-bZksgjRK.js";var ye=O(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Y=e(t(),1),X=n(),be=`~/.claude-second`;function xe({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=g().data,[a,o]=(0,Y.useState)(null),[s,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(r??n[0]??`claude`),[m,h]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=p(),S=_.trim();return(0,X.jsx)(A,{open:e,onOpenChange:t,children:(0,X.jsxs)(oe,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(ae,{children:[(0,X.jsx)(se,{children:`Add agent account`}),(0,X.jsx)(ie,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,X.jsx)(q,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:d,onValueChange:e=>f(e),className:`settings-select max-w-full bg-card text-[13px]`,options:n.map(e=>({value:e,label:l(i,e)}))})]}),(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,X.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:m,placeholder:`Work`,onChange:e=>h(e.target.value),className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,X.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:_,placeholder:c(i,d)?.accountFolderExample??be,onChange:e=>{v(e.target.value),u(null),x.reset()},className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 font-mono text-[13px] outline-none focus-visible:border-ring`}),(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":y,onClick:()=>b(e=>!e),children:y?`Hide folders`:`Browse…`})]}),(0,X.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[`A `,(0,X.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),y?(0,X.jsx)(te,{path:a,selected:s,onSelect:e=>{u(e),v(e.path),x.reset()},onEnter:e=>{o(e),u(null),x.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,x.isError?(0,X.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:x.error instanceof Error?x.error.message:`could not add that folder`}):null,(0,X.jsxs)(re,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(k,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(k,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:d,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),h(``),v(``),u(null),b(!1),w(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function Se(e){return T(await S.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function Ce(e,t){return T(await S.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var we={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function Te(e){let t=y().data?.capabilities?.settingsAdmin===!0,n=ee(),r=[`runner-install`,e],i=C({queryKey:r,queryFn:()=>Se(e),enabled:t,retry:!1,refetchInterval:e=>{if(e.state.error)return!1;let t=e.state.data?.phase;return t&&t!==`idle`&&t!==`failed`?1e3:6e4}}),a=d({mutationFn:t=>Ce(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),o=i.data;return{allowed:t,data:o,busy:a.isPending||!!o&&o.phase!==`idle`&&o.phase!==`failed`,error:a.error?.message??i.error?.message??o?.error,action:a,status:i}}function Ee({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,X.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function De({runner:e}){let t=Te(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,X.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,X.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[r?.installedVersion?`Installed CLI ${r.installedVersion}`:`CLI not installed`,r?.latestVersion?` · Latest ${r.latestVersion}`:``,i&&r?` · ${we[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(Ee,{state:t}),r?.installedVersion?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var Oe={connected:I(`connected`),disconnected:I(`disconnected`),"not-installed":I(`not-installed`),unknown:I(`unknown`)};function ke(){let e=f(),t=g();if(e.isPending||t.isPending)return(0,X.jsx)(`p`,{"data-slot":`accounts-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agents…`});let n=e.error??t.error;return n?(0,X.jsx)(N,{icon:(0,X.jsx)(ye,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(je,{data:e.data,runners:t.data})}function Z(e,t){let n=V(e,t),r=n.split(`/`);return r.length>4?`…/${r.slice(-3).join(`/`)}`:n}function Ae(){let{hash:e}=E();(0,Y.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function je({data:e,runners:t}){let n=y(),[r,i]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=a();return Ae(),pe(),(0,X.jsxs)(`div`,{"data-slot":`accounts-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,X.jsx)(fe,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,X.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-muted-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,X.jsx)(`code`,{children:me}),` on the host to add, edit, or sign in to accounts here.`]}),(0,X.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-3`,children:t.runners.map(r=>(0,X.jsx)(Fe,{entry:r,check:n.data?.checks?.find(e=>e.name===r.id),settingsAdmin:n.data?.capabilities?.settingsAdmin===!0,runners:t,editable:e.editable,accounts:e.profiles.filter(e=>e.provider===r.id),canCarryAccounts:e.profileCapableProviders.includes(r.id),onAdd:()=>i(r.id),onRemove:s},r.id))}),(0,X.jsx)(Ie,{runners:t}),r===null?null:(0,X.jsx)(xe,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(W,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,X.jsxs)(le,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(G,{children:[(0,X.jsxs)(ce,{children:[`Remove “`,o?.label,`”?`]}),(0,X.jsxs)(z,{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)(K,{children:[(0,X.jsx)(B,{children:`Cancel`}),(0,X.jsx)(R,{"data-action":`accounts-remove-confirm`,disabled:c.isPending,onClick:()=>{let e=o;e&&c.mutate(e.id,{onSuccess:()=>{s(null),w(`Removed ${e.label}`)},onError:e=>w(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Me({entry:e,check:t}){return t===void 0?(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking CLI…`}):t.available?(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:L(t.version)?`CLI simulated`:`CLI installed`}),t.version?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}),(0,X.jsx)(Ne,{version:t.version})]}):null]}):(0,X.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`CLI not installed`,e.installHint?(0,X.jsxs)(X.Fragment,{children:[` — `,(0,X.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}function Ne({version:e}){return L(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:F.label}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`, version `}),(0,X.jsx)(`span`,{"data-slot":`agent-version`,className:`text-muted-foreground`,children:e})]})}function Pe({items:e}){let t=e.filter(e=>e!=null&&e!==!1);return t.length===0?null:(0,X.jsx)(`p`,{"data-slot":`agent-summary`,className:`settings-agent-summary`,children:t.map((e,t)=>(0,X.jsxs)(`span`,{className:`settings-agent-summary-item`,children:[t>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}):null,e]},t))})}function Q({titleId:e,title:t,summary:n,actions:r,actionsSlot:i}){return(0,X.jsxs)(`div`,{"data-slot":`agent-head`,className:`settings-agent-head`,children:[(0,X.jsxs)(`div`,{className:`settings-agent-heading`,children:[(0,X.jsx)(`h3`,{id:e,className:`settings-account-provider-title`,children:t}),(0,X.jsx)(Pe,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Fe({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.displayName,d=e.managedInstall===!0&&n,f=a.filter(e=>e.isDefault).length,p=`${M(l)}-title`,m=i&&o?(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`}):null,h={titleId:p,title:u,facts:[d?null:(0,X.jsx)(Me,{entry:e,check:t}),i||a.length>0?(0,X.jsxs)(`span`,{className:`settings-account-count`,title:`${f} discovered, ${a.length-f} added`,children:[a.length,` `,a.length===1?`account`:`accounts`]}):null],addButton:m},[g,..._]=a;return(0,X.jsxs)(`section`,{id:M(l),tabIndex:-1,"aria-labelledby":p,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col rounded-lg border border-border bg-card`,children:[g===void 0?(0,X.jsx)(Q,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(De,{runner:l}):null,g===void 0?null:(0,X.jsxs)(`ul`,{className:`settings-agent-accounts`,children:[(0,X.jsx)($,{account:g,runners:r,editable:i,onRemove:()=>c(g),agent:h}),_.map(e=>(0,X.jsx)($,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))]}),i&&!o?(0,X.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`settings-agent-note`,children:[`One account only: `,u,` keeps its login outside its config folder, so a second folder would change settings without changing who is billed.`]}):!i&&a.length===0&&e.browserLogin?(0,X.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`settings-agent-note flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(`span`,{children:`Discovered account`}),(0,X.jsx)(J,{provider:l,label:u})]}):null]})}function Ie({runners:e}){let[t,n]=(0,Y.useState)(null),a=o(),s=i(),c=m(r(e)),l=ve(),d=he(),f=e=>l.mutate(e,{onSuccess:d.flash});if(a.data===void 0)return null;let p=ue([],e),h=a.data.agentDefaults.runner??`claude`,g=u(t??h,r(e))??t??h,_=a.data.agentDefaults.models??{};return(0,X.jsxs)(`section`,{"data-slot":`accounts-defaults`,className:`flex flex-col gap-3 rounded-lg border border-border bg-card/40 p-3.5`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,X.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`What a project runs when it has not chosen for itself — set once instead of per repository. A project that has chosen keeps its own. `,(0,X.jsx)(ge,{saved:d.saved})]})]}),(0,X.jsx)(de,{rows:p,runner:h,accountFor:()=>null,providerStatus:s,disabled:l.isPending,onPick:e=>{e!==h&&f({agentDefaults:{runner:e}})}}),(0,X.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,X.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,X.jsx)(`span`,{children:`Default model for`}),(0,X.jsx)(q,{"aria-label":`Model agent`,className:`settings-select max-w-full`,value:g,onValueChange:e=>n(e),options:e.runners.map(e=>({value:e.id,label:e.displayName}))})]}),e.runners.filter(e=>e.id===g).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(D,{className:`size-4 text-accent-icon shrink-0`}),(0,X.jsx)(`span`,{className:`w-28 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,X.jsx)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:_[t.id]??``,disabled:l.isPending,onValueChange:e=>f({agentDefaults:{models:{[t.id]:e||null}}}),className:`settings-select w-64 max-w-full bg-card`,options:[...U(t.id,e,c[t.id]?.data,[_[t.id]]).map(e=>({value:e.id,label:e.label})),...Le(t.id,e,c[t.id])]})]},t.id))]})]})}function Le(e,t,n){let r=H(e,t,n);return r?[{value:P,label:r,disabled:!0}]:[]}function Re({account:e,runners:t,status:n,editable:r}){let i=h();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&c(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,r&&n&&n.status!==`connected`&&c(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(k,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:i.isPending,onClick:()=>i.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>w(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>w(e instanceof b&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function ze(e,t,n,r){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?{slot:`account-unrecognised`,label:`Unrecognized folder`,guidance:`This folder does not look like ${l(t,e.provider)} config yet.`}:null:{slot:`account-missing`,label:`Not initialized`,guidance:r?n.status===`connected`?`Folder not created yet. Use Check again to refresh.`:`Folder not created yet. Connect will make it.`:`Folder not created on the host yet.`}}function $({account:e,runners:t,editable:n,onRemove:r,agent:i}){let a=x(e),o=v(),s=_e(),c=_(a,e.status===void 0),l=e.status??c.data?.status,u=l?Oe[l.status]:void 0,d=ze(e,t,l,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:u?`Sign-in: ${u.label}`:void 0,children:[(0,X.jsx)(j,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":d.slot,className:`text-foreground`,children:d.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(j,{tone:u?.tone??`neutral`,pulse:u===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:u?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Re,{account:e,runners:t,status:l,editable:n}),(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>w(e.message,{tone:`danger`})}),children:`Check again`})]}),m=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(ne,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-xs font-normal text-muted-foreground`,children:`discovered`}):null]}),h=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Z(e.configDir,s)}):null,g=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=l?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:l.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Be,{account:e,onRemove:r}):null,S=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),h,g,y]});return i?(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,"data-primary":``,className:`settings-account-primary`,children:[(0,X.jsx)(Q,{titleId:i.titleId,title:i.title,summary:i.facts,actions:(0,X.jsxs)(X.Fragment,{children:[p,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[S,b?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:b}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[S,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Be({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=s();return(0,X.jsx)(X.Fragment,{children:e.isDefault?null:(0,X.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{type:`text`,autoFocus:!0,"aria-label":`Name for ${e.label}`,"data-slot":`account-rename-input`,value:i,onChange:e=>a(e.target.value),className:`w-48 rounded-md border border-input bg-card px-2 py-1 text-xs outline-none focus-visible:border-ring`}),(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>w(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{ke as GlobalAgentsSection};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$t as r,Ct as i,Dt as a,It as o,Nt as s,Qt as c,Xt as l,Yt as u,dn as d,dt as f,mt as p,on as m,pt as h,rn as g,ut as _,wt as v,yt as y}from"./queries-CIeJg62Y.js";import{Fn as b,Fr as x,In as S,hi as ee,ii as C,n as w,zn as T}from"./toaster-D0HMoto5.js";import{f as E}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{b as D}from"./design-icons-BZt8Kqs9.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as te}from"./folder-browser-BSGB9hhQ.js";import{t as k}from"./button-C8jUIs8Q.js";import{t as ne}from"./badge-B6B-xYQQ.js";import{a as re,i as ie,o as ae,r as oe,s as se,t as A}from"./dialog-CB9ZhEk2.js";import{t as j}from"./status-dot-BXf-Ubd0.js";import{n as M}from"./agents-settings-path-7X6_cvUg.js";import{t as N}from"./centered-state-BgSV4e79.js";import{A as P,Cn as F,Dn as I,En as L,Gt as R,Jt as z,Kt as B,Ln as V,M as H,P as U,Wt as W,Xt as G,Yt as K,Zt as ce,qt as le}from"./index-I4_drgNu.js";import{t as q}from"./option-select-_tHcMUWt.js";import{n as J,r as ue,t as de}from"./settings-agent-picker-DE5zKJtS.js";import{n as fe,r as pe,t as me}from"./remote-settings-notice-C8naX_yp.js";import{n as he,t as ge}from"./save-cue-CpHgT93o.js";import{t as _e}from"./use-path-bases-x6weDx5i.js";import{t as ve}from"./use-workspace-config-save-bZksgjRK.js";var ye=O(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Y=e(t(),1),X=n(),be=`~/.claude-second`;function xe({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=g().data,[a,o]=(0,Y.useState)(null),[s,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(r??n[0]??`claude`),[m,h]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=p(),S=_.trim();return(0,X.jsx)(A,{open:e,onOpenChange:t,children:(0,X.jsxs)(oe,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(ae,{children:[(0,X.jsx)(se,{children:`Add agent account`}),(0,X.jsx)(ie,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,X.jsx)(q,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:d,onValueChange:e=>f(e),className:`settings-select max-w-full bg-card text-[13px]`,options:n.map(e=>({value:e,label:l(i,e)}))})]}),(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,X.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:m,placeholder:`Work`,onChange:e=>h(e.target.value),className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,X.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:_,placeholder:c(i,d)?.accountFolderExample??be,onChange:e=>{v(e.target.value),u(null),x.reset()},className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 font-mono text-[13px] outline-none focus-visible:border-ring`}),(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":y,onClick:()=>b(e=>!e),children:y?`Hide folders`:`Browse…`})]}),(0,X.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[`A `,(0,X.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),y?(0,X.jsx)(te,{path:a,selected:s,onSelect:e=>{u(e),v(e.path),x.reset()},onEnter:e=>{o(e),u(null),x.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,x.isError?(0,X.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:x.error instanceof Error?x.error.message:`could not add that folder`}):null,(0,X.jsxs)(re,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(k,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(k,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:d,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),h(``),v(``),u(null),b(!1),w(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function Se(e){return T(await S.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function Ce(e,t){return T(await S.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var we={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function Te(e){let t=y().data?.capabilities?.settingsAdmin===!0,n=ee(),r=[`runner-install`,e],i=C({queryKey:r,queryFn:()=>Se(e),enabled:t,retry:!1,refetchInterval:e=>{if(e.state.error)return!1;let t=e.state.data?.phase;return t&&t!==`idle`&&t!==`failed`?1e3:6e4}}),a=d({mutationFn:t=>Ce(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),o=i.data;return{allowed:t,data:o,busy:a.isPending||!!o&&o.phase!==`idle`&&o.phase!==`failed`,error:a.error?.message??i.error?.message??o?.error,action:a,status:i}}function Ee({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,X.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(k,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function De({runner:e}){let t=Te(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,X.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,X.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[r?.installedVersion?`Installed CLI ${r.installedVersion}`:`CLI not installed`,r?.latestVersion?` · Latest ${r.latestVersion}`:``,i&&r?` · ${we[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(Ee,{state:t}),r?.installedVersion?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var Oe={connected:I(`connected`),disconnected:I(`disconnected`),"not-installed":I(`not-installed`),unknown:I(`unknown`)};function ke(){let e=f(),t=g();if(e.isPending||t.isPending)return(0,X.jsx)(`p`,{"data-slot":`accounts-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agents…`});let n=e.error??t.error;return n?(0,X.jsx)(N,{icon:(0,X.jsx)(ye,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(je,{data:e.data,runners:t.data})}function Z(e,t){let n=V(e,t),r=n.split(`/`);return r.length>4?`…/${r.slice(-3).join(`/`)}`:n}function Ae(){let{hash:e}=E();(0,Y.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function je({data:e,runners:t}){let n=y(),[r,i]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=a();return Ae(),pe(),(0,X.jsxs)(`div`,{"data-slot":`accounts-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,X.jsx)(fe,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,X.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-muted-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,X.jsx)(`code`,{children:me}),` on the host to add, edit, or sign in to accounts here.`]}),(0,X.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-3`,children:t.runners.map(r=>(0,X.jsx)(Fe,{entry:r,check:n.data?.checks?.find(e=>e.name===r.id),settingsAdmin:n.data?.capabilities?.settingsAdmin===!0,runners:t,editable:e.editable,accounts:e.profiles.filter(e=>e.provider===r.id),canCarryAccounts:e.profileCapableProviders.includes(r.id),onAdd:()=>i(r.id),onRemove:s},r.id))}),(0,X.jsx)(Ie,{runners:t}),r===null?null:(0,X.jsx)(xe,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(W,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,X.jsxs)(le,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(G,{children:[(0,X.jsxs)(ce,{children:[`Remove “`,o?.label,`”?`]}),(0,X.jsxs)(z,{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)(K,{children:[(0,X.jsx)(B,{children:`Cancel`}),(0,X.jsx)(R,{"data-action":`accounts-remove-confirm`,disabled:c.isPending,onClick:()=>{let e=o;e&&c.mutate(e.id,{onSuccess:()=>{s(null),w(`Removed ${e.label}`)},onError:e=>w(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Me({entry:e,check:t}){return t===void 0?(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking CLI…`}):t.available?(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:L(t.version)?`CLI simulated`:`CLI installed`}),t.version?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}),(0,X.jsx)(Ne,{version:t.version})]}):null]}):(0,X.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`CLI not installed`,e.installHint?(0,X.jsxs)(X.Fragment,{children:[` — `,(0,X.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}function Ne({version:e}){return L(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:F.label}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`, version `}),(0,X.jsx)(`span`,{"data-slot":`agent-version`,className:`text-muted-foreground`,children:e})]})}function Pe({items:e}){let t=e.filter(e=>e!=null&&e!==!1);return t.length===0?null:(0,X.jsx)(`p`,{"data-slot":`agent-summary`,className:`settings-agent-summary`,children:t.map((e,t)=>(0,X.jsxs)(`span`,{className:`settings-agent-summary-item`,children:[t>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}):null,e]},t))})}function Q({titleId:e,title:t,summary:n,actions:r,actionsSlot:i}){return(0,X.jsxs)(`div`,{"data-slot":`agent-head`,className:`settings-agent-head`,children:[(0,X.jsxs)(`div`,{className:`settings-agent-heading`,children:[(0,X.jsx)(`h3`,{id:e,className:`settings-account-provider-title`,children:t}),(0,X.jsx)(Pe,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Fe({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.displayName,d=e.managedInstall===!0&&n,f=a.filter(e=>e.isDefault).length,p=`${M(l)}-title`,m=i&&o?(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`}):null,h={titleId:p,title:u,facts:[d?null:(0,X.jsx)(Me,{entry:e,check:t}),i||a.length>0?(0,X.jsxs)(`span`,{className:`settings-account-count`,title:`${f} discovered, ${a.length-f} added`,children:[a.length,` `,a.length===1?`account`:`accounts`]}):null],addButton:m},[g,..._]=a;return(0,X.jsxs)(`section`,{id:M(l),tabIndex:-1,"aria-labelledby":p,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col rounded-lg border border-border bg-card`,children:[g===void 0?(0,X.jsx)(Q,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(De,{runner:l}):null,g===void 0?null:(0,X.jsxs)(`ul`,{className:`settings-agent-accounts`,children:[(0,X.jsx)($,{account:g,runners:r,editable:i,onRemove:()=>c(g),agent:h}),_.map(e=>(0,X.jsx)($,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))]}),i&&!o?(0,X.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`settings-agent-note`,children:[`One account only: `,u,` keeps its login outside its config folder, so a second folder would change settings without changing who is billed.`]}):!i&&a.length===0&&e.browserLogin?(0,X.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`settings-agent-note flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(`span`,{children:`Discovered account`}),(0,X.jsx)(J,{provider:l,label:u})]}):null]})}function Ie({runners:e}){let[t,n]=(0,Y.useState)(null),a=o(),s=i(),c=m(r(e)),l=ve(),d=he(),f=e=>l.mutate(e,{onSuccess:d.flash});if(a.data===void 0)return null;let p=ue([],e),h=a.data.agentDefaults.runner??`claude`,g=u(t??h,r(e))??t??h,_=a.data.agentDefaults.models??{};return(0,X.jsxs)(`section`,{"data-slot":`accounts-defaults`,className:`flex flex-col gap-3 rounded-lg border border-border bg-card/40 p-3.5`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,X.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`What a project runs when it has not chosen for itself — set once instead of per repository. A project that has chosen keeps its own. `,(0,X.jsx)(ge,{saved:d.saved})]})]}),(0,X.jsx)(de,{rows:p,runner:h,accountFor:()=>null,providerStatus:s,disabled:l.isPending,onPick:e=>{e!==h&&f({agentDefaults:{runner:e}})}}),(0,X.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,X.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,X.jsx)(`span`,{children:`Default model for`}),(0,X.jsx)(q,{"aria-label":`Model agent`,className:`settings-select max-w-full`,value:g,onValueChange:e=>n(e),options:e.runners.map(e=>({value:e.id,label:e.displayName}))})]}),e.runners.filter(e=>e.id===g).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(D,{className:`size-4 text-accent-icon shrink-0`}),(0,X.jsx)(`span`,{className:`w-28 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,X.jsx)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:_[t.id]??``,disabled:l.isPending,onValueChange:e=>f({agentDefaults:{models:{[t.id]:e||null}}}),className:`settings-select w-64 max-w-full bg-card`,options:[...U(t.id,e,c[t.id]?.data,[_[t.id]]).map(e=>({value:e.id,label:e.label})),...Le(t.id,e,c[t.id])]})]},t.id))]})]})}function Le(e,t,n){let r=H(e,t,n);return r?[{value:P,label:r,disabled:!0}]:[]}function Re({account:e,runners:t,status:n,editable:r}){let i=h();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&c(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,r&&n&&n.status!==`connected`&&c(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(k,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:i.isPending,onClick:()=>i.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>w(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>w(e instanceof b&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function ze(e,t,n,r){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?{slot:`account-unrecognised`,label:`Unrecognized folder`,guidance:`This folder does not look like ${l(t,e.provider)} config yet.`}:null:{slot:`account-missing`,label:`Not initialized`,guidance:r?n.status===`connected`?`Folder not created yet. Use Check again to refresh.`:`Folder not created yet. Connect will make it.`:`Folder not created on the host yet.`}}function $({account:e,runners:t,editable:n,onRemove:r,agent:i}){let a=x(e),o=v(),s=_e(),c=_(a,e.status===void 0),l=e.status??c.data?.status,u=l?Oe[l.status]:void 0,d=ze(e,t,l,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:u?`Sign-in: ${u.label}`:void 0,children:[(0,X.jsx)(j,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":d.slot,className:`text-foreground`,children:d.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(j,{tone:u?.tone??`neutral`,pulse:u===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:u?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Re,{account:e,runners:t,status:l,editable:n}),(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>w(e.message,{tone:`danger`})}),children:`Check again`})]}),m=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(ne,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-xs font-normal text-muted-foreground`,children:`discovered`}):null]}),h=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Z(e.configDir,s)}):null,g=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=l?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:l.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Be,{account:e,onRemove:r}):null,S=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),h,g,y]});return i?(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,"data-primary":``,className:`settings-account-primary`,children:[(0,X.jsx)(Q,{titleId:i.titleId,title:i.title,summary:i.facts,actions:(0,X.jsxs)(X.Fragment,{children:[p,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[S,b?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:b}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[S,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Be({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=s();return(0,X.jsx)(X.Fragment,{children:e.isDefault?null:(0,X.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{type:`text`,autoFocus:!0,"aria-label":`Name for ${e.label}`,"data-slot":`account-rename-input`,value:i,onChange:e=>a(e.target.value),className:`w-48 rounded-md border border-input bg-card px-2 py-1 text-xs outline-none focus-visible:border-ring`}),(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>w(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{ke as GlobalAgentsSection};