@wirecat/zoom-cli 0.40.0 → 0.42.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/README.md +3 -3
- package/dist/agent-skill.d.ts.map +1 -1
- package/dist/agent-skill.js +3 -1
- package/dist/agent-skill.js.map +1 -1
- package/dist/answer-entities.d.ts +736 -0
- package/dist/answer-entities.d.ts.map +1 -0
- package/dist/answer-entities.js +201 -0
- package/dist/answer-entities.js.map +1 -0
- package/dist/answer-output.d.ts +0 -1
- package/dist/answer-output.d.ts.map +1 -1
- package/dist/answer-output.js +2 -2
- package/dist/answer-output.js.map +1 -1
- package/dist/answer-policy.d.ts +0 -4
- package/dist/answer-policy.d.ts.map +1 -1
- package/dist/answer-policy.js +0 -16
- package/dist/answer-policy.js.map +1 -1
- package/dist/archive-commands.d.ts.map +1 -1
- package/dist/archive-commands.js +72 -52
- package/dist/archive-commands.js.map +1 -1
- package/dist/commands.d.ts +0 -2
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +6 -52
- package/dist/commands.js.map +1 -1
- package/dist/execution.d.ts +5 -10
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +11 -27
- package/dist/execution.js.map +1 -1
- package/dist/first-screen.d.ts +8 -0
- package/dist/first-screen.d.ts.map +1 -1
- package/dist/first-screen.js +18 -18
- package/dist/first-screen.js.map +1 -1
- package/dist/json-fields.d.ts +1 -6
- package/dist/json-fields.d.ts.map +1 -1
- package/dist/json-fields.js +2 -22
- package/dist/json-fields.js.map +1 -1
- package/dist/local-transcription-commands.d.ts.map +1 -1
- package/dist/local-transcription-commands.js +1 -1
- package/dist/local-transcription-commands.js.map +1 -1
- package/dist/mcp-command.d.ts +2 -1
- package/dist/mcp-command.d.ts.map +1 -1
- package/dist/mcp-command.js +12 -2
- package/dist/mcp-command.js.map +1 -1
- package/dist/mcp.d.ts +4 -2
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +20 -13
- package/dist/mcp.js.map +1 -1
- package/dist/models-commands.d.ts.map +1 -1
- package/dist/models-commands.js +7 -36
- package/dist/models-commands.js.map +1 -1
- package/dist/permissions.d.ts +6 -0
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +34 -11
- package/dist/permissions.js.map +1 -1
- package/dist/profile-word.d.ts +0 -15
- package/dist/profile-word.d.ts.map +1 -1
- package/dist/profile-word.js +0 -48
- package/dist/profile-word.js.map +1 -1
- package/dist/program-bindings.d.ts +5 -0
- package/dist/program-bindings.d.ts.map +1 -0
- package/dist/program-bindings.js +424 -0
- package/dist/program-bindings.js.map +1 -0
- package/dist/program.d.ts +8 -5
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +17 -417
- package/dist/program.js.map +1 -1
- package/dist/progress-commands.d.ts +9 -0
- package/dist/progress-commands.d.ts.map +1 -0
- package/dist/progress-commands.js +49 -0
- package/dist/progress-commands.js.map +1 -0
- package/dist/read-only.d.ts.map +1 -1
- package/dist/read-only.js +6 -17
- package/dist/read-only.js.map +1 -1
- package/dist/recording-schedule-commands.d.ts.map +1 -1
- package/dist/recording-schedule-commands.js +8 -8
- package/dist/recording-schedule-commands.js.map +1 -1
- package/dist/recording-sync-store.d.ts +2 -1
- package/dist/recording-sync-store.d.ts.map +1 -1
- package/dist/recording-sync-store.js +10 -0
- package/dist/recording-sync-store.js.map +1 -1
- package/dist/run.d.ts +8 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +50 -0
- package/dist/run.js.map +1 -0
- package/dist/setup-commands.d.ts +0 -3
- package/dist/setup-commands.d.ts.map +1 -1
- package/dist/setup-commands.js +5 -11
- package/dist/setup-commands.js.map +1 -1
- package/dist/sync-progress.d.ts +11 -0
- package/dist/sync-progress.d.ts.map +1 -0
- package/dist/sync-progress.js +31 -0
- package/dist/sync-progress.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/watch-commands.d.ts.map +1 -1
- package/dist/watch-commands.js +1 -1
- package/dist/watch-commands.js.map +1 -1
- package/package.json +2 -2
- package/skills/zoom-cli/SKILL.md +5 -5
package/dist/commands.js
CHANGED
|
@@ -1,36 +1,11 @@
|
|
|
1
|
-
import { CliError
|
|
2
|
-
import { annotate,
|
|
1
|
+
import { CliError } from "@wirecat/cli-base";
|
|
2
|
+
import { annotate, describeOptions, describeProgram, flatten, metaOf } from "@wirecat/cli-base/commands";
|
|
3
3
|
import { formatSuggestions, suggest } from "@wirecat/cli-base/completion";
|
|
4
|
-
import {
|
|
4
|
+
import { commandsCommand, itemOf, LOCAL_READ, NO_EFFECTS, REMOTE_READ } from "@wirecat/cli-core/cli";
|
|
5
5
|
import { wholeList } from "./answer-output.js";
|
|
6
|
-
import {
|
|
7
|
-
const CONTRACT = 3;
|
|
6
|
+
import { ZM } from "./read-only.js";
|
|
8
7
|
export const addStandardCommands = (program, deps) => {
|
|
9
|
-
|
|
10
|
-
.command("commands")
|
|
11
|
-
.description("discover commands, flags and examples, optionally scoped to a command path")
|
|
12
|
-
.argument("[path...]", "resource or command path")
|
|
13
|
-
.action((path) => {
|
|
14
|
-
const all = describeProgram(program);
|
|
15
|
-
const scoped = path.length ? scopeOf(all, path) : undefined;
|
|
16
|
-
const commands = scoped ? [scoped.command] : all;
|
|
17
|
-
if (!program.opts().json && !program.opts().jsonl) {
|
|
18
|
-
deps.raw(commandsText(program, commands, scoped?.command.path));
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const fields = deps.fields();
|
|
22
|
-
const { exit_codes, ...document } = commandsDocument(program, {
|
|
23
|
-
cli: "zm",
|
|
24
|
-
version: VERSION,
|
|
25
|
-
contract: CONTRACT,
|
|
26
|
-
});
|
|
27
|
-
deps.discovery({
|
|
28
|
-
...document,
|
|
29
|
-
...(scoped ? { scope: scoped.command.path, inherited_options: scoped.inheritedOptions } : {}),
|
|
30
|
-
commands: fields ? projectDiscovery(commands, fields) : commands,
|
|
31
|
-
exit_codes,
|
|
32
|
-
});
|
|
33
|
-
}), { effects: NO_EFFECTS, examples: ["zm commands --json"] });
|
|
8
|
+
program.addCommand(commandsCommand(ZM).copyInheritedSettings(program));
|
|
34
9
|
annotate(program
|
|
35
10
|
.command("complete")
|
|
36
11
|
.description("answer shell completion requests")
|
|
@@ -98,6 +73,7 @@ const exampleFor = (path) => {
|
|
|
98
73
|
if (path === "session start")
|
|
99
74
|
return "zm personal session start";
|
|
100
75
|
const argumentsByPath = {
|
|
76
|
+
"commands info": "meetings list",
|
|
101
77
|
"config set": "files.timezone Europe/Madrid",
|
|
102
78
|
"meetings show": "1",
|
|
103
79
|
"meetings transcript": "1",
|
|
@@ -109,26 +85,4 @@ const exampleFor = (path) => {
|
|
|
109
85
|
};
|
|
110
86
|
return `zm ${profile}${path}${argumentsByPath[path] ? ` ${argumentsByPath[path]}` : ""} --json`;
|
|
111
87
|
};
|
|
112
|
-
const scopeOf = (all, path) => {
|
|
113
|
-
const inheritedOptions = [];
|
|
114
|
-
let available = all;
|
|
115
|
-
let command;
|
|
116
|
-
for (const word of path) {
|
|
117
|
-
if (command?.options.length)
|
|
118
|
-
inheritedOptions.push({ path: command.path, options: command.options });
|
|
119
|
-
command = available.find((item) => item.name === word);
|
|
120
|
-
if (!command)
|
|
121
|
-
throw new CliError("validation_error", "unknown command path; use zm commands --json");
|
|
122
|
-
available = command.commands;
|
|
123
|
-
}
|
|
124
|
-
return { command: command, inheritedOptions };
|
|
125
|
-
};
|
|
126
|
-
const projectDiscovery = (commands, fields) => commands.map((command) => ({
|
|
127
|
-
...projectFields(command, fields),
|
|
128
|
-
path: command.path,
|
|
129
|
-
name: command.name,
|
|
130
|
-
origin: command.origin,
|
|
131
|
-
effects: command.effects,
|
|
132
|
-
commands: projectDiscovery(command.commands, fields),
|
|
133
|
-
}));
|
|
134
88
|
//# sourceMappingURL=commands.js.map
|
package/dist/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":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,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAA;IAC7E,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,iBAAiB,CAAA;IAC5C,IAAI,IAAI,KAAK,eAAe;QAAE,OAAO,2BAA2B,CAAA;IAChE,MAAM,eAAe,GAA2B;QAC9C,eAAe,EAAE,eAAe;QAChC,YAAY,EAAE,8BAA8B;QAC5C,eAAe,EAAE,GAAG;QACpB,qBAAqB,EAAE,GAAG;QAC1B,kBAAkB,EAAE,GAAG;QACvB,iBAAiB,EAAE,qBAAqB;QACxC,iBAAiB,EAAE,iBAAiB;QACpC,4BAA4B,EAAE,sBAAsB;QACpD,iBAAiB,EAAE,0BAA0B;KAC9C,CAAA;IACD,OAAO,MAAM,OAAO,GAAG,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,CAAA;AACjG,CAAC,CAAA"}
|
package/dist/execution.d.ts
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type OutputBuffer } from "@wirecat/cli-base";
|
|
2
2
|
import type { Meta } from "@wirecat/cli-base/standards";
|
|
3
|
+
import { type BaseEnvironment } from "@wirecat/cli-core/cli";
|
|
3
4
|
import type { Command } from "commander";
|
|
4
|
-
export declare const duration: (text: string) => number;
|
|
5
|
+
export declare const duration: (text: string, source?: string) => number;
|
|
5
6
|
export declare const bytes: (text: string) => number;
|
|
6
7
|
/** A one-shot command that may take an hour; cli-base's `lifetime` names only commands that never end on their own. */
|
|
7
8
|
export declare const runsLong: (command: Command) => Command;
|
|
8
9
|
export declare const commandDeadline: (action: Command) => number | undefined;
|
|
9
|
-
export interface ExecutionOptions {
|
|
10
|
-
signal?: AbortSignal;
|
|
11
|
-
sleep?: SleepLike;
|
|
12
|
-
now?: () => number;
|
|
13
|
-
}
|
|
14
10
|
export interface ExecutionState {
|
|
15
11
|
action: Command;
|
|
16
|
-
|
|
12
|
+
signal: AbortSignal;
|
|
17
13
|
output: OutputBuffer;
|
|
18
14
|
meta: () => Meta;
|
|
19
15
|
}
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const resetCliOptions: (root: Command) => void;
|
|
16
|
+
export declare const sharedExecution: (action: Command, environment: BaseEnvironment, now?: () => number) => ExecutionState;
|
|
22
17
|
//# sourceMappingURL=execution.d.ts.map
|
package/dist/execution.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../src/execution.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../src/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEnF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,uBAAuB,CAAA;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGxC,eAAO,MAAM,QAAQ,SAAU,MAAM,sBAAwB,MAK5D,CAAA;AACD,eAAO,MAAM,KAAK,SAAU,MAAM,KAAG,MAIpC,CAAA;AAED,uHAAuH;AACvH,eAAO,MAAM,QAAQ,YAAa,OAAO,KAAG,OAG3C,CAAA;AACD,eAAO,MAAM,eAAe,WAAY,OAAO,KAAG,MAAM,GAAG,SAK1D,CAAA;AACD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB;AAED,eAAO,MAAM,eAAe,WAAY,OAAO,eAAe,eAAe,QAAQ,MAAM,MAAM,KAAG,cAQnG,CAAA"}
|
package/dist/execution.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { CliError,
|
|
1
|
+
import { CliError, createOutputBuffer } from "@wirecat/cli-base";
|
|
2
2
|
import { metaOf } from "@wirecat/cli-base/commands";
|
|
3
|
+
import { parseDuration } from "@wirecat/cli-core/cli";
|
|
3
4
|
import { readMetadata } from "./answers.js";
|
|
4
|
-
export const duration = (text) => {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (!match || !Number.isSafeInteger(value) || value <= 0 || value > 2147483647)
|
|
9
|
-
throw new CliError("validation_error", "expected a positive duration such as 30s, 5m or 1h");
|
|
5
|
+
export const duration = (text, source = "duration") => {
|
|
6
|
+
const value = parseDuration(text, source);
|
|
7
|
+
if (!Number.isSafeInteger(value) || value > 2147483647)
|
|
8
|
+
throw new CliError("validation_error", "duration exceeds the supported timer range");
|
|
10
9
|
return value;
|
|
11
10
|
};
|
|
12
11
|
export const bytes = (text) => {
|
|
@@ -28,28 +27,13 @@ export const commandDeadline = (action) => {
|
|
|
28
27
|
return 300000;
|
|
29
28
|
return longRunning.has(action) ? 3600000 : 30000;
|
|
30
29
|
};
|
|
31
|
-
export const
|
|
32
|
-
const
|
|
30
|
+
export const sharedExecution = (action, environment, now) => {
|
|
31
|
+
const max = action.optsWithGlobals().maxOutputBytes;
|
|
33
32
|
return {
|
|
34
33
|
action,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
signal: options.signal,
|
|
39
|
-
sleep: options.sleep,
|
|
40
|
-
}),
|
|
41
|
-
output: createOutputBuffer({ maxOutputBytes: flags.maxOutputBytes }),
|
|
34
|
+
signal: environment.signal,
|
|
35
|
+
meta: readMetadata(now),
|
|
36
|
+
output: createOutputBuffer({ maxOutputBytes: max === undefined ? undefined : Number(max) }),
|
|
42
37
|
};
|
|
43
38
|
};
|
|
44
|
-
export const resetCliOptions = (root) => {
|
|
45
|
-
for (const command of [root, ...root.commands]) {
|
|
46
|
-
for (const option of command.options) {
|
|
47
|
-
const name = option.attributeName();
|
|
48
|
-
if (command.getOptionValueSource(name) === "cli")
|
|
49
|
-
command.setOptionValueWithSource(name, option.defaultValue ?? (option.negate ? true : undefined), "default");
|
|
50
|
-
}
|
|
51
|
-
if (command !== root && command.commands.length)
|
|
52
|
-
resetCliOptions(command);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
39
|
//# sourceMappingURL=execution.js.map
|
package/dist/execution.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../src/execution.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../src/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAqB,MAAM,mBAAmB,CAAA;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,OAAO,EAAwB,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,MAAM,GAAG,UAAU,EAAU,EAAE;IACpE,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACzC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,UAAU;QACpD,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,4CAA4C,CAAC,CAAA;IACtF,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAU,EAAE;IAC5C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MA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{ Command } from "commander";
|
|
2
2
|
/** After every other command: the first screen's pointers name only commands that exist. */
|
|
3
3
|
export declare const installFirstScreen: (program: Command) => void;
|
|
4
|
+
export declare const ZOOM_FIRST_SCREEN: {
|
|
5
|
+
pitch: string;
|
|
6
|
+
can: {
|
|
7
|
+
command: string;
|
|
8
|
+
does: string;
|
|
9
|
+
}[];
|
|
10
|
+
start: string;
|
|
11
|
+
};
|
|
4
12
|
//# sourceMappingURL=first-screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"first-screen.d.ts","sourceRoot":"","sources":["../src/first-screen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA4BxC,4FAA4F;AAC5F,eAAO,MAAM,kBAAkB,YAAa,OAAO,KAAG,
|
|
1
|
+
{"version":3,"file":"first-screen.d.ts","sourceRoot":"","sources":["../src/first-screen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA4BxC,4FAA4F;AAC5F,eAAO,MAAM,kBAAkB,YAAa,OAAO,KAAG,IASrD,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;CAiB7B,CAAA"}
|
package/dist/first-screen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
|
-
import { guideCommand, inSection,
|
|
2
|
+
import { guideCommand, inSection, MEMO_SCENARIOS } from "@wirecat/cli-core/cli";
|
|
3
3
|
import { ZM } from "./read-only.js";
|
|
4
4
|
// cli-core places its own groups (meetings, search, watch, serve, config, skill…); these are zm's.
|
|
5
5
|
const SECTIONS = [
|
|
@@ -36,22 +36,22 @@ export const installFirstScreen = (program) => {
|
|
|
36
36
|
});
|
|
37
37
|
// addCommand, unlike command(), leaves out the exit override: `guide --help` called process.exit itself.
|
|
38
38
|
program.addCommand(guide.copyInheritedSettings(program));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
};
|
|
40
|
+
export const ZOOM_FIRST_SCREEN = {
|
|
41
|
+
pitch: "your Zoom meetings for agents: transcripts and summaries in a local store, every answer pointing at its line.",
|
|
42
|
+
can: [
|
|
43
|
+
{ command: "meetings sync", does: "meetings, transcripts and summaries into the store" },
|
|
44
|
+
{ command: 'search meetings "quote"', does: "words across every transcript, with line refs" },
|
|
45
|
+
{ command: "meetings context <person>", does: "what past meetings say about one person" },
|
|
46
|
+
{ command: "meetings prepare <series-id>", does: "a briefing with sources before a meeting" },
|
|
47
|
+
{ command: "meetings transcribe <meeting> <file>", does: "a recording turned into text on this machine" },
|
|
48
|
+
{ command: "recordings schedule create …", does: "a daily, checked archive of cloud recordings" },
|
|
49
|
+
{ command: "mcp", does: "commands for an MCP agent, limited by the profile’s permissions" },
|
|
50
|
+
{
|
|
51
|
+
command: "ZM_READ_ONLY=1 zm …",
|
|
52
|
+
does: "blocks changes to Zoom, login, settings, files and the store; syncs run",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
start: "zm personal session start",
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=first-screen.js.map
|
package/dist/first-screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"first-screen.js","sourceRoot":"","sources":["../src/first-screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,YAAY,EAAoB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"first-screen.js","sourceRoot":"","sources":["../src/first-screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OA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,2BAA2B;CACnC,CAAA"}
|
package/dist/json-fields.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/** `--json=a,b` or `--json a,b`, read the way tg and max read it: the arguments Commander parses, and the fields. */
|
|
3
|
-
export declare const liftJsonFields: (program: Command, [argv, settings]: Parameters<Command["parseAsync"]>) => {
|
|
4
|
-
args: Parameters<Command["parseAsync"]>;
|
|
5
|
-
fields: string[] | undefined;
|
|
6
|
-
};
|
|
1
|
+
export {};
|
|
7
2
|
//# sourceMappingURL=json-fields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-fields.d.ts","sourceRoot":"","sources":["../src/json-fields.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json-fields.d.ts","sourceRoot":"","sources":["../src/json-fields.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAA"}
|
package/dist/json-fields.js
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const commandIn = (root, words) => {
|
|
4
|
-
let at = root;
|
|
5
|
-
for (const word of words) {
|
|
6
|
-
if (word.startsWith("-"))
|
|
7
|
-
continue;
|
|
8
|
-
const child = at.commands.find((command) => command.name() === word || command.aliases().includes(word));
|
|
9
|
-
if (child)
|
|
10
|
-
at = child;
|
|
11
|
-
}
|
|
12
|
-
return at === root ? undefined : at;
|
|
13
|
-
};
|
|
14
|
-
/** `--json=a,b` or `--json a,b`, read the way tg and max read it: the arguments Commander parses, and the fields. */
|
|
15
|
-
export const liftJsonFields = (program, [argv = process.argv, settings]) => {
|
|
16
|
-
const user = settings?.from === "user";
|
|
17
|
-
const requested = liftJson(user ? [...argv] : argv.slice(2), (words) => commandIn(program, words));
|
|
18
|
-
return {
|
|
19
|
-
args: [user ? requested.argv : [...argv.slice(0, 2), ...requested.argv], settings],
|
|
20
|
-
fields: requested.fields === undefined ? undefined : fieldsOf(requested.fields),
|
|
21
|
-
};
|
|
22
|
-
};
|
|
1
|
+
// Retired: Core’s program runner owns JSON field parsing. File removal is deferred to cleanup.
|
|
2
|
+
export {};
|
|
23
3
|
//# sourceMappingURL=json-fields.js.map
|
package/dist/json-fields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-fields.js","sourceRoot":"","sources":["../src/json-fields.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"json-fields.js","sourceRoot":"","sources":["../src/json-fields.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-transcription-commands.d.ts","sourceRoot":"","sources":["../src/local-transcription-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,EAAuB,MAAM,uBAAuB,CAAA;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAEL,KAAK,8BAA8B,EAGpC,MAAM,0BAA0B,CAAA;AAEjC,eAAO,MAAM,6BAA6B,YAC/B,OAAO,QACV;IACJ,YAAY,EAAE,MAAM,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAC3D,MAAM,EAAE,MAAM,WAAW,GAAG,SAAS,CAAA;IACrC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC5B,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACvC,KACA,
|
|
1
|
+
{"version":3,"file":"local-transcription-commands.d.ts","sourceRoot":"","sources":["../src/local-transcription-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,EAAuB,MAAM,uBAAuB,CAAA;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAEL,KAAK,8BAA8B,EAGpC,MAAM,0BAA0B,CAAA;AAEjC,eAAO,MAAM,6BAA6B,YAC/B,OAAO,QACV;IACJ,YAAY,EAAE,MAAM,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAC3D,MAAM,EAAE,MAAM,WAAW,GAAG,SAAS,CAAA;IACrC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC5B,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACvC,KACA,IAsDF,CAAA"}
|
|
@@ -15,7 +15,7 @@ export const addLocalTranscriptionCommands = (program, deps) => {
|
|
|
15
15
|
.requiredOption("--model <model>", "installed speech model")
|
|
16
16
|
.option("--models-dir <dir>", "shared installed speech-model directory")
|
|
17
17
|
.option("--max-bytes <bytes>", "largest audio file to read, in bytes (default 1 GiB)", bytes)
|
|
18
|
-
.option("--max-duration <duration>", "longest audio to transcribe (default 4h)", duration)
|
|
18
|
+
.option("--max-duration <duration>", "longest audio to transcribe (default 4h)", (text) => duration(text, "--max-duration"))
|
|
19
19
|
.option("--max-segments <n>", "most recognized segments (default 10000)", bytes)
|
|
20
20
|
.option("--max-text-bytes <bytes>", "most transcript text, in bytes (default 4 MiB)", bytes)
|
|
21
21
|
.option("--yes", "recognize locally and append to the existing meeting")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-transcription-commands.js","sourceRoot":"","sources":["../src/local-transcription-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAa,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EACL,gCAAgC,EAGhC,iCAAiC,GAClC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EAAE,OAAO,CAAC,WAAW;YAChC,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,KAAK,EAAE,OAAO,CAAC,GAAG;YAClB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SACtB,CAAC,CAAA;QACF,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjE,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,8BAA8B,CAAC,CAAA;QACxE,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;QAC9C,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACvE,IAAI,OAAO,CAAC,OAAO;YAAE,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;;YACrF,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IACnC,CAAC,CACF,EACH;QACE,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE,WAAW;QACpB,QAAQ,EAAE,CAAC,4FAA4F,CAAC;KACzG,CACF,CAAA;AACH,CAAC,CAAA"}
|
package/dist/mcp-command.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RunOptions } from "@wirecat/cli-core/cli";
|
|
1
2
|
import type { Level } from "@wirecat/cli-core/sends";
|
|
2
3
|
import type { Command } from "commander";
|
|
3
4
|
import type { RunCommand, ZoomMcpOptions } from "./mcp.js";
|
|
@@ -12,7 +13,7 @@ export interface McpCommandDeps {
|
|
|
12
13
|
/** `zm <profile> mcp`: the shared three-tool MCP server over stdio, for the named profile (WC-CMD-5, WC-MCP-9). */
|
|
13
14
|
export declare const addMcpCommands: (program: Command, deps: McpCommandDeps) => void;
|
|
14
15
|
/** A run for an MCP agent: the answer and the error captured, nothing at a terminal, and `ask` taken as yes. */
|
|
15
|
-
export declare const runForAgent: (run: (argv: string[], deps: ProgramDeps) => Promise<number>, argv: string[], deps: ProgramDeps) => Promise<{
|
|
16
|
+
export declare const runForAgent: (run: (argv: string[], deps: ProgramDeps) => Promise<number>, argv: string[], deps: ProgramDeps, environment?: RunOptions) => Promise<{
|
|
16
17
|
code: number;
|
|
17
18
|
stdout: string;
|
|
18
19
|
stderr: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-command.d.ts","sourceRoot":"","sources":["../src/mcp-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-command.d.ts","sourceRoot":"","sources":["../src/mcp-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyC,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC9F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,MAAM,CAAA;IACrB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;IACjE,GAAG,EAAE,UAAU,CAAA;IACf,MAAM,EAAE,MAAM,WAAW,GAAG,SAAS,CAAA;IACrC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACnD;AAED,mHAAmH;AACnH,eAAO,MAAM,cAAc,YAAa,OAAO,QAAQ,cAAc,KAAG,IAkCvE,CAAA;AAED,gHAAgH;AAChH,eAAO,MAAM,WAAW,QACjB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,QACrD,MAAM,EAAE,QACR,WAAW,gBACH,UAAU;;;;EAsBzB,CAAA"}
|
package/dist/mcp-command.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import { annotate, describeProgram } from "@wirecat/cli-base/commands";
|
|
3
|
-
import { FETCH, NO_EFFECTS } from "@wirecat/cli-core/cli";
|
|
3
|
+
import { changesAuthorityAt, FETCH, NO_EFFECTS } from "@wirecat/cli-core/cli";
|
|
4
4
|
/** `zm <profile> mcp`: the shared three-tool MCP server over stdio, for the named profile (WC-CMD-5, WC-MCP-9). */
|
|
5
5
|
export const addMcpCommands = (program, deps) => {
|
|
6
6
|
annotate(program.command("mcp"), {
|
|
@@ -19,6 +19,7 @@ export const addMcpCommands = (program, deps) => {
|
|
|
19
19
|
await serve({
|
|
20
20
|
profile,
|
|
21
21
|
commands: describeProgram(program),
|
|
22
|
+
authority: changesAuthorityAt(program),
|
|
22
23
|
permissions: () => deps.permissions(profile),
|
|
23
24
|
run: deps.run,
|
|
24
25
|
...(deps.signal() ? { signal: deps.signal() } : {}),
|
|
@@ -34,12 +35,21 @@ export const addMcpCommands = (program, deps) => {
|
|
|
34
35
|
});
|
|
35
36
|
};
|
|
36
37
|
/** A run for an MCP agent: the answer and the error captured, nothing at a terminal, and `ask` taken as yes. */
|
|
37
|
-
export const runForAgent = async (run, argv, deps) => {
|
|
38
|
+
export const runForAgent = async (run, argv, deps, environment) => {
|
|
38
39
|
const stdout = [];
|
|
39
40
|
const stderr = [];
|
|
40
41
|
const { serveMcp: _serve, streamData: _stream, ...rest } = deps;
|
|
41
42
|
const code = await run(argv, {
|
|
42
43
|
...rest,
|
|
44
|
+
...(environment?.agent
|
|
45
|
+
? {
|
|
46
|
+
agent: {
|
|
47
|
+
...environment.agent,
|
|
48
|
+
result: (value) => stdout.push(JSON.stringify(value)),
|
|
49
|
+
failure: (value) => stderr.push(JSON.stringify(value)),
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
: {}),
|
|
43
53
|
data: (text) => stdout.push(text),
|
|
44
54
|
diagnostic: (text) => stderr.push(text),
|
|
45
55
|
outputIsTTY: false,
|
package/dist/mcp-command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-command.js","sourceRoot":"","sources":["../src/mcp-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EAAE,KAAK,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"mcp-command.js","sourceRoot":"","sources":["../src/mcp-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,UAAU,EAAmB,MAAM,uBAAuB,CAAA;AAc9F,mHAAmH;AACnH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAE,IAAoB,EAAQ,EAAE;IAC7E,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAC/B,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,YAAY;QACtB,GAAG,EAAE,KAAK;QACV,QAAQ,EAAE,CAAC,iBAAiB,CAAC;KAC9B,CAAC;SACC,WAAW,CAAC,kFAAkF,CAAC;SAC/F,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI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,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;IAC/D,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE;QAC3B,GAAG,IAAI;QACP,GAAG,CAAC,WAAW,EAAE,KAAK;YACpB,CAAC,CAAC;gBACE,KAAK,EAAE;oBACL,GAAG,WAAW,CAAC,KAAK;oBACpB,MAAM,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;oBAC9D,OAAO,EAAE,CAAC,KAAc,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;iBAChE;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACjC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACvC,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;KAC1B,CAAC,CAAA;IACF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAA;AACnE,CAAC,CAAA"}
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
2
2
|
import type { CommandInfo } from "@wirecat/cli-base/commands";
|
|
3
|
+
import type { RunOptions } from "@wirecat/cli-core/cli";
|
|
3
4
|
import type { Level } from "@wirecat/cli-core/sends";
|
|
4
5
|
/** One run of the CLI for an agent: its exit code and what it printed, the answer on stdout or the error on stderr. */
|
|
5
|
-
export type RunCommand = (argv: string[]) => Promise<{
|
|
6
|
+
export type RunCommand = (argv: string[], environment?: RunOptions) => Promise<{
|
|
6
7
|
code: number;
|
|
7
8
|
stdout: string;
|
|
8
9
|
stderr: string;
|
|
@@ -12,6 +13,7 @@ export interface ZoomMcpOptions {
|
|
|
12
13
|
commands: readonly CommandInfo[];
|
|
13
14
|
/** The profile's own levels, read on every call. */
|
|
14
15
|
permissions: () => Readonly<Record<string, Level>>;
|
|
16
|
+
authority: (path: readonly string[]) => boolean;
|
|
15
17
|
run: RunCommand;
|
|
16
18
|
signal?: AbortSignal;
|
|
17
19
|
/** Where the protocol runs; stdin and stdout when not given. */
|
|
@@ -20,7 +22,7 @@ export interface ZoomMcpOptions {
|
|
|
20
22
|
/**
|
|
21
23
|
* The shared WireCat MCP surface over zm's own commands: `zm_tools_search`, `zm_read`, `zm_write` (WC-MCP-1, 2). A
|
|
22
24
|
* call runs the command line itself, so it answers and fails as the command does (WC-MCP-10); `ask` counts as yes,
|
|
23
|
-
* since no one is at a terminal (WC-MCP-7), and
|
|
25
|
+
* since no one is at a terminal (WC-MCP-7), and denied commands stay discoverable with availability but cannot run (WC-MCP-6).
|
|
24
26
|
*/
|
|
25
27
|
export declare const createZoomMcpServer: (options: ZoomMcpOptions) => McpServer;
|
|
26
28
|
/** Serves until the client closes the connection or the command is stopped. */
|
package/dist/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAGvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAIpD,uHAAuH;AACvH,MAAM,MAAM,UAAU,GAAG,CACvB,IAAI,EAAE,MAAM,EAAE,EACd,WAAW,CAAC,EAAE,UAAU,KACrB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAE9D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAA;IAChC,oDAAoD;IACpD,WAAW,EAAE,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;IAClD,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,OAAO,CAAA;IAC/C,GAAG,EAAE,UAAU,CAAA;IACf,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,gEAAgE;IAChE,SAAS,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;CAChD;AAuBD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,YAAa,cAAc,KAAG,SA8D7D,CAAA;AAED,+EAA+E;AAC/E,eAAO,MAAM,YAAY,YAAmB,cAAc,KAAG,OAAO,CAAC,IAAI,CAgBxE,CAAA"}
|
package/dist/mcp.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
3
3
|
import { CliError, errorObjectOf, mcpErrorResult, visibleControls } from "@wirecat/cli-base";
|
|
4
|
+
import { isBody, itemAnswer } from "@wirecat/cli-core/cli";
|
|
4
5
|
import { registerCommands, runCommandForAgent, toolsFromCommands } from "@wirecat/cli-core/mcp";
|
|
5
|
-
import { DEFAULT_PERMISSIONS } from "./permissions.js";
|
|
6
|
+
import { DEFAULT_PERMISSIONS, permissionKeyForPath, recordingPermissions } from "./permissions.js";
|
|
6
7
|
import { VERSION } from "./version.js";
|
|
7
8
|
const EXCLUDED = [["mcp"], ["serve"], ["complete"], ["watch"]];
|
|
8
|
-
const authorityAllowed = (levels) => levels["mcp.authority"] === "allow" || levels["mcp.authority"] === "ask";
|
|
9
|
-
const changesAuthority = (path) => ["config set", "skill install", "session start"].includes(path.join(" "));
|
|
10
9
|
/** A remote embedding service is the owner's choice on the command line; over MCP only an installed model answers. */
|
|
11
10
|
const OMITTED = ["base_url", "dims"];
|
|
12
|
-
const keyOf =
|
|
11
|
+
const keyOf = permissionKeyForPath;
|
|
13
12
|
// Retrieved text reaches an agent; hidden control and direction characters are shown, not obeyed.
|
|
14
13
|
const visible = (value) => {
|
|
15
14
|
if (typeof value === "string")
|
|
@@ -21,11 +20,14 @@ const visible = (value) => {
|
|
|
21
20
|
return value;
|
|
22
21
|
};
|
|
23
22
|
/** The levels a tool call is checked against: the built-in defaults under the profile's own, as on the command line. */
|
|
24
|
-
const levelsOf = (own) => ({
|
|
23
|
+
const levelsOf = (own) => ({
|
|
24
|
+
...DEFAULT_PERMISSIONS,
|
|
25
|
+
...recordingPermissions(own),
|
|
26
|
+
});
|
|
25
27
|
/**
|
|
26
28
|
* The shared WireCat MCP surface over zm's own commands: `zm_tools_search`, `zm_read`, `zm_write` (WC-MCP-1, 2). A
|
|
27
29
|
* call runs the command line itself, so it answers and fails as the command does (WC-MCP-10); `ask` counts as yes,
|
|
28
|
-
* since no one is at a terminal (WC-MCP-7), and
|
|
30
|
+
* since no one is at a terminal (WC-MCP-7), and denied commands stay discoverable with availability but cannot run (WC-MCP-6).
|
|
29
31
|
*/
|
|
30
32
|
export const createZoomMcpServer = (options) => {
|
|
31
33
|
const server = new McpServer({ name: "zm", version: VERSION }, {
|
|
@@ -37,37 +39,42 @@ export const createZoomMcpServer = (options) => {
|
|
|
37
39
|
commands: options.commands,
|
|
38
40
|
run: async (argv, environment) => {
|
|
39
41
|
const agent = environment.agent;
|
|
40
|
-
const ran = await options.run(argv);
|
|
41
|
-
if (ran.code === 0)
|
|
42
|
-
|
|
42
|
+
const ran = await options.run(argv, environment);
|
|
43
|
+
if (ran.code === 0) {
|
|
44
|
+
const packet = JSON.parse(ran.stdout || "null");
|
|
45
|
+
agent.result(visible(isBody(packet) ? packet : itemAnswer(packet)));
|
|
46
|
+
}
|
|
43
47
|
else
|
|
44
48
|
agent.failure(JSON.parse(ran.stderr || "{}"));
|
|
45
49
|
return ran.code;
|
|
46
50
|
},
|
|
47
51
|
};
|
|
48
|
-
const
|
|
52
|
+
const offered = () => toolsFromCommands(options.commands, {
|
|
53
|
+
includeUnavailable: true,
|
|
54
|
+
currentLevels: () => levelsOf(options.permissions()),
|
|
49
55
|
exclude: EXCLUDED,
|
|
50
56
|
omit: OMITTED,
|
|
51
57
|
levels: levelsOf(options.permissions()),
|
|
52
58
|
keyOf,
|
|
53
|
-
authority:
|
|
59
|
+
authority: options.authority,
|
|
54
60
|
});
|
|
61
|
+
const tools = offered();
|
|
55
62
|
const commands = Object.fromEntries(tools.map((tool) => [
|
|
56
63
|
tool.command,
|
|
57
64
|
{
|
|
58
65
|
title: tool.title,
|
|
59
66
|
description: tool.description,
|
|
60
67
|
writes: tool.writes,
|
|
68
|
+
availability: tool.availability,
|
|
61
69
|
input: tool.input,
|
|
62
70
|
run: async (input) => {
|
|
63
|
-
if (changesAuthority(tool.path) && !authorityAllowed(levelsOf(options.permissions())))
|
|
64
|
-
return mcpErrorResult(errorObjectOf(new CliError("permission_error", "this command requires mcp.authority: allow")));
|
|
65
71
|
if (tool.command === "config set" && input.key === "permissions")
|
|
66
72
|
return mcpErrorResult(errorObjectOf(new CliError("permission_error", "change profile permissions in a terminal")));
|
|
67
73
|
const answer = await runCommandForAgent(program, tool.path, input, {
|
|
68
74
|
profile: options.profile,
|
|
69
75
|
levels: () => levelsOf(options.permissions()),
|
|
70
76
|
keyOf,
|
|
77
|
+
authority: options.authority,
|
|
71
78
|
});
|
|
72
79
|
if ("error" in answer)
|
|
73
80
|
return mcpErrorResult(answer.error);
|
package/dist/mcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAI5F,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAmB,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEhH,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAoBtC,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC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AG,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAC3C,IAAI,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;IACnB,IAAI,CAAC;QACH,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,MAAM,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAA;YAC/B,IAAI,GAAG,GAAG,EAAE;gBACV,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;YAC3C,CAAC,CAAA;YACD,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;YAC/D,KAAK,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QACpF,CAAC,CAAC,CAAA;IACJ,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QAClD,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;IACtB,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models-commands.d.ts","sourceRoot":"","sources":["../src/models-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"models-commands.d.ts","sourceRoot":"","sources":["../src/models-commands.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,IAAI,EAUV,MAAM,uBAAuB,CAAA;AAU9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAyBxC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YACnB,OAAO,QACV;IAAE,GAAG,EAAE,MAAM,MAAM,CAAC,UAAU,CAAC;IAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,KACvG,IAsCF,CAAA"}
|