@vibes.diy/api-types 14.3.353 → 14.3.355
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/agent-imessage.d.ts +43 -0
- package/agent-imessage.js +124 -0
- package/agent-reply-fold.d.ts +10 -1
- package/agent-reply-fold.js +16 -0
- package/asset-magic.d.ts +4 -0
- package/asset-magic.js +48 -0
- package/crm-fact-msg.d.ts +2 -1
- package/crm-fact-msg.js +2 -1
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +4 -4
- package/settings.d.ts +55 -0
- package/settings.js +19 -1
- package/text-turn.d.ts +22 -0
- package/text-turn.js +14 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const AGENT_SEND_IMESSAGE_TOOL_NAME = "send_imessage";
|
|
2
|
+
export declare const AGENT_SEND_POLL_TOOL_NAME = "send_poll";
|
|
3
|
+
export declare const AGENT_IMESSAGE_TOOL_NAMES: ReadonlySet<string>;
|
|
4
|
+
export declare const IMESSAGE_SCREEN_EFFECTS: readonly ["confetti", "fireworks", "balloons", "lasers", "sparkles", "celebration", "hearts", "love", "happy_birthday", "echo", "spotlight"];
|
|
5
|
+
export declare const IMESSAGE_BUBBLE_EFFECTS: readonly ["slam", "loud", "gentle", "invisible"];
|
|
6
|
+
export declare const IMESSAGE_EFFECTS: readonly ["confetti", "fireworks", "balloons", "lasers", "sparkles", "celebration", "hearts", "love", "happy_birthday", "echo", "spotlight", "slam", "loud", "gentle", "invisible"];
|
|
7
|
+
export type IMessageEffect = (typeof IMESSAGE_EFFECTS)[number];
|
|
8
|
+
export declare const IMESSAGE_TEXT_STYLES: readonly ["bold", "italic", "underline", "strikethrough"];
|
|
9
|
+
export type IMessageTextStyle = (typeof IMESSAGE_TEXT_STYLES)[number];
|
|
10
|
+
export declare const IMESSAGE_TEXT_ANIMATIONS: readonly ["big", "small", "shake", "nod", "explode", "ripple", "bloom", "jitter"];
|
|
11
|
+
export type IMessageTextAnimation = (typeof IMESSAGE_TEXT_ANIMATIONS)[number];
|
|
12
|
+
export type IMessageDecoration = {
|
|
13
|
+
readonly words: string;
|
|
14
|
+
readonly style: IMessageTextStyle;
|
|
15
|
+
} | {
|
|
16
|
+
readonly words: string;
|
|
17
|
+
readonly animation: IMessageTextAnimation;
|
|
18
|
+
};
|
|
19
|
+
export declare const IMESSAGE_POLL_MIN_OPTIONS = 2;
|
|
20
|
+
export declare const IMESSAGE_POLL_MAX_OPTIONS = 12;
|
|
21
|
+
export declare const IMESSAGE_MAX_DECORATIONS = 4;
|
|
22
|
+
export type AgentIMessage = {
|
|
23
|
+
readonly kind: "styled";
|
|
24
|
+
readonly text: string;
|
|
25
|
+
readonly effect?: IMessageEffect;
|
|
26
|
+
readonly decorations?: readonly IMessageDecoration[];
|
|
27
|
+
readonly replyToNewest?: boolean;
|
|
28
|
+
} | {
|
|
29
|
+
readonly kind: "poll";
|
|
30
|
+
readonly question: string;
|
|
31
|
+
readonly options: readonly string[];
|
|
32
|
+
};
|
|
33
|
+
export declare function isIMessageEffect(v: unknown): v is IMessageEffect;
|
|
34
|
+
export declare function screenOrBubble(effect: IMessageEffect): "screen" | "bubble";
|
|
35
|
+
export declare function agentIMessageOf(toolName: string, input: unknown): {
|
|
36
|
+
ok: true;
|
|
37
|
+
value: AgentIMessage;
|
|
38
|
+
} | {
|
|
39
|
+
ok: false;
|
|
40
|
+
reason: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function agentIMessageReceipt(value: AgentIMessage): string;
|
|
43
|
+
export declare function agentIMessageFromReceipt(name: string | undefined, text: string | undefined): AgentIMessage | undefined;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { exception2Result } from "@adviser/cement";
|
|
2
|
+
export const AGENT_SEND_IMESSAGE_TOOL_NAME = "send_imessage";
|
|
3
|
+
export const AGENT_SEND_POLL_TOOL_NAME = "send_poll";
|
|
4
|
+
export const AGENT_IMESSAGE_TOOL_NAMES = new Set([AGENT_SEND_IMESSAGE_TOOL_NAME, AGENT_SEND_POLL_TOOL_NAME]);
|
|
5
|
+
export const IMESSAGE_SCREEN_EFFECTS = [
|
|
6
|
+
"confetti",
|
|
7
|
+
"fireworks",
|
|
8
|
+
"balloons",
|
|
9
|
+
"lasers",
|
|
10
|
+
"sparkles",
|
|
11
|
+
"celebration",
|
|
12
|
+
"hearts",
|
|
13
|
+
"love",
|
|
14
|
+
"happy_birthday",
|
|
15
|
+
"echo",
|
|
16
|
+
"spotlight",
|
|
17
|
+
];
|
|
18
|
+
export const IMESSAGE_BUBBLE_EFFECTS = ["slam", "loud", "gentle", "invisible"];
|
|
19
|
+
export const IMESSAGE_EFFECTS = [...IMESSAGE_SCREEN_EFFECTS, ...IMESSAGE_BUBBLE_EFFECTS];
|
|
20
|
+
export const IMESSAGE_TEXT_STYLES = ["bold", "italic", "underline", "strikethrough"];
|
|
21
|
+
export const IMESSAGE_TEXT_ANIMATIONS = ["big", "small", "shake", "nod", "explode", "ripple", "bloom", "jitter"];
|
|
22
|
+
export const IMESSAGE_POLL_MIN_OPTIONS = 2;
|
|
23
|
+
export const IMESSAGE_POLL_MAX_OPTIONS = 12;
|
|
24
|
+
export const IMESSAGE_MAX_DECORATIONS = 4;
|
|
25
|
+
export function isIMessageEffect(v) {
|
|
26
|
+
return typeof v === "string" && IMESSAGE_EFFECTS.includes(v);
|
|
27
|
+
}
|
|
28
|
+
export function screenOrBubble(effect) {
|
|
29
|
+
return IMESSAGE_BUBBLE_EFFECTS.includes(effect) ? "bubble" : "screen";
|
|
30
|
+
}
|
|
31
|
+
function obj(v) {
|
|
32
|
+
return typeof v === "object" && v !== null && !Array.isArray(v) ? v : undefined;
|
|
33
|
+
}
|
|
34
|
+
function decorationOf(v, text) {
|
|
35
|
+
const d = obj(v);
|
|
36
|
+
if (d === undefined || typeof d.words !== "string" || d.words.trim() === "" || !text.includes(d.words))
|
|
37
|
+
return undefined;
|
|
38
|
+
const style = d.style;
|
|
39
|
+
const animation = d.animation;
|
|
40
|
+
if (typeof style === "string" && IMESSAGE_TEXT_STYLES.includes(style) && animation === undefined) {
|
|
41
|
+
return { words: d.words, style: style };
|
|
42
|
+
}
|
|
43
|
+
if (typeof animation === "string" && IMESSAGE_TEXT_ANIMATIONS.includes(animation) && style === undefined) {
|
|
44
|
+
return { words: d.words, animation: animation };
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
export function agentIMessageOf(toolName, input) {
|
|
49
|
+
const a = obj(input);
|
|
50
|
+
if (a === undefined)
|
|
51
|
+
return { ok: false, reason: "Pass the tool's fields as an object." };
|
|
52
|
+
if (toolName === AGENT_SEND_POLL_TOOL_NAME || a.kind === "poll") {
|
|
53
|
+
const question = typeof a.question === "string" ? a.question.trim() : "";
|
|
54
|
+
if (question === "")
|
|
55
|
+
return { ok: false, reason: "A poll needs its question, sent as the text above it." };
|
|
56
|
+
const options = Array.isArray(a.options)
|
|
57
|
+
? [...new Set(a.options.filter((o) => typeof o === "string").map((o) => o.trim()))].filter((o) => o !== "")
|
|
58
|
+
: [];
|
|
59
|
+
if (options.length < IMESSAGE_POLL_MIN_OPTIONS || options.length > IMESSAGE_POLL_MAX_OPTIONS) {
|
|
60
|
+
return {
|
|
61
|
+
ok: false,
|
|
62
|
+
reason: `A poll takes ${IMESSAGE_POLL_MIN_OPTIONS} to ${IMESSAGE_POLL_MAX_OPTIONS} different options.`,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return { ok: true, value: { kind: "poll", question, options } };
|
|
66
|
+
}
|
|
67
|
+
const text = typeof a.text === "string" ? a.text.trim() : "";
|
|
68
|
+
if (text === "")
|
|
69
|
+
return { ok: false, reason: "send_imessage needs the words to send." };
|
|
70
|
+
let effect;
|
|
71
|
+
if (a.effect !== undefined && a.effect !== null && a.effect !== "") {
|
|
72
|
+
if (!isIMessageEffect(a.effect))
|
|
73
|
+
return { ok: false, reason: `effect is one of ${IMESSAGE_EFFECTS.join(", ")}.` };
|
|
74
|
+
effect = a.effect;
|
|
75
|
+
}
|
|
76
|
+
const rawDecorations = Array.isArray(a.decorations) ? a.decorations : [];
|
|
77
|
+
if (rawDecorations.length > IMESSAGE_MAX_DECORATIONS) {
|
|
78
|
+
return { ok: false, reason: `At most ${IMESSAGE_MAX_DECORATIONS} decorations on one text.` };
|
|
79
|
+
}
|
|
80
|
+
const decorations = [];
|
|
81
|
+
for (const raw of rawDecorations) {
|
|
82
|
+
const d = decorationOf(raw, text);
|
|
83
|
+
if (d === undefined) {
|
|
84
|
+
return {
|
|
85
|
+
ok: false,
|
|
86
|
+
reason: "Each decoration names words that appear in the text and exactly one style " +
|
|
87
|
+
`(${IMESSAGE_TEXT_STYLES.join(", ")}) or animation (${IMESSAGE_TEXT_ANIMATIONS.join(", ")}).`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
decorations.push(d);
|
|
91
|
+
}
|
|
92
|
+
const replyToNewest = a.reply_to_newest === true || a.replyToNewest === true;
|
|
93
|
+
if (effect === undefined && decorations.length === 0 && !replyToNewest) {
|
|
94
|
+
return {
|
|
95
|
+
ok: false,
|
|
96
|
+
reason: "send_imessage is for a text with an effect, decorations or a threaded reply; write plain words as usual.",
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
ok: true,
|
|
101
|
+
value: {
|
|
102
|
+
kind: "styled",
|
|
103
|
+
text,
|
|
104
|
+
...(effect === undefined ? {} : { effect }),
|
|
105
|
+
...(decorations.length === 0 ? {} : { decorations }),
|
|
106
|
+
...(replyToNewest ? { replyToNewest: true } : {}),
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export function agentIMessageReceipt(value) {
|
|
111
|
+
return JSON.stringify({ ok: true, imessage: value });
|
|
112
|
+
}
|
|
113
|
+
export function agentIMessageFromReceipt(name, text) {
|
|
114
|
+
if (name === undefined || !AGENT_IMESSAGE_TOOL_NAMES.has(name) || text === undefined)
|
|
115
|
+
return undefined;
|
|
116
|
+
const rParsed = exception2Result(() => JSON.parse(text));
|
|
117
|
+
if (rParsed.isErr())
|
|
118
|
+
return undefined;
|
|
119
|
+
const r = obj(rParsed.Ok());
|
|
120
|
+
if (r?.ok !== true)
|
|
121
|
+
return undefined;
|
|
122
|
+
const got = agentIMessageOf(name, r.imessage);
|
|
123
|
+
return got.ok ? got.value : undefined;
|
|
124
|
+
}
|
package/agent-reply-fold.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AgentPicture } from "./agent-picture.js";
|
|
2
|
+
import { type AgentIMessage, type IMessageDecoration, type IMessageEffect } from "./agent-imessage.js";
|
|
2
3
|
import { type GroupConfirm, type GroupCopyToAsker } from "./group-principal.js";
|
|
3
4
|
import type { AgentEvidence } from "./prompt.js";
|
|
4
5
|
export interface AgentFoldBlockEvent {
|
|
@@ -35,6 +36,7 @@ export interface FoldAgentRepliesOpts {
|
|
|
35
36
|
readonly onCopyToAsker?: (copy: GroupCopyToAsker) => void;
|
|
36
37
|
readonly onPicture?: (picture: AgentPicture) => void | Promise<void>;
|
|
37
38
|
readonly onPictureMissed?: () => void;
|
|
39
|
+
readonly onIMessage?: (touch: AgentIMessage) => void | Promise<void>;
|
|
38
40
|
readonly now?: () => number;
|
|
39
41
|
readonly callFlushGraceMs?: number;
|
|
40
42
|
}
|
|
@@ -52,6 +54,9 @@ export declare function foldAgentReplies(opts: FoldAgentRepliesOpts): Promise<Fo
|
|
|
52
54
|
export type FoldedReply = {
|
|
53
55
|
readonly kind: "text";
|
|
54
56
|
readonly text: string;
|
|
57
|
+
readonly effect?: IMessageEffect;
|
|
58
|
+
readonly decorations?: IMessageDecoration[];
|
|
59
|
+
readonly replyToNewest?: boolean;
|
|
55
60
|
} | {
|
|
56
61
|
readonly kind: "picture";
|
|
57
62
|
readonly url: string;
|
|
@@ -59,8 +64,12 @@ export type FoldedReply = {
|
|
|
59
64
|
readonly name?: string;
|
|
60
65
|
} | {
|
|
61
66
|
readonly kind: "picture-missed";
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: "poll";
|
|
69
|
+
readonly question: string;
|
|
70
|
+
readonly options: string[];
|
|
62
71
|
};
|
|
63
|
-
export type FoldAgentTurnOpts = Omit<FoldAgentRepliesOpts, "onMessage" | "onPicture" | "onPictureMissed"> & {
|
|
72
|
+
export type FoldAgentTurnOpts = Omit<FoldAgentRepliesOpts, "onMessage" | "onPicture" | "onPictureMissed" | "onIMessage"> & {
|
|
64
73
|
readonly onReply?: (reply: FoldedReply) => void | Promise<void>;
|
|
65
74
|
readonly onError?: (message: string) => void;
|
|
66
75
|
};
|
package/agent-reply-fold.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AGENT_REACT_TOOL_NAME, agentReactionFromReceipt } from "./agent-reactions.js";
|
|
2
2
|
import { AGENT_PICTURE_TOOL_NAMES, agentPictureFromReceipt } from "./agent-picture.js";
|
|
3
|
+
import { agentIMessageFromReceipt } from "./agent-imessage.js";
|
|
3
4
|
import { groupConfirmFromReceipt, groupCopyFromReceipt } from "./group-principal.js";
|
|
4
5
|
import { splitAgentFold } from "./agent-fold.js";
|
|
5
6
|
import { isCreditsExhaustedError } from "./credits-copy.js";
|
|
@@ -161,6 +162,12 @@ export async function foldAgentReplies(opts) {
|
|
|
161
162
|
flush(ev.promptId);
|
|
162
163
|
await Promise.resolve(opts.onPicture?.(picture)).catch(() => undefined);
|
|
163
164
|
}
|
|
165
|
+
const touch = agentIMessageFromReceipt(ev.evidence.name, ev.evidence.text);
|
|
166
|
+
if (touch !== undefined) {
|
|
167
|
+
callFlushAt.delete(ev.promptId);
|
|
168
|
+
flush(ev.promptId);
|
|
169
|
+
await Promise.resolve(opts.onIMessage?.(touch)).catch(() => undefined);
|
|
170
|
+
}
|
|
164
171
|
const onMissed = opts.onPictureMissed;
|
|
165
172
|
if (onMissed !== undefined &&
|
|
166
173
|
picture === undefined &&
|
|
@@ -247,6 +254,15 @@ export async function foldAgentTurn(opts) {
|
|
|
247
254
|
onPictureMissed: () => {
|
|
248
255
|
void emit({ kind: "picture-missed" });
|
|
249
256
|
},
|
|
257
|
+
onIMessage: (t) => emit(t.kind === "poll"
|
|
258
|
+
? { kind: "poll", question: t.question, options: [...t.options] }
|
|
259
|
+
: {
|
|
260
|
+
kind: "text",
|
|
261
|
+
text: t.text,
|
|
262
|
+
...(t.effect === undefined ? {} : { effect: t.effect }),
|
|
263
|
+
...(t.decorations === undefined ? {} : { decorations: [...t.decorations] }),
|
|
264
|
+
...(t.replyToNewest === true ? { replyToNewest: true } : {}),
|
|
265
|
+
}),
|
|
250
266
|
onPicture: (p) => emit({ kind: "picture", url: p.url, mimeType: p.mimeType, ...(p.name === undefined ? {} : { name: p.name }) }),
|
|
251
267
|
});
|
|
252
268
|
await delivered;
|
package/asset-magic.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type AssetMagic = readonly (readonly [number, readonly number[]])[];
|
|
2
|
+
export declare const ASSET_MAGIC: readonly (readonly [string, AssetMagic])[];
|
|
3
|
+
export declare function headMatchesMagic(head: Uint8Array, magic: AssetMagic): boolean;
|
|
4
|
+
export declare function sniffAssetMime(head: Uint8Array): string | null;
|
package/asset-magic.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const ASSET_MAGIC = [
|
|
2
|
+
["image/png", [[0, [0x89, 0x50, 0x4e, 0x47]]]],
|
|
3
|
+
["image/jpeg", [[0, [0xff, 0xd8, 0xff]]]],
|
|
4
|
+
["image/gif", [[0, [0x47, 0x49, 0x46, 0x38]]]],
|
|
5
|
+
[
|
|
6
|
+
"image/webp",
|
|
7
|
+
[
|
|
8
|
+
[0, [0x52, 0x49, 0x46, 0x46]],
|
|
9
|
+
[8, [0x57, 0x45, 0x42, 0x50]],
|
|
10
|
+
],
|
|
11
|
+
],
|
|
12
|
+
["application/pdf", [[0, [0x25, 0x50, 0x44, 0x46]]]],
|
|
13
|
+
["audio/mpeg", [[0, [0x49, 0x44, 0x33]]]],
|
|
14
|
+
[
|
|
15
|
+
"audio/wav",
|
|
16
|
+
[
|
|
17
|
+
[0, [0x52, 0x49, 0x46, 0x46]],
|
|
18
|
+
[8, [0x57, 0x41, 0x56, 0x45]],
|
|
19
|
+
],
|
|
20
|
+
],
|
|
21
|
+
["audio/ogg", [[0, [0x4f, 0x67, 0x67, 0x53]]]],
|
|
22
|
+
[
|
|
23
|
+
"audio/mp4",
|
|
24
|
+
[
|
|
25
|
+
[4, [0x66, 0x74, 0x79, 0x70]],
|
|
26
|
+
[8, [0x4d, 0x34, 0x41, 0x20]],
|
|
27
|
+
],
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"image/avif",
|
|
31
|
+
[
|
|
32
|
+
[4, [0x66, 0x74, 0x79, 0x70]],
|
|
33
|
+
[8, [0x61, 0x76, 0x69, 0x66]],
|
|
34
|
+
],
|
|
35
|
+
],
|
|
36
|
+
["font/woff2", [[0, [0x77, 0x4f, 0x46, 0x32]]]],
|
|
37
|
+
["font/ttf", [[0, [0x00, 0x01, 0x00, 0x00]]]],
|
|
38
|
+
];
|
|
39
|
+
export function headMatchesMagic(head, magic) {
|
|
40
|
+
return magic.every(([off, bytes]) => bytes.every((b, i) => head[off + i] === b));
|
|
41
|
+
}
|
|
42
|
+
export function sniffAssetMime(head) {
|
|
43
|
+
for (const [mime, magic] of ASSET_MAGIC) {
|
|
44
|
+
if (headMatchesMagic(head, magic))
|
|
45
|
+
return mime;
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
package/crm-fact-msg.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const evtCrmFact: import("arktype/internal/variants/object.ts").O
|
|
|
3
3
|
eventId: string;
|
|
4
4
|
userId: string;
|
|
5
5
|
at: string;
|
|
6
|
-
kind: "app-mint" | "app-publish" | "codegen-turn" | "email-bounced" | "email-clicked" | "email-complained" | "email-opened" | "email-sent" | "handle-bind" | "paywall-hit" | "plan-change" | "recruited-by-vibe" | "share-sent" | "signup-source" | "visit";
|
|
6
|
+
kind: "app-mint" | "app-publish" | "codegen-turn" | "email-bounced" | "email-clicked" | "email-complained" | "email-opened" | "email-sent" | "handle-bind" | "paywall-hit" | "plan-change" | "promo-redeemed" | "recruited-by-vibe" | "share-sent" | "signup-source" | "visit";
|
|
7
7
|
handle?: string | undefined;
|
|
8
8
|
provisional?: boolean | undefined;
|
|
9
9
|
appSlug?: string | undefined;
|
|
@@ -21,6 +21,7 @@ export declare const evtCrmFact: import("arktype/internal/variants/object.ts").O
|
|
|
21
21
|
ownerHandle: string;
|
|
22
22
|
appSlug: string;
|
|
23
23
|
} | undefined;
|
|
24
|
+
promoMask?: string | undefined;
|
|
24
25
|
email?: {
|
|
25
26
|
lane: string;
|
|
26
27
|
resendId: string;
|
package/crm-fact-msg.js
CHANGED
|
@@ -5,7 +5,7 @@ export const evtCrmFact = lazyType(() => type({
|
|
|
5
5
|
eventId: "string",
|
|
6
6
|
userId: "string",
|
|
7
7
|
at: "string",
|
|
8
|
-
kind: "'codegen-turn'|'app-mint'|'handle-bind'|'paywall-hit'|'app-publish'|'plan-change'|'signup-source'|'recruited-by-vibe'|'visit'|'share-sent'|'email-sent'|'email-opened'|'email-clicked'|'email-bounced'|'email-complained'",
|
|
8
|
+
kind: "'codegen-turn'|'app-mint'|'handle-bind'|'paywall-hit'|'app-publish'|'plan-change'|'signup-source'|'recruited-by-vibe'|'visit'|'share-sent'|'promo-redeemed'|'email-sent'|'email-opened'|'email-clicked'|'email-bounced'|'email-complained'",
|
|
9
9
|
"handle?": "string",
|
|
10
10
|
"provisional?": "boolean",
|
|
11
11
|
"appSlug?": "string",
|
|
@@ -20,6 +20,7 @@ export const evtCrmFact = lazyType(() => type({
|
|
|
20
20
|
},
|
|
21
21
|
"clickIds?": "('fbclid'|'gclid'|'msclkid'|'ttclid')[]",
|
|
22
22
|
"recruitedBy?": { ownerHandle: "string", appSlug: "string" },
|
|
23
|
+
"promoMask?": "string",
|
|
23
24
|
"email?": {
|
|
24
25
|
lane: "string",
|
|
25
26
|
resendId: "string",
|
package/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from "./agent-tools.js";
|
|
|
21
21
|
export * from "./agent-personalities.js";
|
|
22
22
|
export * from "./agent-reactions.js";
|
|
23
23
|
export * from "./agent-picture.js";
|
|
24
|
+
export * from "./agent-imessage.js";
|
|
24
25
|
export * from "./notify-picture.js";
|
|
25
26
|
export * from "./bridge-notes.js";
|
|
26
27
|
export * from "./shared-mint.js";
|
|
@@ -78,6 +79,7 @@ export * from "./billing-msg.js";
|
|
|
78
79
|
export * from "./credits-copy.js";
|
|
79
80
|
export * from "./asset.js";
|
|
80
81
|
export * from "./asset-extensions.js";
|
|
82
|
+
export * from "./asset-magic.js";
|
|
81
83
|
export * from "./report.js";
|
|
82
84
|
export * from "./report-activity-engaged.js";
|
|
83
85
|
export * from "./home-feed.js";
|
package/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export * from "./agent-tools.js";
|
|
|
20
20
|
export * from "./agent-personalities.js";
|
|
21
21
|
export * from "./agent-reactions.js";
|
|
22
22
|
export * from "./agent-picture.js";
|
|
23
|
+
export * from "./agent-imessage.js";
|
|
23
24
|
export * from "./notify-picture.js";
|
|
24
25
|
export * from "./bridge-notes.js";
|
|
25
26
|
export * from "./shared-mint.js";
|
|
@@ -77,6 +78,7 @@ export * from "./billing-msg.js";
|
|
|
77
78
|
export * from "./credits-copy.js";
|
|
78
79
|
export * from "./asset.js";
|
|
79
80
|
export * from "./asset-extensions.js";
|
|
81
|
+
export * from "./asset-magic.js";
|
|
80
82
|
export * from "./report.js";
|
|
81
83
|
export * from "./report-activity-engaged.js";
|
|
82
84
|
export * from "./home-feed.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/api-types",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.355",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@adviser/cement": "~0.5.37",
|
|
27
27
|
"@cloudflare/workers-types": "~5.20261101.1",
|
|
28
|
-
"@vibes.diy/call-ai-v2": "14.3.
|
|
29
|
-
"@vibes.diy/identity": "14.3.
|
|
30
|
-
"@vibes.diy/vibe-types": "14.3.
|
|
28
|
+
"@vibes.diy/call-ai-v2": "14.3.355",
|
|
29
|
+
"@vibes.diy/identity": "14.3.355",
|
|
30
|
+
"@vibes.diy/vibe-types": "14.3.355",
|
|
31
31
|
"arktype": "~2.2.9"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
package/settings.d.ts
CHANGED
|
@@ -377,6 +377,22 @@ export declare const userSettingPlanAck: import("arktype/internal/variants/objec
|
|
|
377
377
|
}, {}>;
|
|
378
378
|
export type UserSettingPlanAck = typeof userSettingPlanAck.infer;
|
|
379
379
|
export declare function isUserSettingPlanAck(obj: unknown): obj is UserSettingPlanAck;
|
|
380
|
+
export declare const userSettingGuestFirstTouch: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
381
|
+
type: "guestFirstTouch";
|
|
382
|
+
landingPath?: string | undefined;
|
|
383
|
+
referrerHost?: string | undefined;
|
|
384
|
+
utm?: {
|
|
385
|
+
source?: string | undefined;
|
|
386
|
+
medium?: string | undefined;
|
|
387
|
+
campaign?: string | undefined;
|
|
388
|
+
content?: string | undefined;
|
|
389
|
+
term?: string | undefined;
|
|
390
|
+
} | undefined;
|
|
391
|
+
clickIds?: ("fbclid" | "gclid" | "msclkid" | "ttclid")[] | undefined;
|
|
392
|
+
capturedAt: string;
|
|
393
|
+
}, {}>;
|
|
394
|
+
export type UserSettingGuestFirstTouch = typeof userSettingGuestFirstTouch.infer;
|
|
395
|
+
export declare function isUserSettingGuestFirstTouch(obj: unknown): obj is UserSettingGuestFirstTouch;
|
|
380
396
|
export declare const userSettingItem: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
381
397
|
type: "sharing";
|
|
382
398
|
grants: {
|
|
@@ -653,6 +669,19 @@ export declare const userSettingItem: import("arktype/internal/variants/object.t
|
|
|
653
669
|
claimId: string;
|
|
654
670
|
}[];
|
|
655
671
|
updatedAt: string;
|
|
672
|
+
} | {
|
|
673
|
+
type: "guestFirstTouch";
|
|
674
|
+
landingPath?: string | undefined;
|
|
675
|
+
referrerHost?: string | undefined;
|
|
676
|
+
utm?: {
|
|
677
|
+
source?: string | undefined;
|
|
678
|
+
medium?: string | undefined;
|
|
679
|
+
campaign?: string | undefined;
|
|
680
|
+
content?: string | undefined;
|
|
681
|
+
term?: string | undefined;
|
|
682
|
+
} | undefined;
|
|
683
|
+
clickIds?: ("fbclid" | "gclid" | "msclkid" | "ttclid")[] | undefined;
|
|
684
|
+
capturedAt: string;
|
|
656
685
|
} | ((In: {
|
|
657
686
|
type: "defaultUserSlug";
|
|
658
687
|
userSlug: string;
|
|
@@ -943,6 +972,19 @@ export declare const reqEnsureUserSettings: import("arktype/internal/variants/ob
|
|
|
943
972
|
claimId: string;
|
|
944
973
|
}[];
|
|
945
974
|
updatedAt: string;
|
|
975
|
+
} | {
|
|
976
|
+
type: "guestFirstTouch";
|
|
977
|
+
landingPath?: string | undefined;
|
|
978
|
+
referrerHost?: string | undefined;
|
|
979
|
+
utm?: {
|
|
980
|
+
source?: string | undefined;
|
|
981
|
+
medium?: string | undefined;
|
|
982
|
+
campaign?: string | undefined;
|
|
983
|
+
content?: string | undefined;
|
|
984
|
+
term?: string | undefined;
|
|
985
|
+
} | undefined;
|
|
986
|
+
clickIds?: ("fbclid" | "gclid" | "msclkid" | "ttclid")[] | undefined;
|
|
987
|
+
capturedAt: string;
|
|
946
988
|
} | ((In: {
|
|
947
989
|
type: "defaultUserSlug";
|
|
948
990
|
userSlug: string;
|
|
@@ -1231,6 +1273,19 @@ export declare const resEnsureUserSettings: import("arktype/internal/variants/ob
|
|
|
1231
1273
|
claimId: string;
|
|
1232
1274
|
}[];
|
|
1233
1275
|
updatedAt: string;
|
|
1276
|
+
} | {
|
|
1277
|
+
type: "guestFirstTouch";
|
|
1278
|
+
landingPath?: string | undefined;
|
|
1279
|
+
referrerHost?: string | undefined;
|
|
1280
|
+
utm?: {
|
|
1281
|
+
source?: string | undefined;
|
|
1282
|
+
medium?: string | undefined;
|
|
1283
|
+
campaign?: string | undefined;
|
|
1284
|
+
content?: string | undefined;
|
|
1285
|
+
term?: string | undefined;
|
|
1286
|
+
} | undefined;
|
|
1287
|
+
clickIds?: ("fbclid" | "gclid" | "msclkid" | "ttclid")[] | undefined;
|
|
1288
|
+
capturedAt: string;
|
|
1234
1289
|
} | ((In: {
|
|
1235
1290
|
type: "defaultUserSlug";
|
|
1236
1291
|
userSlug: string;
|
package/settings.js
CHANGED
|
@@ -307,6 +307,23 @@ export const userSettingPlanAck = lazyType(() => type({
|
|
|
307
307
|
export function isUserSettingPlanAck(obj) {
|
|
308
308
|
return userSettingPlanAck.allows(obj);
|
|
309
309
|
}
|
|
310
|
+
export const userSettingGuestFirstTouch = lazyType(() => type({
|
|
311
|
+
type: "'guestFirstTouch'",
|
|
312
|
+
"landingPath?": "string",
|
|
313
|
+
"referrerHost?": "string",
|
|
314
|
+
"utm?": {
|
|
315
|
+
"source?": "string",
|
|
316
|
+
"medium?": "string",
|
|
317
|
+
"campaign?": "string",
|
|
318
|
+
"content?": "string",
|
|
319
|
+
"term?": "string",
|
|
320
|
+
},
|
|
321
|
+
"clickIds?": "('fbclid'|'gclid'|'msclkid'|'ttclid')[]",
|
|
322
|
+
capturedAt: "string",
|
|
323
|
+
}));
|
|
324
|
+
export function isUserSettingGuestFirstTouch(obj) {
|
|
325
|
+
return userSettingGuestFirstTouch.allows(obj);
|
|
326
|
+
}
|
|
310
327
|
export const userSettingItem = lazyType(() => userSettingShareing
|
|
311
328
|
.or(userSettingModelDefaults)
|
|
312
329
|
.or(userSettingDefaultHandle)
|
|
@@ -331,7 +348,8 @@ export const userSettingItem = lazyType(() => userSettingShareing
|
|
|
331
348
|
.or(userSettingTermsAck)
|
|
332
349
|
.or(userSettingAppHistoryHidden)
|
|
333
350
|
.or(userSettingCreditMilestones)
|
|
334
|
-
.or(userSettingPlanAck)
|
|
351
|
+
.or(userSettingPlanAck)
|
|
352
|
+
.or(userSettingGuestFirstTouch));
|
|
335
353
|
export const reqEnsureUserSettings = lazyType(() => type({
|
|
336
354
|
type: "'vibes.diy.req-ensure-user-settings'",
|
|
337
355
|
auth: dashAuthType,
|
package/text-turn.d.ts
CHANGED
|
@@ -21,6 +21,13 @@ export declare function isReqTextTurn(obj: unknown): obj is ReqTextTurn;
|
|
|
21
21
|
export declare const foldedReplyWire: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
22
22
|
kind: "text";
|
|
23
23
|
text: string;
|
|
24
|
+
effect?: "balloons" | "celebration" | "confetti" | "echo" | "fireworks" | "gentle" | "happy_birthday" | "hearts" | "invisible" | "lasers" | "loud" | "love" | "slam" | "sparkles" | "spotlight" | undefined;
|
|
25
|
+
decorations?: {
|
|
26
|
+
words: string;
|
|
27
|
+
style?: "bold" | "italic" | "strikethrough" | "underline" | undefined;
|
|
28
|
+
animation?: "big" | "bloom" | "explode" | "jitter" | "nod" | "ripple" | "shake" | "small" | undefined;
|
|
29
|
+
}[] | undefined;
|
|
30
|
+
replyToNewest?: boolean | undefined;
|
|
24
31
|
} | {
|
|
25
32
|
kind: "picture";
|
|
26
33
|
url: string;
|
|
@@ -28,11 +35,22 @@ export declare const foldedReplyWire: import("arktype/internal/variants/object.t
|
|
|
28
35
|
name?: string | undefined;
|
|
29
36
|
} | {
|
|
30
37
|
kind: "picture-missed";
|
|
38
|
+
} | {
|
|
39
|
+
kind: "poll";
|
|
40
|
+
question: string;
|
|
41
|
+
options: string[];
|
|
31
42
|
}, {}>;
|
|
32
43
|
export declare const textTurnLine: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
33
44
|
reply: {
|
|
34
45
|
kind: "text";
|
|
35
46
|
text: string;
|
|
47
|
+
effect?: "balloons" | "celebration" | "confetti" | "echo" | "fireworks" | "gentle" | "happy_birthday" | "hearts" | "invisible" | "lasers" | "loud" | "love" | "slam" | "sparkles" | "spotlight" | undefined;
|
|
48
|
+
decorations?: {
|
|
49
|
+
words: string;
|
|
50
|
+
style?: "bold" | "italic" | "strikethrough" | "underline" | undefined;
|
|
51
|
+
animation?: "big" | "bloom" | "explode" | "jitter" | "nod" | "ripple" | "shake" | "small" | undefined;
|
|
52
|
+
}[] | undefined;
|
|
53
|
+
replyToNewest?: boolean | undefined;
|
|
36
54
|
} | {
|
|
37
55
|
kind: "picture";
|
|
38
56
|
url: string;
|
|
@@ -40,6 +58,10 @@ export declare const textTurnLine: import("arktype/internal/variants/object.ts")
|
|
|
40
58
|
name?: string | undefined;
|
|
41
59
|
} | {
|
|
42
60
|
kind: "picture-missed";
|
|
61
|
+
} | {
|
|
62
|
+
kind: "poll";
|
|
63
|
+
question: string;
|
|
64
|
+
options: string[];
|
|
43
65
|
};
|
|
44
66
|
} | {
|
|
45
67
|
done: true;
|
package/text-turn.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type } from "arktype";
|
|
2
2
|
import { VibesFileContent } from "@vibes.diy/call-ai-v2";
|
|
3
3
|
import { lazyType } from "./lazy-type.js";
|
|
4
|
+
import { IMESSAGE_EFFECTS, IMESSAGE_TEXT_ANIMATIONS, IMESSAGE_TEXT_STYLES } from "./agent-imessage.js";
|
|
4
5
|
export const reqTextTurn = lazyType(() => type({
|
|
5
6
|
"+": "reject",
|
|
6
7
|
userId: "string > 0",
|
|
@@ -15,9 +16,20 @@ export const reqTextTurn = lazyType(() => type({
|
|
|
15
16
|
export function isReqTextTurn(obj) {
|
|
16
17
|
return !(reqTextTurn(obj) instanceof type.errors);
|
|
17
18
|
}
|
|
18
|
-
export const foldedReplyWire = lazyType(() => type({
|
|
19
|
+
export const foldedReplyWire = lazyType(() => type({
|
|
20
|
+
kind: "'text'",
|
|
21
|
+
text: "string",
|
|
22
|
+
"effect?": type.enumerated(...IMESSAGE_EFFECTS),
|
|
23
|
+
"decorations?": type({
|
|
24
|
+
words: "string",
|
|
25
|
+
"style?": type.enumerated(...IMESSAGE_TEXT_STYLES),
|
|
26
|
+
"animation?": type.enumerated(...IMESSAGE_TEXT_ANIMATIONS),
|
|
27
|
+
}).array(),
|
|
28
|
+
"replyToNewest?": "boolean",
|
|
29
|
+
})
|
|
19
30
|
.or({ kind: "'picture'", url: "string", mimeType: "string", "name?": "string" })
|
|
20
|
-
.or({ kind: "'picture-missed'" })
|
|
31
|
+
.or({ kind: "'picture-missed'" })
|
|
32
|
+
.or({ kind: "'poll'", question: "string", options: "string[]" }));
|
|
21
33
|
export const textTurnLine = lazyType(() => type({ "+": "reject", reply: foldedReplyWire })
|
|
22
34
|
.or({ "+": "reject", done: "true", chatId: "string" })
|
|
23
35
|
.or({ "+": "reject", error: "string", "detail?": "string" })
|