@sudohackin/toolring-mcp 0.0.0-stage → 0.10.0
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/AGENT-INSTRUCTIONS.ru.md +136 -0
- package/LICENSE +21 -0
- package/README.md +1144 -2
- package/RUN-BASH.ru.md +34 -0
- package/TOOL-STDOUT.md +50 -0
- package/bin/toolring.js +2 -0
- package/dist/argv-policy.d.ts +493 -0
- package/dist/argv-policy.js +211 -0
- package/dist/argv-policy.js.map +1 -0
- package/dist/bash-process.d.ts +3 -0
- package/dist/bash-process.js +98 -0
- package/dist/bash-process.js.map +1 -0
- package/dist/bash-when.d.ts +44 -0
- package/dist/bash-when.js +119 -0
- package/dist/bash-when.js.map +1 -0
- package/dist/call-policy.d.ts +20 -0
- package/dist/call-policy.js +74 -0
- package/dist/call-policy.js.map +1 -0
- package/dist/call.d.ts +107 -0
- package/dist/call.js +90 -0
- package/dist/call.js.map +1 -0
- package/dist/catalog.d.ts +30 -0
- package/dist/catalog.js +34 -0
- package/dist/catalog.js.map +1 -0
- package/dist/command-plan.d.ts +34 -0
- package/dist/command-plan.js +229 -0
- package/dist/command-plan.js.map +1 -0
- package/dist/config.d.ts +4559 -0
- package/dist/config.js +459 -0
- package/dist/config.js.map +1 -0
- package/dist/connections.d.ts +17 -0
- package/dist/connections.js +87 -0
- package/dist/connections.js.map +1 -0
- package/dist/default-tools.yaml +15 -0
- package/dist/executor.d.ts +39 -0
- package/dist/executor.js +166 -0
- package/dist/executor.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +288 -0
- package/dist/index.js.map +1 -0
- package/dist/module-contract.d.ts +98 -0
- package/dist/module-contract.js +4 -0
- package/dist/module-contract.js.map +1 -0
- package/dist/modules/json.d.ts +14 -0
- package/dist/modules/json.js +14 -0
- package/dist/modules/json.js.map +1 -0
- package/dist/modules/text.d.ts +14 -0
- package/dist/modules/text.js +14 -0
- package/dist/modules/text.js.map +1 -0
- package/dist/modules.d.ts +17 -0
- package/dist/modules.js +113 -0
- package/dist/modules.js.map +1 -0
- package/dist/pipeline-io.d.ts +15 -0
- package/dist/pipeline-io.js +112 -0
- package/dist/pipeline-io.js.map +1 -0
- package/dist/pipeline-parser.d.ts +8 -0
- package/dist/pipeline-parser.js +111 -0
- package/dist/pipeline-parser.js.map +1 -0
- package/dist/pipeline.d.ts +32 -0
- package/dist/pipeline.js +409 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/schema.d.ts +38 -0
- package/dist/schema.js +113 -0
- package/dist/schema.js.map +1 -0
- package/dist/server.d.ts +38 -0
- package/dist/server.js +447 -0
- package/dist/server.js.map +1 -0
- package/dist/stdout-protocol.d.ts +4 -0
- package/dist/stdout-protocol.js +21 -0
- package/dist/stdout-protocol.js.map +1 -0
- package/dist/tool-stream.d.ts +6 -0
- package/dist/tool-stream.js +30 -0
- package/dist/tool-stream.js.map +1 -0
- package/docs/bash-policy.ru.md +211 -0
- package/package.json +68 -4
- package/skills/toolring/SKILL.md +22 -0
- package/skills/toolring-authoring/SKILL.md +63 -0
package/RUN-BASH.ru.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Один вызов `run_bash`
|
|
2
|
+
|
|
3
|
+
Если в `tools/list` есть `run_bash`, передай пайп строкой в `arguments.script` вызова MCP `tools/call`. Пример ниже содержит параметры `tools/call` для профиля `examples/pipeline.yaml`.
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"name": "run_bash",
|
|
8
|
+
"arguments": {
|
|
9
|
+
"script": "jenkins_info --job mobile/app | jq -r '.fullName' | jenkins_build --job @stdin --branch main"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`jenkins_info` возвращает JSON. Команда `jq -r` извлекает строку `mobile/app`. Тул `jenkins_build` получает параметры `{"job":"mobile/app","branch":"main"}`. Агенту возвращается результат последней стадии.
|
|
15
|
+
|
|
16
|
+
- Соединяй опубликованные MCP-тулы и разрешённые внешние команды через `|`. Для одного поля можно сократить первые две стадии до `jenkins_info --job mobile/app --field fullName`.
|
|
17
|
+
- Пиши `@stdin` отдельным словом без кавычек. Вывод предыдущей стадии должен содержать одну непустую строку. Пробелы внутри неё сохраняются в одном аргументе.
|
|
18
|
+
- Известные значения передавай флагами, например `--branch main`. Для переменной укажи `"vars": {"BRANCH": "main"}` рядом с `script` и используй `--branch "$BRANCH"` внутри пайпа.
|
|
19
|
+
|
|
20
|
+
Если профиль включает `allow-unpublished-tools: true`, бери имя стадии из `operations[].call` в `toolring_catalog`. Например, `jenkins.getJobInfo --job mobile/app --field fullName | jenkins.buildJob --job @stdin`. Обе стадии должны быть разрешены `bash-policy` и `call-policy`. Флаги передают строки, включая значения из `@stdin`. Для чисел, булевых значений и вложенных объектов передай один JSON-объект в кавычках или по stdin. Для операции с подключением укажи `--connection ИМЯ` из каталога.
|
|
21
|
+
|
|
22
|
+
Чтобы проверить пайп перед запуском, добавь `dryRun: true` в аргументы этого же MCP-тула:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{"name":"run_bash","arguments":{"dryRun":true,"script":"jenkins_info --job mobile/app --field fullName | jenkins_build --job @stdin"}}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Ответ перечислит решение и причину для каждой стадии. `confirm` означает, что при запуске понадобится подтверждение. `pending` означает, что окончательная проверка ждёт stdout предыдущей стадии. При `deny` смотри `reason` в `structuredContent.stages`. Предпросмотр не запускает процессы и обработчики, поэтому ошибки внутри самих инструментов могут обнаружиться только при исполнении. Для исполнения повтори вызов без `dryRun`. Серверный флаг `serve --dry-run` включает предпросмотр для всех вызовов.
|
|
29
|
+
|
|
30
|
+
Сервер проверяет команды до старта, а значение `@stdin` — перед запуском получателя. При `confirm` клиент запрашивает разрешение на вычисленный вызов.
|
|
31
|
+
|
|
32
|
+
В пайпе `jenkins_logs_tail | grep ERROR` команда читает потоковый вывод тула по мере поступления. Агент получает итог после завершения пайпа. [API потоковых тулов](TOOL-STDOUT.md)
|
|
33
|
+
|
|
34
|
+
Если `grep` завершился с кодом 1, пайп продолжится с его stdout, обычно пустым. Например, `jenkins_logs_tail | grep ERROR` без совпадений вернёт пустой текст. Ошибки команд по-прежнему прерывают пайп.
|
package/TOOL-STDOUT.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Streaming tool output
|
|
2
|
+
|
|
3
|
+
## Implement a toolring handler
|
|
4
|
+
|
|
5
|
+
Return an async iterable of strings or `Uint8Array` chunks from a named module operation or a default handler. Each string is encoded as UTF-8. Bytes pass through unchanged. Supply line endings when producing lines. This example tails a log endpoint supplied by the deployment.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import type { ToolContext, ToolOutputStream } from "@sudohackin/toolring-mcp/module";
|
|
9
|
+
|
|
10
|
+
export async function* logs(_: object, { signal }: ToolContext): ToolOutputStream {
|
|
11
|
+
const response = await fetch(process.env.BUILD_LOG_URL!, { signal });
|
|
12
|
+
if (!response.ok || !response.body) throw new Error(`Log source returned ${response.status}`);
|
|
13
|
+
const reader = response.body.getReader();
|
|
14
|
+
try {
|
|
15
|
+
while (true) {
|
|
16
|
+
const { value, done } = await reader.read();
|
|
17
|
+
if (done) return;
|
|
18
|
+
yield value;
|
|
19
|
+
}
|
|
20
|
+
} finally {
|
|
21
|
+
reader.releaseLock();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Publish the operation as `jenkins_logs_tail` and allow the two stages in the profile. The agent calls `run_bash` with `{"script":"jenkins_logs_tail | grep ERROR"}`. The external process reads chunks during production. Its stdin applies backpressure. Returning signals EOF. Throwing fails the pipeline, and a closed reader or cancelled call aborts `signal`. Pass the signal to blocking I/O and release resources in `finally`.
|
|
27
|
+
|
|
28
|
+
The runner prechecks every stage before streaming starts and checks dynamic arguments when they resolve. A live consumer may already have processed bytes if the producer later fails. `@stdin`, JSON tool arguments and `--field` need a complete value. These boundaries buffer up to 256 KiB. An ordinary direct MCP tool call collects a stream into a UTF-8 text result with the same buffer limit and usual display truncation. A Bash group has a 30-second timeout and a 256 KiB combined stdout/stderr limit. The agent receives the final `run_bash` result when the pipeline ends.
|
|
29
|
+
|
|
30
|
+
From a terminal, `toolring call jenkins_logs_tail | grep ERROR` streams handler bytes directly to the shell pipe. If the generator throws after yielding data, the reader keeps the bytes already written and `toolring call` reports the error on stderr with exit status 1. Enable Bash's `set -o pipefail` to propagate a producer failure through the pipeline.
|
|
31
|
+
|
|
32
|
+
## Implement stdout v1 over MCP
|
|
33
|
+
|
|
34
|
+
Independent servers and clients can use the following toolring extension on a direct `tools/call`. It uses MCP notifications and namespaced request/result metadata. [MCP message and metadata format](https://modelcontextprotocol.io/specification/2025-11-25/basic)
|
|
35
|
+
|
|
36
|
+
1. The server advertises `"experimental":{"io.github.config2mcp/stdout":{"version":1}}` in its initialization capabilities.
|
|
37
|
+
2. The client registers its notification handler before sending the request. To receive bytes, it includes the following metadata in **call params**, alongside `name` and `arguments`. Choose a distinct nonempty token for each in-flight call in the session.
|
|
38
|
+
3. For an iterable result, the server sends each frame in order, awaiting transport sends. Each frame carries the token, a zero-based consecutive sequence number and standard base64 for up to 49,152 bytes. Concatenate decoded bytes in order. Chunk boundaries may split lines or UTF-8 characters.
|
|
39
|
+
4. The final successful result carries the token and total frame count. An empty stream has zero frames. Check the sequence and count before accepting completion. An error, cancellation, disconnect or gap leaves a partial stream. Cancel using the ordinary MCP request ID.
|
|
40
|
+
5. Without v1 opt-in, return the usual tool result. With opt-in, a tool producing an ordinary value still returns its usual result. The terminal metadata identifies a streamed result. Each call chooses its own mode.
|
|
41
|
+
|
|
42
|
+
The following exchange uses an initialized connection. Each line is a JSON-RPC message.
|
|
43
|
+
|
|
44
|
+
```jsonl
|
|
45
|
+
{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"jenkins_logs_tail","arguments":{},"_meta":{"io.github.config2mcp/stdout":{"version":1,"token":"logs-7"}}}}
|
|
46
|
+
{"jsonrpc":"2.0","method":"notifications/io.github.config2mcp/stdout","params":{"token":"logs-7","seq":0,"data":"RVJST1IK"}}
|
|
47
|
+
{"jsonrpc":"2.0","id":7,"result":{"content":[],"_meta":{"io.github.config2mcp/stdout":{"version":1,"token":"logs-7","chunks":1}}}}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The example frame decodes to `ERROR\n`. The notification stream delivers bytes and has no per-frame acknowledgement. MCP progress reporting remains available separately. In a toolring pipeline, locally registered handlers supply their iterable directly to the runner.
|
package/bin/toolring.js
ADDED
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const argumentPattern: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
3
|
+
oneOf: z.ZodArray<z.ZodString, "atleastone">;
|
|
4
|
+
}, "strict", z.ZodTypeAny, {
|
|
5
|
+
oneOf: [string, ...string[]];
|
|
6
|
+
}, {
|
|
7
|
+
oneOf: [string, ...string[]];
|
|
8
|
+
}>, z.ZodObject<{
|
|
9
|
+
startsWith: z.ZodString;
|
|
10
|
+
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
startsWith: string;
|
|
12
|
+
}, {
|
|
13
|
+
startsWith: string;
|
|
14
|
+
}>, z.ZodObject<{
|
|
15
|
+
jsonPatch: z.ZodObject<{
|
|
16
|
+
paths: z.ZodArray<z.ZodString, "atleastone">;
|
|
17
|
+
}, "strict", z.ZodTypeAny, {
|
|
18
|
+
paths: [string, ...string[]];
|
|
19
|
+
}, {
|
|
20
|
+
paths: [string, ...string[]];
|
|
21
|
+
}>;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
jsonPatch: {
|
|
24
|
+
paths: [string, ...string[]];
|
|
25
|
+
};
|
|
26
|
+
}, {
|
|
27
|
+
jsonPatch: {
|
|
28
|
+
paths: [string, ...string[]];
|
|
29
|
+
};
|
|
30
|
+
}>]>;
|
|
31
|
+
export type ArgumentPattern = z.infer<typeof argumentPattern>;
|
|
32
|
+
/** Undefined means the value matched. Use the same comparison for enforcement and explanations. */
|
|
33
|
+
export declare function argumentMismatch(pattern: ArgumentPattern, actual: string): string | undefined;
|
|
34
|
+
export declare const flagName: z.ZodString;
|
|
35
|
+
export declare const optionRequirement: z.ZodObject<{
|
|
36
|
+
option: z.ZodArray<z.ZodString, "atleastone">;
|
|
37
|
+
equals: z.ZodString;
|
|
38
|
+
}, "strict", z.ZodTypeAny, {
|
|
39
|
+
option: [string, ...string[]];
|
|
40
|
+
equals: string;
|
|
41
|
+
}, {
|
|
42
|
+
option: [string, ...string[]];
|
|
43
|
+
equals: string;
|
|
44
|
+
}>;
|
|
45
|
+
export declare function guardMismatch(guard: {
|
|
46
|
+
subcommand?: string;
|
|
47
|
+
require: z.infer<typeof optionRequirement>;
|
|
48
|
+
}, argv: string[], pending: ReadonlySet<number>): string | undefined;
|
|
49
|
+
export declare const commandWords: z.ZodString;
|
|
50
|
+
export declare const commandMatch: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
|
|
51
|
+
subcommand: z.ZodString;
|
|
52
|
+
target: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
53
|
+
oneOf: z.ZodArray<z.ZodString, "atleastone">;
|
|
54
|
+
}, "strict", z.ZodTypeAny, {
|
|
55
|
+
oneOf: [string, ...string[]];
|
|
56
|
+
}, {
|
|
57
|
+
oneOf: [string, ...string[]];
|
|
58
|
+
}>]>>;
|
|
59
|
+
assignments: z.ZodOptional<z.ZodRecord<z.ZodEffects<z.ZodString, string, string>, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
60
|
+
oneOf: z.ZodArray<z.ZodString, "atleastone">;
|
|
61
|
+
}, "strict", z.ZodTypeAny, {
|
|
62
|
+
oneOf: [string, ...string[]];
|
|
63
|
+
}, {
|
|
64
|
+
oneOf: [string, ...string[]];
|
|
65
|
+
}>, z.ZodObject<{
|
|
66
|
+
startsWith: z.ZodString;
|
|
67
|
+
}, "strict", z.ZodTypeAny, {
|
|
68
|
+
startsWith: string;
|
|
69
|
+
}, {
|
|
70
|
+
startsWith: string;
|
|
71
|
+
}>, z.ZodObject<{
|
|
72
|
+
jsonPatch: z.ZodObject<{
|
|
73
|
+
paths: z.ZodArray<z.ZodString, "atleastone">;
|
|
74
|
+
}, "strict", z.ZodTypeAny, {
|
|
75
|
+
paths: [string, ...string[]];
|
|
76
|
+
}, {
|
|
77
|
+
paths: [string, ...string[]];
|
|
78
|
+
}>;
|
|
79
|
+
}, "strict", z.ZodTypeAny, {
|
|
80
|
+
jsonPatch: {
|
|
81
|
+
paths: [string, ...string[]];
|
|
82
|
+
};
|
|
83
|
+
}, {
|
|
84
|
+
jsonPatch: {
|
|
85
|
+
paths: [string, ...string[]];
|
|
86
|
+
};
|
|
87
|
+
}>]>>>;
|
|
88
|
+
flags: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
89
|
+
names: z.ZodArray<z.ZodString, "atleastone">;
|
|
90
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
91
|
+
} & {
|
|
92
|
+
value: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
93
|
+
oneOf: z.ZodArray<z.ZodString, "atleastone">;
|
|
94
|
+
}, "strict", z.ZodTypeAny, {
|
|
95
|
+
oneOf: [string, ...string[]];
|
|
96
|
+
}, {
|
|
97
|
+
oneOf: [string, ...string[]];
|
|
98
|
+
}>, z.ZodObject<{
|
|
99
|
+
startsWith: z.ZodString;
|
|
100
|
+
}, "strict", z.ZodTypeAny, {
|
|
101
|
+
startsWith: string;
|
|
102
|
+
}, {
|
|
103
|
+
startsWith: string;
|
|
104
|
+
}>, z.ZodObject<{
|
|
105
|
+
jsonPatch: z.ZodObject<{
|
|
106
|
+
paths: z.ZodArray<z.ZodString, "atleastone">;
|
|
107
|
+
}, "strict", z.ZodTypeAny, {
|
|
108
|
+
paths: [string, ...string[]];
|
|
109
|
+
}, {
|
|
110
|
+
paths: [string, ...string[]];
|
|
111
|
+
}>;
|
|
112
|
+
}, "strict", z.ZodTypeAny, {
|
|
113
|
+
jsonPatch: {
|
|
114
|
+
paths: [string, ...string[]];
|
|
115
|
+
};
|
|
116
|
+
}, {
|
|
117
|
+
jsonPatch: {
|
|
118
|
+
paths: [string, ...string[]];
|
|
119
|
+
};
|
|
120
|
+
}>]>;
|
|
121
|
+
}, "strict", z.ZodTypeAny, {
|
|
122
|
+
value: string | {
|
|
123
|
+
oneOf: [string, ...string[]];
|
|
124
|
+
} | {
|
|
125
|
+
startsWith: string;
|
|
126
|
+
} | {
|
|
127
|
+
jsonPatch: {
|
|
128
|
+
paths: [string, ...string[]];
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
names: [string, ...string[]];
|
|
132
|
+
required: boolean;
|
|
133
|
+
}, {
|
|
134
|
+
value: string | {
|
|
135
|
+
oneOf: [string, ...string[]];
|
|
136
|
+
} | {
|
|
137
|
+
startsWith: string;
|
|
138
|
+
} | {
|
|
139
|
+
jsonPatch: {
|
|
140
|
+
paths: [string, ...string[]];
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
names: [string, ...string[]];
|
|
144
|
+
required?: boolean | undefined;
|
|
145
|
+
}>, z.ZodObject<{
|
|
146
|
+
names: z.ZodArray<z.ZodString, "atleastone">;
|
|
147
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
148
|
+
} & {
|
|
149
|
+
type: z.ZodLiteral<"switch">;
|
|
150
|
+
}, "strict", z.ZodTypeAny, {
|
|
151
|
+
type: "switch";
|
|
152
|
+
names: [string, ...string[]];
|
|
153
|
+
required: boolean;
|
|
154
|
+
}, {
|
|
155
|
+
type: "switch";
|
|
156
|
+
names: [string, ...string[]];
|
|
157
|
+
required?: boolean | undefined;
|
|
158
|
+
}>]>, "many">>;
|
|
159
|
+
}, "strict", z.ZodTypeAny, {
|
|
160
|
+
subcommand: string;
|
|
161
|
+
flags: ({
|
|
162
|
+
value: string | {
|
|
163
|
+
oneOf: [string, ...string[]];
|
|
164
|
+
} | {
|
|
165
|
+
startsWith: string;
|
|
166
|
+
} | {
|
|
167
|
+
jsonPatch: {
|
|
168
|
+
paths: [string, ...string[]];
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
names: [string, ...string[]];
|
|
172
|
+
required: boolean;
|
|
173
|
+
} | {
|
|
174
|
+
type: "switch";
|
|
175
|
+
names: [string, ...string[]];
|
|
176
|
+
required: boolean;
|
|
177
|
+
})[];
|
|
178
|
+
target?: string | {
|
|
179
|
+
oneOf: [string, ...string[]];
|
|
180
|
+
} | undefined;
|
|
181
|
+
assignments?: Record<string, string | {
|
|
182
|
+
oneOf: [string, ...string[]];
|
|
183
|
+
} | {
|
|
184
|
+
startsWith: string;
|
|
185
|
+
} | {
|
|
186
|
+
jsonPatch: {
|
|
187
|
+
paths: [string, ...string[]];
|
|
188
|
+
};
|
|
189
|
+
}> | undefined;
|
|
190
|
+
}, {
|
|
191
|
+
subcommand: string;
|
|
192
|
+
target?: string | {
|
|
193
|
+
oneOf: [string, ...string[]];
|
|
194
|
+
} | undefined;
|
|
195
|
+
assignments?: Record<string, string | {
|
|
196
|
+
oneOf: [string, ...string[]];
|
|
197
|
+
} | {
|
|
198
|
+
startsWith: string;
|
|
199
|
+
} | {
|
|
200
|
+
jsonPatch: {
|
|
201
|
+
paths: [string, ...string[]];
|
|
202
|
+
};
|
|
203
|
+
}> | undefined;
|
|
204
|
+
flags?: ({
|
|
205
|
+
value: string | {
|
|
206
|
+
oneOf: [string, ...string[]];
|
|
207
|
+
} | {
|
|
208
|
+
startsWith: string;
|
|
209
|
+
} | {
|
|
210
|
+
jsonPatch: {
|
|
211
|
+
paths: [string, ...string[]];
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
names: [string, ...string[]];
|
|
215
|
+
required?: boolean | undefined;
|
|
216
|
+
} | {
|
|
217
|
+
type: "switch";
|
|
218
|
+
names: [string, ...string[]];
|
|
219
|
+
required?: boolean | undefined;
|
|
220
|
+
})[] | undefined;
|
|
221
|
+
}>, z.ZodObject<{
|
|
222
|
+
positionals: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
223
|
+
oneOf: z.ZodArray<z.ZodString, "atleastone">;
|
|
224
|
+
}, "strict", z.ZodTypeAny, {
|
|
225
|
+
oneOf: [string, ...string[]];
|
|
226
|
+
}, {
|
|
227
|
+
oneOf: [string, ...string[]];
|
|
228
|
+
}>, z.ZodObject<{
|
|
229
|
+
startsWith: z.ZodString;
|
|
230
|
+
}, "strict", z.ZodTypeAny, {
|
|
231
|
+
startsWith: string;
|
|
232
|
+
}, {
|
|
233
|
+
startsWith: string;
|
|
234
|
+
}>, z.ZodObject<{
|
|
235
|
+
jsonPatch: z.ZodObject<{
|
|
236
|
+
paths: z.ZodArray<z.ZodString, "atleastone">;
|
|
237
|
+
}, "strict", z.ZodTypeAny, {
|
|
238
|
+
paths: [string, ...string[]];
|
|
239
|
+
}, {
|
|
240
|
+
paths: [string, ...string[]];
|
|
241
|
+
}>;
|
|
242
|
+
}, "strict", z.ZodTypeAny, {
|
|
243
|
+
jsonPatch: {
|
|
244
|
+
paths: [string, ...string[]];
|
|
245
|
+
};
|
|
246
|
+
}, {
|
|
247
|
+
jsonPatch: {
|
|
248
|
+
paths: [string, ...string[]];
|
|
249
|
+
};
|
|
250
|
+
}>]>, "many">;
|
|
251
|
+
flags: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
252
|
+
names: z.ZodArray<z.ZodString, "atleastone">;
|
|
253
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
254
|
+
} & {
|
|
255
|
+
value: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
256
|
+
oneOf: z.ZodArray<z.ZodString, "atleastone">;
|
|
257
|
+
}, "strict", z.ZodTypeAny, {
|
|
258
|
+
oneOf: [string, ...string[]];
|
|
259
|
+
}, {
|
|
260
|
+
oneOf: [string, ...string[]];
|
|
261
|
+
}>, z.ZodObject<{
|
|
262
|
+
startsWith: z.ZodString;
|
|
263
|
+
}, "strict", z.ZodTypeAny, {
|
|
264
|
+
startsWith: string;
|
|
265
|
+
}, {
|
|
266
|
+
startsWith: string;
|
|
267
|
+
}>, z.ZodObject<{
|
|
268
|
+
jsonPatch: z.ZodObject<{
|
|
269
|
+
paths: z.ZodArray<z.ZodString, "atleastone">;
|
|
270
|
+
}, "strict", z.ZodTypeAny, {
|
|
271
|
+
paths: [string, ...string[]];
|
|
272
|
+
}, {
|
|
273
|
+
paths: [string, ...string[]];
|
|
274
|
+
}>;
|
|
275
|
+
}, "strict", z.ZodTypeAny, {
|
|
276
|
+
jsonPatch: {
|
|
277
|
+
paths: [string, ...string[]];
|
|
278
|
+
};
|
|
279
|
+
}, {
|
|
280
|
+
jsonPatch: {
|
|
281
|
+
paths: [string, ...string[]];
|
|
282
|
+
};
|
|
283
|
+
}>]>;
|
|
284
|
+
}, "strict", z.ZodTypeAny, {
|
|
285
|
+
value: string | {
|
|
286
|
+
oneOf: [string, ...string[]];
|
|
287
|
+
} | {
|
|
288
|
+
startsWith: string;
|
|
289
|
+
} | {
|
|
290
|
+
jsonPatch: {
|
|
291
|
+
paths: [string, ...string[]];
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
names: [string, ...string[]];
|
|
295
|
+
required: boolean;
|
|
296
|
+
}, {
|
|
297
|
+
value: string | {
|
|
298
|
+
oneOf: [string, ...string[]];
|
|
299
|
+
} | {
|
|
300
|
+
startsWith: string;
|
|
301
|
+
} | {
|
|
302
|
+
jsonPatch: {
|
|
303
|
+
paths: [string, ...string[]];
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
names: [string, ...string[]];
|
|
307
|
+
required?: boolean | undefined;
|
|
308
|
+
}>, z.ZodObject<{
|
|
309
|
+
names: z.ZodArray<z.ZodString, "atleastone">;
|
|
310
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
311
|
+
} & {
|
|
312
|
+
type: z.ZodLiteral<"switch">;
|
|
313
|
+
}, "strict", z.ZodTypeAny, {
|
|
314
|
+
type: "switch";
|
|
315
|
+
names: [string, ...string[]];
|
|
316
|
+
required: boolean;
|
|
317
|
+
}, {
|
|
318
|
+
type: "switch";
|
|
319
|
+
names: [string, ...string[]];
|
|
320
|
+
required?: boolean | undefined;
|
|
321
|
+
}>]>, "many">>;
|
|
322
|
+
}, "strict", z.ZodTypeAny, {
|
|
323
|
+
flags: ({
|
|
324
|
+
value: string | {
|
|
325
|
+
oneOf: [string, ...string[]];
|
|
326
|
+
} | {
|
|
327
|
+
startsWith: string;
|
|
328
|
+
} | {
|
|
329
|
+
jsonPatch: {
|
|
330
|
+
paths: [string, ...string[]];
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
names: [string, ...string[]];
|
|
334
|
+
required: boolean;
|
|
335
|
+
} | {
|
|
336
|
+
type: "switch";
|
|
337
|
+
names: [string, ...string[]];
|
|
338
|
+
required: boolean;
|
|
339
|
+
})[];
|
|
340
|
+
positionals: (string | {
|
|
341
|
+
oneOf: [string, ...string[]];
|
|
342
|
+
} | {
|
|
343
|
+
startsWith: string;
|
|
344
|
+
} | {
|
|
345
|
+
jsonPatch: {
|
|
346
|
+
paths: [string, ...string[]];
|
|
347
|
+
};
|
|
348
|
+
})[];
|
|
349
|
+
}, {
|
|
350
|
+
positionals: (string | {
|
|
351
|
+
oneOf: [string, ...string[]];
|
|
352
|
+
} | {
|
|
353
|
+
startsWith: string;
|
|
354
|
+
} | {
|
|
355
|
+
jsonPatch: {
|
|
356
|
+
paths: [string, ...string[]];
|
|
357
|
+
};
|
|
358
|
+
})[];
|
|
359
|
+
flags?: ({
|
|
360
|
+
value: string | {
|
|
361
|
+
oneOf: [string, ...string[]];
|
|
362
|
+
} | {
|
|
363
|
+
startsWith: string;
|
|
364
|
+
} | {
|
|
365
|
+
jsonPatch: {
|
|
366
|
+
paths: [string, ...string[]];
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
names: [string, ...string[]];
|
|
370
|
+
required?: boolean | undefined;
|
|
371
|
+
} | {
|
|
372
|
+
type: "switch";
|
|
373
|
+
names: [string, ...string[]];
|
|
374
|
+
required?: boolean | undefined;
|
|
375
|
+
})[] | undefined;
|
|
376
|
+
}>]>, {
|
|
377
|
+
subcommand: string;
|
|
378
|
+
flags: ({
|
|
379
|
+
value: string | {
|
|
380
|
+
oneOf: [string, ...string[]];
|
|
381
|
+
} | {
|
|
382
|
+
startsWith: string;
|
|
383
|
+
} | {
|
|
384
|
+
jsonPatch: {
|
|
385
|
+
paths: [string, ...string[]];
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
names: [string, ...string[]];
|
|
389
|
+
required: boolean;
|
|
390
|
+
} | {
|
|
391
|
+
type: "switch";
|
|
392
|
+
names: [string, ...string[]];
|
|
393
|
+
required: boolean;
|
|
394
|
+
})[];
|
|
395
|
+
target?: string | {
|
|
396
|
+
oneOf: [string, ...string[]];
|
|
397
|
+
} | undefined;
|
|
398
|
+
assignments?: Record<string, string | {
|
|
399
|
+
oneOf: [string, ...string[]];
|
|
400
|
+
} | {
|
|
401
|
+
startsWith: string;
|
|
402
|
+
} | {
|
|
403
|
+
jsonPatch: {
|
|
404
|
+
paths: [string, ...string[]];
|
|
405
|
+
};
|
|
406
|
+
}> | undefined;
|
|
407
|
+
} | {
|
|
408
|
+
flags: ({
|
|
409
|
+
value: string | {
|
|
410
|
+
oneOf: [string, ...string[]];
|
|
411
|
+
} | {
|
|
412
|
+
startsWith: string;
|
|
413
|
+
} | {
|
|
414
|
+
jsonPatch: {
|
|
415
|
+
paths: [string, ...string[]];
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
names: [string, ...string[]];
|
|
419
|
+
required: boolean;
|
|
420
|
+
} | {
|
|
421
|
+
type: "switch";
|
|
422
|
+
names: [string, ...string[]];
|
|
423
|
+
required: boolean;
|
|
424
|
+
})[];
|
|
425
|
+
positionals: (string | {
|
|
426
|
+
oneOf: [string, ...string[]];
|
|
427
|
+
} | {
|
|
428
|
+
startsWith: string;
|
|
429
|
+
} | {
|
|
430
|
+
jsonPatch: {
|
|
431
|
+
paths: [string, ...string[]];
|
|
432
|
+
};
|
|
433
|
+
})[];
|
|
434
|
+
}, {
|
|
435
|
+
subcommand: string;
|
|
436
|
+
target?: string | {
|
|
437
|
+
oneOf: [string, ...string[]];
|
|
438
|
+
} | undefined;
|
|
439
|
+
assignments?: Record<string, string | {
|
|
440
|
+
oneOf: [string, ...string[]];
|
|
441
|
+
} | {
|
|
442
|
+
startsWith: string;
|
|
443
|
+
} | {
|
|
444
|
+
jsonPatch: {
|
|
445
|
+
paths: [string, ...string[]];
|
|
446
|
+
};
|
|
447
|
+
}> | undefined;
|
|
448
|
+
flags?: ({
|
|
449
|
+
value: string | {
|
|
450
|
+
oneOf: [string, ...string[]];
|
|
451
|
+
} | {
|
|
452
|
+
startsWith: string;
|
|
453
|
+
} | {
|
|
454
|
+
jsonPatch: {
|
|
455
|
+
paths: [string, ...string[]];
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
names: [string, ...string[]];
|
|
459
|
+
required?: boolean | undefined;
|
|
460
|
+
} | {
|
|
461
|
+
type: "switch";
|
|
462
|
+
names: [string, ...string[]];
|
|
463
|
+
required?: boolean | undefined;
|
|
464
|
+
})[] | undefined;
|
|
465
|
+
} | {
|
|
466
|
+
positionals: (string | {
|
|
467
|
+
oneOf: [string, ...string[]];
|
|
468
|
+
} | {
|
|
469
|
+
startsWith: string;
|
|
470
|
+
} | {
|
|
471
|
+
jsonPatch: {
|
|
472
|
+
paths: [string, ...string[]];
|
|
473
|
+
};
|
|
474
|
+
})[];
|
|
475
|
+
flags?: ({
|
|
476
|
+
value: string | {
|
|
477
|
+
oneOf: [string, ...string[]];
|
|
478
|
+
} | {
|
|
479
|
+
startsWith: string;
|
|
480
|
+
} | {
|
|
481
|
+
jsonPatch: {
|
|
482
|
+
paths: [string, ...string[]];
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
names: [string, ...string[]];
|
|
486
|
+
required?: boolean | undefined;
|
|
487
|
+
} | {
|
|
488
|
+
type: "switch";
|
|
489
|
+
names: [string, ...string[]];
|
|
490
|
+
required?: boolean | undefined;
|
|
491
|
+
})[] | undefined;
|
|
492
|
+
}>;
|
|
493
|
+
export declare function commandMismatch(match: z.infer<typeof commandMatch>, argv: string[], pending: ReadonlySet<number>, commonOptions?: z.infer<typeof optionRequirement>[]): string | undefined;
|