@hearsay-tools/squawk 0.19.0-dev.8648 → 0.19.0-pr4419.8657
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/delegation/routes.d.ts +65 -65
- package/dist/runners/codex/codex-app-server-runner.js +2 -42
- package/dist/runners/codex/codex-app-server-runner.js.map +1 -1
- package/dist/runners/codex/codex-questions.d.ts +5 -0
- package/dist/runners/codex/codex-questions.js +55 -0
- package/dist/runners/codex/codex-questions.js.map +1 -0
- package/dist/runners/opencode/opencode-questions.js +9 -1
- package/dist/runners/opencode/opencode-questions.js.map +1 -1
- package/dist/server/automations-routes.d.ts +150 -150
- package/dist/server/project-settings-routes.d.ts +107 -107
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +16 -16
- package/dist/server/server.d.ts +8 -8
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-RDVTJfi7.js → accounts-section-B9Hypl0g.js} +1 -1
- package/web/dist/assets/{activity-motion-B7km8QVK.js → activity-motion-DGlEy383.js} +1 -1
- package/web/dist/assets/{activity-route-CjE0yxn0.js → activity-route-Dgzzvc1C.js} +1 -1
- package/web/dist/assets/{agent-config-section-DQ1RaVK2.js → agent-config-section-CDjUBgnZ.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-Dzm7jIza.js → agent-defaults-section-D9w6Arbq.js} +1 -1
- package/web/dist/assets/{appearance-DQLHHfI4.js → appearance-Ciu3klj7.js} +1 -1
- package/web/dist/assets/{automations-route-BcdL5f0K.js → automations-route-CuTrlJe_.js} +2 -2
- package/web/dist/assets/{commit-list-CN1zX-0X.js → commit-list-hmnkwJgy.js} +1 -1
- package/web/dist/assets/{diff-hxqBOfZH.js → diff-Bph54Mj6.js} +2 -2
- package/web/dist/assets/{diff-controls-BRa3141W.js → diff-controls-D6zRC-Ch.js} +1 -1
- package/web/dist/assets/{diff-view-CwlKCj5V.js → diff-view-DmmXxueT.js} +1 -1
- package/web/dist/assets/{file-preview-VvCzp02k.js → file-preview-DLiwl3fv.js} +1 -1
- package/web/dist/assets/{git-toolbar-BulcGzsv.js → git-toolbar-DMB3ZSSD.js} +1 -1
- package/web/dist/assets/github-FbXescpa.js +1 -0
- package/web/dist/assets/{global-activity-route-C4-bmfh_.js → global-activity-route-DjrD5AkK.js} +1 -1
- package/web/dist/assets/{image-preview-Pgf8bnzY.js → image-preview-BZAATe5s.js} +1 -1
- package/web/dist/assets/index-Bd4H0_xW.css +1 -0
- package/web/dist/assets/{index-DNQcTHxV.js → index-cS5ELSRA.js} +6 -6
- package/web/dist/assets/{markdown-9L65ixU6.js → markdown-DBhG8Ap2.js} +1 -1
- package/web/dist/assets/{notifications-section-QWmuj2j2.js → notifications-section-C8UK7f5C.js} +1 -1
- package/web/dist/assets/play-BY_SWlhj.js +1 -0
- package/web/dist/assets/preview-pane-connected-EbemQD3m.js +3 -0
- package/web/dist/assets/{projects-section-DxubjpZI.js → projects-section-BzneiDK3.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-CkQneT1G.js → prompt-templates-section-WO6Xiv1C.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-COojb6XK.js → remote-settings-notice-BCmpPIT0.js} +1 -1
- package/web/dist/assets/{repo-git-Mgk4Qcmo.js → repo-git-DBWXyzHg.js} +1 -1
- package/web/dist/assets/{report-reader-zWwalJDN.js → report-reader-DYr8I-SW.js} +1 -1
- package/web/dist/assets/reports-CR7j7BEy.js +1 -0
- package/web/dist/assets/{resources-section-Cb2WIqNv.js → resources-section-CiPTx574.js} +1 -1
- package/web/dist/assets/run-header-Sse1VUYh.js +2 -0
- package/web/dist/assets/{select-y3oRuA2s.js → select-CmF4qPJi.js} +1 -1
- package/web/dist/assets/{session-context-section-CiPNMiL7.js → session-context-section-B5P8F_s5.js} +2 -2
- package/web/dist/assets/{settings-agent-picker-CJJJncuA.js → settings-agent-picker-Byi8AjNU.js} +1 -1
- package/web/dist/assets/settings-shell-e0iMUIPe.js +1 -0
- package/web/dist/assets/{sidebar-section-VOYJarPd.js → sidebar-section-CsHTxgwu.js} +1 -1
- package/web/dist/assets/{skills-BySF3yBA.js → skills-8Hl9CjlR.js} +1 -1
- package/web/dist/assets/{task-changes-NUwvUglx.js → task-changes-CwyUr6Mq.js} +1 -1
- package/web/dist/assets/task-commits-CWVxea1v.js +1 -0
- package/web/dist/assets/{task-files-Bu-L_NRW.js → task-files-CrNywZLV.js} +1 -1
- package/web/dist/assets/{task-github-item-DhiTqCjk.js → task-github-item-BiDV7gjB.js} +1 -1
- package/web/dist/assets/task-thread-CbAxAUZB.css +1 -0
- package/web/dist/assets/task-thread-DYZiyJqH.js +12 -0
- package/web/dist/assets/{thread-state-B_ZqjjRr.js → thread-state-DCUR4Djq.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-K864D69i.js → use-hand-to-agent-state-jy8ex2Zf.js} +1 -1
- package/web/dist/assets/{workflows-DlTkuM0J.js → workflows-DhEJXkD0.js} +3 -3
- package/web/dist/assets/{workspace-tools-BRK7f1Hk.js → workspace-tools-DrUvrG9H.js} +1 -1
- package/web/dist/assets/{worktrees-section-BXI0-7HH.js → worktrees-section-CTVeHaAF.js} +4 -4
- package/web/dist/index.html +3 -3
- package/web/dist/assets/github-By3yOcFH.js +0 -1
- package/web/dist/assets/index-C69_Sk06.css +0 -1
- package/web/dist/assets/play-CmVAj_fu.js +0 -1
- package/web/dist/assets/preview-pane-connected-DAM2Snwh.js +0 -3
- package/web/dist/assets/reports-BCHWt3zy.js +0 -1
- package/web/dist/assets/run-header-DeprqSP7.js +0 -2
- package/web/dist/assets/settings-shell-CLToW28f.js +0 -1
- package/web/dist/assets/task-commits-CpV1Hz9L.js +0 -1
- package/web/dist/assets/task-thread-CKkTeQdi.js +0 -9
- package/web/dist/assets/task-thread-DzADOhZd.css +0 -1
|
@@ -113,42 +113,10 @@ export declare function createUiStateRoutes(): import("hono/hono-base").HonoBase
|
|
|
113
113
|
"/ui-state": {
|
|
114
114
|
$put: {
|
|
115
115
|
output: {
|
|
116
|
-
|
|
117
|
-
sidebarLimits?: {
|
|
118
|
-
overall?: number | null | undefined;
|
|
119
|
-
needsYou?: number | null | undefined;
|
|
120
|
-
finished?: number | null | undefined;
|
|
121
|
-
working?: number | null | undefined;
|
|
122
|
-
} | undefined;
|
|
123
|
-
lastTask?: {
|
|
124
|
-
source: "skill" | "workflow";
|
|
125
|
-
ref: string;
|
|
126
|
-
} | null | undefined;
|
|
127
|
-
recentSources?: {
|
|
128
|
-
source: "skill" | "workflow";
|
|
129
|
-
ref: string;
|
|
130
|
-
}[] | undefined;
|
|
131
|
-
lastWorktree?: boolean | undefined;
|
|
132
|
-
lastAutonomous?: boolean | undefined;
|
|
133
|
-
skillUsage?: {
|
|
134
|
-
[x: string]: number;
|
|
135
|
-
} | undefined;
|
|
136
|
-
runsView?: "list" | "table" | undefined;
|
|
137
|
-
githubView?: "issues" | "prs" | undefined;
|
|
138
|
-
appearance?: {
|
|
139
|
-
accent?: "cezarion" | "lime" | "violet" | undefined;
|
|
140
|
-
density?: "comfortable" | "compact" | "ultra" | undefined;
|
|
141
|
-
width?: "narrow" | "wide" | undefined;
|
|
142
|
-
} | undefined;
|
|
143
|
-
promptTemplates?: {
|
|
144
|
-
id: string;
|
|
145
|
-
label: string;
|
|
146
|
-
text: string;
|
|
147
|
-
skills?: string[] | undefined;
|
|
148
|
-
}[] | undefined;
|
|
116
|
+
error: string;
|
|
149
117
|
};
|
|
150
118
|
outputFormat: "json";
|
|
151
|
-
status:
|
|
119
|
+
status: 500;
|
|
152
120
|
input: {
|
|
153
121
|
json: {
|
|
154
122
|
[x: string]: unknown;
|
|
@@ -186,10 +154,42 @@ export declare function createUiStateRoutes(): import("hono/hono-base").HonoBase
|
|
|
186
154
|
};
|
|
187
155
|
} | {
|
|
188
156
|
output: {
|
|
189
|
-
|
|
157
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
158
|
+
sidebarLimits?: {
|
|
159
|
+
overall?: number | null | undefined;
|
|
160
|
+
needsYou?: number | null | undefined;
|
|
161
|
+
finished?: number | null | undefined;
|
|
162
|
+
working?: number | null | undefined;
|
|
163
|
+
} | undefined;
|
|
164
|
+
lastTask?: {
|
|
165
|
+
source: "skill" | "workflow";
|
|
166
|
+
ref: string;
|
|
167
|
+
} | null | undefined;
|
|
168
|
+
recentSources?: {
|
|
169
|
+
source: "skill" | "workflow";
|
|
170
|
+
ref: string;
|
|
171
|
+
}[] | undefined;
|
|
172
|
+
lastWorktree?: boolean | undefined;
|
|
173
|
+
lastAutonomous?: boolean | undefined;
|
|
174
|
+
skillUsage?: {
|
|
175
|
+
[x: string]: number;
|
|
176
|
+
} | undefined;
|
|
177
|
+
runsView?: "list" | "table" | undefined;
|
|
178
|
+
githubView?: "issues" | "prs" | undefined;
|
|
179
|
+
appearance?: {
|
|
180
|
+
accent?: "cezarion" | "lime" | "violet" | undefined;
|
|
181
|
+
density?: "comfortable" | "compact" | "ultra" | undefined;
|
|
182
|
+
width?: "narrow" | "wide" | undefined;
|
|
183
|
+
} | undefined;
|
|
184
|
+
promptTemplates?: {
|
|
185
|
+
id: string;
|
|
186
|
+
label: string;
|
|
187
|
+
text: string;
|
|
188
|
+
skills?: string[] | undefined;
|
|
189
|
+
}[] | undefined;
|
|
190
190
|
};
|
|
191
191
|
outputFormat: "json";
|
|
192
|
-
status:
|
|
192
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
193
193
|
input: {
|
|
194
194
|
json: {
|
|
195
195
|
[x: string]: unknown;
|
|
@@ -275,10 +275,11 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
|
|
|
275
275
|
"/workflows": {
|
|
276
276
|
$post: {
|
|
277
277
|
output: {
|
|
278
|
-
|
|
278
|
+
path: string;
|
|
279
|
+
name: string;
|
|
279
280
|
};
|
|
280
281
|
outputFormat: "json";
|
|
281
|
-
status:
|
|
282
|
+
status: 201;
|
|
282
283
|
input: {
|
|
283
284
|
json: {
|
|
284
285
|
name: string;
|
|
@@ -311,10 +312,9 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
|
|
|
311
312
|
} | {
|
|
312
313
|
output: {
|
|
313
314
|
error: string;
|
|
314
|
-
exists: true;
|
|
315
315
|
};
|
|
316
316
|
outputFormat: "json";
|
|
317
|
-
status:
|
|
317
|
+
status: 400;
|
|
318
318
|
input: {
|
|
319
319
|
json: {
|
|
320
320
|
name: string;
|
|
@@ -347,9 +347,10 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
|
|
|
347
347
|
} | {
|
|
348
348
|
output: {
|
|
349
349
|
error: string;
|
|
350
|
+
exists: true;
|
|
350
351
|
};
|
|
351
352
|
outputFormat: "json";
|
|
352
|
-
status:
|
|
353
|
+
status: 409;
|
|
353
354
|
input: {
|
|
354
355
|
json: {
|
|
355
356
|
name: string;
|
|
@@ -381,11 +382,10 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
|
|
|
381
382
|
};
|
|
382
383
|
} | {
|
|
383
384
|
output: {
|
|
384
|
-
|
|
385
|
-
name: string;
|
|
385
|
+
error: string;
|
|
386
386
|
};
|
|
387
387
|
outputFormat: "json";
|
|
388
|
-
status:
|
|
388
|
+
status: 500;
|
|
389
389
|
input: {
|
|
390
390
|
json: {
|
|
391
391
|
name: string;
|
|
@@ -421,10 +421,11 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
|
|
|
421
421
|
"/workflows/:name": {
|
|
422
422
|
$delete: {
|
|
423
423
|
output: {
|
|
424
|
-
|
|
424
|
+
ok: true;
|
|
425
|
+
path: string;
|
|
425
426
|
};
|
|
426
427
|
outputFormat: "json";
|
|
427
|
-
status:
|
|
428
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
428
429
|
input: {
|
|
429
430
|
param: {
|
|
430
431
|
name: string;
|
|
@@ -432,11 +433,10 @@ export declare function createWorkflowsRoutes(): import("hono/hono-base").HonoBa
|
|
|
432
433
|
};
|
|
433
434
|
} | {
|
|
434
435
|
output: {
|
|
435
|
-
|
|
436
|
-
path: string;
|
|
436
|
+
error: string;
|
|
437
437
|
};
|
|
438
438
|
outputFormat: "json";
|
|
439
|
-
status:
|
|
439
|
+
status: 400 | 404 | 409 | 500;
|
|
440
440
|
input: {
|
|
441
441
|
param: {
|
|
442
442
|
name: string;
|
|
@@ -504,18 +504,6 @@ export interface PlanRouteDeps {
|
|
|
504
504
|
export declare function createPlanRoutes(deps: PlanRouteDeps): import("hono/hono-base").HonoBase<ProjectApiEnv, {
|
|
505
505
|
"/plan": {
|
|
506
506
|
$post: {
|
|
507
|
-
output: {
|
|
508
|
-
error: string;
|
|
509
|
-
};
|
|
510
|
-
outputFormat: "json";
|
|
511
|
-
status: 400 | 404 | 409;
|
|
512
|
-
input: {
|
|
513
|
-
json: {
|
|
514
|
-
task: string;
|
|
515
|
-
agentProfile?: string | undefined;
|
|
516
|
-
};
|
|
517
|
-
};
|
|
518
|
-
} | {
|
|
519
507
|
output: {
|
|
520
508
|
name?: string;
|
|
521
509
|
steps: {
|
|
@@ -552,6 +540,18 @@ export declare function createPlanRoutes(deps: PlanRouteDeps): import("hono/hono
|
|
|
552
540
|
agentProfile?: string | undefined;
|
|
553
541
|
};
|
|
554
542
|
};
|
|
543
|
+
} | {
|
|
544
|
+
output: {
|
|
545
|
+
error: string;
|
|
546
|
+
};
|
|
547
|
+
outputFormat: "json";
|
|
548
|
+
status: 400 | 404 | 409;
|
|
549
|
+
input: {
|
|
550
|
+
json: {
|
|
551
|
+
task: string;
|
|
552
|
+
agentProfile?: string | undefined;
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
555
|
};
|
|
556
556
|
};
|
|
557
557
|
}, "/", "/plan">;
|
|
@@ -599,34 +599,10 @@ export declare function createConfigRoutes(deps: ConfigRouteDeps): import("hono/
|
|
|
599
599
|
"/config": {
|
|
600
600
|
$put: {
|
|
601
601
|
output: {
|
|
602
|
-
|
|
603
|
-
effectiveArchiveOnMerge: boolean;
|
|
604
|
-
archiveOnMergeSource: "default" | "environment" | "global" | "project";
|
|
605
|
-
baseBranch: string | null;
|
|
606
|
-
defaultRunner: string;
|
|
607
|
-
systemPrompt: string | null;
|
|
608
|
-
defaultModels: {
|
|
609
|
-
[x: string]: string | undefined;
|
|
610
|
-
};
|
|
611
|
-
modelsLocked: boolean;
|
|
612
|
-
maxParallel: number;
|
|
613
|
-
memoryLimitMb: number | null;
|
|
614
|
-
worktreeRetention: number;
|
|
615
|
-
liveTitleUpdates: boolean | null;
|
|
616
|
-
reviewGate: boolean | null;
|
|
617
|
-
worktreeSetup: {
|
|
618
|
-
commands: string[];
|
|
619
|
-
timeoutSeconds: number;
|
|
620
|
-
} | null;
|
|
621
|
-
worktreeSetupIssue: string | null;
|
|
622
|
-
worktreeTeardown: {
|
|
623
|
-
commands: string[];
|
|
624
|
-
timeoutSeconds: number;
|
|
625
|
-
} | null;
|
|
626
|
-
worktreeTeardownIssue: string | null;
|
|
602
|
+
error: string;
|
|
627
603
|
};
|
|
628
604
|
outputFormat: "json";
|
|
629
|
-
status:
|
|
605
|
+
status: 409;
|
|
630
606
|
input: {
|
|
631
607
|
json: {
|
|
632
608
|
archiveOnMerge?: boolean | null | undefined;
|
|
@@ -654,7 +630,7 @@ export declare function createConfigRoutes(deps: ConfigRouteDeps): import("hono/
|
|
|
654
630
|
error: string;
|
|
655
631
|
};
|
|
656
632
|
outputFormat: "json";
|
|
657
|
-
status:
|
|
633
|
+
status: 500;
|
|
658
634
|
input: {
|
|
659
635
|
json: {
|
|
660
636
|
archiveOnMerge?: boolean | null | undefined;
|
|
@@ -679,10 +655,34 @@ export declare function createConfigRoutes(deps: ConfigRouteDeps): import("hono/
|
|
|
679
655
|
};
|
|
680
656
|
} | {
|
|
681
657
|
output: {
|
|
682
|
-
|
|
658
|
+
archiveOnMerge: boolean | null;
|
|
659
|
+
effectiveArchiveOnMerge: boolean;
|
|
660
|
+
archiveOnMergeSource: "default" | "environment" | "global" | "project";
|
|
661
|
+
baseBranch: string | null;
|
|
662
|
+
defaultRunner: string;
|
|
663
|
+
systemPrompt: string | null;
|
|
664
|
+
defaultModels: {
|
|
665
|
+
[x: string]: string | undefined;
|
|
666
|
+
};
|
|
667
|
+
modelsLocked: boolean;
|
|
668
|
+
maxParallel: number;
|
|
669
|
+
memoryLimitMb: number | null;
|
|
670
|
+
worktreeRetention: number;
|
|
671
|
+
liveTitleUpdates: boolean | null;
|
|
672
|
+
reviewGate: boolean | null;
|
|
673
|
+
worktreeSetup: {
|
|
674
|
+
commands: string[];
|
|
675
|
+
timeoutSeconds: number;
|
|
676
|
+
} | null;
|
|
677
|
+
worktreeSetupIssue: string | null;
|
|
678
|
+
worktreeTeardown: {
|
|
679
|
+
commands: string[];
|
|
680
|
+
timeoutSeconds: number;
|
|
681
|
+
} | null;
|
|
682
|
+
worktreeTeardownIssue: string | null;
|
|
683
683
|
};
|
|
684
684
|
outputFormat: "json";
|
|
685
|
-
status:
|
|
685
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
686
686
|
input: {
|
|
687
687
|
json: {
|
|
688
688
|
archiveOnMerge?: boolean | null | undefined;
|
|
@@ -796,14 +796,10 @@ export declare function createAgentConfigRoutes(capabilities: ServerCapabilities
|
|
|
796
796
|
"/agent-config/:id": {
|
|
797
797
|
$put: {
|
|
798
798
|
output: {
|
|
799
|
-
|
|
800
|
-
path: string;
|
|
801
|
-
exists: boolean;
|
|
802
|
-
content: string;
|
|
803
|
-
version: string | null;
|
|
799
|
+
error: string;
|
|
804
800
|
};
|
|
805
801
|
outputFormat: "json";
|
|
806
|
-
status:
|
|
802
|
+
status: 404;
|
|
807
803
|
input: {
|
|
808
804
|
json: {
|
|
809
805
|
content: string;
|
|
@@ -816,10 +812,14 @@ export declare function createAgentConfigRoutes(capabilities: ServerCapabilities
|
|
|
816
812
|
};
|
|
817
813
|
} | {
|
|
818
814
|
output: {
|
|
819
|
-
|
|
815
|
+
id: string;
|
|
816
|
+
path: string;
|
|
817
|
+
exists: boolean;
|
|
818
|
+
content: string;
|
|
819
|
+
version: string | null;
|
|
820
820
|
};
|
|
821
821
|
outputFormat: "json";
|
|
822
|
-
status:
|
|
822
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
823
823
|
input: {
|
|
824
824
|
json: {
|
|
825
825
|
content: string;
|
|
@@ -941,9 +941,12 @@ export declare function createAgentWebhooksRoutes(deps: AgentWebhooksRouteDeps):
|
|
|
941
941
|
export declare function createSseRoutes(): import("hono/hono-base").HonoBase<ProjectApiEnv, {
|
|
942
942
|
"/runs/:id/events": {
|
|
943
943
|
$get: {
|
|
944
|
-
output: {
|
|
945
|
-
|
|
946
|
-
|
|
944
|
+
output: {
|
|
945
|
+
error: string;
|
|
946
|
+
code?: "invalid_input" | undefined;
|
|
947
|
+
};
|
|
948
|
+
outputFormat: "json";
|
|
949
|
+
status: 400;
|
|
947
950
|
input: {
|
|
948
951
|
param: {
|
|
949
952
|
id: string;
|
|
@@ -955,12 +958,9 @@ export declare function createSseRoutes(): import("hono/hono-base").HonoBase<Pro
|
|
|
955
958
|
};
|
|
956
959
|
};
|
|
957
960
|
} | {
|
|
958
|
-
output: {
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
};
|
|
962
|
-
outputFormat: "json";
|
|
963
|
-
status: 400;
|
|
961
|
+
output: {};
|
|
962
|
+
outputFormat: string;
|
|
963
|
+
status: import("hono/utils/http-status").StatusCode;
|
|
964
964
|
input: {
|
|
965
965
|
param: {
|
|
966
966
|
id: string;
|
|
@@ -58,11 +58,15 @@ export declare function createRunnersRoutes(options: {
|
|
|
58
58
|
"/runner-install/:runner": {
|
|
59
59
|
$post: {
|
|
60
60
|
output: {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
supported: boolean;
|
|
62
|
+
installedVersion: string | null;
|
|
63
|
+
latestVersion: string | null;
|
|
64
|
+
updateAvailable: boolean;
|
|
65
|
+
phase: "activating" | "checking" | "downloading" | "extracting" | "failed" | "idle" | "removing" | "verifying";
|
|
66
|
+
error: string | null;
|
|
63
67
|
};
|
|
64
68
|
outputFormat: "json";
|
|
65
|
-
status:
|
|
69
|
+
status: 202;
|
|
66
70
|
input: {
|
|
67
71
|
param: {
|
|
68
72
|
runner: string;
|
|
@@ -74,15 +78,11 @@ export declare function createRunnersRoutes(options: {
|
|
|
74
78
|
};
|
|
75
79
|
} | {
|
|
76
80
|
output: {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
latestVersion: string | null;
|
|
80
|
-
updateAvailable: boolean;
|
|
81
|
-
phase: "activating" | "checking" | "downloading" | "extracting" | "failed" | "idle" | "removing" | "verifying";
|
|
82
|
-
error: string | null;
|
|
81
|
+
error: string;
|
|
82
|
+
code?: "invalid_input" | undefined;
|
|
83
83
|
};
|
|
84
84
|
outputFormat: "json";
|
|
85
|
-
status:
|
|
85
|
+
status: 400;
|
|
86
86
|
input: {
|
|
87
87
|
param: {
|
|
88
88
|
runner: string;
|
|
@@ -12300,20 +12300,20 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
|
|
|
12300
12300
|
} & {
|
|
12301
12301
|
"/runs/:id/handoff": {
|
|
12302
12302
|
$get: {
|
|
12303
|
-
output:
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
outputFormat: "json";
|
|
12307
|
-
status: 404;
|
|
12303
|
+
output: string;
|
|
12304
|
+
outputFormat: "text";
|
|
12305
|
+
status: 200;
|
|
12308
12306
|
input: {
|
|
12309
12307
|
param: {
|
|
12310
12308
|
id: string;
|
|
12311
12309
|
};
|
|
12312
12310
|
};
|
|
12313
12311
|
} | {
|
|
12314
|
-
output:
|
|
12315
|
-
|
|
12316
|
-
|
|
12312
|
+
output: {
|
|
12313
|
+
error: string;
|
|
12314
|
+
};
|
|
12315
|
+
outputFormat: "json";
|
|
12316
|
+
status: 404;
|
|
12317
12317
|
input: {
|
|
12318
12318
|
param: {
|
|
12319
12319
|
id: string;
|
|
@@ -12351,20 +12351,20 @@ export declare function createRunsRoutes(deps: RunsRouteDeps): import("hono/hono
|
|
|
12351
12351
|
} & {
|
|
12352
12352
|
"/runs/:id/diff": {
|
|
12353
12353
|
$get: {
|
|
12354
|
-
output:
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
outputFormat: "json";
|
|
12358
|
-
status: 404 | 409;
|
|
12354
|
+
output: string;
|
|
12355
|
+
outputFormat: "text";
|
|
12356
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
12359
12357
|
input: {
|
|
12360
12358
|
param: {
|
|
12361
12359
|
id: string;
|
|
12362
12360
|
};
|
|
12363
12361
|
};
|
|
12364
12362
|
} | {
|
|
12365
|
-
output:
|
|
12366
|
-
|
|
12367
|
-
|
|
12363
|
+
output: {
|
|
12364
|
+
error: string;
|
|
12365
|
+
};
|
|
12366
|
+
outputFormat: "json";
|
|
12367
|
+
status: 404 | 409;
|
|
12368
12368
|
input: {
|
|
12369
12369
|
param: {
|
|
12370
12370
|
id: string;
|
package/dist/server/server.d.ts
CHANGED
|
@@ -19447,9 +19447,9 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
19447
19447
|
status: 404 | 409;
|
|
19448
19448
|
input: {
|
|
19449
19449
|
param: {
|
|
19450
|
-
id: string;
|
|
19451
|
-
} & {
|
|
19452
19450
|
sha: string;
|
|
19451
|
+
} & {
|
|
19452
|
+
id: string;
|
|
19453
19453
|
};
|
|
19454
19454
|
};
|
|
19455
19455
|
} | {
|
|
@@ -19478,9 +19478,9 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
19478
19478
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
19479
19479
|
input: {
|
|
19480
19480
|
param: {
|
|
19481
|
-
id: string;
|
|
19482
|
-
} & {
|
|
19483
19481
|
sha: string;
|
|
19482
|
+
} & {
|
|
19483
|
+
id: string;
|
|
19484
19484
|
};
|
|
19485
19485
|
};
|
|
19486
19486
|
};
|
|
@@ -36216,9 +36216,9 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
36216
36216
|
status: 404 | 409;
|
|
36217
36217
|
input: {
|
|
36218
36218
|
param: {
|
|
36219
|
-
id: string;
|
|
36220
|
-
} & {
|
|
36221
36219
|
sha: string;
|
|
36220
|
+
} & {
|
|
36221
|
+
id: string;
|
|
36222
36222
|
};
|
|
36223
36223
|
};
|
|
36224
36224
|
} | {
|
|
@@ -36247,9 +36247,9 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
36247
36247
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
36248
36248
|
input: {
|
|
36249
36249
|
param: {
|
|
36250
|
-
id: string;
|
|
36251
|
-
} & {
|
|
36252
36250
|
sha: string;
|
|
36251
|
+
} & {
|
|
36252
|
+
id: string;
|
|
36253
36253
|
};
|
|
36254
36254
|
};
|
|
36255
36255
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hearsay-tools/squawk",
|
|
3
|
-
"version": "0.19.0-
|
|
3
|
+
"version": "0.19.0-pr4419.8657",
|
|
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-
|
|
73
|
-
"@open-mercato/cezar-contract": "0.19.0-
|
|
72
|
+
"@open-mercato/cezar-api-client": "0.19.0-pr4419.8657",
|
|
73
|
+
"@open-mercato/cezar-contract": "0.19.0-pr4419.8657",
|
|
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": "0b178a10bc65772e4893dfe4fa189dfa541bc1dc"
|
|
91
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{l as r,m as i,o as a,s as o,u as s}from"./live-reads-Crd6fVGH.js";import{Ln as c,Nn as l,Nr as u,Pn as d,an as f,pi as p,ti as m}from"./project-scope-context-Rv6S_BXt.js";import{n as h}from"./toaster-BXnLIU3z.js";import{Ct as g,Et as _,Ft as v,Mt as y,Qt as b,St as x,Vt as S,ft as ee,lt as te,pt as C,qt as w,ut as T,vt as E}from"./queries-qCF-eOqZ.js";import{f as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as re}from"./design-icons-CzEoMH9c.js";import{t as ie}from"./createLucideIcon-BHp8sXmF.js";import{t as ae}from"./folder-browser-B7IbnF0d.js";import{t as D}from"./button-B7MKxYjT.js";import{t as oe}from"./badge-DQ3U69Ht.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dialog-B531GGAo.js";import{t as P}from"./status-dot-BRzVlF2X.js";import{n as F}from"./agents-settings-path-7X6_cvUg.js";import{t as I}from"./centered-state-V15AR_qo.js";import{Gt as L,Ht as R,Jt as z,Kt as B,N as V,Ut as H,Wt as U,Yt as W,j as G,qt as K}from"./index-DNQcTHxV.js";import{t as q}from"./settings-select-CCIMGnyA.js";import{n as J,r as se,t as ce}from"./settings-agent-picker-CJJJncuA.js";import{n as le,r as ue,t as de}from"./remote-settings-notice-COojb6XK.js";var fe=ie(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Y=e(t(),1),X=n(),pe=`~/.claude-second`;function me({open:e,onOpenChange:t,providers:n,initialProvider:a}){let s=i().data,[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null),[f,p]=(0,Y.useState)(a??n[0]??`claude`),[m,g]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=C(),S=_.trim();return(0,X.jsx)(N,{open:e,onOpenChange:t,children:(0,X.jsxs)(j,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(A,{children:[(0,X.jsx)(M,{children:`Add agent account`}),(0,X.jsx)(k,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,X.jsx)(q,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:f,onChange:e=>p(e.target.value),className:`rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`,children:n.map(e=>(0,X.jsx)(`option`,{value:e,children:o(s,e)},e))})]}),(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,X.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:m,placeholder:`Work`,onChange:e=>g(e.target.value),className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,X.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:_,placeholder:r(s,f)?.accountFolderExample??pe,onChange:e=>{v(e.target.value),d(null),x.reset()},className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 font-mono text-[13px] outline-none focus-visible:border-ring`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":y,onClick:()=>b(e=>!e),children:y?`Hide folders`:`Browse…`})]}),(0,X.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[`A `,(0,X.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),y?(0,X.jsx)(ae,{path:c,selected:u,onSelect:e=>{d(e),v(e.path),x.reset()},onEnter:e=>{l(e),d(null),x.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,x.isError?(0,X.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:x.error instanceof Error?x.error.message:`could not add that folder`}):null,(0,X.jsxs)(O,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(D,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(D,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:f,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),g(``),v(``),d(null),b(!1),h(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function he(e){return c(await d.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ge(e,t){return c(await d.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var _e={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function ve(e){let t=E().data?.capabilities?.settingsAdmin===!0,n=p(),r=[`runner-install`,e],i=m({queryKey:r,queryFn:()=>he(e),enabled:t,retry:!1,refetchInterval:e=>{if(e.state.error)return!1;let t=e.state.data?.phase;return t&&t!==`idle`&&t!==`failed`?1e3:6e4}}),a=b({mutationFn:t=>ge(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),o=i.data;return{allowed:t,data:o,busy:a.isPending||!!o&&o.phase!==`idle`&&o.phase!==`failed`,error:a.error?.message??i.error?.message??o?.error,action:a,status:i}}function ye({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,X.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function be({runner:e}){let t=ve(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,X.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,X.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[r?.installedVersion?`Installed CLI ${r.installedVersion}`:`CLI not installed`,r?.latestVersion?` · Latest ${r.latestVersion}`:``,i&&r?` · ${_e[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(ye,{state:t}),r?.installedVersion?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var xe={connected:{label:`Connected`,tone:`success`},disconnected:{label:`Not connected`,tone:`pending`},"not-installed":{label:`Not installed`,tone:`neutral`},unknown:{label:`Could not verify`,tone:`danger`}};function Se(){let e=T(),t=i();if(e.isPending||t.isPending)return(0,X.jsx)(`p`,{"data-slot":`accounts-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agents…`});let n=e.error??t.error;return n?(0,X.jsx)(I,{icon:(0,X.jsx)(fe,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(Te,{data:e.data,runners:t.data})}function Ce(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function we(){let{hash:e}=ne();(0,Y.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function Te({data:e,runners:t}){let n=E(),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),s=_();return we(),ue(),(0,X.jsxs)(`div`,{"data-slot":`accounts-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,X.jsx)(le,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,X.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-muted-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,X.jsx)(`code`,{children:de}),` on the host to add, edit, or sign in to accounts here.`]}),(0,X.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-3`,children:t.runners.map(r=>(0,X.jsx)(Ae,{entry:r,check:n.data?.checks?.find(e=>e.name===r.id),settingsAdmin:n.data?.capabilities?.settingsAdmin===!0,runners:t,editable:e.editable,accounts:e.profiles.filter(e=>e.provider===r.id),canCarryAccounts:e.profileCapableProviders.includes(r.id),onAdd:()=>i(r.id),onRemove:o},r.id))}),(0,X.jsx)(je,{runners:t}),r===null?null:(0,X.jsx)(me,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(R,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,X.jsxs)(L,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(z,{children:[(0,X.jsxs)(W,{children:[`Remove “`,a?.label,`”?`]}),(0,X.jsxs)(B,{children:[`This only forgets the account. Nothing in `,a?.configDir??`this account’s folder`,` is deleted — not your login, not your sessions. Projects using it fall back to the default account, and tasks that ran under it can no longer be resumed from here.`]})]}),(0,X.jsxs)(K,{children:[(0,X.jsx)(U,{children:`Cancel`}),(0,X.jsx)(H,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),h(`Removed ${e.label}`)},onError:e=>h(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Ee({entry:e,check:t}){return t===void 0?(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking CLI…`}):t.available?(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`CLI installed`}),t.version?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}),(0,X.jsx)(Oe,{version:t.version})]}):null]}):(0,X.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`CLI not installed`,e.installHint?(0,X.jsxs)(X.Fragment,{children:[` — `,(0,X.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}var De=/^mock \(\w*DRY_RUN=1\)$/;function Oe({version:e}){return De.test(e)?(0,X.jsx)(`span`,{"data-slot":`agent-version`,"data-dry-run":``,title:e,className:`rounded bg-muted/60 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground`,children:`Dry run`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`, version `}),(0,X.jsx)(`span`,{"data-slot":`agent-version`,className:`text-muted-foreground`,children:e})]})}function ke({items:e}){let t=e.filter(e=>e!=null&&e!==!1);return t.length===0?null:(0,X.jsx)(`p`,{"data-slot":`agent-summary`,className:`settings-agent-summary`,children:t.map((e,t)=>(0,X.jsxs)(`span`,{className:`settings-agent-summary-item`,children:[t>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}):null,e]},t))})}function Z({titleId:e,title:t,summary:n,actions:r,actionsSlot:i}){return(0,X.jsxs)(`div`,{"data-slot":`agent-head`,className:`settings-agent-head`,children:[(0,X.jsxs)(`div`,{className:`settings-agent-heading`,children:[(0,X.jsx)(`h3`,{id:e,className:`settings-account-provider-title`,children:t}),(0,X.jsx)(ke,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Ae({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.displayName,d=e.managedInstall===!0&&n,f=a.filter(e=>e.isDefault).length,p=`${F(l)}-title`,m=i&&o?(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`}):null,h={titleId:p,title:u,facts:[d?null:(0,X.jsx)(Ee,{entry:e,check:t}),i||a.length>0?(0,X.jsxs)(`span`,{className:`settings-account-count`,title:`${f} discovered, ${a.length-f} added`,children:[a.length,` `,a.length===1?`account`:`accounts`]}):null],addButton:m},[g,..._]=a;return(0,X.jsxs)(`section`,{id:F(l),tabIndex:-1,"aria-labelledby":p,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col rounded-lg border border-border bg-card`,children:[g===void 0?(0,X.jsx)(Z,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(be,{runner:l}):null,g===void 0?null:(0,X.jsxs)(`ul`,{className:`settings-agent-accounts`,children:[(0,X.jsx)($,{account:g,runners:r,editable:i,onRemove:()=>c(g),agent:h}),_.map(e=>(0,X.jsx)($,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))]}),i&&!o?(0,X.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`settings-agent-note`,children:[`One account only: `,u,` keeps its login outside its config folder, so a second folder would change settings without changing who is billed.`]}):!i&&a.length===0&&e.browserLogin?(0,X.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`settings-agent-note flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(`span`,{children:`Discovered account`}),(0,X.jsx)(J,{provider:l,label:u})]}):null]})}function je({runners:e}){let[t,n]=(0,Y.useState)(null),r=p(),i=v(),o=x(),c=w(s(e)),l=b({mutationFn:e=>f(e),onSuccess:e=>r.setQueryData(S.config,e),onError:e=>h(e.message,{tone:`danger`})});if(i.data===void 0)return null;let u=se([],e),d=i.data.agentDefaults.runner??`claude`,m=a(t??d,s(e))??t??d,g=i.data.agentDefaults.models??{};return(0,X.jsxs)(`section`,{"data-slot":`accounts-defaults`,className:`flex flex-col gap-3 rounded-lg border border-border bg-card/40 p-3.5`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,X.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`What a project runs when it has not chosen for itself — set once instead of per repository. A project that has chosen keeps its own.`})]}),(0,X.jsx)(ce,{rows:u,runner:d,accountFor:()=>null,providerStatus:o,disabled:l.isPending,onPick:e=>{e!==d&&l.mutate({agentDefaults:{runner:e}})}}),(0,X.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,X.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,X.jsx)(`span`,{children:`Default model for`}),(0,X.jsx)(q,{"aria-label":`Model agent`,value:m,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===m).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(re,{className:`size-4 text-accent-icon shrink-0`}),(0,X.jsx)(`span`,{className:`w-28 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,X.jsxs)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:g[t.id]??``,disabled:l.isPending,onChange:e=>l.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-64 max-w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[V(t.id,e,c[t.id]?.data,[g[t.id]]).map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,X.jsx)(Q,{runner:t.id,runners:e,catalog:c[t.id]})]})]},t.id))]})]})}function Q({runner:e,runners:t,catalog:n}){let r=G(e,t,n);return r?(0,X.jsx)(`option`,{disabled:!0,children:r}):null}function Me({account:e,runners:t,status:n,editable:i}){let a=ee();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&r(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,i&&n&&n.status!==`connected`&&r(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:a.isPending,onClick:()=>a.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>h(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>h(e instanceof l&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ne(e,t,n,r){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?{slot:`account-unrecognised`,label:`Unrecognized folder`,guidance:`This folder does not look like ${o(t,e.provider)} config yet.`}:null:{slot:`account-missing`,label:`Not initialized`,guidance:r?n.status===`connected`?`Folder not created yet. Use Check again to refresh.`:`Folder not created yet. Connect will make it.`:`Folder not created on the host yet.`}}function $({account:e,runners:t,editable:n,onRemove:r,agent:i}){let a=u(e),o=g(),s=te(a,e.status===void 0),c=e.status??s.data?.status,l=c?xe[c.status]:void 0,d=Ne(e,t,c,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:l?`Sign-in: ${l.label}`:void 0,children:[(0,X.jsx)(P,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":d.slot,className:`text-foreground`,children:d.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(P,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:l?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>h(e.message,{tone:`danger`})}),children:`Check again`})]}),m=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(oe,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-[11px] font-normal text-muted-foreground`,children:`discovered`}):null]}),_=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Ce(e.configDir)}):null,v=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=c?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:c.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Pe,{account:e,onRemove:r}):null,x=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),_,v,y]});return i?(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,"data-primary":``,className:`settings-account-primary`,children:[(0,X.jsx)(Z,{titleId:i.titleId,title:i.title,summary:i.facts,actions:(0,X.jsxs)(X.Fragment,{children:[p,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[x,b?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:b}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[x,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Pe({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=y();return(0,X.jsx)(X.Fragment,{children:e.isDefault?null:(0,X.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{type:`text`,autoFocus:!0,"aria-label":`Name for ${e.label}`,"data-slot":`account-rename-input`,value:i,onChange:e=>a(e.target.value),className:`w-48 rounded-md border border-input bg-card px-2 py-1 text-xs outline-none focus-visible:border-ring`}),(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>h(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{Se as GlobalAgentsSection};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{l as r,m as i,o as a,s as o,u as s}from"./live-reads-Crd6fVGH.js";import{Ln as c,Nn as l,Nr as u,Pn as d,an as f,pi as p,ti as m}from"./project-scope-context-Rv6S_BXt.js";import{n as h}from"./toaster-BXnLIU3z.js";import{Ct as g,Et as _,Ft as v,Mt as y,Qt as b,St as x,Vt as S,ft as ee,lt as te,pt as C,qt as w,ut as T,vt as E}from"./queries-qCF-eOqZ.js";import{f as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{y as re}from"./design-icons-CzEoMH9c.js";import{t as ie}from"./createLucideIcon-BHp8sXmF.js";import{t as ae}from"./folder-browser-B7IbnF0d.js";import{t as D}from"./button-B7MKxYjT.js";import{t as oe}from"./badge-DQ3U69Ht.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dialog-B531GGAo.js";import{t as P}from"./status-dot-BRzVlF2X.js";import{n as F}from"./agents-settings-path-7X6_cvUg.js";import{t as I}from"./centered-state-V15AR_qo.js";import{Gt as L,Jt as R,Kt as z,M as B,P as V,Ut as H,Wt as U,Xt as W,Yt as G,qt as K}from"./index-cS5ELSRA.js";import{t as q}from"./settings-select-CCIMGnyA.js";import{n as J,r as se,t as ce}from"./settings-agent-picker-Byi8AjNU.js";import{n as le,r as ue,t as de}from"./remote-settings-notice-BCmpPIT0.js";var fe=ie(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Y=e(t(),1),X=n(),pe=`~/.claude-second`;function me({open:e,onOpenChange:t,providers:n,initialProvider:a}){let s=i().data,[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null),[f,p]=(0,Y.useState)(a??n[0]??`claude`),[m,g]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),x=C(),S=_.trim();return(0,X.jsx)(N,{open:e,onOpenChange:t,children:(0,X.jsxs)(j,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,X.jsxs)(A,{children:[(0,X.jsx)(M,{children:`Add agent account`}),(0,X.jsx)(k,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,X.jsx)(q,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:f,onChange:e=>p(e.target.value),className:`rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`,children:n.map(e=>(0,X.jsx)(`option`,{value:e,children:o(s,e)},e))})]}),(0,X.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,X.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:m,placeholder:`Work`,onChange:e=>g(e.target.value),className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 text-[13px] outline-none focus-visible:border-ring`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,X.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:_,placeholder:r(s,f)?.accountFolderExample??pe,onChange:e=>{v(e.target.value),d(null),x.reset()},className:`min-w-0 flex-1 rounded-md border border-input bg-card px-2 py-1 font-mono text-[13px] outline-none focus-visible:border-ring`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":y,onClick:()=>b(e=>!e),children:y?`Hide folders`:`Browse…`})]}),(0,X.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[`A `,(0,X.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),y?(0,X.jsx)(ae,{path:c,selected:u,onSelect:e=>{d(e),v(e.path),x.reset()},onEnter:e=>{l(e),d(null),x.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,x.isError?(0,X.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:x.error instanceof Error?x.error.message:`could not add that folder`}):null,(0,X.jsxs)(O,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,X.jsx)(D,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,X.jsx)(D,{"data-slot":`add-account-confirm`,disabled:S===``||x.isPending,onClick:()=>{S===``||x.isPending||x.mutate({provider:f,configDir:S,...m.trim()?{label:m.trim()}:{}},{onSuccess:()=>{t(!1),g(``),v(``),d(null),b(!1),h(`Account added — use Connect to sign in`)}})},children:x.isPending?`Adding…`:`Add account`})]})]})})}async function he(e){return c(await d.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ge(e,t){return c(await d.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var _e={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function ve(e){let t=E().data?.capabilities?.settingsAdmin===!0,n=p(),r=[`runner-install`,e],i=m({queryKey:r,queryFn:()=>he(e),enabled:t,retry:!1,refetchInterval:e=>{if(e.state.error)return!1;let t=e.state.data?.phase;return t&&t!==`idle`&&t!==`failed`?1e3:6e4}}),a=b({mutationFn:t=>ge(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),o=i.data;return{allowed:t,data:o,busy:a.isPending||!!o&&o.phase!==`idle`&&o.phase!==`failed`,error:a.error?.message??i.error?.message??o?.error,action:a,status:i}}function ye({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,X.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,X.jsx)(D,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function be({runner:e}){let t=ve(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,X.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,X.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[r?.installedVersion?`Installed CLI ${r.installedVersion}`:`CLI not installed`,r?.latestVersion?` · Latest ${r.latestVersion}`:``,i&&r?` · ${_e[r.phase]}`:``]}),a?(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,X.jsx)(ye,{state:t}),r?.installedVersion?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var xe={connected:{label:`Connected`,tone:`success`},disconnected:{label:`Not connected`,tone:`pending`},"not-installed":{label:`Not installed`,tone:`neutral`},unknown:{label:`Could not verify`,tone:`danger`}};function Se(){let e=T(),t=i();if(e.isPending||t.isPending)return(0,X.jsx)(`p`,{"data-slot":`accounts-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agents…`});let n=e.error??t.error;return n?(0,X.jsx)(I,{icon:(0,X.jsx)(fe,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,X.jsx)(Te,{data:e.data,runners:t.data})}function Ce(e){let t=e.replace(/^\/(?:home|Users)\/[^/]+/,`~`),n=t.split(`/`);return n.length>4?`…/${n.slice(-3).join(`/`)}`:t}function we(){let{hash:e}=ne();(0,Y.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function Te({data:e,runners:t}){let n=E(),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),s=_();return we(),ue(),(0,X.jsxs)(`div`,{"data-slot":`accounts-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,X.jsx)(le,{risk:`Agent accounts run each CLI with the configured host folder`}),e.editable?null:(0,X.jsxs)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-muted-foreground`,children:[`Agent accounts are read-only on this remote cockpit. Run`,` `,(0,X.jsx)(`code`,{children:de}),` on the host to add, edit, or sign in to accounts here.`]}),(0,X.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-3`,children:t.runners.map(r=>(0,X.jsx)(Ae,{entry:r,check:n.data?.checks?.find(e=>e.name===r.id),settingsAdmin:n.data?.capabilities?.settingsAdmin===!0,runners:t,editable:e.editable,accounts:e.profiles.filter(e=>e.provider===r.id),canCarryAccounts:e.profileCapableProviders.includes(r.id),onAdd:()=>i(r.id),onRemove:o},r.id))}),(0,X.jsx)(je,{runners:t}),r===null?null:(0,X.jsx)(me,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,X.jsx)(H,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,X.jsxs)(z,{"data-slot":`accounts-remove-confirm`,children:[(0,X.jsxs)(G,{children:[(0,X.jsxs)(W,{children:[`Remove “`,a?.label,`”?`]}),(0,X.jsxs)(K,{children:[`This only forgets the account. Nothing in `,a?.configDir??`this account’s folder`,` is deleted — not your login, not your sessions. Projects using it fall back to the default account, and tasks that ran under it can no longer be resumed from here.`]})]}),(0,X.jsxs)(R,{children:[(0,X.jsx)(L,{children:`Cancel`}),(0,X.jsx)(U,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),h(`Removed ${e.label}`)},onError:e=>h(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function Ee({entry:e,check:t}){return t===void 0?(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking CLI…`}):t.available?(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,X.jsx)(`span`,{"data-slot":`agent-installed`,children:`CLI installed`}),t.version?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}),(0,X.jsx)(Oe,{version:t.version})]}):null]}):(0,X.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`CLI not installed`,e.installHint?(0,X.jsxs)(X.Fragment,{children:[` — `,(0,X.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}var De=/^mock \(\w*DRY_RUN=1\)$/;function Oe({version:e}){return De.test(e)?(0,X.jsx)(`span`,{"data-slot":`agent-version`,"data-dry-run":``,title:e,className:`rounded bg-muted/60 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground`,children:`Dry run`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`, version `}),(0,X.jsx)(`span`,{"data-slot":`agent-version`,className:`text-muted-foreground`,children:e})]})}function ke({items:e}){let t=e.filter(e=>e!=null&&e!==!1);return t.length===0?null:(0,X.jsx)(`p`,{"data-slot":`agent-summary`,className:`settings-agent-summary`,children:t.map((e,t)=>(0,X.jsxs)(`span`,{className:`settings-agent-summary-item`,children:[t>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`settings-agent-summary-sep`,children:`·`}):null,e]},t))})}function Z({titleId:e,title:t,summary:n,actions:r,actionsSlot:i}){return(0,X.jsxs)(`div`,{"data-slot":`agent-head`,className:`settings-agent-head`,children:[(0,X.jsxs)(`div`,{className:`settings-agent-heading`,children:[(0,X.jsx)(`h3`,{id:e,className:`settings-account-provider-title`,children:t}),(0,X.jsx)(ke,{items:n})]}),r?(0,X.jsx)(`div`,{"data-slot":i,className:`settings-account-actions`,children:r}):null]})}function Ae({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.displayName,d=e.managedInstall===!0&&n,f=a.filter(e=>e.isDefault).length,p=`${F(l)}-title`,m=i&&o?(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`}):null,h={titleId:p,title:u,facts:[d?null:(0,X.jsx)(Ee,{entry:e,check:t}),i||a.length>0?(0,X.jsxs)(`span`,{className:`settings-account-count`,title:`${f} discovered, ${a.length-f} added`,children:[a.length,` `,a.length===1?`account`:`accounts`]}):null],addButton:m},[g,..._]=a;return(0,X.jsxs)(`section`,{id:F(l),tabIndex:-1,"aria-labelledby":p,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col rounded-lg border border-border bg-card`,children:[g===void 0?(0,X.jsx)(Z,{titleId:p,title:u,summary:h.facts,actions:m,actionsSlot:`accounts-actions`}):null,d?(0,X.jsx)(be,{runner:l}):null,g===void 0?null:(0,X.jsxs)(`ul`,{className:`settings-agent-accounts`,children:[(0,X.jsx)($,{account:g,runners:r,editable:i,onRemove:()=>c(g),agent:h}),_.map(e=>(0,X.jsx)($,{account:e,runners:r,editable:i,onRemove:()=>c(e)},e.id))]}),i&&!o?(0,X.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`settings-agent-note`,children:[`One account only: `,u,` keeps its login outside its config folder, so a second folder would change settings without changing who is billed.`]}):!i&&a.length===0&&e.browserLogin?(0,X.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`settings-agent-note flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(`span`,{children:`Discovered account`}),(0,X.jsx)(J,{provider:l,label:u})]}):null]})}function je({runners:e}){let[t,n]=(0,Y.useState)(null),r=p(),i=v(),o=x(),c=w(s(e)),l=b({mutationFn:e=>f(e),onSuccess:e=>r.setQueryData(S.config,e),onError:e=>h(e.message,{tone:`danger`})});if(i.data===void 0)return null;let u=se([],e),d=i.data.agentDefaults.runner??`claude`,m=a(t??d,s(e))??t??d,g=i.data.agentDefaults.models??{};return(0,X.jsxs)(`section`,{"data-slot":`accounts-defaults`,className:`flex flex-col gap-3 rounded-lg border border-border bg-card/40 p-3.5`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,X.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`What a project runs when it has not chosen for itself — set once instead of per repository. A project that has chosen keeps its own.`})]}),(0,X.jsx)(ce,{rows:u,runner:d,accountFor:()=>null,providerStatus:o,disabled:l.isPending,onPick:e=>{e!==d&&l.mutate({agentDefaults:{runner:e}})}}),(0,X.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,X.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,X.jsx)(`span`,{children:`Default model for`}),(0,X.jsx)(q,{"aria-label":`Model agent`,value:m,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===m).map(t=>(0,X.jsxs)(`label`,{className:`settings-account-model flex flex-wrap items-center gap-3`,children:[(0,X.jsx)(re,{className:`size-4 text-accent-icon shrink-0`}),(0,X.jsx)(`span`,{className:`w-28 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,X.jsxs)(q,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:g[t.id]??``,disabled:l.isPending,onChange:e=>l.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-64 max-w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[V(t.id,e,c[t.id]?.data,[g[t.id]]).map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,X.jsx)(Q,{runner:t.id,runners:e,catalog:c[t.id]})]})]},t.id))]})]})}function Q({runner:e,runners:t,catalog:n}){let r=B(e,t,n);return r?(0,X.jsx)(`option`,{disabled:!0,children:r}):null}function Me({account:e,runners:t,status:n,editable:i}){let a=ee();return(0,X.jsxs)(X.Fragment,{children:[n&&n.status!==`connected`&&r(t,e.provider)?.browserLogin?(0,X.jsx)(J,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,i&&n&&n.status!==`connected`&&r(t,e.provider)?.terminalLogin!==!1?(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:a.isPending,onClick:()=>a.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>h(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>h(e instanceof l&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ne(e,t,n,r){return!n||n.requiresAccountHome===!1?null:e.exists?!e.looksValid&&e.configDir?{slot:`account-unrecognised`,label:`Unrecognized folder`,guidance:`This folder does not look like ${o(t,e.provider)} config yet.`}:null:{slot:`account-missing`,label:`Not initialized`,guidance:r?n.status===`connected`?`Folder not created yet. Use Check again to refresh.`:`Folder not created yet. Connect will make it.`:`Folder not created on the host yet.`}}function $({account:e,runners:t,editable:n,onRemove:r,agent:i}){let a=u(e),o=g(),s=te(a,e.status===void 0),c=e.status??s.data?.status,l=c?xe[c.status]:void 0,d=Ne(e,t,c,n),f=d?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:l?`Sign-in: ${l.label}`:void 0,children:[(0,X.jsx)(P,{tone:`pending`}),(0,X.jsx)(`span`,{"data-slot":d.slot,className:`text-foreground`,children:d.label})]}):(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,X.jsx)(P,{tone:l?.tone??`neutral`,pulse:l===void 0}),(0,X.jsx)(`span`,{"data-slot":`account-status`,className:`text-foreground`,children:l?.label??`Checking…`})]}),p=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Me,{account:e,runners:t,status:c,editable:n}),(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:o.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>o.mutate(a,{onError:e=>h(e.message,{tone:`danger`})}),children:`Check again`})]}),m=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`settings-account-label`,children:e.label}),e.isDefault?(0,X.jsx)(oe,{variant:`outline`,"data-slot":`account-discovered`,className:`shrink-0 text-[11px] font-normal text-muted-foreground`,children:`discovered`}):null]}),_=e.configDir?(0,X.jsx)(`span`,{"data-slot":`account-path`,className:`settings-account-path`,title:e.path,children:Ce(e.configDir)}):null,v=d?(0,X.jsx)(`p`,{"data-slot":`account-folder-guidance`,className:`settings-account-hint`,children:d.guidance}):null,y=c?.hint?(0,X.jsx)(`p`,{className:`settings-account-hint`,children:c.hint}):null,b=n&&!e.isDefault?(0,X.jsx)(Pe,{account:e,onRemove:r}):null,x=(0,X.jsxs)(`div`,{className:`settings-account-readout`,children:[(0,X.jsxs)(`div`,{className:`settings-account-meta-line`,children:[m,f]}),_,v,y]});return i?(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,"data-primary":``,className:`settings-account-primary`,children:[(0,X.jsx)(Z,{titleId:i.titleId,title:i.title,summary:i.facts,actions:(0,X.jsxs)(X.Fragment,{children:[p,i.addButton]}),actionsSlot:`account-actions`}),(0,X.jsxs)(`div`,{className:`settings-account-meta`,children:[x,b?(0,X.jsx)(`div`,{className:`settings-account-actions`,children:b}):null]})]}):(0,X.jsxs)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`settings-account-line`,children:[x,(0,X.jsxs)(`div`,{"data-slot":`account-actions`,className:`settings-account-actions`,children:[p,b]})]})}function Pe({account:e,onRemove:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(e.label),o=y();return(0,X.jsx)(X.Fragment,{children:e.isDefault?null:(0,X.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{type:`text`,autoFocus:!0,"aria-label":`Name for ${e.label}`,"data-slot":`account-rename-input`,value:i,onChange:e=>a(e.target.value),className:`w-48 rounded-md border border-input bg-card px-2 py-1 text-xs outline-none focus-visible:border-ring`}),(0,X.jsx)(D,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>h(e.message,{tone:`danger`})}),children:`Save`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{Se as GlobalAgentsSection};
|