@hearsay-tools/squawk 0.18.0-pr4068.7762.2 → 0.18.0-pr4069.7774

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 (141) hide show
  1. package/dist/ci-wait/controller.d.ts +46 -46
  2. package/dist/cli-dispatch.js +2 -1
  3. package/dist/cli-dispatch.js.map +1 -1
  4. package/dist/contract/index.js +2 -1
  5. package/dist/core/backend-detect.js +3 -3
  6. package/dist/core/backend-detect.js.map +1 -1
  7. package/dist/core/runner-definition.d.ts +8 -1
  8. package/dist/core/runner-definition.js.map +1 -1
  9. package/dist/delegation/routes.d.ts +80 -80
  10. package/dist/delegation/transport.d.ts +65 -65
  11. package/dist/managed-install/runtime-home.d.ts +8 -0
  12. package/dist/managed-install/runtime-home.js +14 -0
  13. package/dist/managed-install/runtime-home.js.map +1 -0
  14. package/dist/runners/acp/events.d.ts +15 -0
  15. package/dist/runners/acp/events.js +58 -2
  16. package/dist/runners/acp/events.js.map +1 -1
  17. package/dist/runners/acp/protocol.d.ts +10 -2
  18. package/dist/runners/acp/session.d.ts +11 -3
  19. package/dist/runners/acp/session.js +48 -16
  20. package/dist/runners/acp/session.js.map +1 -1
  21. package/dist/runners/acp/usage.d.ts +3 -0
  22. package/dist/runners/acp/usage.js +12 -0
  23. package/dist/runners/acp/usage.js.map +1 -0
  24. package/dist/runners/antigravity/account-home.js +1 -1
  25. package/dist/runners/antigravity/account-home.js.map +1 -1
  26. package/dist/runners/antigravity/accounts.d.ts +1 -1
  27. package/dist/runners/antigravity/accounts.js +1 -1
  28. package/dist/runners/antigravity/accounts.js.map +1 -1
  29. package/dist/runners/antigravity/antigravity-model-catalog.d.ts +4 -2
  30. package/dist/runners/antigravity/antigravity-model-catalog.js +25 -20
  31. package/dist/runners/antigravity/antigravity-model-catalog.js.map +1 -1
  32. package/dist/runners/antigravity/antigravity-runner.d.ts +6 -6
  33. package/dist/runners/antigravity/antigravity-runner.js +3 -2
  34. package/dist/runners/antigravity/antigravity-runner.js.map +1 -1
  35. package/dist/runners/antigravity/antigravity-session.d.ts +27 -2
  36. package/dist/runners/antigravity/antigravity-session.js +204 -96
  37. package/dist/runners/antigravity/antigravity-session.js.map +1 -1
  38. package/dist/runners/antigravity/antigravity-skill-catalog.d.ts +2 -2
  39. package/dist/runners/antigravity/antigravity-skill-catalog.js +6 -4
  40. package/dist/runners/antigravity/antigravity-skill-catalog.js.map +1 -1
  41. package/dist/runners/antigravity/antigravity-ui-mapper.d.ts +5 -3
  42. package/dist/runners/antigravity/antigravity-ui-mapper.js +27 -12
  43. package/dist/runners/antigravity/antigravity-ui-mapper.js.map +1 -1
  44. package/dist/runners/antigravity/ask-question.d.ts +9 -0
  45. package/dist/runners/antigravity/ask-question.js +37 -0
  46. package/dist/runners/antigravity/ask-question.js.map +1 -0
  47. package/dist/runners/antigravity/browser-sign-in.d.ts +8 -2
  48. package/dist/runners/antigravity/browser-sign-in.js +100 -122
  49. package/dist/runners/antigravity/browser-sign-in.js.map +1 -1
  50. package/dist/runners/antigravity/definition.js +3 -2
  51. package/dist/runners/antigravity/definition.js.map +1 -1
  52. package/dist/runners/antigravity/detection.d.ts +6 -4
  53. package/dist/runners/antigravity/detection.js +8 -5
  54. package/dist/runners/antigravity/detection.js.map +1 -1
  55. package/dist/runners/antigravity/display.d.ts +3 -3
  56. package/dist/runners/antigravity/display.js +2 -2
  57. package/dist/runners/antigravity/display.js.map +1 -1
  58. package/dist/runners/antigravity/executable.d.ts +45 -0
  59. package/dist/runners/antigravity/executable.js +184 -0
  60. package/dist/runners/antigravity/executable.js.map +1 -0
  61. package/dist/runners/antigravity/facts.d.ts +4 -4
  62. package/dist/runners/antigravity/facts.js +10 -5
  63. package/dist/runners/antigravity/facts.js.map +1 -1
  64. package/dist/runners/antigravity/launch-args.d.ts +4 -2
  65. package/dist/runners/antigravity/launch-args.js +5 -4
  66. package/dist/runners/antigravity/launch-args.js.map +1 -1
  67. package/dist/runners/antigravity/login-probe.d.ts +6 -1
  68. package/dist/runners/antigravity/login-probe.js +41 -19
  69. package/dist/runners/antigravity/login-probe.js.map +1 -1
  70. package/dist/runners/antigravity/login.d.ts +1 -1
  71. package/dist/runners/antigravity/login.js +1 -1
  72. package/dist/runners/antigravity/login.js.map +1 -1
  73. package/dist/runners/antigravity/mock.d.ts +24 -13
  74. package/dist/runners/antigravity/mock.js +19 -15
  75. package/dist/runners/antigravity/mock.js.map +1 -1
  76. package/dist/runners/antigravity/native-diagnostics.d.ts +3 -2
  77. package/dist/runners/antigravity/native-diagnostics.js +9 -6
  78. package/dist/runners/antigravity/native-diagnostics.js.map +1 -1
  79. package/dist/runners/antigravity/permissions.d.ts +2 -3
  80. package/dist/runners/antigravity/permissions.js +1 -32
  81. package/dist/runners/antigravity/permissions.js.map +1 -1
  82. package/dist/runners/antigravity/probe-process.d.ts +4 -1
  83. package/dist/runners/antigravity/probe-process.js +21 -5
  84. package/dist/runners/antigravity/probe-process.js.map +1 -1
  85. package/dist/runners/antigravity/runtime-env.d.ts +4 -3
  86. package/dist/runners/antigravity/runtime-env.js +14 -26
  87. package/dist/runners/antigravity/runtime-env.js.map +1 -1
  88. package/dist/runners/antigravity/spec-support.js +8 -8
  89. package/dist/runners/antigravity/spec-support.js.map +1 -1
  90. package/dist/runners/antigravity/tool-normalization.d.ts +6 -2
  91. package/dist/runners/antigravity/tool-normalization.js +23 -12
  92. package/dist/runners/antigravity/tool-normalization.js.map +1 -1
  93. package/dist/runners/antigravity/wire-updates.d.ts +14 -1
  94. package/dist/runners/antigravity/wire-updates.js +21 -6
  95. package/dist/runners/antigravity/wire-updates.js.map +1 -1
  96. package/dist/server/activity-routes.d.ts +23 -23
  97. package/dist/server/live-routes.d.ts +6 -6
  98. package/dist/server/models-routes.d.ts +13 -13
  99. package/dist/server/provider-sign-in-routes.js +1 -1
  100. package/dist/server/provider-sign-in-routes.js.map +1 -1
  101. package/dist/server/server.d.ts +238 -238
  102. package/package.json +4 -4
  103. package/scripts/mock-acp-login.mjs +20 -0
  104. package/scripts/mock-acp-sessions.mjs +30 -0
  105. package/scripts/mock-acp.mjs +128 -79
  106. package/scripts/mock-antigravity-auth.mjs +39 -37
  107. package/web/dist/assets/{activity-motion-BSsgWgJe.js → activity-motion-CMaQA87f.js} +1 -1
  108. package/web/dist/assets/{activity-route-q9sOR4Wb.js → activity-route-CTJT4zv2.js} +1 -1
  109. package/web/dist/assets/{commit-diff-panel-Btiebm6D.js → commit-diff-panel-BoK-qLXZ.js} +1 -1
  110. package/web/dist/assets/{diff-DNIkChMc.js → diff-BHFOGiZQ.js} +2 -2
  111. package/web/dist/assets/{diff-view-jhjgH27W.js → diff-view-BcEpsdxN.js} +1 -1
  112. package/web/dist/assets/{file-preview-De5UjJTG.js → file-preview-DQmUdQku.js} +1 -1
  113. package/web/dist/assets/{git-toolbar-Ol1142ti.js → git-toolbar-CIMGnrx-.js} +1 -1
  114. package/web/dist/assets/{github-BylUlaAL.js → github-DNt7fatG.js} +1 -1
  115. package/web/dist/assets/{global-activity-route-DI3QqvQL.js → global-activity-route-DvJfgzVz.js} +1 -1
  116. package/web/dist/assets/{index-Dbb0-RtK.js → index-Bcs60T3F.js} +4 -4
  117. package/web/dist/assets/{markdown-D3aDM4O5.js → markdown-C78nwKGh.js} +1 -1
  118. package/web/dist/assets/{preview-pane-connected-C-f5rJGZ.js → preview-pane-connected-DAkxP33O.js} +1 -1
  119. package/web/dist/assets/{repo-git-D-j1tyQj.js → repo-git-DTINuV7R.js} +1 -1
  120. package/web/dist/assets/{report-reader-0-k8FTCM.js → report-reader-TsL5jS1q.js} +1 -1
  121. package/web/dist/assets/{reports--2BDXGSj.js → reports-MBONm90i.js} +1 -1
  122. package/web/dist/assets/{run-header-B69_lBSt.js → run-header-BbuegkrJ.js} +1 -1
  123. package/web/dist/assets/{skills-CzyYKL6l.js → skills-Cc2FsHZq.js} +1 -1
  124. package/web/dist/assets/{task-changes-D1Oi0yoX.js → task-changes-Bis3iY6D.js} +1 -1
  125. package/web/dist/assets/{task-commits-DV91fVHF.js → task-commits-CELN07IE.js} +1 -1
  126. package/web/dist/assets/{task-files-_ap-MUjL.js → task-files-Xj9SbIQY.js} +1 -1
  127. package/web/dist/assets/{task-github-item-9oibIBa8.js → task-github-item-8Wi29msX.js} +1 -1
  128. package/web/dist/assets/{task-thread-D8IfseH4.js → task-thread-BpprgiEm.js} +1 -1
  129. package/web/dist/assets/{thread-state-BLS3a1XA.js → thread-state-DjdzGdTP.js} +1 -1
  130. package/web/dist/assets/{use-hand-to-agent-state-DaPTyzCV.js → use-hand-to-agent-state-BrTzbU6r.js} +1 -1
  131. package/web/dist/assets/{workflows-BAIP3wxi.js → workflows-BgbhcFeb.js} +1 -1
  132. package/web/dist/index.html +1 -1
  133. package/dist/runners/antigravity/build-label.d.ts +0 -2
  134. package/dist/runners/antigravity/build-label.js +0 -32
  135. package/dist/runners/antigravity/build-label.js.map +0 -1
  136. package/dist/runners/antigravity/catalog-home.d.ts +0 -2
  137. package/dist/runners/antigravity/catalog-home.js +0 -23
  138. package/dist/runners/antigravity/catalog-home.js.map +0 -1
  139. package/dist/runners/antigravity/stderr.d.ts +0 -2
  140. package/dist/runners/antigravity/stderr.js +0 -15
  141. package/dist/runners/antigravity/stderr.js.map +0 -1
@@ -27,6 +27,18 @@ export declare function delegationFailure(error: unknown): {
27
27
  export declare function createDelegationRoutes(service: DelegationService, credentials: CredentialRegistry): import("hono/hono-base").HonoBase<Env, {
28
28
  "/list": {
29
29
  $get: {
30
+ output: {
31
+ error: string;
32
+ code?: "invalid_input" | undefined;
33
+ };
34
+ outputFormat: "json";
35
+ status: 400;
36
+ input: {
37
+ query: {
38
+ offset?: string | undefined;
39
+ };
40
+ };
41
+ } | {
30
42
  output: {
31
43
  workers: {
32
44
  workerId: string;
@@ -73,24 +85,23 @@ export declare function createDelegationRoutes(service: DelegationService, crede
73
85
  offset?: string | undefined;
74
86
  };
75
87
  };
76
- } | {
77
- output: {
78
- error: string;
79
- code?: "invalid_input" | undefined;
80
- };
81
- outputFormat: "json";
82
- status: 400;
83
- input: {
84
- query: {
85
- offset?: string | undefined;
86
- };
87
- };
88
88
  };
89
89
  };
90
90
  } & {
91
91
  "/discover": {
92
92
  $post: {
93
93
  output: {
94
+ runner: string;
95
+ models: {
96
+ id: string;
97
+ label: string;
98
+ description: string;
99
+ effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
100
+ }[];
101
+ source: "cache" | "live" | "unavailable";
102
+ stale: boolean;
103
+ reason?: string | undefined;
104
+ } | {
94
105
  scope: "host-default-account";
95
106
  runners: {
96
107
  requiresAccountHome?: boolean | undefined;
@@ -112,17 +123,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
112
123
  reason?: string | undefined;
113
124
  }[];
114
125
  nextOffset?: number | undefined;
115
- } | {
116
- runner: string;
117
- models: {
118
- id: string;
119
- label: string;
120
- description: string;
121
- effortLevels?: ("high" | "low" | "max" | "medium" | "xhigh")[] | undefined;
122
- }[];
123
- source: "cache" | "live" | "unavailable";
124
- stale: boolean;
125
- reason?: string | undefined;
126
126
  };
127
127
  outputFormat: "json";
128
128
  status: 200;
@@ -232,13 +232,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
232
232
  status: 200;
233
233
  input: {
234
234
  json: {
235
- workerIds: string[];
236
- timeoutSeconds?: number | undefined;
237
- mode?: "all" | "any" | "one" | undefined;
238
- } | {
239
235
  requestIds: string[];
240
236
  mode?: "all" | "any" | "one" | undefined;
241
237
  timeoutSeconds?: number | undefined;
238
+ } | {
239
+ workerIds: string[];
240
+ timeoutSeconds?: number | undefined;
241
+ mode?: "all" | "any" | "one" | undefined;
242
242
  } | {
243
243
  peerIds: string[];
244
244
  timeoutSeconds?: number | undefined;
@@ -629,6 +629,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
629
629
  } & {
630
630
  "/:workerId": {
631
631
  $get: {
632
+ output: {
633
+ error: string;
634
+ code?: "invalid_input" | undefined;
635
+ };
636
+ outputFormat: "json";
637
+ status: 400;
638
+ input: {
639
+ param: {
640
+ workerId: string;
641
+ };
642
+ };
643
+ } | {
632
644
  output: {
633
645
  workerId: string;
634
646
  settled: boolean;
@@ -746,7 +758,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
746
758
  workerId: string;
747
759
  };
748
760
  };
749
- } | {
761
+ };
762
+ };
763
+ } & {
764
+ "/:workerId/collect": {
765
+ $post: {
750
766
  output: {
751
767
  error: string;
752
768
  code?: "invalid_input" | undefined;
@@ -757,12 +773,10 @@ export declare function createDelegationRoutes(service: DelegationService, crede
757
773
  param: {
758
774
  workerId: string;
759
775
  };
776
+ } & {
777
+ json: Record<string, never>;
760
778
  };
761
- };
762
- };
763
- } & {
764
- "/:workerId/collect": {
765
- $post: {
779
+ } | {
766
780
  output: {
767
781
  workerId: string;
768
782
  parentRunId: string;
@@ -885,7 +899,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
885
899
  } & {
886
900
  json: Record<string, never>;
887
901
  };
888
- } | {
902
+ };
903
+ };
904
+ } & {
905
+ "/:workerId/steer": {
906
+ $post: {
889
907
  output: {
890
908
  error: string;
891
909
  code?: "invalid_input" | undefined;
@@ -897,13 +915,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
897
915
  workerId: string;
898
916
  };
899
917
  } & {
900
- json: Record<string, never>;
918
+ json: {
919
+ text: string;
920
+ };
901
921
  };
902
- };
903
- };
904
- } & {
905
- "/:workerId/steer": {
906
- $post: {
922
+ } | {
907
923
  output: {
908
924
  workerId: string;
909
925
  state: "delivered" | "queued";
@@ -919,7 +935,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
919
935
  text: string;
920
936
  };
921
937
  };
922
- } | {
938
+ };
939
+ };
940
+ } & {
941
+ "/:workerId/stop": {
942
+ $post: {
923
943
  output: {
924
944
  error: string;
925
945
  code?: "invalid_input" | undefined;
@@ -931,15 +951,9 @@ export declare function createDelegationRoutes(service: DelegationService, crede
931
951
  workerId: string;
932
952
  };
933
953
  } & {
934
- json: {
935
- text: string;
936
- };
954
+ json: Record<string, never>;
937
955
  };
938
- };
939
- };
940
- } & {
941
- "/:workerId/stop": {
942
- $post: {
956
+ } | {
943
957
  output: {
944
958
  workerId: string;
945
959
  state: "stopping" | "terminated";
@@ -953,7 +967,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
953
967
  } & {
954
968
  json: Record<string, never>;
955
969
  };
956
- } | {
970
+ };
971
+ };
972
+ } & {
973
+ "/:workerId/destroy": {
974
+ $post: {
957
975
  output: {
958
976
  error: string;
959
977
  code?: "invalid_input" | undefined;
@@ -965,13 +983,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
965
983
  workerId: string;
966
984
  };
967
985
  } & {
968
- json: Record<string, never>;
986
+ json: {
987
+ discardWork?: true | undefined;
988
+ };
969
989
  };
970
- };
971
- };
972
- } & {
973
- "/:workerId/destroy": {
974
- $post: {
990
+ } | {
975
991
  output: {
976
992
  workerId: string;
977
993
  state: "complete" | "incomplete";
@@ -1000,22 +1016,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1000
1016
  discardWork?: true | undefined;
1001
1017
  };
1002
1018
  };
1003
- } | {
1004
- output: {
1005
- error: string;
1006
- code?: "invalid_input" | undefined;
1007
- };
1008
- outputFormat: "json";
1009
- status: 400;
1010
- input: {
1011
- param: {
1012
- workerId: string;
1013
- };
1014
- } & {
1015
- json: {
1016
- discardWork?: true | undefined;
1017
- };
1018
- };
1019
1019
  } | {
1020
1020
  output: {
1021
1021
  workerId: string;
@@ -1051,13 +1051,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1051
1051
  "/:workerId/diff": {
1052
1052
  $get: {
1053
1053
  output: {
1054
- workerId: string;
1055
- baselineSha: string;
1056
- diff: string;
1057
- truncated: boolean;
1054
+ error: string;
1055
+ code?: "invalid_input" | undefined;
1058
1056
  };
1059
1057
  outputFormat: "json";
1060
- status: 200;
1058
+ status: 400;
1061
1059
  input: {
1062
1060
  param: {
1063
1061
  workerId: string;
@@ -1065,11 +1063,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
1065
1063
  };
1066
1064
  } | {
1067
1065
  output: {
1068
- error: string;
1069
- code?: "invalid_input" | undefined;
1066
+ workerId: string;
1067
+ baselineSha: string;
1068
+ diff: string;
1069
+ truncated: boolean;
1070
1070
  };
1071
1071
  outputFormat: "json";
1072
- status: 400;
1072
+ status: 200;
1073
1073
  input: {
1074
1074
  param: {
1075
1075
  workerId: string;
@@ -2,6 +2,18 @@ import type { DelegationRoutes } from './routes.ts';
2
2
  export declare function createDelegationApp(routes: DelegationRoutes): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
3
3
  "/list": {
4
4
  $get: {
5
+ output: {
6
+ error: string;
7
+ code?: "invalid_input" | undefined;
8
+ };
9
+ outputFormat: "json";
10
+ status: 400;
11
+ input: {
12
+ query: {
13
+ offset?: string | undefined;
14
+ };
15
+ };
16
+ } | {
5
17
  output: {
6
18
  workers: {
7
19
  workerId: string;
@@ -48,18 +60,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
48
60
  offset?: string | undefined;
49
61
  };
50
62
  };
51
- } | {
52
- output: {
53
- error: string;
54
- code?: "invalid_input" | undefined;
55
- };
56
- outputFormat: "json";
57
- status: 400;
58
- input: {
59
- query: {
60
- offset?: string | undefined;
61
- };
62
- };
63
63
  };
64
64
  };
65
65
  } & {
@@ -604,6 +604,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
604
604
  } & {
605
605
  "/:workerId": {
606
606
  $get: {
607
+ output: {
608
+ error: string;
609
+ code?: "invalid_input" | undefined;
610
+ };
611
+ outputFormat: "json";
612
+ status: 400;
613
+ input: {
614
+ param: {
615
+ workerId: string;
616
+ };
617
+ };
618
+ } | {
607
619
  output: {
608
620
  workerId: string;
609
621
  settled: boolean;
@@ -721,7 +733,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
721
733
  workerId: string;
722
734
  };
723
735
  };
724
- } | {
736
+ };
737
+ };
738
+ } & {
739
+ "/:workerId/collect": {
740
+ $post: {
725
741
  output: {
726
742
  error: string;
727
743
  code?: "invalid_input" | undefined;
@@ -732,12 +748,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
732
748
  param: {
733
749
  workerId: string;
734
750
  };
751
+ } & {
752
+ json: Record<string, never>;
735
753
  };
736
- };
737
- };
738
- } & {
739
- "/:workerId/collect": {
740
- $post: {
754
+ } | {
741
755
  output: {
742
756
  workerId: string;
743
757
  parentRunId: string;
@@ -860,7 +874,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
860
874
  } & {
861
875
  json: Record<string, never>;
862
876
  };
863
- } | {
877
+ };
878
+ };
879
+ } & {
880
+ "/:workerId/steer": {
881
+ $post: {
864
882
  output: {
865
883
  error: string;
866
884
  code?: "invalid_input" | undefined;
@@ -872,13 +890,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
872
890
  workerId: string;
873
891
  };
874
892
  } & {
875
- json: Record<string, never>;
893
+ json: {
894
+ text: string;
895
+ };
876
896
  };
877
- };
878
- };
879
- } & {
880
- "/:workerId/steer": {
881
- $post: {
897
+ } | {
882
898
  output: {
883
899
  workerId: string;
884
900
  state: "delivered" | "queued";
@@ -894,7 +910,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
894
910
  text: string;
895
911
  };
896
912
  };
897
- } | {
913
+ };
914
+ };
915
+ } & {
916
+ "/:workerId/stop": {
917
+ $post: {
898
918
  output: {
899
919
  error: string;
900
920
  code?: "invalid_input" | undefined;
@@ -906,15 +926,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
906
926
  workerId: string;
907
927
  };
908
928
  } & {
909
- json: {
910
- text: string;
911
- };
929
+ json: Record<string, never>;
912
930
  };
913
- };
914
- };
915
- } & {
916
- "/:workerId/stop": {
917
- $post: {
931
+ } | {
918
932
  output: {
919
933
  workerId: string;
920
934
  state: "stopping" | "terminated";
@@ -928,7 +942,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
928
942
  } & {
929
943
  json: Record<string, never>;
930
944
  };
931
- } | {
945
+ };
946
+ };
947
+ } & {
948
+ "/:workerId/destroy": {
949
+ $post: {
932
950
  output: {
933
951
  error: string;
934
952
  code?: "invalid_input" | undefined;
@@ -940,13 +958,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
940
958
  workerId: string;
941
959
  };
942
960
  } & {
943
- json: Record<string, never>;
961
+ json: {
962
+ discardWork?: true | undefined;
963
+ };
944
964
  };
945
- };
946
- };
947
- } & {
948
- "/:workerId/destroy": {
949
- $post: {
965
+ } | {
950
966
  output: {
951
967
  workerId: string;
952
968
  state: "complete" | "incomplete";
@@ -975,22 +991,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
975
991
  discardWork?: true | undefined;
976
992
  };
977
993
  };
978
- } | {
979
- output: {
980
- error: string;
981
- code?: "invalid_input" | undefined;
982
- };
983
- outputFormat: "json";
984
- status: 400;
985
- input: {
986
- param: {
987
- workerId: string;
988
- };
989
- } & {
990
- json: {
991
- discardWork?: true | undefined;
992
- };
993
- };
994
994
  } | {
995
995
  output: {
996
996
  workerId: string;
@@ -1026,13 +1026,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1026
1026
  "/:workerId/diff": {
1027
1027
  $get: {
1028
1028
  output: {
1029
- workerId: string;
1030
- baselineSha: string;
1031
- diff: string;
1032
- truncated: boolean;
1029
+ error: string;
1030
+ code?: "invalid_input" | undefined;
1033
1031
  };
1034
1032
  outputFormat: "json";
1035
- status: 200;
1033
+ status: 400;
1036
1034
  input: {
1037
1035
  param: {
1038
1036
  workerId: string;
@@ -1040,11 +1038,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
1040
1038
  };
1041
1039
  } | {
1042
1040
  output: {
1043
- error: string;
1044
- code?: "invalid_input" | undefined;
1041
+ workerId: string;
1042
+ baselineSha: string;
1043
+ diff: string;
1044
+ truncated: boolean;
1045
1045
  };
1046
1046
  outputFormat: "json";
1047
- status: 400;
1047
+ status: 200;
1048
1048
  input: {
1049
1049
  param: {
1050
1050
  workerId: string;
@@ -0,0 +1,8 @@
1
+ import type { Home } from '../home/home.ts';
2
+ /**
3
+ * The operator entry's Home, for managed CLI reads and leases. `cli-dispatch` binds it once, when it
4
+ * resolves the Home for a command; the first binding wins and later calls change nothing. A process
5
+ * with no bound Home (a test, a library caller) has no managed CLI and falls back to PATH.
6
+ */
7
+ export declare function bindManagedCliHome(home: Home): Home;
8
+ export declare function managedCliHome(): Home | undefined;
@@ -0,0 +1,14 @@
1
+ let bound;
2
+ /**
3
+ * The operator entry's Home, for managed CLI reads and leases. `cli-dispatch` binds it once, when it
4
+ * resolves the Home for a command; the first binding wins and later calls change nothing. A process
5
+ * with no bound Home (a test, a library caller) has no managed CLI and falls back to PATH.
6
+ */
7
+ export function bindManagedCliHome(home) {
8
+ bound ??= home;
9
+ return home;
10
+ }
11
+ export function managedCliHome() {
12
+ return bound;
13
+ }
14
+ //# sourceMappingURL=runtime-home.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-home.js","sourceRoot":"","sources":["../../src/managed-install/runtime-home.ts"],"names":[],"mappings":"AAEA,IAAI,KAAuB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAU;IAC3C,KAAK,KAAK,IAAI,CAAC;IACf,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -11,12 +11,27 @@ export declare class AcpEvents {
11
11
  private readonly hooks;
12
12
  private serial;
13
13
  private turnId;
14
+ /** The open turn was started by the agent's own work, and no prompt carries it yet. */
15
+ private agentStarted;
16
+ /** The kind of the open turn's latest work update. */
17
+ private lastWork;
18
+ /** A provider failure reported as text in the open turn. */
19
+ private failure;
14
20
  private block;
15
21
  private tools;
16
22
  constructor(sink: AcpEventSink, hooks: AcpHooks);
23
+ get turnOpen(): boolean;
24
+ /** The provider failure of the open turn, if its text reported one. */
25
+ get turnFailure(): string | undefined;
17
26
  begin(): string;
27
+ /** A prompt joins the agent-started turn that is open; its response ends that turn. */
28
+ adopt(): void;
29
+ /** The open turn was started by the agent and no prompt carries it. */
30
+ get agentTurn(): boolean;
18
31
  finish(stopReason: StopReason, usage?: TokenUsage): void;
19
32
  update(update: Record<string, unknown>): void;
33
+ /** A late update for a tool already closed (a failed call the agent reports after cancel). */
34
+ private closedTool;
20
35
  notice(message: string): void;
21
36
  /** A mapper can fold one frame without mutating its caller's state. */
22
37
  fork(sink: AcpEventSink): AcpEvents;
@@ -10,6 +10,8 @@ const toolSchema = z.object({
10
10
  locations: z.array(z.object({ path: z.string(), line: z.number().optional() })).nullish(),
11
11
  }).passthrough();
12
12
  const planStatusSchema = z.enum(['pending', 'in_progress', 'completed']);
13
+ /** Updates that are the agent's own work, as opposed to session metadata. */
14
+ const WORK_UPDATES = new Set(['agent_message_chunk', 'agent_thought_chunk', 'tool_call', 'tool_call_update', 'plan']);
13
15
  const planSchema = z.array(z.object({ content: z.string(), status: planStatusSchema.catch('pending'), priority: z.enum(['high', 'medium', 'low']) }));
14
16
  /** Stateful ACP-v1 -> Squawk v1/v2 mapping. No provider names or tool arguments live here. */
15
17
  export class AcpEvents {
@@ -17,36 +19,81 @@ export class AcpEvents {
17
19
  hooks;
18
20
  serial = 0;
19
21
  turnId;
22
+ /** The open turn was started by the agent's own work, and no prompt carries it yet. */
23
+ agentStarted = false;
24
+ /** The kind of the open turn's latest work update. */
25
+ lastWork;
26
+ /** A provider failure reported as text in the open turn. */
27
+ failure;
20
28
  block;
21
29
  tools = new Map();
22
30
  constructor(sink, hooks) {
23
31
  this.sink = sink;
24
32
  this.hooks = hooks;
25
33
  }
34
+ get turnOpen() { return this.turnId !== undefined; }
35
+ /** The provider failure of the open turn, if its text reported one. */
36
+ get turnFailure() { return this.failure; }
26
37
  begin() {
27
38
  if (this.turnId)
28
39
  throw new Error('ACP prompt already active');
29
40
  this.turnId = `acp-turn-${++this.serial}`;
41
+ this.lastWork = undefined;
30
42
  this.sink.uiEvent?.({ type: 'turn.started', turnId: this.turnId });
31
43
  return this.turnId;
32
44
  }
45
+ /** A prompt joins the agent-started turn that is open; its response ends that turn. */
46
+ adopt() {
47
+ if (!this.agentStarted)
48
+ throw new Error('ACP has no agent-started turn to adopt');
49
+ this.agentStarted = false;
50
+ }
51
+ /** The open turn was started by the agent and no prompt carries it. */
52
+ get agentTurn() { return this.agentStarted; }
33
53
  finish(stopReason, usage) {
34
54
  this.flush();
35
55
  if (!this.turnId)
36
56
  return;
37
- this.finishTools(stopReason);
38
- this.sink.uiEvent?.({ type: 'turn.completed', turnId: this.turnId, stopReason, ...(usage ? { usage } : {}) });
57
+ const reason = this.failure ? 'error' : stopReason;
58
+ this.finishTools(reason);
59
+ // A turn-end listener sees the turn closed: it may start the next one or close the session.
60
+ const turnId = this.turnId;
39
61
  this.turnId = undefined;
62
+ this.agentStarted = false;
63
+ this.failure = undefined;
64
+ this.sink.uiEvent?.({ type: 'turn.completed', turnId, stopReason: reason, ...(usage ? { usage } : {}) });
40
65
  this.sink.event?.({ type: 'turn-end' });
41
66
  }
42
67
  update(update) {
43
68
  try {
69
+ if (this.closedTool(update))
70
+ return;
71
+ const work = WORK_UPDATES.has(update.sessionUpdate);
72
+ if (work && !this.turnId && this.hooks.agentWorkEnds) {
73
+ this.begin();
74
+ this.agentStarted = true;
75
+ }
76
+ const failure = this.turnId ? this.hooks.updateError?.(update) : undefined;
77
+ if (failure)
78
+ this.failure ??= failure;
44
79
  this.mapUpdate(update);
80
+ const previous = this.lastWork;
81
+ if (work)
82
+ this.lastWork = update.sessionUpdate;
83
+ if (this.agentStarted && this.hooks.agentWorkEnds?.(update, previous))
84
+ this.finish('end_turn');
45
85
  }
46
86
  catch {
47
87
  this.notice('ACP ignored malformed session/update');
48
88
  }
49
89
  }
90
+ /** A late update for a tool already closed (a failed call the agent reports after cancel). */
91
+ closedTool(update) {
92
+ if (update.sessionUpdate !== 'tool_call' && update.sessionUpdate !== 'tool_call_update')
93
+ return false;
94
+ const status = this.tools.get(String(update.toolCallId))?.status;
95
+ return status === 'completed' || status === 'failed';
96
+ }
50
97
  notice(message) {
51
98
  this.sink.event?.({ type: 'note', message });
52
99
  this.sink.uiEvent?.({ type: 'session.error', message, fatal: false });
@@ -56,6 +103,9 @@ export class AcpEvents {
56
103
  const next = new AcpEvents(sink, this.hooks);
57
104
  next.serial = this.serial;
58
105
  next.turnId = this.turnId;
106
+ next.agentStarted = this.agentStarted;
107
+ next.lastWork = this.lastWork;
108
+ next.failure = this.failure;
59
109
  next.block = this.block ? { ...this.block } : undefined;
60
110
  // Updates replace tool snapshots; their nested input/output values are never mutated.
61
111
  next.tools = new Map(this.tools);
@@ -83,6 +133,8 @@ export class AcpEvents {
83
133
  this.hooks.normalizeOptions?.(update.configOptions);
84
134
  break;
85
135
  case 'available_commands_update': break; // Native command catalog, not a fault.
136
+ case 'session_info_update': break; // A native session title.
137
+ case 'current_mode_update': break; // The native mode the session/set_config_option call chose.
86
138
  default: this.notice('ACP ignored unsupported session/update');
87
139
  }
88
140
  }
@@ -124,6 +176,10 @@ export class AcpEvents {
124
176
  this.block = undefined;
125
177
  }
126
178
  finishTools(reason) {
179
+ // A wire whose idle session wakes on its own keeps a call running past a normal turn end: a
180
+ // background command, a timer or a question completes in a later turn.
181
+ if (this.hooks.agentWorkEnds && reason !== 'cancelled' && reason !== 'error')
182
+ return;
127
183
  for (const [id, tool] of this.tools) {
128
184
  if (tool.status === 'completed' || tool.status === 'failed')
129
185
  continue;