@laplace.live/chatterbox-sdk 0.0.0-stage → 0.0.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 +30 -2
- package/dist/client.d.ts +63 -0
- package/dist/client.js +111 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/protocol.d.ts +64 -0
- package/dist/protocol.js +70 -0
- package/package.json +35 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LAPLACE Live!
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @laplace.live/chatterbox-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Send danmaku through [LAPLACE Chatterbox](https://laplace.live/chatterbox) from a web page. The userscript runs a
|
|
4
|
+
bridge on [LAPLACE Chat](https://chat.laplace.live) pages and hands each send to the viewer's open live-room tab,
|
|
5
|
+
which posts it as the account logged in there, through the same queue, replacement rules and length splitting as a
|
|
6
|
+
hand-typed danmaku. The page never sees cookies.
|
|
7
|
+
|
|
8
|
+
The viewer turns this on in Chatterbox under 设置 → 功能切换 → 允许控制台通过本脚本发送弹幕.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { ChatterboxClient } from '@laplace.live/chatterbox-sdk'
|
|
12
|
+
|
|
13
|
+
const chatterbox = new ChatterboxClient()
|
|
14
|
+
const sendButton = document.querySelector<HTMLButtonElement>('#send')!
|
|
15
|
+
// null until Chatterbox announces itself on this page; sends before that settle as `unavailable`
|
|
16
|
+
chatterbox.onStatusChange(status => {
|
|
17
|
+
sendButton.hidden = status === null
|
|
18
|
+
})
|
|
19
|
+
chatterbox.connect()
|
|
20
|
+
|
|
21
|
+
sendButton.onclick = async () => {
|
|
22
|
+
const result = await chatterbox.send(21452505, '主播晚上好', {
|
|
23
|
+
wrapBrackets: true, // 【主播晚上好】
|
|
24
|
+
onProgress: ({ sent, total }) => console.log(`${sent}/${total}`),
|
|
25
|
+
})
|
|
26
|
+
// result.status: 'sent' | 'partial' | 'failed' | 'disabled' | 'no-room-tab' | 'no-response' | 'not-logged-in' | 'busy' | 'invalid' | 'unavailable'
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`parseClientMessage` and `parseBridgeMessage` validate the raw page messages for code that speaks the protocol
|
|
31
|
+
directly.
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type SendStatus } from './protocol.ts';
|
|
2
|
+
/** What a compatible bridge announced. */
|
|
3
|
+
export interface ChatterboxStatus {
|
|
4
|
+
/** Userscript version. */
|
|
5
|
+
version: string;
|
|
6
|
+
/** The 允许控制台通过本脚本发送弹幕 setting; sends fail with `disabled` while it's off. */
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface SendProgress {
|
|
10
|
+
sent: number;
|
|
11
|
+
/** 0 until the room tab has split the text. */
|
|
12
|
+
total: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SendResult extends SendProgress {
|
|
15
|
+
/** `unavailable` = no compatible Chatterbox on this page, or the client disconnected. */
|
|
16
|
+
status: SendStatus | 'unavailable';
|
|
17
|
+
/** Bilibili's reason for the first rejected segment. */
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SendOptions {
|
|
21
|
+
/** Wrap every split segment in 【】. */
|
|
22
|
+
wrapBrackets?: boolean;
|
|
23
|
+
onProgress?: (progress: SendProgress) => void;
|
|
24
|
+
}
|
|
25
|
+
interface PageMessage {
|
|
26
|
+
source: unknown;
|
|
27
|
+
origin: string;
|
|
28
|
+
data: unknown;
|
|
29
|
+
}
|
|
30
|
+
/** The parts of `window` the client uses. */
|
|
31
|
+
export interface ChatterboxWindow {
|
|
32
|
+
addEventListener(type: 'message', listener: (event: PageMessage) => void): void;
|
|
33
|
+
removeEventListener(type: 'message', listener: (event: PageMessage) => void): void;
|
|
34
|
+
postMessage(message: unknown, targetOrigin: string): void;
|
|
35
|
+
location: {
|
|
36
|
+
origin: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface ChatterboxClientOptions {
|
|
40
|
+
/** Defaults to the global `window`. */
|
|
41
|
+
target?: ChatterboxWindow;
|
|
42
|
+
/** Fallback for a bridge gone silent mid-send, restarted by each progress message; generous because sends queue in the room tab. */
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Talks to the bridge LAPLACE Chatterbox runs on this page: tracks whether it's there, and sends danmaku through the
|
|
47
|
+
* viewer's open live-room tab as the account logged in there.
|
|
48
|
+
*/
|
|
49
|
+
export declare class ChatterboxClient {
|
|
50
|
+
#private;
|
|
51
|
+
constructor(options?: ChatterboxClientOptions);
|
|
52
|
+
/** What the bridge last announced; null until a compatible Chatterbox has announced itself. Stable between changes. */
|
|
53
|
+
get status(): ChatterboxStatus | null;
|
|
54
|
+
/** Subscribe to status changes; returns the unsubscribe function. */
|
|
55
|
+
onStatusChange(listener: (status: ChatterboxStatus | null) => void): () => void;
|
|
56
|
+
/** Listen for the bridge and ask it to announce itself; calling again only re-asks. */
|
|
57
|
+
connect(): void;
|
|
58
|
+
/** Stop listening; sends still in flight settle as `unavailable`. */
|
|
59
|
+
disconnect(): void;
|
|
60
|
+
/** Have Chatterbox send `text` as danmaku in `roomId`, split at the viewer's length cap, from the tab showing that room. */
|
|
61
|
+
send(roomId: number, text: string, { wrapBrackets, onProgress }?: SendOptions): Promise<SendResult>;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { CLIENT_SOURCE, PROTOCOL_VERSION, parseBridgeMessage } from './protocol.js';
|
|
2
|
+
/**
|
|
3
|
+
* Talks to the bridge LAPLACE Chatterbox runs on this page: tracks whether it's there, and sends danmaku through the
|
|
4
|
+
* viewer's open live-room tab as the account logged in there.
|
|
5
|
+
*/
|
|
6
|
+
export class ChatterboxClient {
|
|
7
|
+
#target;
|
|
8
|
+
#timeoutMs;
|
|
9
|
+
#status = null;
|
|
10
|
+
#listening = false;
|
|
11
|
+
#listeners = new Set();
|
|
12
|
+
#pending = new Map();
|
|
13
|
+
constructor(options = {}) {
|
|
14
|
+
this.#target = options.target;
|
|
15
|
+
this.#timeoutMs = options.timeoutMs ?? 3 * 60_000;
|
|
16
|
+
}
|
|
17
|
+
/** What the bridge last announced; null until a compatible Chatterbox has announced itself. Stable between changes. */
|
|
18
|
+
get status() {
|
|
19
|
+
return this.#status;
|
|
20
|
+
}
|
|
21
|
+
/** Subscribe to status changes; returns the unsubscribe function. */
|
|
22
|
+
onStatusChange(listener) {
|
|
23
|
+
this.#listeners.add(listener);
|
|
24
|
+
return () => {
|
|
25
|
+
this.#listeners.delete(listener);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** Listen for the bridge and ask it to announce itself; calling again only re-asks. */
|
|
29
|
+
connect() {
|
|
30
|
+
if (!this.#listening) {
|
|
31
|
+
this.#window().addEventListener('message', this.#onMessage);
|
|
32
|
+
this.#listening = true;
|
|
33
|
+
}
|
|
34
|
+
this.#post({ source: CLIENT_SOURCE, type: 'ping' });
|
|
35
|
+
}
|
|
36
|
+
/** Stop listening; sends still in flight settle as `unavailable`. */
|
|
37
|
+
disconnect() {
|
|
38
|
+
if (!this.#listening)
|
|
39
|
+
return;
|
|
40
|
+
this.#window().removeEventListener('message', this.#onMessage);
|
|
41
|
+
this.#listening = false;
|
|
42
|
+
for (const [id, entry] of this.#pending)
|
|
43
|
+
this.#settle(id, { status: 'unavailable', ...entry.progress });
|
|
44
|
+
this.#setStatus(null);
|
|
45
|
+
}
|
|
46
|
+
/** Have Chatterbox send `text` as danmaku in `roomId`, split at the viewer's length cap, from the tab showing that room. */
|
|
47
|
+
send(roomId, text, { wrapBrackets = false, onProgress } = {}) {
|
|
48
|
+
if (!this.#status)
|
|
49
|
+
return Promise.resolve({ status: 'unavailable', sent: 0, total: 0 });
|
|
50
|
+
const id = crypto.randomUUID();
|
|
51
|
+
return new Promise(resolve => {
|
|
52
|
+
const entry = { resolve, onProgress, progress: { sent: 0, total: 0 } };
|
|
53
|
+
this.#pending.set(id, entry);
|
|
54
|
+
this.#armTimeout(id, entry);
|
|
55
|
+
this.#post({ source: CLIENT_SOURCE, type: 'send', protocol: PROTOCOL_VERSION, id, roomId, text, wrapBrackets });
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
#window() {
|
|
59
|
+
return this.#target ?? window;
|
|
60
|
+
}
|
|
61
|
+
#post(message) {
|
|
62
|
+
const target = this.#window();
|
|
63
|
+
target.postMessage(message, target.location.origin);
|
|
64
|
+
}
|
|
65
|
+
#setStatus(status) {
|
|
66
|
+
if (status?.version === this.#status?.version && status?.enabled === this.#status?.enabled)
|
|
67
|
+
return;
|
|
68
|
+
this.#status = status;
|
|
69
|
+
for (const listener of this.#listeners)
|
|
70
|
+
listener(status);
|
|
71
|
+
}
|
|
72
|
+
#settle(id, result) {
|
|
73
|
+
const entry = this.#pending.get(id);
|
|
74
|
+
if (!entry)
|
|
75
|
+
return;
|
|
76
|
+
clearTimeout(entry.timer);
|
|
77
|
+
this.#pending.delete(id);
|
|
78
|
+
entry.resolve(result);
|
|
79
|
+
}
|
|
80
|
+
#armTimeout(id, entry) {
|
|
81
|
+
clearTimeout(entry.timer);
|
|
82
|
+
entry.timer = setTimeout(() => this.#settle(id, { status: 'no-response', ...entry.progress }), this.#timeoutMs);
|
|
83
|
+
}
|
|
84
|
+
#onMessage = (event) => {
|
|
85
|
+
const target = this.#window();
|
|
86
|
+
if (event.source !== target || event.origin !== target.location.origin)
|
|
87
|
+
return;
|
|
88
|
+
const message = parseBridgeMessage(event.data);
|
|
89
|
+
if (!message)
|
|
90
|
+
return;
|
|
91
|
+
if (message.type === 'status') {
|
|
92
|
+
const compatible = message.protocol === PROTOCOL_VERSION;
|
|
93
|
+
this.#setStatus(compatible ? { version: message.version, enabled: message.enabled } : null);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const entry = this.#pending.get(message.id);
|
|
97
|
+
if (!entry)
|
|
98
|
+
return;
|
|
99
|
+
if (message.type === 'progress') {
|
|
100
|
+
// The bridge re-posts progress as a heartbeat while a send is queued: it restarts the timeout, but only changes notify.
|
|
101
|
+
this.#armTimeout(message.id, entry);
|
|
102
|
+
if (message.sent === entry.progress.sent && message.total === entry.progress.total)
|
|
103
|
+
return;
|
|
104
|
+
entry.progress = { sent: message.sent, total: message.total };
|
|
105
|
+
entry.onProgress?.(entry.progress);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const { status, sent, total, error } = message;
|
|
109
|
+
this.#settle(message.id, { status, sent, total, error });
|
|
110
|
+
};
|
|
111
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Bump on breaking changes; each side treats a peer on another version as absent. */
|
|
2
|
+
export declare const PROTOCOL_VERSION = 1;
|
|
3
|
+
/** Longest text one send may carry. */
|
|
4
|
+
export declare const MAX_SEND_TEXT = 500;
|
|
5
|
+
/** `source` of every message the client posts. */
|
|
6
|
+
export declare const CLIENT_SOURCE = "laplace-chat";
|
|
7
|
+
/** `source` of every message the bridge posts. */
|
|
8
|
+
export declare const BRIDGE_SOURCE = "laplace-chatterbox";
|
|
9
|
+
export declare const SEND_STATUSES: readonly ['sent', 'partial', 'failed', 'disabled', 'no-room-tab', 'no-response', 'not-logged-in', 'busy', 'invalid'];
|
|
10
|
+
/**
|
|
11
|
+
* How a send ended: `partial` = some segments rejected, `disabled` = the 允许控制台通过本脚本发送弹幕 setting is off,
|
|
12
|
+
* `no-room-tab` = no open tab of that room, `no-response` = the tab went away or stopped answering.
|
|
13
|
+
*/
|
|
14
|
+
export type SendStatus = (typeof SEND_STATUSES)[number];
|
|
15
|
+
export interface PingMessage {
|
|
16
|
+
source: typeof CLIENT_SOURCE;
|
|
17
|
+
type: 'ping';
|
|
18
|
+
}
|
|
19
|
+
export interface SendMessage {
|
|
20
|
+
source: typeof CLIENT_SOURCE;
|
|
21
|
+
type: 'send';
|
|
22
|
+
protocol: number;
|
|
23
|
+
id: string;
|
|
24
|
+
/** Real or short room id; the bridge matches either. */
|
|
25
|
+
roomId: number;
|
|
26
|
+
text: string;
|
|
27
|
+
/** Wrap every split segment in 【】. */
|
|
28
|
+
wrapBrackets: boolean;
|
|
29
|
+
}
|
|
30
|
+
export type ClientMessage = PingMessage | SendMessage;
|
|
31
|
+
export interface StatusMessage {
|
|
32
|
+
source: typeof BRIDGE_SOURCE;
|
|
33
|
+
type: 'status';
|
|
34
|
+
protocol: number;
|
|
35
|
+
/** Userscript version. */
|
|
36
|
+
version: string;
|
|
37
|
+
/** The 允许控制台通过本脚本发送弹幕 setting. */
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface ProgressMessage {
|
|
41
|
+
source: typeof BRIDGE_SOURCE;
|
|
42
|
+
type: 'progress';
|
|
43
|
+
id: string;
|
|
44
|
+
sent: number;
|
|
45
|
+
/** 0 until the room tab has split the text. */
|
|
46
|
+
total: number;
|
|
47
|
+
}
|
|
48
|
+
export interface ResultMessage {
|
|
49
|
+
source: typeof BRIDGE_SOURCE;
|
|
50
|
+
type: 'result';
|
|
51
|
+
id: string;
|
|
52
|
+
status: SendStatus;
|
|
53
|
+
sent: number;
|
|
54
|
+
total: number;
|
|
55
|
+
/** Bilibili's reason for the first rejected segment. */
|
|
56
|
+
error?: string;
|
|
57
|
+
}
|
|
58
|
+
export type BridgeMessage = StatusMessage | ProgressMessage | ResultMessage;
|
|
59
|
+
/** Whether `value` is one of {@link SEND_STATUSES}. */
|
|
60
|
+
export declare function isSendStatus(value: unknown): value is SendStatus;
|
|
61
|
+
/** Parse a message the client posted; null for anything else on the channel. Unknown fields are dropped. */
|
|
62
|
+
export declare function parseClientMessage(raw: unknown): ClientMessage | null;
|
|
63
|
+
/** Parse a message the bridge posted; null for anything else on the channel. Unknown fields are dropped. */
|
|
64
|
+
export declare function parseBridgeMessage(raw: unknown): BridgeMessage | null;
|
package/dist/protocol.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Page protocol between a page using the SDK client and the bridge LAPLACE Chatterbox runs on that page.
|
|
2
|
+
/** Bump on breaking changes; each side treats a peer on another version as absent. */
|
|
3
|
+
export const PROTOCOL_VERSION = 1;
|
|
4
|
+
/** Longest text one send may carry. */
|
|
5
|
+
export const MAX_SEND_TEXT = 500;
|
|
6
|
+
/** `source` of every message the client posts. */
|
|
7
|
+
export const CLIENT_SOURCE = 'laplace-chat';
|
|
8
|
+
/** `source` of every message the bridge posts. */
|
|
9
|
+
export const BRIDGE_SOURCE = 'laplace-chatterbox';
|
|
10
|
+
export const SEND_STATUSES = [
|
|
11
|
+
'sent',
|
|
12
|
+
'partial',
|
|
13
|
+
'failed',
|
|
14
|
+
'disabled',
|
|
15
|
+
'no-room-tab',
|
|
16
|
+
'no-response',
|
|
17
|
+
'not-logged-in',
|
|
18
|
+
'busy',
|
|
19
|
+
'invalid',
|
|
20
|
+
];
|
|
21
|
+
const MAX_ID = 64;
|
|
22
|
+
function isRecord(value) {
|
|
23
|
+
return typeof value === 'object' && value !== null;
|
|
24
|
+
}
|
|
25
|
+
function isCount(value) {
|
|
26
|
+
return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;
|
|
27
|
+
}
|
|
28
|
+
/** Whether `value` is one of {@link SEND_STATUSES}. */
|
|
29
|
+
export function isSendStatus(value) {
|
|
30
|
+
return SEND_STATUSES.some(status => status === value);
|
|
31
|
+
}
|
|
32
|
+
/** Parse a message the client posted; null for anything else on the channel. Unknown fields are dropped. */
|
|
33
|
+
export function parseClientMessage(raw) {
|
|
34
|
+
if (!isRecord(raw) || raw.source !== CLIENT_SOURCE)
|
|
35
|
+
return null;
|
|
36
|
+
if (raw.type === 'ping')
|
|
37
|
+
return { source: CLIENT_SOURCE, type: 'ping' };
|
|
38
|
+
if (raw.type !== 'send')
|
|
39
|
+
return null;
|
|
40
|
+
const { protocol, id, roomId, text, wrapBrackets } = raw;
|
|
41
|
+
if (typeof protocol !== 'number' || typeof id !== 'string' || !id || id.length > MAX_ID)
|
|
42
|
+
return null;
|
|
43
|
+
if (typeof roomId !== 'number' || !Number.isSafeInteger(roomId) || roomId <= 0)
|
|
44
|
+
return null;
|
|
45
|
+
if (typeof text !== 'string' || !text.trim() || text.length > MAX_SEND_TEXT || typeof wrapBrackets !== 'boolean')
|
|
46
|
+
return null;
|
|
47
|
+
return { source: CLIENT_SOURCE, type: 'send', protocol, id, roomId, text, wrapBrackets };
|
|
48
|
+
}
|
|
49
|
+
/** Parse a message the bridge posted; null for anything else on the channel. Unknown fields are dropped. */
|
|
50
|
+
export function parseBridgeMessage(raw) {
|
|
51
|
+
if (!isRecord(raw) || raw.source !== BRIDGE_SOURCE)
|
|
52
|
+
return null;
|
|
53
|
+
if (raw.type === 'status') {
|
|
54
|
+
const { protocol, version, enabled } = raw;
|
|
55
|
+
if (typeof protocol !== 'number' || typeof version !== 'string' || typeof enabled !== 'boolean')
|
|
56
|
+
return null;
|
|
57
|
+
return { source: BRIDGE_SOURCE, type: 'status', protocol, version, enabled };
|
|
58
|
+
}
|
|
59
|
+
const { id, sent, total } = raw;
|
|
60
|
+
if (typeof id !== 'string' || !isCount(sent) || !isCount(total))
|
|
61
|
+
return null;
|
|
62
|
+
if (raw.type === 'progress')
|
|
63
|
+
return { source: BRIDGE_SOURCE, type: 'progress', id, sent, total };
|
|
64
|
+
if (raw.type !== 'result')
|
|
65
|
+
return null;
|
|
66
|
+
const { status, error } = raw;
|
|
67
|
+
if (!isSendStatus(status) || (error !== undefined && typeof error !== 'string'))
|
|
68
|
+
return null;
|
|
69
|
+
return { source: BRIDGE_SOURCE, type: 'result', id, status, sent, total, error };
|
|
70
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laplace.live/chatterbox-sdk",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "TypeScript SDK and page protocol for sending danmaku through LAPLACE Chatterbox from a web page",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"author": "LAPLACE Live! <s@laplace.live>",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/laplace-live/chatterbox",
|
|
11
|
+
"directory": "packages/chatterbox-sdk"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://laplace.live/chatterbox",
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public",
|
|
26
|
+
"provenance": true
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"prepublishOnly": "bun run build"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/bun": "^1.4.5",
|
|
35
|
+
"typescript": "^7.0.2"
|
|
36
|
+
}
|
|
37
|
+
}
|