@leemour/cli-messaging 0.156.0 → 0.157.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 +5 -7
- package/dist/cli/agent-evaluation.d.ts +25 -0
- package/dist/cli/agent-evaluation.d.ts.map +1 -0
- package/dist/cli/agent-evaluation.js +42 -0
- package/dist/cli/agent-evaluation.js.map +1 -0
- package/dist/cli/bot/mcp.d.ts.map +1 -1
- package/dist/cli/bot/mcp.js +4 -12
- package/dist/cli/bot/mcp.js.map +1 -1
- package/dist/cli/command-contract.d.ts +85 -0
- package/dist/cli/command-contract.d.ts.map +1 -0
- package/dist/cli/command-contract.js +211 -0
- package/dist/cli/command-contract.js.map +1 -0
- package/dist/cli/commands-command.d.ts.map +1 -1
- package/dist/cli/commands-command.js +44 -28
- package/dist/cli/commands-command.js.map +1 -1
- package/dist/cli/context.d.ts +2 -0
- package/dist/cli/context.d.ts.map +1 -1
- package/dist/cli/context.js +10 -3
- package/dist/cli/context.js.map +1 -1
- package/dist/cli/deadline.js +3 -4
- package/dist/cli/deadline.js.map +1 -1
- package/dist/cli/execution.d.ts +26 -0
- package/dist/cli/execution.d.ts.map +1 -0
- package/dist/cli/execution.js +175 -0
- package/dist/cli/execution.js.map +1 -0
- package/dist/cli/index.d.ts +6 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +6 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/input-policy.d.ts +14 -0
- package/dist/cli/input-policy.d.ts.map +1 -0
- package/dist/cli/input-policy.js +66 -0
- package/dist/cli/input-policy.js.map +1 -0
- package/dist/cli/messenger/mcp-command.d.ts +0 -1
- package/dist/cli/messenger/mcp-command.d.ts.map +1 -1
- package/dist/cli/messenger/mcp-command.js +15 -19
- package/dist/cli/messenger/mcp-command.js.map +1 -1
- package/dist/cli/messenger/messages-search-command.d.ts.map +1 -1
- package/dist/cli/messenger/messages-search-command.js +7 -3
- package/dist/cli/messenger/messages-search-command.js.map +1 -1
- package/dist/cli/messenger/stats-command.d.ts.map +1 -1
- package/dist/cli/messenger/stats-command.js +1 -12
- package/dist/cli/messenger/stats-command.js.map +1 -1
- package/dist/cli/messenger/stdin.d.ts.map +1 -1
- package/dist/cli/messenger/stdin.js +2 -4
- package/dist/cli/messenger/stdin.js.map +1 -1
- package/dist/cli/permission-migration.d.ts.map +1 -1
- package/dist/cli/permission-migration.js +14 -8
- package/dist/cli/permission-migration.js.map +1 -1
- package/dist/cli/preview.d.ts +35 -0
- package/dist/cli/preview.d.ts.map +1 -0
- package/dist/cli/preview.js +40 -0
- package/dist/cli/preview.js.map +1 -0
- package/dist/cli/program.d.ts +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +148 -15
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/result-fields.d.ts +3 -0
- package/dist/cli/result-fields.d.ts.map +1 -0
- package/dist/cli/result-fields.js +55 -0
- package/dist/cli/result-fields.js.map +1 -0
- package/dist/kit/index.d.ts +1 -0
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +1 -0
- package/dist/kit/index.js.map +1 -1
- package/dist/kit/mcp-commands-client.d.ts +7 -0
- package/dist/kit/mcp-commands-client.d.ts.map +1 -0
- package/dist/kit/mcp-commands-client.js +50 -0
- package/dist/kit/mcp-commands-client.js.map +1 -0
- package/dist/mcp/bot/instructions.d.ts +2 -3
- package/dist/mcp/bot/instructions.d.ts.map +1 -1
- package/dist/mcp/bot/instructions.js +4 -10
- package/dist/mcp/bot/instructions.js.map +1 -1
- package/dist/mcp/bot/server.d.ts +0 -6
- package/dist/mcp/bot/server.d.ts.map +1 -1
- package/dist/mcp/bot/server.js +30 -76
- package/dist/mcp/bot/server.js.map +1 -1
- package/dist/mcp/bot/tools.d.ts +3 -11
- package/dist/mcp/bot/tools.d.ts.map +1 -1
- package/dist/mcp/bot/tools.js +7 -22
- package/dist/mcp/bot/tools.js.map +1 -1
- package/dist/mcp/instructions.d.ts +1 -2
- package/dist/mcp/instructions.d.ts.map +1 -1
- package/dist/mcp/instructions.js +6 -13
- package/dist/mcp/instructions.js.map +1 -1
- package/dist/mcp/personal.d.ts +1 -1
- package/dist/mcp/personal.d.ts.map +1 -1
- package/dist/mcp/personal.js +1 -1
- package/dist/mcp/personal.js.map +1 -1
- package/dist/mcp/prompts.js +14 -14
- package/dist/mcp/prompts.js.map +1 -1
- package/dist/mcp/server.d.ts +3 -23
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +20 -51
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/surface.d.ts +29 -0
- package/dist/mcp/surface.d.ts.map +1 -0
- package/dist/mcp/surface.js +125 -0
- package/dist/mcp/surface.js.map +1 -0
- package/dist/mcp/tool.d.ts +19 -24
- package/dist/mcp/tool.d.ts.map +1 -1
- package/dist/mcp/tool.js +109 -91
- package/dist/mcp/tool.js.map +1 -1
- package/dist/mcp/tools/admin.d.ts.map +1 -1
- package/dist/mcp/tools/admin.js +1 -10
- package/dist/mcp/tools/admin.js.map +1 -1
- package/dist/mcp/tools/attachments.d.ts.map +1 -1
- package/dist/mcp/tools/attachments.js +1 -2
- package/dist/mcp/tools/attachments.js.map +1 -1
- package/dist/mcp/tools/chats-read.d.ts.map +1 -1
- package/dist/mcp/tools/chats-read.js +1 -2
- package/dist/mcp/tools/chats-read.js.map +1 -1
- package/dist/mcp/tools/contacts-write.d.ts.map +1 -1
- package/dist/mcp/tools/contacts-write.js +1 -4
- package/dist/mcp/tools/contacts-write.js.map +1 -1
- package/dist/mcp/tools/conversations.d.ts.map +1 -1
- package/dist/mcp/tools/conversations.js +1 -5
- package/dist/mcp/tools/conversations.js.map +1 -1
- package/dist/mcp/tools/folders.d.ts.map +1 -1
- package/dist/mcp/tools/folders.js +1 -4
- package/dist/mcp/tools/folders.js.map +1 -1
- package/dist/mcp/tools/messages-actions.d.ts.map +1 -1
- package/dist/mcp/tools/messages-actions.js +1 -5
- package/dist/mcp/tools/messages-actions.js.map +1 -1
- package/dist/mcp/tools/messages-delete.d.ts.map +1 -1
- package/dist/mcp/tools/messages-delete.js +1 -2
- package/dist/mcp/tools/messages-delete.js.map +1 -1
- package/dist/mcp/tools/messages-send.d.ts.map +1 -1
- package/dist/mcp/tools/messages-send.js +1 -2
- package/dist/mcp/tools/messages-send.js.map +1 -1
- package/dist/mcp/tools/moderation.d.ts.map +1 -1
- package/dist/mcp/tools/moderation.js +1 -2
- package/dist/mcp/tools/moderation.js.map +1 -1
- package/dist/mcp/tools/polls.d.ts.map +1 -1
- package/dist/mcp/tools/polls.js +1 -4
- package/dist/mcp/tools/polls.js.map +1 -1
- package/dist/mcp/tools/reactions.d.ts.map +1 -1
- package/dist/mcp/tools/reactions.js +1 -3
- package/dist/mcp/tools/reactions.js.map +1 -1
- package/dist/mcp/tools/searches.d.ts.map +1 -1
- package/dist/mcp/tools/searches.js +1 -5
- package/dist/mcp/tools/searches.js.map +1 -1
- package/dist/mcp/tools/tags.d.ts.map +1 -1
- package/dist/mcp/tools/tags.js +1 -4
- package/dist/mcp/tools/tags.js.map +1 -1
- package/dist/mcp/tools/tasks.d.ts.map +1 -1
- package/dist/mcp/tools/tasks.js +1 -4
- package/dist/mcp/tools/tasks.js.map +1 -1
- package/dist/mcp/tools/topics.d.ts.map +1 -1
- package/dist/mcp/tools/topics.js +1 -3
- package/dist/mcp/tools/topics.js.map +1 -1
- package/dist/output.d.ts +3 -1
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +13 -3
- package/dist/output.js.map +1 -1
- package/dist/sends/guarded.d.ts +2 -0
- package/dist/sends/guarded.d.ts.map +1 -1
- package/dist/sends/guarded.js +37 -3
- package/dist/sends/guarded.js.map +1 -1
- package/dist/skills/validate.d.ts +9 -0
- package/dist/skills/validate.d.ts.map +1 -0
- package/dist/skills/validate.js +86 -0
- package/dist/skills/validate.js.map +1 -0
- package/dist/store/sqlite/chats.d.ts.map +1 -1
- package/dist/store/sqlite/chats.js +7 -3
- package/dist/store/sqlite/chats.js.map +1 -1
- package/dist/terminal/prompt.d.ts +1 -1
- package/dist/terminal/prompt.d.ts.map +1 -1
- package/dist/terminal/prompt.js +34 -31
- package/dist/terminal/prompt.js.map +1 -1
- package/package.json +9 -3
- package/parity.json +81 -346
- package/skills/link-conversations/SKILL.md +8 -13
- package/dist/mcp/confirm.d.ts +0 -30
- package/dist/mcp/confirm.d.ts.map +0 -1
- package/dist/mcp/confirm.js +0 -92
- package/dist/mcp/confirm.js.map +0 -1
- package/dist/mcp/http/policy.d.ts +0 -13
- package/dist/mcp/http/policy.d.ts.map +0 -1
- package/dist/mcp/http/policy.js +0 -18
- package/dist/mcp/http/policy.js.map +0 -1
|
@@ -79,19 +79,14 @@ was added or deleted inside it: ask for the next batch instead.
|
|
|
79
79
|
|
|
80
80
|
## Through MCP
|
|
81
81
|
|
|
82
|
-
Follow the same cost gate and loop
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
| conversations batches status | {{command}}_conversations_batches_status |
|
|
88
|
-
| conversations batches next | {{command}}_conversations_batches_next |
|
|
89
|
-
| conversations links add | {{command}}_conversations_links_add |
|
|
90
|
-
| conversations links clear | {{command}}_conversations_links_clear |
|
|
91
|
-
| conversations show | {{command}}_conversations_show |
|
|
82
|
+
Follow the same cost gate and loop through MCP: each step is the same command, run with
|
|
83
|
+
`{{command}}_read` (`conversations batches status`, `conversations batches next`,
|
|
84
|
+
`conversations show`) or `{{command}}_write` (`conversations build`, `conversations links add`,
|
|
85
|
+
`conversations links clear`), as `{ "command": "conversations build", "arguments": { … } }`.
|
|
86
|
+
`{{command}}_tools_search` shows each one's arguments.
|
|
92
87
|
|
|
93
88
|
Use `chat` for the chat reference, and `size` for the batch size (10–200, default 50).
|
|
94
|
-
Send `batch`, `model`, `skill` and `answers` as the links
|
|
89
|
+
Send `batch`, `model`, `skill` and `answers` as the arguments of `conversations links add`.
|
|
95
90
|
Next returns `{ "batch": null }` when finished. Build before status and once more after the last
|
|
96
|
-
answer. The
|
|
97
|
-
|
|
91
|
+
answer. The writing commands run where `permissions.conversations.links` is `allow` or `ask`. A read-only
|
|
92
|
+
profile offers only status and next.
|
package/dist/mcp/confirm.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type InputRequiredResult, type ServerContext } from "@modelcontextprotocol/server";
|
|
2
|
-
/** A chat as the form shows it: the id it resolved to, and its title. */
|
|
3
|
-
export type ResolveChat = (reference: string) => Promise<{
|
|
4
|
-
id: string;
|
|
5
|
-
title?: string | null;
|
|
6
|
-
}>;
|
|
7
|
-
type Arguments = Record<string, unknown>;
|
|
8
|
-
/**
|
|
9
|
-
* **`--confirm-send`: the server asks the owner itself, for every write, and shows where the names
|
|
10
|
-
* resolved to** — max-cli's `confirm.ts` (its `CLI-28`).
|
|
11
|
-
*
|
|
12
|
-
* The client's own approval shows the arguments as the model wrote them — `chat: "Team"`. The form
|
|
13
|
-
* shows the chat that name became and the whole text, which is what the owner is actually agreeing
|
|
14
|
-
* to. The first call writes nothing; the SDK shows the form and calls again with the answer.
|
|
15
|
-
*
|
|
16
|
-
* The answer is bound to what the form showed: `requestState` carries an HMAC of the tool, every
|
|
17
|
-
* argument with its chats resolved, a nonce and an expiry, under a key that never leaves this
|
|
18
|
-
* process. The state round-trips through the client, so without the key an answer given for one
|
|
19
|
-
* message could be carried to another, or to another tool; the nonce is spent on first use, so a
|
|
20
|
-
* yes cannot be replayed. A client that cannot show a form fails the call in the SDK, before the
|
|
21
|
-
* second call — nothing is written.
|
|
22
|
-
*/
|
|
23
|
-
export declare const confirmer: ({ now }?: {
|
|
24
|
-
now?: () => number;
|
|
25
|
-
}) => (tool: {
|
|
26
|
-
name: string;
|
|
27
|
-
title: string;
|
|
28
|
-
}, resolveChat: ResolveChat, args: Arguments, ctx: ServerContext, act: (resolved: Arguments) => Promise<object>) => Promise<object | InputRequiredResult>;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=confirm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../src/mcp/confirm.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,mBAAmB,EAGxB,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAA;AAGrC,yEAAyE;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAAA;AAM/F,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAExC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,aAAgC;IAAE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAAE,YAalE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,eACxB,WAAW,QAClB,SAAS,OACV,aAAa,OACb,CAAC,QAAQ,EAAE,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,KAC5C,OAAO,CAAC,MAAM,GAAG,mBAAmB,CAqExC,CAAA"}
|
package/dist/mcp/confirm.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
2
|
-
import { CliError } from "@leemour/cli-core";
|
|
3
|
-
import { inputRequired, inputResponse, } from "@modelcontextprotocol/server";
|
|
4
|
-
import { sendTime } from "../domain/send-time.js";
|
|
5
|
-
/** The arguments that name a chat: each is shown as the chat it resolved to, and sealed as its id. */
|
|
6
|
-
const CHAT_ARGUMENTS = ["chat", "to"];
|
|
7
|
-
const VALID_MS = 5 * 60 * 1000;
|
|
8
|
-
/**
|
|
9
|
-
* **`--confirm-send`: the server asks the owner itself, for every write, and shows where the names
|
|
10
|
-
* resolved to** — max-cli's `confirm.ts` (its `CLI-28`).
|
|
11
|
-
*
|
|
12
|
-
* The client's own approval shows the arguments as the model wrote them — `chat: "Team"`. The form
|
|
13
|
-
* shows the chat that name became and the whole text, which is what the owner is actually agreeing
|
|
14
|
-
* to. The first call writes nothing; the SDK shows the form and calls again with the answer.
|
|
15
|
-
*
|
|
16
|
-
* The answer is bound to what the form showed: `requestState` carries an HMAC of the tool, every
|
|
17
|
-
* argument with its chats resolved, a nonce and an expiry, under a key that never leaves this
|
|
18
|
-
* process. The state round-trips through the client, so without the key an answer given for one
|
|
19
|
-
* message could be carried to another, or to another tool; the nonce is spent on first use, so a
|
|
20
|
-
* yes cannot be replayed. A client that cannot show a form fails the call in the SDK, before the
|
|
21
|
-
* second call — nothing is written.
|
|
22
|
-
*/
|
|
23
|
-
export const confirmer = ({ now = () => Date.now() } = {}) => {
|
|
24
|
-
const key = randomBytes(32);
|
|
25
|
-
const issued = new Map();
|
|
26
|
-
const seal = (tool, args, nonce, expires) => createHmac("sha256", key)
|
|
27
|
-
.update(JSON.stringify([tool, Object.entries(args).sort(([a], [b]) => a.localeCompare(b)), nonce, expires]))
|
|
28
|
-
.digest("base64url");
|
|
29
|
-
const matches = (given, expected) => given.length === expected.length && timingSafeEqual(Buffer.from(given), Buffer.from(expected));
|
|
30
|
-
return async (tool, resolveChat, args, ctx, act) => {
|
|
31
|
-
for (const [nonce, entry] of issued)
|
|
32
|
-
if (entry.expires < now())
|
|
33
|
-
issued.delete(nonce);
|
|
34
|
-
const answer = inputResponse(ctx.mcpReq.inputResponses, "confirm");
|
|
35
|
-
const previousNonce = answer.kind === "missing" ? undefined : ctx.mcpReq.requestState()?.split(".")[0];
|
|
36
|
-
const previousTime = previousNonce === undefined ? undefined : issued.get(previousNonce)?.time;
|
|
37
|
-
const time = typeof args.at_time === "string"
|
|
38
|
-
? {
|
|
39
|
-
given: args.at_time,
|
|
40
|
-
fixed: previousTime?.given === args.at_time ? previousTime.fixed : sendTime(args.at_time, now()),
|
|
41
|
-
}
|
|
42
|
-
: undefined;
|
|
43
|
-
const shown = [];
|
|
44
|
-
const resolved = { ...args };
|
|
45
|
-
if (time)
|
|
46
|
-
resolved.at_time = time.fixed;
|
|
47
|
-
for (const name of CHAT_ARGUMENTS) {
|
|
48
|
-
if (typeof args[name] !== "string")
|
|
49
|
-
continue;
|
|
50
|
-
const chat = await resolveChat(args[name]);
|
|
51
|
-
resolved[name] = chat.id;
|
|
52
|
-
shown.push(`${name}: ${JSON.stringify(chat.title ?? chat.id)} (${chat.id})`);
|
|
53
|
-
}
|
|
54
|
-
for (const [name, value] of Object.entries(args)) {
|
|
55
|
-
if (CHAT_ARGUMENTS.includes(name) || name === "text")
|
|
56
|
-
continue;
|
|
57
|
-
// A delay like "30m" is not a time; the owner agrees to the clock time it becomes.
|
|
58
|
-
const when = name === "at_time" && time ? ` — sends at ${time.fixed}` : "";
|
|
59
|
-
shown.push(`${name}: ${JSON.stringify(value)}${when}`);
|
|
60
|
-
}
|
|
61
|
-
if (typeof args.text === "string")
|
|
62
|
-
shown.push("", args.text);
|
|
63
|
-
if (answer.kind === "missing") {
|
|
64
|
-
const nonce = randomBytes(16).toString("base64url");
|
|
65
|
-
const expires = now() + VALID_MS;
|
|
66
|
-
issued.set(nonce, { expires, ...(time ? { time } : {}) });
|
|
67
|
-
return inputRequired({
|
|
68
|
-
inputRequests: {
|
|
69
|
-
confirm: inputRequired.elicit({
|
|
70
|
-
message: `${tool.title}?\n\n${shown.join("\n")}`,
|
|
71
|
-
requestedSchema: { type: "object", properties: {} },
|
|
72
|
-
}),
|
|
73
|
-
},
|
|
74
|
-
requestState: `${nonce}.${expires}.${seal(tool.name, resolved, nonce, expires)}`,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
if (answer.kind !== "elicit" || answer.action !== "accept") {
|
|
78
|
-
throw new CliError("confirmation_required", "the owner did not confirm this — nothing was written; do not retry it");
|
|
79
|
-
}
|
|
80
|
-
const [nonce = "", expiresText = "", mac = ""] = (ctx.mcpReq.requestState() ?? "").split(".");
|
|
81
|
-
const expires = Number(expiresText);
|
|
82
|
-
if (!issued.has(nonce) || issued.get(nonce)?.expires !== expires || expires < now()) {
|
|
83
|
-
throw new CliError("confirmation_required", "the confirmation has expired, was already used, or is not from this server — nothing was written");
|
|
84
|
-
}
|
|
85
|
-
if (!matches(mac, seal(tool.name, resolved, nonce, expires))) {
|
|
86
|
-
throw new CliError("confirmation_required", "the confirmation was given for another tool, chat or text — nothing was written");
|
|
87
|
-
}
|
|
88
|
-
issued.delete(nonce);
|
|
89
|
-
return act(resolved);
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=confirm.js.map
|
package/dist/mcp/confirm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.js","sourceRoot":"","sources":["../../src/mcp/confirm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAEL,aAAa,EACb,aAAa,GAEd,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAKjD,sGAAsG;AACtG,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AACrC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAA;AAI9B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,GAA2B,EAAE,EAAE,EAAE;IACnF,MAAM,GAAG,GAAG,WAAW,CAAC,EAAE,CAAC,CAAA;IAC3B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAwE,CAAA;IAE9F,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,IAAe,EAAE,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,EACvB,uEAAuE,CACxE,CAAA;QACH,CAAC;QACD,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,EAAU,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACrG,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;QACnC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,IAAI,OAAO,GAAG,GAAG,EAAE,EAAE,CAAC;YACpF,MAAM,IAAI,QAAQ,CAChB,uBAAuB,EACvB,kGAAkG,CACnG,CAAA;QACH,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;YAC7D,MAAM,IAAI,QAAQ,CAChB,uBAAuB,EACvB,iFAAiF,CAClF,CAAA;QACH,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAA;IACtB,CAAC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type HttpConfirmation = "required" | "permissions";
|
|
2
|
-
export declare const httpConfirmationOf: (flags: {
|
|
3
|
-
http?: boolean;
|
|
4
|
-
httpConfirmation?: string;
|
|
5
|
-
confirmSend?: boolean;
|
|
6
|
-
}) => HttpConfirmation;
|
|
7
|
-
/** HTTP never inherits the stdio flags that bypass questions at level ask. */
|
|
8
|
-
export declare const httpServerOptions: (mode?: HttpConfirmation) => {
|
|
9
|
-
confirmSend: boolean;
|
|
10
|
-
yes: boolean;
|
|
11
|
-
allowDangerous: boolean;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../src/mcp/http/policy.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,CAAA;AAEzD,eAAO,MAAM,kBAAkB,UAAW;IACxC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,KAAG,gBASH,CAAA;AAED,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,UAAU,gBAAgB;IACtD,WAAW;IACX,GAAG;IACH,cAAc;CACd,CAAA"}
|
package/dist/mcp/http/policy.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CliError } from "@leemour/cli-core";
|
|
2
|
-
export const httpConfirmationOf = (flags) => {
|
|
3
|
-
const mode = flags.httpConfirmation ?? "required";
|
|
4
|
-
if (flags.httpConfirmation !== undefined && !flags.http)
|
|
5
|
-
throw new CliError("validation_error", "--http-confirmation needs --http");
|
|
6
|
-
if (mode !== "required" && mode !== "permissions")
|
|
7
|
-
throw new CliError("validation_error", "--http-confirmation takes required or permissions");
|
|
8
|
-
if (mode === "permissions" && flags.confirmSend)
|
|
9
|
-
throw new CliError("validation_error", "--http-confirmation permissions conflicts with --confirm-send");
|
|
10
|
-
return mode;
|
|
11
|
-
};
|
|
12
|
-
/** HTTP never inherits the stdio flags that bypass questions at level ask. */
|
|
13
|
-
export const httpServerOptions = (mode = "required") => ({
|
|
14
|
-
confirmSend: httpConfirmationOf({ http: true, httpConfirmation: mode }) === "required",
|
|
15
|
-
yes: false,
|
|
16
|
-
allowDangerous: false,
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=policy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../src/mcp/http/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAI5C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAIlC,EAAoB,EAAE;IACrB,MAAM,IAAI,GAAG,KAAK,CAAC,gBAAgB,IAAI,UAAU,CAAA;IACjD,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI;QACrD,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,kCAAkC,CAAC,CAAA;IAC5E,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,aAAa;QAC/C,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,mDAAmD,CAAC,CAAA;IAC7F,IAAI,IAAI,KAAK,aAAa,IAAI,KAAK,CAAC,WAAW;QAC7C,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,+DAA+D,CAAC,CAAA;IACzG,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAI,GAAqB,UAAU,EAAE,EAAE,CAAC,CAAC;IACzE,WAAW,EAAE,kBAAkB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,KAAK,UAAU;IACtF,GAAG,EAAE,KAAK;IACV,cAAc,EAAE,KAAK;CACtB,CAAC,CAAA"}
|