@commandgarden/cli 1.0.2 → 1.1.1
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/main.js +389 -4360
- package/node_modules/@commandgarden/app/dist/client/assets/index-58UrF1aG.js +197 -0
- package/node_modules/@commandgarden/app/dist/client/assets/index-DErcb2Kp.css +1 -0
- package/node_modules/@commandgarden/app/dist/client/index.html +19 -0
- package/node_modules/@commandgarden/app/dist/server/daemon-client.js +61 -0
- package/node_modules/@commandgarden/app/dist/server/main.js +63 -0
- package/node_modules/@commandgarden/app/dist/server/routes/audit.js +20 -0
- package/node_modules/@commandgarden/app/dist/server/routes/config.js +13 -0
- package/node_modules/@commandgarden/app/dist/server/routes/connectors.js +35 -0
- package/node_modules/@commandgarden/app/dist/server/routes/index.js +14 -0
- package/node_modules/@commandgarden/app/dist/server/routes/preferences.js +32 -0
- package/node_modules/@commandgarden/app/dist/server/routes/run.js +46 -0
- package/node_modules/@commandgarden/app/dist/server/routes/status.js +11 -0
- package/node_modules/@commandgarden/app/dist/server/store.js +55 -0
- package/node_modules/@commandgarden/app/package.json +42 -0
- package/node_modules/@commandgarden/daemon/dist/audit-store.d.ts +18 -0
- package/node_modules/@commandgarden/daemon/dist/audit-store.d.ts.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/audit-store.js +97 -0
- package/node_modules/@commandgarden/daemon/dist/audit-store.js.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/auth.d.ts +5 -0
- package/node_modules/@commandgarden/daemon/dist/auth.d.ts.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/auth.js +27 -0
- package/node_modules/@commandgarden/daemon/dist/auth.js.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/config.d.ts +109 -0
- package/node_modules/@commandgarden/daemon/dist/config.d.ts.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/config.js +45 -0
- package/node_modules/@commandgarden/daemon/dist/config.js.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/main.d.ts +2 -0
- package/node_modules/@commandgarden/daemon/dist/main.d.ts.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/main.js +58 -0
- package/node_modules/@commandgarden/daemon/dist/main.js.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/registry.d.ts +21 -0
- package/node_modules/@commandgarden/daemon/dist/registry.d.ts.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/registry.js +70 -0
- package/node_modules/@commandgarden/daemon/dist/registry.js.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/server.d.ts +15 -0
- package/node_modules/@commandgarden/daemon/dist/server.d.ts.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/server.js +336 -0
- package/node_modules/@commandgarden/daemon/dist/server.js.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/sse-manager.d.ts +10 -0
- package/node_modules/@commandgarden/daemon/dist/sse-manager.d.ts.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/sse-manager.js +37 -0
- package/node_modules/@commandgarden/daemon/dist/sse-manager.js.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/validator.d.ts +10 -0
- package/node_modules/@commandgarden/daemon/dist/validator.d.ts.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/validator.js +19 -0
- package/node_modules/@commandgarden/daemon/dist/validator.js.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/ws-relay.d.ts +30 -0
- package/node_modules/@commandgarden/daemon/dist/ws-relay.d.ts.map +1 -0
- package/node_modules/@commandgarden/daemon/dist/ws-relay.js +111 -0
- package/node_modules/@commandgarden/daemon/dist/ws-relay.js.map +1 -0
- package/node_modules/@commandgarden/daemon/package.json +30 -0
- package/node_modules/@commandgarden/shared/dist/capabilities.d.ts +7 -0
- package/node_modules/@commandgarden/shared/dist/capabilities.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/capabilities.js +23 -0
- package/node_modules/@commandgarden/shared/dist/capabilities.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/connector.d.ts +377 -0
- package/node_modules/@commandgarden/shared/dist/connector.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/connector.js +29 -0
- package/node_modules/@commandgarden/shared/dist/connector.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/events.d.ts +33 -0
- package/node_modules/@commandgarden/shared/dist/events.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/events.js +34 -0
- package/node_modules/@commandgarden/shared/dist/events.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/evaluator.d.ts +8 -0
- package/node_modules/@commandgarden/shared/dist/expression/evaluator.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/evaluator.js +49 -0
- package/node_modules/@commandgarden/shared/dist/expression/evaluator.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/filters.d.ts +3 -0
- package/node_modules/@commandgarden/shared/dist/expression/filters.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/filters.js +8 -0
- package/node_modules/@commandgarden/shared/dist/expression/filters.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/index.d.ts +5 -0
- package/node_modules/@commandgarden/shared/dist/expression/index.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/index.js +5 -0
- package/node_modules/@commandgarden/shared/dist/expression/index.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/parser.d.ts +22 -0
- package/node_modules/@commandgarden/shared/dist/expression/parser.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/parser.js +85 -0
- package/node_modules/@commandgarden/shared/dist/expression/parser.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/tokenizer.d.ts +7 -0
- package/node_modules/@commandgarden/shared/dist/expression/tokenizer.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/expression/tokenizer.js +76 -0
- package/node_modules/@commandgarden/shared/dist/expression/tokenizer.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/index.d.ts +8 -0
- package/node_modules/@commandgarden/shared/dist/index.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/index.js +15 -0
- package/node_modules/@commandgarden/shared/dist/index.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/loader.d.ts +17 -0
- package/node_modules/@commandgarden/shared/dist/loader.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/loader.js +76 -0
- package/node_modules/@commandgarden/shared/dist/loader.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/pipeline.d.ts +339 -0
- package/node_modules/@commandgarden/shared/dist/pipeline.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/pipeline.js +97 -0
- package/node_modules/@commandgarden/shared/dist/pipeline.js.map +1 -0
- package/node_modules/@commandgarden/shared/dist/protocol.d.ts +58 -0
- package/node_modules/@commandgarden/shared/dist/protocol.d.ts.map +1 -0
- package/node_modules/@commandgarden/shared/dist/protocol.js +26 -0
- package/node_modules/@commandgarden/shared/dist/protocol.js.map +1 -0
- package/node_modules/@commandgarden/shared/package.json +32 -0
- package/package.json +55 -42
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Capability } from './capabilities.js';
|
|
3
|
+
export declare const PIPELINE_STEP_TYPES: readonly ["navigate", "wait", "extract", "click", "type", "intercept", "cookie", "fetch", "map", "filter", "set", "js_evaluate"];
|
|
4
|
+
export type PipelineStepType = (typeof PIPELINE_STEP_TYPES)[number];
|
|
5
|
+
export declare const STEP_CAPABILITY_MAP: Record<PipelineStepType, Capability | null>;
|
|
6
|
+
declare const navigateStepSchema: z.ZodObject<{
|
|
7
|
+
step: z.ZodLiteral<"navigate">;
|
|
8
|
+
url: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
step: "navigate";
|
|
11
|
+
url: string;
|
|
12
|
+
}, {
|
|
13
|
+
step: "navigate";
|
|
14
|
+
url: string;
|
|
15
|
+
}>;
|
|
16
|
+
declare const waitStepSchema: z.ZodObject<{
|
|
17
|
+
step: z.ZodLiteral<"wait">;
|
|
18
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
19
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
step: "wait";
|
|
22
|
+
selector?: string | undefined;
|
|
23
|
+
timeout?: number | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
step: "wait";
|
|
26
|
+
selector?: string | undefined;
|
|
27
|
+
timeout?: number | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
declare const extractStepSchema: z.ZodObject<{
|
|
30
|
+
step: z.ZodLiteral<"extract">;
|
|
31
|
+
selector: z.ZodString;
|
|
32
|
+
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
step: "extract";
|
|
35
|
+
selector: string;
|
|
36
|
+
fields: Record<string, string>;
|
|
37
|
+
}, {
|
|
38
|
+
step: "extract";
|
|
39
|
+
selector: string;
|
|
40
|
+
fields: Record<string, string>;
|
|
41
|
+
}>;
|
|
42
|
+
declare const clickStepSchema: z.ZodObject<{
|
|
43
|
+
step: z.ZodLiteral<"click">;
|
|
44
|
+
selector: z.ZodString;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
step: "click";
|
|
47
|
+
selector: string;
|
|
48
|
+
}, {
|
|
49
|
+
step: "click";
|
|
50
|
+
selector: string;
|
|
51
|
+
}>;
|
|
52
|
+
declare const typeStepSchema: z.ZodObject<{
|
|
53
|
+
step: z.ZodLiteral<"type">;
|
|
54
|
+
selector: z.ZodString;
|
|
55
|
+
value: z.ZodString;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
step: "type";
|
|
58
|
+
value: string;
|
|
59
|
+
selector: string;
|
|
60
|
+
}, {
|
|
61
|
+
step: "type";
|
|
62
|
+
value: string;
|
|
63
|
+
selector: string;
|
|
64
|
+
}>;
|
|
65
|
+
declare const interceptStepSchema: z.ZodObject<{
|
|
66
|
+
step: z.ZodLiteral<"intercept">;
|
|
67
|
+
urlPattern: z.ZodString;
|
|
68
|
+
as: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
step: "intercept";
|
|
71
|
+
urlPattern: string;
|
|
72
|
+
as?: string | undefined;
|
|
73
|
+
}, {
|
|
74
|
+
step: "intercept";
|
|
75
|
+
urlPattern: string;
|
|
76
|
+
as?: string | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
declare const cookieStepSchema: z.ZodObject<{
|
|
79
|
+
step: z.ZodLiteral<"cookie">;
|
|
80
|
+
domain: z.ZodString;
|
|
81
|
+
name: z.ZodOptional<z.ZodString>;
|
|
82
|
+
as: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
step: "cookie";
|
|
85
|
+
domain: string;
|
|
86
|
+
as?: string | undefined;
|
|
87
|
+
name?: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
step: "cookie";
|
|
90
|
+
domain: string;
|
|
91
|
+
as?: string | undefined;
|
|
92
|
+
name?: string | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
declare const fetchStepSchema: z.ZodObject<{
|
|
95
|
+
step: z.ZodLiteral<"fetch">;
|
|
96
|
+
url: z.ZodString;
|
|
97
|
+
method: z.ZodOptional<z.ZodString>;
|
|
98
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
99
|
+
body: z.ZodOptional<z.ZodString>;
|
|
100
|
+
as: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
step: "fetch";
|
|
103
|
+
url: string;
|
|
104
|
+
as?: string | undefined;
|
|
105
|
+
method?: string | undefined;
|
|
106
|
+
headers?: Record<string, string> | undefined;
|
|
107
|
+
body?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
step: "fetch";
|
|
110
|
+
url: string;
|
|
111
|
+
as?: string | undefined;
|
|
112
|
+
method?: string | undefined;
|
|
113
|
+
headers?: Record<string, string> | undefined;
|
|
114
|
+
body?: string | undefined;
|
|
115
|
+
}>;
|
|
116
|
+
declare const mapStepSchema: z.ZodObject<{
|
|
117
|
+
step: z.ZodLiteral<"map">;
|
|
118
|
+
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
step: "map";
|
|
121
|
+
fields: Record<string, string>;
|
|
122
|
+
}, {
|
|
123
|
+
step: "map";
|
|
124
|
+
fields: Record<string, string>;
|
|
125
|
+
}>;
|
|
126
|
+
declare const filterStepSchema: z.ZodObject<{
|
|
127
|
+
step: z.ZodLiteral<"filter">;
|
|
128
|
+
field: z.ZodString;
|
|
129
|
+
operator: z.ZodEnum<["eq", "ne", "gt", "lt", "gte", "lte", "contains", "matches"]>;
|
|
130
|
+
value: z.ZodString;
|
|
131
|
+
}, "strip", z.ZodTypeAny, {
|
|
132
|
+
step: "filter";
|
|
133
|
+
value: string;
|
|
134
|
+
field: string;
|
|
135
|
+
operator: "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "contains" | "matches";
|
|
136
|
+
}, {
|
|
137
|
+
step: "filter";
|
|
138
|
+
value: string;
|
|
139
|
+
field: string;
|
|
140
|
+
operator: "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "contains" | "matches";
|
|
141
|
+
}>;
|
|
142
|
+
declare const setStepSchema: z.ZodObject<{
|
|
143
|
+
step: z.ZodLiteral<"set">;
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
value: z.ZodString;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
step: "set";
|
|
148
|
+
value: string;
|
|
149
|
+
name: string;
|
|
150
|
+
}, {
|
|
151
|
+
step: "set";
|
|
152
|
+
value: string;
|
|
153
|
+
name: string;
|
|
154
|
+
}>;
|
|
155
|
+
declare const jsEvaluateStepSchema: z.ZodObject<{
|
|
156
|
+
step: z.ZodLiteral<"js_evaluate">;
|
|
157
|
+
code: z.ZodOptional<z.ZodString>;
|
|
158
|
+
file: z.ZodOptional<z.ZodString>;
|
|
159
|
+
as: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, "strip", z.ZodTypeAny, {
|
|
161
|
+
step: "js_evaluate";
|
|
162
|
+
code?: string | undefined;
|
|
163
|
+
as?: string | undefined;
|
|
164
|
+
file?: string | undefined;
|
|
165
|
+
}, {
|
|
166
|
+
step: "js_evaluate";
|
|
167
|
+
code?: string | undefined;
|
|
168
|
+
as?: string | undefined;
|
|
169
|
+
file?: string | undefined;
|
|
170
|
+
}>;
|
|
171
|
+
export declare const pipelineStepSchema: z.ZodDiscriminatedUnion<"step", [z.ZodObject<{
|
|
172
|
+
step: z.ZodLiteral<"navigate">;
|
|
173
|
+
url: z.ZodString;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
step: "navigate";
|
|
176
|
+
url: string;
|
|
177
|
+
}, {
|
|
178
|
+
step: "navigate";
|
|
179
|
+
url: string;
|
|
180
|
+
}>, z.ZodObject<{
|
|
181
|
+
step: z.ZodLiteral<"wait">;
|
|
182
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
183
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
}, "strip", z.ZodTypeAny, {
|
|
185
|
+
step: "wait";
|
|
186
|
+
selector?: string | undefined;
|
|
187
|
+
timeout?: number | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
step: "wait";
|
|
190
|
+
selector?: string | undefined;
|
|
191
|
+
timeout?: number | undefined;
|
|
192
|
+
}>, z.ZodObject<{
|
|
193
|
+
step: z.ZodLiteral<"extract">;
|
|
194
|
+
selector: z.ZodString;
|
|
195
|
+
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
step: "extract";
|
|
198
|
+
selector: string;
|
|
199
|
+
fields: Record<string, string>;
|
|
200
|
+
}, {
|
|
201
|
+
step: "extract";
|
|
202
|
+
selector: string;
|
|
203
|
+
fields: Record<string, string>;
|
|
204
|
+
}>, z.ZodObject<{
|
|
205
|
+
step: z.ZodLiteral<"click">;
|
|
206
|
+
selector: z.ZodString;
|
|
207
|
+
}, "strip", z.ZodTypeAny, {
|
|
208
|
+
step: "click";
|
|
209
|
+
selector: string;
|
|
210
|
+
}, {
|
|
211
|
+
step: "click";
|
|
212
|
+
selector: string;
|
|
213
|
+
}>, z.ZodObject<{
|
|
214
|
+
step: z.ZodLiteral<"type">;
|
|
215
|
+
selector: z.ZodString;
|
|
216
|
+
value: z.ZodString;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
step: "type";
|
|
219
|
+
value: string;
|
|
220
|
+
selector: string;
|
|
221
|
+
}, {
|
|
222
|
+
step: "type";
|
|
223
|
+
value: string;
|
|
224
|
+
selector: string;
|
|
225
|
+
}>, z.ZodObject<{
|
|
226
|
+
step: z.ZodLiteral<"intercept">;
|
|
227
|
+
urlPattern: z.ZodString;
|
|
228
|
+
as: z.ZodOptional<z.ZodString>;
|
|
229
|
+
}, "strip", z.ZodTypeAny, {
|
|
230
|
+
step: "intercept";
|
|
231
|
+
urlPattern: string;
|
|
232
|
+
as?: string | undefined;
|
|
233
|
+
}, {
|
|
234
|
+
step: "intercept";
|
|
235
|
+
urlPattern: string;
|
|
236
|
+
as?: string | undefined;
|
|
237
|
+
}>, z.ZodObject<{
|
|
238
|
+
step: z.ZodLiteral<"cookie">;
|
|
239
|
+
domain: z.ZodString;
|
|
240
|
+
name: z.ZodOptional<z.ZodString>;
|
|
241
|
+
as: z.ZodOptional<z.ZodString>;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
step: "cookie";
|
|
244
|
+
domain: string;
|
|
245
|
+
as?: string | undefined;
|
|
246
|
+
name?: string | undefined;
|
|
247
|
+
}, {
|
|
248
|
+
step: "cookie";
|
|
249
|
+
domain: string;
|
|
250
|
+
as?: string | undefined;
|
|
251
|
+
name?: string | undefined;
|
|
252
|
+
}>, z.ZodObject<{
|
|
253
|
+
step: z.ZodLiteral<"fetch">;
|
|
254
|
+
url: z.ZodString;
|
|
255
|
+
method: z.ZodOptional<z.ZodString>;
|
|
256
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
257
|
+
body: z.ZodOptional<z.ZodString>;
|
|
258
|
+
as: z.ZodOptional<z.ZodString>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
step: "fetch";
|
|
261
|
+
url: string;
|
|
262
|
+
as?: string | undefined;
|
|
263
|
+
method?: string | undefined;
|
|
264
|
+
headers?: Record<string, string> | undefined;
|
|
265
|
+
body?: string | undefined;
|
|
266
|
+
}, {
|
|
267
|
+
step: "fetch";
|
|
268
|
+
url: string;
|
|
269
|
+
as?: string | undefined;
|
|
270
|
+
method?: string | undefined;
|
|
271
|
+
headers?: Record<string, string> | undefined;
|
|
272
|
+
body?: string | undefined;
|
|
273
|
+
}>, z.ZodObject<{
|
|
274
|
+
step: z.ZodLiteral<"map">;
|
|
275
|
+
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
276
|
+
}, "strip", z.ZodTypeAny, {
|
|
277
|
+
step: "map";
|
|
278
|
+
fields: Record<string, string>;
|
|
279
|
+
}, {
|
|
280
|
+
step: "map";
|
|
281
|
+
fields: Record<string, string>;
|
|
282
|
+
}>, z.ZodObject<{
|
|
283
|
+
step: z.ZodLiteral<"filter">;
|
|
284
|
+
field: z.ZodString;
|
|
285
|
+
operator: z.ZodEnum<["eq", "ne", "gt", "lt", "gte", "lte", "contains", "matches"]>;
|
|
286
|
+
value: z.ZodString;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
step: "filter";
|
|
289
|
+
value: string;
|
|
290
|
+
field: string;
|
|
291
|
+
operator: "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "contains" | "matches";
|
|
292
|
+
}, {
|
|
293
|
+
step: "filter";
|
|
294
|
+
value: string;
|
|
295
|
+
field: string;
|
|
296
|
+
operator: "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "contains" | "matches";
|
|
297
|
+
}>, z.ZodObject<{
|
|
298
|
+
step: z.ZodLiteral<"set">;
|
|
299
|
+
name: z.ZodString;
|
|
300
|
+
value: z.ZodString;
|
|
301
|
+
}, "strip", z.ZodTypeAny, {
|
|
302
|
+
step: "set";
|
|
303
|
+
value: string;
|
|
304
|
+
name: string;
|
|
305
|
+
}, {
|
|
306
|
+
step: "set";
|
|
307
|
+
value: string;
|
|
308
|
+
name: string;
|
|
309
|
+
}>, z.ZodObject<{
|
|
310
|
+
step: z.ZodLiteral<"js_evaluate">;
|
|
311
|
+
code: z.ZodOptional<z.ZodString>;
|
|
312
|
+
file: z.ZodOptional<z.ZodString>;
|
|
313
|
+
as: z.ZodOptional<z.ZodString>;
|
|
314
|
+
}, "strip", z.ZodTypeAny, {
|
|
315
|
+
step: "js_evaluate";
|
|
316
|
+
code?: string | undefined;
|
|
317
|
+
as?: string | undefined;
|
|
318
|
+
file?: string | undefined;
|
|
319
|
+
}, {
|
|
320
|
+
step: "js_evaluate";
|
|
321
|
+
code?: string | undefined;
|
|
322
|
+
as?: string | undefined;
|
|
323
|
+
file?: string | undefined;
|
|
324
|
+
}>]>;
|
|
325
|
+
export type PipelineStep = z.infer<typeof pipelineStepSchema>;
|
|
326
|
+
export type NavigateStep = z.infer<typeof navigateStepSchema>;
|
|
327
|
+
export type WaitStep = z.infer<typeof waitStepSchema>;
|
|
328
|
+
export type ExtractStep = z.infer<typeof extractStepSchema>;
|
|
329
|
+
export type ClickStep = z.infer<typeof clickStepSchema>;
|
|
330
|
+
export type TypeStep = z.infer<typeof typeStepSchema>;
|
|
331
|
+
export type InterceptStep = z.infer<typeof interceptStepSchema>;
|
|
332
|
+
export type CookieStep = z.infer<typeof cookieStepSchema>;
|
|
333
|
+
export type FetchStep = z.infer<typeof fetchStepSchema>;
|
|
334
|
+
export type MapStep = z.infer<typeof mapStepSchema>;
|
|
335
|
+
export type FilterStep = z.infer<typeof filterStepSchema>;
|
|
336
|
+
export type SetStep = z.infer<typeof setStepSchema>;
|
|
337
|
+
export type JsEvaluateStep = z.infer<typeof jsEvaluateStepSchema>;
|
|
338
|
+
export {};
|
|
339
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,mBAAmB,kIAGtB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAa3E,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;;;;;;;EAGtB,CAAC;AAEH,QAAA,MAAM,cAAc;;;;;;;;;;;;EAIlB,CAAC;AAEH,QAAA,MAAM,iBAAiB;;;;;;;;;;;;EAIrB,CAAC;AAEH,QAAA,MAAM,eAAe;;;;;;;;;EAGnB,CAAC;AAEH,QAAA,MAAM,cAAc;;;;;;;;;;;;EAIlB,CAAC;AAEH,QAAA,MAAM,mBAAmB;;;;;;;;;;;;EAIvB,CAAC;AAEH,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;EAKpB,CAAC;AAEH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EAOnB,CAAC;AAEH,QAAA,MAAM,aAAa;;;;;;;;;EAGjB,CAAC;AAEH,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;EAKpB,CAAC;AAEH,QAAA,MAAM,aAA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,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const PIPELINE_STEP_TYPES = [
|
|
3
|
+
'navigate', 'wait', 'extract', 'click', 'type',
|
|
4
|
+
'intercept', 'cookie', 'fetch', 'map', 'filter', 'set', 'js_evaluate',
|
|
5
|
+
];
|
|
6
|
+
export const STEP_CAPABILITY_MAP = {
|
|
7
|
+
navigate: 'navigate',
|
|
8
|
+
wait: 'navigate',
|
|
9
|
+
extract: 'dom_read',
|
|
10
|
+
click: 'dom_write',
|
|
11
|
+
type: 'dom_write',
|
|
12
|
+
intercept: 'intercept_response',
|
|
13
|
+
cookie: 'cookie_read',
|
|
14
|
+
fetch: 'cookie_read',
|
|
15
|
+
map: null,
|
|
16
|
+
filter: null,
|
|
17
|
+
set: null,
|
|
18
|
+
js_evaluate: 'js_evaluate',
|
|
19
|
+
};
|
|
20
|
+
const navigateStepSchema = z.object({
|
|
21
|
+
step: z.literal('navigate'),
|
|
22
|
+
url: z.string(),
|
|
23
|
+
});
|
|
24
|
+
const waitStepSchema = z.object({
|
|
25
|
+
step: z.literal('wait'),
|
|
26
|
+
selector: z.string().optional(),
|
|
27
|
+
timeout: z.number().positive().optional(),
|
|
28
|
+
});
|
|
29
|
+
const extractStepSchema = z.object({
|
|
30
|
+
step: z.literal('extract'),
|
|
31
|
+
selector: z.string(),
|
|
32
|
+
fields: z.record(z.string(), z.string()),
|
|
33
|
+
});
|
|
34
|
+
const clickStepSchema = z.object({
|
|
35
|
+
step: z.literal('click'),
|
|
36
|
+
selector: z.string(),
|
|
37
|
+
});
|
|
38
|
+
const typeStepSchema = z.object({
|
|
39
|
+
step: z.literal('type'),
|
|
40
|
+
selector: z.string(),
|
|
41
|
+
value: z.string(),
|
|
42
|
+
});
|
|
43
|
+
const interceptStepSchema = z.object({
|
|
44
|
+
step: z.literal('intercept'),
|
|
45
|
+
urlPattern: z.string(),
|
|
46
|
+
as: z.string().optional(),
|
|
47
|
+
});
|
|
48
|
+
const cookieStepSchema = z.object({
|
|
49
|
+
step: z.literal('cookie'),
|
|
50
|
+
domain: z.string(),
|
|
51
|
+
name: z.string().optional(),
|
|
52
|
+
as: z.string().optional(),
|
|
53
|
+
});
|
|
54
|
+
const fetchStepSchema = z.object({
|
|
55
|
+
step: z.literal('fetch'),
|
|
56
|
+
url: z.string(),
|
|
57
|
+
method: z.string().optional(),
|
|
58
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
59
|
+
body: z.string().optional(),
|
|
60
|
+
as: z.string().optional(),
|
|
61
|
+
});
|
|
62
|
+
const mapStepSchema = z.object({
|
|
63
|
+
step: z.literal('map'),
|
|
64
|
+
fields: z.record(z.string(), z.string()),
|
|
65
|
+
});
|
|
66
|
+
const filterStepSchema = z.object({
|
|
67
|
+
step: z.literal('filter'),
|
|
68
|
+
field: z.string(),
|
|
69
|
+
operator: z.enum(['eq', 'ne', 'gt', 'lt', 'gte', 'lte', 'contains', 'matches']),
|
|
70
|
+
value: z.string(),
|
|
71
|
+
});
|
|
72
|
+
const setStepSchema = z.object({
|
|
73
|
+
step: z.literal('set'),
|
|
74
|
+
name: z.string(),
|
|
75
|
+
value: z.string(),
|
|
76
|
+
});
|
|
77
|
+
const jsEvaluateStepSchema = z.object({
|
|
78
|
+
step: z.literal('js_evaluate'),
|
|
79
|
+
code: z.string().optional(),
|
|
80
|
+
file: z.string().optional(),
|
|
81
|
+
as: z.string().optional(),
|
|
82
|
+
});
|
|
83
|
+
export const pipelineStepSchema = z.discriminatedUnion('step', [
|
|
84
|
+
navigateStepSchema,
|
|
85
|
+
waitStepSchema,
|
|
86
|
+
extractStepSchema,
|
|
87
|
+
clickStepSchema,
|
|
88
|
+
typeStepSchema,
|
|
89
|
+
interceptStepSchema,
|
|
90
|
+
cookieStepSchema,
|
|
91
|
+
fetchStepSchema,
|
|
92
|
+
mapStepSchema,
|
|
93
|
+
filterStepSchema,
|
|
94
|
+
setStepSchema,
|
|
95
|
+
jsEvaluateStepSchema,
|
|
96
|
+
]);
|
|
97
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM;IAC9C,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa;CAC7D,CAAC;AAIX,MAAM,CAAC,MAAM,mBAAmB,GAAgD;IAC9E,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,oBAAoB;IAC/B,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,aAAa;IACpB,GAAG,EAAE,IAAI;IACT,MAAM,EAAE,IAAI;IACZ,GAAG,EAAE,IAAI;IACT,WAAW,EAAE,aAAa;CAC3B,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,E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AE;CAClB,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC7D,kBAAkB;IAClB,cAAc;IACd,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,oBAAoB;CACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ConnectorDef } from './connector.js';
|
|
2
|
+
import type { PipelineStepType } from './pipeline.js';
|
|
3
|
+
import type { Capability } from './capabilities.js';
|
|
4
|
+
import type { StepSummary } from './events.js';
|
|
5
|
+
export interface RunCommandRequest {
|
|
6
|
+
connector: string;
|
|
7
|
+
args: Record<string, string | number | boolean>;
|
|
8
|
+
format?: 'table' | 'json' | 'csv';
|
|
9
|
+
}
|
|
10
|
+
export interface RunCommandResponse {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
connector: string;
|
|
13
|
+
rowCount: number;
|
|
14
|
+
columns: string[];
|
|
15
|
+
data: Record<string, unknown>[];
|
|
16
|
+
error?: string;
|
|
17
|
+
durationMs: number;
|
|
18
|
+
requestId?: string;
|
|
19
|
+
requiresApproval?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ApprovalConfig {
|
|
22
|
+
approvalRequired: string[];
|
|
23
|
+
autoApproveConnectors: string[];
|
|
24
|
+
approvalTimeoutMs: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ExtensionRequest {
|
|
27
|
+
id: string;
|
|
28
|
+
connector: ConnectorDef;
|
|
29
|
+
args: Record<string, string | number | boolean>;
|
|
30
|
+
approvalConfig?: ApprovalConfig;
|
|
31
|
+
}
|
|
32
|
+
export interface ExtensionResponse {
|
|
33
|
+
id: string;
|
|
34
|
+
ok: boolean;
|
|
35
|
+
data: Record<string, unknown>[];
|
|
36
|
+
error?: string;
|
|
37
|
+
steps?: StepSummary[];
|
|
38
|
+
}
|
|
39
|
+
export interface ApprovalRequest {
|
|
40
|
+
type: 'approval.request';
|
|
41
|
+
approvalId: string;
|
|
42
|
+
requestId: string;
|
|
43
|
+
connectorKey: string;
|
|
44
|
+
stepIndex: number;
|
|
45
|
+
stepType: PipelineStepType;
|
|
46
|
+
capability: Capability;
|
|
47
|
+
description: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ApprovalResponse {
|
|
50
|
+
type: 'approval.response';
|
|
51
|
+
approvalId: string;
|
|
52
|
+
approved: boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare function isRunCommandRequest(value: unknown): value is RunCommandRequest;
|
|
55
|
+
export declare function isExtensionResponse(value: unknown): value is ExtensionResponse;
|
|
56
|
+
export declare function isApprovalRequest(value: unknown): value is ApprovalRequest;
|
|
57
|
+
export declare function isApprovalResponse(value: unknown): value is ApprovalResponse;
|
|
58
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,MAAM,WAAW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nB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAID,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAI9E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAI9E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAI1E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAI5E"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// ---------- Type guards ----------
|
|
2
|
+
export function isRunCommandRequest(value) {
|
|
3
|
+
if (value == null || typeof value !== 'object')
|
|
4
|
+
return false;
|
|
5
|
+
const obj = value;
|
|
6
|
+
return typeof obj.connector === 'string' && typeof obj.args === 'object' && obj.args !== null;
|
|
7
|
+
}
|
|
8
|
+
export function isExtensionResponse(value) {
|
|
9
|
+
if (value == null || typeof value !== 'object')
|
|
10
|
+
return false;
|
|
11
|
+
const obj = value;
|
|
12
|
+
return typeof obj.id === 'string' && typeof obj.ok === 'boolean' && Array.isArray(obj.data);
|
|
13
|
+
}
|
|
14
|
+
export function isApprovalRequest(value) {
|
|
15
|
+
if (value == null || typeof value !== 'object')
|
|
16
|
+
return false;
|
|
17
|
+
const obj = value;
|
|
18
|
+
return obj.type === 'approval.request' && typeof obj.approvalId === 'string';
|
|
19
|
+
}
|
|
20
|
+
export function isApprovalResponse(value) {
|
|
21
|
+
if (value == null || typeof value !== 'object')
|
|
22
|
+
return false;
|
|
23
|
+
const obj = value;
|
|
24
|
+
return obj.type === 'approval.response' && typeof obj.approvalId === 'string';
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAmEA,oCAAoC;AAEpC,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7D,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,OAAO,OAAO,GAAG,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC;AAChG,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7D,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,OAAO,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC9F,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7D,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,OAAO,GAAG,CAAC,IAAI,KAAK,kBAAkB,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,CAAC;AAC/E,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7D,MAAM,GAAG,GAAG,KAAgC,CAAC;IAC7C,OAAO,GAAG,CAAC,IAAI,KAAK,mBAAmB,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@commandgarden/shared",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared types and utilities for CommandGarden",
|
|
5
|
+
"private": true,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"yaml": "^2.4.0",
|
|
25
|
+
"zod": "^3.23.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^26.0.0",
|
|
29
|
+
"typescript": "^5.4.0",
|
|
30
|
+
"vitest": "^2.0.0"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,42 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@commandgarden/cli",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Enterprise browser automation CLI",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "./dist/main.js",
|
|
8
|
-
"bin": {
|
|
9
|
-
"commandgarden": "dist/main.js",
|
|
10
|
-
"cg": "dist/main.js"
|
|
11
|
-
},
|
|
12
|
-
"files": [
|
|
13
|
-
"dist"
|
|
14
|
-
],
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=20"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"browser-automation",
|
|
20
|
-
"cli",
|
|
21
|
-
"enterprise",
|
|
22
|
-
"commandgarden"
|
|
23
|
-
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "tsup",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"test
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@commandgarden/cli",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "Enterprise browser automation CLI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/main.js",
|
|
8
|
+
"bin": {
|
|
9
|
+
"commandgarden": "dist/main.js",
|
|
10
|
+
"cg": "dist/main.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"browser-automation",
|
|
20
|
+
"cli",
|
|
21
|
+
"enterprise",
|
|
22
|
+
"commandgarden"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"prepack": "node scripts/prepare-bundle.mjs",
|
|
27
|
+
"start": "node dist/main.js",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest"
|
|
30
|
+
},
|
|
31
|
+
"bundleDependencies": [
|
|
32
|
+
"@commandgarden/daemon",
|
|
33
|
+
"@commandgarden/app",
|
|
34
|
+
"@commandgarden/shared"
|
|
35
|
+
],
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@commandgarden/app": "*",
|
|
38
|
+
"@commandgarden/daemon": "*",
|
|
39
|
+
"@commandgarden/shared": "*",
|
|
40
|
+
"@fastify/static": "^8.0.0",
|
|
41
|
+
"@fastify/websocket": "^11.0.0",
|
|
42
|
+
"better-sqlite3": "^11.0.0",
|
|
43
|
+
"cli-table3": "^0.6.0",
|
|
44
|
+
"commander": "^12.0.0",
|
|
45
|
+
"fastify": "^5.0.0",
|
|
46
|
+
"yaml": "^2.4.0",
|
|
47
|
+
"zod": "^3.23.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^22.0.0",
|
|
51
|
+
"tsup": "^8.5.1",
|
|
52
|
+
"typescript": "^5.4.0",
|
|
53
|
+
"vitest": "^2.0.0"
|
|
54
|
+
}
|
|
55
|
+
}
|