@vibes.diy/api-types 14.3.352 → 14.3.354

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.
@@ -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
+ }
@@ -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
  };
@@ -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/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,11 +21,13 @@ 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;
27
28
  subject?: string | undefined;
28
29
  text?: string | undefined;
30
+ campaign?: string | undefined;
29
31
  link?: string | undefined;
30
32
  recipient?: string | undefined;
31
33
  bounceType?: string | undefined;
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,11 +20,13 @@ 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",
26
27
  "subject?": "string",
27
28
  "text?": "string",
29
+ "campaign?": "string",
28
30
  "link?": "string",
29
31
  "recipient?": "string",
30
32
  "bounceType?": "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";
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";
package/invite-flow.d.ts CHANGED
@@ -8,6 +8,53 @@ export declare const KeyGrantKey: import("arktype/internal/variants/object.ts").
8
8
  export type KeyGrantKey = typeof KeyGrantKey.infer;
9
9
  export declare const ResKeyGrantItem: import("arktype/internal/variants/object.ts").ObjectType<{
10
10
  entry: {
11
+ type: "app.acl.active.request";
12
+ role: "viewer";
13
+ state: "pending";
14
+ request: {
15
+ key: string;
16
+ provider: "clerk" | "github" | "google";
17
+ msg?: string | undefined;
18
+ userId: string;
19
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
20
+ };
21
+ } | {
22
+ type: "app.acl.active.request";
23
+ role: "editor" | "submitter" | "viewer";
24
+ state: "approved";
25
+ request: {
26
+ key: string;
27
+ provider: "clerk" | "github" | "google";
28
+ msg?: string | undefined;
29
+ userId: string;
30
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
31
+ };
32
+ tick: {
33
+ count: number;
34
+ last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
35
+ };
36
+ grant: {
37
+ ownerId: string;
38
+ key?: string | undefined;
39
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
40
+ };
41
+ } | {
42
+ type: "app.acl.active.request";
43
+ role: "editor" | "submitter" | "viewer";
44
+ state: "rejected";
45
+ request: {
46
+ key: string;
47
+ provider: "clerk" | "github" | "google";
48
+ msg?: string | undefined;
49
+ userId: string;
50
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
51
+ };
52
+ grant: {
53
+ ownerId: string;
54
+ key?: string | undefined;
55
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
56
+ };
57
+ } | {
11
58
  type: "app.acl.active.invite";
12
59
  role: "editor";
13
60
  state: "pending";
@@ -93,53 +140,6 @@ export declare const ResKeyGrantItem: import("arktype/internal/variants/object.t
93
140
  count: number;
94
141
  last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
95
142
  };
96
- } | {
97
- type: "app.acl.active.request";
98
- role: "viewer";
99
- state: "pending";
100
- request: {
101
- key: string;
102
- provider: "clerk" | "github" | "google";
103
- msg?: string | undefined;
104
- userId: string;
105
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
106
- };
107
- } | {
108
- type: "app.acl.active.request";
109
- role: "editor" | "submitter" | "viewer";
110
- state: "approved";
111
- request: {
112
- key: string;
113
- provider: "clerk" | "github" | "google";
114
- msg?: string | undefined;
115
- userId: string;
116
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
117
- };
118
- tick: {
119
- count: number;
120
- last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
121
- };
122
- grant: {
123
- ownerId: string;
124
- key?: string | undefined;
125
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
126
- };
127
- } | {
128
- type: "app.acl.active.request";
129
- role: "editor" | "submitter" | "viewer";
130
- state: "rejected";
131
- request: {
132
- key: string;
133
- provider: "clerk" | "github" | "google";
134
- msg?: string | undefined;
135
- userId: string;
136
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
137
- };
138
- grant: {
139
- ownerId: string;
140
- key?: string | undefined;
141
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
142
- };
143
143
  };
144
144
  grantUserId?: string | undefined;
145
145
  grantType: "invite" | "request";
@@ -168,6 +168,53 @@ export declare const ResListKeyGrants: import("arktype/internal/variants/object.
168
168
  items: {
169
169
  key: string;
170
170
  entry: {
171
+ type: "app.acl.active.request";
172
+ role: "viewer";
173
+ state: "pending";
174
+ request: {
175
+ key: string;
176
+ provider: "clerk" | "github" | "google";
177
+ msg?: string | undefined;
178
+ userId: string;
179
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
180
+ };
181
+ } | {
182
+ type: "app.acl.active.request";
183
+ role: "editor" | "submitter" | "viewer";
184
+ state: "approved";
185
+ request: {
186
+ key: string;
187
+ provider: "clerk" | "github" | "google";
188
+ msg?: string | undefined;
189
+ userId: string;
190
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
191
+ };
192
+ tick: {
193
+ count: number;
194
+ last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
195
+ };
196
+ grant: {
197
+ ownerId: string;
198
+ key?: string | undefined;
199
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
200
+ };
201
+ } | {
202
+ type: "app.acl.active.request";
203
+ role: "editor" | "submitter" | "viewer";
204
+ state: "rejected";
205
+ request: {
206
+ key: string;
207
+ provider: "clerk" | "github" | "google";
208
+ msg?: string | undefined;
209
+ userId: string;
210
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
211
+ };
212
+ grant: {
213
+ ownerId: string;
214
+ key?: string | undefined;
215
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
216
+ };
217
+ } | {
171
218
  type: "app.acl.active.invite";
172
219
  role: "editor";
173
220
  state: "pending";
@@ -253,53 +300,6 @@ export declare const ResListKeyGrants: import("arktype/internal/variants/object.
253
300
  count: number;
254
301
  last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
255
302
  };
256
- } | {
257
- type: "app.acl.active.request";
258
- role: "viewer";
259
- state: "pending";
260
- request: {
261
- key: string;
262
- provider: "clerk" | "github" | "google";
263
- msg?: string | undefined;
264
- userId: string;
265
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
266
- };
267
- } | {
268
- type: "app.acl.active.request";
269
- role: "editor" | "submitter" | "viewer";
270
- state: "approved";
271
- request: {
272
- key: string;
273
- provider: "clerk" | "github" | "google";
274
- msg?: string | undefined;
275
- userId: string;
276
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
277
- };
278
- tick: {
279
- count: number;
280
- last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
281
- };
282
- grant: {
283
- ownerId: string;
284
- key?: string | undefined;
285
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
286
- };
287
- } | {
288
- type: "app.acl.active.request";
289
- role: "editor" | "submitter" | "viewer";
290
- state: "rejected";
291
- request: {
292
- key: string;
293
- provider: "clerk" | "github" | "google";
294
- msg?: string | undefined;
295
- userId: string;
296
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
297
- };
298
- grant: {
299
- ownerId: string;
300
- key?: string | undefined;
301
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
302
- };
303
303
  };
304
304
  grantUserId?: string | undefined;
305
305
  updated: string;
@@ -321,6 +321,53 @@ export declare const ReqUpsertKeyGrant: import("arktype/internal/variants/object
321
321
  appSlug: string;
322
322
  ownerHandle: string;
323
323
  entry: {
324
+ type: "app.acl.active.request";
325
+ role: "viewer";
326
+ state: "pending";
327
+ request: {
328
+ key: string;
329
+ provider: "clerk" | "github" | "google";
330
+ msg?: string | undefined;
331
+ userId: string;
332
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
333
+ };
334
+ } | {
335
+ type: "app.acl.active.request";
336
+ role: "editor" | "submitter" | "viewer";
337
+ state: "approved";
338
+ request: {
339
+ key: string;
340
+ provider: "clerk" | "github" | "google";
341
+ msg?: string | undefined;
342
+ userId: string;
343
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
344
+ };
345
+ tick: {
346
+ count: number;
347
+ last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
348
+ };
349
+ grant: {
350
+ ownerId: string;
351
+ key?: string | undefined;
352
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
353
+ };
354
+ } | {
355
+ type: "app.acl.active.request";
356
+ role: "editor" | "submitter" | "viewer";
357
+ state: "rejected";
358
+ request: {
359
+ key: string;
360
+ provider: "clerk" | "github" | "google";
361
+ msg?: string | undefined;
362
+ userId: string;
363
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
364
+ };
365
+ grant: {
366
+ ownerId: string;
367
+ key?: string | undefined;
368
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
369
+ };
370
+ } | {
324
371
  type: "app.acl.active.invite";
325
372
  role: "editor";
326
373
  state: "pending";
@@ -406,7 +453,16 @@ export declare const ReqUpsertKeyGrant: import("arktype/internal/variants/object
406
453
  count: number;
407
454
  last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
408
455
  };
409
- } | {
456
+ };
457
+ }, {}>;
458
+ export type ReqUpsertKeyGrant = typeof ReqUpsertKeyGrant.infer;
459
+ export declare function isReqUpsertKeyGrant(obj: unknown): obj is ReqUpsertKeyGrant;
460
+ export declare const ResUpsertKeyGrant: import("arktype/internal/variants/object.ts").ObjectType<{
461
+ appSlug: string;
462
+ ownerHandle: string;
463
+ grantType: "invite" | "request";
464
+ key: string;
465
+ entry: {
410
466
  type: "app.acl.active.request";
411
467
  role: "viewer";
412
468
  state: "pending";
@@ -453,16 +509,7 @@ export declare const ReqUpsertKeyGrant: import("arktype/internal/variants/object
453
509
  key?: string | undefined;
454
510
  on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
455
511
  };
456
- };
457
- }, {}>;
458
- export type ReqUpsertKeyGrant = typeof ReqUpsertKeyGrant.infer;
459
- export declare function isReqUpsertKeyGrant(obj: unknown): obj is ReqUpsertKeyGrant;
460
- export declare const ResUpsertKeyGrant: import("arktype/internal/variants/object.ts").ObjectType<{
461
- appSlug: string;
462
- ownerHandle: string;
463
- grantType: "invite" | "request";
464
- key: string;
465
- entry: {
512
+ } | {
466
513
  type: "app.acl.active.invite";
467
514
  role: "editor";
468
515
  state: "pending";
@@ -548,53 +595,6 @@ export declare const ResUpsertKeyGrant: import("arktype/internal/variants/object
548
595
  count: number;
549
596
  last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
550
597
  };
551
- } | {
552
- type: "app.acl.active.request";
553
- role: "viewer";
554
- state: "pending";
555
- request: {
556
- key: string;
557
- provider: "clerk" | "github" | "google";
558
- msg?: string | undefined;
559
- userId: string;
560
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
561
- };
562
- } | {
563
- type: "app.acl.active.request";
564
- role: "editor" | "submitter" | "viewer";
565
- state: "approved";
566
- request: {
567
- key: string;
568
- provider: "clerk" | "github" | "google";
569
- msg?: string | undefined;
570
- userId: string;
571
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
572
- };
573
- tick: {
574
- count: number;
575
- last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
576
- };
577
- grant: {
578
- ownerId: string;
579
- key?: string | undefined;
580
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
581
- };
582
- } | {
583
- type: "app.acl.active.request";
584
- role: "editor" | "submitter" | "viewer";
585
- state: "rejected";
586
- request: {
587
- key: string;
588
- provider: "clerk" | "github" | "google";
589
- msg?: string | undefined;
590
- userId: string;
591
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
592
- };
593
- grant: {
594
- ownerId: string;
595
- key?: string | undefined;
596
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
597
- };
598
598
  };
599
599
  grantUserId?: string | undefined;
600
600
  updated: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/api-types",
3
- "version": "14.3.352",
3
+ "version": "14.3.354",
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.352",
29
- "@vibes.diy/identity": "14.3.352",
30
- "@vibes.diy/vibe-types": "14.3.352",
28
+ "@vibes.diy/call-ai-v2": "14.3.354",
29
+ "@vibes.diy/identity": "14.3.354",
30
+ "@vibes.diy/vibe-types": "14.3.354",
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({ kind: "'text'", text: "string" })
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" })