@wirecat/max-cli 0.55.0 → 0.56.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/dist/adapter/max-adapter.d.ts +1 -5
- package/dist/adapter/max-adapter.d.ts.map +1 -1
- package/dist/adapter/max-adapter.js +21 -53
- package/dist/adapter/max-adapter.js.map +1 -1
- package/dist/client/account.d.ts +3 -3
- package/dist/client/account.d.ts.map +1 -1
- package/dist/client/account.js +4 -4
- package/dist/client/account.js.map +1 -1
- package/dist/client/chat-members.d.ts +2 -1
- package/dist/client/chat-members.d.ts.map +1 -1
- package/dist/client/chat-members.js.map +1 -1
- package/dist/client/chat-reads.d.ts +2 -1
- package/dist/client/chat-reads.d.ts.map +1 -1
- package/dist/client/chat-reads.js +9 -7
- package/dist/client/chat-reads.js.map +1 -1
- package/dist/client/chat-writes.d.ts +5 -12
- package/dist/client/chat-writes.d.ts.map +1 -1
- package/dist/client/chat-writes.js +40 -67
- package/dist/client/chat-writes.js.map +1 -1
- package/dist/client/contacts.d.ts +4 -4
- package/dist/client/contacts.d.ts.map +1 -1
- package/dist/client/contacts.js +6 -6
- package/dist/client/contacts.js.map +1 -1
- package/dist/client/delivery.d.ts +1 -1
- package/dist/client/delivery.d.ts.map +1 -1
- package/dist/client/delivery.js.map +1 -1
- package/dist/client/folders.d.ts +2 -3
- package/dist/client/folders.d.ts.map +1 -1
- package/dist/client/folders.js +4 -4
- package/dist/client/folders.js.map +1 -1
- package/dist/client/history.d.ts +2 -1
- package/dist/client/history.d.ts.map +1 -1
- package/dist/client/history.js +4 -3
- package/dist/client/history.js.map +1 -1
- package/dist/client/live.d.ts +2 -1
- package/dist/client/live.d.ts.map +1 -1
- package/dist/client/live.js.map +1 -1
- package/dist/client/message-reads.d.ts +1 -1
- package/dist/client/message-reads.d.ts.map +1 -1
- package/dist/client/message-reads.js +7 -5
- package/dist/client/message-reads.js.map +1 -1
- package/dist/client/message-writes.d.ts +2 -8
- package/dist/client/message-writes.d.ts.map +1 -1
- package/dist/client/message-writes.js +75 -178
- package/dist/client/message-writes.js.map +1 -1
- package/dist/client/people.d.ts +1 -1
- package/dist/client/people.d.ts.map +1 -1
- package/dist/client/people.js.map +1 -1
- package/dist/client/polls.d.ts +5 -10
- package/dist/client/polls.d.ts.map +1 -1
- package/dist/client/polls.js +27 -74
- package/dist/client/polls.js.map +1 -1
- package/dist/client/session.d.ts +1 -1
- package/dist/client/session.d.ts.map +1 -1
- package/dist/client/session.js.map +1 -1
- package/dist/client/shapes.d.ts +59 -0
- package/dist/client/shapes.d.ts.map +1 -0
- package/dist/client/shapes.js +6 -0
- package/dist/client/shapes.js.map +1 -0
- package/dist/client/stickers.d.ts +1 -1
- package/dist/client/stickers.d.ts.map +1 -1
- package/dist/client/stickers.js.map +1 -1
- package/dist/client/types.d.ts +0 -8
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/values.d.ts +7 -1
- package/dist/client/values.d.ts.map +1 -1
- package/dist/client/values.js +5 -0
- package/dist/client/values.js.map +1 -1
- package/dist/client/writes.d.ts +6 -15
- package/dist/client/writes.d.ts.map +1 -1
- package/dist/client/writes.js +21 -118
- package/dist/client/writes.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +9 -19
- package/dist/client.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +2 -6
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/serve.js +1 -1
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/session.js +1 -1
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +21 -13
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/watch.d.ts +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +6 -4
- package/dist/commands/watch.js.map +1 -1
- package/dist/domain/map.d.ts +4 -3
- package/dist/domain/map.d.ts.map +1 -1
- package/dist/domain/map.js +27 -22
- package/dist/domain/map.js.map +1 -1
- package/dist/download.d.ts +1 -1
- package/dist/download.d.ts.map +1 -1
- package/dist/messenger.d.ts +1 -1
- package/dist/messenger.d.ts.map +1 -1
- package/dist/messenger.js +36 -9
- package/dist/messenger.js.map +1 -1
- package/dist/permissions.d.ts +3 -3
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +20 -4
- package/dist/permissions.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +2 -3
- package/dist/program.js.map +1 -1
- package/dist/report.d.ts +2 -2
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +25 -13
- package/dist/report.js.map +1 -1
- package/dist/resolve.d.ts +1 -1
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js.map +1 -1
- package/dist/sends.d.ts +3 -3
- package/dist/sends.d.ts.map +1 -1
- package/dist/sends.js +3 -3
- package/dist/sends.js.map +1 -1
- package/dist/server/replies.d.ts +1 -2
- package/dist/server/replies.d.ts.map +1 -1
- package/dist/server/replies.js.map +1 -1
- package/dist/server/server-connection.js +1 -1
- package/dist/server/server-connection.js.map +1 -1
- package/dist/server/server.d.ts +2 -1
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +0 -2
- package/dist/server/server.js.map +1 -1
- package/dist/transcribe/index.d.ts +1 -1
- package/dist/transcribe/index.d.ts.map +1 -1
- package/dist/transcribe/index.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/max-cli/SKILL.md +5 -4
- package/dist/client/read-policy.d.ts +0 -2
- package/dist/client/read-policy.d.ts.map +0 -1
- package/dist/client/read-policy.js +0 -34
- package/dist/client/read-policy.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -29
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -176
- package/dist/commands/mcp.js.map +0 -1
- package/dist/domain/models.d.ts +0 -238
- package/dist/domain/models.d.ts.map +0 -1
- package/dist/domain/models.js +0 -17
- package/dist/domain/models.js.map +0 -1
- package/dist/mcp/instructions.d.ts +0 -4
- package/dist/mcp/instructions.d.ts.map +0 -1
- package/dist/mcp/instructions.js +0 -16
- package/dist/mcp/instructions.js.map +0 -1
- package/dist/mcp/legacy-check.d.ts +0 -12
- package/dist/mcp/legacy-check.d.ts.map +0 -1
- package/dist/mcp/legacy-check.js +0 -46
- package/dist/mcp/legacy-check.js.map +0 -1
- package/dist/mcp/photo.d.ts +0 -9
- package/dist/mcp/photo.d.ts.map +0 -1
- package/dist/mcp/photo.js +0 -38
- package/dist/mcp/photo.js.map +0 -1
- package/dist/mcp/prompts.d.ts +0 -7
- package/dist/mcp/prompts.d.ts.map +0 -1
- package/dist/mcp/prompts.js +0 -102
- package/dist/mcp/prompts.js.map +0 -1
- package/dist/mcp/resources.d.ts +0 -15
- package/dist/mcp/resources.d.ts.map +0 -1
- package/dist/mcp/resources.js +0 -60
- package/dist/mcp/resources.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -23
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -98
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/session.d.ts +0 -30
- package/dist/mcp/session.d.ts.map +0 -1
- package/dist/mcp/session.js +0 -109
- package/dist/mcp/session.js.map +0 -1
- package/dist/mcp/shared.d.ts +0 -14
- package/dist/mcp/shared.d.ts.map +0 -1
- package/dist/mcp/shared.js +0 -46
- package/dist/mcp/shared.js.map +0 -1
- package/dist/mcp/tools.d.ts +0 -19
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js +0 -257
- package/dist/mcp/tools.js.map +0 -1
- package/dist/moderation/check.d.ts +0 -103
- package/dist/moderation/check.d.ts.map +0 -1
- package/dist/moderation/check.js +0 -273
- package/dist/moderation/check.js.map +0 -1
- package/dist/moderation/points.d.ts +0 -8
- package/dist/moderation/points.d.ts.map +0 -1
- package/dist/moderation/points.js +0 -21
- package/dist/moderation/points.js.map +0 -1
- package/dist/rendering/messages.d.ts +0 -24
- package/dist/rendering/messages.d.ts.map +0 -1
- package/dist/rendering/messages.js +0 -172
- package/dist/rendering/messages.js.map +0 -1
package/dist/transcribe/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export const openInstalled = (model, directory) => openRecognizer(model, modelPa
|
|
|
13
13
|
/** The recording of one voice message, fetched while the connection is still open. */
|
|
14
14
|
const fetchVoice = async (client, chatId, messageId, fetchAudio) => {
|
|
15
15
|
const { links } = await client.messages.links(chatId, messageId);
|
|
16
|
-
const voice = links.find((link) => link.kind === "
|
|
16
|
+
const voice = links.find((link) => link.kind === "voice");
|
|
17
17
|
if (!voice)
|
|
18
18
|
throw new CliError("validation_error", `message ${messageId} has no voice recording to transcribe`);
|
|
19
19
|
const bytes = await fetchAudio(voice);
|
|
@@ -113,7 +113,7 @@ export const hearAll = async (client, voices, { model, directory, record, releas
|
|
|
113
113
|
}
|
|
114
114
|
return { transcripts, unheard, ...(problem === undefined ? {} : { problem }) };
|
|
115
115
|
};
|
|
116
|
-
export const isVoice = (message) => message.attachments.some(({ kind }) => kind === "
|
|
116
|
+
export const isVoice = (message) => message.attachments.some(({ kind }) => kind === "voice");
|
|
117
117
|
/** A message with its transcript, when there is one; others pass through unchanged. */
|
|
118
118
|
export const withTranscript = (message, heard) => {
|
|
119
119
|
const transcript = heard.transcripts.get(voiceKey({ chatId: message.chatId, messageId: message.id }));
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.56.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.56.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/max-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"description": "MAX Messenger bots through the official Bot API, and a personal MAX account, from the terminal — built for agents and scripts",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"@modelcontextprotocol/server": "2.1.0",
|
|
101
101
|
"@msgpack/msgpack": "3.1.3",
|
|
102
102
|
"@valibot/to-json-schema": "1.8.0",
|
|
103
|
-
"@wirecat/cli-base": "0.
|
|
104
|
-
"@wirecat/cli-core": "0.
|
|
103
|
+
"@wirecat/cli-base": "0.40.0",
|
|
104
|
+
"@wirecat/cli-core": "0.296.0",
|
|
105
105
|
"commander": "15.0.0",
|
|
106
106
|
"lossless-json": "4.3.1",
|
|
107
107
|
"ogg-opus-decoder": "1.7.5",
|
package/skills/max-cli/SKILL.md
CHANGED
|
@@ -246,22 +246,23 @@ max personal review 'date>"2026-09-23T09:00:00Z"' --json # всё, свои т
|
|
|
246
246
|
max personal review 'chat:"-1000"' --unanswered 4h --json # вопросы в группе, на которые 4 часа не ответили ни владелец, ни админы
|
|
247
247
|
max personal tasks list state:open --json # что ждёт ответа владельца; задачи открывает и закрывает review
|
|
248
248
|
max personal tasks add <ссылка> --type request --category documents --json
|
|
249
|
-
# выход 2 task.duplicate-candidates: возможно, это та же задача; повторите с --into <задача> или --new
|
|
249
|
+
# выход 2 task.duplicate-candidates: возможно, это та же открытая задача; повторите с --into <задача> или --new. Похожая только на закрытую — новая задача со связью follow-up-of
|
|
250
250
|
max personal tasks duplicates --json # пары, которые могут быть одной задачей; tasks merge <дубль> --into <задача>
|
|
251
251
|
max personal tasks duplicates reject <дубль> <задача> # не одна задача; defer — решит владелец (decision:unsure); tasks unmerge <дубль> отменяет merge
|
|
252
252
|
max personal tasks related <задача> --json # похожие задачи с полосой likely|maybe|different; ничего не меняет
|
|
253
253
|
max personal tasks agenda category:money tag:urgent --json # план на сегодня; claimed:any — и занятые другими
|
|
254
254
|
max personal tasks claim <задача> --json # занять, пока работаешь (30m, --lease); tasks release <задача> — отдать
|
|
255
255
|
max personal tasks categories --json # категории; список один на хранилище (tg, max, memo), меняет его только владелец: max config set task_categories.<имя>
|
|
256
|
-
max personal tasks close <задача> --as dismissed --reason no-reply-needed --json # только когда владелец так
|
|
256
|
+
max personal tasks close <задача> --as dismissed --reason no-reply-needed --certainty 0.9 --json # только когда владелец так решил; --certainty 0..1 обязателен, ниже порога задача остаётся открытой с предложением закрыть
|
|
257
|
+
max personal tasks list close:suggested --json # предложения закрыть, которые ждут владельца: он подтверждает tasks close или отклоняет tasks reject
|
|
257
258
|
max personal watch --jsonl # новые сообщения по мере прихода; `max personal serve` запустится сам
|
|
258
259
|
max personal watch --events --jsonl # плюс правки, удаления, реакции, прочтения, изменения чатов; поле "event"
|
|
259
260
|
max personal server status --json # работает ли фоновый сервер, какой версии, подключён ли
|
|
260
261
|
max personal chats show -1000 --json # один чат и кто в нём
|
|
261
262
|
max personal chats events -1000 'time>=2026-09-20' --json # кто вступил, вышел, кого добавили и удалили
|
|
262
263
|
max personal chats members list -1000 --all --json # все участники от MAX: registered_at, last_seen_at
|
|
263
|
-
max personal chats requests list -1000 --json # заявки в канал с одобрением;
|
|
264
|
-
max personal chats requests accept -1000 20000002 # только по просьбе владельца; decline — отказать
|
|
264
|
+
max personal chats requests list -1000 --json # заявки в канал с одобрением; ни времени, ни порядка
|
|
265
|
+
max personal chats requests accept -1000 20000002 # по одному человеку и только по просьбе владельца; decline — отказать
|
|
265
266
|
max personal chats rules show -1000 --json # правила модерации группы; set <ключ> <значение> меняет одно
|
|
266
267
|
max personal chats moderate -1000 --dry-run --json # что нового нарушает правила; без --dry-run — только по слову владельца
|
|
267
268
|
max personal contacts show @ivan --json # один человек и общие чаты
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-policy.d.ts","sourceRoot":"","sources":["../../src/client/read-policy.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,YACnC,MAAM,WACP,CAAC,SACH,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,KACzC,CAsBF,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { isId } from "../resolve.js";
|
|
2
|
-
const aliases = {
|
|
3
|
-
"account.me": "account.show",
|
|
4
|
-
"account.sessions": "account.sessions.list",
|
|
5
|
-
"account.endOtherSessions": "account.sessions.end",
|
|
6
|
-
"chats.markRead": "chats.mark-read",
|
|
7
|
-
"chats.adminIds": "chats.admins.list",
|
|
8
|
-
"chats.since": "messages.list",
|
|
9
|
-
"messages.around": "messages.context",
|
|
10
|
-
"messages.react": "reactions.add",
|
|
11
|
-
"messages.unreact": "reactions.remove",
|
|
12
|
-
"contacts.sync": "contacts.list",
|
|
13
|
-
};
|
|
14
|
-
export const withReadPolicy = (resource, methods, reads) => {
|
|
15
|
-
if (!reads || ["login", "stickers", "live"].includes(resource))
|
|
16
|
-
return methods;
|
|
17
|
-
return Object.fromEntries(Object.entries(methods).map(([key, value]) => {
|
|
18
|
-
const path = `${resource}.${key}`;
|
|
19
|
-
return [
|
|
20
|
-
key,
|
|
21
|
-
typeof value === "object" && value !== null
|
|
22
|
-
? withReadPolicy(path, value, reads)
|
|
23
|
-
: typeof value === "function"
|
|
24
|
-
? (...args) => {
|
|
25
|
-
if (path !== "messages.moment" &&
|
|
26
|
-
!(path === "chats.resolve" && typeof args[0] === "string" && isId(args[0])))
|
|
27
|
-
reads(path === "messages.pin" && args[1] === null ? "messages.unpin" : (aliases[path] ?? path));
|
|
28
|
-
return Reflect.apply(value, methods, args);
|
|
29
|
-
}
|
|
30
|
-
: value,
|
|
31
|
-
];
|
|
32
|
-
}));
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=read-policy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"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AAC,CAAC,CAAC,CAAC;4BAE3E,KAAK,CAAC,IAAI,KAAK,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAA;wBACjG,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;oBAC5C,CAAC;oBACH,CAAC,CAAC,KAAK;SACZ,CAAA;IACH,CAAC,CAAC,CACE,CAAA;AACR,CAAC,CAAA"}
|
package/dist/commands/mcp.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
interface Flags {
|
|
3
|
-
yes?: boolean;
|
|
4
|
-
permission?: string[];
|
|
5
|
-
http?: boolean;
|
|
6
|
-
port?: string;
|
|
7
|
-
publicUrl?: string;
|
|
8
|
-
revoke?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare const mcpCommand: () => Command;
|
|
11
|
-
/**
|
|
12
|
-
* `node` and the script by full path, on every platform: a client started from the desktop does
|
|
13
|
-
* not see the PATH a terminal has, and on Windows `max` is a `.cmd` file that a client which starts
|
|
14
|
-
* programs without a shell cannot run. `MAX_TOKEN` is never copied — the server reads the keyring.
|
|
15
|
-
*/
|
|
16
|
-
export declare const serverEntry: ({ profile, flags, execPath, scriptPath, env, }: {
|
|
17
|
-
profile: string;
|
|
18
|
-
flags: Flags;
|
|
19
|
-
execPath: string;
|
|
20
|
-
scriptPath: string;
|
|
21
|
-
env: NodeJS.ProcessEnv;
|
|
22
|
-
}) => {
|
|
23
|
-
config: {
|
|
24
|
-
mcpServers: Record<string, object>;
|
|
25
|
-
};
|
|
26
|
-
warning?: string;
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,UAAU,KAAK;IACb,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAoCD,eAAO,MAAM,UAAU,QAAO,OAkI7B,CAAA;AAUD;;;;GAIG;AACH,eAAO,MAAM,WAAW,mDAMrB;IACD,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CACvB,KAAG;IAAE,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CA4BrE,CAAA"}
|
package/dist/commands/mcp.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { CliError } from "@wirecat/cli-base";
|
|
2
|
-
import { annotate } from "@wirecat/cli-base/commands";
|
|
3
|
-
import { installerOf } from "@wirecat/cli-base/update";
|
|
4
|
-
import { grantsAuthority, httpTokenFile, itemOf, LOCAL_READ, LOCAL_WRITE, REMOTE_WRITE, renderAnswer, revokeAll, snakeKeys, } from "@wirecat/cli-core/cli";
|
|
5
|
-
import { Command } from "commander";
|
|
6
|
-
import { MAX_APP } from "../app.js";
|
|
7
|
-
import { ownScript } from "../install.js";
|
|
8
|
-
import { forCommand } from "./context.js";
|
|
9
|
-
const DEFAULT_PORT = 8765;
|
|
10
|
-
const publicUrlOf = (given) => {
|
|
11
|
-
const example = "--public-url https://<name>.ts.net";
|
|
12
|
-
if (!given)
|
|
13
|
-
throw new CliError("configuration_error", `--http needs the tunnel's address: ${example}`);
|
|
14
|
-
let url;
|
|
15
|
-
try {
|
|
16
|
-
url = new URL(given);
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
throw new CliError("validation_error", `--public-url is not an address: ${example}`);
|
|
20
|
-
}
|
|
21
|
-
const local = url.protocol === "http:" && ["localhost", "127.0.0.1"].includes(url.hostname);
|
|
22
|
-
if (url.protocol !== "https:" && !local)
|
|
23
|
-
throw new CliError("validation_error", "--public-url must be https — the browser apps reach max through it");
|
|
24
|
-
if (url.pathname !== "/" || url.search || url.hash)
|
|
25
|
-
throw new CliError("validation_error", `--public-url is the tunnel's address only, without a path: ${example}`);
|
|
26
|
-
return url;
|
|
27
|
-
};
|
|
28
|
-
const portOf = (given) => {
|
|
29
|
-
if (given === undefined)
|
|
30
|
-
return DEFAULT_PORT;
|
|
31
|
-
const port = Number(given);
|
|
32
|
-
if (!Number.isInteger(port) || port < 1 || port > 65535)
|
|
33
|
-
throw new CliError("validation_error", "--port takes 1–65535");
|
|
34
|
-
return port;
|
|
35
|
-
};
|
|
36
|
-
const withFlags = (command) => command.option("--permission <key=level>", "override a permission for this server only; repeat for more keys", (value, previous = []) => [...previous, value]);
|
|
37
|
-
export const mcpCommand = () => {
|
|
38
|
-
const command = withFlags(annotate(new Command("mcp"), { effects: REMOTE_WRITE }).description("serve this profile to an agent over MCP, on stdin and stdout — `claude mcp add max -- max mcp`"))
|
|
39
|
-
.option("--http", "serve over HTTP on 127.0.0.1 for ChatGPT and Claude in the browser, behind your tunnel; the profile's permissions decide")
|
|
40
|
-
.option("--port <port>", `the local port for --http (default ${DEFAULT_PORT})`)
|
|
41
|
-
.option("--public-url <url>", "the tunnel's https address the browser apps use, e.g. https://<name>.ts.net")
|
|
42
|
-
.option("--revoke", "forget every login given to a browser app; each must log in again");
|
|
43
|
-
command.action(async function () {
|
|
44
|
-
const own = this.optsWithGlobals();
|
|
45
|
-
const context = forCommand(this);
|
|
46
|
-
const tokenFile = httpTokenFile(MAX_APP, context.settings.profile, process.env);
|
|
47
|
-
if (own.revoke) {
|
|
48
|
-
revokeAll(tokenFile);
|
|
49
|
-
renderAnswer(this, context, itemOf({ revoked: true, profile: context.settings.profile }));
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (own.http) {
|
|
53
|
-
const publicUrl = publicUrlOf(own.publicUrl);
|
|
54
|
-
const { serveOverHttpUntilStopped } = await import("../mcp/server.js");
|
|
55
|
-
await serveOverHttpUntilStopped(context, {}, { publicUrl, port: portOf(own.port), tokenFile });
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
// Loaded here, not at the top: every other command would otherwise pay for the SDK and zod.
|
|
59
|
-
const { serveOverStdio } = await import("../mcp/server.js");
|
|
60
|
-
await serveOverStdio(context, {});
|
|
61
|
-
});
|
|
62
|
-
command.addCommand(withFlags(annotate(new Command("config"), { effects: LOCAL_READ }).description("print the mcpServers entry for Claude Desktop, Cursor and others, with full paths; writes nothing")).action(async function () {
|
|
63
|
-
const { renderer, settings, format, streams, run } = forCommand(this);
|
|
64
|
-
const flags = this.optsWithGlobals();
|
|
65
|
-
await run("mcp config", async () => {
|
|
66
|
-
const entry = serverEntry({
|
|
67
|
-
profile: settings.profile,
|
|
68
|
-
flags,
|
|
69
|
-
execPath: process.execPath,
|
|
70
|
-
scriptPath: ownScript(),
|
|
71
|
-
env: process.env,
|
|
72
|
-
});
|
|
73
|
-
// Pasted into a file, so a person gets the same JSON a script does, only indented.
|
|
74
|
-
if (format === "pretty")
|
|
75
|
-
streams.data(JSON.stringify(entry.config, null, 2));
|
|
76
|
-
else
|
|
77
|
-
renderAnswer(this, { renderer, format, streams }, itemOf({ config: entry.config }));
|
|
78
|
-
if (entry.warning)
|
|
79
|
-
renderer.note(entry.warning);
|
|
80
|
-
});
|
|
81
|
-
}));
|
|
82
|
-
command.addCommand(withFlags(grantsAuthority(annotate(new Command("setup"), { effects: LOCAL_WRITE }))
|
|
83
|
-
.description("add this profile's local MCP server to Codex or Claude Code")
|
|
84
|
-
.argument("<client>", "codex or claude-code")
|
|
85
|
-
.option("--allow-writes", "acknowledge that this profile offers writing tools")).action(async function (client) {
|
|
86
|
-
if (client !== "codex" && client !== "claude-code")
|
|
87
|
-
throw new CliError("validation_error", "choose codex or claude-code");
|
|
88
|
-
const { renderer, settings, format, streams } = forCommand(this);
|
|
89
|
-
const entry = serverEntry({
|
|
90
|
-
profile: settings.profile,
|
|
91
|
-
flags: this.optsWithGlobals(),
|
|
92
|
-
execPath: process.execPath,
|
|
93
|
-
scriptPath: ownScript(),
|
|
94
|
-
env: process.env,
|
|
95
|
-
});
|
|
96
|
-
const [name, server] = Object.entries(entry.config.mcpServers)[0] ?? [];
|
|
97
|
-
if (!name || !server)
|
|
98
|
-
throw new CliError("validation_error", "the MCP entry is empty");
|
|
99
|
-
const { installStdioEntry, probeStdio } = await import("@wirecat/cli-base/mcp");
|
|
100
|
-
try {
|
|
101
|
-
const configuration = server;
|
|
102
|
-
const { potentialWrites } = await probeStdio(configuration);
|
|
103
|
-
if (potentialWrites.length > 0 && this.opts().allowWrites !== true)
|
|
104
|
-
throw new Error(`this profile offers ${potentialWrites.length} tools that may write; review its permissions, then pass --allow-writes to install it`);
|
|
105
|
-
renderAnswer(this, { renderer, format, streams }, itemOf(snakeKeys({ ...installStdioEntry(client, name, configuration), potentialWrites: potentialWrites.length })));
|
|
106
|
-
}
|
|
107
|
-
catch (error) {
|
|
108
|
-
throw new CliError("validation_error", error instanceof Error ? error.message : "MCP setup failed");
|
|
109
|
-
}
|
|
110
|
-
}));
|
|
111
|
-
command.addCommand(withFlags(annotate(new Command("doctor"), { effects: LOCAL_READ }).description("check this profile's local MCP handshake and tool list")).action(async function () {
|
|
112
|
-
const { renderer, settings, format, streams } = forCommand(this);
|
|
113
|
-
const entry = serverEntry({
|
|
114
|
-
profile: settings.profile,
|
|
115
|
-
flags: this.optsWithGlobals(),
|
|
116
|
-
execPath: process.execPath,
|
|
117
|
-
scriptPath: ownScript(),
|
|
118
|
-
env: process.env,
|
|
119
|
-
});
|
|
120
|
-
const server = Object.values(entry.config.mcpServers)[0];
|
|
121
|
-
if (!server)
|
|
122
|
-
throw new CliError("validation_error", "the MCP entry is empty");
|
|
123
|
-
const { probeStdio } = await import("@wirecat/cli-base/mcp");
|
|
124
|
-
try {
|
|
125
|
-
const { tools, potentialWrites } = await probeStdio(server);
|
|
126
|
-
renderAnswer(this, { renderer, format, streams }, itemOf({
|
|
127
|
-
healthy: true,
|
|
128
|
-
profile: settings.profile,
|
|
129
|
-
tools: tools.length,
|
|
130
|
-
potential_writes: potentialWrites.length,
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
throw new CliError("validation_error", error instanceof Error ? error.message : "MCP doctor failed");
|
|
135
|
-
}
|
|
136
|
-
}));
|
|
137
|
-
return command;
|
|
138
|
-
};
|
|
139
|
-
/**
|
|
140
|
-
* They choose the keyring entry and the store, so a server without them would answer "no session" or search
|
|
141
|
-
* another store. `XDG_RUNTIME_DIR` reaches the keyring, and a client that trims the environment drops it.
|
|
142
|
-
*/
|
|
143
|
-
const DIRECTORIES = ["MAX_CONFIG_DIR", "MAX_STATE_DIR", "MAX_CACHE_DIR", "MESSAGING_STORE", "XDG_RUNTIME_DIR"];
|
|
144
|
-
const VERSION_MANAGER = /[\\/](\.nvm|nvm|\.fnm|fnm|fnm_multishells|\.volta|volta|\.asdf|mise)[\\/]/i;
|
|
145
|
-
/**
|
|
146
|
-
* `node` and the script by full path, on every platform: a client started from the desktop does
|
|
147
|
-
* not see the PATH a terminal has, and on Windows `max` is a `.cmd` file that a client which starts
|
|
148
|
-
* programs without a shell cannot run. `MAX_TOKEN` is never copied — the server reads the keyring.
|
|
149
|
-
*/
|
|
150
|
-
export const serverEntry = ({ profile, flags, execPath, scriptPath, env, }) => {
|
|
151
|
-
if (installerOf(scriptPath) === "npx") {
|
|
152
|
-
throw new CliError("validation_error", "this max runs from npx's cache, which gets cleared, and the path would stop working — " +
|
|
153
|
-
"`npm install -g @wirecat/max-cli`, then run `max mcp config` again");
|
|
154
|
-
}
|
|
155
|
-
const args = [
|
|
156
|
-
scriptPath,
|
|
157
|
-
profile,
|
|
158
|
-
"mcp",
|
|
159
|
-
...(flags.permission ?? []).flatMap((entry) => ["--permission", entry]),
|
|
160
|
-
...(flags.yes === true ? ["--yes"] : []),
|
|
161
|
-
];
|
|
162
|
-
const directories = Object.fromEntries(DIRECTORIES.flatMap((name) => (env[name] ? [[name, env[name]]] : [])));
|
|
163
|
-
const server = {
|
|
164
|
-
type: "stdio",
|
|
165
|
-
command: execPath,
|
|
166
|
-
args,
|
|
167
|
-
...(Object.keys(directories).length > 0 ? { env: directories } : {}),
|
|
168
|
-
};
|
|
169
|
-
return {
|
|
170
|
-
config: { mcpServers: { [profile === "default" ? "max" : `max-${profile}`]: server } },
|
|
171
|
-
...(VERSION_MANAGER.test(execPath)
|
|
172
|
-
? { warning: `${execPath} belongs to one Node version — after switching or upgrading Node, run this again` }
|
|
173
|
-
: {}),
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
//# sourceMappingURL=mcp.js.map
|
package/dist/commands/mcp.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EACL,eAAe,EACf,aAAa,EACb,MAAM,EACN,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,SAAS,GACV,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,O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AAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE,CAAA;IACD,OAAO;QACL,MAAM,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE;QACtF,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC;YAChC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,QAAQ,kFAAkF,EAAE;YAC5G,CAAC,CAAC,EAAE,CAAC;KACR,CAAA;AACH,CAAC,CAAA"}
|
package/dist/domain/models.d.ts
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What this CLI promises. **Raw MAX objects never reach output** (REQUIREMENTS §16, §25): the wire
|
|
3
|
-
* shape is undocumented, changes without notice, and carries fields whose meaning nobody knows.
|
|
4
|
-
* Everything above the adapter speaks these types.
|
|
5
|
-
*/
|
|
6
|
-
import type { Button, Chat, Contact, Id, Member, Reactions, ChatCard as SharedChatCard } from "@wirecat/cli-core";
|
|
7
|
-
/**
|
|
8
|
-
* The shared model where MAX says the same thing; below, only what MAX says differently or alone.
|
|
9
|
-
* What MAX does with the shared ones, measured:
|
|
10
|
-
*
|
|
11
|
-
* - `Id` — MAX ids are 64-bit, so a string, never a number.
|
|
12
|
-
* - `AttachmentLink` — no token and no cookie needed to fetch it (2026-09-23).
|
|
13
|
-
* - `ChatEvent.event` — `new`, `add`, `remove`, `pin` seen; anything else passes through.
|
|
14
|
-
* - `Contact.lastMessagedAt` — MAX does not send it on a contact: it comes from the chat.
|
|
15
|
-
* - `AccountSession` — MAX gives a session no id, so none can be ended alone.
|
|
16
|
-
*/
|
|
17
|
-
export type { AccountSession, AttachmentLink, Audience, Button, ButtonKind, CallRecord, Chat, ChatEvent, ChatEvents, ChatKind, Contact, Deletion, Id, JoinRequest, MediaKind, Member, Page, PersonCard, Pin, PrivacySettings, Profile, ProfileFacts, Reactions, ReadMark, Sticker, StickerSet, } from "@wirecat/cli-core";
|
|
18
|
-
export interface Attachment {
|
|
19
|
-
/** Lower-cased MAX type: `photo`, `video`, `file`, `share`, `call`, `control`, `sticker`… */
|
|
20
|
-
kind: string;
|
|
21
|
-
/**
|
|
22
|
-
* A photo's image or a shared page. ⚠ Measured 2026-09-22: a photo link opens with no cookie and
|
|
23
|
-
* no token, so whoever holds it sees the picture.
|
|
24
|
-
*/
|
|
25
|
-
url?: string;
|
|
26
|
-
width?: number;
|
|
27
|
-
height?: number;
|
|
28
|
-
/** A shared page's title. */
|
|
29
|
-
title?: string;
|
|
30
|
-
/** A file's name and size, measured 2026-09-23. */
|
|
31
|
-
name?: string;
|
|
32
|
-
size?: number;
|
|
33
|
-
/** A file or a video carries no link, only these; `messages download` asks MAX for the link. */
|
|
34
|
-
fileId?: Id;
|
|
35
|
-
videoId?: Id;
|
|
36
|
-
/** A service message (`control`): what happened, as MAX names it — `new`, `add`, `remove`, `pin`… */
|
|
37
|
-
event?: string;
|
|
38
|
-
/** A service message: the people it happened to. Who did it is the message's sender. */
|
|
39
|
-
userIds?: Id[];
|
|
40
|
-
/** Absent on a `poll` newer than the version measured (`version` above 2). */
|
|
41
|
-
poll?: Poll;
|
|
42
|
-
/** A bot's keyboard, row by row (`inline_keyboard`). */
|
|
43
|
-
buttons?: Button[][];
|
|
44
|
-
}
|
|
45
|
-
/** A poll as the owner sees it. The settings bits are unpacked here and nowhere else. */
|
|
46
|
-
export interface Poll {
|
|
47
|
-
id: Id;
|
|
48
|
-
question: string;
|
|
49
|
-
answers: PollAnswer[];
|
|
50
|
-
/** How many people voted, not how many votes: one person may pick several answers. */
|
|
51
|
-
total: number;
|
|
52
|
-
multiple: boolean;
|
|
53
|
-
anonymous: boolean;
|
|
54
|
-
revote: boolean;
|
|
55
|
-
closed: boolean;
|
|
56
|
-
quiz: boolean;
|
|
57
|
-
}
|
|
58
|
-
export interface PollAnswer {
|
|
59
|
-
/** What `max polls vote` takes — MAX's own answer id, not a position in the list. */
|
|
60
|
-
id: Id;
|
|
61
|
-
text: string;
|
|
62
|
-
votes: number;
|
|
63
|
-
/** The owner voted for this one. */
|
|
64
|
-
mine: boolean;
|
|
65
|
-
}
|
|
66
|
-
/** A poll and the message that carries it — what `max polls` answers with. */
|
|
67
|
-
export interface PollMessage {
|
|
68
|
-
chatId: Id;
|
|
69
|
-
messageId: Id;
|
|
70
|
-
poll: Poll;
|
|
71
|
-
}
|
|
72
|
-
/** The message a reply answers or a forward carries — MAX sends it whole, inside the one that links to it. */
|
|
73
|
-
export interface QuotedMessage {
|
|
74
|
-
id: Id;
|
|
75
|
-
senderId: Id | null;
|
|
76
|
-
senderName: string | null;
|
|
77
|
-
/** ISO 8601, or `null` when the quote did not say. */
|
|
78
|
-
timestamp: string | null;
|
|
79
|
-
text: string;
|
|
80
|
-
attachments: Attachment[];
|
|
81
|
-
/** Whether this account wrote it. `null` when we do not know who we are. */
|
|
82
|
-
outgoing: boolean | null;
|
|
83
|
-
}
|
|
84
|
-
export interface Message {
|
|
85
|
-
id: Id;
|
|
86
|
-
chatId: Id;
|
|
87
|
-
senderId: Id | null;
|
|
88
|
-
senderName: string | null;
|
|
89
|
-
/** ISO 8601. */
|
|
90
|
-
timestamp: string;
|
|
91
|
-
/**
|
|
92
|
-
* When MAX last recorded an edit, or `null` for a message nobody has changed.
|
|
93
|
-
*
|
|
94
|
-
* Measured 2026-09-20: an edited message comes back carrying `status: "EDITED"` and an
|
|
95
|
-
* `updateTime` later than its `time`. Surfaced rather than hidden because a reader has no other
|
|
96
|
-
* way to tell an edited message from the original, and because it is what the cache compares to
|
|
97
|
-
* decide whether the copy it holds is still current.
|
|
98
|
-
*/
|
|
99
|
-
editedAt: string | null;
|
|
100
|
-
text: string;
|
|
101
|
-
/** Whether this account sent it. `null` when we do not know who we are. */
|
|
102
|
-
outgoing: boolean | null;
|
|
103
|
-
attachments: Attachment[];
|
|
104
|
-
replyTo: QuotedMessage | null;
|
|
105
|
-
forwardedFrom: QuotedMessage | null;
|
|
106
|
-
/**
|
|
107
|
-
* `null` when nobody asked — `--offline`, or the request failed. ~~History does not carry
|
|
108
|
-
* reactions~~ **Correction 2026-10-06:** a channel's history carries `reactionInfo` with counts (measured
|
|
109
|
-
* with `pnpm probe:channel-posts`); elsewhere it is `{}` and they come from a request of their own.
|
|
110
|
-
*/
|
|
111
|
-
reactions: Reactions | null;
|
|
112
|
-
/** ISO 8601 — when MAX will send it. Present only on a message still waiting in the queue. */
|
|
113
|
-
scheduledFor?: string;
|
|
114
|
-
/** A channel post's `stats.views`, where MAX sends it (measured 2026-10-05, `pnpm probe:channel-posts`). */
|
|
115
|
-
providerMetadata?: {
|
|
116
|
-
views?: number;
|
|
117
|
-
graph?: {
|
|
118
|
-
version: 1;
|
|
119
|
-
reply?: {
|
|
120
|
-
chatId: Id;
|
|
121
|
-
messageId: Id;
|
|
122
|
-
} | null;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* A message found by searching, carrying the chat's name as well as its id.
|
|
128
|
-
*
|
|
129
|
-
* A search spans every chat, so an answer that named only the id would make the reader look each
|
|
130
|
-
* one up to understand their own results. The title is what the store already holds; it is `null`
|
|
131
|
-
* for a chat MAX never titled.
|
|
132
|
-
*/
|
|
133
|
-
export interface MessageHit extends Message {
|
|
134
|
-
chatTitle: string | null;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* What happened to a message after it arrived, as `max watch --events` prints it (`MAX-34`). MAX
|
|
138
|
-
* pushes an edit and a deletion as the same message again with `status` `EDITED` or `REMOVED`, and
|
|
139
|
-
* a reaction as opcode 155 (tab recording 2026-09-25).
|
|
140
|
-
*/
|
|
141
|
-
export type MessageChange = {
|
|
142
|
-
event: "edit";
|
|
143
|
-
message: MessageHit;
|
|
144
|
-
} | {
|
|
145
|
-
event: "delete";
|
|
146
|
-
chatId: Id;
|
|
147
|
-
chatTitle: string | null;
|
|
148
|
-
messageId: Id;
|
|
149
|
-
} | {
|
|
150
|
-
event: "reaction";
|
|
151
|
-
chatId: Id;
|
|
152
|
-
chatTitle: string | null;
|
|
153
|
-
messageId: Id;
|
|
154
|
-
reactions: Reactions;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Somebody read a chat up to a message — the owner on another device too. MAX names the message by
|
|
158
|
-
* its time, not its id (opcode 130, measured 2026-10-08).
|
|
159
|
-
*/
|
|
160
|
-
| {
|
|
161
|
-
event: "read";
|
|
162
|
-
chatId: Id;
|
|
163
|
-
chatTitle: string | null;
|
|
164
|
-
userId: Id;
|
|
165
|
-
upToTime: string | null;
|
|
166
|
-
unreadCount: number | null;
|
|
167
|
-
}
|
|
168
|
-
/** A chat's title, members or the owner's membership changed; MAX sends the chat whole (135, or a 128 with it). */
|
|
169
|
-
| {
|
|
170
|
-
event: "chat";
|
|
171
|
-
chat: Chat;
|
|
172
|
-
};
|
|
173
|
-
/** A group's member as MAX lists them (`max chats members list`). */
|
|
174
|
-
export interface GroupMember extends Member {
|
|
175
|
-
/** ISO 8601, when the MAX account was created — a days-old account is worth a look. */
|
|
176
|
-
registeredAt: string | null;
|
|
177
|
-
/** ISO 8601, when MAX last saw them; `null` when their privacy hides it. */
|
|
178
|
-
lastSeenAt: string | null;
|
|
179
|
-
/** Absent where the login did not say who runs the group. */
|
|
180
|
-
role?: "owner" | "admin" | "member";
|
|
181
|
-
}
|
|
182
|
-
export interface GroupMembers {
|
|
183
|
-
chatId: Id;
|
|
184
|
-
members: GroupMember[];
|
|
185
|
-
/** Every page was read. */
|
|
186
|
-
complete: boolean;
|
|
187
|
-
/** Whether `role` is filled in: the login names a group's owner and admins only for chats that changed lately. */
|
|
188
|
-
rolesKnown: boolean;
|
|
189
|
-
}
|
|
190
|
-
/** The shared card, plus what MAX tells about a group. */
|
|
191
|
-
export interface ChatCard extends SharedChatCard {
|
|
192
|
-
description: string | null;
|
|
193
|
-
access: string | null;
|
|
194
|
-
/** `null` for a dialog, offline, or a group the login did not carry. */
|
|
195
|
-
settings: GroupSettings | null;
|
|
196
|
-
}
|
|
197
|
-
/** The settings MAX lets a group's owner change, under our names. */
|
|
198
|
-
export interface GroupSettings {
|
|
199
|
-
allCanPin: boolean | null;
|
|
200
|
-
onlyAdminsAdd: boolean | null;
|
|
201
|
-
onlyAdminsCall: boolean | null;
|
|
202
|
-
onlyOwnerEditsInfo: boolean | null;
|
|
203
|
-
membersSeeLink: boolean | null;
|
|
204
|
-
}
|
|
205
|
-
/** A group or channel as the group commands answer it. */
|
|
206
|
-
export interface GroupCard extends Chat {
|
|
207
|
-
description: string | null;
|
|
208
|
-
/** `public`, `private` or `secret`, as MAX says it. */
|
|
209
|
-
access: string | null;
|
|
210
|
-
/** The invite link. Only a member who may see it gets one. */
|
|
211
|
-
link: string | null;
|
|
212
|
-
settings: GroupSettings;
|
|
213
|
-
}
|
|
214
|
-
/** A chat folder. MAX's own filters and options are kept inside the client and sent back untouched. */
|
|
215
|
-
export interface Folder {
|
|
216
|
-
id: string;
|
|
217
|
-
title: string;
|
|
218
|
-
/** Chats added to it by hand. A folder that selects by filter lists none. */
|
|
219
|
-
chatIds: Id[];
|
|
220
|
-
}
|
|
221
|
-
export interface ContactImport {
|
|
222
|
-
/** How many numbers went to MAX. */
|
|
223
|
-
sent: number;
|
|
224
|
-
/** The numbers MAX answered for — measured once, on the owner's own number, which it recognised. */
|
|
225
|
-
recognised: string[];
|
|
226
|
-
contacts: Contact[];
|
|
227
|
-
}
|
|
228
|
-
/** One message of a window around another, which carries `anchor: true`. */
|
|
229
|
-
export type WindowedMessage = Message & {
|
|
230
|
-
anchor?: true;
|
|
231
|
-
};
|
|
232
|
-
/**
|
|
233
|
-
* When a message was sent, read from its id: **`id >> 16` is the send time in milliseconds**, the
|
|
234
|
-
* low 16 bits a counter. Measured 2026-09-22 on three messages across two days, exact every time.
|
|
235
|
-
* `undefined` for anything that is not a message id.
|
|
236
|
-
*/
|
|
237
|
-
export declare const timeOfMessageId: (id: Id) => number | undefined;
|
|
238
|
-
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/domain/models.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEjH;;;;;;;;;GASG;AACH,YAAY,EACV,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,EACN,UAAU,EACV,UAAU,EACV,IAAI,EACJ,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,EAAE,EACF,WAAW,EACX,SAAS,EACT,MAAM,EACN,IAAI,EACJ,UAAU,EACV,GAAG,EACH,eAAe,EACf,OAAO,EACP,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,UAAU,GACX,MAAM,mBAAmB,CAAA;AAE1B,MAAM,WAAW,UAAU;IACzB,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gGAAgG;IAChG,MAAM,CAAC,EAAE,EAAE,CAAA;IACX,OAAO,CAAC,EAAE,EAAE,CAAA;IACZ,qGAAqG;IACrG,KAAK,CAAC,EAAE,MA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;IAC9B,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAA;IAClC,cAAc,EAAE,OAAO,GAAG,IAAI,CAAA;CAC/B;AAED,0DAA0D;AAC1D,MAAM,WAAW,SAAU,SAAQ,IAAI;IACrC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,QAAQ,EAAE,aAAa,CAAA;CACxB;AAED,uGAAuG;AACvG,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,6EAA6E;IAC7E,OAAO,EAAE,EAAE,EAAE,CAAA;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,oGAAoG;IACpG,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,QAAQ,EAAE,OAAO,EAAE,CAAA;CACpB;AAED,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG;IAAE,MAAM,CAAC,EAAE,IAAI,CAAA;CAAE,CAAA;AAEzD;;;;GAIG;AACH,eAAO,MAAM,eAAe,OAAQ,EAAE,KAAG,MAAM,GAAG,SAIjD,CAAA"}
|
package/dist/domain/models.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What this CLI promises. **Raw MAX objects never reach output** (REQUIREMENTS §16, §25): the wire
|
|
3
|
-
* shape is undocumented, changes without notice, and carries fields whose meaning nobody knows.
|
|
4
|
-
* Everything above the adapter speaks these types.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* When a message was sent, read from its id: **`id >> 16` is the send time in milliseconds**, the
|
|
8
|
-
* low 16 bits a counter. Measured 2026-09-22 on three messages across two days, exact every time.
|
|
9
|
-
* `undefined` for anything that is not a message id.
|
|
10
|
-
*/
|
|
11
|
-
export const timeOfMessageId = (id) => {
|
|
12
|
-
if (!/^\d{10,20}$/.test(id))
|
|
13
|
-
return undefined;
|
|
14
|
-
const time = Number(BigInt(id) >> 16n);
|
|
15
|
-
return Number.isSafeInteger(time) && time > 0 ? time : undefined;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=models.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/domain/models.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwPH;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAM,EAAsB,EAAE;IAC5D,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,SAAS,CAAA;IAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAA;IACtC,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;AAClE,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/instructions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,gBAAiB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAAG,MAclD,CAAA"}
|