@medicine-wheel/narrative-engine 0.2.2
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/README.md +72 -0
- package/dist/arc.d.ts +13 -0
- package/dist/arc.d.ts.map +1 -0
- package/dist/arc.js +123 -0
- package/dist/arc.js.map +1 -0
- package/dist/cadence.d.ts +27 -0
- package/dist/cadence.d.ts.map +1 -0
- package/dist/cadence.js +133 -0
- package/dist/cadence.js.map +1 -0
- package/dist/cycle.d.ts +15 -0
- package/dist/cycle.d.ts.map +1 -0
- package/dist/cycle.js +98 -0
- package/dist/cycle.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/rsis-narrative.d.ts +32 -0
- package/dist/rsis-narrative.d.ts.map +1 -0
- package/dist/rsis-narrative.js +95 -0
- package/dist/rsis-narrative.js.map +1 -0
- package/dist/sequencer.d.ts +55 -0
- package/dist/sequencer.d.ts.map +1 -0
- package/dist/sequencer.js +223 -0
- package/dist/sequencer.js.map +1 -0
- package/dist/timeline.d.ts +16 -0
- package/dist/timeline.d.ts.map +1 -0
- package/dist/timeline.js +131 -0
- package/dist/timeline.js.map +1 -0
- package/dist/types.d.ts +139 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +41 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @medicine-wheel/narrative-engine — types
|
|
3
|
+
*
|
|
4
|
+
* Extends ontology-core types with engine-specific interfaces
|
|
5
|
+
* for beat sequencing, cadence patterns, and arc validation.
|
|
6
|
+
*/
|
|
7
|
+
import type { DirectionName, NarrativeBeat, MedicineWheelCycle } from '@medicine-wheel/ontology-core';
|
|
8
|
+
export interface BeatPosition {
|
|
9
|
+
beat: NarrativeBeat;
|
|
10
|
+
index: number;
|
|
11
|
+
direction: DirectionName;
|
|
12
|
+
act: number;
|
|
13
|
+
}
|
|
14
|
+
export interface BeatInsertResult {
|
|
15
|
+
success: boolean;
|
|
16
|
+
positions: BeatPosition[];
|
|
17
|
+
warnings: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface SequencerOptions {
|
|
20
|
+
/** Enforce direction order: east → south → west → north */
|
|
21
|
+
enforceDirectionOrder?: boolean;
|
|
22
|
+
/** Allow multiple beats per act */
|
|
23
|
+
allowMultiplePerAct?: boolean;
|
|
24
|
+
/** Maximum beats per direction */
|
|
25
|
+
maxBeatsPerDirection?: number;
|
|
26
|
+
}
|
|
27
|
+
export type CadencePhase = 'opening' | 'deepening' | 'integrating' | 'closing';
|
|
28
|
+
export interface CadencePattern {
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
phases: CadencePhaseRule[];
|
|
32
|
+
}
|
|
33
|
+
export interface CadencePhaseRule {
|
|
34
|
+
phase: CadencePhase;
|
|
35
|
+
direction: DirectionName;
|
|
36
|
+
requiresCeremony: boolean;
|
|
37
|
+
minBeats: number;
|
|
38
|
+
maxBeats: number;
|
|
39
|
+
}
|
|
40
|
+
export interface CadenceValidation {
|
|
41
|
+
valid: boolean;
|
|
42
|
+
currentPhase: CadencePhase;
|
|
43
|
+
phasesCompleted: CadencePhase[];
|
|
44
|
+
phasesRemaining: CadencePhase[];
|
|
45
|
+
violations: CadenceViolation[];
|
|
46
|
+
}
|
|
47
|
+
export interface CadenceViolation {
|
|
48
|
+
phase: CadencePhase;
|
|
49
|
+
rule: string;
|
|
50
|
+
message: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ArcCompleteness {
|
|
53
|
+
complete: boolean;
|
|
54
|
+
directionsVisited: DirectionName[];
|
|
55
|
+
directionsMissing: DirectionName[];
|
|
56
|
+
ceremoniesPerDirection: Record<DirectionName, number>;
|
|
57
|
+
beatsPerDirection: Record<DirectionName, number>;
|
|
58
|
+
wilsonAlignment: number;
|
|
59
|
+
ocapCompliant: boolean;
|
|
60
|
+
completenessScore: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ArcViolation {
|
|
63
|
+
type: 'missing_direction' | 'no_ceremony' | 'low_wilson' | 'ocap_gap' | 'unbalanced';
|
|
64
|
+
direction?: DirectionName;
|
|
65
|
+
message: string;
|
|
66
|
+
severity: 'error' | 'warning' | 'info';
|
|
67
|
+
}
|
|
68
|
+
export interface ArcValidationResult {
|
|
69
|
+
valid: boolean;
|
|
70
|
+
completeness: ArcCompleteness;
|
|
71
|
+
violations: ArcViolation[];
|
|
72
|
+
recommendations: string[];
|
|
73
|
+
}
|
|
74
|
+
export type TimelineAxis = 'chronological' | 'directional' | 'ceremonial';
|
|
75
|
+
export interface TimelineEntry {
|
|
76
|
+
beat: NarrativeBeat;
|
|
77
|
+
position: number;
|
|
78
|
+
direction: DirectionName;
|
|
79
|
+
act: number;
|
|
80
|
+
hasCeremony: boolean;
|
|
81
|
+
group: string;
|
|
82
|
+
}
|
|
83
|
+
export interface TimelineData {
|
|
84
|
+
axis: TimelineAxis;
|
|
85
|
+
entries: TimelineEntry[];
|
|
86
|
+
groups: TimelineGroup[];
|
|
87
|
+
span: {
|
|
88
|
+
start: string;
|
|
89
|
+
end: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export interface TimelineGroup {
|
|
93
|
+
key: string;
|
|
94
|
+
label: string;
|
|
95
|
+
color: string;
|
|
96
|
+
entries: TimelineEntry[];
|
|
97
|
+
}
|
|
98
|
+
export interface TimelineOptions {
|
|
99
|
+
axis?: TimelineAxis;
|
|
100
|
+
filterDirection?: DirectionName;
|
|
101
|
+
filterAct?: number;
|
|
102
|
+
sortBy?: 'timestamp' | 'act' | 'direction';
|
|
103
|
+
}
|
|
104
|
+
export interface CycleTransition {
|
|
105
|
+
from: DirectionName;
|
|
106
|
+
to: DirectionName;
|
|
107
|
+
timestamp: string;
|
|
108
|
+
ceremonyConducted: boolean;
|
|
109
|
+
beat?: NarrativeBeat;
|
|
110
|
+
}
|
|
111
|
+
export interface CycleProgress {
|
|
112
|
+
cycle: MedicineWheelCycle;
|
|
113
|
+
transitions: CycleTransition[];
|
|
114
|
+
currentPhase: CadencePhase;
|
|
115
|
+
completeness: ArcCompleteness;
|
|
116
|
+
nextDirection: DirectionName | null;
|
|
117
|
+
suggestedAction: string;
|
|
118
|
+
}
|
|
119
|
+
/** Measures whether narrative beats show genuine deepening of understanding */
|
|
120
|
+
export interface EpistemicDepth {
|
|
121
|
+
/** How many full circles through the four directions have been completed */
|
|
122
|
+
circleCount: number;
|
|
123
|
+
/** Indicators that understanding is genuinely deepening */
|
|
124
|
+
deepeningIndicators: string[];
|
|
125
|
+
/** Whether the narrative risks stagnation (circling without progress) */
|
|
126
|
+
stagnationRisk: boolean;
|
|
127
|
+
}
|
|
128
|
+
/** A point in the narrative where understanding visibly shifted */
|
|
129
|
+
export interface NarrativeTransformation {
|
|
130
|
+
/** The beat where transformation occurred */
|
|
131
|
+
beatId: string;
|
|
132
|
+
/** Understanding before this beat */
|
|
133
|
+
beforeUnderstanding: string;
|
|
134
|
+
/** Understanding after this beat */
|
|
135
|
+
afterUnderstanding: string;
|
|
136
|
+
/** What catalysed the shift */
|
|
137
|
+
catalyst: string;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAItG,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,aAAa,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS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eAAe,CAAC,EAAE,aAAa,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,WAAW,CAAC;CAC5C;AAID,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,EAAE,EAAE,aAAa,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,eAAe,CAAC;IAC9B,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC;CACzB;AAID,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,yEAAyE;IACzE,cAAc,EAAE,OAAO,CAAC;CACzB;AAID,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oCAAoC;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@medicine-wheel/narrative-engine",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Beat sequencing, arc validation, and ceremonial cadence engine for the Medicine Wheel Developer Suite",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"medicine-wheel",
|
|
27
|
+
"narrative",
|
|
28
|
+
"indigenous",
|
|
29
|
+
"four-directions",
|
|
30
|
+
"beat-sequencing",
|
|
31
|
+
"ceremony"
|
|
32
|
+
],
|
|
33
|
+
"author": "jgwill",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@medicine-wheel/ontology-core": "^0.2.2"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"typescript": "^5.7.0"
|
|
40
|
+
}
|
|
41
|
+
}
|