@benchme/scenarios 0.10.0 → 0.12.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/dist/cuj-v1/accounts.d.ts +14 -0
- package/dist/cuj-v1/accounts.js +52 -0
- package/dist/cuj-v1/accounts.js.map +1 -0
- package/dist/cuj-v1/index.d.ts +16 -0
- package/dist/cuj-v1/index.js +28 -0
- package/dist/cuj-v1/index.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/scenario.d.ts +24 -0
- package/dist/scenario.js +11 -0
- package/dist/scenario.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SiteAccounts } from "../scenario.js";
|
|
2
|
+
import type { SiteRows } from "../sites/rows.js";
|
|
3
|
+
/** How many people of each site's rows get an account of their own. */
|
|
4
|
+
export declare const ACCOUNTS_PER_SITE = 4;
|
|
5
|
+
/**
|
|
6
|
+
* The accounts a cuj-v1 workspace starts with: on each site, a few of the
|
|
7
|
+
* people its rows already have something for, signed up and verified, each
|
|
8
|
+
* with a password. A task that asks someone to act on their own account says
|
|
9
|
+
* who they are and their password; a task that asks for a new account signs
|
|
10
|
+
* up with an email no account has. Drawn from a stream of their own
|
|
11
|
+
* (`substream(seed, "cuj-v1:accounts:<app>")`), spread across each site's
|
|
12
|
+
* people in email order, so the same seed gives the same accounts forever.
|
|
13
|
+
*/
|
|
14
|
+
export declare function siteAccounts(seed: number, rows: SiteRows): SiteAccounts;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { int, pick, substream } from "../prng.js";
|
|
2
|
+
/** How many people of each site's rows get an account of their own. */
|
|
3
|
+
export const ACCOUNTS_PER_SITE = 4;
|
|
4
|
+
const WORDS = ["amber", "birch", "cedar", "delta", "ember", "fjord", "garnet", "harbor", "indigo", "juniper", "kestrel", "linden", "marble", "nectar", "orchid", "pewter"];
|
|
5
|
+
/** A password a person can type: two words and four digits, from the site's own stream. */
|
|
6
|
+
const passwordOf = (rng) => `${pick(rng, WORDS)}-${int(rng, 1000, 9999)}-${pick(rng, WORDS)}`;
|
|
7
|
+
/** People with something on the site, by email, each once, in email order; the first name seen for an email is kept. */
|
|
8
|
+
function people(list) {
|
|
9
|
+
const byEmail = new Map();
|
|
10
|
+
for (const p of list)
|
|
11
|
+
if (!byEmail.has(p.email.toLowerCase()))
|
|
12
|
+
byEmail.set(p.email.toLowerCase(), p.name);
|
|
13
|
+
return [...byEmail].map(([email, name]) => ({ email, name })).sort((a, b) => a.email.localeCompare(b.email));
|
|
14
|
+
}
|
|
15
|
+
/** Who on each site has something to act on: a booking, an order, a viewing, a prescription, a place in the directory. */
|
|
16
|
+
function candidates(rows) {
|
|
17
|
+
return {
|
|
18
|
+
hotels: people(rows.hotels.bookings.filter((b) => b.status === "confirmed").map((b) => ({ email: b.guestEmail, name: b.guestName }))),
|
|
19
|
+
flights: people(rows.flights.bookings.filter((b) => b.status === "confirmed").map((b) => ({ email: b.contactEmail, name: b.passengers[0]?.name ?? b.contactEmail }))),
|
|
20
|
+
dining: people(rows.dining.reservations.filter((r) => r.status === "confirmed").map((r) => ({ email: r.guestEmail, name: r.guestName }))),
|
|
21
|
+
pizza: people(rows.pizza.orders.map((o) => ({ email: o.customerEmail, name: o.customerName }))),
|
|
22
|
+
cinema: people(rows.cinema.bookings.filter((b) => b.status === "confirmed").map((b) => ({ email: b.customerEmail, name: b.customerName }))),
|
|
23
|
+
sports: people(rows.sports.customers),
|
|
24
|
+
homes: people(rows.homes.viewings.filter((v) => v.status === "requested").map((v) => ({ email: v.viewerEmail, name: v.viewerName }))),
|
|
25
|
+
clinic: people(rows.clinic.patients),
|
|
26
|
+
events: people(rows.events.people),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The accounts a cuj-v1 workspace starts with: on each site, a few of the
|
|
31
|
+
* people its rows already have something for, signed up and verified, each
|
|
32
|
+
* with a password. A task that asks someone to act on their own account says
|
|
33
|
+
* who they are and their password; a task that asks for a new account signs
|
|
34
|
+
* up with an email no account has. Drawn from a stream of their own
|
|
35
|
+
* (`substream(seed, "cuj-v1:accounts:<app>")`), spread across each site's
|
|
36
|
+
* people in email order, so the same seed gives the same accounts forever.
|
|
37
|
+
*/
|
|
38
|
+
export function siteAccounts(seed, rows) {
|
|
39
|
+
const out = {};
|
|
40
|
+
for (const [app, list] of Object.entries(candidates(rows))) {
|
|
41
|
+
const rng = substream(seed, `cuj-v1:accounts:${app}`);
|
|
42
|
+
const step = Math.max(1, Math.floor(list.length / ACCOUNTS_PER_SITE));
|
|
43
|
+
const chosen = [];
|
|
44
|
+
for (let i = Math.min(int(rng, 0, step - 1), list.length - 1); i < list.length && chosen.length < ACCOUNTS_PER_SITE; i += step) {
|
|
45
|
+
const p = list[i];
|
|
46
|
+
chosen.push({ email: p.email, name: p.name, password: passwordOf(rng) });
|
|
47
|
+
}
|
|
48
|
+
out[app] = chosen;
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/cuj-v1/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAY,MAAM,YAAY,CAAC;AAI5D,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAEpL,2FAA2F;AAC3F,MAAM,UAAU,GA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,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Scenario } from "../scenario.js";
|
|
2
|
+
/**
|
|
3
|
+
* cuj-v1: critical user journeys on the nine sites of webmcp-v1, in focus
|
|
4
|
+
* areas and at levels (tools/intent-corpus/cuj, docs/scenarios/cuj-v1.md).
|
|
5
|
+
* Its rows are webmcp-v1's at the same seed, row for row; what it adds is a
|
|
6
|
+
* few accounts already signed up on each site (`accounts`), so a journey can
|
|
7
|
+
* begin with someone signing in to their own account. Its workspaces
|
|
8
|
+
* advertise the nine sites and the inbox their sign-up codes land in.
|
|
9
|
+
*
|
|
10
|
+
* Its mailboxes are private: everyone its rows already hold (a guest, an
|
|
11
|
+
* organiser, an account's owner) has a mailbox of their own, which the inbox
|
|
12
|
+
* never shows. A journey acts for its people through the accounts they have,
|
|
13
|
+
* and cannot sign up as one of them on a site where they have none: the code
|
|
14
|
+
* would go to their own mailbox. A new person a task names signs up as ever.
|
|
15
|
+
*/
|
|
16
|
+
export declare const cujV1: Scenario;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SITE_APPS } from "../sites/rows.js";
|
|
2
|
+
import { webmcpV1 } from "../webmcp-v1/index.js";
|
|
3
|
+
import { siteAccounts } from "./accounts.js";
|
|
4
|
+
/**
|
|
5
|
+
* cuj-v1: critical user journeys on the nine sites of webmcp-v1, in focus
|
|
6
|
+
* areas and at levels (tools/intent-corpus/cuj, docs/scenarios/cuj-v1.md).
|
|
7
|
+
* Its rows are webmcp-v1's at the same seed, row for row; what it adds is a
|
|
8
|
+
* few accounts already signed up on each site (`accounts`), so a journey can
|
|
9
|
+
* begin with someone signing in to their own account. Its workspaces
|
|
10
|
+
* advertise the nine sites and the inbox their sign-up codes land in.
|
|
11
|
+
*
|
|
12
|
+
* Its mailboxes are private: everyone its rows already hold (a guest, an
|
|
13
|
+
* organiser, an account's owner) has a mailbox of their own, which the inbox
|
|
14
|
+
* never shows. A journey acts for its people through the accounts they have,
|
|
15
|
+
* and cannot sign up as one of them on a site where they have none: the code
|
|
16
|
+
* would go to their own mailbox. A new person a task names signs up as ever.
|
|
17
|
+
*/
|
|
18
|
+
export const cujV1 = {
|
|
19
|
+
key: "cuj-v1",
|
|
20
|
+
description: "Critical user journeys on the nine sites of webmcp-v1 (hotels, flights, restaurants, pizza, cinema, a sports store, homes, clinics, office events), with a few accounts already signed up on each",
|
|
21
|
+
apps: [...SITE_APPS, "mail"],
|
|
22
|
+
mailboxes: "private",
|
|
23
|
+
generate(seed) {
|
|
24
|
+
const rows = webmcpV1.generate(seed);
|
|
25
|
+
return { ...rows, accounts: siteAccounts(seed, rows) };
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cuj-v1/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,KAAK,GAAa;IAC7B,GAAG,EAAE,QAAQ;IACb,WAAW,EAAE,mMAAmM;IAChN,IAAI,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,SAAS;IACpB,QAAQ,CAAC,IAAY;QACnB,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;IACzD,CAAC;CACF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { shopsV1 } from "./shops-v1/index.js";
|
|
|
5
5
|
export { guideV1 } from "./guide-v1/index.js";
|
|
6
6
|
export { webV1 } from "./web-v1/index.js";
|
|
7
7
|
export { webmcpV1 } from "./webmcp-v1/index.js";
|
|
8
|
+
export { cujV1 } from "./cuj-v1/index.js";
|
|
9
|
+
export { ACCOUNTS_PER_SITE, siteAccounts } from "./cuj-v1/accounts.js";
|
|
8
10
|
export { SITE_APPS, noSiteRows, siteRows, type SiteApp, type SiteRows } from "./sites/rows.js";
|
|
9
11
|
export * from "./sites/flights/index.js";
|
|
10
12
|
export * from "./sites/dining/index.js";
|
|
@@ -17,7 +19,7 @@ export * from "./sites/events/index.js";
|
|
|
17
19
|
export { documentsMatching, lowStock, openOrdersFor, openTicketsFor, orderTotalCents, slaBreaches, stockOf } from "./answers.js";
|
|
18
20
|
export { int, minstd, pick, shuffle, substream, type Rng } from "./prng.js";
|
|
19
21
|
export { MAX_NIGHTS, STAY_WINDOW, addDays, checkOutOf, fitProblem, isDate, nightsOf, roomsLeft, searchStays, stayProblem, stayTotalCents, type Stay, type StayOffer, type StayProblem, type StayQuery, } from "./stays.js";
|
|
20
|
-
export { ScenarioRegistry, UnknownScenarioError, type Agent, type Booking, type BookingStatus, type Comment, type CompanyFacts, type Customer, type Document, type DocumentKind, type Hotel, type HotelRows, type Location, type Order, type OrderLine, type OrderStatus, type Product, type RoomType, type Scenario, type ScenarioRows, type SlaPolicy, type Stock, type Ticket, type TicketPriority, type TicketStatus, type Transfer, type TransferStatus, } from "./scenario.js";
|
|
22
|
+
export { MAILBOXES, ScenarioRegistry, UnknownScenarioError, mailboxesOf, type Agent, type Booking, type BookingStatus, type Comment, type CompanyFacts, type Customer, type Document, type DocumentKind, type Hotel, type HotelRows, type Location, type Mailboxes, type Order, type OrderLine, type OrderStatus, type Product, type RoomType, type Scenario, type ScenarioRows, type SiteAccount, type SiteAccounts, type SlaPolicy, type Stock, type Ticket, type TicketPriority, type TicketStatus, type Transfer, type TransferStatus, } from "./scenario.js";
|
|
21
23
|
/**
|
|
22
24
|
* The default registry with every shipped scenario. acme-v1 stays first: the
|
|
23
25
|
* gateway's robots.txt advertises the shared workspace of the first one.
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,15 @@ import { ScenarioRegistry } from "./scenario.js";
|
|
|
4
4
|
import { shopsV1 } from "./shops-v1/index.js";
|
|
5
5
|
import { webV1 } from "./web-v1/index.js";
|
|
6
6
|
import { webmcpV1 } from "./webmcp-v1/index.js";
|
|
7
|
+
import { cujV1 } from "./cuj-v1/index.js";
|
|
7
8
|
export { ACME_V1_SIZES, acmeV1 } from "./acme-v1/index.js";
|
|
8
9
|
export { AMENITIES, HOTEL_SIZES } from "./sites/hotels/generate.js";
|
|
9
10
|
export { shopsV1 } from "./shops-v1/index.js";
|
|
10
11
|
export { guideV1 } from "./guide-v1/index.js";
|
|
11
12
|
export { webV1 } from "./web-v1/index.js";
|
|
12
13
|
export { webmcpV1 } from "./webmcp-v1/index.js";
|
|
14
|
+
export { cujV1 } from "./cuj-v1/index.js";
|
|
15
|
+
export { ACCOUNTS_PER_SITE, siteAccounts } from "./cuj-v1/accounts.js";
|
|
13
16
|
export { SITE_APPS, noSiteRows, siteRows } from "./sites/rows.js";
|
|
14
17
|
export * from "./sites/flights/index.js";
|
|
15
18
|
export * from "./sites/dining/index.js";
|
|
@@ -22,10 +25,10 @@ export * from "./sites/events/index.js";
|
|
|
22
25
|
export { documentsMatching, lowStock, openOrdersFor, openTicketsFor, orderTotalCents, slaBreaches, stockOf } from "./answers.js";
|
|
23
26
|
export { int, minstd, pick, shuffle, substream } from "./prng.js";
|
|
24
27
|
export { MAX_NIGHTS, STAY_WINDOW, addDays, checkOutOf, fitProblem, isDate, nightsOf, roomsLeft, searchStays, stayProblem, stayTotalCents, } from "./stays.js";
|
|
25
|
-
export { ScenarioRegistry, UnknownScenarioError, } from "./scenario.js";
|
|
28
|
+
export { MAILBOXES, ScenarioRegistry, UnknownScenarioError, mailboxesOf, } from "./scenario.js";
|
|
26
29
|
/**
|
|
27
30
|
* The default registry with every shipped scenario. acme-v1 stays first: the
|
|
28
31
|
* gateway's robots.txt advertises the shared workspace of the first one.
|
|
29
32
|
*/
|
|
30
|
-
export const scenarios = new ScenarioRegistry().register(acmeV1).register(shopsV1).register(guideV1).register(webV1).register(webmcpV1);
|
|
33
|
+
export const scenarios = new ScenarioRegistry().register(acmeV1).register(shopsV1).register(guideV1).register(webV1).register(webmcpV1).register(cujV1);
|
|
31
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,Q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AAgB,EAChB,oBAAoB,EACpB,WAAW,GA6BZ,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC"}
|
package/dist/scenario.d.ts
CHANGED
|
@@ -151,6 +151,14 @@ export type CompanyFacts = {
|
|
|
151
151
|
employees: number;
|
|
152
152
|
fiscalYearRevenueCents: number;
|
|
153
153
|
};
|
|
154
|
+
/** An account a site already has when a workspace starts: signed up and verified, with the password its owner types. */
|
|
155
|
+
export type SiteAccount = {
|
|
156
|
+
email: string;
|
|
157
|
+
name: string;
|
|
158
|
+
password: string;
|
|
159
|
+
};
|
|
160
|
+
/** Accounts by site app (hotels, flights …); a site with none is left out. */
|
|
161
|
+
export type SiteAccounts = Partial<Record<"hotels" | "flights" | "dining" | "pizza" | "cinema" | "sports" | "homes" | "clinic" | "events", SiteAccount[]>>;
|
|
154
162
|
export type ScenarioRows = {
|
|
155
163
|
company: CompanyFacts;
|
|
156
164
|
warehouse: {
|
|
@@ -180,7 +188,19 @@ export type ScenarioRows = {
|
|
|
180
188
|
pizza: PizzaRows;
|
|
181
189
|
events: EventRows;
|
|
182
190
|
clinic: ClinicRows;
|
|
191
|
+
/** Accounts the sites start with (cuj-v1); absent where a scenario seeds none, as every other does. */
|
|
192
|
+
accounts?: SiteAccounts;
|
|
183
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* How a workspace's mailboxes work, as the inbox (apps/mail) keeps them:
|
|
196
|
+
* - `shared`: one inbox shows the mail to every address, so a site's sign-up code can be read whoever it was sent to;
|
|
197
|
+
* - `private`: every address the workspace's rows already hold (a guest, an organiser, an account's owner) has a
|
|
198
|
+
* mailbox of its own, which the inbox never shows. Signing up in the name of someone who already exists cannot be
|
|
199
|
+
* finished, because their code goes to their own mailbox; mail to any other address (one the user makes up, a new
|
|
200
|
+
* person a task names) is shown as in a shared inbox.
|
|
201
|
+
*/
|
|
202
|
+
export declare const MAILBOXES: readonly ["shared", "private"];
|
|
203
|
+
export type Mailboxes = (typeof MAILBOXES)[number];
|
|
184
204
|
/** A scenario is a pure function of its seed: same seed, byte-identical rows. */
|
|
185
205
|
export interface Scenario {
|
|
186
206
|
readonly key: string;
|
|
@@ -191,8 +211,12 @@ export interface Scenario {
|
|
|
191
211
|
* workspaces. Absent: every listed app, as before.
|
|
192
212
|
*/
|
|
193
213
|
readonly apps?: readonly string[];
|
|
214
|
+
/** How its workspaces' mailboxes work (`Mailboxes`). Absent: `shared`, as every scenario's were before (`mailboxesOf`). */
|
|
215
|
+
readonly mailboxes?: Mailboxes;
|
|
194
216
|
generate(seed: number): ScenarioRows;
|
|
195
217
|
}
|
|
218
|
+
/** A scenario's mailboxes: what it declares, or `shared` when it says nothing — the one place that default lives. */
|
|
219
|
+
export declare const mailboxesOf: (scenario: Pick<Scenario, "mailboxes">) => Mailboxes;
|
|
196
220
|
export declare class UnknownScenarioError extends Error {
|
|
197
221
|
constructor(key: string);
|
|
198
222
|
}
|
package/dist/scenario.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a workspace's mailboxes work, as the inbox (apps/mail) keeps them:
|
|
3
|
+
* - `shared`: one inbox shows the mail to every address, so a site's sign-up code can be read whoever it was sent to;
|
|
4
|
+
* - `private`: every address the workspace's rows already hold (a guest, an organiser, an account's owner) has a
|
|
5
|
+
* mailbox of its own, which the inbox never shows. Signing up in the name of someone who already exists cannot be
|
|
6
|
+
* finished, because their code goes to their own mailbox; mail to any other address (one the user makes up, a new
|
|
7
|
+
* person a task names) is shown as in a shared inbox.
|
|
8
|
+
*/
|
|
9
|
+
export const MAILBOXES = ["shared", "private"];
|
|
10
|
+
/** A scenario's mailboxes: what it declares, or `shared` when it says nothing — the one place that default lives. */
|
|
11
|
+
export const mailboxesOf = (scenario) => scenario.mailboxes ?? "shared";
|
|
1
12
|
export class UnknownScenarioError extends Error {
|
|
2
13
|
constructor(key) {
|
|
3
14
|
super(`unknown scenario: ${key}`);
|
package/dist/scenario.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario.js","sourceRoot":"","sources":["../src/scenario.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scenario.js","sourceRoot":"","sources":["../src/scenario.ts"],"names":[],"mappings":"AAiIA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAC;AAkBxD,qHAAqH;AACrH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAqC,EAAa,EAAE,CAAC,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC;AAEhH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,GAAW;QACrB,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,+EAA+E;AAC/E,MAAM,OAAO,gBAAgB;IACV,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;IAErD,QAAQ,CAAC,QAAkB;QACzB,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QAClG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,GAAG,CAAC,GAAW;QACb,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG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