@hearsay-tools/squawk 0.19.0-dev.8881 → 0.19.0-dev.8884
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.
- package/dist/ci-wait/github.d.ts +1 -1
- package/dist/ci-wait/github.js +1 -1
- package/dist/ci-wait/github.js.map +1 -1
- package/dist/ci-wait/supervisor.js +1 -1
- package/dist/ci-wait/supervisor.js.map +1 -1
- package/dist/core/forge-registry.d.ts +177 -2
- package/dist/core/forge-registry.js +39 -0
- package/dist/core/forge-registry.js.map +1 -1
- package/dist/core/git.d.ts +6 -0
- package/dist/core/git.js +28 -20
- package/dist/core/git.js.map +1 -1
- package/dist/{server/forge → core}/github-request-gate.d.ts +2 -1
- package/dist/{server/forge → core}/github-request-gate.js +3 -4
- package/dist/core/github-request-gate.js.map +1 -0
- package/dist/core/repo-handle-discovery.js.map +1 -0
- package/dist/delegation/routes.d.ts +15 -15
- package/dist/delegation/transport.d.ts +10 -10
- package/dist/features/automations/automations-routes.js +7 -2
- package/dist/features/automations/automations-routes.js.map +1 -1
- package/dist/features/automations/github-poller.d.ts +1 -1
- package/dist/features/automations/github-poller.js +1 -1
- package/dist/features/automations/github-poller.js.map +1 -1
- package/dist/features/automations/github-repository.d.ts +1 -1
- package/dist/features/automations/github-repository.js +3 -4
- package/dist/features/automations/github-repository.js.map +1 -1
- package/dist/features/automations/scheduler.js +1 -1
- package/dist/features/automations/scheduler.js.map +1 -1
- package/dist/features/automations/service.d.ts +1 -1
- package/dist/features/automations/tools.d.ts +8 -8
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/index.js +2 -0
- package/dist/plugin/index.js.map +1 -1
- package/dist/project-commands.js +2 -2
- package/dist/project-commands.js.map +1 -1
- package/dist/runs/arm-repo-handle.d.ts +5 -4
- package/dist/runs/arm-repo-handle.js +5 -1
- package/dist/runs/arm-repo-handle.js.map +1 -1
- package/dist/runs/event-log.js +2 -1
- package/dist/runs/event-log.js.map +1 -1
- package/dist/runs/pull-requests.d.ts +6 -0
- package/dist/runs/pull-requests.js +4 -0
- package/dist/runs/pull-requests.js.map +1 -1
- package/dist/runs/record-write-rules.js +2 -3
- package/dist/runs/record-write-rules.js.map +1 -1
- package/dist/runs/run-archive.js +4 -5
- package/dist/runs/run-archive.js.map +1 -1
- package/dist/runs/run-references.js +2 -2
- package/dist/runs/run-references.js.map +1 -1
- package/dist/runs/store.d.ts +2 -0
- package/dist/runs/store.js.map +1 -1
- package/dist/server/archive-on-merge.d.ts +9 -0
- package/dist/server/archive-on-merge.js +44 -4
- package/dist/server/archive-on-merge.js.map +1 -1
- package/dist/server/cold-repo-handles.d.ts +5 -3
- package/dist/server/cold-repo-handles.js +14 -5
- package/dist/server/cold-repo-handles.js.map +1 -1
- package/dist/server/completion-actions.d.ts +5 -5
- package/dist/server/completion-actions.js +15 -8
- package/dist/server/completion-actions.js.map +1 -1
- package/dist/server/draft-pr.d.ts +24 -0
- package/dist/server/{forge/draft-pr.js → draft-pr.js} +51 -56
- package/dist/server/draft-pr.js.map +1 -0
- package/dist/server/forge/github-checks.js +1 -1
- package/dist/server/forge/github-checks.js.map +1 -1
- package/dist/server/forge/github-comments.js +2 -2
- package/dist/server/forge/github-comments.js.map +1 -1
- package/dist/server/forge/{draft-pr.d.ts → github-create-pr.d.ts} +0 -8
- package/dist/server/forge/github-create-pr.js +41 -0
- package/dist/server/forge/github-create-pr.js.map +1 -0
- package/dist/server/forge/github-forge.d.ts +6 -0
- package/dist/server/forge/github-forge.js +49 -25
- package/dist/server/forge/github-forge.js.map +1 -1
- package/dist/server/forge/github-list.js +2 -2
- package/dist/server/forge/github-list.js.map +1 -1
- package/dist/server/forge/github-mutations.js +3 -3
- package/dist/server/forge/github-mutations.js.map +1 -1
- package/dist/server/forge/github-pr-diff.js +1 -1
- package/dist/server/forge/github-pr-diff.js.map +1 -1
- package/dist/server/forge/github-ref-status.js +1 -1
- package/dist/server/forge/github-ref-status.js.map +1 -1
- package/dist/server/forge/github-shared.js +2 -2
- package/dist/server/forge/github-shared.js.map +1 -1
- package/dist/server/forge/github.d.ts +3 -4
- package/dist/server/forge/github.js +4 -16
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/index.d.ts +3 -24
- package/dist/server/forge/index.js +3 -54
- package/dist/server/forge/index.js.map +1 -1
- package/dist/server/forge/types.d.ts +5 -91
- package/dist/server/forge-pr-states.d.ts +16 -0
- package/dist/server/forge-pr-states.js +87 -0
- package/dist/server/forge-pr-states.js.map +1 -0
- package/dist/server/github-cli.js.map +1 -0
- package/dist/server/{forge/github-repo-handle.d.ts → github-repo-handle.d.ts} +1 -1
- package/dist/server/{forge/github-repo-handle.js → github-repo-handle.js} +1 -1
- package/dist/server/github-repo-handle.js.map +1 -0
- package/dist/server/github-routes.d.ts +69 -26
- package/dist/server/github-routes.js +68 -39
- package/dist/server/github-routes.js.map +1 -1
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/project-context.d.ts +3 -2
- package/dist/server/project-context.js +2 -2
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/project-forge.d.ts +36 -0
- package/dist/server/project-forge.js +52 -0
- package/dist/server/project-forge.js.map +1 -0
- package/dist/server/repo-branch-forge.d.ts +10 -19
- package/dist/server/repo-branch-forge.js +40 -12
- package/dist/server/repo-branch-forge.js.map +1 -1
- package/dist/server/repo-branch-sweep.js +2 -2
- package/dist/server/repo-branch-sweep.js.map +1 -1
- package/dist/server/repo-branches.d.ts +1 -1
- package/dist/server/repo-branches.js +1 -1
- package/dist/server/repo-branches.js.map +1 -1
- package/dist/server/repo-routes.d.ts +3 -2
- package/dist/server/repo-routes.js +2 -2
- package/dist/server/repo-routes.js.map +1 -1
- package/dist/server/runs-routes.d.ts +678 -677
- package/dist/server/runs-routes.js +18 -10
- package/dist/server/runs-routes.js.map +1 -1
- package/dist/server/server.d.ts +2591 -2515
- package/dist/server/server.js +13 -9
- package/dist/server/server.js.map +1 -1
- package/dist/server/start-server.js +14 -11
- package/dist/server/start-server.js.map +1 -1
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/server/workspace-projects.d.ts +1 -1
- package/dist/server/workspace-projects.js +1 -1
- package/dist/server/workspace-routes.d.ts +3 -2
- package/dist/server/workspace-routes.js +7 -4
- package/dist/server/workspace-routes.js.map +1 -1
- package/dist/workflows/input-acknowledgement.d.ts +24 -24
- package/dist/workflows/run/wait-engine.d.ts +72 -72
- package/dist/workspace/projects.js +6 -4
- package/dist/workspace/projects.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-BM-HWieF.js → accounts-section-hoIJ1y1g.js} +1 -1
- package/web/dist/assets/{activity-motion-BlDa0Oee.js → activity-motion-DxZp9POT.js} +1 -1
- package/web/dist/assets/{activity-route-BOozKrPn.js → activity-route-DWv1sa1J.js} +1 -1
- package/web/dist/assets/{agent-config-section-Bg0OgLPn.js → agent-config-section-CaN9Tsqa.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-B-uXUUCT.js → agent-defaults-section-DV1EYjS4.js} +1 -1
- package/web/dist/assets/{appearance-Cv8Qr8nS.js → appearance-CLw62KVo.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-DExgXlBg.js → archive-on-merge-field-DLzE1X_H.js} +1 -1
- package/web/dist/assets/{automations-route-DqS_DIp2.js → automations-route-C0HozfbY.js} +1 -1
- package/web/dist/assets/{commit-list-a1vNhwzg.js → commit-list-BZuXRQ3x.js} +1 -1
- package/web/dist/assets/{diff-DDjPsaQ6.js → diff-DrARYKpR.js} +2 -2
- package/web/dist/assets/{diff-controls-QeCV3Sy1.js → diff-controls-C62rOSYk.js} +1 -1
- package/web/dist/assets/{diff-view-Bv9YauBT.js → diff-view-CSgYwy29.js} +1 -1
- package/web/dist/assets/{file-preview-CuwkUuqd.js → file-preview-DNIfdHeC.js} +1 -1
- package/web/dist/assets/{git-toolbar-BWSmSiqy.js → git-toolbar-DC4PBhUA.js} +1 -1
- package/web/dist/assets/{github-CS_bLWjw.js → github-DXAy-1l9.js} +1 -1
- package/web/dist/assets/{global-activity-route-D7HmA4W3.js → global-activity-route-B3YY4F9O.js} +1 -1
- package/web/dist/assets/index-DygQwjn7.js +21 -0
- package/web/dist/assets/{markdown-Djjm7pRl.js → markdown-B7l0dDH1.js} +1 -1
- package/web/dist/assets/{notifications-section-Dcclastm.js → notifications-section-D6ULf4HX.js} +1 -1
- package/web/dist/assets/{option-select-DzjSpnye.js → option-select-DfIhavTu.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-DOnixsSz.js → preview-pane-connected-DoxA-fww.js} +1 -1
- package/web/dist/assets/{projects-section-CJAE2fqb.js → projects-section-CDMSMHFE.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-BqmYEq-d.js → prompt-templates-section-DMmsJLnJ.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-ChJJ2HzF.js → remote-settings-notice-vT_SqiND.js} +1 -1
- package/web/dist/assets/{repo-git-DzX-ZqFC.js → repo-git-CojmT8ND.js} +1 -1
- package/web/dist/assets/{report-reader-DMLkJxpC.js → report-reader-Db9uCHYJ.js} +1 -1
- package/web/dist/assets/{reports-DyilNFvz.js → reports-Cg5pjc-Y.js} +1 -1
- package/web/dist/assets/{resources-section-NWZHHXtk.js → resources-section-DLBSQ86u.js} +1 -1
- package/web/dist/assets/{review-panel-BsKM2hDc.js → review-panel-B3nW4mdy.js} +1 -1
- package/web/dist/assets/{run-header-DpTjMIK-.js → run-header-Dz_3eeYI.js} +1 -1
- package/web/dist/assets/{select-CvnOk0OI.js → select-D_VDDq-U.js} +1 -1
- package/web/dist/assets/{session-context-section-B3bs0GoD.js → session-context-section-CrpBj5i2.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-DlX1-8_P.js → settings-agent-picker-Djpp91WO.js} +1 -1
- package/web/dist/assets/{settings-shell-twGuaJwv.js → settings-shell-BnM8FG0q.js} +1 -1
- package/web/dist/assets/{sidebar-section-Crbl2_-9.js → sidebar-section-WJiDdzkS.js} +1 -1
- package/web/dist/assets/{skills-CXdbXepC.js → skills-KIqozQUm.js} +1 -1
- package/web/dist/assets/{task-changes-C8m5S54H.js → task-changes-Bd_vt0EJ.js} +1 -1
- package/web/dist/assets/{task-commits-CwNBsoyL.js → task-commits-DHMAW2nI.js} +1 -1
- package/web/dist/assets/{task-file-scope-C313CMq7.js → task-file-scope-BlQFzrLW.js} +1 -1
- package/web/dist/assets/{task-files-CdpANvF1.js → task-files-BwBvGURY.js} +1 -1
- package/web/dist/assets/{task-github-item-f4J2WBEt.js → task-github-item-WDODiSW4.js} +1 -1
- package/web/dist/assets/{task-thread-BqoX3viB.js → task-thread-BMva9nB6.js} +1 -1
- package/web/dist/assets/{thread-state-Bh4adRbN.js → thread-state-D9OBCI53.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-C3NlsVVQ.js → use-hand-to-agent-state-iYYMqi-U.js} +1 -1
- package/web/dist/assets/{workflows-Df7ulEcU.js → workflows-W1-z1hgt.js} +1 -1
- package/web/dist/assets/{workspace-tools-C_93GWNV.js → workspace-tools-DvImV-Bw.js} +1 -1
- package/web/dist/assets/{worktrees-section-w9Q1xpeU.js → worktrees-section-DFTb8CjT.js} +1 -1
- package/web/dist/index.html +1 -1
- package/dist/server/forge/draft-pr.js.map +0 -1
- package/dist/server/forge/github-cli.js.map +0 -1
- package/dist/server/forge/github-repo-handle.js.map +0 -1
- package/dist/server/forge/github-request-gate.js.map +0 -1
- package/dist/server/forge/repo-handle-discovery.js.map +0 -1
- package/web/dist/assets/index-B0_haEFL.js +0 -21
- /package/dist/{server/forge → core}/repo-handle-discovery.d.ts +0 -0
- /package/dist/{server/forge → core}/repo-handle-discovery.js +0 -0
- /package/dist/server/{forge/github-cli.d.ts → github-cli.d.ts} +0 -0
- /package/dist/server/{forge/github-cli.js → github-cli.js} +0 -0
|
@@ -238,30 +238,6 @@ export declare class WaitEngine {
|
|
|
238
238
|
deadline: string;
|
|
239
239
|
seconds: number;
|
|
240
240
|
note?: string | undefined;
|
|
241
|
-
} | {
|
|
242
|
-
id: string;
|
|
243
|
-
source: "agent" | "cezar";
|
|
244
|
-
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";
|
|
245
|
-
registeredAt: string;
|
|
246
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
247
|
-
resolvedAt?: string | undefined;
|
|
248
|
-
deliveredAt?: string | undefined;
|
|
249
|
-
cancelledAt?: string | undefined;
|
|
250
|
-
turnId: string;
|
|
251
|
-
kind: "process";
|
|
252
|
-
deadline: string;
|
|
253
|
-
timeoutSeconds: number;
|
|
254
|
-
pid: number;
|
|
255
|
-
startToken?: string | undefined;
|
|
256
|
-
exitFile?: string | undefined;
|
|
257
|
-
note?: string | undefined;
|
|
258
|
-
result?: {
|
|
259
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
260
|
-
observedAt: string;
|
|
261
|
-
exitCode?: number | undefined;
|
|
262
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
263
|
-
diagnostic?: string | undefined;
|
|
264
|
-
} | undefined;
|
|
265
241
|
} | {
|
|
266
242
|
id: string;
|
|
267
243
|
source: "agent" | "cezar";
|
|
@@ -323,6 +299,30 @@ export declare class WaitEngine {
|
|
|
323
299
|
reason: "outcome" | "timeout";
|
|
324
300
|
} | undefined;
|
|
325
301
|
wakeInputId?: string | undefined;
|
|
302
|
+
} | {
|
|
303
|
+
id: string;
|
|
304
|
+
source: "agent" | "cezar";
|
|
305
|
+
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";
|
|
306
|
+
registeredAt: string;
|
|
307
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
308
|
+
resolvedAt?: string | undefined;
|
|
309
|
+
deliveredAt?: string | undefined;
|
|
310
|
+
cancelledAt?: string | undefined;
|
|
311
|
+
turnId: string;
|
|
312
|
+
kind: "process";
|
|
313
|
+
deadline: string;
|
|
314
|
+
timeoutSeconds: number;
|
|
315
|
+
pid: number;
|
|
316
|
+
startToken?: string | undefined;
|
|
317
|
+
exitFile?: string | undefined;
|
|
318
|
+
note?: string | undefined;
|
|
319
|
+
result?: {
|
|
320
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
321
|
+
observedAt: string;
|
|
322
|
+
exitCode?: number | undefined;
|
|
323
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
324
|
+
diagnostic?: string | undefined;
|
|
325
|
+
} | undefined;
|
|
326
326
|
} | {
|
|
327
327
|
id: string;
|
|
328
328
|
source: "agent" | "cezar";
|
|
@@ -451,30 +451,6 @@ export declare class WaitEngine {
|
|
|
451
451
|
deadline: string;
|
|
452
452
|
seconds: number;
|
|
453
453
|
note?: string | undefined;
|
|
454
|
-
} | {
|
|
455
|
-
id: string;
|
|
456
|
-
source: "agent" | "cezar";
|
|
457
|
-
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";
|
|
458
|
-
registeredAt: string;
|
|
459
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
460
|
-
resolvedAt?: string | undefined;
|
|
461
|
-
deliveredAt?: string | undefined;
|
|
462
|
-
cancelledAt?: string | undefined;
|
|
463
|
-
turnId: string;
|
|
464
|
-
kind: "process";
|
|
465
|
-
deadline: string;
|
|
466
|
-
timeoutSeconds: number;
|
|
467
|
-
pid: number;
|
|
468
|
-
startToken?: string | undefined;
|
|
469
|
-
exitFile?: string | undefined;
|
|
470
|
-
note?: string | undefined;
|
|
471
|
-
result?: {
|
|
472
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
473
|
-
observedAt: string;
|
|
474
|
-
exitCode?: number | undefined;
|
|
475
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
476
|
-
diagnostic?: string | undefined;
|
|
477
|
-
} | undefined;
|
|
478
454
|
} | {
|
|
479
455
|
id: string;
|
|
480
456
|
source: "agent" | "cezar";
|
|
@@ -536,6 +512,30 @@ export declare class WaitEngine {
|
|
|
536
512
|
reason: "outcome" | "timeout";
|
|
537
513
|
} | undefined;
|
|
538
514
|
wakeInputId?: string | undefined;
|
|
515
|
+
} | {
|
|
516
|
+
id: string;
|
|
517
|
+
source: "agent" | "cezar";
|
|
518
|
+
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";
|
|
519
|
+
registeredAt: string;
|
|
520
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
521
|
+
resolvedAt?: string | undefined;
|
|
522
|
+
deliveredAt?: string | undefined;
|
|
523
|
+
cancelledAt?: string | undefined;
|
|
524
|
+
turnId: string;
|
|
525
|
+
kind: "process";
|
|
526
|
+
deadline: string;
|
|
527
|
+
timeoutSeconds: number;
|
|
528
|
+
pid: number;
|
|
529
|
+
startToken?: string | undefined;
|
|
530
|
+
exitFile?: string | undefined;
|
|
531
|
+
note?: string | undefined;
|
|
532
|
+
result?: {
|
|
533
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
534
|
+
observedAt: string;
|
|
535
|
+
exitCode?: number | undefined;
|
|
536
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
537
|
+
diagnostic?: string | undefined;
|
|
538
|
+
} | undefined;
|
|
539
539
|
} | {
|
|
540
540
|
id: string;
|
|
541
541
|
source: "agent" | "cezar";
|
|
@@ -663,30 +663,6 @@ export declare class WaitEngine {
|
|
|
663
663
|
deadline: string;
|
|
664
664
|
seconds: number;
|
|
665
665
|
note?: string | undefined;
|
|
666
|
-
} | {
|
|
667
|
-
id: string;
|
|
668
|
-
source: "agent" | "cezar";
|
|
669
|
-
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";
|
|
670
|
-
registeredAt: string;
|
|
671
|
-
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
672
|
-
resolvedAt?: string | undefined;
|
|
673
|
-
deliveredAt?: string | undefined;
|
|
674
|
-
cancelledAt?: string | undefined;
|
|
675
|
-
turnId: string;
|
|
676
|
-
kind: "process";
|
|
677
|
-
deadline: string;
|
|
678
|
-
timeoutSeconds: number;
|
|
679
|
-
pid: number;
|
|
680
|
-
startToken?: string | undefined;
|
|
681
|
-
exitFile?: string | undefined;
|
|
682
|
-
note?: string | undefined;
|
|
683
|
-
result?: {
|
|
684
|
-
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
685
|
-
observedAt: string;
|
|
686
|
-
exitCode?: number | undefined;
|
|
687
|
-
exitFileNote?: "not-an-exit-code" | undefined;
|
|
688
|
-
diagnostic?: string | undefined;
|
|
689
|
-
} | undefined;
|
|
690
666
|
} | {
|
|
691
667
|
id: string;
|
|
692
668
|
source: "agent" | "cezar";
|
|
@@ -748,6 +724,30 @@ export declare class WaitEngine {
|
|
|
748
724
|
reason: "outcome" | "timeout";
|
|
749
725
|
} | undefined;
|
|
750
726
|
wakeInputId?: string | undefined;
|
|
727
|
+
} | {
|
|
728
|
+
id: string;
|
|
729
|
+
source: "agent" | "cezar";
|
|
730
|
+
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";
|
|
731
|
+
registeredAt: string;
|
|
732
|
+
phase: "cancelled" | "delivered" | "open" | "resolved";
|
|
733
|
+
resolvedAt?: string | undefined;
|
|
734
|
+
deliveredAt?: string | undefined;
|
|
735
|
+
cancelledAt?: string | undefined;
|
|
736
|
+
turnId: string;
|
|
737
|
+
kind: "process";
|
|
738
|
+
deadline: string;
|
|
739
|
+
timeoutSeconds: number;
|
|
740
|
+
pid: number;
|
|
741
|
+
startToken?: string | undefined;
|
|
742
|
+
exitFile?: string | undefined;
|
|
743
|
+
note?: string | undefined;
|
|
744
|
+
result?: {
|
|
745
|
+
outcome: "deadline" | "error" | "exit_file" | "exited";
|
|
746
|
+
observedAt: string;
|
|
747
|
+
exitCode?: number | undefined;
|
|
748
|
+
exitFileNote?: "not-an-exit-code" | undefined;
|
|
749
|
+
diagnostic?: string | undefined;
|
|
750
|
+
} | undefined;
|
|
751
751
|
} | {
|
|
752
752
|
id: string;
|
|
753
753
|
source: "agent" | "cezar";
|
|
@@ -7,7 +7,7 @@ import { PROJECT_TAGS_MAX, PROJECT_TAG_MAX_LENGTH } from '../contract/index.js';
|
|
|
7
7
|
import { projectWebhooks, redactWebhook } from './webhooks.js';
|
|
8
8
|
import { forgeKindOfRemote, forgeWebRoot } from '../core/forge-registry.js';
|
|
9
9
|
import { createRootProbeCache } from './root-probe-cache.js';
|
|
10
|
-
import { getRepoInfo } from '../core/git.js';
|
|
10
|
+
import { getRepoInfo, getRepoRemote } from '../core/git.js';
|
|
11
11
|
import { mergeWriteWorkspaceConfig, loadWorkspaceConfig, } from './config.js';
|
|
12
12
|
/**
|
|
13
13
|
* Registry operations: canonical-root registration and slug allocation through merge writes,
|
|
@@ -220,9 +220,11 @@ async function computeProbe(root) {
|
|
|
220
220
|
// Branch and forge are best-effort garnish: getRepoInfo never throws (null
|
|
221
221
|
// on e.g. an unborn HEAD), and a repo without either is still status ok.
|
|
222
222
|
const info = await getRepoInfo(root);
|
|
223
|
-
|
|
224
|
-
//
|
|
225
|
-
const
|
|
223
|
+
// An unborn HEAD has no repo info, but its remote still names the forge (a clone of an empty
|
|
224
|
+
// repository keeps its GitHub tab).
|
|
225
|
+
const remote = info ? info.remote : await getRepoRemote(root);
|
|
226
|
+
const forge = forgeKindOfRemote(remote);
|
|
227
|
+
const repoUrl = forgeWebRoot(remote);
|
|
226
228
|
return {
|
|
227
229
|
status: 'ok',
|
|
228
230
|
...(info?.branch ? { branch: info.branch } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/workspace/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAEvG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/workspace/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAA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AAE,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.
|
|
3
|
+
"version": "0.19.0-dev.8884",
|
|
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.
|
|
73
|
-
"@open-mercato/cezar-contract": "0.19.0-dev.
|
|
72
|
+
"@open-mercato/cezar-api-client": "0.19.0-dev.8884",
|
|
73
|
+
"@open-mercato/cezar-contract": "0.19.0-dev.8884",
|
|
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": "
|
|
90
|
+
"gitHead": "1158c8641f066ad03d851bcf5c3b0ffd5189699c"
|
|
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,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-ByqTmyCs.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-Lf_4oY96.js";import{f as O}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as k}from"./design-icons-CzEoMH9c.js";import{t as A}from"./createLucideIcon-BHp8sXmF.js";import{t as te}from"./folder-browser-CK1mNIQi.js";import{t as j}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 M}from"./dialog-Dbu3HnqC.js";import{t as N}from"./status-dot-BXf-Ubd0.js";import{n as P}from"./agents-settings-path-7X6_cvUg.js";import{t as F}from"./centered-state-BgSV4e79.js";import{A as I,En as L,Gt as R,Jt as z,Kt as B,M as V,P as H,Sn as U,Tn as W,Ut as G,Wt as K,Xt as ce,Yt as le,qt as ue}from"./index-B0_haEFL.js";import{t as q}from"./option-select-DzjSpnye.js";import{n as J,r as de,t as fe}from"./settings-agent-picker-DlX1-8_P.js";import{n as pe,r as me,t as he}from"./remote-settings-notice-ChJJ2HzF.js";var ge=A(`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(),_e=`~/.claude-second`;function ve({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)(M,{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:u(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: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??_e,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)(j,{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=>{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)(re,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(j,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(j,{"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 ye(e){return D(await C.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function be(e,t){return D(await C.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var xe={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function Se(e){let t=b().data?.capabilities?.settingsAdmin===!0,n=w(),r=[`runner-install`,e],i=T({queryKey:r,queryFn:()=>ye(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=>be(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 Ce({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)(j,{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)(j,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(j,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function we({runner:e}){let t=Se(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?` · ${xe[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(Ce,{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 Te={connected:L(`connected`),disconnected:L(`disconnected`),"not-installed":L(`not-installed`),unknown:L(`unknown`)};function Ee(){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)(F,{icon:(0,X.jsx)(ge,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(ke,{data:e.data,runners:t.data})}function De(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function Oe(){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 ke({data:e,runners:t}){let n=b(),[r,i]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=a();return Oe(),me(),(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)(pe,{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:he}),` 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)(Me,{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)(Ne,{runners:t}),r===null?null:(0,X.jsx)(ve,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(G,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,X.jsxs)(B,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(le,{children:[(0,X.jsxs)(ce,{children:[`Remove “`,o?.label,`”?`]}),(0,X.jsxs)(ue,{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)(z,{children:[(0,X.jsx)(R,{children:`Cancel`}),(0,X.jsx)(K,{"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 Z({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:W(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)(Ae,{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 Ae({version:e}){return W(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:U.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 je({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)(je,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Me({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=`${P(l)}-title`,m=i&&o?(0,X.jsx)(j,{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)(Z,{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:P(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)(we,{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 Ne({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=de([],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)(fe,{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`,className:`settings-select max-w-full`,value:_,onValueChange:e=>n(e),options:e.runners.map(e=>({value:e.id,label:e.displayName}))})]}),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.jsx)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:v[t.id]??``,disabled:p.isPending,onValueChange:e=>p.mutate({agentDefaults:{models:{[t.id]:e||null}}}),className:`settings-select w-64 max-w-full bg-card`,options:[...H(t.id,e,u[t.id]?.data,[v[t.id]]).map(e=>({value:e.id,label:e.id===``?`Native default`:e.label})),...Pe(t.id,e,u[t.id])]})]},t.id))]})]})}function Pe(e,t,n){let r=V(e,t,n);return r?[{value:I,label:r,disabled:!0}]:[]}function Fe({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)(j,{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 Ie(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?Te[c.status]:void 0,u=Ie(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)(N,{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)(N,{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)(Fe,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(j,{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)(ne,{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:De(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)(Le,{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 Le({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)(j,{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)(j,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(j,{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{Ee 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-ByqTmyCs.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-Lf_4oY96.js";import{f as O}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as k}from"./design-icons-CzEoMH9c.js";import{t as A}from"./createLucideIcon-BHp8sXmF.js";import{t as te}from"./folder-browser-CK1mNIQi.js";import{t as j}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 M}from"./dialog-Dbu3HnqC.js";import{t as N}from"./status-dot-BXf-Ubd0.js";import{n as P}from"./agents-settings-path-7X6_cvUg.js";import{t as F}from"./centered-state-BgSV4e79.js";import{A as I,En as L,Gt as R,Jt as z,Kt as B,M as V,P as H,Sn as U,Tn as W,Ut as G,Wt as K,Xt as ce,Yt as le,qt as ue}from"./index-DygQwjn7.js";import{t as q}from"./option-select-DfIhavTu.js";import{n as J,r as de,t as fe}from"./settings-agent-picker-Djpp91WO.js";import{n as pe,r as me,t as he}from"./remote-settings-notice-vT_SqiND.js";var ge=A(`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(),_e=`~/.claude-second`;function ve({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)(M,{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:u(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: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??_e,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)(j,{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=>{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)(re,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(j,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(j,{"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 ye(e){return D(await C.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function be(e,t){return D(await C.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var xe={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function Se(e){let t=b().data?.capabilities?.settingsAdmin===!0,n=w(),r=[`runner-install`,e],i=T({queryKey:r,queryFn:()=>ye(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=>be(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 Ce({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)(j,{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)(j,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(j,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function we({runner:e}){let t=Se(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?` · ${xe[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(Ce,{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 Te={connected:L(`connected`),disconnected:L(`disconnected`),"not-installed":L(`not-installed`),unknown:L(`unknown`)};function Ee(){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)(F,{icon:(0,X.jsx)(ge,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(ke,{data:e.data,runners:t.data})}function De(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function Oe(){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 ke({data:e,runners:t}){let n=b(),[r,i]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=a();return Oe(),me(),(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)(pe,{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:he}),` 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)(Me,{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)(Ne,{runners:t}),r===null?null:(0,X.jsx)(ve,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(G,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,X.jsxs)(B,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(le,{children:[(0,X.jsxs)(ce,{children:[`Remove “`,o?.label,`”?`]}),(0,X.jsxs)(ue,{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)(z,{children:[(0,X.jsx)(R,{children:`Cancel`}),(0,X.jsx)(K,{"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 Z({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:W(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)(Ae,{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 Ae({version:e}){return W(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:U.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 je({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)(je,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Me({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=`${P(l)}-title`,m=i&&o?(0,X.jsx)(j,{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)(Z,{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:P(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)(we,{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 Ne({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=de([],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)(fe,{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`,className:`settings-select max-w-full`,value:_,onValueChange:e=>n(e),options:e.runners.map(e=>({value:e.id,label:e.displayName}))})]}),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.jsx)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:v[t.id]??``,disabled:p.isPending,onValueChange:e=>p.mutate({agentDefaults:{models:{[t.id]:e||null}}}),className:`settings-select w-64 max-w-full bg-card`,options:[...H(t.id,e,u[t.id]?.data,[v[t.id]]).map(e=>({value:e.id,label:e.id===``?`Native default`:e.label})),...Pe(t.id,e,u[t.id])]})]},t.id))]})]})}function Pe(e,t,n){let r=V(e,t,n);return r?[{value:I,label:r,disabled:!0}]:[]}function Fe({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)(j,{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 Ie(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?Te[c.status]:void 0,u=Ie(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)(N,{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)(N,{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)(Fe,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(j,{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)(ne,{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:De(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)(Le,{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 Le({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)(j,{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)(j,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(j,{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{Ee as GlobalAgentsSection};
|