@try-works/extension-laya 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +38 -2
  2. package/lib/index.d.ts +18 -0
  3. package/lib/index.js +172 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/pure.d.ts +35 -0
  6. package/lib/pure.js +71 -0
  7. package/lib/pure.js.map +1 -0
  8. package/models.lock.json +63 -0
  9. package/package.json +39 -4
  10. package/schema/decision-choose.input.json +22 -0
  11. package/schema/decision-choose.output.json +20 -0
  12. package/schema/decision-score.input.json +18 -0
  13. package/schema/decision-score.output.json +18 -0
  14. package/schema/decision-test.input.json +10 -0
  15. package/schema/decision-test.output.json +18 -0
  16. package/tool-mode.extension.json +87 -0
  17. package/vendor/LICENSE.laya-ts +176 -0
  18. package/vendor/laya-ts/agent.d.ts +216 -0
  19. package/vendor/laya-ts/agent.js +631 -0
  20. package/vendor/laya-ts/common.d.ts +167 -0
  21. package/vendor/laya-ts/common.js +478 -0
  22. package/vendor/laya-ts/dx.d.ts +17 -0
  23. package/vendor/laya-ts/dx.js +46 -0
  24. package/vendor/laya-ts/email.d.ts +2 -0
  25. package/vendor/laya-ts/email.js +184 -0
  26. package/vendor/laya-ts/hooks.d.ts +134 -0
  27. package/vendor/laya-ts/hooks.js +379 -0
  28. package/vendor/laya-ts/index.d.ts +22 -0
  29. package/vendor/laya-ts/index.js +13 -0
  30. package/vendor/laya-ts/lang.d.ts +24 -0
  31. package/vendor/laya-ts/lang.js +590 -0
  32. package/vendor/laya-ts/presets.d.ts +5 -0
  33. package/vendor/laya-ts/presets.js +175 -0
  34. package/vendor/laya-ts/providers.d.ts +67 -0
  35. package/vendor/laya-ts/providers.js +668 -0
  36. package/vendor/laya-ts/router.d.ts +186 -0
  37. package/vendor/laya-ts/router.js +757 -0
  38. package/vendor/laya-ts/shortlist.d.ts +65 -0
  39. package/vendor/laya-ts/shortlist.js +407 -0
  40. package/vendor/laya-ts/structured.d.ts +89 -0
  41. package/vendor/laya-ts/structured.js +256 -0
  42. package/vendor/laya-ts/tokenizer.d.ts +66 -0
  43. package/vendor/laya-ts/tokenizer.js +482 -0
@@ -0,0 +1,46 @@
1
+ /** One-line question factories; output always passes checkQuestion. */
2
+ export const q = {
3
+ choice(instructions, criteria) {
4
+ return { type: "choice", instructions, criteria };
5
+ },
6
+ score(instructions, criteria) {
7
+ return { type: "score", instructions, criteria };
8
+ },
9
+ noul(instructions, criteria, labels) {
10
+ const out = { type: "noul", instructions };
11
+ if (criteria !== undefined)
12
+ out["criteria"] = criteria;
13
+ if (labels !== undefined)
14
+ out["labels"] = labels;
15
+ return out;
16
+ },
17
+ };
18
+ /** Argmax label: choice string, score key, noul boolean. */
19
+ export function best(answer) {
20
+ if (answer.type === "choice")
21
+ return answer.choice;
22
+ if (answer.type === "score") {
23
+ let bk = "";
24
+ let bv = -Infinity;
25
+ for (const [k, v] of Object.entries(answer.probabilities)) {
26
+ if (v > bv) {
27
+ bv = v;
28
+ bk = k;
29
+ }
30
+ }
31
+ return bk;
32
+ }
33
+ return answer.noul >= 0.5;
34
+ }
35
+ /** Top-k probability keys, descending. */
36
+ export function topK(probs, k) {
37
+ return Object.entries(probs)
38
+ .sort((a, b) => b[1] - a[1])
39
+ .slice(0, Math.max(0, k))
40
+ .map(([key]) => key);
41
+ }
42
+ /** Confidence gate (default 0.8) on answer_confidence (max(p)) alone, so the
43
+ * gate uses one scale across question types instead of mixing in entropy. */
44
+ export function isConfident(answer, thresh = 0.8) {
45
+ return (answer.answer_confidence ?? 0) >= thresh;
46
+ }
@@ -0,0 +1,2 @@
1
+ export declare function cleanEmailBody(body: string, maxChars?: number): string;
2
+ export declare function emailState(subject: string, body: string, sender?: string | null, clean?: boolean, extra?: Record<string, unknown>, maxChars?: number): Record<string, unknown>;
@@ -0,0 +1,184 @@
1
+ const QUOTE_HEADERS = [
2
+ /^\s*On .{0,300}wrote:\s*$/i,
3
+ /^\s*Em (?=.*\d).{0,300}escreveu:\s*$/i,
4
+ /^\s*El (?=.*\d).{0,300}escribi[óo]:\s*$/i,
5
+ // Gmail's French attribution carries a date like the others ("Le lun. ... a écrit :"), and
6
+ // French typography puts a space before the colon, so the verb allows one
7
+ /^\s*Le (?=.*\d).{0,300}a [eé]crit\s*:\s*$/i,
8
+ /^\s*-{2,}\s*(Original|Forwarded) Message\s*-{2,}/i,
9
+ /^\s*-{2,}\s*(Mensagem (original|encaminhada)|Mensaje (original|reenviado)|Message d'origine)\s*-{2,}/i,
10
+ /^\s*_{8,}\s*$/,
11
+ // `From:` opens ordinary prose too ("From: my side the integration works, but please
12
+ // refund..."), and a reply header always carries the sender, so the header is only recognised
13
+ // when an address follows -- the same rule as `De:` below. A bare `From: Name` header is
14
+ // caught by HEADER_FROM_NAME/HEADER_NEXT instead, which need the header's own `Sent:`/`Date:`
15
+ // line to tell it apart from a sentence.
16
+ /^\s*From:\s.*[@<]/i,
17
+ // `De:` also opens ordinary Portuguese/Spanish lines ("De: 10/09 a 15/09"), so the Outlook
18
+ // header is only recognised when it carries an address. French Outlook writes `De :` with a
19
+ // space, so the marker allows one; the address rule is unchanged
20
+ /^\s*De\s*:\s.*[@<]/i,
21
+ ];
22
+ const ATTRIBUTION_TAIL = /^.{0,120}\S@\S+\s+(wrote|escreveu|escribi[óo]|a [eé]crit)\s*:\s*$/i;
23
+ const ATTRIBUTION_HEAD = /^\s*(On|Em|El|Le) (?=.*\d)/i;
24
+ // Exchange often leaves the address out of Outlook's reply header ("De: Maria Souza"), so a bare
25
+ // `De:` only cuts when the header's own `Enviado:` line, or a dated `Data:`/`Fecha:` line, follows
26
+ // it. `Para:` is not enough: "De: 10/09 / Para: 15/09" is how a leave request reads.
27
+ //
28
+ // The same is true of a bare English `From: Maria Souza`, which is why the marker above needs
29
+ // this rule: the English client lines are the translations of the two `De:` neighbours. A line
30
+ // that only looks like prose still has to be told apart from a header by its neighbours, so the
31
+ // English pair is "From: <name>" followed by "Sent:"/"Date:". French Outlook writes the same
32
+ // header as `De : Marie Dupont` with `Envoyé :` underneath, so both allow the spaced colon.
33
+ const HEADER_FROM_NAME = /^\s*(De|From)\s*:\s+\S/i;
34
+ const HEADER_NEXT = /^\s*(Enviad[oa]( em| el)?:\s|Envoy[ée]( le)?\s*:\s|Sent:\s|(Data|Fecha|Date):\s.*\d{4})/i;
35
+ // A closing line is the closing word plus punctuation and at most a name. Anything else on
36
+ // the line is a sentence, and the case of the next word is what separates the two: a name is
37
+ // capitalised, "for" in "Thanks for the quick reply." is not. JS regexes have no scoped
38
+ // case-insensitive groups like Python's (?i:...), so the closing words are matched
39
+ // case-insensitively here and the name is checked case-sensitively by SIGNOFF_TAIL.
40
+ const SIGNOFF_HEAD = /^\s*(?:best|kind|warmest|warm|many thanks|thanks|thank you|regards|cheers|sincerely)(?:\s+(?:and|&)\s+regards|\s+(?:regards|wishes|again|in advance|a lot|so much|very much))?/i;
41
+ // The name's first letter must not be lowercase, so the check is per character, not per script:
42
+ // \p{Lu}/\p{Lt}/\p{Lo} accepts a name capitalised in any script (Regards, Łukasz) or written in
43
+ // a script without case (山田). Python asks the same question per token (`_is_english_signoff`).
44
+ const SIGNOFF_TAIL = /^[\s,;:!.]*(?:[\p{Lu}\p{Lt}\p{Lo}][\p{L}\p{M}\p{N}_'-]*[\s,.]*){0,3}$/u;
45
+ function isEnglishSignoff(line) {
46
+ const m = SIGNOFF_HEAD.exec(line);
47
+ return m !== null && SIGNOFF_TAIL.test(line.slice(m[0].length));
48
+ }
49
+ const SIGNATURE_MARKERS = [
50
+ (l) => /^\s*--\s*$/.test(l),
51
+ isEnglishSignoff,
52
+ (l) => /^\s*(atenciosamente|att|abraços?|abs|um abraço|cordialmente|grat[oa]|(muito )?obrigad[oa]s?( desde já| pela atenção)?|(com os melhores )?cumprimentos|saudações|(un )?saludos?( cordiales)?|atentamente|(muchas )?gracias( de antemano)?|(bien )?cordialement|salutations( distinguées)?|bien à vous|merci( d'avance)?|bonne journée)[\s,!.]*$/i.test(l),
53
+ ];
54
+ const DEVICE = "iphone|ipad|android|ios|mobile|celular|telemóvel|móvil|galaxy|smartphone|samsung|tablet|" +
55
+ "outlook|yahoo|mail|e-?mail|gmail|windows";
56
+ const DEVICE_FOOTER = new RegExp("^\\s*((enviad[oa] (do|pelo|pela|via|desde|a partir do)( meu| minha| mi)?|sent from( my)?|" +
57
+ "envoy[ée] (depuis|de)( mon| ma| mes)?)" +
58
+ ` (${DEVICE})( (${DEVICE}|para|for|no|na|\\d+|phone|device|pro|max|mini|plus|using [a-z][\\w.+-]*))*` +
59
+ "|(obter o|get) outlook (para|for) (ios|android))[\\s.!]*$", "i");
60
+ const DISCLAIMER = new RegExp(
61
+ // English is tied to a disclaimer noun and a disclaimer tail, the way the Portuguese branches
62
+ // below are. The bare word matched any sentence that merely mentioned it, so "Is this
63
+ // confidential?" and "Confidential: I need a refund." were deleted whole and the model was
64
+ // scored on an empty state. `[^.]` rather than `[^.\n]`: a footer wraps, so "are\nconfidential"
65
+ // must still match.
66
+ "(\\b(e-?mail|message|information|communication|transmission|contents?)\\b[^.]{0,60}" +
67
+ "\\bconfidential\\b[^.]{0,60}\\b(intended|solely|addressee|recipient|privileged|" +
68
+ "disclos|unauthori[sz]ed)|" +
69
+ "\\bconfidential\\b[^.]{0,60}\\b(and (may|is) (also )?privileged)|" +
70
+ "if you (have )?received this (e-?mail|message) in error|" +
71
+ "\\b(esta|este) (mensagem|e-?mail|mensaje|correo)\\b[^.]{0,80}(confidencia|sigilos|privilegiad)|" +
72
+ "\\b(uso exclusivo|exclusivamente|únicamente|unicamente)\\b[^.]{0,30}" +
73
+ "(destinatári|destinatari|pessoa|persona|entidade|entidad)|" +
74
+ "\\b(recebeu|recebido|receber) (esta|este) (mensagem|e-?mail)\\b[^.]{0,20} por (engano|erro)|" +
75
+ "\\b(ha recibido|recibió|recibe) (este|esta) (mensaje|correo)\\b[^.]{0,20} por error|" +
76
+ "\\bantes de imprimir\\b[^.]{0,100}(meio ambiente|medio ambiente|natureza|planeta|realmente necess)|" +
77
+ "\\b(meio|medio) ambiente\\b[^.]{0,30}antes de imprimir|" +
78
+ // French is tied to "ce message/cet e-mail" rather than the bare word `confidentiel`, which a
79
+ // sender's own request ("le contrat confidentiel") uses just as often
80
+ "\\b(ce|cet|cette) (message|e-?mail|mail|courriel)\\b[^.]{0,80}(confidentiel|privil[eé]gi)|" +
81
+ "\\bavez re[çc]u (ce|cet|cette) (message|e-?mail|mail)\\b[^.]{0,20} par erreur|" +
82
+ "\\b(usage exclusif|exclusivement|uniquement)\\b[^.]{0,30}destinataire)", "i");
83
+ const SENTENCE = /(?<=[.!?])\s+/;
84
+ function startsNewSentence(line) {
85
+ for (const ch of line) {
86
+ if (/\p{L}/u.test(ch))
87
+ return ch === ch.toUpperCase() && ch !== ch.toLowerCase();
88
+ }
89
+ return false;
90
+ }
91
+ function splitFusedLines(sentence) {
92
+ if (!sentence.includes("\n"))
93
+ return [sentence];
94
+ const pieces = [];
95
+ let buf = "";
96
+ for (const line of sentence.split("\n").map((ln) => ln.trim())) {
97
+ if (!line)
98
+ continue;
99
+ if (buf && startsNewSentence(line)) {
100
+ pieces.push(buf);
101
+ buf = line;
102
+ }
103
+ else {
104
+ buf = buf ? buf + " " + line : line;
105
+ }
106
+ }
107
+ if (buf)
108
+ pieces.push(buf);
109
+ return pieces;
110
+ }
111
+ function stripDisclaimer(paragraph) {
112
+ if (!DISCLAIMER.test(paragraph))
113
+ return paragraph;
114
+ const parts = paragraph.split(SENTENCE).map((p) => p.trim()).filter(Boolean);
115
+ const pieces = [];
116
+ for (const p of parts) {
117
+ if (DISCLAIMER.test(p))
118
+ pieces.push(...splitFusedLines(p));
119
+ else
120
+ pieces.push(p);
121
+ }
122
+ return pieces.filter((p) => !DISCLAIMER.test(p)).join(" ");
123
+ }
124
+ export function cleanEmailBody(body, maxChars = 3000) {
125
+ let text = (body ?? "").replace(/\r\n?/g, "\n").replace(/\\n/g, "\n");
126
+ // Bound regex work before the expensive patterns below (Python does the same): only
127
+ // maxChars are ever returned, so nothing past 4x can survive cleaning.
128
+ if (text.length > maxChars * 4)
129
+ text = text.slice(0, maxChars * 4);
130
+ const lines = [];
131
+ const src = text.split("\n");
132
+ for (let i = 0; i < src.length; i++) {
133
+ const line = src[i];
134
+ if (QUOTE_HEADERS.some((p) => p.test(line)) && lines.length)
135
+ break;
136
+ if (lines.length && HEADER_FROM_NAME.test(line) && i + 1 < src.length && HEADER_NEXT.test(src[i + 1]))
137
+ break;
138
+ if (ATTRIBUTION_TAIL.test(line) && lines.length) {
139
+ if (ATTRIBUTION_HEAD.test(lines[lines.length - 1]))
140
+ lines.pop();
141
+ break;
142
+ }
143
+ if (line.replace(/^\s+/, "").startsWith(">"))
144
+ continue;
145
+ lines.push(line.replace(/\s+$/, ""));
146
+ }
147
+ let cut = lines.length;
148
+ const start = Math.max(1, Math.min(Math.floor(lines.length * 0.6), lines.length - 8));
149
+ for (let i = start; i < lines.length; i++) {
150
+ const n = lines[i].trim().length;
151
+ if ((n <= 40 && SIGNATURE_MARKERS.some((p) => p(lines[i]))) ||
152
+ (n <= 60 && DEVICE_FOOTER.test(lines[i]))) {
153
+ cut = i;
154
+ break;
155
+ }
156
+ }
157
+ const kept = lines.slice(0, cut);
158
+ const paragraphs = kept
159
+ .join("\n")
160
+ .split(/\n\s*\n/)
161
+ .map(stripDisclaimer);
162
+ const out = paragraphs
163
+ .map((p) => p.trim())
164
+ .filter(Boolean)
165
+ .join("\n\n")
166
+ .replace(/[ \t]+/g, " ");
167
+ return out.slice(0, maxChars);
168
+ }
169
+ export function emailState(subject, body, sender, clean = true, extra = {},
170
+ // The budget cleanEmailBody cuts the body to, as Python's email_state(max_chars=) (#589).
171
+ // Last, so existing positional calls keep their meaning. Ignored when clean is false.
172
+ maxChars = 3000) {
173
+ const state = {
174
+ subject: (subject ?? "").trim(),
175
+ body: clean ? cleanEmailBody(body ?? "", maxChars) : (body ?? ""),
176
+ };
177
+ if (sender)
178
+ state["from"] = sender;
179
+ for (const [k, v] of Object.entries(extra ?? {})) {
180
+ if (v !== null && v !== undefined)
181
+ state[k] = v;
182
+ }
183
+ return state;
184
+ }
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Opt-in prediction hooks: observe or shape every decision without forking.
3
+ *
4
+ * A hook is either a plain `(ctx) => void` or an object implementing any subset of the
5
+ * lifecycle methods on `Hook`. Hooks are configured on `Agent` / `Router` and can be
6
+ * overridden per call. Port of `laya/hooks.py`.
7
+ */
8
+ /** Mutable state passed to every hook for one call. */
9
+ export declare class PredictContext {
10
+ /** `states` / `questions` may be rewritten by `onPredictStart`. */
11
+ states: unknown[];
12
+ questions: Record<string, unknown>;
13
+ /** Shared by every hook of one call. */
14
+ runId: string;
15
+ /** Set by `skip()` or after inference; `onPredictEnd` may rewrite it. */
16
+ results: Record<string, unknown>[] | null;
17
+ /** Router: the RouteDecision. */
18
+ decision: Record<string, unknown> | null;
19
+ /** Resolved checkpoint name. */
20
+ model: string | null;
21
+ agent: unknown;
22
+ router: unknown;
23
+ /** Per-call token-budget overrides; null = agent config. */
24
+ maxLen: number | null;
25
+ headMaxLen: number | null;
26
+ /** Aggregated input/output tokens across results. */
27
+ usage: Record<string, number> | null;
28
+ startedAt: number;
29
+ elapsedMs: number | null;
30
+ error: unknown;
31
+ constructor(init: {
32
+ states: unknown[];
33
+ questions: Record<string, unknown>;
34
+ } & Partial<PredictContext>);
35
+ /** Set cached results from a start hook; inference is skipped, end hooks still run. */
36
+ skip(results: Record<string, unknown>[]): void;
37
+ /** Set elapsedMs from startedAt. Called by the dispatching call, not by hooks. */
38
+ markElapsed(): void;
39
+ }
40
+ /** Optional lifecycle methods. Implement any subset; missing methods are skipped. */
41
+ export interface Hook {
42
+ onPredictStart?(ctx: PredictContext): void | Promise<void>;
43
+ onPredictEnd?(ctx: PredictContext): void | Promise<void>;
44
+ onRoute?(ctx: PredictContext): void;
45
+ onLoad?(ctx: PredictContext): void | Promise<void>;
46
+ onEvict?(ctx: PredictContext): void | Promise<void>;
47
+ onError?(ctx: PredictContext): void | Promise<void>;
48
+ }
49
+ export type PredictHook = (ctx: PredictContext) => void | Promise<void>;
50
+ export type HookArg = Hook | Hook[] | null | undefined;
51
+ export type PredictHookArg = PredictHook | PredictHook[] | null | undefined;
52
+ export declare const HOOK_EVENTS: readonly ["onPredictStart", "onPredictEnd", "onRoute", "onLoad", "onEvict", "onError"];
53
+ export type HookEvent = (typeof HOOK_EVENTS)[number];
54
+ /**
55
+ * No-op base class: subclass it and override only the events you need.
56
+ *
57
+ * `Hook` is the structural interface; `BaseHook` is the concrete convenience when you would
58
+ * rather subclass than implement methods by shape. Every method does nothing by default.
59
+ */
60
+ export declare class BaseHook implements Hook {
61
+ onPredictStart(_ctx: PredictContext): void;
62
+ onPredictEnd(_ctx: PredictContext): void;
63
+ onRoute(_ctx: PredictContext): void;
64
+ onLoad(_ctx: PredictContext): void;
65
+ onEvict(_ctx: PredictContext): void;
66
+ onError(_ctx: PredictContext): void;
67
+ }
68
+ /**
69
+ * Normalise the hook arguments shared by Agent, Router and every predict call: an optional
70
+ * hook (object or list) plus optional plain start/end callables. A plain callable is not a
71
+ * hook on its own -- which lifecycle event would it bind to? Passing one as `hooks` is a
72
+ * TypeError; pass it as `onPredictStart` / `onPredictEnd` instead. The same callable as both
73
+ * start and end is a TypeError too: the registry dedupes by identity, so one of the two would
74
+ * silently never fire.
75
+ */
76
+ export declare function normaliseHooks(hooks?: unknown, onPredictStart?: PredictHookArg, onPredictEnd?: PredictHookArg): Hook[];
77
+ /** The process-wide hooks, a copy, in order. Empty unless set via `setDefaultHooks`. */
78
+ export declare function defaultHooks(): Hook[];
79
+ /**
80
+ * Replace the process-wide default hooks.
81
+ *
82
+ * Defaults run before installed and per-call hooks for every `Agent` and `Router` in the
83
+ * process, so a tracer or metrics hook does not have to be threaded through every
84
+ * construction. Accepts the same arguments as the `hooks` option.
85
+ */
86
+ export declare function setDefaultHooks(hooks?: HookArg, onPredictStart?: PredictHookArg, onPredictEnd?: PredictHookArg): void;
87
+ /** Append one hook or a list of hooks to the process-wide defaults. */
88
+ export declare function addDefaultHook(hook: HookArg): void;
89
+ /** Remove every process-wide default hook. */
90
+ export declare function clearDefaultHooks(): void;
91
+ /** `Router.predict` marks the options of its Agent call: the Router already ran the defaults for this request. */
92
+ export declare function markDefaultsRan(opts: object): void;
93
+ /** Whether `opts` was marked by `markDefaultsRan`, so the Agent must not run the defaults a second time. */
94
+ export declare function defaultsAlreadyRan(opts: object): boolean;
95
+ /**
96
+ * Effective hook list for one call: defaults, then installed, then per-call hooks.
97
+ *
98
+ * Reads the process-wide defaults at call time, so hooks set after construction still apply.
99
+ */
100
+ export declare function composeHooks(installed: readonly Hook[], hooks?: HookArg, onPredictStart?: PredictHookArg, onPredictEnd?: PredictHookArg): Hook[];
101
+ /**
102
+ * Base class giving a runtime-mutable hook list.
103
+ *
104
+ * `Agent` and `Router` extend it so hooks can be added, removed or scoped after construction.
105
+ * Mutation replaces the array, so a call that already snapshotted its active hooks is never
106
+ * disturbed by an add or remove that lands mid-flight.
107
+ */
108
+ export declare class HookRegistry {
109
+ hooks: Hook[];
110
+ /** Install one hook or a list of them. Returns this for chaining. */
111
+ addHook(hook: HookArg): this;
112
+ /** Remove a hook by identity. Returns true if it was installed. */
113
+ removeHook(hook: unknown): boolean;
114
+ /**
115
+ * Run `fn` with hooks installed, then remove them -- works for sync and async `fn`:
116
+ *
117
+ * await router.withHooks([tracer], () => router.predict(state, questions));
118
+ */
119
+ withHooks<T>(hookArgs: HookArg[], fn: () => T): T;
120
+ }
121
+ /** Sum the per-state usage blocks so a hook sees one total for the call. */
122
+ export declare function aggregateUsage(results: Record<string, unknown>[]): Record<string, number>;
123
+ export declare function dispatch(hooks: Hook[], event: HookEvent, ctx: PredictContext, opts?: {
124
+ raiseErrors?: boolean;
125
+ timeoutMs?: number | null;
126
+ hook?: Hook;
127
+ }): void;
128
+ /** Like `dispatch`, but waits for each hook that returns a promise before the next runs, and a
129
+ * rejection follows `raiseErrors` the way a thrown error does. */
130
+ export declare function dispatchAsync(hooks: Hook[], event: HookEvent, ctx: PredictContext, opts?: {
131
+ raiseErrors?: boolean;
132
+ timeoutMs?: number | null;
133
+ hook?: Hook;
134
+ }): Promise<void>;