@wjarka/cezarion 0.14.9-dev.1011 → 0.14.9-dev.1017

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/core/ask.d.ts +2 -3
  2. package/dist/core/ask.js +16 -10
  3. package/dist/core/ask.js.map +1 -1
  4. package/dist/delegation/transport.d.ts +50 -50
  5. package/dist/server/server.d.ts +58 -58
  6. package/package.json +3 -3
  7. package/scripts/mock-claude.mjs +5 -1
  8. package/scripts/mock-codex-app-server.mjs +6 -1
  9. package/scripts/mock-cursor-acp.mjs +2 -1
  10. package/scripts/mock-opencode-serve.mjs +7 -1
  11. package/scripts/mock-pi-rpc.mjs +7 -1
  12. package/web/dist/assets/{agent-accounts-CerclGiO.js → agent-accounts-DyL8fuLm.js} +1 -1
  13. package/web/dist/assets/centered-state-BS3y81sP.js +43 -0
  14. package/web/dist/assets/{collapsible-De2G0xqQ.js → collapsible-B_5Byaac.js} +1 -1
  15. package/web/dist/assets/{commit-list-s6JPY3qv.js → commit-list-DGsvJs8W.js} +1 -1
  16. package/web/dist/assets/{compare-variants-BQu_t-_g.js → compare-variants-C2XM9Cdu.js} +1 -1
  17. package/web/dist/assets/{diff-controls-B6ok0TtQ.js → diff-controls-B5u0d3Ni.js} +1 -1
  18. package/web/dist/assets/{dropdown-menu-7KGQMoFj.js → dropdown-menu-BILyQM1H.js} +1 -1
  19. package/web/dist/assets/git-toolbar-pocL8rsv.js +1 -0
  20. package/web/dist/assets/{github-DCkk6sBm.js → github-Bigpyf77.js} +1 -1
  21. package/web/dist/assets/index-C6s-lgD_.css +1 -0
  22. package/web/dist/assets/index-vrmXsGqF.js +7 -0
  23. package/web/dist/assets/{markdown-DvbymqXz.js → markdown-Bxw0CkSS.js} +1 -1
  24. package/web/dist/assets/pill-D0gYCUCW.js +1 -0
  25. package/web/dist/assets/{project-router-ChC5Rb-Y.js → project-router-CYgfAd0B.js} +1 -1
  26. package/web/dist/assets/{prompt-templates-j8qlK7c-.js → prompt-templates-C3okTwnY.js} +1 -1
  27. package/web/dist/assets/{repo-git-_h1NjOVt.js → repo-git-BNmcmALh.js} +1 -1
  28. package/web/dist/assets/{run-diff-BuATgZpx.js → run-diff-wfKABrYX.js} +1 -1
  29. package/web/dist/assets/run-header-ChtrVwvM.js +1 -0
  30. package/web/dist/assets/{skills-C-fq5BrZ.js → skills-CQo5yBQH.js} +1 -1
  31. package/web/dist/assets/{tab-link-BmGKj9Rt.js → tab-link-B5RpMPwe.js} +1 -1
  32. package/web/dist/assets/{task-changes-CHa6JWOS.js → task-changes-Aqk-VGht.js} +1 -1
  33. package/web/dist/assets/{task-commits-BqCqyWm1.js → task-commits-CP3D9MKz.js} +1 -1
  34. package/web/dist/assets/{task-files-BSA0l-YP.js → task-files-DY6LWGRA.js} +1 -1
  35. package/web/dist/assets/{task-thread-Q7Nj33DH.js → task-thread-D00PqkWx.js} +7 -6
  36. package/web/dist/assets/{textarea-ByZ-txS7.js → textarea-CcPLMGgF.js} +1 -1
  37. package/web/dist/assets/{thread-loading-DHT9p5o5.js → thread-loading-SU_xKa7g.js} +1 -1
  38. package/web/dist/assets/{token-metrics-k4XoovDS.js → token-metrics-CqDOn3bu.js} +1 -1
  39. package/web/dist/assets/use-desktop-vnn3Lv3H.js +1 -0
  40. package/web/dist/assets/{workflows-HJOd3lVi.js → workflows-Cve95oNS.js} +1 -1
  41. package/web/dist/index.html +13 -13
  42. package/web/dist/assets/centered-state-DH8qtCz-.js +0 -43
  43. package/web/dist/assets/git-toolbar-DqbapMXr.js +0 -1
  44. package/web/dist/assets/index-Bnva-ttR.js +0 -7
  45. package/web/dist/assets/index-D5NkwqY7.css +0 -1
  46. package/web/dist/assets/pill-BL6ugwXo.js +0 -1
  47. package/web/dist/assets/run-header-DuAWswYM.js +0 -1
  48. package/web/dist/assets/square-terminal-B6RYYieR.js +0 -1
  49. package/web/dist/assets/use-desktop-BaYgO7YW.js +0 -1
@@ -33,9 +33,8 @@ export declare function parseAskRequest(value: unknown): AskRequest | null;
33
33
  /**
34
34
  * The AskUser control marker: a trailing `CEZ:ASK <compact-json>` line (a
35
35
  * sibling of `CEZ:DONE` / `CEZ:MONITORING`). Detected on the *assembled* turn
36
- * text so delta-streaming backends can't split it — uniform across all three
37
- * backends. The JSON is greedily captured from the first `{` after the keyword
38
- * to the last `}` at end-of-text.
36
+ * text so delta-streaming backends can't split it. The marker must begin the
37
+ * last nonempty line; mentions in prose or quoted logs are ordinary text.
39
38
  */
40
39
  export declare const ASK_MARKER_RE: RegExp;
41
40
  /**
package/dist/core/ask.js CHANGED
@@ -13,14 +13,19 @@ export function parseAskRequest(value) {
13
13
  /**
14
14
  * The AskUser control marker: a trailing `CEZ:ASK <compact-json>` line (a
15
15
  * sibling of `CEZ:DONE` / `CEZ:MONITORING`). Detected on the *assembled* turn
16
- * text so delta-streaming backends can't split it — uniform across all three
17
- * backends. The JSON is greedily captured from the first `{` after the keyword
18
- * to the last `}` at end-of-text.
16
+ * text so delta-streaming backends can't split it. The marker must begin the
17
+ * last nonempty line; mentions in prose or quoted logs are ordinary text.
19
18
  */
20
- export const ASK_MARKER_RE = /CEZ:ASK[ \t]+(\{[\s\S]*\})\s*$/;
19
+ export const ASK_MARKER_RE = /(?:^|\n)CEZ:ASK[ \t]+(\{[^\r\n]*\})\s*$/;
21
20
  /** Looser than `ASK_MARKER_RE` so diagnostics can distinguish a malformed
22
21
  * trailing marker from ordinary assistant prose. */
23
- const ASK_MARKER_CANDIDATE_RE = /CEZ:ASK[ \t]+([\s\S]*)$/;
22
+ const ASK_MARKER_CANDIDATE_RE = /^CEZ:ASK[ \t]+(.*)$/;
23
+ function finalAskLine(text) {
24
+ const trimmed = text.trimEnd();
25
+ const lineStart = trimmed.lastIndexOf('\n') + 1;
26
+ const match = ASK_MARKER_CANDIDATE_RE.exec(trimmed.slice(lineStart));
27
+ return match?.[1] === undefined ? null : { prefix: trimmed.slice(0, lineStart), payload: match[1] };
28
+ }
24
29
  function isRecord(value) {
25
30
  return typeof value === 'object' && value !== null && !Array.isArray(value);
26
31
  }
@@ -144,16 +149,16 @@ function issuesOf(error) {
144
149
  * rejected so the raw fallback stays readable.
145
150
  */
146
151
  export function parseAskMarkerResult(turnText) {
147
- const match = ASK_MARKER_CANDIDATE_RE.exec(turnText.trimEnd());
148
- if (!match || match[1] === undefined)
152
+ const match = finalAskLine(turnText);
153
+ if (!match)
149
154
  return { kind: 'none' };
150
155
  let raw;
151
156
  let repaired = false;
152
157
  try {
153
- raw = JSON.parse(match[1]);
158
+ raw = JSON.parse(match.payload);
154
159
  }
155
160
  catch (error) {
156
- const closed = closeUnbalancedJson(match[1]);
161
+ const closed = closeUnbalancedJson(match.payload);
157
162
  try {
158
163
  if (closed === null)
159
164
  throw error;
@@ -209,6 +214,7 @@ export function stripAskMarker(text, allowRepair = true) {
209
214
  const result = parseAskMarkerResult(text);
210
215
  if (result.kind !== 'valid' || (!allowRepair && result.repaired))
211
216
  return text;
212
- return text.replace(/\s*CEZ:ASK[ \t]+[\s\S]*$/, '');
217
+ const marker = finalAskLine(text);
218
+ return marker ? marker.prefix.trimEnd() : text;
213
219
  }
214
220
  //# sourceMappingURL=ask.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ask.js","sourceRoot":"","sources":["../../src/core/ask.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAqD,MAAM,8BAA8B,CAAC;AAkBvJ;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MA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,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9E,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC"}
@@ -461,18 +461,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
461
461
  } & {
462
462
  "/:workerId": {
463
463
  $get: {
464
- output: {
465
- error: string;
466
- code?: "invalid_input" | undefined;
467
- };
468
- outputFormat: "json";
469
- status: 400;
470
- input: {
471
- param: {
472
- workerId: string;
473
- };
474
- };
475
- } | {
476
464
  output: {
477
465
  workerId: string;
478
466
  parentRunId: string;
@@ -549,11 +537,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
549
537
  workerId: string;
550
538
  };
551
539
  };
552
- };
553
- };
554
- } & {
555
- "/:workerId/collect": {
556
- $post: {
540
+ } | {
557
541
  output: {
558
542
  error: string;
559
543
  code?: "invalid_input" | undefined;
@@ -564,10 +548,12 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
564
548
  param: {
565
549
  workerId: string;
566
550
  };
567
- } & {
568
- json: Record<string, never>;
569
551
  };
570
- } | {
552
+ };
553
+ };
554
+ } & {
555
+ "/:workerId/collect": {
556
+ $post: {
571
557
  output: {
572
558
  workerId: string;
573
559
  parentRunId: string;
@@ -669,11 +655,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
669
655
  } & {
670
656
  json: Record<string, never>;
671
657
  };
672
- };
673
- };
674
- } & {
675
- "/:workerId/steer": {
676
- $post: {
658
+ } | {
677
659
  output: {
678
660
  error: string;
679
661
  code?: "invalid_input" | undefined;
@@ -685,11 +667,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
685
667
  workerId: string;
686
668
  };
687
669
  } & {
688
- json: {
689
- text: string;
690
- };
670
+ json: Record<string, never>;
691
671
  };
692
- } | {
672
+ };
673
+ };
674
+ } & {
675
+ "/:workerId/steer": {
676
+ $post: {
693
677
  output: {
694
678
  workerId: string;
695
679
  state: "delivered" | "queued";
@@ -705,11 +689,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
705
689
  text: string;
706
690
  };
707
691
  };
708
- };
709
- };
710
- } & {
711
- "/:workerId/stop": {
712
- $post: {
692
+ } | {
713
693
  output: {
714
694
  error: string;
715
695
  code?: "invalid_input" | undefined;
@@ -721,9 +701,15 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
721
701
  workerId: string;
722
702
  };
723
703
  } & {
724
- json: Record<string, never>;
704
+ json: {
705
+ text: string;
706
+ };
725
707
  };
726
- } | {
708
+ };
709
+ };
710
+ } & {
711
+ "/:workerId/stop": {
712
+ $post: {
727
713
  output: {
728
714
  workerId: string;
729
715
  state: "stopping" | "terminated";
@@ -737,11 +723,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
737
723
  } & {
738
724
  json: Record<string, never>;
739
725
  };
740
- };
741
- };
742
- } & {
743
- "/:workerId/destroy": {
744
- $post: {
726
+ } | {
745
727
  output: {
746
728
  error: string;
747
729
  code?: "invalid_input" | undefined;
@@ -755,7 +737,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
755
737
  } & {
756
738
  json: Record<string, never>;
757
739
  };
758
- } | {
740
+ };
741
+ };
742
+ } & {
743
+ "/:workerId/destroy": {
744
+ $post: {
759
745
  output: {
760
746
  workerId: string;
761
747
  state: "complete" | "incomplete";
@@ -778,6 +764,20 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
778
764
  } & {
779
765
  json: Record<string, never>;
780
766
  };
767
+ } | {
768
+ output: {
769
+ error: string;
770
+ code?: "invalid_input" | undefined;
771
+ };
772
+ outputFormat: "json";
773
+ status: 400;
774
+ input: {
775
+ param: {
776
+ workerId: string;
777
+ };
778
+ } & {
779
+ json: Record<string, never>;
780
+ };
781
781
  } | {
782
782
  output: {
783
783
  workerId: string;
@@ -807,11 +807,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
807
807
  "/:workerId/diff": {
808
808
  $get: {
809
809
  output: {
810
- error: string;
811
- code?: "invalid_input" | undefined;
810
+ workerId: string;
811
+ baselineSha: string;
812
+ diff: string;
813
+ truncated: boolean;
812
814
  };
813
815
  outputFormat: "json";
814
- status: 400;
816
+ status: 200;
815
817
  input: {
816
818
  param: {
817
819
  workerId: string;
@@ -819,13 +821,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
819
821
  };
820
822
  } | {
821
823
  output: {
822
- workerId: string;
823
- baselineSha: string;
824
- diff: string;
825
- truncated: boolean;
824
+ error: string;
825
+ code?: "invalid_input" | undefined;
826
826
  };
827
827
  outputFormat: "json";
828
- status: 200;
828
+ status: 400;
829
829
  input: {
830
830
  param: {
831
831
  workerId: string;
@@ -4318,19 +4318,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4318
4318
  } & {
4319
4319
  "/repo/commit/:sha": {
4320
4320
  $get: {
4321
- output: string;
4322
- outputFormat: "text";
4323
- status: import("hono/utils/http-status").ContentfulStatusCode;
4324
- input: {
4325
- query: {
4326
- structured?: string | undefined;
4327
- };
4328
- } & {
4329
- param: {
4330
- sha: string;
4331
- };
4332
- };
4333
- } | {
4334
4321
  output: {
4335
4322
  error: string;
4336
4323
  code?: "invalid_input" | undefined;
@@ -4394,6 +4381,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
4394
4381
  sha: string;
4395
4382
  };
4396
4383
  };
4384
+ } | {
4385
+ output: string;
4386
+ outputFormat: "text";
4387
+ status: import("hono/utils/http-status").ContentfulStatusCode;
4388
+ input: {
4389
+ query: {
4390
+ structured?: string | undefined;
4391
+ };
4392
+ } & {
4393
+ param: {
4394
+ sha: string;
4395
+ };
4396
+ };
4397
4397
  };
4398
4398
  };
4399
4399
  } & {
@@ -12317,20 +12317,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
12317
12317
  } & {
12318
12318
  "/runs/:id/handoff": {
12319
12319
  $get: {
12320
- output: string;
12321
- outputFormat: "text";
12322
- status: 200;
12320
+ output: {
12321
+ error: string;
12322
+ };
12323
+ outputFormat: "json";
12324
+ status: 404;
12323
12325
  input: {
12324
12326
  param: {
12325
12327
  id: string;
12326
12328
  };
12327
12329
  };
12328
12330
  } | {
12329
- output: {
12330
- error: string;
12331
- };
12332
- outputFormat: "json";
12333
- status: 404;
12331
+ output: string;
12332
+ outputFormat: "text";
12333
+ status: 200;
12334
12334
  input: {
12335
12335
  param: {
12336
12336
  id: string;
@@ -12368,20 +12368,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
12368
12368
  } & {
12369
12369
  "/runs/:id/diff": {
12370
12370
  $get: {
12371
- output: string;
12372
- outputFormat: "text";
12373
- status: import("hono/utils/http-status").ContentfulStatusCode;
12371
+ output: {
12372
+ error: string;
12373
+ };
12374
+ outputFormat: "json";
12375
+ status: 404;
12374
12376
  input: {
12375
12377
  param: {
12376
12378
  id: string;
12377
12379
  };
12378
12380
  };
12379
12381
  } | {
12380
- output: {
12381
- error: string;
12382
- };
12383
- outputFormat: "json";
12384
- status: 404;
12382
+ output: string;
12383
+ outputFormat: "text";
12384
+ status: import("hono/utils/http-status").ContentfulStatusCode;
12385
12385
  input: {
12386
12386
  param: {
12387
12387
  id: string;
@@ -15250,19 +15250,6 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
15250
15250
  } & {
15251
15251
  "/repo/commit/:sha": {
15252
15252
  $get: {
15253
- output: string;
15254
- outputFormat: "text";
15255
- status: import("hono/utils/http-status").ContentfulStatusCode;
15256
- input: {
15257
- query: {
15258
- structured?: string | undefined;
15259
- };
15260
- } & {
15261
- param: {
15262
- sha: string;
15263
- };
15264
- };
15265
- } | {
15266
15253
  output: {
15267
15254
  error: string;
15268
15255
  code?: "invalid_input" | undefined;
@@ -15326,6 +15313,19 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
15326
15313
  sha: string;
15327
15314
  };
15328
15315
  };
15316
+ } | {
15317
+ output: string;
15318
+ outputFormat: "text";
15319
+ status: import("hono/utils/http-status").ContentfulStatusCode;
15320
+ input: {
15321
+ query: {
15322
+ structured?: string | undefined;
15323
+ };
15324
+ } & {
15325
+ param: {
15326
+ sha: string;
15327
+ };
15328
+ };
15329
15329
  };
15330
15330
  };
15331
15331
  } & {
@@ -23249,20 +23249,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
23249
23249
  } & {
23250
23250
  "/runs/:id/handoff": {
23251
23251
  $get: {
23252
- output: string;
23253
- outputFormat: "text";
23254
- status: 200;
23252
+ output: {
23253
+ error: string;
23254
+ };
23255
+ outputFormat: "json";
23256
+ status: 404;
23255
23257
  input: {
23256
23258
  param: {
23257
23259
  id: string;
23258
23260
  };
23259
23261
  };
23260
23262
  } | {
23261
- output: {
23262
- error: string;
23263
- };
23264
- outputFormat: "json";
23265
- status: 404;
23263
+ output: string;
23264
+ outputFormat: "text";
23265
+ status: 200;
23266
23266
  input: {
23267
23267
  param: {
23268
23268
  id: string;
@@ -23300,20 +23300,20 @@ export declare function createApp(deps: ServerDeps): import("hono/hono-base").Ho
23300
23300
  } & {
23301
23301
  "/runs/:id/diff": {
23302
23302
  $get: {
23303
- output: string;
23304
- outputFormat: "text";
23305
- status: import("hono/utils/http-status").ContentfulStatusCode;
23303
+ output: {
23304
+ error: string;
23305
+ };
23306
+ outputFormat: "json";
23307
+ status: 404;
23306
23308
  input: {
23307
23309
  param: {
23308
23310
  id: string;
23309
23311
  };
23310
23312
  };
23311
23313
  } | {
23312
- output: {
23313
- error: string;
23314
- };
23315
- outputFormat: "json";
23316
- status: 404;
23314
+ output: string;
23315
+ outputFormat: "text";
23316
+ status: import("hono/utils/http-status").ContentfulStatusCode;
23317
23317
  input: {
23318
23318
  param: {
23319
23319
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wjarka/cezarion",
3
- "version": "0.14.9-dev.1011",
3
+ "version": "0.14.9-dev.1017",
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",
@@ -51,8 +51,8 @@
51
51
  "zod": "^4.4.3"
52
52
  },
53
53
  "devDependencies": {
54
- "@open-mercato/cezar-api-client": "0.14.9-dev.1011",
55
- "@open-mercato/cezar-contract": "0.14.9-dev.1011",
54
+ "@open-mercato/cezar-api-client": "0.14.9-dev.1017",
55
+ "@open-mercato/cezar-contract": "0.14.9-dev.1017",
56
56
  "@types/node": "^20.14.0",
57
57
  "@types/ws": "^8.18.1",
58
58
  "esbuild": "^0.28.1",
@@ -128,7 +128,11 @@ async function respond(userText, imageCount, uuid) {
128
128
  }
129
129
  // #401: result-only full text; mapResult and v1 use the same fallback.
130
130
  if (!userText.includes('[cez-namer]') && userText.includes('mock:ask-snapshot')) {
131
- emit({ type: 'result', subtype: 'success', result: 'Choose a test library.\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}', usage: { input_tokens: 10, output_tokens: 5 } });
131
+ emit({ type: 'result', subtype: 'success', result: 'Using the CEZ:ASK structured question format instead:\n\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}', usage: { input_tokens: 10, output_tokens: 5 } });
132
+ return;
133
+ }
134
+ if (!userText.includes('[cez-namer]') && userText.includes('mock:ask-prose')) {
135
+ emit({ type: 'result', subtype: 'success', result: 'Use `CEZ:ASK {"questions":[]}` in your reply.\n> CEZ:ASK {not valid json', usage: { input_tokens: 10, output_tokens: 5 } });
132
136
  return;
133
137
  }
134
138
  if (userText.includes('mock:ci-wait')) {
@@ -163,7 +163,12 @@ rl.on('line', async (line) => {
163
163
  }
164
164
  // #401: agentMessage completion without deltas (same item envelope as baseline).
165
165
  if (turnText.includes('mock:ask-snapshot')) {
166
- emit({ method: 'item/completed', params: { threadId: 'th_mock_1', turnId: 'turn_mock_1', item: { type: 'agentMessage', id: 'ask-snapshot', text: 'Choose a test library.\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}' } } });
166
+ emit({ method: 'item/completed', params: { threadId: 'th_mock_1', turnId: 'turn_mock_1', item: { type: 'agentMessage', id: 'ask-snapshot', text: 'Using the CEZ:ASK structured question format instead:\n\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}' } } });
167
+ emit({ method: 'turn/completed', params: { threadId: 'th_mock_1', turn: { id: 'turn_mock_1', status: 'completed' } } });
168
+ return;
169
+ }
170
+ if (turnText.includes('mock:ask-prose')) {
171
+ emit({ method: 'item/completed', params: { threadId: 'th_mock_1', turnId: 'turn_mock_1', item: { type: 'agentMessage', id: 'ask-prose', text: 'Use `CEZ:ASK {"questions":[]}` in your reply.\n> CEZ:ASK {not valid json' } } });
167
172
  emit({ method: 'turn/completed', params: { threadId: 'th_mock_1', turn: { id: 'turn_mock_1', status: 'completed' } } });
168
173
  return;
169
174
  }
@@ -73,8 +73,9 @@ async function prompt(id, content) {
73
73
  if (input.includes('mock:provider-error') && !input.includes('mock:provider-error-')) { text('\n\nError: [unauthenticated] Backend rejected authentication.'); complete(id); return; }
74
74
  // #401: ACP has chunks only, so completion must flush the same text to v1/v2.
75
75
  if (input.includes('mock:ask-snapshot')) {
76
- text('Choose a test library.\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}'); complete(id); return;
76
+ text('Using the CEZ:ASK structured question format instead:\n\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}'); complete(id); return;
77
77
  }
78
+ if (input.includes('mock:ask-prose')) { text('Use `CEZ:ASK {"questions":[]}` in your reply.\n> CEZ:ASK {not valid json'); complete(id); return; }
78
79
  if (input.includes('mock:ask-bad')) { pendingAsk = { id }; emit({ id: 'bad-question', method: 'cursor/ask_question', params: { questions: [] } }); return; }
79
80
  if (input.includes('mock:plan')) { pendingAsk = { id, input }; emit({ id: 'plan-1', method: 'cursor/create_plan', params: { name: 'Test plan', overview: 'Approve the changes?', plan: 'Implement the change and run tests.' } }); return; }
80
81
  if (input.includes('mock:multi-ask')) { pendingAsk = { id }; emit({ id: 'multi-question', method: 'cursor/ask_question', params: { title: 'Choices', questions: [question, { ...question, id: 'build', prompt: 'Which build tool?', options: [{ id: 'vite', label: 'Vite' }, { id: 'webpack', label: 'Webpack' }] }] } }); return; }
@@ -316,7 +316,13 @@ const server = createServer((req, res) => {
316
316
  // #401: one completed text snapshot, without an earlier streaming part.
317
317
  if (body.includes('mock:ask-snapshot')) {
318
318
  send({ type: 'message.updated', properties: { info: info({}) } });
319
- send({ type: 'message.part.updated', properties: { part: { id: 'ask-snapshot', messageID: MESSAGE_ID, sessionID: SESSION_ID, type: 'text', text: 'Choose a test library.\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}', time: { start: 1, end: 2 } } } });
319
+ send({ type: 'message.part.updated', properties: { part: { id: 'ask-snapshot', messageID: MESSAGE_ID, sessionID: SESSION_ID, type: 'text', text: 'Using the CEZ:ASK structured question format instead:\n\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}', time: { start: 1, end: 2 } } } });
320
+ send({ type: 'session.idle', properties: { sessionID: SESSION_ID } });
321
+ return;
322
+ }
323
+ if (body.includes('mock:ask-prose')) {
324
+ send({ type: 'message.updated', properties: { info: info({}) } });
325
+ send({ type: 'message.part.updated', properties: { part: { id: 'ask-prose', messageID: MESSAGE_ID, sessionID: SESSION_ID, type: 'text', text: 'Use `CEZ:ASK {"questions":[]}` in your reply.\n> CEZ:ASK {not valid json', time: { start: 1, end: 2 } } } });
320
326
  send({ type: 'session.idle', properties: { sessionID: SESSION_ID } });
321
327
  return;
322
328
  }
@@ -186,7 +186,13 @@ async function handle(command) {
186
186
  send({ id: command.id, type: 'response', command: 'prompt', success: true });
187
187
  send({ type: 'agent_start' });
188
188
  send({ type: 'turn_start' });
189
- send({ type: 'message_update', message: {}, assistantMessageEvent: { type: 'text_end', contentIndex: 0, content: 'Choose a test library.\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}', partial: {} } });
189
+ send({ type: 'message_update', message: {}, assistantMessageEvent: { type: 'text_end', contentIndex: 0, content: 'Using the CEZ:ASK structured question format instead:\n\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}', partial: {} } });
190
+ sendTurnEnd();
191
+ } else if (command.type === 'prompt' && command.message.includes('mock:ask-prose')) {
192
+ send({ id: command.id, type: 'response', command: 'prompt', success: true });
193
+ send({ type: 'agent_start' });
194
+ send({ type: 'turn_start' });
195
+ sendText(['Use `CEZ:ASK {"questions":[]}` in your reply.\n> CEZ:ASK {not valid json']);
190
196
  sendTurnEnd();
191
197
  } else if (command.type === 'prompt' && command.message.includes('mock:ask-bad')) {
192
198
  // A marker whose JSON body is invalid. `parseAskMarker` must render no card
@@ -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{C as r,D as i,I as a,M as o,N as s,O as c,Qn as l,S as u,T as d,b as f,j as p,k as m,un as h,w as g,x as _,z as v}from"./centered-state-DH8qtCz-.js";import{t as y}from"./utils-BTFBhZ55.js";import{_ as b,g as x,h as ee,m as te,p as S}from"./dropdown-menu-7KGQMoFj.js";var C=e(t(),1),w=n(),T=`Popover`,[E,ne]=o(T,[b]),D=b(),[O,k]=E(T),A=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!1}=e,c=D(t),l=C.useRef(null),[u,d]=C.useState(!1),[f,p]=m({prop:r,defaultProp:a??!1,onChange:o,caller:T});return(0,w.jsx)(x,{...c,children:(0,w.jsx)(O,{scope:t,contentId:i(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:C.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:C.useCallback(()=>d(!0),[]),onCustomAnchorRemove:C.useCallback(()=>d(!1),[]),modal:s,children:n})})};A.displayName=T;var j=`PopoverAnchor`,M=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(j,n),a=D(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return C.useEffect(()=>(o(),()=>s()),[o,s]),(0,w.jsx)(S,{...a,...r,ref:t})});M.displayName=j;var N=`PopoverTrigger`,P=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(N,n),a=D(n),o=v(t,i.triggerRef),c=(0,w.jsx)(s.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":J(i.open),...r,ref:o,onClick:p(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:(0,w.jsx)(S,{asChild:!0,...a,children:c})});P.displayName=N;var F=`PopoverPortal`,[re,I]=E(F,{forceMount:void 0}),L=e=>{let{__scopePopover:t,forceMount:n,children:i,container:a}=e,o=k(F,t);return(0,w.jsx)(re,{scope:t,forceMount:n,children:(0,w.jsx)(c,{present:n||o.open,children:(0,w.jsx)(r,{asChild:!0,container:a,children:i})})})};L.displayName=F;var R=`PopoverContent`,z=C.forwardRef((e,t)=>{let n=I(R,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=k(R,e.__scopePopover);return(0,w.jsx)(c,{present:r||a.open,children:a.modal?(0,w.jsx)(V,{...i,ref:t}):(0,w.jsx)(H,{...i,ref:t})})});z.displayName=R;var B=a(`PopoverContent.RemoveScroll`),V=C.forwardRef((e,t)=>{let n=k(R,e.__scopePopover),r=C.useRef(null),i=v(t,r),a=C.useRef(!1);return C.useEffect(()=>{let e=r.current;if(e)return f(e)},[]),(0,w.jsx)(_,{as:B,allowPinchZoom:!0,children:(0,w.jsx)(U,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:p(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:p(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),H=C.forwardRef((e,t)=>{let n=k(R,e.__scopePopover),r=C.useRef(!1),i=C.useRef(!1);return(0,w.jsx)(U,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),U=C.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:f,...p}=e,m=k(R,n),h=D(n);return u(),(0,w.jsx)(g,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,w.jsx)(d,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,w.jsx)(ee,{"data-state":J(m.open),role:`dialog`,id:m.contentId,...h,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),W=`PopoverClose`,G=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(W,n);return(0,w.jsx)(s.button,{type:`button`,...r,ref:t,onClick:p(e.onClick,()=>i.onOpenChange(!1))})});G.displayName=W;var K=`PopoverArrow`,q=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=D(n);return(0,w.jsx)(te,{...i,...r,ref:t})});q.displayName=K;function J(e){return e?`open`:`closed`}var Y=A,X=M,Z=P,ie=L,ae=z;function Q(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function oe(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Q(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Q(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function se(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:Q(e)}:{top:0,bottom:0}}function ce(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function le(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(se(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function ue(){let[e,t]=(0,C.useState)({top:0,bottom:0});return(0,C.useEffect)(()=>le(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function de(e){let t=(0,C.useRef)(e);t.current=e,(0,C.useEffect)(()=>{let e=document.documentElement;return oe(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var $=C.createContext(null);function fe({...e}){let t=C.useRef(!1);return(0,w.jsx)($,{value:t,children:(0,w.jsx)(Y,{"data-slot":`popover`,...e})})}function pe({onPointerDownCapture:e,onKeyDownCapture:t,...n}){let r=C.useContext($);return(0,w.jsx)(Z,{"data-slot":`popover-trigger`,...n,onPointerDownCapture:t=>{r&&(r.current=t.pointerType===`touch`),e?.(t)},onKeyDownCapture:e=>{r&&(r.current=!1),t?.(e)}})}function me({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,onOpenAutoFocus:i,...a}){let o=ue(),s=C.useContext($);return(0,w.jsx)(ie,{children:(0,w.jsx)(ae,{"data-slot":`popover-content`,align:t,sideOffset:n,onOpenAutoFocus:e=>{let t=s?.current;if(s&&(s.current=!1),i?.(e),e.defaultPrevented||!t)return;let n=e.target;n instanceof HTMLElement&&n.querySelector(`[cmdk-input]`)&&(e.preventDefault(),n.focus({preventScroll:!0}))},collisionPadding:ce(o,r),className:y(`z-50 w-72 max-w-(--radix-popover-content-available-width) [overflow-wrap:anywhere] origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...a})})}function he({...e}){return(0,w.jsx)(X,{"data-slot":`popover-anchor`,...e})}function ge(){let e=h(),t=l(),n=(e.data?.profiles??[]).map(e=>({provider:e.provider,id:e.id,label:e.label,configDir:e.configDir})),r=t.data?.info?.root;return{accounts:n,repoAccount:r?e.data?.selections?.[r]:void 0}}function _e(e,t){return e.filter(e=>e.provider===t).length>1}export{me as a,he as i,ge as n,pe as o,fe as r,de as s,_e as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{C as r,D as i,I as a,M as o,N as s,O as c,Qn as l,S as u,T as d,b as f,j as p,k as m,un as h,w as g,x as _,z as v}from"./centered-state-BS3y81sP.js";import{t as y}from"./utils-BTFBhZ55.js";import{_ as b,g as x,h as ee,m as te,p as S}from"./dropdown-menu-BILyQM1H.js";var C=e(t(),1),w=n(),T=`Popover`,[E,ne]=o(T,[b]),D=b(),[O,k]=E(T),A=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!1}=e,c=D(t),l=C.useRef(null),[u,d]=C.useState(!1),[f,p]=m({prop:r,defaultProp:a??!1,onChange:o,caller:T});return(0,w.jsx)(x,{...c,children:(0,w.jsx)(O,{scope:t,contentId:i(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:C.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:C.useCallback(()=>d(!0),[]),onCustomAnchorRemove:C.useCallback(()=>d(!1),[]),modal:s,children:n})})};A.displayName=T;var j=`PopoverAnchor`,M=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(j,n),a=D(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return C.useEffect(()=>(o(),()=>s()),[o,s]),(0,w.jsx)(S,{...a,...r,ref:t})});M.displayName=j;var N=`PopoverTrigger`,P=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(N,n),a=D(n),o=v(t,i.triggerRef),c=(0,w.jsx)(s.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":J(i.open),...r,ref:o,onClick:p(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:(0,w.jsx)(S,{asChild:!0,...a,children:c})});P.displayName=N;var F=`PopoverPortal`,[re,I]=E(F,{forceMount:void 0}),L=e=>{let{__scopePopover:t,forceMount:n,children:i,container:a}=e,o=k(F,t);return(0,w.jsx)(re,{scope:t,forceMount:n,children:(0,w.jsx)(c,{present:n||o.open,children:(0,w.jsx)(r,{asChild:!0,container:a,children:i})})})};L.displayName=F;var R=`PopoverContent`,z=C.forwardRef((e,t)=>{let n=I(R,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=k(R,e.__scopePopover);return(0,w.jsx)(c,{present:r||a.open,children:a.modal?(0,w.jsx)(V,{...i,ref:t}):(0,w.jsx)(H,{...i,ref:t})})});z.displayName=R;var B=a(`PopoverContent.RemoveScroll`),V=C.forwardRef((e,t)=>{let n=k(R,e.__scopePopover),r=C.useRef(null),i=v(t,r),a=C.useRef(!1);return C.useEffect(()=>{let e=r.current;if(e)return f(e)},[]),(0,w.jsx)(_,{as:B,allowPinchZoom:!0,children:(0,w.jsx)(U,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:p(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:p(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),H=C.forwardRef((e,t)=>{let n=k(R,e.__scopePopover),r=C.useRef(!1),i=C.useRef(!1);return(0,w.jsx)(U,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),U=C.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:f,...p}=e,m=k(R,n),h=D(n);return u(),(0,w.jsx)(g,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,w.jsx)(d,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,w.jsx)(ee,{"data-state":J(m.open),role:`dialog`,id:m.contentId,...h,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),W=`PopoverClose`,G=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(W,n);return(0,w.jsx)(s.button,{type:`button`,...r,ref:t,onClick:p(e.onClick,()=>i.onOpenChange(!1))})});G.displayName=W;var K=`PopoverArrow`,q=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=D(n);return(0,w.jsx)(te,{...i,...r,ref:t})});q.displayName=K;function J(e){return e?`open`:`closed`}var Y=A,X=M,Z=P,ie=L,ae=z;function Q(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function oe(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Q(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Q(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function se(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:Q(e)}:{top:0,bottom:0}}function ce(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function le(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(se(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function ue(){let[e,t]=(0,C.useState)({top:0,bottom:0});return(0,C.useEffect)(()=>le(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function de(e){let t=(0,C.useRef)(e);t.current=e,(0,C.useEffect)(()=>{let e=document.documentElement;return oe(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var $=C.createContext(null);function fe({...e}){let t=C.useRef(!1);return(0,w.jsx)($,{value:t,children:(0,w.jsx)(Y,{"data-slot":`popover`,...e})})}function pe({onPointerDownCapture:e,onKeyDownCapture:t,...n}){let r=C.useContext($);return(0,w.jsx)(Z,{"data-slot":`popover-trigger`,...n,onPointerDownCapture:t=>{r&&(r.current=t.pointerType===`touch`),e?.(t)},onKeyDownCapture:e=>{r&&(r.current=!1),t?.(e)}})}function me({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,onOpenAutoFocus:i,...a}){let o=ue(),s=C.useContext($);return(0,w.jsx)(ie,{children:(0,w.jsx)(ae,{"data-slot":`popover-content`,align:t,sideOffset:n,onOpenAutoFocus:e=>{let t=s?.current;if(s&&(s.current=!1),i?.(e),e.defaultPrevented||!t)return;let n=e.target;n instanceof HTMLElement&&n.querySelector(`[cmdk-input]`)&&(e.preventDefault(),n.focus({preventScroll:!0}))},collisionPadding:ce(o,r),className:y(`z-50 w-72 max-w-(--radix-popover-content-available-width) [overflow-wrap:anywhere] origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...a})})}function he({...e}){return(0,w.jsx)(X,{"data-slot":`popover-anchor`,...e})}function ge(){let e=h(),t=l(),n=(e.data?.profiles??[]).map(e=>({provider:e.provider,id:e.id,label:e.label,configDir:e.configDir})),r=t.data?.info?.root;return{accounts:n,repoAccount:r?e.data?.selections?.[r]:void 0}}function _e(e,t){return e.filter(e=>e.provider===t).length>1}export{me as a,he as i,ge as n,pe as o,fe as r,de as s,_e as t};