@sharpee/chord 3.1.0 → 3.3.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 +1202 -33
- package/analyzer.js.map +1 -1
- package/ast.d.ts +415 -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 +31 -13
- package/index.d.ts.map +1 -1
- package/index.js +110 -30
- package/index.js.map +1 -1
- package/ir.d.ts +290 -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/index.d.ts +21 -0
- package/manifests/index.d.ts.map +1 -0
- package/manifests/index.js +46 -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/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 +830 -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 +1507 -174
- 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/sharpee-chord-3.0.0.tgz +0 -0
|
@@ -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/sharpee_v2/packages/chord/src/manifests/combat.ts"],"names":[],"mappings":";;;AAea,QAAA,eAAe,GAAsB;IAChD,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE;QACf;YACE,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE;gBACN,iEAAiE;gBACjE,+DAA+D;gBAC/D,0DAA0D;gBAC1D,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;gBACtC,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE;gBAC1C,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;gBACrC,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE;gBAC3C,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;gBACrC,EAAE,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE;gBAC5C,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE;gBACvC,EAAE,GAAG,EAAE,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE;gBAChD,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE;gBACrC,EAAE,GAAG,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE;gBAC3C,EAAE,GAAG,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE;gBAC7C,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE;aACxC;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE;gBACN,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;gBACtC,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE;gBAC3C,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE;gBACxC,EAAE,GAAG,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,EAAE;aAChD;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { NPC_MANIFEST } from './npc.js';
|
|
5
|
+
export { STATE_MACHINES_MANIFEST } from './state-machines.js';
|
|
6
|
+
/**
|
|
7
|
+
* Name → manifest, for every extension the language knows. `use`-gated
|
|
8
|
+
* manifests need their `use` line; `core: true` manifests (npc) are always
|
|
9
|
+
* admitted and refuse a `use` line.
|
|
10
|
+
*/
|
|
11
|
+
export declare const EXTENSION_MANIFESTS: ReadonlyMap<string, ExtensionManifest>;
|
|
12
|
+
/**
|
|
13
|
+
* The manifest (and adjective entry) contributing a trait-adjective word,
|
|
14
|
+
* or null when no extension owns the word.
|
|
15
|
+
* @param word a composition adjective as written (`combatant`)
|
|
16
|
+
*/
|
|
17
|
+
export declare function manifestForAdjective(word: string): {
|
|
18
|
+
manifest: ExtensionManifest;
|
|
19
|
+
adjective: ManifestAdjective;
|
|
20
|
+
} | null;
|
|
21
|
+
//# 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":"AAgBA,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,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EXTENSION_MANIFESTS = exports.STATE_MACHINES_MANIFEST = exports.NPC_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 npc_js_1 = require("./npc.js");
|
|
20
|
+
const state_machines_js_1 = require("./state-machines.js");
|
|
21
|
+
var combat_js_2 = require("./combat.js");
|
|
22
|
+
Object.defineProperty(exports, "COMBAT_MANIFEST", { enumerable: true, get: function () { return combat_js_2.COMBAT_MANIFEST; } });
|
|
23
|
+
var npc_js_2 = require("./npc.js");
|
|
24
|
+
Object.defineProperty(exports, "NPC_MANIFEST", { enumerable: true, get: function () { return npc_js_2.NPC_MANIFEST; } });
|
|
25
|
+
var state_machines_js_2 = require("./state-machines.js");
|
|
26
|
+
Object.defineProperty(exports, "STATE_MACHINES_MANIFEST", { enumerable: true, get: function () { return state_machines_js_2.STATE_MACHINES_MANIFEST; } });
|
|
27
|
+
/**
|
|
28
|
+
* Name → manifest, for every extension the language knows. `use`-gated
|
|
29
|
+
* manifests need their `use` line; `core: true` manifests (npc) are always
|
|
30
|
+
* admitted and refuse a `use` line.
|
|
31
|
+
*/
|
|
32
|
+
exports.EXTENSION_MANIFESTS = new Map([combat_js_1.COMBAT_MANIFEST, npc_js_1.NPC_MANIFEST, state_machines_js_1.STATE_MACHINES_MANIFEST].map((m) => [m.name, m]));
|
|
33
|
+
/**
|
|
34
|
+
* The manifest (and adjective entry) contributing a trait-adjective word,
|
|
35
|
+
* or null when no extension owns the word.
|
|
36
|
+
* @param word a composition adjective as written (`combatant`)
|
|
37
|
+
*/
|
|
38
|
+
function manifestForAdjective(word) {
|
|
39
|
+
for (const manifest of exports.EXTENSION_MANIFESTS.values()) {
|
|
40
|
+
const adjective = manifest.traitAdjectives.find((a) => a.word === word);
|
|
41
|
+
if (adjective)
|
|
42
|
+
return { manifest, adjective };
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
//# 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":";;;AAqCA,oDAQC;AA7CD;;;;;;;;;;;;GAYG;AACH,2CAA8C;AAC9C,qCAAwC;AACxC,2DAA8D;AAI9D,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AACrB,yDAA8D;AAArD,4HAAA,uBAAuB,OAAA;AAEhC;;;;GAIG;AACU,QAAA,mBAAmB,GAA2C,IAAI,GAAG,CAChF,CAAC,2BAAe,EAAE,qBAAY,EAAE,2CAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACjF,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,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,CAqyBvD,CAAC"}
|