zaileys 4.15.1 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/dist/builder/builder.d.ts +3 -8
- package/dist/builder/content/airich.d.ts +1 -2
- package/dist/builder/content/buttons.d.ts +0 -2
- package/dist/builder/content/html-app.d.ts +16 -24
- package/dist/builder/html.d.ts +14 -0
- package/dist/builder/index.d.ts +2 -2
- package/dist/index.cjs +16 -16
- package/dist/index.mjs +16 -16
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -118,20 +118,22 @@ Pick your provider → **[Choose Your Provider](https://zaileys.kejaa.id/provide
|
|
|
118
118
|
|
|
119
119
|
## Build with AI
|
|
120
120
|
|
|
121
|
-
Zaileys ships an **official Agent Skill
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
Zaileys ships an **official Agent Skill**, `zaileys`, so your AI assistant builds, extends, debugs, reviews,
|
|
122
|
+
upgrades, and deploys zaileys bots with the real API instead of guessing. It covers both providers, includes
|
|
123
|
+
runnable templates and a read-only project doctor, and is checked against the source on every change.
|
|
124
|
+
Install it straight from this repo:
|
|
124
125
|
|
|
125
126
|
```bash
|
|
126
|
-
# Claude Code
|
|
127
|
+
# Claude Code plugin
|
|
127
128
|
/plugin marketplace add zeative/zaileys
|
|
128
129
|
/plugin install zaileys-official@zeative
|
|
129
130
|
|
|
130
|
-
# npx skills (
|
|
131
|
+
# npx skills (Claude Code, Codex, Cursor, OpenCode, and more)
|
|
131
132
|
npx skills add zeative/zaileys # add -g for a global install
|
|
132
133
|
```
|
|
133
134
|
|
|
134
|
-
|
|
135
|
+
Upgrading from the four earlier skills (`zaileys-assist`, `-scaffold`, `-debug`, `-review`)? See
|
|
136
|
+
**[zaileys.kejaa.id/ai](https://zaileys.kejaa.id/ai#upgrade-from-the-four-skills)**.
|
|
135
137
|
|
|
136
138
|
## Why Zaileys
|
|
137
139
|
|
|
@@ -281,7 +283,7 @@ Package managers: **npm**, **pnpm**, **yarn**, and **bun** are all supported.
|
|
|
281
283
|
- [Recipes](https://zaileys.kejaa.id/recipes/auto-reply) — complete bots you can copy
|
|
282
284
|
- [Reference](https://zaileys.kejaa.id/reference/client) — every method, option, and event
|
|
283
285
|
- [Feature matrix](https://zaileys.kejaa.id/feature-matrix) — what works on which provider
|
|
284
|
-
- 🤖 [**Build with AI**](https://zaileys.kejaa.id/ai) — official Claude Code
|
|
286
|
+
- 🤖 [**Build with AI**](https://zaileys.kejaa.id/ai) — official agent skill for Claude Code, Codex, Cursor, and more
|
|
285
287
|
- 📦 [**examples/**](./examples) — runnable bots: quickstart, interactive buttons, AIRich, storage adapters, broadcast
|
|
286
288
|
- 🔀 [**MIGRATION.md**](./MIGRATION.md) — upgrading from v3.x to v4.0.0 (breaking changes, side-by-side snippets)
|
|
287
289
|
- 🤝 [**CONTRIBUTING.md**](./CONTRIBUTING.md) — dev setup, tests, commit convention, release flow
|
|
@@ -3,6 +3,7 @@ import { type ButtonsContentOptions } from './content/buttons.js';
|
|
|
3
3
|
import { type CarouselCard } from './content/carousel.js';
|
|
4
4
|
import { type AIRichOptions } from './content/airich.js';
|
|
5
5
|
import { type HtmlAppOptions } from './content/html-app.js';
|
|
6
|
+
import type { SafeHtml } from './html.js';
|
|
6
7
|
import { type BuilderInternalState } from './state.js';
|
|
7
8
|
import type { AlbumItem, AudioOptions, BuilderState, ButtonDef, DocumentOptions, EventOptions, GroupInviteOptions, GroupStatusOptions, GroupStatusRepostOptions, GroupStatusSource, ImageOptions, InteractiveButton, ListOptions, LocationOptions, MediaSource, PollOptions, ProductOptions, StickerOptions, TemplateOptions, VideoNoteOptions, VideoOptions } from './types.js';
|
|
8
9
|
export interface BuilderSocketLike {
|
|
@@ -30,7 +31,8 @@ export declare class MessageBuilder<State extends BuilderState> {
|
|
|
30
31
|
static create(socket: BuilderSocketLike, recipient: string, resolveRecipient?: (raw: string) => Promise<string>, recordSent?: (message: WAMessage) => void, inheritDisappearing?: (jid: string) => number | undefined): MessageBuilder<'init'>;
|
|
31
32
|
to(this: MessageBuilder<'init'>, recipient: string): MessageBuilder<'init'>;
|
|
32
33
|
text(this: MessageBuilder<'init'>, content: string, opts?: TextOptions): MessageBuilder<'content-set'>;
|
|
33
|
-
|
|
34
|
+
/** Sends an HTML page that runs inside the bubble on WhatsApp Android. Experimental WhatsApp format. */
|
|
35
|
+
htmlApp(this: MessageBuilder<'init'>, markup: string | SafeHtml, opts?: HtmlAppOptions): MessageBuilder<'content-set'>;
|
|
34
36
|
image(this: MessageBuilder<'init'>, src: MediaSource, opts?: ImageOptions): MessageBuilder<'content-set'>;
|
|
35
37
|
videoNote(this: MessageBuilder<'init'>, src: MediaSource, opts?: VideoNoteOptions): MessageBuilder<'content-set'>;
|
|
36
38
|
video(this: MessageBuilder<'init'>, src: MediaSource, opts?: VideoOptions): MessageBuilder<'content-set'>;
|
|
@@ -76,11 +78,4 @@ export declare class MessageBuilder<State extends BuilderState> {
|
|
|
76
78
|
/** Relay skips baileys' contextInfo pass, so mentions and mentionAll are applied to the unwrapped node here. */
|
|
77
79
|
private applyRelayMentions;
|
|
78
80
|
private sendRelay;
|
|
79
|
-
/**
|
|
80
|
-
* Re-sends the card as an edit of itself. Without it the recipient gets WhatsApp's
|
|
81
|
-
* "can't verify the security of this media" prompt and has to tap Download before the page renders.
|
|
82
|
-
* The edit must sit inside `botForwardedMessage` like the original, otherwise it lands as its own
|
|
83
|
-
* broken message instead of replacing the card.
|
|
84
|
-
*/
|
|
85
|
-
private relayIdenticalEdit;
|
|
86
81
|
}
|
|
@@ -31,7 +31,6 @@ export type AIRichPart = {
|
|
|
31
31
|
} | {
|
|
32
32
|
type: 'html';
|
|
33
33
|
html: string;
|
|
34
|
-
trustedSources?: string[];
|
|
35
34
|
height?: number;
|
|
36
35
|
} | {
|
|
37
36
|
type: 'suggest';
|
|
@@ -82,6 +81,6 @@ export type AIRichOptions = {
|
|
|
82
81
|
footer?: string;
|
|
83
82
|
sources?: Array<[profileUrl: string, url: string, text: string]>;
|
|
84
83
|
};
|
|
85
|
-
/**
|
|
84
|
+
/** Undocumented WhatsApp primitive; only Android renders it, and it runs with no network access. */
|
|
86
85
|
export declare const AI_RICH_HTML_PRIMITIVE = "GenAIaeacdsnwHtmlPrimitive";
|
|
87
86
|
export declare const buildAIRichContent: (parts: AIRichPart[], opts?: AIRichOptions) => AnyMessageContent;
|
|
@@ -4,8 +4,6 @@ export declare const RELAY_CONTENT_KEY = "__zaileysRelayMessage";
|
|
|
4
4
|
export declare const RELAY_MEDIA_KEY = "__zaileysHeaderMedia";
|
|
5
5
|
/** Marks relay content that may only target a group jid; the value is the method label used in the error. */
|
|
6
6
|
export declare const RELAY_REQUIRE_GROUP_KEY = "__zaileysRequireGroupJid";
|
|
7
|
-
/** Asks `sendRelay` to follow the message with an identical edit, which renders it without the download prompt. */
|
|
8
|
-
export declare const RELAY_BYPASS_DOWNLOAD_KEY = "__zaileysBypassDownload";
|
|
9
7
|
/** Carries a downloaded media buffer that `sendRelay` re-uploads and injects into the status envelope. */
|
|
10
8
|
export declare const RELAY_STATUS_MEDIA_KEY = "__zaileysStatusMedia";
|
|
11
9
|
export type StatusMedia = {
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import type { AnyMessageContent } from 'baileys';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/** Rendered above the card, and as the body of the fallback message. */
|
|
10
|
-
text?: string;
|
|
11
|
-
footer?: string;
|
|
12
|
-
trustedSources?: string[];
|
|
13
|
-
/** Pins the page height so the host stops re-measuring a bubble whose height follows its width. */
|
|
2
|
+
import { SafeHtml } from '../html.js';
|
|
3
|
+
/** Default byte ceiling for `htmlApp()` markup. */
|
|
4
|
+
export declare const HTML_APP_MAX_BYTES: number;
|
|
5
|
+
export interface HtmlAppOptions {
|
|
6
|
+
/** Small label shown above the card. Default: none. */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Pins the card height in CSS pixels (1–4096) so the bubble stops re-measuring. Default: the page's own height. */
|
|
14
9
|
height?: number;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
* leaves an empty bubble, so they get a webview button to the same page instead.
|
|
25
|
-
*/
|
|
26
|
-
export declare const buildHtmlAppContent: (html: string, opts?: HtmlAppOptions) => AnyMessageContent;
|
|
10
|
+
/** Recipient device, usually `ctx.senderDevice`; non-`'android'` sends `fallback` or throws. Default: Android. */
|
|
11
|
+
device?: string;
|
|
12
|
+
/** Plain text sent instead of the card when `device` is not Android. Default: none. */
|
|
13
|
+
fallback?: string;
|
|
14
|
+
/** Byte ceiling for the UTF-8 markup. Default 256 KB. */
|
|
15
|
+
maxBytes?: number;
|
|
16
|
+
}
|
|
17
|
+
/** Builds an inline HTML card. WhatsApp renders it only on Android, with no network or storage access. */
|
|
18
|
+
export declare const buildHtmlAppContent: (markup: string | SafeHtml, opts?: HtmlAppOptions) => AnyMessageContent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Markup that `html` inserts verbatim. Build it with `html`, `rawHtml` or `htmlJson`, never from user input. */
|
|
2
|
+
export declare class SafeHtml {
|
|
3
|
+
readonly value: string;
|
|
4
|
+
constructor(value: string);
|
|
5
|
+
toString(): string;
|
|
6
|
+
}
|
|
7
|
+
/** Escapes the characters that can open a tag or close an attribute. */
|
|
8
|
+
export declare const escapeHtml: (value: string) => string;
|
|
9
|
+
/** Marks trusted markup so `html` does not escape it. */
|
|
10
|
+
export declare const rawHtml: (markup: string) => SafeHtml;
|
|
11
|
+
/** Serialises a value for `<script>`, escaping the sequences that could close the tag early. */
|
|
12
|
+
export declare const htmlJson: (value: unknown) => SafeHtml;
|
|
13
|
+
/** Escapes interpolated values; `SafeHtml` and arrays of it pass through, `null`/`undefined`/`false` vanish. */
|
|
14
|
+
export declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => SafeHtml;
|
package/dist/builder/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './types.js';
|
|
|
2
2
|
export * from './errors.js';
|
|
3
3
|
export { MessageBuilder, type BuilderSocketLike, type TextOptions } from './builder.js';
|
|
4
4
|
export { EditBuilder } from './edit-builder.js';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
5
|
+
export { HTML_APP_MAX_BYTES, type HtmlAppOptions } from './content/html-app.js';
|
|
6
|
+
export { SafeHtml, escapeHtml, html, htmlJson, rawHtml } from './html.js';
|
|
7
7
|
export { deleteMessage, reactToMessage, forwardMessage, pinMessage, type DeleteOptions, type PinOptions, } from './mutations.js';
|
|
8
8
|
export { isJid, resolveUsername, type UsernameResolveSocketLike, } from './username-resolve.js';
|