@allyhub/sdk 0.15.3 → 0.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/CHANGELOG.md +9 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +30 -4
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +15 -4
- package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +2 -0
- package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +10 -5
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +7 -0
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +9 -0
- package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +77 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +39 -9
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +15 -15
- package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +441 -5
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -2
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +8 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +5 -5
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +15 -0
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +134 -0
- package/dist/node_modules/@allyhub/protocol/dist/paywall.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +3 -3
- package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +47 -0
- package/dist/node_modules/@allyhub/protocol/dist/purposes.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +52 -5
- package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +34 -0
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +21 -52
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +264 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +18 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +97 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +3 -2
- package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +20 -20
- package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +71 -0
- package/dist/node_modules/@allyhub/protocol/dist/turns.js +2 -0
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/docs/batches.md +4 -4
- package/docs/contract.md +5 -5
- package/docs/defaults.md +2 -2
- package/docs/docs.md +5 -5
- package/docs/footage.md +8 -8
- package/docs/image.md +5 -5
- package/docs/layers.md +10 -10
- package/docs/linkedin.md +1 -1
- package/docs/modeling.md +3 -3
- package/docs/pictures.md +4 -4
- package/docs/project.md +11 -7
- package/docs/scenery.md +3 -3
- package/docs/sheets.md +5 -5
- package/docs/slides.md +2 -2
- package/docs/sound.md +7 -7
- package/docs/speech.md +7 -7
- package/docs/video.md +3 -3
- package/docs/websites.md +3 -3
- package/docs/x.md +2 -2
- package/package.json +1 -1
|
@@ -11,10 +11,43 @@ export declare const EVENTS_AT_MOST = 100;
|
|
|
11
11
|
export declare const EventWordSchema: z.ZodString;
|
|
12
12
|
/** An id a program made: a project's, a session's. Random, never a name. */
|
|
13
13
|
export declare const EventIdSchema: z.ZodString;
|
|
14
|
+
/** A language as a message's label gives it: an ISO 639-1 code, two lower-case letters. */
|
|
15
|
+
export declare const EventLanguageSchema: z.ZodString;
|
|
16
|
+
/** A country as Stripe gives it: an ISO 3166-1 alpha-2 code, two upper-case letters. */
|
|
17
|
+
export declare const EventCountrySchema: z.ZodString;
|
|
14
18
|
/** A W3C trace id: 32 lower-case hex digits. */
|
|
15
19
|
export declare const EventTraceIdSchema: z.ZodString;
|
|
16
20
|
/** A route's pattern (`/api/tools/:name/calls`), never a path with its ids. */
|
|
17
21
|
export declare const EventRouteSchema: z.ZodString;
|
|
22
|
+
/** The console Home's three ways to use AllyHub (`home_product_chosen`). */
|
|
23
|
+
export declare const WINDOW_PRODUCTS: readonly ["agents", "desktop", "cloud"];
|
|
24
|
+
export type WindowProduct = (typeof WINDOW_PRODUCTS)[number];
|
|
25
|
+
/**
|
|
26
|
+
* Where an upgrade or a buy-credits action was pressed (`upgrade_clicked`):
|
|
27
|
+
* the sidebar's low-credit offer, Settings' plan page, the card of a call
|
|
28
|
+
* refused for credits or a plan in the conversation, Read only's Buy credits
|
|
29
|
+
* when a resume was refused for credits, and the paywall: the dialog every
|
|
30
|
+
* refusal for what buying fixes opens (docs/design/paywall.md), which takes
|
|
31
|
+
* the card's place.
|
|
32
|
+
*/
|
|
33
|
+
export declare const UPGRADE_PLACES: readonly ["sidebar_offer", "plan_settings", "refusal_card", "read_only_chip", "paywall"];
|
|
34
|
+
export type UpgradePlace = (typeof UPGRADE_PLACES)[number];
|
|
35
|
+
/** Why the paywall opened (`paywall_shown`): something was refused, or the person pressed its reminder in the sidebar. */
|
|
36
|
+
export declare const PAYWALL_TRIGGERS: readonly ["refused", "reminder", "locked"];
|
|
37
|
+
export type PaywallTrigger = (typeof PAYWALL_TRIGGERS)[number];
|
|
38
|
+
/** The few pages whose arrivals are told (`page_viewed`). */
|
|
39
|
+
export declare const WINDOW_PAGES: readonly ["console_home", "cloud_studio", "plan_settings"];
|
|
40
|
+
export type WindowPage = (typeof WINDOW_PAGES)[number];
|
|
41
|
+
/** What a person goes to Stripe's Checkout for: a plan, credits, or a card saved for auto top-up. */
|
|
42
|
+
export declare const CHECKOUT_WHATS: readonly ["plan", "top_up", "card"];
|
|
43
|
+
export type CheckoutWhat = (typeof CHECKOUT_WHATS)[number];
|
|
44
|
+
/**
|
|
45
|
+
* What stopped a person who came back from Stripe's Checkout without
|
|
46
|
+
* paying, as they answered (`checkout_abandoned`): the price, no payment
|
|
47
|
+
* method they can use, just looking, something else.
|
|
48
|
+
*/
|
|
49
|
+
export declare const CHECKOUT_LEFT_REASONS: readonly ["price", "payment_method", "just_looking", "other"];
|
|
50
|
+
export type CheckoutLeftReason = (typeof CHECKOUT_LEFT_REASONS)[number];
|
|
18
51
|
/** Each event's properties, by its name. */
|
|
19
52
|
export declare const EVENT_PROPS: {
|
|
20
53
|
/** A program started: Studio, the CLI on its first command of a day. */
|
|
@@ -39,12 +72,17 @@ export declare const EVENT_PROPS: {
|
|
|
39
72
|
readonly session_started: z.ZodObject<{
|
|
40
73
|
agent: z.ZodString;
|
|
41
74
|
}, z.core.$strict>;
|
|
75
|
+
/** A turn began: a prompt was sent to the agent. Never a word of the prompt: that is the turn's record's (turns.ts), not telemetry's. */
|
|
76
|
+
readonly turn_started: z.ZodObject<{
|
|
77
|
+
agent: z.ZodString;
|
|
78
|
+
}, z.core.$strict>;
|
|
42
79
|
/** A turn ended: a prompt, and all the agent did to answer it. */
|
|
43
80
|
readonly turn_finished: z.ZodObject<{
|
|
44
81
|
agent: z.ZodString;
|
|
45
82
|
durationMs: z.ZodNumber;
|
|
46
83
|
ended: z.ZodString;
|
|
47
84
|
changed: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
85
|
+
made: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
48
86
|
}, z.core.$strict>;
|
|
49
87
|
/** Work Studio did ended (@allyhub/jobs): an export, a publish, an install, a download. */
|
|
50
88
|
readonly job_finished: z.ZodObject<{
|
|
@@ -53,8 +91,8 @@ export declare const EVENT_PROPS: {
|
|
|
53
91
|
kind: z.ZodOptional<z.ZodString>;
|
|
54
92
|
durationMs: z.ZodNumber;
|
|
55
93
|
outcome: z.ZodEnum<{
|
|
56
|
-
failed: "failed";
|
|
57
94
|
done: "done";
|
|
95
|
+
failed: "failed";
|
|
58
96
|
cancelled: "cancelled";
|
|
59
97
|
}>;
|
|
60
98
|
}, z.core.$strict>;
|
|
@@ -63,25 +101,92 @@ export declare const EVENT_PROPS: {
|
|
|
63
101
|
command: z.ZodString;
|
|
64
102
|
durationMs: z.ZodNumber;
|
|
65
103
|
exit: z.ZodNumber;
|
|
104
|
+
code: z.ZodOptional<z.ZodString>;
|
|
66
105
|
}, z.core.$strict>;
|
|
67
106
|
/** A refusal was shown to the person. */
|
|
68
107
|
readonly refusal_shown: z.ZodObject<{
|
|
69
108
|
code: z.ZodString;
|
|
70
109
|
where: z.ZodString;
|
|
71
110
|
}, z.core.$strict>;
|
|
111
|
+
/** The person pressed the action of one of the console Home's three ways to use AllyHub. */
|
|
112
|
+
readonly home_product_chosen: z.ZodObject<{
|
|
113
|
+
product: z.ZodEnum<{
|
|
114
|
+
desktop: "desktop";
|
|
115
|
+
agents: "agents";
|
|
116
|
+
cloud: "cloud";
|
|
117
|
+
}>;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
/** The person opened an item or a plain file from the sidebar's tree themselves (a click, or the keyboard). */
|
|
120
|
+
readonly item_opened_from_sidebar: z.ZodObject<{
|
|
121
|
+
kind: z.ZodString;
|
|
122
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
123
|
+
}, z.core.$strict>;
|
|
124
|
+
/** A file the person asked for from the header's Download was given to the browser (or, for a format made in the editor's page, made for it to download: 4.13). */
|
|
125
|
+
readonly file_downloaded: z.ZodObject<{
|
|
126
|
+
kind: z.ZodString;
|
|
127
|
+
format: z.ZodString;
|
|
128
|
+
paused: z.ZodBoolean;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
/** The person opened the header's Share panel. */
|
|
131
|
+
readonly share_opened: z.ZodObject<{
|
|
132
|
+
kind: z.ZodString;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
/** The person pressed an upgrade or a buy-credits action. */
|
|
135
|
+
readonly upgrade_clicked: z.ZodObject<{
|
|
136
|
+
where: z.ZodEnum<{
|
|
137
|
+
sidebar_offer: "sidebar_offer";
|
|
138
|
+
plan_settings: "plan_settings";
|
|
139
|
+
refusal_card: "refusal_card";
|
|
140
|
+
read_only_chip: "read_only_chip";
|
|
141
|
+
paywall: "paywall";
|
|
142
|
+
}>;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
/** The person arrived at one of the few pages that matter: once an arrival, not at every drawing. */
|
|
145
|
+
readonly page_viewed: z.ZodObject<{
|
|
146
|
+
page: z.ZodEnum<{
|
|
147
|
+
plan_settings: "plan_settings";
|
|
148
|
+
console_home: "console_home";
|
|
149
|
+
cloud_studio: "cloud_studio";
|
|
150
|
+
}>;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
/** The paywall opened (docs/design/paywall.md): why AllyHub refused (`insufficient_credits`, `plan_required`, `storage_full`), what it refused (`model`, `save`…), and whether a refusal or its reminder opened it. */
|
|
153
|
+
readonly paywall_shown: z.ZodObject<{
|
|
154
|
+
reason: z.ZodString;
|
|
155
|
+
what: z.ZodString;
|
|
156
|
+
trigger: z.ZodEnum<{
|
|
157
|
+
refused: "refused";
|
|
158
|
+
reminder: "reminder";
|
|
159
|
+
locked: "locked";
|
|
160
|
+
}>;
|
|
161
|
+
}, z.core.$strict>;
|
|
162
|
+
/** The person came back from Stripe's Checkout without paying (its way back) and answered what stopped them, or skipped the question (no `reason`). */
|
|
163
|
+
readonly checkout_abandoned: z.ZodObject<{
|
|
164
|
+
what: z.ZodEnum<{
|
|
165
|
+
plan: "plan";
|
|
166
|
+
top_up: "top_up";
|
|
167
|
+
card: "card";
|
|
168
|
+
}>;
|
|
169
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
170
|
+
other: "other";
|
|
171
|
+
price: "price";
|
|
172
|
+
payment_method: "payment_method";
|
|
173
|
+
just_looking: "just_looking";
|
|
174
|
+
}>>;
|
|
175
|
+
}, z.core.$strict>;
|
|
72
176
|
/** A person's first organization was made: they signed up. */
|
|
73
177
|
readonly account_created: z.ZodObject<{}, z.core.$strict>;
|
|
74
178
|
/** The service refused a call for credits, a plan, a limit or a tool turned off, or a file for the organization's cap. */
|
|
75
179
|
readonly refusal_met: z.ZodObject<{
|
|
76
180
|
code: z.ZodString;
|
|
77
181
|
route: z.ZodString;
|
|
182
|
+
background: z.ZodOptional<z.ZodBoolean>;
|
|
78
183
|
}, z.core.$strict>;
|
|
79
184
|
/** A person went to pay. */
|
|
80
185
|
readonly checkout_started: z.ZodObject<{
|
|
81
186
|
what: z.ZodEnum<{
|
|
82
187
|
plan: "plan";
|
|
83
|
-
card: "card";
|
|
84
188
|
top_up: "top_up";
|
|
189
|
+
card: "card";
|
|
85
190
|
}>;
|
|
86
191
|
plan: z.ZodOptional<z.ZodString>;
|
|
87
192
|
interval: z.ZodOptional<z.ZodString>;
|
|
@@ -93,12 +198,75 @@ export declare const EVENT_PROPS: {
|
|
|
93
198
|
top_up: "top_up";
|
|
94
199
|
}>;
|
|
95
200
|
plan: z.ZodOptional<z.ZodString>;
|
|
201
|
+
amount_cents: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
/** A Checkout Session ended unpaid: Stripe let it expire (a day after it was opened, by default). Once a session. */
|
|
205
|
+
readonly checkout_expired: z.ZodObject<{
|
|
206
|
+
what: z.ZodEnum<{
|
|
207
|
+
plan: "plan";
|
|
208
|
+
top_up: "top_up";
|
|
209
|
+
card: "card";
|
|
210
|
+
}>;
|
|
211
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
212
|
+
interval: z.ZodOptional<z.ZodString>;
|
|
213
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
214
|
+
country: z.ZodOptional<z.ZodString>;
|
|
96
215
|
}, z.core.$strict>;
|
|
97
216
|
/** A share was made. */
|
|
98
217
|
readonly share_made: z.ZodObject<{
|
|
99
218
|
kind: z.ZodString;
|
|
100
219
|
audience: z.ZodString;
|
|
101
220
|
}, z.core.$strict>;
|
|
221
|
+
/**
|
|
222
|
+
* A person opened Studio: once ever (`first`), then at most once a day
|
|
223
|
+
* (UTC), so a day they opened it and wrote nothing is still a day seen.
|
|
224
|
+
* Recorded by the service as the window asks for the person's cloud
|
|
225
|
+
* computer to be made or resumed.
|
|
226
|
+
*/
|
|
227
|
+
readonly studio_opened: z.ZodObject<{
|
|
228
|
+
where: z.ZodEnum<{
|
|
229
|
+
cloud: "cloud";
|
|
230
|
+
computer: "computer";
|
|
231
|
+
}>;
|
|
232
|
+
first: z.ZodBoolean;
|
|
233
|
+
}, z.core.$strict>;
|
|
234
|
+
/**
|
|
235
|
+
* A person's first turn that ended as the agent meant it to (`end_turn`)
|
|
236
|
+
* and changed or made something: once a person, ever.
|
|
237
|
+
*/
|
|
238
|
+
readonly activated: z.ZodObject<{
|
|
239
|
+
turns_before: z.ZodNumber;
|
|
240
|
+
hours_since_sign_up: z.ZodNumber;
|
|
241
|
+
}, z.core.$strict>;
|
|
242
|
+
/** A person's message's labels (purposes.ts), read on the server from the turn's record: what it asked for, its language, how they sounded and, when it went badly, what about. Never a word of the message. */
|
|
243
|
+
readonly turn_classified: z.ZodObject<{
|
|
244
|
+
purpose: z.ZodEnum<{
|
|
245
|
+
research_social: "research_social";
|
|
246
|
+
research_market: "research_market";
|
|
247
|
+
document: "document";
|
|
248
|
+
media: "media";
|
|
249
|
+
writing: "writing";
|
|
250
|
+
browse_act: "browse_act";
|
|
251
|
+
question: "question";
|
|
252
|
+
other: "other";
|
|
253
|
+
}>;
|
|
254
|
+
language: z.ZodOptional<z.ZodString>;
|
|
255
|
+
mood: z.ZodOptional<z.ZodEnum<{
|
|
256
|
+
pleased: "pleased";
|
|
257
|
+
neutral: "neutral";
|
|
258
|
+
confused: "confused";
|
|
259
|
+
frustrated: "frustrated";
|
|
260
|
+
}>>;
|
|
261
|
+
trouble: z.ZodOptional<z.ZodEnum<{
|
|
262
|
+
access: "access";
|
|
263
|
+
other: "other";
|
|
264
|
+
result: "result";
|
|
265
|
+
speed: "speed";
|
|
266
|
+
cost: "cost";
|
|
267
|
+
ability: "ability";
|
|
268
|
+
}>>;
|
|
269
|
+
}, z.core.$strict>;
|
|
102
270
|
};
|
|
103
271
|
export type EventName = keyof typeof EVENT_PROPS;
|
|
104
272
|
/**
|
|
@@ -108,8 +276,16 @@ export type EventName = keyof typeof EVENT_PROPS;
|
|
|
108
276
|
*/
|
|
109
277
|
export declare const EVENT_ABOUT: Record<EventName, string>;
|
|
110
278
|
/** The events a client may send; the rest are the server's own to record. */
|
|
111
|
-
export declare const CLIENT_EVENTS: readonly ["program_opened", "project_opened", "item_opened", "session_started", "turn_finished", "job_finished", "command_ran", "refusal_shown"];
|
|
279
|
+
export declare const CLIENT_EVENTS: readonly ["program_opened", "project_opened", "item_opened", "session_started", "turn_started", "turn_finished", "job_finished", "command_ran", "refusal_shown"];
|
|
112
280
|
export type ClientEventName = (typeof CLIENT_EVENTS)[number];
|
|
281
|
+
/**
|
|
282
|
+
* The events the window on AllyHub's site may send with the person's own
|
|
283
|
+
* session (a browser's cookie): a few clicks and page views, and nothing a
|
|
284
|
+
* program tells. A session sends these alone; a program's sign-in sends the
|
|
285
|
+
* clients' events alone.
|
|
286
|
+
*/
|
|
287
|
+
export declare const WINDOW_EVENTS: readonly ["home_product_chosen", "item_opened_from_sidebar", "file_downloaded", "share_opened", "upgrade_clicked", "page_viewed", "paywall_shown", "checkout_abandoned"];
|
|
288
|
+
export type WindowEventName = (typeof WINDOW_EVENTS)[number];
|
|
113
289
|
/** An event's properties. */
|
|
114
290
|
export type EventProps<N extends EventName> = z.infer<(typeof EVENT_PROPS)[N]>;
|
|
115
291
|
/** An event as a client sends it. */
|
|
@@ -159,6 +335,16 @@ export declare const ClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
159
335
|
projectId: z.ZodOptional<z.ZodString>;
|
|
160
336
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
161
337
|
traceId: z.ZodOptional<z.ZodString>;
|
|
338
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
339
|
+
name: z.ZodLiteral<"turn_started">;
|
|
340
|
+
props: z.ZodObject<{
|
|
341
|
+
agent: z.ZodString;
|
|
342
|
+
}, z.core.$strict>;
|
|
343
|
+
id: z.ZodUUID;
|
|
344
|
+
at: z.ZodISODateTime;
|
|
345
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
346
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
347
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
162
348
|
}, z.core.$strict>, z.ZodObject<{
|
|
163
349
|
name: z.ZodLiteral<"turn_finished">;
|
|
164
350
|
props: z.ZodObject<{
|
|
@@ -166,6 +352,7 @@ export declare const ClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
166
352
|
durationMs: z.ZodNumber;
|
|
167
353
|
ended: z.ZodString;
|
|
168
354
|
changed: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
355
|
+
made: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
169
356
|
}, z.core.$strict>;
|
|
170
357
|
id: z.ZodUUID;
|
|
171
358
|
at: z.ZodISODateTime;
|
|
@@ -180,8 +367,8 @@ export declare const ClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
180
367
|
kind: z.ZodOptional<z.ZodString>;
|
|
181
368
|
durationMs: z.ZodNumber;
|
|
182
369
|
outcome: z.ZodEnum<{
|
|
183
|
-
failed: "failed";
|
|
184
370
|
done: "done";
|
|
371
|
+
failed: "failed";
|
|
185
372
|
cancelled: "cancelled";
|
|
186
373
|
}>;
|
|
187
374
|
}, z.core.$strict>;
|
|
@@ -196,6 +383,7 @@ export declare const ClientEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
196
383
|
command: z.ZodString;
|
|
197
384
|
durationMs: z.ZodNumber;
|
|
198
385
|
exit: z.ZodNumber;
|
|
386
|
+
code: z.ZodOptional<z.ZodString>;
|
|
199
387
|
}, z.core.$strict>;
|
|
200
388
|
id: z.ZodUUID;
|
|
201
389
|
at: z.ZodISODateTime;
|
|
@@ -263,6 +451,16 @@ export declare const EventsRequestSchema: z.ZodObject<{
|
|
|
263
451
|
projectId: z.ZodOptional<z.ZodString>;
|
|
264
452
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
265
453
|
traceId: z.ZodOptional<z.ZodString>;
|
|
454
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
455
|
+
name: z.ZodLiteral<"turn_started">;
|
|
456
|
+
props: z.ZodObject<{
|
|
457
|
+
agent: z.ZodString;
|
|
458
|
+
}, z.core.$strict>;
|
|
459
|
+
id: z.ZodUUID;
|
|
460
|
+
at: z.ZodISODateTime;
|
|
461
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
462
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
463
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
266
464
|
}, z.core.$strict>, z.ZodObject<{
|
|
267
465
|
name: z.ZodLiteral<"turn_finished">;
|
|
268
466
|
props: z.ZodObject<{
|
|
@@ -270,6 +468,7 @@ export declare const EventsRequestSchema: z.ZodObject<{
|
|
|
270
468
|
durationMs: z.ZodNumber;
|
|
271
469
|
ended: z.ZodString;
|
|
272
470
|
changed: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
471
|
+
made: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
273
472
|
}, z.core.$strict>;
|
|
274
473
|
id: z.ZodUUID;
|
|
275
474
|
at: z.ZodISODateTime;
|
|
@@ -284,8 +483,8 @@ export declare const EventsRequestSchema: z.ZodObject<{
|
|
|
284
483
|
kind: z.ZodOptional<z.ZodString>;
|
|
285
484
|
durationMs: z.ZodNumber;
|
|
286
485
|
outcome: z.ZodEnum<{
|
|
287
|
-
failed: "failed";
|
|
288
486
|
done: "done";
|
|
487
|
+
failed: "failed";
|
|
289
488
|
cancelled: "cancelled";
|
|
290
489
|
}>;
|
|
291
490
|
}, z.core.$strict>;
|
|
@@ -300,6 +499,7 @@ export declare const EventsRequestSchema: z.ZodObject<{
|
|
|
300
499
|
command: z.ZodString;
|
|
301
500
|
durationMs: z.ZodNumber;
|
|
302
501
|
exit: z.ZodNumber;
|
|
502
|
+
code: z.ZodOptional<z.ZodString>;
|
|
303
503
|
}, z.core.$strict>;
|
|
304
504
|
id: z.ZodUUID;
|
|
305
505
|
at: z.ZodISODateTime;
|
|
@@ -320,6 +520,242 @@ export declare const EventsRequestSchema: z.ZodObject<{
|
|
|
320
520
|
}, z.core.$strict>], "name">>;
|
|
321
521
|
}, z.core.$strict>;
|
|
322
522
|
export type EventsRequest = z.infer<typeof EventsRequestSchema>;
|
|
523
|
+
/** An event as the window on AllyHub's site sends it. */
|
|
524
|
+
export declare const WindowEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
525
|
+
name: z.ZodLiteral<"home_product_chosen">;
|
|
526
|
+
props: z.ZodObject<{
|
|
527
|
+
product: z.ZodEnum<{
|
|
528
|
+
desktop: "desktop";
|
|
529
|
+
agents: "agents";
|
|
530
|
+
cloud: "cloud";
|
|
531
|
+
}>;
|
|
532
|
+
}, z.core.$strict>;
|
|
533
|
+
id: z.ZodUUID;
|
|
534
|
+
at: z.ZodISODateTime;
|
|
535
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
536
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
537
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
538
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
539
|
+
name: z.ZodLiteral<"item_opened_from_sidebar">;
|
|
540
|
+
props: z.ZodObject<{
|
|
541
|
+
kind: z.ZodString;
|
|
542
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
543
|
+
}, z.core.$strict>;
|
|
544
|
+
id: z.ZodUUID;
|
|
545
|
+
at: z.ZodISODateTime;
|
|
546
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
547
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
548
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
549
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
550
|
+
name: z.ZodLiteral<"file_downloaded">;
|
|
551
|
+
props: z.ZodObject<{
|
|
552
|
+
kind: z.ZodString;
|
|
553
|
+
format: z.ZodString;
|
|
554
|
+
paused: z.ZodBoolean;
|
|
555
|
+
}, z.core.$strict>;
|
|
556
|
+
id: z.ZodUUID;
|
|
557
|
+
at: z.ZodISODateTime;
|
|
558
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
559
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
560
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
561
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
562
|
+
name: z.ZodLiteral<"share_opened">;
|
|
563
|
+
props: z.ZodObject<{
|
|
564
|
+
kind: z.ZodString;
|
|
565
|
+
}, z.core.$strict>;
|
|
566
|
+
id: z.ZodUUID;
|
|
567
|
+
at: z.ZodISODateTime;
|
|
568
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
569
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
570
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
571
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
572
|
+
name: z.ZodLiteral<"upgrade_clicked">;
|
|
573
|
+
props: z.ZodObject<{
|
|
574
|
+
where: z.ZodEnum<{
|
|
575
|
+
sidebar_offer: "sidebar_offer";
|
|
576
|
+
plan_settings: "plan_settings";
|
|
577
|
+
refusal_card: "refusal_card";
|
|
578
|
+
read_only_chip: "read_only_chip";
|
|
579
|
+
paywall: "paywall";
|
|
580
|
+
}>;
|
|
581
|
+
}, z.core.$strict>;
|
|
582
|
+
id: z.ZodUUID;
|
|
583
|
+
at: z.ZodISODateTime;
|
|
584
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
585
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
586
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
587
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
588
|
+
name: z.ZodLiteral<"page_viewed">;
|
|
589
|
+
props: z.ZodObject<{
|
|
590
|
+
page: z.ZodEnum<{
|
|
591
|
+
plan_settings: "plan_settings";
|
|
592
|
+
console_home: "console_home";
|
|
593
|
+
cloud_studio: "cloud_studio";
|
|
594
|
+
}>;
|
|
595
|
+
}, z.core.$strict>;
|
|
596
|
+
id: z.ZodUUID;
|
|
597
|
+
at: z.ZodISODateTime;
|
|
598
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
599
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
600
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
601
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
602
|
+
name: z.ZodLiteral<"paywall_shown">;
|
|
603
|
+
props: z.ZodObject<{
|
|
604
|
+
reason: z.ZodString;
|
|
605
|
+
what: z.ZodString;
|
|
606
|
+
trigger: z.ZodEnum<{
|
|
607
|
+
refused: "refused";
|
|
608
|
+
reminder: "reminder";
|
|
609
|
+
locked: "locked";
|
|
610
|
+
}>;
|
|
611
|
+
}, z.core.$strict>;
|
|
612
|
+
id: z.ZodUUID;
|
|
613
|
+
at: z.ZodISODateTime;
|
|
614
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
615
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
616
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
617
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
618
|
+
name: z.ZodLiteral<"checkout_abandoned">;
|
|
619
|
+
props: z.ZodObject<{
|
|
620
|
+
what: z.ZodEnum<{
|
|
621
|
+
plan: "plan";
|
|
622
|
+
top_up: "top_up";
|
|
623
|
+
card: "card";
|
|
624
|
+
}>;
|
|
625
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
626
|
+
other: "other";
|
|
627
|
+
price: "price";
|
|
628
|
+
payment_method: "payment_method";
|
|
629
|
+
just_looking: "just_looking";
|
|
630
|
+
}>>;
|
|
631
|
+
}, z.core.$strict>;
|
|
632
|
+
id: z.ZodUUID;
|
|
633
|
+
at: z.ZodISODateTime;
|
|
634
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
635
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
636
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
637
|
+
}, z.core.$strict>], "name">;
|
|
638
|
+
export type WindowEvent = z.infer<typeof WindowEventSchema>;
|
|
639
|
+
/** The window's batch, sent with the person's session: strict as a program's, and of the window's events alone. */
|
|
640
|
+
export declare const WindowEventsRequestSchema: z.ZodObject<{
|
|
641
|
+
events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
642
|
+
name: z.ZodLiteral<"home_product_chosen">;
|
|
643
|
+
props: z.ZodObject<{
|
|
644
|
+
product: z.ZodEnum<{
|
|
645
|
+
desktop: "desktop";
|
|
646
|
+
agents: "agents";
|
|
647
|
+
cloud: "cloud";
|
|
648
|
+
}>;
|
|
649
|
+
}, z.core.$strict>;
|
|
650
|
+
id: z.ZodUUID;
|
|
651
|
+
at: z.ZodISODateTime;
|
|
652
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
653
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
654
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
655
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
656
|
+
name: z.ZodLiteral<"item_opened_from_sidebar">;
|
|
657
|
+
props: z.ZodObject<{
|
|
658
|
+
kind: z.ZodString;
|
|
659
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
660
|
+
}, z.core.$strict>;
|
|
661
|
+
id: z.ZodUUID;
|
|
662
|
+
at: z.ZodISODateTime;
|
|
663
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
664
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
665
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
666
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
667
|
+
name: z.ZodLiteral<"file_downloaded">;
|
|
668
|
+
props: z.ZodObject<{
|
|
669
|
+
kind: z.ZodString;
|
|
670
|
+
format: z.ZodString;
|
|
671
|
+
paused: z.ZodBoolean;
|
|
672
|
+
}, z.core.$strict>;
|
|
673
|
+
id: z.ZodUUID;
|
|
674
|
+
at: z.ZodISODateTime;
|
|
675
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
676
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
677
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
678
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
679
|
+
name: z.ZodLiteral<"share_opened">;
|
|
680
|
+
props: z.ZodObject<{
|
|
681
|
+
kind: z.ZodString;
|
|
682
|
+
}, z.core.$strict>;
|
|
683
|
+
id: z.ZodUUID;
|
|
684
|
+
at: z.ZodISODateTime;
|
|
685
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
686
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
687
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
688
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
689
|
+
name: z.ZodLiteral<"upgrade_clicked">;
|
|
690
|
+
props: z.ZodObject<{
|
|
691
|
+
where: z.ZodEnum<{
|
|
692
|
+
sidebar_offer: "sidebar_offer";
|
|
693
|
+
plan_settings: "plan_settings";
|
|
694
|
+
refusal_card: "refusal_card";
|
|
695
|
+
read_only_chip: "read_only_chip";
|
|
696
|
+
paywall: "paywall";
|
|
697
|
+
}>;
|
|
698
|
+
}, z.core.$strict>;
|
|
699
|
+
id: z.ZodUUID;
|
|
700
|
+
at: z.ZodISODateTime;
|
|
701
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
702
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
703
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
704
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
705
|
+
name: z.ZodLiteral<"page_viewed">;
|
|
706
|
+
props: z.ZodObject<{
|
|
707
|
+
page: z.ZodEnum<{
|
|
708
|
+
plan_settings: "plan_settings";
|
|
709
|
+
console_home: "console_home";
|
|
710
|
+
cloud_studio: "cloud_studio";
|
|
711
|
+
}>;
|
|
712
|
+
}, z.core.$strict>;
|
|
713
|
+
id: z.ZodUUID;
|
|
714
|
+
at: z.ZodISODateTime;
|
|
715
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
716
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
717
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
718
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
719
|
+
name: z.ZodLiteral<"paywall_shown">;
|
|
720
|
+
props: z.ZodObject<{
|
|
721
|
+
reason: z.ZodString;
|
|
722
|
+
what: z.ZodString;
|
|
723
|
+
trigger: z.ZodEnum<{
|
|
724
|
+
refused: "refused";
|
|
725
|
+
reminder: "reminder";
|
|
726
|
+
locked: "locked";
|
|
727
|
+
}>;
|
|
728
|
+
}, z.core.$strict>;
|
|
729
|
+
id: z.ZodUUID;
|
|
730
|
+
at: z.ZodISODateTime;
|
|
731
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
732
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
733
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
734
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
735
|
+
name: z.ZodLiteral<"checkout_abandoned">;
|
|
736
|
+
props: z.ZodObject<{
|
|
737
|
+
what: z.ZodEnum<{
|
|
738
|
+
plan: "plan";
|
|
739
|
+
top_up: "top_up";
|
|
740
|
+
card: "card";
|
|
741
|
+
}>;
|
|
742
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
743
|
+
other: "other";
|
|
744
|
+
price: "price";
|
|
745
|
+
payment_method: "payment_method";
|
|
746
|
+
just_looking: "just_looking";
|
|
747
|
+
}>>;
|
|
748
|
+
}, z.core.$strict>;
|
|
749
|
+
id: z.ZodUUID;
|
|
750
|
+
at: z.ZodISODateTime;
|
|
751
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
752
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
753
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
754
|
+
}, z.core.$strict>], "name">>;
|
|
755
|
+
}, z.core.$strict>;
|
|
756
|
+
export type WindowEventsRequest = z.infer<typeof WindowEventsRequestSchema>;
|
|
757
|
+
/** An event a client sent, as the service takes it: a program's, or the window's. */
|
|
758
|
+
export type SentEvent = ClientEvent | WindowEvent;
|
|
323
759
|
/** What the server answers: how many it kept (one sent before is kept once). */
|
|
324
760
|
export declare const EventsAnswerSchema: z.ZodObject<{
|
|
325
761
|
kept: z.ZodNumber;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as e}from"zod";export const EVENTS_PATH="/api/events",EVENTS_AT_MOST=100,EventWordSchema=e.string().regex(/^[a-z0-9][a-z0-9_.:-]{0,63}$/u),EventIdSchema=e.string().regex(/^[A-Za-z0-9_-]{1,128}$/u),EventTraceIdSchema=e.string().regex(/^[0-9a-f]{32}$/u),EventRouteSchema=e.string().regex(/^(?:\/[A-Za-z0-9_.:*-]{1,64}){1,12}$|^unmatched$/u);const a=e.record(EventWordSchema,e.number().int().min(0).max(1e6)).refine(n=>Object.keys(n).length<=32,"At most 32 words."),
|
|
2
|
+
import{z as e}from"zod";import{TURN_MOODS as i,TURN_PURPOSES as d,TURN_TROUBLES as c}from"./purposes.js";export const EVENTS_PATH="/api/events",EVENTS_AT_MOST=100,EventWordSchema=e.string().regex(/^[a-z0-9][a-z0-9_.:-]{0,63}$/u),EventIdSchema=e.string().regex(/^[A-Za-z0-9_-]{1,128}$/u),EventLanguageSchema=e.string().regex(/^[a-z]{2}$/u),EventCountrySchema=e.string().regex(/^[A-Z]{2}$/u),EventTraceIdSchema=e.string().regex(/^[0-9a-f]{32}$/u),EventRouteSchema=e.string().regex(/^(?:\/[A-Za-z0-9_.:*-]{1,64}){1,12}$|^unmatched$/u);const a=e.record(EventWordSchema,e.number().int().min(0).max(1e6)).refine(n=>Object.keys(n).length<=32,"At most 32 words.");export const WINDOW_PRODUCTS=["agents","desktop","cloud"],UPGRADE_PLACES=["sidebar_offer","plan_settings","refusal_card","read_only_chip","paywall"],PAYWALL_TRIGGERS=["refused","reminder","locked"],WINDOW_PAGES=["console_home","cloud_studio","plan_settings"],CHECKOUT_WHATS=["plan","top_up","card"],CHECKOUT_LEFT_REASONS=["price","payment_method","just_looking","other"];const s=e.number().int().min(0).max(10080*60*1e3);export const EVENT_PROPS={program_opened:e.strictObject({os:EventWordSchema,arch:EventWordSchema,where:e.enum(["computer","cloud"])}),project_opened:e.strictObject({fresh:e.boolean(),items:a}),item_opened:e.strictObject({kind:EventWordSchema}),session_started:e.strictObject({agent:EventWordSchema}),turn_started:e.strictObject({agent:EventWordSchema}),turn_finished:e.strictObject({agent:EventWordSchema,durationMs:s,ended:EventWordSchema,changed:a,made:a.optional()}),job_finished:e.strictObject({what:EventWordSchema,about:EventWordSchema,kind:EventWordSchema.optional(),durationMs:s,outcome:e.enum(["done","failed","cancelled"])}),command_ran:e.strictObject({command:EventWordSchema,durationMs:s,exit:e.number().int().min(0).max(255),code:EventWordSchema.optional()}),refusal_shown:e.strictObject({code:EventWordSchema,where:EventWordSchema}),home_product_chosen:e.strictObject({product:e.enum(WINDOW_PRODUCTS)}),item_opened_from_sidebar:e.strictObject({kind:EventWordSchema,extension:EventWordSchema.optional()}),file_downloaded:e.strictObject({kind:EventWordSchema,format:EventWordSchema,paused:e.boolean()}),share_opened:e.strictObject({kind:EventWordSchema}),upgrade_clicked:e.strictObject({where:e.enum(UPGRADE_PLACES)}),page_viewed:e.strictObject({page:e.enum(WINDOW_PAGES)}),paywall_shown:e.strictObject({reason:EventWordSchema,what:EventWordSchema,trigger:e.enum(PAYWALL_TRIGGERS)}),checkout_abandoned:e.strictObject({what:e.enum(CHECKOUT_WHATS),reason:e.enum(CHECKOUT_LEFT_REASONS).optional()}),account_created:e.strictObject({}),refusal_met:e.strictObject({code:EventWordSchema,route:EventRouteSchema,background:e.boolean().optional()}),checkout_started:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional()}),checkout_completed:e.strictObject({what:e.enum(["plan","top_up"]),plan:EventWordSchema.optional(),amount_cents:e.number().int().nonnegative().optional(),currency:EventWordSchema.optional()}),checkout_expired:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional(),currency:EventWordSchema.optional(),country:EventCountrySchema.optional()}),share_made:e.strictObject({kind:EventWordSchema,audience:EventWordSchema}),studio_opened:e.strictObject({where:e.enum(["computer","cloud"]),first:e.boolean()}),activated:e.strictObject({turns_before:e.number().int().min(0),hours_since_sign_up:e.number().min(0)}),turn_classified:e.strictObject({purpose:e.enum(d),language:EventLanguageSchema.optional(),mood:e.enum(i).optional(),trouble:e.enum(c).optional()})},EVENT_ABOUT={program_opened:"Studio started.",project_opened:"A project was opened in Studio.",item_opened:"A piece was put on show in Studio: its kind (a video, a deck, a doc), never which one.",session_started:"A conversation with an agent began.",turn_started:"A message was sent to an agent: which agent, never what the message says.",turn_finished:"An agent finished answering a message: how long it took, how it ended, how many files it changed of each kind of work and how many pieces of each kind it made.",job_finished:"Work Studio did ended: an export, a publish, an install, a download.",command_ran:"A command of the allyhub CLI ran: its name, how long it took, its exit code and, where it did not succeed, its failure's code.",refusal_shown:"Studio showed that a call needs credits or a plan.",home_product_chosen:"On the console's Home, the action of one of the three ways to use AllyHub was pressed: which way.",item_opened_from_sidebar:"A piece or a file was opened from the sidebar by hand: its kind, and a plain file's extension, never which one.",file_downloaded:"A file was downloaded from Studio's Download: the piece's kind, the file's format, and whether the computer in the cloud was paused.",share_opened:"Studio's Share panel was opened: the piece's kind.",upgrade_clicked:"An upgrade or buy-credits button was pressed: which of a few places it was in.",page_viewed:"One of a few pages was arrived at: the console's Home, AllyHub in the Cloud, or the plan's settings.",paywall_shown:"The dialog that offers plans and credits opened: why AllyHub refused (credits, a plan, storage), what kind of thing it refused, and whether a refusal or its reminder opened it.",checkout_abandoned:"Someone came back from Stripe's payment page without paying: what it was for (a plan, credits, a card) and, when they answered, which of a few reasons stopped them.",account_created:"A person signed up.",refusal_met:"AllyHub's service refused a call for credits, a plan, a limit, a tool turned off or storage, and whether background work made the call.",checkout_started:"A person went to pay.",checkout_completed:"A payment arrived.",checkout_expired:"A payment page was left unpaid until Stripe closed it.",share_made:"A share link was made.",studio_opened:"A person opened AllyHub Studio: the first time, then once a day at most.",activated:"A person's first message an agent answered to its end with something changed or made.",turn_classified:"A message's labels, read by AllyHub's own model: which of a few kinds of work it asked for (research, a document, media, writing…), its language, how the person sounded (pleased, neutral, confused, frustrated) and, when confused or frustrated, about what. Never a word of the message."},CLIENT_EVENTS=["program_opened","project_opened","item_opened","session_started","turn_started","turn_finished","job_finished","command_ran","refusal_shown"],WINDOW_EVENTS=["home_product_chosen","item_opened_from_sidebar","file_downloaded","share_opened","upgrade_clicked","page_viewed","paywall_shown","checkout_abandoned"];const r={id:e.uuid(),at:e.iso.datetime(),projectId:EventIdSchema.optional(),sessionId:EventIdSchema.optional(),traceId:EventTraceIdSchema.optional()},t=n=>e.strictObject({...r,name:e.literal(n),props:EVENT_PROPS[n]});export const ClientEventSchema=e.discriminatedUnion("name",[t("program_opened"),t("project_opened"),t("item_opened"),t("session_started"),t("turn_started"),t("turn_finished"),t("job_finished"),t("command_ran"),t("refusal_shown")]),EventsRequestSchema=e.strictObject({events:e.array(ClientEventSchema).min(1).max(EVENTS_AT_MOST)});const o=n=>e.strictObject({...r,name:e.literal(n),props:EVENT_PROPS[n]});export const WindowEventSchema=e.discriminatedUnion("name",[o("home_product_chosen"),o("item_opened_from_sidebar"),o("file_downloaded"),o("share_opened"),o("upgrade_clicked"),o("page_viewed"),o("paywall_shown"),o("checkout_abandoned")]),WindowEventsRequestSchema=e.strictObject({events:e.array(WindowEventSchema).min(1).max(EVENTS_AT_MOST)}),EventsAnswerSchema=e.object({kept:e.number().int().min(0)});
|
|
@@ -8,9 +8,9 @@ export declare const VersionSchema: z.ZodNullable<z.ZodString>;
|
|
|
8
8
|
/** Who changed a file, when the host knows. */
|
|
9
9
|
export declare const WriterSchema: z.ZodObject<{
|
|
10
10
|
kind: z.ZodEnum<{
|
|
11
|
+
agent: "agent";
|
|
11
12
|
tool: "tool";
|
|
12
13
|
person: "person";
|
|
13
|
-
agent: "agent";
|
|
14
14
|
}>;
|
|
15
15
|
name: z.ZodString;
|
|
16
16
|
}, z.core.$strict>;
|
|
@@ -91,9 +91,9 @@ export declare const FILE_NOTIFICATIONS: {
|
|
|
91
91
|
version: z.ZodNullable<z.ZodString>;
|
|
92
92
|
by: z.ZodOptional<z.ZodObject<{
|
|
93
93
|
kind: z.ZodEnum<{
|
|
94
|
+
agent: "agent";
|
|
94
95
|
tool: "tool";
|
|
95
96
|
person: "person";
|
|
96
|
-
agent: "agent";
|
|
97
97
|
}>;
|
|
98
98
|
name: z.ZodString;
|
|
99
99
|
}, z.core.$strict>>;
|
|
@@ -212,10 +212,10 @@ export declare const FRAME_NOTIFICATIONS: {
|
|
|
212
212
|
}, z.core.$strict>>;
|
|
213
213
|
readonly "export/state": import("./jsonrpc.js").NotificationSpec<z.ZodObject<{
|
|
214
214
|
at: z.ZodEnum<{
|
|
215
|
+
done: "done";
|
|
215
216
|
failed: "failed";
|
|
216
217
|
queued: "queued";
|
|
217
218
|
running: "running";
|
|
218
|
-
done: "done";
|
|
219
219
|
idle: "idle";
|
|
220
220
|
}>;
|
|
221
221
|
percent: z.ZodOptional<z.ZodNumber>;
|
|
@@ -9,6 +9,8 @@ export * from "./tools.js";
|
|
|
9
9
|
export * from "./cli.js";
|
|
10
10
|
export * from "./auth.js";
|
|
11
11
|
export * from "./events.js";
|
|
12
|
+
export * from "./purposes.js";
|
|
13
|
+
export * from "./turns.js";
|
|
12
14
|
export * from "./errors.js";
|
|
13
15
|
export * from "./registry.js";
|
|
14
16
|
export * from "./runtimes.js";
|
|
@@ -27,4 +29,10 @@ export * from "./open.js";
|
|
|
27
29
|
export * from "./jobs.js";
|
|
28
30
|
export * from "./peer.js";
|
|
29
31
|
export * from "./shape.js";
|
|
32
|
+
export * from "./studio-server.js";
|
|
33
|
+
export * from "./studio-window-requests.js";
|
|
34
|
+
export * from "./studio-tool-calls.js";
|
|
35
|
+
export * from "./cloud-computer.js";
|
|
36
|
+
export * from "./sidebar-deletion.js";
|
|
37
|
+
export * from "./paywall.js";
|
|
30
38
|
//# sourceMappingURL=index.d.ts.map
|