@sharpee/chord 3.1.0 → 3.5.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/analyzer.d.ts +11 -3
- package/analyzer.d.ts.map +1 -1
- package/analyzer.js +1360 -33
- package/analyzer.js.map +1 -1
- package/ast.d.ts +480 -9
- package/ast.d.ts.map +1 -1
- package/catalog.d.ts +57 -1
- package/catalog.d.ts.map +1 -1
- package/catalog.js +91 -3
- package/catalog.js.map +1 -1
- package/diagnostics.d.ts +1 -1
- package/diagnostics.d.ts.map +1 -1
- package/index.d.ts +32 -13
- package/index.d.ts.map +1 -1
- package/index.js +112 -30
- package/index.js.map +1 -1
- package/ir.d.ts +361 -7
- package/ir.d.ts.map +1 -1
- package/lexer.d.ts +11 -3
- package/lexer.d.ts.map +1 -1
- package/lexer.js +36 -8
- package/lexer.js.map +1 -1
- package/manifests/combat.d.ts +16 -0
- package/manifests/combat.d.ts.map +1 -0
- package/manifests/combat.js +38 -0
- package/manifests/combat.js.map +1 -0
- package/manifests/hunger.d.ts +18 -0
- package/manifests/hunger.d.ts.map +1 -0
- package/manifests/hunger.js +8 -0
- package/manifests/hunger.js.map +1 -0
- package/manifests/index.d.ts +23 -0
- package/manifests/index.d.ts.map +1 -0
- package/manifests/index.js +52 -0
- package/manifests/index.js.map +1 -0
- package/manifests/npc.d.ts +19 -0
- package/manifests/npc.d.ts.map +1 -0
- package/manifests/npc.js +38 -0
- package/manifests/npc.js.map +1 -0
- package/manifests/scoring.d.ts +25 -0
- package/manifests/scoring.d.ts.map +1 -0
- package/manifests/scoring.js +8 -0
- package/manifests/scoring.js.map +1 -0
- package/manifests/state-machines.d.ts +17 -0
- package/manifests/state-machines.d.ts.map +1 -0
- package/manifests/state-machines.js +8 -0
- package/manifests/state-machines.js.map +1 -0
- package/manifests/types.d.ts +41 -0
- package/manifests/types.d.ts.map +1 -0
- package/manifests/types.js +18 -0
- package/manifests/types.js.map +1 -0
- package/message-alias-catalog.d.ts +22 -0
- package/message-alias-catalog.d.ts.map +1 -0
- package/message-alias-catalog.js +826 -0
- package/message-alias-catalog.js.map +1 -0
- package/package.json +1 -1
- package/parser.d.ts +2 -2
- package/parser.d.ts.map +1 -1
- package/parser.js +1644 -131
- package/parser.js.map +1 -1
- package/phrasebooks.d.ts +28 -0
- package/phrasebooks.d.ts.map +1 -0
- package/phrasebooks.js +6 -0
- package/phrasebooks.js.map +1 -0
- package/version.d.ts +38 -0
- package/version.d.ts.map +1 -0
- package/version.js +41 -0
- package/version.js.map +1 -0
- package/sharpee-chord-3.0.0.tgz +0 -0
package/lexer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.lex = lex;
|
|
4
|
-
const
|
|
4
|
+
const span_js_1 = require("./span.js");
|
|
5
5
|
const WORD_RE = /^[A-Za-zÀ-ɏ][A-Za-z0-9À-ɏ'_-]*/;
|
|
6
6
|
const NUMBER_RE = /^[0-9]+(?:\.[0-9]+)*/;
|
|
7
7
|
/**
|
|
@@ -25,7 +25,7 @@ function lex(source, diagnostics) {
|
|
|
25
25
|
let col = 0;
|
|
26
26
|
while (col < raw.length && (raw[col] === ' ' || raw[col] === '\t')) {
|
|
27
27
|
if (raw[col] === '\t') {
|
|
28
|
-
diagnostics.error('lex.tab-indent', 'Tabs are not allowed in indentation — use spaces.', (0,
|
|
28
|
+
diagnostics.error('lex.tab-indent', 'Tabs are not allowed in indentation — use spaces.', (0, span_js_1.spanOf)(lineNo, col + 1));
|
|
29
29
|
}
|
|
30
30
|
indent++;
|
|
31
31
|
col++;
|
|
@@ -36,11 +36,39 @@ function lex(source, diagnostics) {
|
|
|
36
36
|
raw,
|
|
37
37
|
tokens: tokenizeLine(raw, lineNo, col, diagnostics),
|
|
38
38
|
afterBlank,
|
|
39
|
+
comment: indent === 0 && raw.startsWith('##'),
|
|
39
40
|
});
|
|
40
41
|
afterBlank = false;
|
|
41
42
|
}
|
|
43
|
+
checkCommentDelimitation(lines, diagnostics);
|
|
42
44
|
return lines;
|
|
43
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* ADR-249 hard rule: a comment run (maximal consecutive indent-0 `##`
|
|
48
|
+
* lines) must be preceded AND followed by blank lines. Start and end of
|
|
49
|
+
* file count as blank — `##` as the very first line is the file-header
|
|
50
|
+
* comment. One diagnostic per violating run.
|
|
51
|
+
*/
|
|
52
|
+
function checkCommentDelimitation(lines, diagnostics) {
|
|
53
|
+
let i = 0;
|
|
54
|
+
while (i < lines.length) {
|
|
55
|
+
if (!lines[i].comment) {
|
|
56
|
+
i++;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const start = i;
|
|
60
|
+
while (i + 1 < lines.length && lines[i + 1].comment && !lines[i + 1].afterBlank)
|
|
61
|
+
i++;
|
|
62
|
+
const blankBefore = lines[start].afterBlank; // start of file counts as blank
|
|
63
|
+
const next = lines[i + 1];
|
|
64
|
+
const blankAfter = !next || next.afterBlank; // end of file counts as blank
|
|
65
|
+
if (!blankBefore || !blankAfter) {
|
|
66
|
+
const at = blankBefore ? lines[i] : lines[start];
|
|
67
|
+
diagnostics.error('lex.comment-blank-lines', 'A `##` comment must have a blank line before and after it.', (0, span_js_1.spanOf)(at.lineNo, 1, at.raw.length));
|
|
68
|
+
}
|
|
69
|
+
i++;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
44
72
|
function tokenizeLine(raw, lineNo, start, diagnostics) {
|
|
45
73
|
const tokens = [];
|
|
46
74
|
let pos = start;
|
|
@@ -57,11 +85,11 @@ function tokenizeLine(raw, lineNo, start, diagnostics) {
|
|
|
57
85
|
// A lone quote is prose punctuation (multi-line dialogue in prose
|
|
58
86
|
// blocks, e.g. design.md §3.3 PA announcements). Positions that
|
|
59
87
|
// REQUIRE a string (header, hatch paths) diagnose at parse time.
|
|
60
|
-
tokens.push({ kind: 'punct', text: ch, span: (0,
|
|
88
|
+
tokens.push({ kind: 'punct', text: ch, span: (0, span_js_1.spanOf)(lineNo, column) });
|
|
61
89
|
pos++;
|
|
62
90
|
}
|
|
63
91
|
else {
|
|
64
|
-
tokens.push({ kind: 'string', text: raw.slice(pos + 1, close), span: (0,
|
|
92
|
+
tokens.push({ kind: 'string', text: raw.slice(pos + 1, close), span: (0, span_js_1.spanOf)(lineNo, column, close - pos + 1) });
|
|
65
93
|
pos = close + 1;
|
|
66
94
|
}
|
|
67
95
|
continue;
|
|
@@ -69,18 +97,18 @@ function tokenizeLine(raw, lineNo, start, diagnostics) {
|
|
|
69
97
|
const rest = raw.slice(pos);
|
|
70
98
|
const word = WORD_RE.exec(rest);
|
|
71
99
|
if (word) {
|
|
72
|
-
tokens.push({ kind: 'word', text: word[0], span: (0,
|
|
100
|
+
tokens.push({ kind: 'word', text: word[0], span: (0, span_js_1.spanOf)(lineNo, column, word[0].length) });
|
|
73
101
|
pos += word[0].length;
|
|
74
102
|
continue;
|
|
75
103
|
}
|
|
76
104
|
const num = NUMBER_RE.exec(rest);
|
|
77
105
|
if (num) {
|
|
78
|
-
tokens.push({ kind: 'number', text: num[0], span: (0,
|
|
106
|
+
tokens.push({ kind: 'number', text: num[0], span: (0, span_js_1.spanOf)(lineNo, column, num[0].length) });
|
|
79
107
|
pos += num[0].length;
|
|
80
108
|
continue;
|
|
81
109
|
}
|
|
82
|
-
const single = { ':': 'colon', ',': 'comma', '(': 'lparen', ')': 'rparen' };
|
|
83
|
-
tokens.push({ kind: single[ch] ?? 'punct', text: ch, span: (0,
|
|
110
|
+
const single = { ':': 'colon', ',': 'comma', '(': 'lparen', ')': 'rparen', '[': 'lbracket', ']': 'rbracket', '{': 'lbrace', '}': 'rbrace' };
|
|
111
|
+
tokens.push({ kind: single[ch] ?? 'punct', text: ch, span: (0, span_js_1.spanOf)(lineNo, column) });
|
|
84
112
|
pos++;
|
|
85
113
|
}
|
|
86
114
|
return tokens;
|
package/lexer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexer.js","sourceRoot":"","sources":["../../../repos/sharpee_v2/packages/chord/src/lexer.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"lexer.js","sourceRoot":"","sources":["../../../repos/sharpee_v2/packages/chord/src/lexer.ts"],"names":[],"mappings":";;AA0EA,kBAwCC;AA5FD,uCAAyC;AA2CzC,MAAM,OAAO,GAAG,gCAAgC,CAAC;AACjD,MAAM,SAAS,GAAG,sBAAsB,CAAC;AAEzC;;;;;GAKG;AACH,SAAgB,GAAG,CAAC,MAAc,EAAE,WAA0B;IAC5D,MAAM,KAAK,GAAW,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC5C,IAAI,UAAU,GAAG,IAAI,CAAC,CAAC,+CAA+C;IAEtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;QACrB,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACtB,UAAU,GAAG,IAAI,CAAC;YAClB,SAAS;QACX,CAAC;QAED,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;YACnE,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;gBACtB,WAAW,CAAC,KAAK,CACf,gBAAgB,EAChB,mDAAmD,EACnD,IAAA,gBAAM,EAAC,MAAM,EAAE,GAAG,GAAG,CAAC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AAQ,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;QACvK,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,IAAA,gBAAM,EAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QACrF,GAAG,EAAE,CAAC;IACR,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* combat.ts — the `use combat` vocabulary manifest (ADR-215).
|
|
3
|
+
*
|
|
4
|
+
* Purpose: the NAMES half of the names-vs-mappings split — the words and
|
|
5
|
+
* typed `with`-fields the `combat` extension contributes to the composable
|
|
6
|
+
* catalog when a story declares `use combat`. Pure data, zero platform
|
|
7
|
+
* imports (the analyzer consumes it; the browser-safe boundary holds).
|
|
8
|
+
* The adjective→trait field routing (the mappings half) lives in
|
|
9
|
+
* @sharpee/story-loader; a conformance test there pins the two together.
|
|
10
|
+
*
|
|
11
|
+
* Public interface: COMBAT_MANIFEST.
|
|
12
|
+
* Owner context: @sharpee/chord (language frontend; browser-safe).
|
|
13
|
+
*/
|
|
14
|
+
import type { ExtensionManifest } from './types.js';
|
|
15
|
+
export declare const COMBAT_MANIFEST: ExtensionManifest;
|
|
16
|
+
//# sourceMappingURL=combat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combat.d.ts","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/combat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,eAAe,EAAE,iBAiC7B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMBAT_MANIFEST = void 0;
|
|
4
|
+
exports.COMBAT_MANIFEST = {
|
|
5
|
+
name: 'combat',
|
|
6
|
+
traitAdjectives: [
|
|
7
|
+
{
|
|
8
|
+
word: 'combatant',
|
|
9
|
+
fields: [
|
|
10
|
+
// health/max-health route to the required HealthTrait (ADR-226 —
|
|
11
|
+
// life-state lives there, not on CombatantTrait); the rest are
|
|
12
|
+
// CombatantTrait stats. Routing is the loader's business.
|
|
13
|
+
{ key: 'health', valueKind: 'number' },
|
|
14
|
+
{ key: 'max-health', valueKind: 'number' },
|
|
15
|
+
{ key: 'skill', valueKind: 'number' },
|
|
16
|
+
{ key: 'base-damage', valueKind: 'number' },
|
|
17
|
+
{ key: 'armor', valueKind: 'number' },
|
|
18
|
+
{ key: 'attack-power', valueKind: 'number' },
|
|
19
|
+
{ key: 'defense', valueKind: 'number' },
|
|
20
|
+
{ key: 'experience-value', valueKind: 'number' },
|
|
21
|
+
{ key: 'hostile', valueKind: 'word' },
|
|
22
|
+
{ key: 'can-retaliate', valueKind: 'word' },
|
|
23
|
+
{ key: 'drops-inventory', valueKind: 'word' },
|
|
24
|
+
{ key: 'is-undead', valueKind: 'word' },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
word: 'weapon',
|
|
29
|
+
fields: [
|
|
30
|
+
{ key: 'damage', valueKind: 'number' },
|
|
31
|
+
{ key: 'skill-bonus', valueKind: 'number' },
|
|
32
|
+
{ key: 'is-blessed', valueKind: 'word' },
|
|
33
|
+
{ key: 'glows-near-danger', valueKind: 'word' },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=combat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combat.js","sourceRoot":"","sources":["../../../../repos/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AE,mBAAmB,EAAE,SAAS,EAAE,MAAM,EAAE;aAChD;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hunger.ts — the `use hunger` manifest (ADR-263 D4).
|
|
3
|
+
*
|
|
4
|
+
* Gates the satiety-meter body — `grows N each turn`, `<band> at <n>` rungs,
|
|
5
|
+
* and `fatal at N` — behind one header line, exactly as `use scoring` gates the
|
|
6
|
+
* rank ladder.
|
|
7
|
+
*
|
|
8
|
+
* Contributes **no trait adjectives**: hunger is story-header configuration
|
|
9
|
+
* (the meter's bands and decay), not per-entity data. The runtime registration
|
|
10
|
+
* behind this name installs the eating handler, the death hook, the decay
|
|
11
|
+
* daemon, and the ADR-262 crossing watcher; none of that is a trait word.
|
|
12
|
+
*
|
|
13
|
+
* Public interface: HUNGER_MANIFEST.
|
|
14
|
+
* Owner context: @sharpee/chord (language frontend; browser-safe).
|
|
15
|
+
*/
|
|
16
|
+
import type { ExtensionManifest } from './types.js';
|
|
17
|
+
export declare const HUNGER_MANIFEST: ExtensionManifest;
|
|
18
|
+
//# sourceMappingURL=hunger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hunger.d.ts","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/hunger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,eAAe,EAAE,iBAG7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hunger.js","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/hunger.ts"],"names":[],"mappings":";;;AAiBa,QAAA,eAAe,GAAsB;IAChD,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,EAAE;CACpB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ExtensionManifest, ManifestAdjective } from './types.js';
|
|
2
|
+
export type { ExtensionManifest, ManifestAdjective, ManifestField } from './types.js';
|
|
3
|
+
export { COMBAT_MANIFEST } from './combat.js';
|
|
4
|
+
export { HUNGER_MANIFEST } from './hunger.js';
|
|
5
|
+
export { NPC_MANIFEST } from './npc.js';
|
|
6
|
+
export { SCORING_MANIFEST } from './scoring.js';
|
|
7
|
+
export { STATE_MACHINES_MANIFEST } from './state-machines.js';
|
|
8
|
+
/**
|
|
9
|
+
* Name → manifest, for every extension the language knows. `use`-gated
|
|
10
|
+
* manifests need their `use` line; `core: true` manifests (npc) are always
|
|
11
|
+
* admitted and refuse a `use` line.
|
|
12
|
+
*/
|
|
13
|
+
export declare const EXTENSION_MANIFESTS: ReadonlyMap<string, ExtensionManifest>;
|
|
14
|
+
/**
|
|
15
|
+
* The manifest (and adjective entry) contributing a trait-adjective word,
|
|
16
|
+
* or null when no extension owns the word.
|
|
17
|
+
* @param word a composition adjective as written (`combatant`)
|
|
18
|
+
*/
|
|
19
|
+
export declare function manifestForAdjective(word: string): {
|
|
20
|
+
manifest: ExtensionManifest;
|
|
21
|
+
adjective: ManifestAdjective;
|
|
22
|
+
} | null;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/index.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEvE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAEtE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,GACX;IAAE,QAAQ,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,iBAAiB,CAAA;CAAE,GAAG,IAAI,CAMtE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EXTENSION_MANIFESTS = exports.STATE_MACHINES_MANIFEST = exports.SCORING_MANIFEST = exports.NPC_MANIFEST = exports.HUNGER_MANIFEST = exports.COMBAT_MANIFEST = void 0;
|
|
4
|
+
exports.manifestForAdjective = manifestForAdjective;
|
|
5
|
+
/**
|
|
6
|
+
* index.ts — the extension-manifest registry (ADR-215), compile-time side.
|
|
7
|
+
*
|
|
8
|
+
* Purpose: the closed set of trusted-extension vocabulary manifests the
|
|
9
|
+
* analyzer resolves `use <name>` against. Growing this set is a grammar
|
|
10
|
+
* change (chord-grammar-changes.md governance). The loader's trusted
|
|
11
|
+
* runtime registry (@sharpee/story-loader) must carry exactly these names —
|
|
12
|
+
* the manifest-conformance test asserts the two registries agree.
|
|
13
|
+
*
|
|
14
|
+
* Public interface: EXTENSION_MANIFESTS, manifestForAdjective; re-exports
|
|
15
|
+
* the manifest types.
|
|
16
|
+
* Owner context: @sharpee/chord (language frontend; browser-safe).
|
|
17
|
+
*/
|
|
18
|
+
const combat_js_1 = require("./combat.js");
|
|
19
|
+
const hunger_js_1 = require("./hunger.js");
|
|
20
|
+
const npc_js_1 = require("./npc.js");
|
|
21
|
+
const scoring_js_1 = require("./scoring.js");
|
|
22
|
+
const state_machines_js_1 = require("./state-machines.js");
|
|
23
|
+
var combat_js_2 = require("./combat.js");
|
|
24
|
+
Object.defineProperty(exports, "COMBAT_MANIFEST", { enumerable: true, get: function () { return combat_js_2.COMBAT_MANIFEST; } });
|
|
25
|
+
var hunger_js_2 = require("./hunger.js");
|
|
26
|
+
Object.defineProperty(exports, "HUNGER_MANIFEST", { enumerable: true, get: function () { return hunger_js_2.HUNGER_MANIFEST; } });
|
|
27
|
+
var npc_js_2 = require("./npc.js");
|
|
28
|
+
Object.defineProperty(exports, "NPC_MANIFEST", { enumerable: true, get: function () { return npc_js_2.NPC_MANIFEST; } });
|
|
29
|
+
var scoring_js_2 = require("./scoring.js");
|
|
30
|
+
Object.defineProperty(exports, "SCORING_MANIFEST", { enumerable: true, get: function () { return scoring_js_2.SCORING_MANIFEST; } });
|
|
31
|
+
var state_machines_js_2 = require("./state-machines.js");
|
|
32
|
+
Object.defineProperty(exports, "STATE_MACHINES_MANIFEST", { enumerable: true, get: function () { return state_machines_js_2.STATE_MACHINES_MANIFEST; } });
|
|
33
|
+
/**
|
|
34
|
+
* Name → manifest, for every extension the language knows. `use`-gated
|
|
35
|
+
* manifests need their `use` line; `core: true` manifests (npc) are always
|
|
36
|
+
* admitted and refuse a `use` line.
|
|
37
|
+
*/
|
|
38
|
+
exports.EXTENSION_MANIFESTS = new Map([combat_js_1.COMBAT_MANIFEST, hunger_js_1.HUNGER_MANIFEST, npc_js_1.NPC_MANIFEST, scoring_js_1.SCORING_MANIFEST, state_machines_js_1.STATE_MACHINES_MANIFEST].map((m) => [m.name, m]));
|
|
39
|
+
/**
|
|
40
|
+
* The manifest (and adjective entry) contributing a trait-adjective word,
|
|
41
|
+
* or null when no extension owns the word.
|
|
42
|
+
* @param word a composition adjective as written (`combatant`)
|
|
43
|
+
*/
|
|
44
|
+
function manifestForAdjective(word) {
|
|
45
|
+
for (const manifest of exports.EXTENSION_MANIFESTS.values()) {
|
|
46
|
+
const adjective = manifest.traitAdjectives.find((a) => a.word === word);
|
|
47
|
+
if (adjective)
|
|
48
|
+
return { manifest, adjective };
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/index.ts"],"names":[],"mappings":";;;AAyCA,oDAQC;AAjDD;;;;;;;;;;;;GAYG;AACH,2CAA8C;AAC9C,2CAA8C;AAC9C,qCAAwC;AACxC,6CAAgD;AAChD,2DAA8D;AAI9D,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AACrB,2CAAgD;AAAvC,8GAAA,gBAAgB,OAAA;AACzB,yDAA8D;AAArD,4HAAA,uBAAuB,OAAA;AAEhC;;;;GAIG;AACU,QAAA,mBAAmB,GAA2C,IAAI,GAAG,CAChF,CAAC,2BAAe,EAAE,2BAAe,EAAE,qBAAY,EAAE,6BAAgB,EAAE,2CAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACpH,CAAC;AAEF;;;;GAIG;AACH,SAAgB,oBAAoB,CAClC,IAAY;IAEZ,KAAK,MAAM,QAAQ,IAAI,2BAAmB,CAAC,MAAM,EAAE,EAAE,CAAC;QACpD,MAAM,SAAS,GAAG,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QACxE,IAAI,SAAS;YAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAChD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* npc.ts — the CORE NPC vocabulary manifest (ADR-215).
|
|
3
|
+
*
|
|
4
|
+
* Purpose: the behavior-library adjectives every story may compose with no
|
|
5
|
+
* `use` line — NPCs are core by David's ruling ("this deliberately breaks
|
|
6
|
+
* the uniform one-`use`-per-extension rule for the common case"): the NPC
|
|
7
|
+
* plugin auto-wires at load and this vocabulary is always admitted
|
|
8
|
+
* (`core: true`). Pure data, zero platform imports; the trait/behavior
|
|
9
|
+
* routing lives in @sharpee/story-loader.
|
|
10
|
+
*
|
|
11
|
+
* NOT surfaced: `NpcTrait.goals` — structured Goal objects have no config
|
|
12
|
+
* spelling; surfacing them is a future conversation, not a guess.
|
|
13
|
+
*
|
|
14
|
+
* Public interface: NPC_MANIFEST.
|
|
15
|
+
* Owner context: @sharpee/chord (language frontend; browser-safe).
|
|
16
|
+
*/
|
|
17
|
+
import type { ExtensionManifest } from './types.js';
|
|
18
|
+
export declare const NPC_MANIFEST: ExtensionManifest;
|
|
19
|
+
//# sourceMappingURL=npc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npc.d.ts","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/npc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,YAAY,CAAC;AAUnE,eAAO,MAAM,YAAY,EAAE,iBA0B1B,CAAC"}
|
package/manifests/npc.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NPC_MANIFEST = void 0;
|
|
4
|
+
/** NpcTrait fields composable on every behavior adjective. */
|
|
5
|
+
const NPC_COMMON_FIELDS = [
|
|
6
|
+
{ key: 'can-move', valueKind: 'word' },
|
|
7
|
+
{ key: 'announces-movement', valueKind: 'word' },
|
|
8
|
+
{ key: 'allowed-rooms', valueKind: 'list' },
|
|
9
|
+
{ key: 'forbidden-rooms', valueKind: 'list' },
|
|
10
|
+
];
|
|
11
|
+
exports.NPC_MANIFEST = {
|
|
12
|
+
name: 'npc',
|
|
13
|
+
core: true, // auto-wired; `use npc` is a compile error, not a requirement
|
|
14
|
+
traitAdjectives: [
|
|
15
|
+
{ word: 'guard', fields: [...NPC_COMMON_FIELDS] },
|
|
16
|
+
{ word: 'passive', fields: [...NPC_COMMON_FIELDS] },
|
|
17
|
+
{
|
|
18
|
+
word: 'wanderer',
|
|
19
|
+
// move-chance is a Chord percentage (0-100); the loader converts to
|
|
20
|
+
// the platform's 0-1 fraction (tested explicitly).
|
|
21
|
+
fields: [{ key: 'move-chance', valueKind: 'number' }, ...NPC_COMMON_FIELDS],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
word: 'follower',
|
|
25
|
+
fields: [{ key: 'immediate', valueKind: 'word' }, ...NPC_COMMON_FIELDS],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
word: 'patrol',
|
|
29
|
+
fields: [
|
|
30
|
+
{ key: 'route', valueKind: 'list' },
|
|
31
|
+
{ key: 'loop', valueKind: 'word' },
|
|
32
|
+
{ key: 'wait-turns', valueKind: 'number' },
|
|
33
|
+
...NPC_COMMON_FIELDS,
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=npc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npc.js","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/npc.ts"],"names":[],"mappings":";;;AAkBA,8DAA8D;AAC9D,MAAM,iBAAiB,GAAoB;IACzC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE;IACtC,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;IAChD,EAAE,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE;IAC3C,EAAE,GAAG,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE;CAC9C,CAAC;AAEW,QAAA,YAAY,GAAsB;IAC7C,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,IAAI,EAAE,8DAA8D;IAC1E,eAAe,EAAE;QACf,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,iBAAiB,CAAC,EAAE;QACjD,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,iBAAiB,CAAC,EAAE;QACnD;YACE,IAAI,EAAE,UAAU;YAChB,oEAAoE;YACpE,mDAAmD;YACnD,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,GAAG,iBAAiB,CAAC;SAC5E;QACD;YACE,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,iBAAiB,CAAC;SACxE;QACD;YACE,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE;gBACN,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE;gBACnC,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;gBAClC,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE;gBAC1C,GAAG,iBAAiB;aACrB;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scoring.ts — the `use scoring` manifest (ADR-261 D1).
|
|
3
|
+
*
|
|
4
|
+
* Purpose: gates scoring's three constructs — `score <name> worth N`,
|
|
5
|
+
* `award <name>`, and the `rank` ladder — behind one header line. Gating all
|
|
6
|
+
* three together is what makes "absent `use scoring` means the game has no
|
|
7
|
+
* score" (D3) a rule with no exceptions: scoring is on precisely when the
|
|
8
|
+
* header says so, and there is exactly one place to look.
|
|
9
|
+
*
|
|
10
|
+
* Contributes **no trait adjectives**, exactly like `state-machines`. Scoring
|
|
11
|
+
* needs none: `score`/`award` are core lines and a rank ladder is
|
|
12
|
+
* story-header configuration, not per-entity data.
|
|
13
|
+
*
|
|
14
|
+
* Note that this manifest does not — and structurally cannot — carry the
|
|
15
|
+
* ladder. The runtime registration behind this name is
|
|
16
|
+
* `(world) => registerScoring(world)`, which has no access to the story's IR
|
|
17
|
+
* (ADR-260 D5); the ladder reaches the world through the loader's generic
|
|
18
|
+
* lowering instead.
|
|
19
|
+
*
|
|
20
|
+
* Public interface: SCORING_MANIFEST.
|
|
21
|
+
* Owner context: @sharpee/chord (language frontend; browser-safe).
|
|
22
|
+
*/
|
|
23
|
+
import type { ExtensionManifest } from './types.js';
|
|
24
|
+
export declare const SCORING_MANIFEST: ExtensionManifest;
|
|
25
|
+
//# sourceMappingURL=scoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/scoring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,gBAAgB,EAAE,iBAG9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/scoring.ts"],"names":[],"mappings":";;;AAwBa,QAAA,gBAAgB,GAAsB;IACjD,IAAI,EAAE,SAAS;IACf,eAAe,EAAE,EAAE;CACpB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* state-machines.ts — the `use state-machines` manifest (ADR-215).
|
|
3
|
+
*
|
|
4
|
+
* Purpose: gates the ADR-119 DEPTH — the `define machine` construct
|
|
5
|
+
* (named machines, onEnter/onExit, terminal states, role bindings,
|
|
6
|
+
* triggered+guarded transitions). Contributes no trait adjectives; the
|
|
7
|
+
* construct itself is the gated surface (`define machine` without the
|
|
8
|
+
* `use` is a compile error). Chord's existing core `states:`/`select`/
|
|
9
|
+
* `change` surface stays UNCONDITIONAL — gating it would break shipped
|
|
10
|
+
* stories (ADR-215's hard invariant).
|
|
11
|
+
*
|
|
12
|
+
* Public interface: STATE_MACHINES_MANIFEST.
|
|
13
|
+
* Owner context: @sharpee/chord (language frontend; browser-safe).
|
|
14
|
+
*/
|
|
15
|
+
import type { ExtensionManifest } from './types.js';
|
|
16
|
+
export declare const STATE_MACHINES_MANIFEST: ExtensionManifest;
|
|
17
|
+
//# sourceMappingURL=state-machines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-machines.d.ts","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/state-machines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,uBAAuB,EAAE,iBAGrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-machines.js","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/state-machines.ts"],"names":[],"mappings":";;;AAgBa,QAAA,uBAAuB,GAAsB;IACxD,IAAI,EAAE,gBAAgB;IACtB,eAAe,EAAE,EAAE;CACpB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* types.ts — extension vocabulary manifest shapes (ADR-215).
|
|
3
|
+
*
|
|
4
|
+
* Purpose: the static, declarative form in which a trusted platform
|
|
5
|
+
* extension contributes vocabulary to the composable catalog. Manifests are
|
|
6
|
+
* pure data — the analyzer merges a manifest's words only when its `use`
|
|
7
|
+
* name is declared, and validates each adjective's `with`-fields against the
|
|
8
|
+
* declared types. The platform-side trait mappings live in
|
|
9
|
+
* @sharpee/story-loader (names-vs-mappings split), pinned together by the
|
|
10
|
+
* manifest-conformance test there.
|
|
11
|
+
*
|
|
12
|
+
* Public interface: ExtensionManifest, ManifestAdjective, ManifestField.
|
|
13
|
+
* Owner context: @sharpee/chord (language frontend; browser-safe — no
|
|
14
|
+
* platform imports may ever appear in a manifest).
|
|
15
|
+
*/
|
|
16
|
+
/** One typed `with`-field an extension adjective accepts. */
|
|
17
|
+
export interface ManifestField {
|
|
18
|
+
/** The field key as written in Chord (`skill-bonus`). */
|
|
19
|
+
key: string;
|
|
20
|
+
/** Required value kind, matching ConfigSetting's valueKind vocabulary. */
|
|
21
|
+
valueKind: 'number' | 'string' | 'word' | 'name' | 'list';
|
|
22
|
+
}
|
|
23
|
+
/** One trait adjective an extension contributes (`combatant`, `weapon`). */
|
|
24
|
+
export interface ManifestAdjective {
|
|
25
|
+
word: string;
|
|
26
|
+
/** The typed `with`-fields the adjective accepts (closed set — unknown keys are load errors). */
|
|
27
|
+
fields: ManifestField[];
|
|
28
|
+
}
|
|
29
|
+
/** A trusted extension's full vocabulary contribution (ADR-215). */
|
|
30
|
+
export interface ExtensionManifest {
|
|
31
|
+
/** The `use` name (`combat`, `state-machines`); core manifests are named for diagnostics only. */
|
|
32
|
+
name: string;
|
|
33
|
+
/**
|
|
34
|
+
* True for CORE vocabulary (the NPC library): always admitted, the
|
|
35
|
+
* plugin auto-wires, and a `use <name>` line is a compile error — the
|
|
36
|
+
* deliberate exception to one-`use`-per-extension (ADR-215 Q4).
|
|
37
|
+
*/
|
|
38
|
+
core?: boolean;
|
|
39
|
+
traitAdjectives: ManifestAdjective[];
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAC3D;AAED,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,iGAAiG;IACjG,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,kGAAkG;IAClG,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,iBAAiB,EAAE,CAAC;CACtC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* types.ts — extension vocabulary manifest shapes (ADR-215).
|
|
4
|
+
*
|
|
5
|
+
* Purpose: the static, declarative form in which a trusted platform
|
|
6
|
+
* extension contributes vocabulary to the composable catalog. Manifests are
|
|
7
|
+
* pure data — the analyzer merges a manifest's words only when its `use`
|
|
8
|
+
* name is declared, and validates each adjective's `with`-fields against the
|
|
9
|
+
* declared types. The platform-side trait mappings live in
|
|
10
|
+
* @sharpee/story-loader (names-vs-mappings split), pinned together by the
|
|
11
|
+
* manifest-conformance test there.
|
|
12
|
+
*
|
|
13
|
+
* Public interface: ExtensionManifest, ManifestAdjective, ManifestField.
|
|
14
|
+
* Owner context: @sharpee/chord (language frontend; browser-safe — no
|
|
15
|
+
* platform imports may ever appear in a manifest).
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../repos/sharpee_v2/packages/chord/src/manifests/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* message-alias-catalog.ts — ADR-255 Interface Contract 3 (names side).
|
|
3
|
+
*
|
|
4
|
+
* Purpose: the closed set of curated kebab aliases an author may name in
|
|
5
|
+
* `override message <alias>` — one alias per standard-action message id in
|
|
6
|
+
* `@sharpee/lang-en-us`. The analyzer checks `override message` against this
|
|
7
|
+
* set (`analysis.unknown-message-alias`). Names only — no dotted platform ids —
|
|
8
|
+
* so the compiler stays platform-free; the alias -> `if.action.*` mapping lives
|
|
9
|
+
* in `@sharpee/story-loader` (`message-alias-map.ts`), pinned equal to this set
|
|
10
|
+
* and to the live message ids by that package's completeness test (ADR-255 D5).
|
|
11
|
+
*
|
|
12
|
+
* Public interface: MESSAGE_OVERRIDE_ALIASES.
|
|
13
|
+
* Owner context: @sharpee/chord (language frontend; browser-safe).
|
|
14
|
+
*
|
|
15
|
+
* Generated from the built `lang-en-us` action modules via
|
|
16
|
+
* `alias = kebab(action) + "-" + kebab(message-key)` (ADR-255 D2). Hand-curation
|
|
17
|
+
* of a cryptic alias is allowed (the D5 test pins ids, not spellings); regenerate
|
|
18
|
+
* the baseline by re-applying the rule to the current `lang-en-us` messages.
|
|
19
|
+
* 748 aliases across 56 actions, 0 collisions.
|
|
20
|
+
*/
|
|
21
|
+
export declare const MESSAGE_OVERRIDE_ALIASES: ReadonlySet<string>;
|
|
22
|
+
//# sourceMappingURL=message-alias-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-alias-catalog.d.ts","sourceRoot":"","sources":["../../../repos/sharpee_v2/packages/chord/src/message-alias-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,MAAM,CAiyBvD,CAAC"}
|