@hearsay-tools/squawk 0.19.0-pr4491.8863 → 0.19.0-pr4493.8878
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/delegation/routes.d.ts +65 -65
- package/dist/delegation/transport.d.ts +65 -65
- package/dist/git-diff-base.d.ts +22 -0
- package/dist/git-diff-base.js +30 -11
- package/dist/git-diff-base.js.map +1 -1
- package/dist/git-private-index.js +50 -3
- package/dist/git-private-index.js.map +1 -1
- package/dist/git-worktree.js +9 -11
- package/dist/git-worktree.js.map +1 -1
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/models-routes.d.ts +12 -12
- package/dist/server/projects-routes.d.ts +45 -45
- package/dist/server/repo-routes.d.ts +34 -34
- package/dist/server/reports-api.d.ts +2 -2
- package/dist/server/runs-routes.d.ts +304 -304
- package/dist/server/server.d.ts +1312 -1312
- package/dist/server/workspace-routes.d.ts +84 -84
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-vUm3Oo91.js → accounts-section-UJZxye-z.js} +1 -1
- package/web/dist/assets/{activity-motion-5PqpNBr3.js → activity-motion-BnRBlOlc.js} +1 -1
- package/web/dist/assets/{activity-route-y4J0XPmC.js → activity-route-weCjVQ4j.js} +1 -1
- package/web/dist/assets/{agent-config-section-B6nb-4Tg.js → agent-config-section-CGrPPEQR.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-WBjj9Ohn.js → agent-defaults-section-mocZoAgX.js} +1 -1
- package/web/dist/assets/{appearance-CC_zz6GG.js → appearance-dnjgFECm.js} +1 -1
- package/web/dist/assets/{automations-route-BCXGQLB5.js → automations-route-Dj5mLsB_.js} +1 -1
- package/web/dist/assets/{commit-list-Cw8yFUN-.js → commit-list-C8pTI7mp.js} +1 -1
- package/web/dist/assets/{diff-CWizOg4r.js → diff-BUeqeifm.js} +2 -2
- package/web/dist/assets/{diff-controls-DY_B9_uk.js → diff-controls-n4THBHKo.js} +1 -1
- package/web/dist/assets/{diff-view-BLsl8Jxr.js → diff-view-mEcoOmP6.js} +1 -1
- package/web/dist/assets/{file-preview-Bz07aJkJ.js → file-preview-CQdNEFHu.js} +1 -1
- package/web/dist/assets/{git-toolbar-D22Fx9FV.js → git-toolbar-AbHPGj3l.js} +1 -1
- package/web/dist/assets/{github-BxWZugau.js → github-DriOZy15.js} +1 -1
- package/web/dist/assets/{global-activity-route-CrIQm98Y.js → global-activity-route-u1XpCWGK.js} +1 -1
- package/web/dist/assets/index-_LohQUeF.js +21 -0
- package/web/dist/assets/{markdown-DVqtRtwM.js → markdown-DJkMnwyc.js} +1 -1
- package/web/dist/assets/{notifications-section-DRRyTHmL.js → notifications-section-CBdv2T-_.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-Cj_mwoFj.js → preview-pane-connected-B00yRXAd.js} +1 -1
- package/web/dist/assets/{projects-section-UDntLOSd.js → projects-section-BXkVtC6H.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-D2bXkdN-.js → prompt-templates-section-RF3GKyNP.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-0suHSrOy.js → remote-settings-notice-BJwP8Vi8.js} +1 -1
- package/web/dist/assets/{repo-git-B-vjoloe.js → repo-git-DuPmx5Mc.js} +1 -1
- package/web/dist/assets/{report-reader-C__EDjjn.js → report-reader-DDGKyj6B.js} +1 -1
- package/web/dist/assets/{reports-Dk8YneJS.js → reports-CUVVGSNs.js} +1 -1
- package/web/dist/assets/{resources-section-sabtBqDV.js → resources-section-CO9ePehe.js} +1 -1
- package/web/dist/assets/{review-panel-DsMQp4bE.js → review-panel-5IbppuWS.js} +1 -1
- package/web/dist/assets/{run-header-B48O-vRv.js → run-header-BbjUWTs-.js} +1 -1
- package/web/dist/assets/{select-Ceegk4kO.js → select-Cnv2IYdg.js} +1 -1
- package/web/dist/assets/{session-context-section-odpGIMPe.js → session-context-section-nSf23HuY.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-B7D6qReD.js → settings-agent-picker-DFTg6k6E.js} +1 -1
- package/web/dist/assets/{settings-shell-DGjDI-c1.js → settings-shell-BlNdAbSK.js} +1 -1
- package/web/dist/assets/{sidebar-section-Ctg5OW0G.js → sidebar-section-DmBlDKYf.js} +1 -1
- package/web/dist/assets/{skills-B8jOrPvl.js → skills-BmwnEyVF.js} +1 -1
- package/web/dist/assets/{task-changes-BmmEftoB.js → task-changes-BGxKFPHy.js} +1 -1
- package/web/dist/assets/{task-commits-vu5Nxx5O.js → task-commits-C3Aieqql.js} +1 -1
- package/web/dist/assets/{task-file-scope-CLJD_Mve.js → task-file-scope-EBj6BbvL.js} +1 -1
- package/web/dist/assets/{task-files-DZ77QBej.js → task-files-BkrKQUzS.js} +1 -1
- package/web/dist/assets/{task-github-item-DpD171qE.js → task-github-item-DdpDpxtU.js} +1 -1
- package/web/dist/assets/{task-thread-BFg_zKMs.js → task-thread-CbBHJkXy.js} +1 -1
- package/web/dist/assets/{thread-state-C96iPHAz.js → thread-state-9hRlv8vK.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-DdohFuox.js → use-hand-to-agent-state-CCWMSRyA.js} +1 -1
- package/web/dist/assets/{workflows-iiAfPhwp.js → workflows-XpPXRBCU.js} +1 -1
- package/web/dist/assets/{workspace-tools-Bqx4oCjd.js → workspace-tools-C2ut23LU.js} +1 -1
- package/web/dist/assets/{worktrees-section--ES3ssJy.js → worktrees-section-BE61T3WC.js} +1 -1
- package/web/dist/index.html +1 -1
- package/web/dist/assets/index-CjcLSwvy.js +0 -21
|
@@ -27,18 +27,6 @@ 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
|
-
} | {
|
|
42
30
|
output: {
|
|
43
31
|
workers: {
|
|
44
32
|
workerId: string;
|
|
@@ -91,6 +79,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
91
79
|
offset?: string | undefined;
|
|
92
80
|
};
|
|
93
81
|
};
|
|
82
|
+
} | {
|
|
83
|
+
output: {
|
|
84
|
+
error: string;
|
|
85
|
+
code?: "invalid_input" | undefined;
|
|
86
|
+
};
|
|
87
|
+
outputFormat: "json";
|
|
88
|
+
status: 400;
|
|
89
|
+
input: {
|
|
90
|
+
query: {
|
|
91
|
+
offset?: string | undefined;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
} & {
|
|
@@ -677,18 +677,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
677
677
|
} & {
|
|
678
678
|
"/:workerId": {
|
|
679
679
|
$get: {
|
|
680
|
-
output: {
|
|
681
|
-
error: string;
|
|
682
|
-
code?: "invalid_input" | undefined;
|
|
683
|
-
};
|
|
684
|
-
outputFormat: "json";
|
|
685
|
-
status: 400;
|
|
686
|
-
input: {
|
|
687
|
-
param: {
|
|
688
|
-
workerId: string;
|
|
689
|
-
};
|
|
690
|
-
};
|
|
691
|
-
} | {
|
|
692
680
|
output: {
|
|
693
681
|
workerId: string;
|
|
694
682
|
settled: boolean;
|
|
@@ -813,11 +801,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
813
801
|
workerId: string;
|
|
814
802
|
};
|
|
815
803
|
};
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
} & {
|
|
819
|
-
"/:workerId/collect": {
|
|
820
|
-
$post: {
|
|
804
|
+
} | {
|
|
821
805
|
output: {
|
|
822
806
|
error: string;
|
|
823
807
|
code?: "invalid_input" | undefined;
|
|
@@ -828,10 +812,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
828
812
|
param: {
|
|
829
813
|
workerId: string;
|
|
830
814
|
};
|
|
831
|
-
} & {
|
|
832
|
-
json: Record<string, never>;
|
|
833
815
|
};
|
|
834
|
-
}
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
} & {
|
|
819
|
+
"/:workerId/collect": {
|
|
820
|
+
$post: {
|
|
835
821
|
output: {
|
|
836
822
|
workerId: string;
|
|
837
823
|
parentRunId: string;
|
|
@@ -954,11 +940,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
954
940
|
} & {
|
|
955
941
|
json: Record<string, never>;
|
|
956
942
|
};
|
|
957
|
-
}
|
|
958
|
-
};
|
|
959
|
-
} & {
|
|
960
|
-
"/:workerId/steer": {
|
|
961
|
-
$post: {
|
|
943
|
+
} | {
|
|
962
944
|
output: {
|
|
963
945
|
error: string;
|
|
964
946
|
code?: "invalid_input" | undefined;
|
|
@@ -970,11 +952,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
970
952
|
workerId: string;
|
|
971
953
|
};
|
|
972
954
|
} & {
|
|
973
|
-
json:
|
|
974
|
-
text: string;
|
|
975
|
-
};
|
|
955
|
+
json: Record<string, never>;
|
|
976
956
|
};
|
|
977
|
-
}
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
} & {
|
|
960
|
+
"/:workerId/steer": {
|
|
961
|
+
$post: {
|
|
978
962
|
output: {
|
|
979
963
|
workerId: string;
|
|
980
964
|
state: "delivered" | "queued";
|
|
@@ -990,11 +974,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
990
974
|
text: string;
|
|
991
975
|
};
|
|
992
976
|
};
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
} & {
|
|
996
|
-
"/:workerId/stop": {
|
|
997
|
-
$post: {
|
|
977
|
+
} | {
|
|
998
978
|
output: {
|
|
999
979
|
error: string;
|
|
1000
980
|
code?: "invalid_input" | undefined;
|
|
@@ -1006,9 +986,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1006
986
|
workerId: string;
|
|
1007
987
|
};
|
|
1008
988
|
} & {
|
|
1009
|
-
json:
|
|
989
|
+
json: {
|
|
990
|
+
text: string;
|
|
991
|
+
};
|
|
1010
992
|
};
|
|
1011
|
-
}
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
} & {
|
|
996
|
+
"/:workerId/stop": {
|
|
997
|
+
$post: {
|
|
1012
998
|
output: {
|
|
1013
999
|
workerId: string;
|
|
1014
1000
|
state: "stopping" | "terminated";
|
|
@@ -1022,11 +1008,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1022
1008
|
} & {
|
|
1023
1009
|
json: Record<string, never>;
|
|
1024
1010
|
};
|
|
1025
|
-
}
|
|
1026
|
-
};
|
|
1027
|
-
} & {
|
|
1028
|
-
"/:workerId/destroy": {
|
|
1029
|
-
$post: {
|
|
1011
|
+
} | {
|
|
1030
1012
|
output: {
|
|
1031
1013
|
error: string;
|
|
1032
1014
|
code?: "invalid_input" | undefined;
|
|
@@ -1038,11 +1020,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1038
1020
|
workerId: string;
|
|
1039
1021
|
};
|
|
1040
1022
|
} & {
|
|
1041
|
-
json:
|
|
1042
|
-
discardWork?: true | undefined;
|
|
1043
|
-
};
|
|
1023
|
+
json: Record<string, never>;
|
|
1044
1024
|
};
|
|
1045
|
-
}
|
|
1025
|
+
};
|
|
1026
|
+
};
|
|
1027
|
+
} & {
|
|
1028
|
+
"/:workerId/destroy": {
|
|
1029
|
+
$post: {
|
|
1046
1030
|
output: {
|
|
1047
1031
|
workerId: string;
|
|
1048
1032
|
state: "complete" | "incomplete";
|
|
@@ -1071,6 +1055,22 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1071
1055
|
discardWork?: true | undefined;
|
|
1072
1056
|
};
|
|
1073
1057
|
};
|
|
1058
|
+
} | {
|
|
1059
|
+
output: {
|
|
1060
|
+
error: string;
|
|
1061
|
+
code?: "invalid_input" | undefined;
|
|
1062
|
+
};
|
|
1063
|
+
outputFormat: "json";
|
|
1064
|
+
status: 400;
|
|
1065
|
+
input: {
|
|
1066
|
+
param: {
|
|
1067
|
+
workerId: string;
|
|
1068
|
+
};
|
|
1069
|
+
} & {
|
|
1070
|
+
json: {
|
|
1071
|
+
discardWork?: true | undefined;
|
|
1072
|
+
};
|
|
1073
|
+
};
|
|
1074
1074
|
} | {
|
|
1075
1075
|
output: {
|
|
1076
1076
|
workerId: string;
|
|
@@ -1106,11 +1106,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1106
1106
|
"/:workerId/diff": {
|
|
1107
1107
|
$get: {
|
|
1108
1108
|
output: {
|
|
1109
|
-
|
|
1110
|
-
|
|
1109
|
+
workerId: string;
|
|
1110
|
+
baselineSha: string;
|
|
1111
|
+
diff: string;
|
|
1112
|
+
truncated: boolean;
|
|
1111
1113
|
};
|
|
1112
1114
|
outputFormat: "json";
|
|
1113
|
-
status:
|
|
1115
|
+
status: 200;
|
|
1114
1116
|
input: {
|
|
1115
1117
|
param: {
|
|
1116
1118
|
workerId: string;
|
|
@@ -1118,13 +1120,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1118
1120
|
};
|
|
1119
1121
|
} | {
|
|
1120
1122
|
output: {
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
diff: string;
|
|
1124
|
-
truncated: boolean;
|
|
1123
|
+
error: string;
|
|
1124
|
+
code?: "invalid_input" | undefined;
|
|
1125
1125
|
};
|
|
1126
1126
|
outputFormat: "json";
|
|
1127
|
-
status:
|
|
1127
|
+
status: 400;
|
|
1128
1128
|
input: {
|
|
1129
1129
|
param: {
|
|
1130
1130
|
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;
|
|
@@ -54,18 +66,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
54
66
|
offset?: string | undefined;
|
|
55
67
|
};
|
|
56
68
|
};
|
|
57
|
-
} | {
|
|
58
|
-
output: {
|
|
59
|
-
error: string;
|
|
60
|
-
code?: "invalid_input" | undefined;
|
|
61
|
-
};
|
|
62
|
-
outputFormat: "json";
|
|
63
|
-
status: 400;
|
|
64
|
-
input: {
|
|
65
|
-
query: {
|
|
66
|
-
offset?: string | undefined;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
} & {
|
|
@@ -652,6 +652,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
652
652
|
} & {
|
|
653
653
|
"/:workerId": {
|
|
654
654
|
$get: {
|
|
655
|
+
output: {
|
|
656
|
+
error: string;
|
|
657
|
+
code?: "invalid_input" | undefined;
|
|
658
|
+
};
|
|
659
|
+
outputFormat: "json";
|
|
660
|
+
status: 400;
|
|
661
|
+
input: {
|
|
662
|
+
param: {
|
|
663
|
+
workerId: string;
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
} | {
|
|
655
667
|
output: {
|
|
656
668
|
workerId: string;
|
|
657
669
|
settled: boolean;
|
|
@@ -776,7 +788,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
776
788
|
workerId: string;
|
|
777
789
|
};
|
|
778
790
|
};
|
|
779
|
-
}
|
|
791
|
+
};
|
|
792
|
+
};
|
|
793
|
+
} & {
|
|
794
|
+
"/:workerId/collect": {
|
|
795
|
+
$post: {
|
|
780
796
|
output: {
|
|
781
797
|
error: string;
|
|
782
798
|
code?: "invalid_input" | undefined;
|
|
@@ -787,12 +803,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
787
803
|
param: {
|
|
788
804
|
workerId: string;
|
|
789
805
|
};
|
|
806
|
+
} & {
|
|
807
|
+
json: Record<string, never>;
|
|
790
808
|
};
|
|
791
|
-
}
|
|
792
|
-
};
|
|
793
|
-
} & {
|
|
794
|
-
"/:workerId/collect": {
|
|
795
|
-
$post: {
|
|
809
|
+
} | {
|
|
796
810
|
output: {
|
|
797
811
|
workerId: string;
|
|
798
812
|
parentRunId: string;
|
|
@@ -915,7 +929,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
915
929
|
} & {
|
|
916
930
|
json: Record<string, never>;
|
|
917
931
|
};
|
|
918
|
-
}
|
|
932
|
+
};
|
|
933
|
+
};
|
|
934
|
+
} & {
|
|
935
|
+
"/:workerId/steer": {
|
|
936
|
+
$post: {
|
|
919
937
|
output: {
|
|
920
938
|
error: string;
|
|
921
939
|
code?: "invalid_input" | undefined;
|
|
@@ -927,13 +945,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
927
945
|
workerId: string;
|
|
928
946
|
};
|
|
929
947
|
} & {
|
|
930
|
-
json:
|
|
948
|
+
json: {
|
|
949
|
+
text: string;
|
|
950
|
+
};
|
|
931
951
|
};
|
|
932
|
-
}
|
|
933
|
-
};
|
|
934
|
-
} & {
|
|
935
|
-
"/:workerId/steer": {
|
|
936
|
-
$post: {
|
|
952
|
+
} | {
|
|
937
953
|
output: {
|
|
938
954
|
workerId: string;
|
|
939
955
|
state: "delivered" | "queued";
|
|
@@ -949,7 +965,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
949
965
|
text: string;
|
|
950
966
|
};
|
|
951
967
|
};
|
|
952
|
-
}
|
|
968
|
+
};
|
|
969
|
+
};
|
|
970
|
+
} & {
|
|
971
|
+
"/:workerId/stop": {
|
|
972
|
+
$post: {
|
|
953
973
|
output: {
|
|
954
974
|
error: string;
|
|
955
975
|
code?: "invalid_input" | undefined;
|
|
@@ -961,15 +981,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
961
981
|
workerId: string;
|
|
962
982
|
};
|
|
963
983
|
} & {
|
|
964
|
-
json:
|
|
965
|
-
text: string;
|
|
966
|
-
};
|
|
984
|
+
json: Record<string, never>;
|
|
967
985
|
};
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
} & {
|
|
971
|
-
"/:workerId/stop": {
|
|
972
|
-
$post: {
|
|
986
|
+
} | {
|
|
973
987
|
output: {
|
|
974
988
|
workerId: string;
|
|
975
989
|
state: "stopping" | "terminated";
|
|
@@ -983,7 +997,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
983
997
|
} & {
|
|
984
998
|
json: Record<string, never>;
|
|
985
999
|
};
|
|
986
|
-
}
|
|
1000
|
+
};
|
|
1001
|
+
};
|
|
1002
|
+
} & {
|
|
1003
|
+
"/:workerId/destroy": {
|
|
1004
|
+
$post: {
|
|
987
1005
|
output: {
|
|
988
1006
|
error: string;
|
|
989
1007
|
code?: "invalid_input" | undefined;
|
|
@@ -995,13 +1013,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
995
1013
|
workerId: string;
|
|
996
1014
|
};
|
|
997
1015
|
} & {
|
|
998
|
-
json:
|
|
1016
|
+
json: {
|
|
1017
|
+
discardWork?: true | undefined;
|
|
1018
|
+
};
|
|
999
1019
|
};
|
|
1000
|
-
}
|
|
1001
|
-
};
|
|
1002
|
-
} & {
|
|
1003
|
-
"/:workerId/destroy": {
|
|
1004
|
-
$post: {
|
|
1020
|
+
} | {
|
|
1005
1021
|
output: {
|
|
1006
1022
|
workerId: string;
|
|
1007
1023
|
state: "complete" | "incomplete";
|
|
@@ -1030,22 +1046,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1030
1046
|
discardWork?: true | undefined;
|
|
1031
1047
|
};
|
|
1032
1048
|
};
|
|
1033
|
-
} | {
|
|
1034
|
-
output: {
|
|
1035
|
-
error: string;
|
|
1036
|
-
code?: "invalid_input" | undefined;
|
|
1037
|
-
};
|
|
1038
|
-
outputFormat: "json";
|
|
1039
|
-
status: 400;
|
|
1040
|
-
input: {
|
|
1041
|
-
param: {
|
|
1042
|
-
workerId: string;
|
|
1043
|
-
};
|
|
1044
|
-
} & {
|
|
1045
|
-
json: {
|
|
1046
|
-
discardWork?: true | undefined;
|
|
1047
|
-
};
|
|
1048
|
-
};
|
|
1049
1049
|
} | {
|
|
1050
1050
|
output: {
|
|
1051
1051
|
workerId: string;
|
|
@@ -1081,13 +1081,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1081
1081
|
"/:workerId/diff": {
|
|
1082
1082
|
$get: {
|
|
1083
1083
|
output: {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
diff: string;
|
|
1087
|
-
truncated: boolean;
|
|
1084
|
+
error: string;
|
|
1085
|
+
code?: "invalid_input" | undefined;
|
|
1088
1086
|
};
|
|
1089
1087
|
outputFormat: "json";
|
|
1090
|
-
status:
|
|
1088
|
+
status: 400;
|
|
1091
1089
|
input: {
|
|
1092
1090
|
param: {
|
|
1093
1091
|
workerId: string;
|
|
@@ -1095,11 +1093,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1095
1093
|
};
|
|
1096
1094
|
} | {
|
|
1097
1095
|
output: {
|
|
1098
|
-
|
|
1099
|
-
|
|
1096
|
+
workerId: string;
|
|
1097
|
+
baselineSha: string;
|
|
1098
|
+
diff: string;
|
|
1099
|
+
truncated: boolean;
|
|
1100
1100
|
};
|
|
1101
1101
|
outputFormat: "json";
|
|
1102
|
-
status:
|
|
1102
|
+
status: 200;
|
|
1103
1103
|
input: {
|
|
1104
1104
|
param: {
|
|
1105
1105
|
workerId: string;
|
package/dist/git-diff-base.d.ts
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
export interface GitRunResult {
|
|
7
7
|
ok: boolean;
|
|
8
8
|
stdout: string;
|
|
9
|
+
/** True when git wrote more than the runner's buffer limit (`git-command.ts`). */
|
|
10
|
+
overflow?: boolean;
|
|
9
11
|
}
|
|
10
12
|
/** A caller-supplied `git` invocation, already bound to a working directory (and env). */
|
|
11
13
|
export type GitRunner = (args: string[]) => Promise<GitRunResult>;
|
|
@@ -31,6 +33,21 @@ export interface TaskDiffBase {
|
|
|
31
33
|
* HEAD, or a repo with no `origin` all fall through unchanged.
|
|
32
34
|
*/
|
|
33
35
|
export declare function freshestBaseRef(runGit: GitRunner, base: string): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* A task diff anchor as `resolveTaskDiffAnchor` returns it. With `viaMergeBase`, the anchor is the
|
|
38
|
+
* merge-base of `base` and HEAD, not yet computed: `diffFromMergeBase` lets git compute it inside
|
|
39
|
+
* the diff, so a caller with one diff to run starts one git process instead of two.
|
|
40
|
+
*/
|
|
41
|
+
export interface TaskDiffAnchor extends TaskDiffBase {
|
|
42
|
+
viaMergeBase: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* `git diff <diffArgs> $(git merge-base <base> HEAD)`, with the two-step fallback to `base` itself
|
|
46
|
+
* when there is no merge-base. One git process when git can answer `--merge-base` (git 2.30+ and
|
|
47
|
+
* exactly one merge-base); otherwise git fails, and the two-step form gives the same answer it
|
|
48
|
+
* always gave. Every turn end runs this (hearsay-tools/squawk#4430).
|
|
49
|
+
*/
|
|
50
|
+
export declare function diffFromMergeBase<R extends GitRunResult>(runGit: (args: string[]) => Promise<R>, base: string, diffArgs: readonly string[]): Promise<R>;
|
|
34
51
|
/**
|
|
35
52
|
* Resolve a task diff anchor. Without a task branch, use the merge-base; without a usable
|
|
36
53
|
* repoint baseline, use HEAD. Failed git calls fall back to the base name.
|
|
@@ -39,3 +56,8 @@ export declare function resolveTaskDiffBase(runGit: GitRunner, baseBranch: strin
|
|
|
39
56
|
taskBranch?: string | undefined;
|
|
40
57
|
runStartedAt?: string | undefined;
|
|
41
58
|
}): Promise<TaskDiffBase>;
|
|
59
|
+
/** `resolveTaskDiffBase`, with the plain merge-base anchor left to the caller's diff. */
|
|
60
|
+
export declare function resolveTaskDiffAnchor(runGit: GitRunner, baseBranch: string, opts?: {
|
|
61
|
+
taskBranch?: string | undefined;
|
|
62
|
+
runStartedAt?: string | undefined;
|
|
63
|
+
}): Promise<TaskDiffAnchor>;
|
package/dist/git-diff-base.js
CHANGED
|
@@ -75,18 +75,37 @@ async function changedLines(runGit, ref) {
|
|
|
75
75
|
}
|
|
76
76
|
return total;
|
|
77
77
|
}
|
|
78
|
+
/** `git merge-base <base> HEAD`, or `base` itself when git finds none. */
|
|
79
|
+
async function mergeBaseOf(runGit, base) {
|
|
80
|
+
const res = await runGit(['merge-base', base, 'HEAD']);
|
|
81
|
+
return res.ok && res.stdout.trim() ? res.stdout.trim() : base;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* `git diff <diffArgs> $(git merge-base <base> HEAD)`, with the two-step fallback to `base` itself
|
|
85
|
+
* when there is no merge-base. One git process when git can answer `--merge-base` (git 2.30+ and
|
|
86
|
+
* exactly one merge-base); otherwise git fails, and the two-step form gives the same answer it
|
|
87
|
+
* always gave. Every turn end runs this (hearsay-tools/squawk#4430).
|
|
88
|
+
*/
|
|
89
|
+
export async function diffFromMergeBase(runGit, base, diffArgs) {
|
|
90
|
+
const direct = await runGit(['diff', ...diffArgs, '--merge-base', base]);
|
|
91
|
+
// An overflow means git was already writing the diff: the two-step form would only repeat it.
|
|
92
|
+
if (direct.ok || direct.overflow)
|
|
93
|
+
return direct;
|
|
94
|
+
return runGit(['diff', ...diffArgs, await mergeBaseOf(runGit, base)]);
|
|
95
|
+
}
|
|
78
96
|
/**
|
|
79
97
|
* Resolve a task diff anchor. Without a task branch, use the merge-base; without a usable
|
|
80
98
|
* repoint baseline, use HEAD. Failed git calls fall back to the base name.
|
|
81
99
|
*/
|
|
82
100
|
export async function resolveTaskDiffBase(runGit, baseBranch, opts = {}) {
|
|
101
|
+
const { viaMergeBase, ...anchor } = await resolveTaskDiffAnchor(runGit, baseBranch, opts);
|
|
102
|
+
return viaMergeBase ? { base: await mergeBaseOf(runGit, anchor.base) } : anchor;
|
|
103
|
+
}
|
|
104
|
+
/** `resolveTaskDiffBase`, with the plain merge-base anchor left to the caller's diff. */
|
|
105
|
+
export async function resolveTaskDiffAnchor(runGit, baseBranch, opts = {}) {
|
|
83
106
|
const base = await freshestBaseRef(runGit, baseBranch);
|
|
84
|
-
const mergeBase = async () => {
|
|
85
|
-
const res = await runGit(['merge-base', base, 'HEAD']);
|
|
86
|
-
return res.ok && res.stdout.trim() ? res.stdout.trim() : base;
|
|
87
|
-
};
|
|
88
107
|
if (!opts.taskBranch)
|
|
89
|
-
return { base:
|
|
108
|
+
return { base, viaMergeBase: true };
|
|
90
109
|
const headBranchResult = await runGit(['rev-parse', '--abbrev-ref', 'HEAD']);
|
|
91
110
|
const headBranch = headBranchResult.ok ? headBranchResult.stdout.trim() : '';
|
|
92
111
|
// An unreadable HEAD (no commits yet, broken worktree) is NOT evidence of a
|
|
@@ -94,23 +113,23 @@ export async function resolveTaskDiffBase(runGit, baseBranch, opts = {}) {
|
|
|
94
113
|
// guess. A detached HEAD, on the other hand, is by definition not the task's
|
|
95
114
|
// branch and takes the repointed path below.
|
|
96
115
|
if (!headBranch || headBranch === opts.taskBranch)
|
|
97
|
-
return { base:
|
|
116
|
+
return { base, viaMergeBase: true };
|
|
98
117
|
const repointedHead = { headBranch, taskBranch: opts.taskBranch };
|
|
99
118
|
const baseline = await checkoutBaseline(runGit, headBranch, opts.runStartedAt);
|
|
100
119
|
if (!baseline)
|
|
101
|
-
return { base: 'HEAD', repointedHead };
|
|
120
|
+
return { base: 'HEAD', repointedHead, viaMergeBase: false };
|
|
102
121
|
// Two defensible anchors, so report the tighter one: the number must never
|
|
103
122
|
// claim more than the least either measure attributes to this task. The
|
|
104
123
|
// baseline is usually it — but not when the run merged the base branch in
|
|
105
124
|
// afterwards, which drags the whole upstream delta past a pre-merge baseline
|
|
106
125
|
// and leaves the merge-base as the only anchor that still measures the task.
|
|
107
|
-
const anchor = await
|
|
126
|
+
const anchor = await mergeBaseOf(runGit, base);
|
|
108
127
|
const viaBaseline = await changedLines(runGit, baseline);
|
|
109
128
|
if (viaBaseline === null)
|
|
110
|
-
return { base: anchor, repointedHead };
|
|
129
|
+
return { base: anchor, repointedHead, viaMergeBase: false };
|
|
111
130
|
const viaMergeBase = await changedLines(runGit, anchor);
|
|
112
131
|
if (viaMergeBase === null || viaBaseline <= viaMergeBase)
|
|
113
|
-
return { base: baseline, repointedHead };
|
|
114
|
-
return { base: anchor, repointedHead };
|
|
132
|
+
return { base: baseline, repointedHead, viaMergeBase: false };
|
|
133
|
+
return { base: anchor, repointedHead, viaMergeBase: false };
|
|
115
134
|
}
|
|
116
135
|
//# sourceMappingURL=git-diff-base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-diff-base.js","sourceRoot":"","sources":["../src/git-diff-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"git-diff-base.js","sourceRoot":"","sources":["../src/git-diff-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA0B7C;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,sEAAsE,CAAC;AAE3F;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAi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AQ;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IAE3E,2EAA2E;IAC3E,wEAAwE;IACxE,0EAA0E;IAC1E,6EAA6E;IAC7E,6EAA6E;IAC7E,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzD,IAAI,WAAW,KAAK,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IACtF,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,YAAY,KAAK,IAAI,IAAI,WAAW,IAAI,YAAY;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IACxH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -1,16 +1,63 @@
|
|
|
1
|
-
import { mkdtemp, rm } from 'node:fs/promises';
|
|
1
|
+
import { mkdtemp, readFile, rm, stat } from 'node:fs/promises';
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
3
|
import { dirname, join } from 'node:path';
|
|
4
4
|
import { git } from './git-command.js';
|
|
5
5
|
import { copyGitIndex } from './git-index-copy.js';
|
|
6
6
|
import { fallbackProjectWriteError } from './project-paths.js';
|
|
7
|
+
/** Entries kept by `realIndexPath`: one per worktree or checkout read. */
|
|
8
|
+
const INDEX_PATH_CACHE_MAX = 512;
|
|
9
|
+
const indexPathCache = new Map();
|
|
10
|
+
/**
|
|
11
|
+
* What decides where Git keeps the index of `dir`: the text of a `.git` file (a linked worktree's
|
|
12
|
+
* `gitdir:` pointer) or the identity of a `.git` directory. Undefined when `dir` has no `.git` of
|
|
13
|
+
* its own (a subdirectory, not a repository) or it cannot be read: Git is then asked every time.
|
|
14
|
+
*/
|
|
15
|
+
async function dotGitEntry(dir) {
|
|
16
|
+
const path = join(dir, '.git');
|
|
17
|
+
try {
|
|
18
|
+
const entry = await stat(path, { bigint: true });
|
|
19
|
+
if (entry.isDirectory())
|
|
20
|
+
return `dir:${entry.dev}:${entry.ino}`;
|
|
21
|
+
if (entry.isFile())
|
|
22
|
+
return `file:${await readFile(path, 'utf8')}`;
|
|
23
|
+
}
|
|
24
|
+
catch { /* No readable `.git` here. */ }
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* `git rev-parse --git-path index` for `dir`, or '' when Git cannot tell. The answer is kept while
|
|
29
|
+
* the `.git` entry stays the same, so a repeat read starts no process: every turn end reads one
|
|
30
|
+
* (hearsay-tools/squawk#4430). A worktree removed and added again at the same path can get another
|
|
31
|
+
* admin directory, and its `.git` file then names it, so the next read asks Git again.
|
|
32
|
+
*/
|
|
33
|
+
async function realIndexPath(dir) {
|
|
34
|
+
const entry = await dotGitEntry(dir);
|
|
35
|
+
if (entry === undefined)
|
|
36
|
+
return askIndexPath(dir);
|
|
37
|
+
const cached = indexPathCache.get(dir);
|
|
38
|
+
// A read in flight is shared: a turn end and a settlement diff often start together.
|
|
39
|
+
if (cached?.entry === entry)
|
|
40
|
+
return cached.path;
|
|
41
|
+
const kept = { entry, path: askIndexPath(dir) };
|
|
42
|
+
indexPathCache.delete(dir);
|
|
43
|
+
if (indexPathCache.size >= INDEX_PATH_CACHE_MAX)
|
|
44
|
+
indexPathCache.delete(indexPathCache.keys().next().value);
|
|
45
|
+
indexPathCache.set(dir, kept);
|
|
46
|
+
const path = await kept.path;
|
|
47
|
+
if (!path && indexPathCache.get(dir) === kept)
|
|
48
|
+
indexPathCache.delete(dir);
|
|
49
|
+
return path;
|
|
50
|
+
}
|
|
51
|
+
async function askIndexPath(dir) {
|
|
52
|
+
const real = await git(dir, ['rev-parse', '--path-format=absolute', '--git-path', 'index']);
|
|
53
|
+
return real.ok ? real.stdout.trim() : '';
|
|
54
|
+
}
|
|
7
55
|
/**
|
|
8
56
|
* Read through a private index copy. Try OS temp, then the Git directory; if neither is
|
|
9
57
|
* writable, check beforeLiveIndex before the real-index fallback. Always remove scratch state.
|
|
10
58
|
*/
|
|
11
59
|
export async function withPrivateIndex(worktreePath, read, beforeLiveIndex) {
|
|
12
|
-
const
|
|
13
|
-
const realIndex = real.ok ? real.stdout.trim() : '';
|
|
60
|
+
const realIndex = await realIndexPath(worktreePath);
|
|
14
61
|
let scratch;
|
|
15
62
|
for (const parent of [tmpdir(), ...(realIndex ? [dirname(realIndex)] : [])]) {
|
|
16
63
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-private-index.js","sourceRoot":"","sources":["../src/git-private-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/
|
|
1
|
+
{"version":3,"file":"git-private-index.js","sourceRoot":"","sources":["../src/git-private-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAkB,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAO/D,0EAA0E;AAC1E,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACjC,MAAM,cAAc,GAAG,IAAI,GAAG,EAAoD,CAAC;AAEnF;;;;GAIG;AACH,KAAK,UAA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