@hearsay-tools/squawk 0.18.0-pr4290.8322 → 0.18.0-pr4298.8332
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/core/runner-definition.d.ts +2 -2
- package/dist/delegation/transport.d.ts +65 -65
- package/{scripts → dist/runners/omp}/omp-ci-wait.mjs +14 -6
- package/dist/runners/omp/omp-runner.js +4 -13
- package/dist/runners/omp/omp-runner.js.map +1 -1
- package/dist/runners/omp/omp-skill-catalog.d.ts +1 -1
- package/dist/runners/omp/omp-skill-catalog.js +1 -1
- package/dist/runners/omp/omp-skill-catalog.js.map +1 -1
- package/dist/runners/pi/extensions/pi-ci-wait.mjs +10 -0
- package/dist/runners/pi/pi-args.js +3 -3
- package/dist/runners/pi/pi-args.js.map +1 -1
- package/dist/runners/pi/pi-runner.js +6 -14
- package/dist/runners/pi/pi-runner.js.map +1 -1
- package/dist/runners/pi/pi-skill-catalog.d.ts +1 -1
- package/dist/runners/pi/pi-skill-catalog.js +1 -1
- package/dist/runners/pi/pi-skill-catalog.js.map +1 -1
- package/dist/runners/pi/runaway-reply.js +1 -1
- package/dist/runners/pi/runaway-reply.js.map +1 -1
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/models-routes.d.ts +13 -13
- package/dist/server/providers-routes.d.ts +59 -59
- package/dist/server/repo-routes.d.ts +21 -21
- package/dist/server/reports-api.d.ts +2 -2
- package/dist/server/server.d.ts +58 -58
- package/dist/server/workspace-routes.d.ts +84 -84
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-W7E0lJ_T.js → accounts-section-qnA3YX9G.js} +1 -1
- package/web/dist/assets/{activity-motion-CKC91fdO.js → activity-motion-wGHBuD_L.js} +1 -1
- package/web/dist/assets/{activity-route-BMKRcZZz.js → activity-route-BhT-npje.js} +1 -1
- package/web/dist/assets/agent-config-section-BIkW506A.js +4 -0
- package/web/dist/assets/agent-defaults-section-D9oxRh7t.js +1 -0
- package/web/dist/assets/{appearance-DgNRb9F9.js → appearance-CipbKN5k.js} +1 -1
- package/web/dist/assets/{automations-route-Bgp_2Y8z.js → automations-route-DKKwkBjL.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-DEXRRtL1.js → commit-diff-panel-OqVigspU.js} +1 -1
- package/web/dist/assets/{diff-TSXSey_i.js → diff-CpkjO5Q-.js} +2 -2
- package/web/dist/assets/{diff-view-COAB2s1Z.js → diff-view-D6QC4z_i.js} +1 -1
- package/web/dist/assets/{file-preview-BgnwLTzh.js → file-preview-C-oYrG0r.js} +1 -1
- package/web/dist/assets/{git-toolbar-DKexH2FX.js → git-toolbar-BiWUXSvy.js} +1 -1
- package/web/dist/assets/{github-CdzkHkDn.js → github-DSZtAYK0.js} +1 -1
- package/web/dist/assets/{global-activity-route-Cfb8uAU1.js → global-activity-route-ylV7sfQb.js} +1 -1
- package/web/dist/assets/{index-DgdiXHgV.js → index-CS5yyNbo.js} +5 -5
- package/web/dist/assets/{markdown-Dj9PnU5f.js → markdown-Drj1MCd_.js} +1 -1
- package/web/dist/assets/{notifications-section-DCf8tYi9.js → notifications-section-BNncS89W.js} +1 -1
- package/web/dist/assets/preview-pane-connected-C9bYs_nr.js +3 -0
- package/web/dist/assets/{projects-section-C-ji_9Jb.js → projects-section-DAyPYxaB.js} +1 -1
- package/web/dist/assets/prompt-templates-section-BUTjHN-R.js +1 -0
- package/web/dist/assets/{remote-settings-notice-D12kO_fx.js → remote-settings-notice-BTtluTx2.js} +1 -1
- package/web/dist/assets/{repo-git-BnR84_ZF.js → repo-git-CahuM1Bi.js} +1 -1
- package/web/dist/assets/{report-reader-DFeUVrVf.js → report-reader-BMw7TyID.js} +1 -1
- package/web/dist/assets/{reports-DeGJ_TQv.js → reports-BqhgWSM-.js} +1 -1
- package/web/dist/assets/resources-section-CPdErsDL.js +1 -0
- package/web/dist/assets/run-header-BpdSJ6lc.js +2 -0
- package/web/dist/assets/saved-draft-BwzBc-_Y.js +1 -0
- package/web/dist/assets/{settings-agent-picker-2lOzGfbc.js → settings-agent-picker-By-EZVYH.js} +1 -1
- package/web/dist/assets/settings-shell-Cg1j_HUU.js +1 -0
- package/web/dist/assets/sidebar-section-C7mKySo9.js +1 -0
- package/web/dist/assets/{skills-C1g3oBTx.js → skills-DL6gTurZ.js} +1 -1
- package/web/dist/assets/{task-changes-AWps2X1w.js → task-changes-BYdPYqmr.js} +1 -1
- package/web/dist/assets/{task-commits-DjUZYIvx.js → task-commits-CZs64PxA.js} +1 -1
- package/web/dist/assets/{task-files-xW_ZlA4N.js → task-files-CHDvZdch.js} +1 -1
- package/web/dist/assets/{task-github-item-QsIE8qBm.js → task-github-item-BaAS8tc7.js} +1 -1
- package/web/dist/assets/{task-thread-19WlI5jh.js → task-thread-DKTYTRYk.js} +6 -6
- package/web/dist/assets/{thread-state-Bno0d7IG.js → thread-state-Cnu6irf1.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-DGPBUUma.js → use-hand-to-agent-state-C0HmC08K.js} +1 -1
- package/web/dist/assets/{workflows-LoZzQln6.js → workflows-BxrHkrIx.js} +3 -3
- package/web/dist/assets/{workspace-tools-885o7YQC.js → workspace-tools-DK0GgizV.js} +1 -1
- package/web/dist/assets/worktrees-section-CBWXq2mc.js +4 -0
- package/web/dist/index.html +1 -1
- package/scripts/pi-ci-wait.mjs +0 -7
- package/scripts/pi-runaway-reply-guard.d.mts +0 -3
- package/web/dist/assets/agent-config-section-L-WUv_Sg.js +0 -4
- package/web/dist/assets/agent-defaults-section-BNy5LuYr.js +0 -1
- package/web/dist/assets/preview-pane-connected-BuS799XB.js +0 -3
- package/web/dist/assets/prompt-templates-section-pKPXaO18.js +0 -1
- package/web/dist/assets/resources-section-CKfUOEMU.js +0 -1
- package/web/dist/assets/run-header-sYd-snDr.js +0 -2
- package/web/dist/assets/settings-shell-Cd_zkHHS.js +0 -1
- package/web/dist/assets/sidebar-section-CrCVthxb.js +0 -1
- package/web/dist/assets/worktrees-section-ORq1CrNd.js +0 -4
- /package/{scripts → dist/runners/pi/extensions}/pi-default-tools.mjs +0 -0
- /package/{scripts → dist/runners/pi/extensions}/pi-project-skills.mjs +0 -0
- /package/{scripts → dist/runners/pi/extensions}/pi-retry-degraded-service.mjs +0 -0
- /package/{scripts → dist/runners/pi/extensions}/pi-runaway-reply-guard.mjs +0 -0
package/dist/server/server.d.ts
CHANGED
|
@@ -4652,19 +4652,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
4652
4652
|
} & {
|
|
4653
4653
|
"/repo/commit/:sha": {
|
|
4654
4654
|
$get: {
|
|
4655
|
-
output: string;
|
|
4656
|
-
outputFormat: "text";
|
|
4657
|
-
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
4658
|
-
input: {
|
|
4659
|
-
query: {
|
|
4660
|
-
structured?: string | undefined;
|
|
4661
|
-
};
|
|
4662
|
-
} & {
|
|
4663
|
-
param: {
|
|
4664
|
-
sha: string;
|
|
4665
|
-
};
|
|
4666
|
-
};
|
|
4667
|
-
} | {
|
|
4668
4655
|
output: {
|
|
4669
4656
|
error: string;
|
|
4670
4657
|
code?: "invalid_input" | undefined;
|
|
@@ -4728,6 +4715,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
4728
4715
|
sha: string;
|
|
4729
4716
|
};
|
|
4730
4717
|
};
|
|
4718
|
+
} | {
|
|
4719
|
+
output: string;
|
|
4720
|
+
outputFormat: "text";
|
|
4721
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
4722
|
+
input: {
|
|
4723
|
+
query: {
|
|
4724
|
+
structured?: string | undefined;
|
|
4725
|
+
};
|
|
4726
|
+
} & {
|
|
4727
|
+
param: {
|
|
4728
|
+
sha: string;
|
|
4729
|
+
};
|
|
4730
|
+
};
|
|
4731
4731
|
};
|
|
4732
4732
|
};
|
|
4733
4733
|
} & {
|
|
@@ -19195,20 +19195,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
19195
19195
|
} & {
|
|
19196
19196
|
"/runs/:id/handoff": {
|
|
19197
19197
|
$get: {
|
|
19198
|
-
output:
|
|
19199
|
-
|
|
19200
|
-
|
|
19198
|
+
output: {
|
|
19199
|
+
error: string;
|
|
19200
|
+
};
|
|
19201
|
+
outputFormat: "json";
|
|
19202
|
+
status: 404;
|
|
19201
19203
|
input: {
|
|
19202
19204
|
param: {
|
|
19203
19205
|
id: string;
|
|
19204
19206
|
};
|
|
19205
19207
|
};
|
|
19206
19208
|
} | {
|
|
19207
|
-
output:
|
|
19208
|
-
|
|
19209
|
-
|
|
19210
|
-
outputFormat: "json";
|
|
19211
|
-
status: 404;
|
|
19209
|
+
output: string;
|
|
19210
|
+
outputFormat: "text";
|
|
19211
|
+
status: 200;
|
|
19212
19212
|
input: {
|
|
19213
19213
|
param: {
|
|
19214
19214
|
id: string;
|
|
@@ -19246,20 +19246,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
19246
19246
|
} & {
|
|
19247
19247
|
"/runs/:id/diff": {
|
|
19248
19248
|
$get: {
|
|
19249
|
-
output:
|
|
19250
|
-
|
|
19251
|
-
|
|
19249
|
+
output: {
|
|
19250
|
+
error: string;
|
|
19251
|
+
};
|
|
19252
|
+
outputFormat: "json";
|
|
19253
|
+
status: 404 | 409;
|
|
19252
19254
|
input: {
|
|
19253
19255
|
param: {
|
|
19254
19256
|
id: string;
|
|
19255
19257
|
};
|
|
19256
19258
|
};
|
|
19257
19259
|
} | {
|
|
19258
|
-
output:
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
outputFormat: "json";
|
|
19262
|
-
status: 404 | 409;
|
|
19260
|
+
output: string;
|
|
19261
|
+
outputFormat: "text";
|
|
19262
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
19263
19263
|
input: {
|
|
19264
19264
|
param: {
|
|
19265
19265
|
id: string;
|
|
@@ -21306,19 +21306,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
21306
21306
|
} & {
|
|
21307
21307
|
"/repo/commit/:sha": {
|
|
21308
21308
|
$get: {
|
|
21309
|
-
output: string;
|
|
21310
|
-
outputFormat: "text";
|
|
21311
|
-
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
21312
|
-
input: {
|
|
21313
|
-
query: {
|
|
21314
|
-
structured?: string | undefined;
|
|
21315
|
-
};
|
|
21316
|
-
} & {
|
|
21317
|
-
param: {
|
|
21318
|
-
sha: string;
|
|
21319
|
-
};
|
|
21320
|
-
};
|
|
21321
|
-
} | {
|
|
21322
21309
|
output: {
|
|
21323
21310
|
error: string;
|
|
21324
21311
|
code?: "invalid_input" | undefined;
|
|
@@ -21382,6 +21369,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
21382
21369
|
sha: string;
|
|
21383
21370
|
};
|
|
21384
21371
|
};
|
|
21372
|
+
} | {
|
|
21373
|
+
output: string;
|
|
21374
|
+
outputFormat: "text";
|
|
21375
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
21376
|
+
input: {
|
|
21377
|
+
query: {
|
|
21378
|
+
structured?: string | undefined;
|
|
21379
|
+
};
|
|
21380
|
+
} & {
|
|
21381
|
+
param: {
|
|
21382
|
+
sha: string;
|
|
21383
|
+
};
|
|
21384
|
+
};
|
|
21385
21385
|
};
|
|
21386
21386
|
};
|
|
21387
21387
|
} & {
|
|
@@ -35849,20 +35849,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
35849
35849
|
} & {
|
|
35850
35850
|
"/runs/:id/handoff": {
|
|
35851
35851
|
$get: {
|
|
35852
|
-
output:
|
|
35853
|
-
|
|
35854
|
-
|
|
35852
|
+
output: {
|
|
35853
|
+
error: string;
|
|
35854
|
+
};
|
|
35855
|
+
outputFormat: "json";
|
|
35856
|
+
status: 404;
|
|
35855
35857
|
input: {
|
|
35856
35858
|
param: {
|
|
35857
35859
|
id: string;
|
|
35858
35860
|
};
|
|
35859
35861
|
};
|
|
35860
35862
|
} | {
|
|
35861
|
-
output:
|
|
35862
|
-
|
|
35863
|
-
|
|
35864
|
-
outputFormat: "json";
|
|
35865
|
-
status: 404;
|
|
35863
|
+
output: string;
|
|
35864
|
+
outputFormat: "text";
|
|
35865
|
+
status: 200;
|
|
35866
35866
|
input: {
|
|
35867
35867
|
param: {
|
|
35868
35868
|
id: string;
|
|
@@ -35900,20 +35900,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
|
|
|
35900
35900
|
} & {
|
|
35901
35901
|
"/runs/:id/diff": {
|
|
35902
35902
|
$get: {
|
|
35903
|
-
output:
|
|
35904
|
-
|
|
35905
|
-
|
|
35903
|
+
output: {
|
|
35904
|
+
error: string;
|
|
35905
|
+
};
|
|
35906
|
+
outputFormat: "json";
|
|
35907
|
+
status: 404 | 409;
|
|
35906
35908
|
input: {
|
|
35907
35909
|
param: {
|
|
35908
35910
|
id: string;
|
|
35909
35911
|
};
|
|
35910
35912
|
};
|
|
35911
35913
|
} | {
|
|
35912
|
-
output:
|
|
35913
|
-
|
|
35914
|
-
|
|
35915
|
-
outputFormat: "json";
|
|
35916
|
-
status: 404 | 409;
|
|
35914
|
+
output: string;
|
|
35915
|
+
outputFormat: "text";
|
|
35916
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
35917
35917
|
input: {
|
|
35918
35918
|
param: {
|
|
35919
35919
|
id: string;
|
|
@@ -51,34 +51,10 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
|
|
|
51
51
|
"/workspace/config": {
|
|
52
52
|
$put: {
|
|
53
53
|
output: {
|
|
54
|
-
|
|
55
|
-
projectsDir: string;
|
|
56
|
-
archiveOnMerge: boolean | null;
|
|
57
|
-
effectiveArchiveOnMerge: boolean;
|
|
58
|
-
archiveOnMergeSource: "default" | "environment" | "global";
|
|
59
|
-
composerDefaults: {
|
|
60
|
-
autonomous: boolean | null;
|
|
61
|
-
worktree: boolean | null;
|
|
62
|
-
inheritedAutonomous: "source-dependent" | boolean;
|
|
63
|
-
inheritedWorktree: boolean;
|
|
64
|
-
};
|
|
65
|
-
resources: {
|
|
66
|
-
maxParallel: number;
|
|
67
|
-
maxMonitoringSessions: number;
|
|
68
|
-
monitoringWakeIntervalMinutes: number | null;
|
|
69
|
-
autoResumeOnUsageLimit: boolean;
|
|
70
|
-
memoryLimitMb: number | null;
|
|
71
|
-
worktreeRetentionDefault: number;
|
|
72
|
-
};
|
|
73
|
-
agentDefaults: {
|
|
74
|
-
runner?: string | undefined;
|
|
75
|
-
models?: {
|
|
76
|
-
[x: string]: string | undefined;
|
|
77
|
-
} | undefined;
|
|
78
|
-
};
|
|
54
|
+
error: string;
|
|
79
55
|
};
|
|
80
56
|
outputFormat: "json";
|
|
81
|
-
status:
|
|
57
|
+
status: 400;
|
|
82
58
|
input: {
|
|
83
59
|
json: {
|
|
84
60
|
browseRoot?: string | undefined;
|
|
@@ -107,7 +83,7 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
|
|
|
107
83
|
error: string;
|
|
108
84
|
};
|
|
109
85
|
outputFormat: "json";
|
|
110
|
-
status:
|
|
86
|
+
status: 500;
|
|
111
87
|
input: {
|
|
112
88
|
json: {
|
|
113
89
|
browseRoot?: string | undefined;
|
|
@@ -133,10 +109,34 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
|
|
|
133
109
|
};
|
|
134
110
|
} | {
|
|
135
111
|
output: {
|
|
136
|
-
|
|
112
|
+
browseRoot: string;
|
|
113
|
+
projectsDir: string;
|
|
114
|
+
archiveOnMerge: boolean | null;
|
|
115
|
+
effectiveArchiveOnMerge: boolean;
|
|
116
|
+
archiveOnMergeSource: "default" | "environment" | "global";
|
|
117
|
+
composerDefaults: {
|
|
118
|
+
autonomous: boolean | null;
|
|
119
|
+
worktree: boolean | null;
|
|
120
|
+
inheritedAutonomous: "source-dependent" | boolean;
|
|
121
|
+
inheritedWorktree: boolean;
|
|
122
|
+
};
|
|
123
|
+
resources: {
|
|
124
|
+
maxParallel: number;
|
|
125
|
+
maxMonitoringSessions: number;
|
|
126
|
+
monitoringWakeIntervalMinutes: number | null;
|
|
127
|
+
autoResumeOnUsageLimit: boolean;
|
|
128
|
+
memoryLimitMb: number | null;
|
|
129
|
+
worktreeRetentionDefault: number;
|
|
130
|
+
};
|
|
131
|
+
agentDefaults: {
|
|
132
|
+
runner?: string | undefined;
|
|
133
|
+
models?: {
|
|
134
|
+
[x: string]: string | undefined;
|
|
135
|
+
} | undefined;
|
|
136
|
+
};
|
|
137
137
|
};
|
|
138
138
|
outputFormat: "json";
|
|
139
|
-
status:
|
|
139
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
140
140
|
input: {
|
|
141
141
|
json: {
|
|
142
142
|
browseRoot?: string | undefined;
|
|
@@ -208,41 +208,10 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
|
|
|
208
208
|
"/workspace/ui-state": {
|
|
209
209
|
$put: {
|
|
210
210
|
output: {
|
|
211
|
-
|
|
212
|
-
sidebar?: {
|
|
213
|
-
[x: string]: import("hono/utils/types").JSONValue;
|
|
214
|
-
collapsed?: {
|
|
215
|
-
[x: string]: boolean;
|
|
216
|
-
} | undefined;
|
|
217
|
-
projectOrder?: string[] | undefined;
|
|
218
|
-
} | undefined;
|
|
219
|
-
dismissedProviderAuthFailures?: {
|
|
220
|
-
[x: string]: string | undefined;
|
|
221
|
-
} | undefined;
|
|
222
|
-
appearance?: {
|
|
223
|
-
accent?: "cezarion" | "lime" | "violet" | undefined;
|
|
224
|
-
density?: "comfortable" | "compact" | "ultra" | undefined;
|
|
225
|
-
width?: "narrow" | "wide" | undefined;
|
|
226
|
-
} | undefined;
|
|
227
|
-
notifications?: {
|
|
228
|
-
[x: string]: import("hono/utils/types").JSONValue;
|
|
229
|
-
enabled?: boolean | undefined;
|
|
230
|
-
} | undefined;
|
|
231
|
-
taskTable?: {
|
|
232
|
-
[x: string]: import("hono/utils/types").JSONValue;
|
|
233
|
-
expandedColumns?: {
|
|
234
|
-
[x: string]: boolean;
|
|
235
|
-
} | undefined;
|
|
236
|
-
} | undefined;
|
|
237
|
-
lastLocation?: {
|
|
238
|
-
projectId: string;
|
|
239
|
-
pathname: string;
|
|
240
|
-
search?: string | undefined;
|
|
241
|
-
hash?: string | undefined;
|
|
242
|
-
} | undefined;
|
|
211
|
+
error: string;
|
|
243
212
|
};
|
|
244
213
|
outputFormat: "json";
|
|
245
|
-
status:
|
|
214
|
+
status: 500;
|
|
246
215
|
input: {
|
|
247
216
|
json: {
|
|
248
217
|
[x: string]: unknown;
|
|
@@ -275,10 +244,41 @@ export declare function createWorkspaceConfigRoutes(deps: WorkspaceConfigRouteDe
|
|
|
275
244
|
};
|
|
276
245
|
} | {
|
|
277
246
|
output: {
|
|
278
|
-
|
|
247
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
248
|
+
sidebar?: {
|
|
249
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
250
|
+
collapsed?: {
|
|
251
|
+
[x: string]: boolean;
|
|
252
|
+
} | undefined;
|
|
253
|
+
projectOrder?: string[] | undefined;
|
|
254
|
+
} | undefined;
|
|
255
|
+
dismissedProviderAuthFailures?: {
|
|
256
|
+
[x: string]: string | undefined;
|
|
257
|
+
} | undefined;
|
|
258
|
+
appearance?: {
|
|
259
|
+
accent?: "cezarion" | "lime" | "violet" | undefined;
|
|
260
|
+
density?: "comfortable" | "compact" | "ultra" | undefined;
|
|
261
|
+
width?: "narrow" | "wide" | undefined;
|
|
262
|
+
} | undefined;
|
|
263
|
+
notifications?: {
|
|
264
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
265
|
+
enabled?: boolean | undefined;
|
|
266
|
+
} | undefined;
|
|
267
|
+
taskTable?: {
|
|
268
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
269
|
+
expandedColumns?: {
|
|
270
|
+
[x: string]: boolean;
|
|
271
|
+
} | undefined;
|
|
272
|
+
} | undefined;
|
|
273
|
+
lastLocation?: {
|
|
274
|
+
projectId: string;
|
|
275
|
+
pathname: string;
|
|
276
|
+
search?: string | undefined;
|
|
277
|
+
hash?: string | undefined;
|
|
278
|
+
} | undefined;
|
|
279
279
|
};
|
|
280
280
|
outputFormat: "json";
|
|
281
|
-
status:
|
|
281
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
282
282
|
input: {
|
|
283
283
|
json: {
|
|
284
284
|
[x: string]: unknown;
|
|
@@ -329,10 +329,17 @@ export declare function createFsBrowseRoutes(workspaceBrowseRoot: () => Promise<
|
|
|
329
329
|
};
|
|
330
330
|
} | {
|
|
331
331
|
output: {
|
|
332
|
-
|
|
332
|
+
path: string;
|
|
333
|
+
parent: string | null;
|
|
334
|
+
dirs: {
|
|
335
|
+
name: string;
|
|
336
|
+
path: string;
|
|
337
|
+
isRepo: boolean;
|
|
338
|
+
}[];
|
|
339
|
+
truncated: boolean;
|
|
333
340
|
};
|
|
334
341
|
outputFormat: "json";
|
|
335
|
-
status:
|
|
342
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
336
343
|
input: {
|
|
337
344
|
query: {
|
|
338
345
|
path?: string | undefined;
|
|
@@ -341,17 +348,10 @@ export declare function createFsBrowseRoutes(workspaceBrowseRoot: () => Promise<
|
|
|
341
348
|
};
|
|
342
349
|
} | {
|
|
343
350
|
output: {
|
|
344
|
-
|
|
345
|
-
parent: string | null;
|
|
346
|
-
dirs: {
|
|
347
|
-
name: string;
|
|
348
|
-
path: string;
|
|
349
|
-
isRepo: boolean;
|
|
350
|
-
}[];
|
|
351
|
-
truncated: boolean;
|
|
351
|
+
error: string;
|
|
352
352
|
};
|
|
353
353
|
outputFormat: "json";
|
|
354
|
-
status:
|
|
354
|
+
status: 400 | 403 | 404;
|
|
355
355
|
input: {
|
|
356
356
|
query: {
|
|
357
357
|
path?: string | undefined;
|
|
@@ -370,15 +370,6 @@ export interface WorkspaceEventsRouteDeps {
|
|
|
370
370
|
export declare function createWorkspaceEventsRoutes(deps: WorkspaceEventsRouteDeps): import("hono/hono-base").HonoBase<ProjectApiEnv, {
|
|
371
371
|
"/workspace/events": {
|
|
372
372
|
$get: {
|
|
373
|
-
output: {};
|
|
374
|
-
outputFormat: string;
|
|
375
|
-
status: import("hono/utils/http-status").StatusCode;
|
|
376
|
-
input: {
|
|
377
|
-
query: {
|
|
378
|
-
runs?: "summary" | undefined;
|
|
379
|
-
};
|
|
380
|
-
};
|
|
381
|
-
} | {
|
|
382
373
|
output: {
|
|
383
374
|
error: string;
|
|
384
375
|
code?: "invalid_input" | undefined;
|
|
@@ -390,6 +381,15 @@ export declare function createWorkspaceEventsRoutes(deps: WorkspaceEventsRouteDe
|
|
|
390
381
|
runs?: "summary" | undefined;
|
|
391
382
|
};
|
|
392
383
|
};
|
|
384
|
+
} | {
|
|
385
|
+
output: {};
|
|
386
|
+
outputFormat: string;
|
|
387
|
+
status: import("hono/utils/http-status").StatusCode;
|
|
388
|
+
input: {
|
|
389
|
+
query: {
|
|
390
|
+
runs?: "summary" | undefined;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
393
|
};
|
|
394
394
|
};
|
|
395
395
|
}, "/", "/workspace/events">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hearsay-tools/squawk",
|
|
3
|
-
"version": "0.18.0-
|
|
3
|
+
"version": "0.18.0-pr4298.8332",
|
|
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",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@babel/parser": "^8.0.8",
|
|
70
70
|
"@babel/types": "^8.0.8",
|
|
71
|
-
"@open-mercato/cezar-api-client": "0.18.0-
|
|
72
|
-
"@open-mercato/cezar-contract": "0.18.0-
|
|
71
|
+
"@open-mercato/cezar-api-client": "0.18.0-pr4298.8332",
|
|
72
|
+
"@open-mercato/cezar-contract": "0.18.0-pr4298.8332",
|
|
73
73
|
"@types/node": "^24.19.1",
|
|
74
74
|
"@types/ws": "^8.18.1",
|
|
75
75
|
"esbuild": "^0.28.1",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "899dcae72276c86309b43ae7c097be6dab7a140d"
|
|
90
90
|
}
|
|
@@ -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{An as r,Ar as i,Pn as a,ci as o,jn as s,nn as c}from"./project-scope-context-d3J3hWPR.js";import{$t as l,Ct as u,Gt as d,Ht as f,Kt as p,Mt as m,Rt as h,Ut as g,Xt as _,bt as v,ht as y,in as b,kt as x,lt as S,ot as C,st as w,ut as ee,yt as te}from"./queries-dnpdX9VT.js";import{t as ne}from"./useQuery-CkUPLiaa.js";import{f as T}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as E}from"./toaster-Bo5vCbz-.js";import{y as D}from"./design-icons-CzEoMH9c.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as k}from"./folder-browser-DJd_sQFq.js";import{t as A}from"./button-BQ2y4XRB.js";import{t as j}from"./badge-D9JrXe0o.js";import{a as M,i as N,o as P,r as F,s as I,t as L}from"./dialog-BVF6dIeS.js";import{t as R}from"./status-dot-DtAOFiIi.js";import{n as z}from"./agents-settings-path-7X6_cvUg.js";import{t as B}from"./centered-state-V15AR_qo.js";import{Gt as V,Ht as H,Jt as U,Kt as W,N as G,Ut as K,Vt as q,Wt as J,j as re,qt as Y}from"./index-DgdiXHgV.js";import{n as X,r as ie,t as ae}from"./settings-agent-picker-2lOzGfbc.js";var oe=O(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Z=e(t(),1),Q=n(),se=`~/.claude-second`;function ce({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=_().data,[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(r??n[0]??`claude`),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,v]=(0,Z.useState)(!1),y=ee(),b=m.trim();return(0,Q.jsx)(L,{open:e,onOpenChange:t,children:(0,Q.jsxs)(F,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,Q.jsxs)(P,{children:[(0,Q.jsx)(I,{children:`Add agent account`}),(0,Q.jsx)(N,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,Q.jsx)(`select`,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:l,onChange:e=>u(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,Q.jsx)(`option`,{value:e,children:e},e))})]}),(0,Q.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,Q.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:f,placeholder:`Work`,onChange:e=>p(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,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,Q.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:m,placeholder:d(i,l)?.accountFolderExample??se,onChange:e=>{h(e.target.value),c(null),y.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,Q.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":g,onClick:()=>v(e=>!e),children:g?`Hide folders`:`Browse…`})]}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-soft-foreground`,children:[`A `,(0,Q.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),g?(0,Q.jsx)(k,{path:a,selected:s,onSelect:e=>{c(e),h(e.path),y.reset()},onEnter:e=>{o(e),c(null),y.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,y.isError?(0,Q.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:y.error instanceof Error?y.error.message:`could not add that folder`}):null,(0,Q.jsxs)(M,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,Q.jsx)(A,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,Q.jsx)(A,{"data-slot":`add-account-confirm`,disabled:b===``||y.isPending,onClick:()=>{b===``||y.isPending||y.mutate({provider:l,configDir:b,...f.trim()?{label:f.trim()}:{}},{onSuccess:()=>{t(!1),p(``),h(``),c(null),v(!1),E(`Account added — use Connect to sign in`)}})},children:y.isPending?`Adding…`:`Add account`})]})]})})}async function le(e){return a(await s.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ue(e,t){return a(await s.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var de={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function fe(e){let t=y().data?.capabilities?.settingsAdmin===!0,n=o(),r=[`runner-install`,e],i=ne({queryKey:r,queryFn:()=>le(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=>ue(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),s=i.data;return{allowed:t,data:s,busy:a.isPending||!!s&&s.phase!==`idle`&&s.phase!==`failed`,error:a.error?.message??i.error?.message??s?.error,action:a,status:i}}function pe({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,Q.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function $({runner:e}){let t=fe(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,Q.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,Q.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?` · ${de[r.phase]}`:``]}),a?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,Q.jsx)(pe,{state:t}),r?.installedVersion?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var me={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 he(){let e=w(),t=_();if(e.isPending||t.isPending)return(0,Q.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,Q.jsx)(B,{icon:(0,Q.jsx)(oe,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,Q.jsx)(_e,{data:e.data,runners:t.data})}function ge(){let{hash:e}=T();(0,Z.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function _e({data:e,runners:t}){let n=y(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),s=u();return ge(),(0,Q.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,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Install, update and sign in to each agent, and set what a project runs when it has not chosen.`}),e.editable?null:(0,Q.jsx)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-soft-foreground`,children:`Agent accounts are managed from the machine that owns the checkout — this cockpit runs in hosted mode.`}),(0,Q.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-4`,children:t.runners.map(r=>(0,Q.jsx)(ye,{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,Q.jsx)(be,{runners:t}),r===null?null:(0,Q.jsx)(ce,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,Q.jsx)(q,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,Q.jsxs)(J,{"data-slot":`accounts-remove-confirm`,children:[(0,Q.jsxs)(Y,{children:[(0,Q.jsxs)(U,{children:[`Remove “`,a?.label,`”?`]}),(0,Q.jsxs)(V,{children:[`This only forgets the account. Nothing in `,a?.configDir,` 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,Q.jsxs)(W,{children:[(0,Q.jsx)(K,{children:`Cancel`}),(0,Q.jsx)(H,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),E(`Removed ${e.label}`)},onError:e=>E(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function ve({entry:e,check:t}){return t===void 0?(0,Q.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking…`}):t.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"data-slot":`agent-installed`,children:`Installed`}),t.version?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,Q.jsx)(`span`,{"data-slot":`agent-version`,children:t.version})]}):null]}):(0,Q.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`Not installed`,e.installHint?(0,Q.jsxs)(Q.Fragment,{children:[` — `,(0,Q.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}function ye({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.managedInstall===!0&&n,d=a.filter(e=>e.isDefault).length,f=`${z(l)}-title`;return(0,Q.jsxs)(`section`,{id:z(l),tabIndex:-1,"aria-labelledby":f,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col gap-4 rounded-lg border border-border bg-card p-4`,children:[(0,Q.jsx)(`h3`,{id:f,className:`settings-account-provider-title`,children:e.displayName}),u?(0,Q.jsx)($,{runner:l}):null,(0,Q.jsxs)(`div`,{className:`settings-account-installation settings-readout`,children:[u?null:(0,Q.jsx)(ve,{entry:e,check:t}),i?(0,Q.jsxs)(`span`,{className:`settings-account-count`,children:[a.length,` `,a.length===1?`account`:`accounts`,` (`,d,` discovered, `,a.length-d,` added)`]}):null]}),i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`ul`,{children:a.map(e=>(0,Q.jsx)(Ce,{account:e,runners:r,onRemove:()=>c(e)},e.id))}),o?(0,Q.jsx)(`div`,{className:`settings-account-add-row`,children:(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`})}):(0,Q.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`text-[11px] text-soft-foreground`,children:[e.displayName,` can only hold one account here: it keeps its credentials outside its config folder, so a second folder would change settings without changing the login — which would say “work account” while billing the other one.`]})]}):e.browserLogin?(0,Q.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Discovered account`}),(0,Q.jsx)(X,{provider:l,label:e.displayName})]}):null]})}function be({runners:e}){let[t,n]=(0,Z.useState)(null),r=o(),i=m(),a=te(),s=l(p(e)),u=b({mutationFn:e=>c(e),onSuccess:e=>r.setQueryData(h.config,e),onError:e=>E(e.message,{tone:`danger`})});if(i.data===void 0)return null;let d=ie([],e),g=i.data.agentDefaults.runner??`claude`,_=f(t??g,p(e))??t??g,v=i.data.agentDefaults.models??{};return(0,Q.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,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,Q.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,Q.jsx)(ae,{rows:d,runner:g,accountFor:()=>null,providerStatus:a,disabled:u.isPending,onPick:e=>{e!==g&&u.mutate({agentDefaults:{runner:e}})}}),(0,Q.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,Q.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,Q.jsx)(`span`,{children:`Default model for`}),(0,Q.jsx)(`select`,{"aria-label":`Model agent`,value:_,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===_).map(t=>(0,Q.jsxs)(`label`,{className:`settings-account-model flex items-center gap-3`,children:[(0,Q.jsx)(D,{className:`size-4 text-accent-icon shrink-0`}),(0,Q.jsx)(`span`,{className:`w-24 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,Q.jsxs)(`select`,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:v[t.id]??``,disabled:u.isPending,onChange:e=>u.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-full max-w-xs 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:[G(t.id,e,s[t.id]?.data,[v[t.id]]).map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,Q.jsx)(xe,{runner:t.id,runners:e,catalog:s[t.id]})]})]},t.id))]})]})}function xe({runner:e,runners:t,catalog:n}){let r=re(e,t,n);return r?(0,Q.jsx)(`option`,{disabled:!0,children:r}):null}function Se({account:e,runners:t,status:n}){let i=S();return(0,Q.jsxs)(Q.Fragment,{children:[n&&n.status!==`connected`&&d(t,e.provider)?.browserLogin?(0,Q.jsx)(X,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,n&&n.status!==`connected`&&d(t,e.provider)?.terminalLogin!==!1?(0,Q.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:i.isPending,onClick:()=>i.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>E(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>E(e instanceof r&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ce({account:e,runners:t,onRemove:n}){let r=i(e),a=v(),o=C(r,e.status===void 0),s=e.status??o.data?.status,c=s?me[s.status]:void 0;return(0,Q.jsx)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`flex flex-col gap-2 px-3.5 py-3`,children:(0,Q.jsxs)(`div`,{className:`settings-account-card`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-[13px] font-medium text-foreground`,children:e.label}),e.isDefault?(0,Q.jsx)(j,{variant:`ghost`,className:`shrink-0 text-[12px] text-muted-foreground`,children:`discovered`}):null]}),(0,Q.jsxs)(`div`,{className:`settings-account-readout settings-readout`,children:[(0,Q.jsx)(`p`,{"data-slot":`account-path`,className:`mt-0.5 truncate font-mono text-[11px] text-soft-foreground`,title:e.path,children:e.configDir}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(R,{tone:c?.tone??`neutral`,pulse:c===void 0}),(0,Q.jsx)(`span`,{"data-slot":`account-status`,children:c?.label??`Checking…`}),!s||s.requiresAccountHome===!1?null:e.exists?e.looksValid?null:(0,Q.jsxs)(`span`,{"data-slot":`account-unrecognised`,children:[`— this folder does not look like `,g(t,e.provider),` config yet`]}):(0,Q.jsx)(`span`,{"data-slot":`account-missing`,children:`— folder not created yet; Connect will make it`})]}),s?.hint?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s.hint}):null]})]}),(0,Q.jsxs)(`div`,{className:`settings-account-actions`,children:[(0,Q.jsx)(Se,{account:e,runners:t,status:s}),(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:a.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>a.mutate(r,{onError:e=>E(e.message,{tone:`danger`})}),children:`Check again`}),(0,Q.jsx)(we,{account:e,onRemove:n})]})]})})}function we({account:e,onRemove:t}){let[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(e.label),o=x();return(0,Q.jsx)(Q.Fragment,{children:e.isDefault?null:(0,Q.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.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,Q.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>E(e.message,{tone:`danger`})}),children:`Save`}),(0,Q.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{he 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{An as r,Ar as i,Pn as a,ci as o,jn as s,nn as c}from"./project-scope-context-d3J3hWPR.js";import{$t as l,Ct as u,Gt as d,Ht as f,Kt as p,Mt as m,Rt as h,Ut as g,Xt as _,bt as v,ht as y,in as b,kt as x,lt as S,ot as C,st as w,ut as ee,yt as te}from"./queries-dnpdX9VT.js";import{t as ne}from"./useQuery-CkUPLiaa.js";import{f as T}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as E}from"./toaster-Bo5vCbz-.js";import{y as D}from"./design-icons-CzEoMH9c.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as k}from"./folder-browser-DJd_sQFq.js";import{t as A}from"./button-BQ2y4XRB.js";import{t as j}from"./badge-D9JrXe0o.js";import{a as M,i as N,o as P,r as F,s as I,t as L}from"./dialog-BVF6dIeS.js";import{t as R}from"./status-dot-DtAOFiIi.js";import{n as z}from"./agents-settings-path-7X6_cvUg.js";import{t as B}from"./centered-state-V15AR_qo.js";import{Gt as V,Ht as H,Jt as U,Kt as W,N as G,Ut as K,Vt as q,Wt as J,j as re,qt as Y}from"./index-CS5yyNbo.js";import{n as X,r as ie,t as ae}from"./settings-agent-picker-By-EZVYH.js";var oe=O(`id-card`,[[`path`,{d:`M16 10h2`,key:`8sgtl7`}],[`path`,{d:`M16 14h2`,key:`epxaof`}],[`path`,{d:`M6.17 15a3 3 0 0 1 5.66 0`,key:`n6f512`}],[`circle`,{cx:`9`,cy:`11`,r:`2`,key:`yxgjnd`}],[`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`,key:`qneu4z`}]]),Z=e(t(),1),Q=n(),se=`~/.claude-second`;function ce({open:e,onOpenChange:t,providers:n,initialProvider:r}){let i=_().data,[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(r??n[0]??`claude`),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,v]=(0,Z.useState)(!1),y=ee(),b=m.trim();return(0,Q.jsx)(L,{open:e,onOpenChange:t,children:(0,Q.jsxs)(F,{"data-slot":`add-account-dialog`,className:`sm:max-w-lg`,children:[(0,Q.jsxs)(P,{children:[(0,Q.jsx)(I,{children:`Add agent account`}),(0,Q.jsx)(N,{children:`The config folder this account uses. It does not have to exist yet — Connect signs in and the CLI creates it.`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent`}),(0,Q.jsx)(`select`,{"aria-label":`Agent`,"data-slot":`add-account-provider`,value:l,onChange:e=>u(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,Q.jsx)(`option`,{value:e,children:e},e))})]}),(0,Q.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Name`}),(0,Q.jsx)(`input`,{type:`text`,"aria-label":`Account name`,"data-slot":`add-account-label`,value:f,placeholder:`Work`,onChange:e=>p(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,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`Folder`}),(0,Q.jsx)(`input`,{type:`text`,spellCheck:!1,autoComplete:`off`,"aria-label":`Config folder`,"data-slot":`add-account-dir`,value:m,placeholder:d(i,l)?.accountFolderExample??se,onChange:e=>{h(e.target.value),c(null),y.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,Q.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`add-account-browse`,"aria-expanded":g,onClick:()=>v(e=>!e),children:g?`Hide folders`:`Browse…`})]}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-soft-foreground`,children:[`A `,(0,Q.jsx)(`code`,{children:`~`}),` is kept as written and expanded when the agent runs.`]})]}),g?(0,Q.jsx)(k,{path:a,selected:s,onSelect:e=>{c(e),h(e.path),y.reset()},onEnter:e=>{o(e),c(null),y.reset()},showHidden:!0,emptyHint:`No subfolders here — pick this folder by typing its path above.`}):null,y.isError?(0,Q.jsx)(`p`,{"data-slot":`add-account-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:y.error instanceof Error?y.error.message:`could not add that folder`}):null,(0,Q.jsxs)(M,{className:`min-w-0 sm:items-center sm:justify-end`,children:[(0,Q.jsx)(A,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,Q.jsx)(A,{"data-slot":`add-account-confirm`,disabled:b===``||y.isPending,onClick:()=>{b===``||y.isPending||y.mutate({provider:l,configDir:b,...f.trim()?{label:f.trim()}:{}},{onSuccess:()=>{t(!1),p(``),h(``),c(null),v(!1),E(`Account added — use Connect to sign in`)}})},children:y.isPending?`Adding…`:`Add account`})]})]})})}async function le(e){return a(await s.api.v1[`runner-install`][`:runner`].$get({param:{runner:e}}),`/runner-install/:runner`)}async function ue(e,t){return a(await s.api.v1[`runner-install`][`:runner`].$post({param:{runner:e},json:{action:t}}),`/runner-install/:runner`)}var de={idle:``,checking:`Checking for updates…`,downloading:`Downloading CLI…`,verifying:`Verifying CLI…`,extracting:`Extracting CLI…`,activating:`Activating CLI…`,removing:`Removing CLI…`,failed:``};function fe(e){let t=y().data?.capabilities?.settingsAdmin===!0,n=o(),r=[`runner-install`,e],i=ne({queryKey:r,queryFn:()=>le(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=>ue(e,t),retry:!1,onSuccess:e=>{n.setQueryData(r,e)}}),s=i.data;return{allowed:t,data:s,busy:a.isPending||!!s&&s.phase!==`idle`&&s.phase!==`failed`,error:a.error?.message??i.error?.message??s?.error,action:a,status:i}}function pe({state:e}){let{data:t,busy:n,action:r,status:i}=e;if(t?.supported===!1)return(0,Q.jsx)(`p`,{children:`This host is not supported by the CLI installer.`});let a=!!t?.installedVersion;return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,disabled:n||!t,onClick:()=>r.mutate(a?`update`:`install`),children:a?`Update CLI`:`Install CLI`}),a?(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>r.mutate(`remove`),children:`Remove CLI`}):null,(0,Q.jsx)(A,{className:`min-h-11 active:opacity-80`,variant:`outline`,disabled:n,onClick:()=>{i.isError?i.refetch():r.mutate(`check`)},children:`Check for updates`})]})}function $({runner:e}){let t=fe(e),{allowed:n,data:r,busy:i,error:a}=t;return n?(0,Q.jsxs)(`section`,{"aria-label":`CLI installation`,className:`grid gap-3`,children:[(0,Q.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?` · ${de[r.phase]}`:``]}),a?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}):null,(0,Q.jsx)(pe,{state:t}),r?.installedVersion?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Removing the CLI keeps account data and lets running tasks finish.`}):null]}):null}var me={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 he(){let e=w(),t=_();if(e.isPending||t.isPending)return(0,Q.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,Q.jsx)(B,{icon:(0,Q.jsx)(oe,{}),tone:`danger`,title:`Agents did not load`,subtitle:n.message,heading:`h2`}):(0,Q.jsx)(_e,{data:e.data,runners:t.data})}function ge(){let{hash:e}=T();(0,Z.useEffect)(()=>{if(!e)return;let t=document.getElementById(decodeURIComponent(e.slice(1)));t&&(t.scrollIntoView?.({block:`start`}),t.focus({preventScroll:!0}))},[e])}function _e({data:e,runners:t}){let n=y(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),s=u();return ge(),(0,Q.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,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Install, update and sign in to each agent, and set what a project runs when it has not chosen.`}),e.editable?null:(0,Q.jsx)(`p`,{"data-slot":`accounts-hosted`,className:`text-[13px] text-soft-foreground`,children:`Agent accounts are managed from the machine that owns the checkout — this cockpit runs in hosted mode.`}),(0,Q.jsx)(`div`,{"data-slot":`agent-cards`,className:`flex flex-col gap-4`,children:t.runners.map(r=>(0,Q.jsx)(ye,{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,Q.jsx)(be,{runners:t}),r===null?null:(0,Q.jsx)(ce,{open:!0,onOpenChange:e=>!e&&i(null),providers:e.profileCapableProviders,initialProvider:r},r),(0,Q.jsx)(q,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,Q.jsxs)(J,{"data-slot":`accounts-remove-confirm`,children:[(0,Q.jsxs)(Y,{children:[(0,Q.jsxs)(U,{children:[`Remove “`,a?.label,`”?`]}),(0,Q.jsxs)(V,{children:[`This only forgets the account. Nothing in `,a?.configDir,` 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,Q.jsxs)(W,{children:[(0,Q.jsx)(K,{children:`Cancel`}),(0,Q.jsx)(H,{"data-action":`accounts-remove-confirm`,disabled:s.isPending,onClick:()=>{let e=a;e&&s.mutate(e.id,{onSuccess:()=>{o(null),E(`Removed ${e.label}`)},onError:e=>E(e.message,{tone:`danger`})})},children:`Remove`})]})]})})]})}function ve({entry:e,check:t}){return t===void 0?(0,Q.jsx)(`span`,{"data-slot":`agent-installed`,children:`Checking…`}):t.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"data-slot":`agent-installed`,children:`Installed`}),t.version?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,Q.jsx)(`span`,{"data-slot":`agent-version`,children:t.version})]}):null]}):(0,Q.jsxs)(`span`,{"data-slot":`agent-installed`,children:[`Not installed`,e.installHint?(0,Q.jsxs)(Q.Fragment,{children:[` — `,(0,Q.jsx)(`code`,{className:`break-all`,children:e.installHint})]}):null]})}function ye({entry:e,check:t,settingsAdmin:n,runners:r,editable:i,accounts:a,canCarryAccounts:o,onAdd:s,onRemove:c}){let l=e.id,u=e.managedInstall===!0&&n,d=a.filter(e=>e.isDefault).length,f=`${z(l)}-title`;return(0,Q.jsxs)(`section`,{id:z(l),tabIndex:-1,"aria-labelledby":f,"data-slot":`accounts-provider`,"data-provider":l,className:`settings-agent-card flex flex-col gap-4 rounded-lg border border-border bg-card p-4`,children:[(0,Q.jsx)(`h3`,{id:f,className:`settings-account-provider-title`,children:e.displayName}),u?(0,Q.jsx)($,{runner:l}):null,(0,Q.jsxs)(`div`,{className:`settings-account-installation settings-readout`,children:[u?null:(0,Q.jsx)(ve,{entry:e,check:t}),i?(0,Q.jsxs)(`span`,{className:`settings-account-count`,children:[a.length,` `,a.length===1?`account`:`accounts`,` (`,d,` discovered, `,a.length-d,` added)`]}):null]}),i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`ul`,{children:a.map(e=>(0,Q.jsx)(Ce,{account:e,runners:r,onRemove:()=>c(e)},e.id))}),o?(0,Q.jsx)(`div`,{className:`settings-account-add-row`,children:(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`accounts-add`,"data-provider":l,onClick:s,children:`Add account`})}):(0,Q.jsxs)(`p`,{"data-slot":`accounts-single-only`,className:`text-[11px] text-soft-foreground`,children:[e.displayName,` can only hold one account here: it keeps its credentials outside its config folder, so a second folder would change settings without changing the login — which would say “work account” while billing the other one.`]})]}):e.browserLogin?(0,Q.jsxs)(`div`,{"data-slot":`hosted-sign-in`,className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Discovered account`}),(0,Q.jsx)(X,{provider:l,label:e.displayName})]}):null]})}function be({runners:e}){let[t,n]=(0,Z.useState)(null),r=o(),i=m(),a=te(),s=l(p(e)),u=b({mutationFn:e=>c(e),onSuccess:e=>r.setQueryData(h.config,e),onError:e=>E(e.message,{tone:`danger`})});if(i.data===void 0)return null;let d=ie([],e),g=i.data.agentDefaults.runner??`claude`,_=f(t??g,p(e))??t??g,v=i.data.agentDefaults.models??{};return(0,Q.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,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:`Defaults for new projects`}),(0,Q.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,Q.jsx)(ae,{rows:d,runner:g,accountFor:()=>null,providerStatus:a,disabled:u.isPending,onPick:e=>{e!==g&&u.mutate({agentDefaults:{runner:e}})}}),(0,Q.jsxs)(`div`,{className:`settings-account-models flex flex-col gap-2`,children:[(0,Q.jsxs)(`label`,{className:`settings-model-agent-choice`,children:[(0,Q.jsx)(`span`,{children:`Default model for`}),(0,Q.jsx)(`select`,{"aria-label":`Model agent`,value:_,onChange:e=>n(e.target.value),children:e.runners.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})]}),e.runners.filter(e=>e.id===_).map(t=>(0,Q.jsxs)(`label`,{className:`settings-account-model flex items-center gap-3`,children:[(0,Q.jsx)(D,{className:`size-4 text-accent-icon shrink-0`}),(0,Q.jsx)(`span`,{className:`w-24 shrink-0 text-xs text-muted-foreground`,children:t.displayName}),(0,Q.jsxs)(`select`,{"aria-label":`Default model for ${t.pickerLabel}`,"data-slot":`accounts-default-model`,"data-runner":t.id,value:v[t.id]??``,disabled:u.isPending,onChange:e=>u.mutate({agentDefaults:{models:{[t.id]:e.target.value||null}}}),className:`block w-full max-w-xs 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:[G(t.id,e,s[t.id]?.data,[v[t.id]]).map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.id===``?`Native default`:e.label},e.id)),(0,Q.jsx)(xe,{runner:t.id,runners:e,catalog:s[t.id]})]})]},t.id))]})]})}function xe({runner:e,runners:t,catalog:n}){let r=re(e,t,n);return r?(0,Q.jsx)(`option`,{disabled:!0,children:r}):null}function Se({account:e,runners:t,status:n}){let i=S();return(0,Q.jsxs)(Q.Fragment,{children:[n&&n.status!==`connected`&&d(t,e.provider)?.browserLogin?(0,Q.jsx)(X,{provider:e.provider,...e.isDefault?{}:{profileId:e.id},label:e.label}):null,n&&n.status!==`connected`&&d(t,e.provider)?.terminalLogin!==!1?(0,Q.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:i.isPending,onClick:()=>i.mutate({provider:e.provider,...e.isDefault?{}:{profileId:e.id}},{onSuccess:e=>E(e.opened?`Finish signing in in the terminal, then Check again.`:`This account is already connected.`),onError:e=>E(e instanceof r&&e.command?`${e.message} — run: ${e.command}`:e.message,{tone:`danger`})}),children:`Connect`}):null]})}function Ce({account:e,runners:t,onRemove:n}){let r=i(e),a=v(),o=C(r,e.status===void 0),s=e.status??o.data?.status,c=s?me[s.status]:void 0;return(0,Q.jsx)(`li`,{"data-slot":`account-row`,"data-account":e.id,className:`flex flex-col gap-2 px-3.5 py-3`,children:(0,Q.jsxs)(`div`,{className:`settings-account-card`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-[13px] font-medium text-foreground`,children:e.label}),e.isDefault?(0,Q.jsx)(j,{variant:`ghost`,className:`shrink-0 text-[12px] text-muted-foreground`,children:`discovered`}):null]}),(0,Q.jsxs)(`div`,{className:`settings-account-readout settings-readout`,children:[(0,Q.jsx)(`p`,{"data-slot":`account-path`,className:`mt-0.5 truncate font-mono text-[11px] text-soft-foreground`,title:e.path,children:e.configDir}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(R,{tone:c?.tone??`neutral`,pulse:c===void 0}),(0,Q.jsx)(`span`,{"data-slot":`account-status`,children:c?.label??`Checking…`}),!s||s.requiresAccountHome===!1?null:e.exists?e.looksValid?null:(0,Q.jsxs)(`span`,{"data-slot":`account-unrecognised`,children:[`— this folder does not look like `,g(t,e.provider),` config yet`]}):(0,Q.jsx)(`span`,{"data-slot":`account-missing`,children:`— folder not created yet; Connect will make it`})]}),s?.hint?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s.hint}):null]})]}),(0,Q.jsxs)(`div`,{className:`settings-account-actions`,children:[(0,Q.jsx)(Se,{account:e,runners:t,status:s}),(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-recheck`,disabled:a.isPending,title:`Re-probe this account's login now, instead of waiting for the cached answer`,onClick:()=>a.mutate(r,{onError:e=>E(e.message,{tone:`danger`})}),children:`Check again`}),(0,Q.jsx)(we,{account:e,onRemove:n})]})]})})}function we({account:e,onRemove:t}){let[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(e.label),o=x();return(0,Q.jsx)(Q.Fragment,{children:e.isDefault?null:(0,Q.jsx)(`div`,{"data-slot":`account-manage`,className:`settings-account-management`,children:n?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.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,Q.jsx)(A,{type:`button`,size:`sm`,"data-action":`account-rename-save`,disabled:o.isPending||i.trim()===``||i.trim()===e.label,onClick:()=>o.mutate({id:e.id,label:i.trim()},{onSuccess:()=>r(!1),onError:e=>E(e.message,{tone:`danger`})}),children:`Save`}),(0,Q.jsx)(A,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{a(e.label),r(!1)},children:`Cancel`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-rename`,onClick:()=>r(!0),children:`Rename`}),(0,Q.jsx)(A,{type:`button`,variant:`outline`,size:`sm`,"data-action":`account-remove`,onClick:t,children:`Remove account`}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Renaming changes what Squawk calls this account, not its folder.`})]})})})}export{he as GlobalAgentsSection};
|