@hearsay-tools/squawk 0.18.0-pr4407.8607 → 0.18.0-pr4407.8625
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/automations/tools.d.ts +8 -8
- package/dist/ci-wait/controller.d.ts +7 -7
- package/dist/delegation/transport.d.ts +65 -65
- package/dist/features/mcp/cli.d.ts +14 -0
- package/dist/features/mcp/cli.js +87 -0
- package/dist/features/mcp/cli.js.map +1 -0
- package/dist/features/mcp/index.d.ts +9 -0
- package/dist/features/mcp/index.js +13 -0
- package/dist/features/mcp/index.js.map +1 -0
- package/dist/features/mcp/stdio.d.ts +10 -0
- package/dist/features/mcp/stdio.js +41 -0
- package/dist/features/mcp/stdio.js.map +1 -0
- package/dist/features/mcp/tools.d.ts +19 -0
- package/dist/features/mcp/tools.js +476 -0
- package/dist/features/mcp/tools.js.map +1 -0
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/models-routes.d.ts +12 -12
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/providers-routes.d.ts +57 -57
- 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 +277 -277
- package/dist/server/server.d.ts +1472 -1472
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/server/workspace-routes.d.ts +84 -84
- package/dist/task-cli/cli.js +54 -221
- package/dist/task-cli/cli.js.map +1 -1
- package/dist/task-cli/discovery.d.ts +22 -1
- package/dist/task-cli/discovery.js +69 -17
- package/dist/task-cli/discovery.js.map +1 -1
- package/dist/task-cli/http.d.ts +15 -13
- package/dist/task-cli/http.js +16 -6
- package/dist/task-cli/http.js.map +1 -1
- package/dist/task-cli/operations.d.ts +156 -0
- package/dist/task-cli/operations.js +388 -0
- package/dist/task-cli/operations.js.map +1 -0
- package/dist/task-cli/watch.d.ts +31 -8
- package/dist/task-cli/watch.js +159 -91
- package/dist/task-cli/watch.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-DbLoty0g.js → accounts-section-D7EK3_7b.js} +1 -1
- package/web/dist/assets/{activity-motion-DsIybVZn.js → activity-motion-2BQBW4lA.js} +1 -1
- package/web/dist/assets/{activity-route-BXehwJ4N.js → activity-route-Ct06t8Y9.js} +1 -1
- package/web/dist/assets/{agent-config-section-BKANTX-h.js → agent-config-section-D6Lcc7c5.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-D7ohQxAI.js → agent-defaults-section-BnDBbzuG.js} +1 -1
- package/web/dist/assets/{appearance-rXtZGJD_.js → appearance-CM6ahUyy.js} +1 -1
- package/web/dist/assets/{automations-route-h7bwC5xx.js → automations-route-7B_DF4O1.js} +1 -1
- package/web/dist/assets/{commit-list-yW-pZ7Bc.js → commit-list-O4ugJ12w.js} +1 -1
- package/web/dist/assets/{diff-CfS2Qosw.js → diff-DKZvZQ2G.js} +2 -2
- package/web/dist/assets/{diff-controls-DUiipGjf.js → diff-controls-BpTFu29H.js} +1 -1
- package/web/dist/assets/{diff-view-pPxrBBze.js → diff-view-D4yXb2w7.js} +1 -1
- package/web/dist/assets/{file-preview-CGAcZe9q.js → file-preview-CUhut4J9.js} +1 -1
- package/web/dist/assets/{git-toolbar-Dwndizit.js → git-toolbar-po0QJciG.js} +1 -1
- package/web/dist/assets/{github-DJ0jdSaa.js → github-TgLTixC7.js} +1 -1
- package/web/dist/assets/{global-activity-route-BV9RmVEz.js → global-activity-route-OHCmn0ZO.js} +1 -1
- package/web/dist/assets/{image-preview-Bvd30ghX.js → image-preview-Sisptm3b.js} +1 -1
- package/web/dist/assets/{index-B-_22hXp.js → index-CvVmG4Yu.js} +5 -5
- package/web/dist/assets/{markdown-BDjWFex4.js → markdown-jle_P0a2.js} +1 -1
- package/web/dist/assets/{notifications-section-ALnp6W1u.js → notifications-section-Bhqr3yOz.js} +1 -1
- package/web/dist/assets/page-shell-DQPYcKyL.css +1 -0
- package/web/dist/assets/{preview-pane-connected-rud-axMx.js → preview-pane-connected-CBt_nlmX.js} +1 -1
- package/web/dist/assets/{projects-section-BTyOG2uL.js → projects-section-DnGSWHZJ.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-BQdQIVys.js → prompt-templates-section-8kBTviSw.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-DeCObYJC.js → remote-settings-notice-D7G8cXSx.js} +1 -1
- package/web/dist/assets/{repo-git-CegVXOtZ.js → repo-git-DqBUjQMh.js} +1 -1
- package/web/dist/assets/{report-reader-zqO4yokN.js → report-reader-DtSBGt0O.js} +1 -1
- package/web/dist/assets/{reports-DP-sxf1p.js → reports-ea3-iuBm.js} +1 -1
- package/web/dist/assets/{resources-section-B19JoAbk.js → resources-section-CpXFFHXl.js} +1 -1
- package/web/dist/assets/{run-header-PqdYTt5O.js → run-header-BWTrj0_2.js} +1 -1
- package/web/dist/assets/{select-CEH-C-jh.js → select-aiSr0uTB.js} +1 -1
- package/web/dist/assets/{session-context-section-C33VjuF4.js → session-context-section-BRaZbxVO.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-4PfVRtdT.js → settings-agent-picker-DMIqQhkC.js} +1 -1
- package/web/dist/assets/{settings-shell-CE1EKMmX.js → settings-shell-DwMbZhxp.js} +1 -1
- package/web/dist/assets/{sidebar-section-DOTH6fiq.js → sidebar-section-ClrORHpO.js} +1 -1
- package/web/dist/assets/{skills-BuxDnPg-.js → skills-B97qjJ7j.js} +1 -1
- package/web/dist/assets/{task-changes-D8rzLeLg.js → task-changes-BEfLx9dF.js} +1 -1
- package/web/dist/assets/{task-commits-BpcYm-FY.js → task-commits-6f0GpNF7.js} +1 -1
- package/web/dist/assets/{task-files-DaaC4c18.js → task-files-CA2xTRaM.js} +1 -1
- package/web/dist/assets/{task-github-item-D8kwUMZL.js → task-github-item-BWapcDJr.js} +1 -1
- package/web/dist/assets/{task-thread-9E6bYoV6.js → task-thread-0rKVutjQ.js} +1 -1
- package/web/dist/assets/{thread-state-_-bLdUA2.js → thread-state-C3eDWXYs.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-B-chm1Rk.js → use-hand-to-agent-state-DrAmCxn8.js} +1 -1
- package/web/dist/assets/{workflows-Df3RjnXf.js → workflows-CW-1K6tq.js} +1 -1
- package/web/dist/assets/{workspace-tools-CAQH-2K5.js → workspace-tools-BzDQrP3y.js} +1 -1
- package/web/dist/assets/{worktrees-section-CN78zo2m.js → worktrees-section-ay1jJn_w.js} +1 -1
- package/web/dist/index.html +3 -3
- package/web/dist/assets/page-shell-DPQBoUpR.css +0 -1
- /package/web/dist/assets/{page-shell-h8a6oznS.js → page-shell-7pLJMOgh.js} +0 -0
|
@@ -7,10 +7,6 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
|
|
|
7
7
|
}[];
|
|
8
8
|
isError: boolean;
|
|
9
9
|
details: {
|
|
10
|
-
ok: false;
|
|
11
|
-
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
12
|
-
message: string;
|
|
13
|
-
} | {
|
|
14
10
|
ok: true;
|
|
15
11
|
task: {
|
|
16
12
|
id: string;
|
|
@@ -22,6 +18,10 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
|
|
|
22
18
|
url?: string | undefined;
|
|
23
19
|
};
|
|
24
20
|
note: string;
|
|
21
|
+
} | {
|
|
22
|
+
ok: false;
|
|
23
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
24
|
+
message: string;
|
|
25
25
|
};
|
|
26
26
|
}>;
|
|
27
27
|
export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof callScheduleTask>>): {
|
|
@@ -31,10 +31,6 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
|
|
|
31
31
|
}[];
|
|
32
32
|
isError: boolean;
|
|
33
33
|
details: {
|
|
34
|
-
ok: false;
|
|
35
|
-
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
36
|
-
message: string;
|
|
37
|
-
} | {
|
|
38
34
|
ok: true;
|
|
39
35
|
task: {
|
|
40
36
|
id: string;
|
|
@@ -46,6 +42,10 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
|
|
|
46
42
|
url?: string | undefined;
|
|
47
43
|
};
|
|
48
44
|
note: string;
|
|
45
|
+
} | {
|
|
46
|
+
ok: false;
|
|
47
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
48
|
+
message: string;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
export declare function invokeScheduledTasksTool(input: unknown): Promise<{
|
|
@@ -121,9 +121,12 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
121
121
|
} & {
|
|
122
122
|
"/api/v1/tools/:name": {
|
|
123
123
|
$post: {
|
|
124
|
-
output:
|
|
124
|
+
output: {
|
|
125
|
+
code: string;
|
|
126
|
+
message: string;
|
|
127
|
+
};
|
|
125
128
|
outputFormat: "json";
|
|
126
|
-
status:
|
|
129
|
+
status: 401;
|
|
127
130
|
input: {
|
|
128
131
|
json: unknown;
|
|
129
132
|
} & {
|
|
@@ -146,12 +149,9 @@ export declare function ciToolRoutes(capabilities: Map<string, Capability>): imp
|
|
|
146
149
|
};
|
|
147
150
|
};
|
|
148
151
|
} | {
|
|
149
|
-
output:
|
|
150
|
-
code: string;
|
|
151
|
-
message: string;
|
|
152
|
-
};
|
|
152
|
+
output: never;
|
|
153
153
|
outputFormat: "json";
|
|
154
|
-
status:
|
|
154
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
155
155
|
input: {
|
|
156
156
|
json: unknown;
|
|
157
157
|
} & {
|
|
@@ -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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type DiscoverOriginOptions } from '../../task-cli/discovery.ts';
|
|
2
|
+
import { type ServeMcpStdioOptions } from './stdio.ts';
|
|
3
|
+
export declare const MCP_HELP: string;
|
|
4
|
+
export interface McpCliDeps {
|
|
5
|
+
cwd?: () => string;
|
|
6
|
+
stdout?: (line: string) => void;
|
|
7
|
+
stderr?: (line: string) => void;
|
|
8
|
+
discover?: (options: DiscoverOriginOptions) => Promise<{
|
|
9
|
+
origin: string;
|
|
10
|
+
}>;
|
|
11
|
+
serve?: (options: ServeMcpStdioOptions) => Promise<void>;
|
|
12
|
+
version?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function runMcpCommand(argv: string[], env: NodeJS.ProcessEnv, deps?: McpCliDeps): Promise<number>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { parseArgs } from 'node:util';
|
|
5
|
+
import { productEnv } from '../../core/product-env.js';
|
|
6
|
+
import { commandText } from '../../home/command.js';
|
|
7
|
+
import { discoverCockpitOrigin } from '../../task-cli/discovery.js';
|
|
8
|
+
import { TaskCliError } from '../../task-cli/http.js';
|
|
9
|
+
import { serveMcpStdio } from './stdio.js';
|
|
10
|
+
export const MCP_HELP = commandText(`Squawk MCP — stdio MCP server over Squawk task operations for outside orchestrators
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
cez mcp [--url <origin>] [--repo <dir>]
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
--url <origin> Connect to this cockpit origin instead of local discovery (also HSQ_URL / CEZ_URL).
|
|
17
|
+
--repo <dir> Match the cockpit serving this repository (default: cwd, falling back to a single local cockpit).
|
|
18
|
+
-h, --help Show this help.
|
|
19
|
+
|
|
20
|
+
Notes:
|
|
21
|
+
- Keeps stdout strictly for MCP JSON-RPC frames; diagnostics go to stderr.
|
|
22
|
+
- Refuses to start inside a Squawk task (when HSQ_TASK_ID or CEZ_TASK_ID is set).`);
|
|
23
|
+
function readPackageVersion() {
|
|
24
|
+
try {
|
|
25
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
26
|
+
const pkg = JSON.parse(readFileSync(join(here, '..', '..', '..', 'package.json'), 'utf8'));
|
|
27
|
+
return pkg.version ?? '0.0.0';
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return '0.0.0';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function parseMcpArgs(argv) {
|
|
34
|
+
try {
|
|
35
|
+
return parseArgs({
|
|
36
|
+
args: argv,
|
|
37
|
+
options: {
|
|
38
|
+
url: { type: 'string' },
|
|
39
|
+
repo: { type: 'string' },
|
|
40
|
+
help: { type: 'boolean', short: 'h', default: false },
|
|
41
|
+
},
|
|
42
|
+
allowPositionals: true,
|
|
43
|
+
strict: true,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
throw new TaskCliError(64, { code: 'invalid_input', error: error instanceof Error ? error.message : 'invalid arguments' });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function formatCliError(error) {
|
|
51
|
+
if (error instanceof TaskCliError) {
|
|
52
|
+
const msg = typeof error.body.error === 'string' ? error.body.error : error.message;
|
|
53
|
+
const hint = typeof error.body.hint === 'string' ? `\nHint: ${error.body.hint}` : '';
|
|
54
|
+
return { message: `${msg}${hint}`, exitCode: error.exitCode };
|
|
55
|
+
}
|
|
56
|
+
return { message: error instanceof Error ? error.message : String(error), exitCode: 1 };
|
|
57
|
+
}
|
|
58
|
+
export async function runMcpCommand(argv, env, deps = {}) {
|
|
59
|
+
const writeOut = deps.stdout ?? ((line) => console.log(line));
|
|
60
|
+
const writeErr = deps.stderr ?? ((line) => console.error(line));
|
|
61
|
+
try {
|
|
62
|
+
const parsed = parseMcpArgs(argv);
|
|
63
|
+
if (parsed.values.help) {
|
|
64
|
+
writeOut(MCP_HELP);
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
if (parsed.positionals.length > 0) {
|
|
68
|
+
throw new TaskCliError(64, { code: 'invalid_input', error: `unexpected argument '${parsed.positionals[0]}'` });
|
|
69
|
+
}
|
|
70
|
+
if (productEnv('TASK_ID', env)?.trim()) {
|
|
71
|
+
writeErr(commandText('cez mcp is for outside orchestrators and refuses to start inside a Squawk task (HSQ_TASK_ID / CEZ_TASK_ID is set).'));
|
|
72
|
+
return 1;
|
|
73
|
+
}
|
|
74
|
+
const url = parsed.values.url ?? (productEnv('URL', env)?.trim() || undefined);
|
|
75
|
+
const explicitRepo = parsed.values.repo !== undefined;
|
|
76
|
+
const repoDir = resolve(parsed.values.repo ?? (deps.cwd ? deps.cwd() : process.cwd()));
|
|
77
|
+
const { origin } = await (deps.discover ?? discoverCockpitOrigin)({ url, repoDir, explicitRepo });
|
|
78
|
+
await (deps.serve ?? serveMcpStdio)({ origin, version: deps.version ?? readPackageVersion() });
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
const formatted = formatCliError(error);
|
|
83
|
+
writeErr(formatted.message);
|
|
84
|
+
return formatted.exitCode;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/features/mcp/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACt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,IAAI,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAC/F,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACxC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC5B,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bundled orchestrator MCP feature (spec 2026-11-27-orchestrator-mcp-server,
|
|
3
|
+
* hearsay-tools/squawk#4401): registers `hsq mcp` through the plugin API only.
|
|
4
|
+
* Nothing outside this folder imports it.
|
|
5
|
+
*/
|
|
6
|
+
import type { CliCommandDefinition, SquawkPluginApi } from '../../plugin/index.ts';
|
|
7
|
+
/** `hsq mcp`: parses its own argv and talks to a running cockpit over loopback HTTP. */
|
|
8
|
+
export declare const mcpCliCommand: CliCommandDefinition;
|
|
9
|
+
export default function setup(api: SquawkPluginApi): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** `hsq mcp`: parses its own argv and talks to a running cockpit over loopback HTTP. */
|
|
2
|
+
export const mcpCliCommand = {
|
|
3
|
+
name: 'mcp',
|
|
4
|
+
usage: [' cez mcp [--url <origin>] [--repo <dir>] serve Squawk task tools over MCP stdio (see: mcp --help)'],
|
|
5
|
+
parseMode: 'subcommand',
|
|
6
|
+
homeMode: 'none',
|
|
7
|
+
runtimeMode: 'none',
|
|
8
|
+
load: async () => (await import('./cli.js')).runMcpCommand,
|
|
9
|
+
};
|
|
10
|
+
export default function setup(api) {
|
|
11
|
+
api.registerCliCommand(mcpCliCommand);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/mcp/index.ts"],"names":[],"mappings":"AAOA,wFAAwF;AACxF,MAAM,CAAC,MAAM,aAAa,GAAyB;IACjD,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,CAAC,qGAAqG,CAAC;IAC9G,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa;CAC3D,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAoB;IAChD,GAAG,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type OrchestratorMcpOptions } from './tools.ts';
|
|
2
|
+
export interface ServeMcpStdioOptions extends OrchestratorMcpOptions {
|
|
3
|
+
stdin?: NodeJS.ReadableStream | undefined;
|
|
4
|
+
stdout?: NodeJS.WritableStream | undefined;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Run the orchestrator MCP server over stdio until the transport closes, stdin ends, or a
|
|
8
|
+
* termination signal arrives. Keeps stdout exclusively for MCP JSON-RPC frames.
|
|
9
|
+
*/
|
|
10
|
+
export declare function serveMcpStdio(options: ServeMcpStdioOptions): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
|
+
import { createOrchestratorMcpServer } from './tools.js';
|
|
3
|
+
/**
|
|
4
|
+
* Run the orchestrator MCP server over stdio until the transport closes, stdin ends, or a
|
|
5
|
+
* termination signal arrives. Keeps stdout exclusively for MCP JSON-RPC frames.
|
|
6
|
+
*/
|
|
7
|
+
export async function serveMcpStdio(options) {
|
|
8
|
+
const server = createOrchestratorMcpServer(options);
|
|
9
|
+
const stdin = options.stdin ?? process.stdin;
|
|
10
|
+
const stdout = options.stdout ?? process.stdout;
|
|
11
|
+
const transport = new StdioServerTransport(stdin, stdout);
|
|
12
|
+
let closing = false;
|
|
13
|
+
const closeOnce = () => {
|
|
14
|
+
if (closing)
|
|
15
|
+
return;
|
|
16
|
+
closing = true;
|
|
17
|
+
void server.close().catch(() => { });
|
|
18
|
+
};
|
|
19
|
+
await new Promise((resolve, reject) => {
|
|
20
|
+
const onSignal = () => closeOnce();
|
|
21
|
+
const cleanup = () => {
|
|
22
|
+
stdin.removeListener('end', closeOnce);
|
|
23
|
+
stdin.removeListener('close', closeOnce);
|
|
24
|
+
process.removeListener('SIGINT', onSignal);
|
|
25
|
+
process.removeListener('SIGTERM', onSignal);
|
|
26
|
+
};
|
|
27
|
+
server.onclose = () => {
|
|
28
|
+
cleanup();
|
|
29
|
+
resolve();
|
|
30
|
+
};
|
|
31
|
+
stdin.once('end', closeOnce);
|
|
32
|
+
stdin.once('close', closeOnce);
|
|
33
|
+
process.once('SIGINT', onSignal);
|
|
34
|
+
process.once('SIGTERM', onSignal);
|
|
35
|
+
void server.connect(transport).catch((error) => {
|
|
36
|
+
cleanup();
|
|
37
|
+
reject(error);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=stdio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../../src/features/mcp/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAA+B,MAAM,YAAY,CAAC;AAOtF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA6B;IAC/D,MAAM,MAAM,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAChD,MAAM,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CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import { type FetchFn } from '../../task-cli/http.ts';
|
|
3
|
+
export declare const MCP_SERVER_NAME = "squawk";
|
|
4
|
+
export declare const MCP_SERVER_INSTRUCTIONS: string;
|
|
5
|
+
export interface OrchestratorMcpOptions {
|
|
6
|
+
origin: string;
|
|
7
|
+
version?: string | undefined;
|
|
8
|
+
fetch?: FetchFn | undefined;
|
|
9
|
+
pollMs?: number | undefined;
|
|
10
|
+
heartbeatMs?: number | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function formatMcpToolError(error: unknown): {
|
|
13
|
+
isError: true;
|
|
14
|
+
content: [{
|
|
15
|
+
type: 'text';
|
|
16
|
+
text: string;
|
|
17
|
+
}];
|
|
18
|
+
};
|
|
19
|
+
export declare function createOrchestratorMcpServer(options: OrchestratorMcpOptions): Server;
|