@wirecat/max-cli 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +530 -2
- package/dist/adapter/max-adapter.d.ts +17 -0
- package/dist/adapter/max-adapter.d.ts.map +1 -0
- package/dist/adapter/max-adapter.js +364 -0
- package/dist/adapter/max-adapter.js.map +1 -0
- package/dist/app.d.ts +3 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +9 -0
- package/dist/app.js.map +1 -0
- package/dist/bin/max.d.ts +3 -0
- package/dist/bin/max.d.ts.map +1 -0
- package/dist/bin/max.js +20 -0
- package/dist/bin/max.js.map +1 -0
- package/dist/bot/adapter.d.ts +25 -0
- package/dist/bot/adapter.d.ts.map +1 -0
- package/dist/bot/adapter.js +404 -0
- package/dist/bot/adapter.js.map +1 -0
- package/dist/bot/auth.d.ts +13 -0
- package/dist/bot/auth.d.ts.map +1 -0
- package/dist/bot/auth.js +9 -0
- package/dist/bot/auth.js.map +1 -0
- package/dist/bot/client.d.ts +26 -0
- package/dist/bot/client.d.ts.map +1 -0
- package/dist/bot/client.js +105 -0
- package/dist/bot/client.js.map +1 -0
- package/dist/bot/generated/manifest.d.ts +3 -0
- package/dist/bot/generated/manifest.d.ts.map +1 -0
- package/dist/bot/generated/manifest.js +1232 -0
- package/dist/bot/generated/manifest.js.map +1 -0
- package/dist/bot/generated/schemas.d.ts +271 -0
- package/dist/bot/generated/schemas.d.ts.map +1 -0
- package/dist/bot/generated/schemas.js +869 -0
- package/dist/bot/generated/schemas.js.map +1 -0
- package/dist/bot/generated/types.d.ts +1088 -0
- package/dist/bot/generated/types.d.ts.map +1 -0
- package/dist/bot/generated/types.js +5 -0
- package/dist/bot/generated/types.js.map +1 -0
- package/dist/bot/input.d.ts +6 -0
- package/dist/bot/input.d.ts.map +1 -0
- package/dist/bot/input.js +6 -0
- package/dist/bot/input.js.map +1 -0
- package/dist/bot/joins.d.ts +26 -0
- package/dist/bot/joins.d.ts.map +1 -0
- package/dist/bot/joins.js +56 -0
- package/dist/bot/joins.js.map +1 -0
- package/dist/bot/keep.d.ts +25 -0
- package/dist/bot/keep.d.ts.map +1 -0
- package/dist/bot/keep.js +98 -0
- package/dist/bot/keep.js.map +1 -0
- package/dist/bot/map.d.ts +14 -0
- package/dist/bot/map.d.ts.map +1 -0
- package/dist/bot/map.js +101 -0
- package/dist/bot/map.js.map +1 -0
- package/dist/bot/mcp-tools.d.ts +4 -0
- package/dist/bot/mcp-tools.d.ts.map +1 -0
- package/dist/bot/mcp-tools.js +78 -0
- package/dist/bot/mcp-tools.js.map +1 -0
- package/dist/bot/permissions.d.ts +14 -0
- package/dist/bot/permissions.d.ts.map +1 -0
- package/dist/bot/permissions.js +88 -0
- package/dist/bot/permissions.js.map +1 -0
- package/dist/bot/registry.d.ts +11 -0
- package/dist/bot/registry.d.ts.map +1 -0
- package/dist/bot/registry.js +13 -0
- package/dist/bot/registry.js.map +1 -0
- package/dist/bot/russian-trusted-root.d.ts +8 -0
- package/dist/bot/russian-trusted-root.d.ts.map +1 -0
- package/dist/bot/russian-trusted-root.js +41 -0
- package/dist/bot/russian-trusted-root.js.map +1 -0
- package/dist/bot/transport.d.ts +46 -0
- package/dist/bot/transport.d.ts.map +1 -0
- package/dist/bot/transport.js +252 -0
- package/dist/bot/transport.js.map +1 -0
- package/dist/bot/uploads.d.ts +42 -0
- package/dist/bot/uploads.d.ts.map +1 -0
- package/dist/bot/uploads.js +145 -0
- package/dist/bot/uploads.js.map +1 -0
- package/dist/client.d.ts +650 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +2836 -0
- package/dist/client.js.map +1 -0
- package/dist/commands/account.d.ts +3 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +4 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/bot-comments.d.ts +3 -0
- package/dist/commands/bot-comments.d.ts.map +1 -0
- package/dist/commands/bot-comments.js +74 -0
- package/dist/commands/bot-comments.js.map +1 -0
- package/dist/commands/bot-context.d.ts +38 -0
- package/dist/commands/bot-context.d.ts.map +1 -0
- package/dist/commands/bot-context.js +121 -0
- package/dist/commands/bot-context.js.map +1 -0
- package/dist/commands/bot-members.d.ts +14 -0
- package/dist/commands/bot-members.d.ts.map +1 -0
- package/dist/commands/bot-members.js +64 -0
- package/dist/commands/bot-members.js.map +1 -0
- package/dist/commands/bot-messenger.d.ts +10 -0
- package/dist/commands/bot-messenger.d.ts.map +1 -0
- package/dist/commands/bot-messenger.js +101 -0
- package/dist/commands/bot-messenger.js.map +1 -0
- package/dist/commands/bot-reads.d.ts +4 -0
- package/dist/commands/bot-reads.d.ts.map +1 -0
- package/dist/commands/bot-reads.js +13 -0
- package/dist/commands/bot-reads.js.map +1 -0
- package/dist/commands/bot-sends.d.ts +13 -0
- package/dist/commands/bot-sends.d.ts.map +1 -0
- package/dist/commands/bot-sends.js +103 -0
- package/dist/commands/bot-sends.js.map +1 -0
- package/dist/commands/bot-setup.d.ts +3 -0
- package/dist/commands/bot-setup.d.ts.map +1 -0
- package/dist/commands/bot-setup.js +20 -0
- package/dist/commands/bot-setup.js.map +1 -0
- package/dist/commands/bot.d.ts +3 -0
- package/dist/commands/bot.d.ts.map +1 -0
- package/dist/commands/bot.js +60 -0
- package/dist/commands/bot.js.map +1 -0
- package/dist/commands/calls.d.ts +3 -0
- package/dist/commands/calls.d.ts.map +1 -0
- package/dist/commands/calls.js +4 -0
- package/dist/commands/calls.js.map +1 -0
- package/dist/commands/chats.d.ts +3 -0
- package/dist/commands/chats.d.ts.map +1 -0
- package/dist/commands/chats.js +46 -0
- package/dist/commands/chats.js.map +1 -0
- package/dist/commands/commands.d.ts +2 -0
- package/dist/commands/commands.d.ts.map +1 -0
- package/dist/commands/commands.js +4 -0
- package/dist/commands/commands.js.map +1 -0
- package/dist/commands/complete.d.ts +2 -0
- package/dist/commands/complete.d.ts.map +1 -0
- package/dist/commands/complete.js +34 -0
- package/dist/commands/complete.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +170 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/contacts.d.ts +10 -0
- package/dist/commands/contacts.d.ts.map +1 -0
- package/dist/commands/contacts.js +80 -0
- package/dist/commands/contacts.js.map +1 -0
- package/dist/commands/context.d.ts +126 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +137 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/doctor.d.ts +24 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +308 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/mcp.d.ts +36 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +214 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/messages.d.ts +3 -0
- package/dist/commands/messages.d.ts.map +1 -0
- package/dist/commands/messages.js +105 -0
- package/dist/commands/messages.js.map +1 -0
- package/dist/commands/models.d.ts +3 -0
- package/dist/commands/models.d.ts.map +1 -0
- package/dist/commands/models.js +4 -0
- package/dist/commands/models.js.map +1 -0
- package/dist/commands/paging.d.ts +59 -0
- package/dist/commands/paging.d.ts.map +1 -0
- package/dist/commands/paging.js +77 -0
- package/dist/commands/paging.js.map +1 -0
- package/dist/commands/recipients.d.ts +9 -0
- package/dist/commands/recipients.d.ts.map +1 -0
- package/dist/commands/recipients.js +74 -0
- package/dist/commands/recipients.js.map +1 -0
- package/dist/commands/runs.d.ts +2 -0
- package/dist/commands/runs.d.ts.map +1 -0
- package/dist/commands/runs.js +4 -0
- package/dist/commands/runs.js.map +1 -0
- package/dist/commands/sends.d.ts +3 -0
- package/dist/commands/sends.d.ts.map +1 -0
- package/dist/commands/sends.js +4 -0
- package/dist/commands/sends.js.map +1 -0
- package/dist/commands/serve-members.d.ts +14 -0
- package/dist/commands/serve-members.d.ts.map +1 -0
- package/dist/commands/serve-members.js +54 -0
- package/dist/commands/serve-members.js.map +1 -0
- package/dist/commands/serve-stems.d.ts +9 -0
- package/dist/commands/serve-stems.d.ts.map +1 -0
- package/dist/commands/serve-stems.js +26 -0
- package/dist/commands/serve-stems.js.map +1 -0
- package/dist/commands/serve.d.ts +10 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +79 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/server.d.ts +16 -0
- package/dist/commands/server.d.ts.map +1 -0
- package/dist/commands/server.js +51 -0
- package/dist/commands/server.js.map +1 -0
- package/dist/commands/session.d.ts +15 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +169 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/setup.d.ts +3 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +168 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/skill.d.ts +3 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +7 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/stickers.d.ts +3 -0
- package/dist/commands/stickers.d.ts.map +1 -0
- package/dist/commands/stickers.js +4 -0
- package/dist/commands/stickers.js.map +1 -0
- package/dist/commands/upgrade.d.ts +2 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +14 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/watch.d.ts +27 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +105 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/config.d.ts +385 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +372 -0
- package/dist/config.js.map +1 -0
- package/dist/deadline.d.ts +2 -0
- package/dist/deadline.d.ts.map +1 -0
- package/dist/deadline.js +2 -0
- package/dist/deadline.js.map +1 -0
- package/dist/diagnose.d.ts +143 -0
- package/dist/diagnose.d.ts.map +1 -0
- package/dist/diagnose.js +183 -0
- package/dist/diagnose.js.map +1 -0
- package/dist/domain/map.d.ts +65 -0
- package/dist/domain/map.d.ts.map +1 -0
- package/dist/domain/map.js +431 -0
- package/dist/domain/map.js.map +1 -0
- package/dist/domain/models.d.ts +238 -0
- package/dist/domain/models.d.ts.map +1 -0
- package/dist/domain/models.js +17 -0
- package/dist/domain/models.js.map +1 -0
- package/dist/download.d.ts +38 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +199 -0
- package/dist/download.js.map +1 -0
- package/dist/format-markdown.d.ts +13 -0
- package/dist/format-markdown.d.ts.map +1 -0
- package/dist/format-markdown.js +241 -0
- package/dist/format-markdown.js.map +1 -0
- package/dist/generated/client.generated.d.ts +95 -0
- package/dist/generated/client.generated.d.ts.map +1 -0
- package/dist/generated/client.generated.js +91 -0
- package/dist/generated/client.generated.js.map +1 -0
- package/dist/generated/opcodes.generated.d.ts +76 -0
- package/dist/generated/opcodes.generated.d.ts.map +1 -0
- package/dist/generated/opcodes.generated.js +76 -0
- package/dist/generated/opcodes.generated.js.map +1 -0
- package/dist/generated/operations.generated.d.ts +502 -0
- package/dist/generated/operations.generated.d.ts.map +1 -0
- package/dist/generated/operations.generated.js +72 -0
- package/dist/generated/operations.generated.js.map +1 -0
- package/dist/inbox-point.d.ts +3 -0
- package/dist/inbox-point.d.ts.map +1 -0
- package/dist/inbox-point.js +17 -0
- package/dist/inbox-point.js.map +1 -0
- package/dist/install/postinstall.d.ts +8 -0
- package/dist/install/postinstall.d.ts.map +1 -0
- package/dist/install/postinstall.js +62 -0
- package/dist/install/postinstall.js.map +1 -0
- package/dist/install.d.ts +43 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +142 -0
- package/dist/install.js.map +1 -0
- package/dist/markdown.d.ts +13 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +6 -0
- package/dist/markdown.js.map +1 -0
- package/dist/mcp/instructions.d.ts +13 -0
- package/dist/mcp/instructions.d.ts.map +1 -0
- package/dist/mcp/instructions.js +16 -0
- package/dist/mcp/instructions.js.map +1 -0
- package/dist/mcp/legacy-check.d.ts +12 -0
- package/dist/mcp/legacy-check.d.ts.map +1 -0
- package/dist/mcp/legacy-check.js +44 -0
- package/dist/mcp/legacy-check.js.map +1 -0
- package/dist/mcp/photo.d.ts +9 -0
- package/dist/mcp/photo.d.ts.map +1 -0
- package/dist/mcp/photo.js +38 -0
- package/dist/mcp/photo.js.map +1 -0
- package/dist/mcp/prompts.d.ts +7 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +100 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/resources.d.ts +15 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +56 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +31 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +116 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/session.d.ts +30 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +109 -0
- package/dist/mcp/session.js.map +1 -0
- package/dist/mcp/shared.d.ts +14 -0
- package/dist/mcp/shared.d.ts.map +1 -0
- package/dist/mcp/shared.js +46 -0
- package/dist/mcp/shared.js.map +1 -0
- package/dist/mcp/tools.d.ts +30 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +248 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/messenger.d.ts +15 -0
- package/dist/messenger.d.ts.map +1 -0
- package/dist/messenger.js +149 -0
- package/dist/messenger.js.map +1 -0
- package/dist/moderation/check.d.ts +103 -0
- package/dist/moderation/check.d.ts.map +1 -0
- package/dist/moderation/check.js +273 -0
- package/dist/moderation/check.js.map +1 -0
- package/dist/moderation/points.d.ts +8 -0
- package/dist/moderation/points.d.ts.map +1 -0
- package/dist/moderation/points.js +21 -0
- package/dist/moderation/points.js.map +1 -0
- package/dist/moderation/rules.d.ts +7 -0
- package/dist/moderation/rules.d.ts.map +1 -0
- package/dist/moderation/rules.js +24 -0
- package/dist/moderation/rules.js.map +1 -0
- package/dist/online.d.ts +23 -0
- package/dist/online.d.ts.map +1 -0
- package/dist/online.js +87 -0
- package/dist/online.js.map +1 -0
- package/dist/output.d.ts +2 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +2 -0
- package/dist/output.js.map +1 -0
- package/dist/permissions.d.ts +20 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +76 -0
- package/dist/permissions.js.map +1 -0
- package/dist/profile.d.ts +33 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +60 -0
- package/dist/profile.js.map +1 -0
- package/dist/program.d.ts +10 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +172 -0
- package/dist/program.js.map +1 -0
- package/dist/protocol/connection.d.ts +83 -0
- package/dist/protocol/connection.d.ts.map +1 -0
- package/dist/protocol/connection.js +301 -0
- package/dist/protocol/connection.js.map +1 -0
- package/dist/protocol/frame.d.ts +55 -0
- package/dist/protocol/frame.d.ts.map +1 -0
- package/dist/protocol/frame.js +149 -0
- package/dist/protocol/frame.js.map +1 -0
- package/dist/protocol/lz4.d.ts +15 -0
- package/dist/protocol/lz4.d.ts.map +1 -0
- package/dist/protocol/lz4.js +157 -0
- package/dist/protocol/lz4.js.map +1 -0
- package/dist/record.d.ts +41 -0
- package/dist/record.d.ts.map +1 -0
- package/dist/record.js +104 -0
- package/dist/record.js.map +1 -0
- package/dist/rendering/messages.d.ts +24 -0
- package/dist/rendering/messages.d.ts.map +1 -0
- package/dist/rendering/messages.js +172 -0
- package/dist/rendering/messages.js.map +1 -0
- package/dist/report.d.ts +43 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +104 -0
- package/dist/report.js.map +1 -0
- package/dist/resolve.d.ts +6 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +5 -0
- package/dist/resolve.js.map +1 -0
- package/dist/sends.d.ts +17 -0
- package/dist/sends.d.ts.map +1 -0
- package/dist/sends.js +97 -0
- package/dist/sends.js.map +1 -0
- package/dist/server/lines.d.ts +23 -0
- package/dist/server/lines.d.ts.map +1 -0
- package/dist/server/lines.js +56 -0
- package/dist/server/lines.js.map +1 -0
- package/dist/server/replies.d.ts +31 -0
- package/dist/server/replies.d.ts.map +1 -0
- package/dist/server/replies.js +95 -0
- package/dist/server/replies.js.map +1 -0
- package/dist/server/server-connection.d.ts +55 -0
- package/dist/server/server-connection.d.ts.map +1 -0
- package/dist/server/server-connection.js +245 -0
- package/dist/server/server-connection.js.map +1 -0
- package/dist/server/server.d.ts +88 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/server/server.js +634 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/start.d.ts +37 -0
- package/dist/server/start.d.ts.map +1 -0
- package/dist/server/start.js +102 -0
- package/dist/server/start.js.map +1 -0
- package/dist/server/subscribe.d.ts +9 -0
- package/dist/server/subscribe.d.ts.map +1 -0
- package/dist/server/subscribe.js +26 -0
- package/dist/server/subscribe.js.map +1 -0
- package/dist/session/adopt.d.ts +22 -0
- package/dist/session/adopt.d.ts.map +1 -0
- package/dist/session/adopt.js +34 -0
- package/dist/session/adopt.js.map +1 -0
- package/dist/session/browser.d.ts +55 -0
- package/dist/session/browser.d.ts.map +1 -0
- package/dist/session/browser.js +321 -0
- package/dist/session/browser.js.map +1 -0
- package/dist/session/handshake.d.ts +57 -0
- package/dist/session/handshake.d.ts.map +1 -0
- package/dist/session/handshake.js +40 -0
- package/dist/session/handshake.js.map +1 -0
- package/dist/session/login.d.ts +20 -0
- package/dist/session/login.d.ts.map +1 -0
- package/dist/session/login.js +66 -0
- package/dist/session/login.js.map +1 -0
- package/dist/session/prompt.d.ts +2 -0
- package/dist/session/prompt.d.ts.map +1 -0
- package/dist/session/prompt.js +2 -0
- package/dist/session/prompt.js.map +1 -0
- package/dist/session/qr-terminal.d.ts +9 -0
- package/dist/session/qr-terminal.d.ts.map +1 -0
- package/dist/session/qr-terminal.js +34 -0
- package/dist/session/qr-terminal.js.map +1 -0
- package/dist/session/store.d.ts +76 -0
- package/dist/session/store.d.ts.map +1 -0
- package/dist/session/store.js +134 -0
- package/dist/session/store.js.map +1 -0
- package/dist/skill.d.ts +7 -0
- package/dist/skill.d.ts.map +1 -0
- package/dist/skill.js +8 -0
- package/dist/skill.js.map +1 -0
- package/dist/spec/check.d.ts +16 -0
- package/dist/spec/check.d.ts.map +1 -0
- package/dist/spec/check.js +44 -0
- package/dist/spec/check.js.map +1 -0
- package/dist/spec/define.d.ts +108 -0
- package/dist/spec/define.d.ts.map +1 -0
- package/dist/spec/define.js +47 -0
- package/dist/spec/define.js.map +1 -0
- package/dist/spec/guards.d.ts +16 -0
- package/dist/spec/guards.d.ts.map +1 -0
- package/dist/spec/guards.js +30 -0
- package/dist/spec/guards.js.map +1 -0
- package/dist/spec/identity.d.ts +57 -0
- package/dist/spec/identity.d.ts.map +1 -0
- package/dist/spec/identity.js +53 -0
- package/dist/spec/identity.js.map +1 -0
- package/dist/spec/index.d.ts +15 -0
- package/dist/spec/index.d.ts.map +1 -0
- package/dist/spec/index.js +84 -0
- package/dist/spec/index.js.map +1 -0
- package/dist/spec/operations/account.d.ts +39 -0
- package/dist/spec/operations/account.d.ts.map +1 -0
- package/dist/spec/operations/account.js +103 -0
- package/dist/spec/operations/account.js.map +1 -0
- package/dist/spec/operations/assets.d.ts +17 -0
- package/dist/spec/operations/assets.d.ts.map +1 -0
- package/dist/spec/operations/assets.js +43 -0
- package/dist/spec/operations/assets.js.map +1 -0
- package/dist/spec/operations/attachments.d.ts +15 -0
- package/dist/spec/operations/attachments.d.ts.map +1 -0
- package/dist/spec/operations/attachments.js +40 -0
- package/dist/spec/operations/attachments.js.map +1 -0
- package/dist/spec/operations/banners.d.ts +7 -0
- package/dist/spec/operations/banners.d.ts.map +1 -0
- package/dist/spec/operations/banners.js +16 -0
- package/dist/spec/operations/banners.js.map +1 -0
- package/dist/spec/operations/calls.d.ts +8 -0
- package/dist/spec/operations/calls.d.ts.map +1 -0
- package/dist/spec/operations/calls.js +25 -0
- package/dist/spec/operations/calls.js.map +1 -0
- package/dist/spec/operations/chats.d.ts +115 -0
- package/dist/spec/operations/chats.d.ts.map +1 -0
- package/dist/spec/operations/chats.js +331 -0
- package/dist/spec/operations/chats.js.map +1 -0
- package/dist/spec/operations/contacts.d.ts +39 -0
- package/dist/spec/operations/contacts.d.ts.map +1 -0
- package/dist/spec/operations/contacts.js +135 -0
- package/dist/spec/operations/contacts.js.map +1 -0
- package/dist/spec/operations/folders.d.ts +31 -0
- package/dist/spec/operations/folders.d.ts.map +1 -0
- package/dist/spec/operations/folders.js +94 -0
- package/dist/spec/operations/folders.js.map +1 -0
- package/dist/spec/operations/login.d.ts +64 -0
- package/dist/spec/operations/login.d.ts.map +1 -0
- package/dist/spec/operations/login.js +105 -0
- package/dist/spec/operations/login.js.map +1 -0
- package/dist/spec/operations/messages.d.ts +142 -0
- package/dist/spec/operations/messages.d.ts.map +1 -0
- package/dist/spec/operations/messages.js +347 -0
- package/dist/spec/operations/messages.js.map +1 -0
- package/dist/spec/operations/session.d.ts +120 -0
- package/dist/spec/operations/session.d.ts.map +1 -0
- package/dist/spec/operations/session.js +202 -0
- package/dist/spec/operations/session.js.map +1 -0
- package/dist/spec/operations/uploads.d.ts +31 -0
- package/dist/spec/operations/uploads.d.ts.map +1 -0
- package/dist/spec/operations/uploads.js +59 -0
- package/dist/spec/operations/uploads.js.map +1 -0
- package/dist/spec/scalars.d.ts +17 -0
- package/dist/spec/scalars.d.ts.map +1 -0
- package/dist/spec/scalars.js +33 -0
- package/dist/spec/scalars.js.map +1 -0
- package/dist/transcribe/index.d.ts +70 -0
- package/dist/transcribe/index.d.ts.map +1 -0
- package/dist/transcribe/index.js +127 -0
- package/dist/transcribe/index.js.map +1 -0
- package/dist/transcribe/install.d.ts +2 -0
- package/dist/transcribe/install.d.ts.map +1 -0
- package/dist/transcribe/install.js +2 -0
- package/dist/transcribe/install.js.map +1 -0
- package/dist/transcribe/models.d.ts +5 -0
- package/dist/transcribe/models.d.ts.map +1 -0
- package/dist/transcribe/models.js +6 -0
- package/dist/transcribe/models.js.map +1 -0
- package/dist/transcribe/speech.d.ts +25 -0
- package/dist/transcribe/speech.d.ts.map +1 -0
- package/dist/transcribe/speech.js +107 -0
- package/dist/transcribe/speech.js.map +1 -0
- package/dist/update.d.ts +31 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +69 -0
- package/dist/update.js.map +1 -0
- package/dist/upload.d.ts +15 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +97 -0
- package/dist/upload.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/voice.d.ts +9 -0
- package/dist/voice.d.ts.map +1 -0
- package/dist/voice.js +36 -0
- package/dist/voice.js.map +1 -0
- package/dist/wire-events.d.ts +23 -0
- package/dist/wire-events.d.ts.map +1 -0
- package/dist/wire-events.js +47 -0
- package/dist/wire-events.js.map +1 -0
- package/install/postinstall.mjs +3 -0
- package/install/windows.ps1 +160 -0
- package/package.json +125 -4
- package/skills/max-cli/SKILL.md +518 -0
|
@@ -0,0 +1,238 @@
|
|
|
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-messaging";
|
|
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-messaging";
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,wBAAwB,CAAA;AAEtH;;;;;;;;;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,wBAAwB,CAAA;AAE/B,MAAM,WAAW,UAAU;IACzB,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;I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ENTS §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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AttachmentLink } from "./domain/models.js";
|
|
2
|
+
export interface Saved {
|
|
3
|
+
kind: string;
|
|
4
|
+
path: string;
|
|
5
|
+
bytes: number;
|
|
6
|
+
}
|
|
7
|
+
/** Where a download may go; throws for a link it must not follow. */
|
|
8
|
+
export type Reach = (url: URL) => Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* **Out to the internet only, over https** (`NEED-278`). A link comes from MAX, and one pointing at
|
|
11
|
+
* this machine or its network would make `max` a way to read what only this machine can reach.
|
|
12
|
+
* Checked again after every redirect.
|
|
13
|
+
*/
|
|
14
|
+
export declare const publicOnly: Reach;
|
|
15
|
+
/** A voice message is read into memory whole; minutes of Opus are a few megabytes. */
|
|
16
|
+
export declare const LARGEST_VOICE: number;
|
|
17
|
+
/** No byte for this long and the download is given up — however large the file, it is moving or not. */
|
|
18
|
+
export declare const STALL_MS = 60000;
|
|
19
|
+
export interface Watchdog {
|
|
20
|
+
readonly signal: AbortSignal;
|
|
21
|
+
poke(): void;
|
|
22
|
+
stop(): void;
|
|
23
|
+
}
|
|
24
|
+
/** An abort signal that fires when `poke` has not been called for `ms`. */
|
|
25
|
+
export declare const watchdog: (ms: number) => Watchdog;
|
|
26
|
+
/** General attachments stream with a file budget; voice transcription keeps its smaller memory budget. */
|
|
27
|
+
export declare const streamBytes: (attachment: AttachmentLink, reach?: Reach, limit?: number, onMime?: (mime: string | undefined) => void, signal?: AbortSignal) => AsyncGenerator<Uint8Array>;
|
|
28
|
+
/** Into memory rather than a file: a voice message is a few hundred kilobytes, and transcription reads it once. */
|
|
29
|
+
export declare const fetchBytes: (attachment: AttachmentLink, reach?: Reach, limit?: number) => Promise<Uint8Array>;
|
|
30
|
+
/**
|
|
31
|
+
* Downloads one attachment into `directory` and **never replaces a file that is there**.
|
|
32
|
+
*
|
|
33
|
+
* The bytes go to a temporary name first and are then hard-linked to the real one, which fails if
|
|
34
|
+
* the name is taken — so an existing file survives, and an interrupted download leaves no half
|
|
35
|
+
* file under the name somebody will open.
|
|
36
|
+
*/
|
|
37
|
+
export declare const save: (attachment: AttachmentLink, directory: string, fallbackName: string, reach?: Reach) => Promise<Saved>;
|
|
38
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGxD,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AA2BD,qEAAqE;AACrE,MAAM,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAE/C;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,KAaxB,CAAA;AA0BD,sFAAsF;AACtF,eAAO,MAAM,aAAa,QAAmB,CAAA;AAE7C,wGAAwG;AACxG,eAAO,MAAM,QAAQ,QAAS,CAAA;AAE9B,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,IAAI,IAAI,IAAI,CAAA;IACZ,IAAI,IAAI,IAAI,CAAA;CACb;AAED,2EAA2E;AAC3E,eAAO,MAAM,QAAQ,OAAQ,MAAM,KAAG,QAWrC,CAAA;AAsED,0GAA0G;AAC1G,eAAO,MAAM,WAAW,eACV,cAAc,UACnB,KAAK,2BAEH,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,WAClC,WAAW,KACnB,cAAc,CAAC,UAAU,CAiB3B,CAAA;AAED,mHAAmH;AACnH,eAAO,MAAM,UAAU,eACT,cAAc,UACnB,KAAK,qBAEX,OAAO,CAAC,UAAU,CAYpB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,eACH,cAAc,aACf,MAAM,gBACH,MAAM,UACb,KAAK,KACX,OAAO,CAAC,KAAK,CAoBf,CAAA"}
|
package/dist/download.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { lookup } from "node:dns/promises";
|
|
2
|
+
import { createWriteStream } from "node:fs";
|
|
3
|
+
import { link, rm } from "node:fs/promises";
|
|
4
|
+
import { BlockList, isIP } from "node:net";
|
|
5
|
+
import { basename, join } from "node:path";
|
|
6
|
+
import { PassThrough, Readable, Transform, Writable } from "node:stream";
|
|
7
|
+
import { pipeline } from "node:stream/promises";
|
|
8
|
+
import { CliError } from "@wirecat/cli-core";
|
|
9
|
+
import { WEB_USER_AGENT } from "./spec/identity.js";
|
|
10
|
+
const EXTENSIONS = {
|
|
11
|
+
"image/jpeg": "jpg",
|
|
12
|
+
"image/png": "png",
|
|
13
|
+
"image/webp": "webp",
|
|
14
|
+
"image/gif": "gif",
|
|
15
|
+
"video/mp4": "mp4",
|
|
16
|
+
"audio/mpeg": "mp3",
|
|
17
|
+
"audio/ogg": "ogg",
|
|
18
|
+
"audio/mp4": "m4a",
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A name MAX gave cannot climb out of the directory, cannot be a dot file we would then hide, and
|
|
22
|
+
* carries no control or direction character to rewrite the terminal or disguise its extension.
|
|
23
|
+
*/
|
|
24
|
+
const safeName = (name) => {
|
|
25
|
+
const plain = name === undefined
|
|
26
|
+
? ""
|
|
27
|
+
: basename(name.replaceAll("\\", "/"))
|
|
28
|
+
.replace(/[\p{Cc}\u200b-\u200f\u202a-\u202e\u2066-\u2069]/gu, "")
|
|
29
|
+
.replace(/^\.+/, "");
|
|
30
|
+
return plain === "" ? undefined : plain;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* **Out to the internet only, over https** (`NEED-278`). A link comes from MAX, and one pointing at
|
|
34
|
+
* this machine or its network would make `max` a way to read what only this machine can reach.
|
|
35
|
+
* Checked again after every redirect.
|
|
36
|
+
*/
|
|
37
|
+
export const publicOnly = async (url) => {
|
|
38
|
+
if (url.protocol !== "https:") {
|
|
39
|
+
throw new CliError("validation_error", `a ${url.protocol} link is not downloaded — only https`);
|
|
40
|
+
}
|
|
41
|
+
const host = url.hostname.replace(/^\[|\]$/g, "");
|
|
42
|
+
const family = isIP(host);
|
|
43
|
+
const addresses = family ? [{ address: host, family }] : await lookup(host, { all: true, verbatim: true });
|
|
44
|
+
if (addresses.some(({ address, family }) => PRIVATE.check(address, family === 6 ? "ipv6" : "ipv4"))) {
|
|
45
|
+
throw new CliError("validation_error", `the link points into this machine or its network (${url.hostname}) — not downloaded`);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const PRIVATE = new BlockList();
|
|
49
|
+
for (const [network, prefix] of [
|
|
50
|
+
["0.0.0.0", 8],
|
|
51
|
+
["10.0.0.0", 8],
|
|
52
|
+
["100.64.0.0", 10],
|
|
53
|
+
["127.0.0.0", 8],
|
|
54
|
+
["169.254.0.0", 16],
|
|
55
|
+
["172.16.0.0", 12],
|
|
56
|
+
["192.168.0.0", 16],
|
|
57
|
+
["224.0.0.0", 3],
|
|
58
|
+
])
|
|
59
|
+
PRIVATE.addSubnet(network, prefix, "ipv4");
|
|
60
|
+
// `::ffff:127.0.0.1` is matched against the IPv4 rules by BlockList itself, under Node and Bun alike.
|
|
61
|
+
for (const [network, prefix] of [
|
|
62
|
+
["::", 127],
|
|
63
|
+
["fc00::", 7],
|
|
64
|
+
["fe80::", 10],
|
|
65
|
+
["ff00::", 8],
|
|
66
|
+
])
|
|
67
|
+
PRIVATE.addSubnet(network, prefix, "ipv6");
|
|
68
|
+
/** MAX takes attachments up to 4 GB (help.max.ru, "Как отправить в чат фото и другие файлы"). */
|
|
69
|
+
const LARGEST_ATTACHMENT = 4 * 1024 ** 3;
|
|
70
|
+
/** A voice message is read into memory whole; minutes of Opus are a few megabytes. */
|
|
71
|
+
export const LARGEST_VOICE = 32 * 1024 * 1024;
|
|
72
|
+
/** No byte for this long and the download is given up — however large the file, it is moving or not. */
|
|
73
|
+
export const STALL_MS = 60_000;
|
|
74
|
+
/** An abort signal that fires when `poke` has not been called for `ms`. */
|
|
75
|
+
export const watchdog = (ms) => {
|
|
76
|
+
const controller = new AbortController();
|
|
77
|
+
let timer = setTimeout(() => controller.abort(), ms);
|
|
78
|
+
return {
|
|
79
|
+
signal: controller.signal,
|
|
80
|
+
poke: () => {
|
|
81
|
+
clearTimeout(timer);
|
|
82
|
+
timer = setTimeout(() => controller.abort(), ms);
|
|
83
|
+
},
|
|
84
|
+
stop: () => clearTimeout(timer),
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const REDIRECTS = 5;
|
|
88
|
+
const HEADERS = { "User-Agent": WEB_USER_AGENT.headerUserAgent, Referer: "https://web.max.ru/" };
|
|
89
|
+
/** The body of the link, at most `limit` bytes, with redirects followed by hand so each is checked. */
|
|
90
|
+
const open = async (attachment, reach, limit, parentSignal) => {
|
|
91
|
+
const stalled = watchdog(STALL_MS);
|
|
92
|
+
const signal = parentSignal ? AbortSignal.any([stalled.signal, parentSignal]) : stalled.signal;
|
|
93
|
+
const failed = (error) => {
|
|
94
|
+
stalled.stop();
|
|
95
|
+
if (stalled.signal.aborted) {
|
|
96
|
+
throw new CliError("timeout", `the ${attachment.kind} download stopped moving for ${STALL_MS / 1000} s`);
|
|
97
|
+
}
|
|
98
|
+
throw error;
|
|
99
|
+
};
|
|
100
|
+
let target = new URL(attachment.url);
|
|
101
|
+
for (let hop = 0;; hop += 1) {
|
|
102
|
+
const response = await reach(target)
|
|
103
|
+
.then(() => fetch(target, { headers: HEADERS, redirect: "manual", signal }))
|
|
104
|
+
.catch(failed);
|
|
105
|
+
const location = response.headers.get("location");
|
|
106
|
+
if (response.status >= 300 && response.status < 400 && location) {
|
|
107
|
+
await response.body?.cancel();
|
|
108
|
+
if (hop >= REDIRECTS)
|
|
109
|
+
failed(new CliError("network_error", `the ${attachment.kind} link redirects too many times`));
|
|
110
|
+
target = new URL(location, target);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (!response.ok || !response.body) {
|
|
114
|
+
await response.body?.cancel();
|
|
115
|
+
failed(new CliError("network_error", `the ${attachment.kind} could not be downloaded: HTTP ${response.status}`));
|
|
116
|
+
}
|
|
117
|
+
const declared = Number(response.headers.get("content-length") ?? Number.NaN);
|
|
118
|
+
if (declared > limit) {
|
|
119
|
+
await response.body?.cancel();
|
|
120
|
+
failed(tooLarge(attachment, limit));
|
|
121
|
+
}
|
|
122
|
+
let bytes = 0;
|
|
123
|
+
const counting = new Transform({
|
|
124
|
+
transform(chunk, _encoding, done) {
|
|
125
|
+
stalled.poke();
|
|
126
|
+
bytes += chunk.length;
|
|
127
|
+
done(bytes > limit ? tooLarge(attachment, limit) : null, chunk);
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
const source = Readable.fromWeb(response.body);
|
|
131
|
+
const pump = (destination) => pipeline(source, counting, destination).then(() => {
|
|
132
|
+
stalled.stop();
|
|
133
|
+
return bytes;
|
|
134
|
+
}, failed);
|
|
135
|
+
return { response, pump };
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const tooLarge = (attachment, limit) => new CliError("validation_error", `the ${attachment.kind} is larger than ${limit >= 1024 ** 2 ? `${Math.round(limit / 1024 ** 2)} MiB` : `${Math.round(limit / 1024)} KiB`} — not downloaded`);
|
|
139
|
+
/** General attachments stream with a file budget; voice transcription keeps its smaller memory budget. */
|
|
140
|
+
export const streamBytes = async function* (attachment, reach = publicOnly, limit = LARGEST_ATTACHMENT, onMime, signal) {
|
|
141
|
+
const { pump, response } = await open(attachment, reach, limit, signal);
|
|
142
|
+
const body = new PassThrough();
|
|
143
|
+
const finished = pump(body).catch((error) => {
|
|
144
|
+
body.destroy(error instanceof Error ? error : new Error("attachment download failed"));
|
|
145
|
+
throw error;
|
|
146
|
+
});
|
|
147
|
+
// The stream reports failures to its reader; observe the pump immediately as well.
|
|
148
|
+
void finished.catch(() => { });
|
|
149
|
+
try {
|
|
150
|
+
onMime?.(response.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase());
|
|
151
|
+
for await (const chunk of body)
|
|
152
|
+
yield chunk;
|
|
153
|
+
await finished;
|
|
154
|
+
}
|
|
155
|
+
finally {
|
|
156
|
+
body.destroy();
|
|
157
|
+
await finished.catch(() => { });
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
/** Into memory rather than a file: a voice message is a few hundred kilobytes, and transcription reads it once. */
|
|
161
|
+
export const fetchBytes = async (attachment, reach = publicOnly, limit = LARGEST_VOICE) => {
|
|
162
|
+
const { pump } = await open(attachment, reach, limit);
|
|
163
|
+
const chunks = [];
|
|
164
|
+
await pump(new Writable({
|
|
165
|
+
write(chunk, _encoding, done) {
|
|
166
|
+
chunks.push(chunk);
|
|
167
|
+
done();
|
|
168
|
+
},
|
|
169
|
+
}));
|
|
170
|
+
return new Uint8Array(Buffer.concat(chunks));
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Downloads one attachment into `directory` and **never replaces a file that is there**.
|
|
174
|
+
*
|
|
175
|
+
* The bytes go to a temporary name first and are then hard-linked to the real one, which fails if
|
|
176
|
+
* the name is taken — so an existing file survives, and an interrupted download leaves no half
|
|
177
|
+
* file under the name somebody will open.
|
|
178
|
+
*/
|
|
179
|
+
export const save = async (attachment, directory, fallbackName, reach = publicOnly) => {
|
|
180
|
+
const { response, pump } = await open(attachment, reach, LARGEST_ATTACHMENT);
|
|
181
|
+
const extension = EXTENSIONS[response.headers.get("content-type")?.split(";")[0]?.trim() ?? ""];
|
|
182
|
+
const name = safeName(attachment.name) ?? (extension ? `${fallbackName}.${extension}` : fallbackName);
|
|
183
|
+
const path = join(directory, name);
|
|
184
|
+
const partial = join(directory, `.${name}.${process.pid}.part`);
|
|
185
|
+
try {
|
|
186
|
+
const bytes = await pump(createWriteStream(partial, { flags: "wx", mode: 0o600 }));
|
|
187
|
+
await link(partial, path).catch((error) => {
|
|
188
|
+
if (error.code === "EEXIST") {
|
|
189
|
+
throw new CliError("validation_error", `${path} already exists — nothing was overwritten; choose --output`);
|
|
190
|
+
}
|
|
191
|
+
throw error;
|
|
192
|
+
});
|
|
193
|
+
return { kind: attachment.kind, path, bytes };
|
|
194
|
+
}
|
|
195
|
+
finally {
|
|
196
|
+
await rm(partial, { force: true });
|
|
197
|
+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gBAC5B,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,GAAG,IAAI,4DAA4D,CAAC,CAAA;YAC7G,CAAC;YACD,MAAM,KAAK,CAAA;QACb,CAAC,CAAC,CAAA;QACF,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;IAC/C,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACpC,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FormattedText, type TextSpan } from "@wirecat/cli-messaging";
|
|
2
|
+
export declare const formatMarkdown: (input: string) => FormattedText;
|
|
3
|
+
/** Personal elements: legacy types measured locally; UNDERLINE/LINK documented in external traffic observations. */
|
|
4
|
+
export declare const toNativeMarkup: (span: TextSpan) => {
|
|
5
|
+
type: string;
|
|
6
|
+
from: number;
|
|
7
|
+
length: number;
|
|
8
|
+
attributes?: {
|
|
9
|
+
url: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const toHtml: (text: string, spans: readonly TextSpan[]) => string;
|
|
13
|
+
//# sourceMappingURL=format-markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-markdown.d.ts","sourceRoot":"","sources":["../src/format-markdown.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAyB,MAAM,wBAAwB,CAAA;AAmJjG,eAAO,MAAM,cAAc,UAAW,MAAM,KAAG,aAY9C,CAAA;AAED,oHAAoH;AACpH,eAAO,MAAM,cAAc,SACnB,QAAQ,KACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAoB5E,CAAA;AAKD,eAAO,MAAM,MAAM,SAAU,MAAM,SAAS,SAAS,QAAQ,EAAE,KAAG,MA2DjE,CAAA"}
|