@sharpee/if-domain 1.1.1 → 2.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.
- package/changes.d.ts.map +1 -1
- package/changes.js.map +1 -1
- package/channels/index.d.ts.map +1 -1
- package/channels/index.js.map +1 -1
- package/channels/types.d.ts.map +1 -1
- package/channels/types.js.map +1 -1
- package/channels/wire.d.ts.map +1 -1
- package/channels/wire.js.map +1 -1
- package/contracts.d.ts.map +1 -1
- package/contracts.js.map +1 -1
- package/events.d.ts.map +1 -1
- package/events.js.map +1 -1
- package/grammar/grammar-builder.d.ts.map +1 -1
- package/grammar/grammar-builder.js.map +1 -1
- package/grammar/grammar-engine.d.ts.map +1 -1
- package/grammar/grammar-engine.js.map +1 -1
- package/grammar/index.d.ts.map +1 -1
- package/grammar/index.js.map +1 -1
- package/grammar/pattern-compiler.d.ts.map +1 -1
- package/grammar/pattern-compiler.js.map +1 -1
- package/grammar/scope-builder.d.ts.map +1 -1
- package/grammar/scope-builder.js.map +1 -1
- package/grammar/vocabulary-provider.d.ts.map +1 -1
- package/grammar/vocabulary-provider.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/language-provider.d.ts +46 -0
- package/language-provider.d.ts.map +1 -1
- package/language-provider.js.map +1 -1
- package/package.json +3 -3
- package/parser-contracts/index.d.ts.map +1 -1
- package/parser-contracts/index.js.map +1 -1
- package/parser-contracts/parser-factory.d.ts.map +1 -1
- package/parser-contracts/parser-factory.js.map +1 -1
- package/parser-contracts/parser-internals.d.ts.map +1 -1
- package/parser-contracts/parser-internals.js.map +1 -1
- package/parser-contracts/parser-types.d.ts.map +1 -1
- package/parser-contracts/parser-types.js.map +1 -1
- package/parser-language-provider.d.ts.map +1 -1
- package/parser-language-provider.js.map +1 -1
- package/phrase.d.ts +450 -0
- package/phrase.d.ts.map +1 -0
- package/phrase.js +108 -0
- package/phrase.js.map +1 -0
- package/prompt.d.ts.map +1 -1
- package/prompt.js.map +1 -1
- package/sound/index.d.ts.map +1 -1
- package/sound/index.js.map +1 -1
- package/sound/types.d.ts.map +1 -1
- package/sound/types.js.map +1 -1
- package/vocabulary-contracts/index.d.ts.map +1 -1
- package/vocabulary-contracts/index.js.map +1 -1
- package/vocabulary-contracts/vocabulary-adapters.d.ts.map +1 -1
- package/vocabulary-contracts/vocabulary-adapters.js.map +1 -1
- package/vocabulary-contracts/vocabulary-registry.d.ts.map +1 -1
- package/vocabulary-contracts/vocabulary-registry.js.map +1 -1
- package/vocabulary-contracts/vocabulary-types.d.ts.map +1 -1
- package/vocabulary-contracts/vocabulary-types.js.map +1 -1
package/phrase.d.ts
ADDED
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Phrase algebra — language-neutral phrase contracts (ADR-192).
|
|
3
|
+
*
|
|
4
|
+
* Purpose: declare the closed `Phrase` discriminated union, its producer and
|
|
5
|
+
* render-context contracts, and the per-locale `Assembler` interface. These are
|
|
6
|
+
* the language-neutral surface of the phrase algebra that replaces the
|
|
7
|
+
* `messageId → formatter-chain → string` pipeline with
|
|
8
|
+
* `messageId → phrase tree → Assembler → ITextBlock[]`.
|
|
9
|
+
*
|
|
10
|
+
* Public interface: the `Phrase` union (13 members), `PhraseProducer`,
|
|
11
|
+
* `RenderContext` (with the `reference` / `textState` / `contribute` write +
|
|
12
|
+
* `slotContributions` read seams), `Assembler`, and the `isX` kind type guards.
|
|
13
|
+
*
|
|
14
|
+
* Owner context: `@sharpee/if-domain` — language-neutral domain contracts,
|
|
15
|
+
* beside `language-provider.ts` and `contracts.ts`. INVARIANT (ADR-192 AC-10):
|
|
16
|
+
* this file contains NO locale logic and NO article surface strings
|
|
17
|
+
* (a / an / the / some). Article realization belongs to the English Assembler in
|
|
18
|
+
* `@sharpee/lang-en-us`; `articleType` here is a language-neutral selector only.
|
|
19
|
+
*
|
|
20
|
+
* Extensibility (ADR-192 §1): `Phrase` is a CLOSED discriminated union keyed by
|
|
21
|
+
* `kind`. The five foundational kinds are implemented by the Assembler in
|
|
22
|
+
* ADR-192; `Verb` (199), `Verbatim` (200), `Numeral` (198), `Pronoun` (197), and
|
|
23
|
+
* `Contents` (194) are realized follow-on atoms; the remaining three stub kinds are
|
|
24
|
+
* reserved discriminants whose fields and realization land additively in their
|
|
25
|
+
* follow-on ADRs (193 adjectives, 195 Slot, 196 Optional/Choice). Extension is
|
|
26
|
+
* additive only — a new member plus a new Assembler case, never a rewrite.
|
|
27
|
+
*/
|
|
28
|
+
import { EntityId, IEntity } from '@sharpee/core';
|
|
29
|
+
import { IDecoration, ITextBlock } from '@sharpee/text-blocks';
|
|
30
|
+
/**
|
|
31
|
+
* Base carried by every composable phrase: decorations (emphasis / code) that
|
|
32
|
+
* survive composition and are realized by the Assembler. The literal article
|
|
33
|
+
* string is deliberately absent — see the file invariant.
|
|
34
|
+
*/
|
|
35
|
+
export interface PhraseBase {
|
|
36
|
+
/** Emphasis / code decorations carried through composition. */
|
|
37
|
+
decorations?: IDecoration[];
|
|
38
|
+
}
|
|
39
|
+
/** Raw author text. The whitespace authority collapses `normal`, exempts `verbatim`. */
|
|
40
|
+
export interface Literal extends PhraseBase {
|
|
41
|
+
kind: 'literal';
|
|
42
|
+
text: string;
|
|
43
|
+
/** `verbatim` exempts the text from whitespace collapse. Default `normal`. */
|
|
44
|
+
whitespace?: 'normal' | 'verbatim';
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Article + adjectives + noun, agreed as a whole. The `name` is the base noun
|
|
48
|
+
* (computed names → ADR-193); `adjectives` are static in ADR-192 (state-derived
|
|
49
|
+
* contributors → ADR-193). `articleType` selects the article language-neutrally;
|
|
50
|
+
* the a/an/the/some surface is computed by the Assembler over the rendered head.
|
|
51
|
+
*/
|
|
52
|
+
export interface NounPhrase extends PhraseBase {
|
|
53
|
+
kind: 'noun';
|
|
54
|
+
/** Base noun. */
|
|
55
|
+
name: string;
|
|
56
|
+
/** Static adjectives (ADR-192 AC-4); state-derived adjectives land in ADR-193. */
|
|
57
|
+
adjectives?: string[];
|
|
58
|
+
number: 'singular' | 'plural' | 'mass';
|
|
59
|
+
/**
|
|
60
|
+
* Grammatical person, the verb-agreement surface a referencing `Verb` reads
|
|
61
|
+
* (ADR-199 §4). Unset is treated as third person; the player in 2nd-person
|
|
62
|
+
* narrative is stamped `'second'` so `{verb:is actor}` takes the plural form
|
|
63
|
+
* ("you are"). Language-neutral selector — no verb surface lives here.
|
|
64
|
+
*/
|
|
65
|
+
person?: 'first' | 'second' | 'third';
|
|
66
|
+
/** Suppresses the article when true. */
|
|
67
|
+
properName?: boolean;
|
|
68
|
+
articleType: 'indefinite' | 'definite' | 'some' | 'none';
|
|
69
|
+
/** Author override for irregular plurals. */
|
|
70
|
+
pluralForm?: string;
|
|
71
|
+
/** Last-mentioned tracking → `Pronoun` resolution (ADR-197). */
|
|
72
|
+
referableId?: EntityId;
|
|
73
|
+
/** Pronoun set for later gendered / neopronoun reference (ADR-197). */
|
|
74
|
+
pronounSet?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Sentence-start capitalization requested by the `{capitalize …}` template
|
|
77
|
+
* hint (ADR-192 §5). The Assembler's Case authority upper-cases the rendered
|
|
78
|
+
* head's first letter when set. Language-neutral request, not a surface string.
|
|
79
|
+
*/
|
|
80
|
+
capitalize?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/** Combinator: group / pluralize / serial-comma over its items (ports ADR-190). */
|
|
83
|
+
export interface PhraseList extends PhraseBase {
|
|
84
|
+
kind: 'list';
|
|
85
|
+
items: Phrase[];
|
|
86
|
+
conj: 'and' | 'or';
|
|
87
|
+
}
|
|
88
|
+
/** Combinator: ordered join under one punctuation authority. */
|
|
89
|
+
export interface Sequence extends PhraseBase {
|
|
90
|
+
kind: 'seq';
|
|
91
|
+
parts: Phrase[];
|
|
92
|
+
}
|
|
93
|
+
/** Atom: realizes to "" and is absorbed by combinators (no dangling comma). */
|
|
94
|
+
export interface Empty {
|
|
95
|
+
kind: 'empty';
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Verb atom (ADR-199): defers a verb's surface and agrees its number/person
|
|
99
|
+
* with a referenced subject phrase at realize time. Replaces the legacy
|
|
100
|
+
* `{is:}` / `{was:}` / `{has:}` formatters. A follow-on atom of ADR-192 —
|
|
101
|
+
* additive (new union member + one Assembler case), no core rewrite.
|
|
102
|
+
*
|
|
103
|
+
* `lemma` is the 3rd-person-singular surface the author types ('is','was',
|
|
104
|
+
* 'has','opens'); the agreed (plural / person-marked) form is the Assembler's
|
|
105
|
+
* Agreement authority to compute — NO conjugation strings live here, exactly as
|
|
106
|
+
* `NounPhrase` carries `articleType` and never the a/an surface.
|
|
107
|
+
*/
|
|
108
|
+
export interface Verb extends PhraseBase {
|
|
109
|
+
kind: 'verb';
|
|
110
|
+
/** 3rd-person-singular surface the author types: 'is', 'was', 'has', 'opens'. */
|
|
111
|
+
lemma: string;
|
|
112
|
+
/** Param/producer name of the subject phrase to agree number/person with. */
|
|
113
|
+
subjectRef: string;
|
|
114
|
+
/** Default 'third'; the subject's own `person` takes precedence when present. */
|
|
115
|
+
person?: 'first' | 'second' | 'third';
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Atom — a pronoun ("it"/"them"/"his"/…) agreeing in case, number, and gender
|
|
119
|
+
* with the last-mentioned referent (ADR-197). Language-neutral: the he/she/it/they
|
|
120
|
+
* surface tables live in the locale Assembler; only the grammatical `case` is here.
|
|
121
|
+
*/
|
|
122
|
+
export interface Pronoun extends PhraseBase {
|
|
123
|
+
kind: 'pronoun';
|
|
124
|
+
case: 'subject' | 'object' | 'possessive' | 'possessive-pronoun' | 'reflexive';
|
|
125
|
+
/**
|
|
126
|
+
* S40 capitalization override (ADR-201 §2, Q1). `true` ⇒ always cap; `false` ⇒
|
|
127
|
+
* never cap (even sentence-initial); absent ⇒ cap iff sentence-initial (driven
|
|
128
|
+
* by `RenderContext.position`). The precedence logic is realizer-side (ADR-201
|
|
129
|
+
* §3.2 / Phase 4); this field is the explicit author opt.
|
|
130
|
+
*/
|
|
131
|
+
capitalize?: boolean;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Atom — a numeric value rendered as digits, spelled-out words, or an ordinal
|
|
135
|
+
* (ADR-198). Language-neutral: `value` is the number; the spelled surface
|
|
136
|
+
* ("seven", "3rd") is the Assembler's to compute (no number words here).
|
|
137
|
+
*/
|
|
138
|
+
export interface Numeral extends PhraseBase {
|
|
139
|
+
kind: 'number';
|
|
140
|
+
/** The numeric value to render. */
|
|
141
|
+
value: number;
|
|
142
|
+
/** How to render it. Default `digits`. */
|
|
143
|
+
format: 'digits' | 'words' | 'ordinal';
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Atom — opaque text passed through untouched and exempt from whitespace
|
|
147
|
+
* collapse (ADR-200). The phrase home for non-entity scalars (names, directions,
|
|
148
|
+
* free text, banners) the old chain substituted with a bare `String(value)`.
|
|
149
|
+
*/
|
|
150
|
+
export interface Verbatim extends PhraseBase {
|
|
151
|
+
kind: 'verbatim';
|
|
152
|
+
/** The opaque value, rendered verbatim. */
|
|
153
|
+
text: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Combinator — an entity's direct contents, read from the live world at realize
|
|
157
|
+
* time and grouped as a list (ADR-194). `containerRef` names the container param.
|
|
158
|
+
*/
|
|
159
|
+
export interface Contents extends PhraseBase {
|
|
160
|
+
kind: 'contents';
|
|
161
|
+
/** Param naming the container (a `NounPhrase` carrying `referableId`, or an id). */
|
|
162
|
+
containerRef: string;
|
|
163
|
+
/** List conjunction. Default `and`. */
|
|
164
|
+
conj?: 'and' | 'or';
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Combinator — an open, named append target (ADR-195). Several independent
|
|
168
|
+
* sources `contribute` bare clause/sentence content to `slotKey` during the
|
|
169
|
+
* turn; at realize time the Assembler collects them, orders them
|
|
170
|
+
* deterministically, and joins them under ONE punctuation authority — the slot
|
|
171
|
+
* owns every comma, "and", and sentence break, the contribution is bare content.
|
|
172
|
+
*
|
|
173
|
+
* `mode` selects the join grammar (default `sentence`): `sentence` joins
|
|
174
|
+
* contributions as independent sentences after the stem's terminator; `clause`
|
|
175
|
+
* joins them as clauses through the punctuation authority (serial comma + final
|
|
176
|
+
* `conj`) before the terminator. `conj` is that final connective for `clause`
|
|
177
|
+
* mode (default `and`). Language-neutral: no connective surface lives here.
|
|
178
|
+
*/
|
|
179
|
+
export interface Slot extends PhraseBase {
|
|
180
|
+
kind: 'slot';
|
|
181
|
+
/** The contribution channel name (`{slot:here}` → `slotKey: 'here'`). */
|
|
182
|
+
slotKey: string;
|
|
183
|
+
/** Join grammar. Default `sentence`. */
|
|
184
|
+
mode?: 'sentence' | 'clause';
|
|
185
|
+
/** Final connective for `clause` mode. Default `and`. */
|
|
186
|
+
conj?: 'and' | 'or';
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Modifier — a phrase that renders its `child` **or `Empty`**, gated by a boolean
|
|
190
|
+
* the PRODUCER resolves from world state (ADR-196 §1). Realization is stateless:
|
|
191
|
+
* `present ? realize(child) : Empty`. The conditional-clause mechanism (scenarios
|
|
192
|
+
* S9–S10). `present: false` yields `Empty`, absorbed by the enclosing combinator
|
|
193
|
+
* (ADR-192 AC-6) so no dangling comma/whitespace survives. The boolean is resolved
|
|
194
|
+
* at tree-build time — there is NO realize-time world read.
|
|
195
|
+
*/
|
|
196
|
+
export interface Optional extends PhraseBase {
|
|
197
|
+
kind: 'optional';
|
|
198
|
+
/** The phrase realized when `present` is true. */
|
|
199
|
+
child: Phrase;
|
|
200
|
+
/** Resolved by the producer from world state; NOT read at realize time. */
|
|
201
|
+
present: boolean;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Modifier — a phrase that renders **one of** `alternatives`, selected by a
|
|
205
|
+
* deterministic, persistent selector keyed to `(entityId, messageKey)` in the
|
|
206
|
+
* text-state store (ADR-196 §2). The ONLY kind that reads/writes `ctx.textState`;
|
|
207
|
+
* the selector advances a per-`(entityId, messageKey)` counter at realize time.
|
|
208
|
+
* Variation / cycling / first-time text (scenarios S12–S14).
|
|
209
|
+
*/
|
|
210
|
+
export interface Choice extends PhraseBase {
|
|
211
|
+
kind: 'choice';
|
|
212
|
+
/** The variants; length ≥ 1. An alternative MAY be `Empty` (once-only text). */
|
|
213
|
+
alternatives: Phrase[];
|
|
214
|
+
/**
|
|
215
|
+
* Selection strategy (ADR-196 §2):
|
|
216
|
+
* - `cycling` — advance through variants, wrapping (`i = n % len`).
|
|
217
|
+
* - `stopping` — advance to the last variant, then stick (`i = min(n, len-1)`).
|
|
218
|
+
* - `sticky` — pick once (seeded), then replay that variant.
|
|
219
|
+
* - `random` — seeded pick each trigger; deterministic from the counter.
|
|
220
|
+
* - `firstTime` — `alt[0]` first, `alt[1]` after (`alt[1]` may be `Empty`).
|
|
221
|
+
*/
|
|
222
|
+
selector: 'cycling' | 'stopping' | 'sticky' | 'random' | 'firstTime';
|
|
223
|
+
/** The entity the variation is keyed to (text-state primary key). */
|
|
224
|
+
entityId: EntityId;
|
|
225
|
+
/** Stable per-choice-site key (text-state secondary key). */
|
|
226
|
+
messageKey: string;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Atom — a sentence boundary (ADR-201 §2). Declares that `child` realizes as a
|
|
230
|
+
* sentence: its first glyph is capitalized and a terminal mark is emitted at its
|
|
231
|
+
* close. The structural carrier of "capitalize the start" (ADR-202) — the
|
|
232
|
+
* Assembler drives sentence-start casing from this boundary, not by scanning
|
|
233
|
+
* prose. Not author-facing in v1 (emitted by message structure / `Quote`).
|
|
234
|
+
*/
|
|
235
|
+
export interface Sentence extends PhraseBase {
|
|
236
|
+
kind: 'sentence';
|
|
237
|
+
/** The content realized as a sentence. */
|
|
238
|
+
child: Phrase;
|
|
239
|
+
/** Terminal punctuation emitted at the sentence close. Default `.`. */
|
|
240
|
+
terminal?: '.' | '?' | '!';
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Atom — a quoted utterance (ADR-201 §2). Wraps an `utterance` `Phrase` and owns
|
|
244
|
+
* the surrounding quote glyphs (locale-tuned via `LocaleSettings`), capitalization
|
|
245
|
+
* of the utterance's first word, terminal-punctuation-INSIDE the closing quote,
|
|
246
|
+
* and the attributive comma owed to an enclosing dialogue tag. Implies a
|
|
247
|
+
* `Sentence` boundary for its contents.
|
|
248
|
+
*/
|
|
249
|
+
export interface Quote extends PhraseBase {
|
|
250
|
+
kind: 'quote';
|
|
251
|
+
/** The quoted words; glyphs / first-word cap / terminal-inside are realizer-applied. */
|
|
252
|
+
utterance: Phrase;
|
|
253
|
+
/** Punctuation placed INSIDE the closing quote. Default `.`. */
|
|
254
|
+
terminal?: '.' | '?' | '!';
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The closed phrase algebra. Foundational members are realized in ADR-192,
|
|
258
|
+
* `Verb` in ADR-199, and `Sentence`/`Quote` in ADR-201; remaining stubs are
|
|
259
|
+
* reserved for their follow-on ADRs. Extension is additive.
|
|
260
|
+
*/
|
|
261
|
+
export type Phrase = Literal | NounPhrase | PhraseList | Sequence | Empty | Verb | Pronoun | Numeral | Verbatim | Contents | Slot | Optional | Choice | Sentence | Quote;
|
|
262
|
+
/**
|
|
263
|
+
* Read-only world access for realization. Language-neutral subset of the world
|
|
264
|
+
* model exposed to the Assembler — no mutation, no parser or command surface.
|
|
265
|
+
*/
|
|
266
|
+
export interface RenderWorld {
|
|
267
|
+
/** Resolve an entity by id, or undefined if absent. */
|
|
268
|
+
getEntity(entityId: EntityId): IEntity | undefined;
|
|
269
|
+
/** Direct contents of an entity. */
|
|
270
|
+
getEntityContents(entityId: EntityId): IEntity[];
|
|
271
|
+
/** The room transitively containing an entity, if any. */
|
|
272
|
+
getContainingRoom(entityId: EntityId): IEntity | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* Produce the `NounPhrase` for an entity id (ADR-194) — the entity→phrase bridge
|
|
275
|
+
* `Contents`/`Slot` realize through. Optional: present when the engine wired it to
|
|
276
|
+
* the producer (`nounPhraseFor`); absent in bare/world-less render stubs.
|
|
277
|
+
*/
|
|
278
|
+
nounPhraseFor?(entityId: EntityId): NounPhrase | undefined;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Locale-tunable realization settings. Language-neutral knobs only; the English
|
|
282
|
+
* Assembler reads what it needs and ignores the rest.
|
|
283
|
+
*/
|
|
284
|
+
export interface LocaleSettings {
|
|
285
|
+
/** Serial (Oxford) comma in lists. Default on. */
|
|
286
|
+
serialComma?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Opening quote glyph for `Quote` (ADR-201 §2). The default (`"`) is applied by
|
|
289
|
+
* the locale realizer (lang-en-us) — kept out of if-domain so no locale logic
|
|
290
|
+
* lives here.
|
|
291
|
+
*/
|
|
292
|
+
openQuote?: string;
|
|
293
|
+
/** Closing quote glyph for `Quote` (ADR-201 §2). Default applied by the realizer. */
|
|
294
|
+
closeQuote?: string;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Narrative agreement context for verb-person resolution (ADR-199 §4 B).
|
|
298
|
+
*
|
|
299
|
+
* The player is the only subject that takes 1st/2nd-person agreement, and which
|
|
300
|
+
* grammatical person it takes depends on the story's narration. Carrying the
|
|
301
|
+
* player's id plus the narrative person here lets the Assembler's Agreement
|
|
302
|
+
* authority give the player subject the right verb form ("you **are**") without
|
|
303
|
+
* any producer needing the perspective at build time.
|
|
304
|
+
*/
|
|
305
|
+
export interface NarrativeAgreement {
|
|
306
|
+
/** Grammatical person of the player subject under the current narration. */
|
|
307
|
+
person: 'first' | 'second' | 'third';
|
|
308
|
+
/** The player entity's id, matched against a subject's `referableId`. */
|
|
309
|
+
playerId?: EntityId;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* The agreement surface of a last-mentioned referent — enough for a `Pronoun` to
|
|
313
|
+
* choose its surface (case × number × gender) without re-reading the world (ADR-197).
|
|
314
|
+
*/
|
|
315
|
+
export interface Mentioned {
|
|
316
|
+
/** The referent entity's id. */
|
|
317
|
+
referableId: EntityId;
|
|
318
|
+
/** Its grammatical number. */
|
|
319
|
+
number: 'singular' | 'plural' | 'mass';
|
|
320
|
+
/** Its pronoun set ('he' | 'she' | 'it' | 'they', or a named set); optional. */
|
|
321
|
+
pronounSet?: string;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Last-mentioned reference context — the seam a later `Pronoun` consumes (ADR-197).
|
|
325
|
+
* The Assembler `note`s each realized `NounPhrase`'s surface; `lastMentioned`
|
|
326
|
+
* returns the most recent.
|
|
327
|
+
*/
|
|
328
|
+
export interface ReferenceContext {
|
|
329
|
+
/** The referent most recently realized this turn, if any. */
|
|
330
|
+
lastMentioned(): Mentioned | undefined;
|
|
331
|
+
/** Record a referent as last-mentioned. */
|
|
332
|
+
note(mentioned: Mentioned): void;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Per-`(entityId, messageKey)` persistent store backing deterministic
|
|
336
|
+
* `Choice` / `Optional`. SEAM (ADR-196): implementation and final shape owned by
|
|
337
|
+
* ADR-196; declared here so the seeded-selection contract is named now.
|
|
338
|
+
*/
|
|
339
|
+
export interface TextStateStore {
|
|
340
|
+
get(entityId: EntityId, messageKey: string): number | undefined;
|
|
341
|
+
set(entityId: EntityId, messageKey: string, value: number): void;
|
|
342
|
+
}
|
|
343
|
+
/** Options for a slot contribution. SEAM (ADR-195). */
|
|
344
|
+
export interface SlotContributionOptions {
|
|
345
|
+
/** Ordering hint among contributions to the same slot. */
|
|
346
|
+
order?: number;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Read-mostly position state threaded down the recursive realizer (ADR-201 §4).
|
|
350
|
+
* Lets sentence-start capitalization and quote nesting fall out of structure
|
|
351
|
+
* instead of prose-scanning (ADR-202). Per-render and ephemeral — never persisted.
|
|
352
|
+
*/
|
|
353
|
+
export interface RenderPosition {
|
|
354
|
+
/** The next atom realizes at a sentence start (→ cap-eligible first glyph). */
|
|
355
|
+
sentenceInitial: boolean;
|
|
356
|
+
/** Currently within a `Quote`'s utterance. */
|
|
357
|
+
insideQuote: boolean;
|
|
358
|
+
/** Terminal punctuation owed when the enclosing sentence closes. */
|
|
359
|
+
pendingTerminal?: '.' | '?' | '!';
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* The context a producer realizes against: a read-only world, the bound params,
|
|
363
|
+
* locale settings, and the three declared seams. The seam METHODS are part of
|
|
364
|
+
* the contract now; their behavior is filled in by ADR-195–197.
|
|
365
|
+
*/
|
|
366
|
+
export interface RenderContext {
|
|
367
|
+
/** Read-only world access. */
|
|
368
|
+
readonly world: RenderWorld;
|
|
369
|
+
/** Params bound for this message (producer references resolve against these). */
|
|
370
|
+
readonly params: Record<string, unknown>;
|
|
371
|
+
/** Locale realization settings. */
|
|
372
|
+
readonly settings: LocaleSettings;
|
|
373
|
+
/** Narrative agreement context — player id + person for verb agreement (ADR-199 §4 B). */
|
|
374
|
+
readonly narrative: NarrativeAgreement;
|
|
375
|
+
/** Last-mentioned context (consumed by `Pronoun`, ADR-197). */
|
|
376
|
+
readonly reference: ReferenceContext;
|
|
377
|
+
/** Per-`(entityId, messageKey)` store (consumed by `Choice`/`Optional`, ADR-196). */
|
|
378
|
+
readonly textState: TextStateStore;
|
|
379
|
+
/** Slot contribution channel — write side (ADR-192/195). */
|
|
380
|
+
contribute(slotKey: string, phrase: Phrase, opts?: SlotContributionOptions): void;
|
|
381
|
+
/**
|
|
382
|
+
* Slot contribution channel — read side (ADR-195). Returns the contributions
|
|
383
|
+
* staged for `slotKey` this turn, ordered by `(order asc, insertion asc)`.
|
|
384
|
+
* A PEEK, not a drain: it never consumes the store, so two `{slot:key}` nodes
|
|
385
|
+
* sharing a key see the same contributions and repeated reads are stable.
|
|
386
|
+
*
|
|
387
|
+
* OPTIONAL — matching `RenderWorld.nounPhraseFor?`'s optional-seam precedent
|
|
388
|
+
* (ADR-194): a context that never wired the store (world-less render stubs)
|
|
389
|
+
* omits it, and the Assembler reads `ctx.slotContributions?.(key) ?? []`, so an
|
|
390
|
+
* absent accessor yields no contributions and the slot realizes `Empty`.
|
|
391
|
+
*/
|
|
392
|
+
slotContributions?(slotKey: string): Phrase[];
|
|
393
|
+
/**
|
|
394
|
+
* Sentence/quote position state (ADR-201 §4). OPTIONAL — matching the
|
|
395
|
+
* `slotContributions?` optional-seam precedent: an absent `position` degrades
|
|
396
|
+
* to "not sentence-initial, not in quote" (today's behavior), so existing
|
|
397
|
+
* render paths that don't supply it are unaffected.
|
|
398
|
+
*/
|
|
399
|
+
readonly position?: RenderPosition;
|
|
400
|
+
}
|
|
401
|
+
/** Code that emits a phrase from world state. May return `Empty`. */
|
|
402
|
+
export type PhraseProducer = (ctx: RenderContext) => Phrase;
|
|
403
|
+
/**
|
|
404
|
+
* The single per-locale component that realizes a phrase tree to text and owns
|
|
405
|
+
* every cross-cutting correctness concern (article, agreement, punctuation,
|
|
406
|
+
* whitespace, reference, case). The English implementation lives in
|
|
407
|
+
* `@sharpee/lang-en-us`; it emits the unchanged `ITextBlock[]` contract.
|
|
408
|
+
*/
|
|
409
|
+
export interface Assembler {
|
|
410
|
+
/**
|
|
411
|
+
* Realize a phrase tree to text blocks. Pure function of `(tree, world, ctx)`
|
|
412
|
+
* (ADR-192 §7): identical inputs yield identical output.
|
|
413
|
+
*
|
|
414
|
+
* @param tree the phrase tree to realize
|
|
415
|
+
* @param ctx the render context (world, params, settings, seams)
|
|
416
|
+
* @returns the realized text blocks
|
|
417
|
+
*/
|
|
418
|
+
realize(tree: Phrase, ctx: RenderContext): ITextBlock[];
|
|
419
|
+
}
|
|
420
|
+
/** @returns true if the phrase is a `Literal`. */
|
|
421
|
+
export declare function isLiteral(p: Phrase): p is Literal;
|
|
422
|
+
/** @returns true if the phrase is a `NounPhrase`. */
|
|
423
|
+
export declare function isNounPhrase(p: Phrase): p is NounPhrase;
|
|
424
|
+
/** @returns true if the phrase is a `PhraseList`. */
|
|
425
|
+
export declare function isPhraseList(p: Phrase): p is PhraseList;
|
|
426
|
+
/** @returns true if the phrase is a `Sequence`. */
|
|
427
|
+
export declare function isSequence(p: Phrase): p is Sequence;
|
|
428
|
+
/** @returns true if the phrase is `Empty`. */
|
|
429
|
+
export declare function isEmpty(p: Phrase): p is Empty;
|
|
430
|
+
/** @returns true if the phrase is a `Verb` (ADR-199). */
|
|
431
|
+
export declare function isVerb(p: Phrase): p is Verb;
|
|
432
|
+
/** @returns true if the phrase is a `Pronoun` (ADR-197). */
|
|
433
|
+
export declare function isPronoun(p: Phrase): p is Pronoun;
|
|
434
|
+
/** @returns true if the phrase is a `Numeral` (ADR-198). */
|
|
435
|
+
export declare function isNumeral(p: Phrase): p is Numeral;
|
|
436
|
+
/** @returns true if the phrase is `Verbatim`. */
|
|
437
|
+
export declare function isVerbatim(p: Phrase): p is Verbatim;
|
|
438
|
+
/** @returns true if the phrase is `Contents` (ADR-194). */
|
|
439
|
+
export declare function isContents(p: Phrase): p is Contents;
|
|
440
|
+
/** @returns true if the phrase is a `Slot` (ADR-195). */
|
|
441
|
+
export declare function isSlot(p: Phrase): p is Slot;
|
|
442
|
+
/** @returns true if the phrase is `Optional` (ADR-196). */
|
|
443
|
+
export declare function isOptional(p: Phrase): p is Optional;
|
|
444
|
+
/** @returns true if the phrase is a `Choice` (ADR-196). */
|
|
445
|
+
export declare function isChoice(p: Phrase): p is Choice;
|
|
446
|
+
/** @returns true if the phrase is a `Sentence` (ADR-201). */
|
|
447
|
+
export declare function isSentence(p: Phrase): p is Sentence;
|
|
448
|
+
/** @returns true if the phrase is a `Quote` (ADR-201). */
|
|
449
|
+
export declare function isQuote(p: Phrase): p is Quote;
|
|
450
|
+
//# sourceMappingURL=phrase.d.ts.map
|
package/phrase.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phrase.d.ts","sourceRoot":"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AAED,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,QAAQ,CAEnD;AAED,yDAAyD;AACzD,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,IAAI,CAE3C;AAED,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,QAAQ,CAEnD;AAED,2DAA2D;AAC3D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,MAAM,CAE/C;AAED,6DAA6D;AAC7D,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,QAAQ,CAEnD;AAED,0DAA0D;AAC1D,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,KAAK,CAE7C"}
|
package/phrase.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Phrase algebra — language-neutral phrase contracts (ADR-192).
|
|
4
|
+
*
|
|
5
|
+
* Purpose: declare the closed `Phrase` discriminated union, its producer and
|
|
6
|
+
* render-context contracts, and the per-locale `Assembler` interface. These are
|
|
7
|
+
* the language-neutral surface of the phrase algebra that replaces the
|
|
8
|
+
* `messageId → formatter-chain → string` pipeline with
|
|
9
|
+
* `messageId → phrase tree → Assembler → ITextBlock[]`.
|
|
10
|
+
*
|
|
11
|
+
* Public interface: the `Phrase` union (13 members), `PhraseProducer`,
|
|
12
|
+
* `RenderContext` (with the `reference` / `textState` / `contribute` write +
|
|
13
|
+
* `slotContributions` read seams), `Assembler`, and the `isX` kind type guards.
|
|
14
|
+
*
|
|
15
|
+
* Owner context: `@sharpee/if-domain` — language-neutral domain contracts,
|
|
16
|
+
* beside `language-provider.ts` and `contracts.ts`. INVARIANT (ADR-192 AC-10):
|
|
17
|
+
* this file contains NO locale logic and NO article surface strings
|
|
18
|
+
* (a / an / the / some). Article realization belongs to the English Assembler in
|
|
19
|
+
* `@sharpee/lang-en-us`; `articleType` here is a language-neutral selector only.
|
|
20
|
+
*
|
|
21
|
+
* Extensibility (ADR-192 §1): `Phrase` is a CLOSED discriminated union keyed by
|
|
22
|
+
* `kind`. The five foundational kinds are implemented by the Assembler in
|
|
23
|
+
* ADR-192; `Verb` (199), `Verbatim` (200), `Numeral` (198), `Pronoun` (197), and
|
|
24
|
+
* `Contents` (194) are realized follow-on atoms; the remaining three stub kinds are
|
|
25
|
+
* reserved discriminants whose fields and realization land additively in their
|
|
26
|
+
* follow-on ADRs (193 adjectives, 195 Slot, 196 Optional/Choice). Extension is
|
|
27
|
+
* additive only — a new member plus a new Assembler case, never a rewrite.
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.isLiteral = isLiteral;
|
|
31
|
+
exports.isNounPhrase = isNounPhrase;
|
|
32
|
+
exports.isPhraseList = isPhraseList;
|
|
33
|
+
exports.isSequence = isSequence;
|
|
34
|
+
exports.isEmpty = isEmpty;
|
|
35
|
+
exports.isVerb = isVerb;
|
|
36
|
+
exports.isPronoun = isPronoun;
|
|
37
|
+
exports.isNumeral = isNumeral;
|
|
38
|
+
exports.isVerbatim = isVerbatim;
|
|
39
|
+
exports.isContents = isContents;
|
|
40
|
+
exports.isSlot = isSlot;
|
|
41
|
+
exports.isOptional = isOptional;
|
|
42
|
+
exports.isChoice = isChoice;
|
|
43
|
+
exports.isSentence = isSentence;
|
|
44
|
+
exports.isQuote = isQuote;
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// Kind type guards
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
/** @returns true if the phrase is a `Literal`. */
|
|
49
|
+
function isLiteral(p) {
|
|
50
|
+
return p.kind === 'literal';
|
|
51
|
+
}
|
|
52
|
+
/** @returns true if the phrase is a `NounPhrase`. */
|
|
53
|
+
function isNounPhrase(p) {
|
|
54
|
+
return p.kind === 'noun';
|
|
55
|
+
}
|
|
56
|
+
/** @returns true if the phrase is a `PhraseList`. */
|
|
57
|
+
function isPhraseList(p) {
|
|
58
|
+
return p.kind === 'list';
|
|
59
|
+
}
|
|
60
|
+
/** @returns true if the phrase is a `Sequence`. */
|
|
61
|
+
function isSequence(p) {
|
|
62
|
+
return p.kind === 'seq';
|
|
63
|
+
}
|
|
64
|
+
/** @returns true if the phrase is `Empty`. */
|
|
65
|
+
function isEmpty(p) {
|
|
66
|
+
return p.kind === 'empty';
|
|
67
|
+
}
|
|
68
|
+
/** @returns true if the phrase is a `Verb` (ADR-199). */
|
|
69
|
+
function isVerb(p) {
|
|
70
|
+
return p.kind === 'verb';
|
|
71
|
+
}
|
|
72
|
+
/** @returns true if the phrase is a `Pronoun` (ADR-197). */
|
|
73
|
+
function isPronoun(p) {
|
|
74
|
+
return p.kind === 'pronoun';
|
|
75
|
+
}
|
|
76
|
+
/** @returns true if the phrase is a `Numeral` (ADR-198). */
|
|
77
|
+
function isNumeral(p) {
|
|
78
|
+
return p.kind === 'number';
|
|
79
|
+
}
|
|
80
|
+
/** @returns true if the phrase is `Verbatim`. */
|
|
81
|
+
function isVerbatim(p) {
|
|
82
|
+
return p.kind === 'verbatim';
|
|
83
|
+
}
|
|
84
|
+
/** @returns true if the phrase is `Contents` (ADR-194). */
|
|
85
|
+
function isContents(p) {
|
|
86
|
+
return p.kind === 'contents';
|
|
87
|
+
}
|
|
88
|
+
/** @returns true if the phrase is a `Slot` (ADR-195). */
|
|
89
|
+
function isSlot(p) {
|
|
90
|
+
return p.kind === 'slot';
|
|
91
|
+
}
|
|
92
|
+
/** @returns true if the phrase is `Optional` (ADR-196). */
|
|
93
|
+
function isOptional(p) {
|
|
94
|
+
return p.kind === 'optional';
|
|
95
|
+
}
|
|
96
|
+
/** @returns true if the phrase is a `Choice` (ADR-196). */
|
|
97
|
+
function isChoice(p) {
|
|
98
|
+
return p.kind === 'choice';
|
|
99
|
+
}
|
|
100
|
+
/** @returns true if the phrase is a `Sentence` (ADR-201). */
|
|
101
|
+
function isSentence(p) {
|
|
102
|
+
return p.kind === 'sentence';
|
|
103
|
+
}
|
|
104
|
+
/** @returns true if the phrase is a `Quote` (ADR-201). */
|
|
105
|
+
function isQuote(p) {
|
|
106
|
+
return p.kind === 'quote';
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=phrase.js.map
|
package/phrase.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phrase.js","sourceRoot":"","sources":["../../../../../../repos/sharpee_v2/packages/if-domain/src/phrase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;AAudH,8BAEC;AAGD,oCAEC;AAGD,oCAEC;AAGD,gCAEC;AAGD,0BAEC;AAGD,wBAEC;AAGD,8BAEC;AAGD,8BAEC;AAGD,gCAEC;AAGD,gCAEC;AAGD,wBAEC;AAGD,gCAEC;AAGD,4BAEC;AAGD,gCAEC;AAGD,0BAEC;AA7ED,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,kDAAkD;AAClD,SAAgB,SAAS,CAAC,CAAS;IACjC,OAAO,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;AAC9B,CAAC;AAED,qDAAqD;AACrD,SAAgB,YAAY,CAAC,CAAS;IACpC,OAAO,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;AAC3B,CAAC;AAED,qDAAqD;AACrD,SAAgB,YAAY,CAAC,CAAS;IACpC,OAAO,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;AAC3B,CAAC;AAED,mDAAmD;AACnD,SAAgB,UAAU,CAAC,CAAS;IAClC,OAAO,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC;AAC1B,CAAC;AAED,8CAA8C;AAC9C,SAAgB,OAAO,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC;AAC5B,CAAC;AAED,yDAAyD;AACzD,SAAgB,MAAM,CAAC,CAAS;IAC9B,OAAO,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;AAC3B,CAAC;AAED,4DAA4D;AAC5D,SAAgB,SAAS,CAAC,CAAS;IACjC,OAAO,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;AAC9B,CAAC;AAED,4DAA4D;AAC5D,SAAgB,SAAS,CAAC,CAAS;IACjC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC7B,CAAC;AAED,iDAAiD;AACjD,SAAgB,UAAU,CAAC,CAAS;IAClC,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;AAC/B,CAAC;AAED,2DAA2D;AAC3D,SAAgB,UAAU,CAAC,CAAS;IAClC,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;AAC/B,CAAC;AAED,yDAAyD;AACzD,SAAgB,MAAM,CAAC,CAAS;IAC9B,OAAO,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;AAC3B,CAAC;AAED,2DAA2D;AAC3D,SAAgB,UAAU,CAAC,CAAS;IAClC,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;AAC/B,CAAC;AAED,2DAA2D;AAC3D,SAAgB,QAAQ,CAAC,CAAS;IAChC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC7B,CAAC;AAED,6DAA6D;AAC7D,SAAgB,UAAU,CAAC,CAAS;IAClC,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;AAC/B,CAAC;AAED,0DAA0D;AAC1D,SAAgB,OAAO,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC;AAC5B,CAAC"}
|
package/prompt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee_v2/packages/if-domain/src/prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,UAAgD,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,gBAAgB,cAAc,CAAC"}
|
package/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../repos/sharpee_v2/packages/if-domain/src/prompt.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAiBH;;;GAGG;AACU,QAAA,aAAa,GAAe,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;AAE7E;;GAEG;AACU,QAAA,gBAAgB,GAAG,WAAW,CAAC"}
|
package/sound/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee_v2/packages/if-domain/src/sound/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,SAAS,CAAC"}
|
package/sound/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee_v2/packages/if-domain/src/sound/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;AAEH,0CAAwB"}
|
package/sound/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee_v2/packages/if-domain/src/sound/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAM9C;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAMnE,CAAC;AAMH;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;AAM3F;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC5C;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;CAClC;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,8DAA8D;IAC9D,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAC3D,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B"}
|
package/sound/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee_v2/packages/if-domain/src/sound/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;AAoBH;;;;;;;;GAQG;AACU,QAAA,mBAAmB,GAAyC,MAAM,CAAC,MAAM,CAAC;IACrF,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,CAAC;CACZ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee_v2/packages/if-domain/src/vocabulary-contracts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee_v2/packages/if-domain/src/vocabulary-contracts/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,qDAAmC;AACnC,wDAAsC;AACtC,wDAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabulary-adapters.d.ts","sourceRoot":"","sources":["../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"vocabulary-adapters.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee_v2/packages/if-domain/src/vocabulary-contracts/vocabulary-adapters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,cAAc,EAAE,CAqB9F;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,mBAAmB,EAAE,CAyBxG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,iBAAiB,CAalG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabulary-adapters.js","sourceRoot":"","sources":["../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"vocabulary-adapters.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee_v2/packages/if-domain/src/vocabulary-contracts/vocabulary-adapters.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAaH,kDAqBC;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