@hearsay-tools/squawk 0.19.0-pr4573.9072 → 0.19.0-pr4574.9076
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/built-in-cli-commands.js +6 -1
- package/dist/built-in-cli-commands.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +7 -7
- package/dist/cli-dispatch.d.ts +2 -1
- package/dist/cli-dispatch.js +20 -7
- package/dist/cli-dispatch.js.map +1 -1
- package/dist/contract/hosts.d.ts +161 -0
- package/dist/contract/index.js +116 -0
- package/dist/core/cli-registry.d.ts +1 -0
- package/dist/core/cli-registry.js.map +1 -1
- package/dist/delegation/routes.d.ts +78 -78
- package/dist/features/automations/tools.d.ts +8 -8
- package/dist/features/hosts/cli.d.ts +59 -0
- package/dist/features/hosts/cli.js +28 -17
- package/dist/features/hosts/cli.js.map +1 -1
- package/dist/features/hosts/host-server-cli.d.ts +13 -0
- package/dist/features/hosts/host-server-cli.js +246 -0
- package/dist/features/hosts/host-server-cli.js.map +1 -0
- package/dist/features/hosts/host-server.d.ts +51 -0
- package/dist/features/hosts/host-server.js +407 -0
- package/dist/features/hosts/host-server.js.map +1 -0
- package/dist/features/hosts/index.d.ts +2 -0
- package/dist/features/hosts/index.js +12 -0
- package/dist/features/hosts/index.js.map +1 -1
- package/dist/features/hosts/runtime-archive.d.ts +103 -0
- package/dist/features/hosts/runtime-archive.js +619 -0
- package/dist/features/hosts/runtime-archive.js.map +1 -0
- package/dist/features/hosts/start-methods.d.ts +65 -0
- package/dist/features/hosts/start-methods.js +213 -0
- package/dist/features/hosts/start-methods.js.map +1 -0
- package/dist/features/hosts/tar-gz.d.ts +30 -0
- package/dist/features/hosts/tar-gz.js +143 -0
- package/dist/features/hosts/tar-gz.js.map +1 -0
- package/dist/host-server-store.d.ts +103 -0
- package/dist/host-server-store.js +348 -0
- package/dist/host-server-store.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/serve-command.d.ts +10 -1
- package/dist/serve-command.js +63 -9
- package/dist/serve-command.js.map +1 -1
- 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/projects-routes.d.ts +73 -73
- package/dist/server/providers-routes.d.ts +58 -58
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +995 -995
- package/dist/server/server.d.ts +739 -739
- package/dist/server/workspace-identity-routes.d.ts +5 -5
- package/dist/server/workspace-routes.d.ts +85 -85
- package/package.json +4 -4
|
@@ -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;
|
|
@@ -956,11 +942,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
956
942
|
} & {
|
|
957
943
|
json: Record<string, never>;
|
|
958
944
|
};
|
|
959
|
-
}
|
|
960
|
-
};
|
|
961
|
-
} & {
|
|
962
|
-
"/:workerId/steer": {
|
|
963
|
-
$post: {
|
|
945
|
+
} | {
|
|
964
946
|
output: {
|
|
965
947
|
error: string;
|
|
966
948
|
code?: "invalid_input" | undefined;
|
|
@@ -972,11 +954,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
972
954
|
workerId: string;
|
|
973
955
|
};
|
|
974
956
|
} & {
|
|
975
|
-
json:
|
|
976
|
-
text: string;
|
|
977
|
-
};
|
|
957
|
+
json: Record<string, never>;
|
|
978
958
|
};
|
|
979
|
-
}
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
} & {
|
|
962
|
+
"/:workerId/steer": {
|
|
963
|
+
$post: {
|
|
980
964
|
output: {
|
|
981
965
|
workerId: string;
|
|
982
966
|
state: "delivered" | "queued";
|
|
@@ -992,11 +976,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
992
976
|
text: string;
|
|
993
977
|
};
|
|
994
978
|
};
|
|
995
|
-
}
|
|
996
|
-
};
|
|
997
|
-
} & {
|
|
998
|
-
"/:workerId/stop": {
|
|
999
|
-
$post: {
|
|
979
|
+
} | {
|
|
1000
980
|
output: {
|
|
1001
981
|
error: string;
|
|
1002
982
|
code?: "invalid_input" | undefined;
|
|
@@ -1008,9 +988,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1008
988
|
workerId: string;
|
|
1009
989
|
};
|
|
1010
990
|
} & {
|
|
1011
|
-
json:
|
|
991
|
+
json: {
|
|
992
|
+
text: string;
|
|
993
|
+
};
|
|
1012
994
|
};
|
|
1013
|
-
}
|
|
995
|
+
};
|
|
996
|
+
};
|
|
997
|
+
} & {
|
|
998
|
+
"/:workerId/stop": {
|
|
999
|
+
$post: {
|
|
1014
1000
|
output: {
|
|
1015
1001
|
workerId: string;
|
|
1016
1002
|
state: "stopping" | "terminated";
|
|
@@ -1024,11 +1010,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1024
1010
|
} & {
|
|
1025
1011
|
json: Record<string, never>;
|
|
1026
1012
|
};
|
|
1027
|
-
}
|
|
1028
|
-
};
|
|
1029
|
-
} & {
|
|
1030
|
-
"/:workerId/destroy": {
|
|
1031
|
-
$post: {
|
|
1013
|
+
} | {
|
|
1032
1014
|
output: {
|
|
1033
1015
|
error: string;
|
|
1034
1016
|
code?: "invalid_input" | undefined;
|
|
@@ -1040,11 +1022,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1040
1022
|
workerId: string;
|
|
1041
1023
|
};
|
|
1042
1024
|
} & {
|
|
1043
|
-
json:
|
|
1044
|
-
discardWork?: true | undefined;
|
|
1045
|
-
};
|
|
1025
|
+
json: Record<string, never>;
|
|
1046
1026
|
};
|
|
1047
|
-
}
|
|
1027
|
+
};
|
|
1028
|
+
};
|
|
1029
|
+
} & {
|
|
1030
|
+
"/:workerId/destroy": {
|
|
1031
|
+
$post: {
|
|
1048
1032
|
output: {
|
|
1049
1033
|
workerId: string;
|
|
1050
1034
|
state: "complete" | "incomplete";
|
|
@@ -1073,6 +1057,22 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1073
1057
|
discardWork?: true | undefined;
|
|
1074
1058
|
};
|
|
1075
1059
|
};
|
|
1060
|
+
} | {
|
|
1061
|
+
output: {
|
|
1062
|
+
error: string;
|
|
1063
|
+
code?: "invalid_input" | undefined;
|
|
1064
|
+
};
|
|
1065
|
+
outputFormat: "json";
|
|
1066
|
+
status: 400;
|
|
1067
|
+
input: {
|
|
1068
|
+
param: {
|
|
1069
|
+
workerId: string;
|
|
1070
|
+
};
|
|
1071
|
+
} & {
|
|
1072
|
+
json: {
|
|
1073
|
+
discardWork?: true | undefined;
|
|
1074
|
+
};
|
|
1075
|
+
};
|
|
1076
1076
|
} | {
|
|
1077
1077
|
output: {
|
|
1078
1078
|
workerId: string;
|
|
@@ -1108,11 +1108,18 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1108
1108
|
"/:workerId/summary": {
|
|
1109
1109
|
$post: {
|
|
1110
1110
|
output: {
|
|
1111
|
-
|
|
1112
|
-
|
|
1111
|
+
workerId: string;
|
|
1112
|
+
revision: number;
|
|
1113
|
+
source: "assistant" | "failure";
|
|
1114
|
+
seq: number;
|
|
1115
|
+
totalLines: number;
|
|
1116
|
+
offset: number;
|
|
1117
|
+
lineCount: number;
|
|
1118
|
+
text: string;
|
|
1119
|
+
nextOffset?: number | undefined;
|
|
1113
1120
|
};
|
|
1114
1121
|
outputFormat: "json";
|
|
1115
|
-
status:
|
|
1122
|
+
status: 200;
|
|
1116
1123
|
input: {
|
|
1117
1124
|
param: {
|
|
1118
1125
|
workerId: string;
|
|
@@ -1125,18 +1132,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1125
1132
|
};
|
|
1126
1133
|
} | {
|
|
1127
1134
|
output: {
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
source: "assistant" | "failure";
|
|
1131
|
-
seq: number;
|
|
1132
|
-
totalLines: number;
|
|
1133
|
-
offset: number;
|
|
1134
|
-
lineCount: number;
|
|
1135
|
-
text: string;
|
|
1136
|
-
nextOffset?: number | undefined;
|
|
1135
|
+
error: string;
|
|
1136
|
+
code?: "invalid_input" | undefined;
|
|
1137
1137
|
};
|
|
1138
1138
|
outputFormat: "json";
|
|
1139
|
-
status:
|
|
1139
|
+
status: 400;
|
|
1140
1140
|
input: {
|
|
1141
1141
|
param: {
|
|
1142
1142
|
workerId: string;
|
|
@@ -1153,11 +1153,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1153
1153
|
"/:workerId/diff": {
|
|
1154
1154
|
$get: {
|
|
1155
1155
|
output: {
|
|
1156
|
-
|
|
1157
|
-
|
|
1156
|
+
workerId: string;
|
|
1157
|
+
baselineSha: string;
|
|
1158
|
+
diff: string;
|
|
1159
|
+
truncated: boolean;
|
|
1158
1160
|
};
|
|
1159
1161
|
outputFormat: "json";
|
|
1160
|
-
status:
|
|
1162
|
+
status: 200;
|
|
1161
1163
|
input: {
|
|
1162
1164
|
param: {
|
|
1163
1165
|
workerId: string;
|
|
@@ -1165,13 +1167,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
1165
1167
|
};
|
|
1166
1168
|
} | {
|
|
1167
1169
|
output: {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
diff: string;
|
|
1171
|
-
truncated: boolean;
|
|
1170
|
+
error: string;
|
|
1171
|
+
code?: "invalid_input" | undefined;
|
|
1172
1172
|
};
|
|
1173
1173
|
outputFormat: "json";
|
|
1174
|
-
status:
|
|
1174
|
+
status: 400;
|
|
1175
1175
|
input: {
|
|
1176
1176
|
param: {
|
|
1177
1177
|
workerId: string;
|
|
@@ -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;
|
|
@@ -23,6 +19,10 @@ export declare function invokeScheduleTaskTool(input: unknown): Promise<{
|
|
|
23
19
|
url?: string | undefined;
|
|
24
20
|
};
|
|
25
21
|
note: string;
|
|
22
|
+
} | {
|
|
23
|
+
ok: false;
|
|
24
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
25
|
+
message: string;
|
|
26
26
|
};
|
|
27
27
|
}>;
|
|
28
28
|
export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof callScheduleTask>>): {
|
|
@@ -32,10 +32,6 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
|
|
|
32
32
|
}[];
|
|
33
33
|
isError: boolean;
|
|
34
34
|
details: {
|
|
35
|
-
ok: false;
|
|
36
|
-
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
37
|
-
message: string;
|
|
38
|
-
} | {
|
|
39
35
|
ok: true;
|
|
40
36
|
task: {
|
|
41
37
|
id: string;
|
|
@@ -48,6 +44,10 @@ export declare function formatScheduleTaskTool(answer: Awaited<ReturnType<typeof
|
|
|
48
44
|
url?: string | undefined;
|
|
49
45
|
};
|
|
50
46
|
note: string;
|
|
47
|
+
} | {
|
|
48
|
+
ok: false;
|
|
49
|
+
code: "automations_off" | "conflict" | "invalid_request" | "not_found" | "unavailable";
|
|
50
|
+
message: string;
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
export declare function invokeScheduledTasksTool(input: unknown): Promise<{
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `hsq host add | list | remove` (spec § Architecture 1, hearsay-tools/squawk#4537).
|
|
3
|
+
*
|
|
4
|
+
* Host-operator CLI for managing `<config>/hosts.json` directly through `HomeStore`.
|
|
5
|
+
* Works with no cockpit running; running cockpits of the same home see updates on the next read.
|
|
6
|
+
*/
|
|
7
|
+
import { type ParseArgsOptionsConfig } from 'node:util';
|
|
1
8
|
import type { Home } from '../../home/home.ts';
|
|
2
9
|
export declare const HOST_CLI_USAGE: string;
|
|
3
10
|
export interface HostCliDeps {
|
|
@@ -5,4 +12,56 @@ export interface HostCliDeps {
|
|
|
5
12
|
stdout?: (line: string) => void;
|
|
6
13
|
stderr?: (line: string) => void;
|
|
7
14
|
}
|
|
15
|
+
export interface HostCliIo {
|
|
16
|
+
stdout(line: string): void;
|
|
17
|
+
stderr(line: string): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class HostCliUsageError extends Error {
|
|
20
|
+
}
|
|
21
|
+
export declare function resolveHostCliIo(deps: Pick<HostCliDeps, 'stdout' | 'stderr'>): HostCliIo;
|
|
22
|
+
export declare function isHostCliHelp(argv: readonly string[]): boolean;
|
|
23
|
+
export declare function parseStrictHostArgs<T extends ParseArgsOptionsConfig>(argv: string[], options: T): {
|
|
24
|
+
values: T & {
|
|
25
|
+
json: {
|
|
26
|
+
type: "boolean";
|
|
27
|
+
default: false;
|
|
28
|
+
};
|
|
29
|
+
help: {
|
|
30
|
+
type: "boolean";
|
|
31
|
+
short: string;
|
|
32
|
+
default: false;
|
|
33
|
+
};
|
|
34
|
+
} extends ParseArgsOptionsConfig ? (T & {
|
|
35
|
+
json: {
|
|
36
|
+
type: "boolean";
|
|
37
|
+
default: false;
|
|
38
|
+
};
|
|
39
|
+
help: {
|
|
40
|
+
type: "boolean";
|
|
41
|
+
short: string;
|
|
42
|
+
default: false;
|
|
43
|
+
};
|
|
44
|
+
} extends infer T_1 extends ParseArgsOptionsConfig ? { -readonly [LongOption in keyof T_1]?: V[LongOption]; } : never) & (T & {
|
|
45
|
+
json: {
|
|
46
|
+
type: "boolean";
|
|
47
|
+
default: false;
|
|
48
|
+
};
|
|
49
|
+
help: {
|
|
50
|
+
type: "boolean";
|
|
51
|
+
short: string;
|
|
52
|
+
default: false;
|
|
53
|
+
};
|
|
54
|
+
} extends infer T_2 extends ParseArgsOptionsConfig ? { [LongOption in keyof T_2 as (T & {
|
|
55
|
+
json: {
|
|
56
|
+
type: "boolean";
|
|
57
|
+
default: false;
|
|
58
|
+
};
|
|
59
|
+
help: {
|
|
60
|
+
type: "boolean";
|
|
61
|
+
short: string;
|
|
62
|
+
default: false;
|
|
63
|
+
};
|
|
64
|
+
})[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption]; } : never) extends infer P ? { [K in keyof P]: P[K]; } : never : {};
|
|
65
|
+
positionals: string[];
|
|
66
|
+
};
|
|
8
67
|
export declare function runHostCommand(argv: string[], _env: NodeJS.ProcessEnv, deps?: HostCliDeps): Promise<number>;
|
|
@@ -14,24 +14,23 @@ export const HOST_CLI_USAGE = commandText(`usage:
|
|
|
14
14
|
cez host list [--json] list saved remote hosts
|
|
15
15
|
cez host remove <id> [--json]
|
|
16
16
|
remove a saved remote host`);
|
|
17
|
-
class HostCliUsageError extends Error {
|
|
17
|
+
export class HostCliUsageError extends Error {
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
return Number(value);
|
|
19
|
+
export function resolveHostCliIo(deps) {
|
|
20
|
+
return {
|
|
21
|
+
stdout: deps.stdout ?? ((line) => console.log(line)),
|
|
22
|
+
stderr: deps.stderr ?? ((line) => console.error(line)),
|
|
23
|
+
};
|
|
26
24
|
}
|
|
27
|
-
function
|
|
25
|
+
export function isHostCliHelp(argv) {
|
|
26
|
+
return argv.length === 0 || argv[0] === 'help' || argv.includes('--help') || argv.includes('-h');
|
|
27
|
+
}
|
|
28
|
+
export function parseStrictHostArgs(argv, options) {
|
|
28
29
|
try {
|
|
29
30
|
return parseArgs({
|
|
30
31
|
args: argv,
|
|
31
32
|
options: {
|
|
32
|
-
|
|
33
|
-
label: { type: 'string' },
|
|
34
|
-
port: { type: 'string' },
|
|
33
|
+
...options,
|
|
35
34
|
json: { type: 'boolean', default: false },
|
|
36
35
|
help: { type: 'boolean', short: 'h', default: false },
|
|
37
36
|
},
|
|
@@ -43,6 +42,21 @@ function parseHostArgv(argv) {
|
|
|
43
42
|
throw new HostCliUsageError(error instanceof Error ? error.message : 'invalid arguments');
|
|
44
43
|
}
|
|
45
44
|
}
|
|
45
|
+
function parsePortFlag(value) {
|
|
46
|
+
if (value === undefined)
|
|
47
|
+
return undefined;
|
|
48
|
+
if (!/^[1-9]\d{0,4}$/.test(value) || Number(value) > 65_535) {
|
|
49
|
+
throw new HostCliUsageError(`--port must be an integer between 1 and 65535, not "${value}"`);
|
|
50
|
+
}
|
|
51
|
+
return Number(value);
|
|
52
|
+
}
|
|
53
|
+
function parseHostArgv(argv) {
|
|
54
|
+
return parseStrictHostArgs(argv, {
|
|
55
|
+
id: { type: 'string' },
|
|
56
|
+
label: { type: 'string' },
|
|
57
|
+
port: { type: 'string' },
|
|
58
|
+
});
|
|
59
|
+
}
|
|
46
60
|
function formatHostRow(entry, idWidth, labelWidth) {
|
|
47
61
|
const portSuffix = entry.port !== undefined ? ` port=${entry.port}` : '';
|
|
48
62
|
return ` · ${entry.id.padEnd(idWidth)} ${entry.label.padEnd(labelWidth)} unreachable (${HOST_NOT_CONNECTED_REASON}) ssh=${entry.sshAlias}${portSuffix}`;
|
|
@@ -137,11 +151,8 @@ function reportCliError(error, json, io) {
|
|
|
137
151
|
return exitCode;
|
|
138
152
|
}
|
|
139
153
|
export async function runHostCommand(argv, _env, deps = {}) {
|
|
140
|
-
const io =
|
|
141
|
-
|
|
142
|
-
stderr: deps.stderr ?? ((line) => console.error(line)),
|
|
143
|
-
};
|
|
144
|
-
if (argv.length === 0 || argv[0] === 'help' || argv.includes('--help') || argv.includes('-h')) {
|
|
154
|
+
const io = resolveHostCliIo(deps);
|
|
155
|
+
if (isHostCliHelp(argv)) {
|
|
145
156
|
io.stdout(HOST_CLI_USAGE);
|
|
146
157
|
return 0;
|
|
147
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/features/hosts/cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/features/hosts/cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAA+B,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAkB,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3F,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;;;;;uDAKa,CAAC,CAAC;AAazD,MAAM,OAAO,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,MAAM,UAAU,gBAAgB,CAAC,IAA4C;IAC3E,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,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;QACpD,MAAM,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,WAAW,CAAC;QACtC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAC1B,OAAO,CAAC,CAAC;QACX,CAAC;QACD,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,iBAAiB,CAAC,4BAA4B,MAAM,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACzB,IAAI,MAAM,KAAK,MAAM;YAAE,OAAO,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9D,IAAI,MAAM,KAAK,KAAK;YAAE,OAAO,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5D,OAAO,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Home } from '../../home/home.ts';
|
|
2
|
+
import { type HostServerOpsDeps } from './host-server.ts';
|
|
3
|
+
import { type RuntimeInstallDeps } from './runtime-archive.ts';
|
|
4
|
+
export declare const HOST_SERVER_CLI_USAGE: string;
|
|
5
|
+
export interface HostServerCliDeps {
|
|
6
|
+
home?: () => Home;
|
|
7
|
+
stdout?: (line: string) => void;
|
|
8
|
+
stderr?: (line: string) => void;
|
|
9
|
+
ops?: HostServerOpsDeps;
|
|
10
|
+
runtimeInstall?: RuntimeInstallDeps;
|
|
11
|
+
readOwnVersion?: () => string;
|
|
12
|
+
}
|
|
13
|
+
export declare function runHostServerCommand(argv: string[], env: NodeJS.ProcessEnv, deps?: HostServerCliDeps): Promise<number>;
|