@miadi/ncp-story-studio 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +19 -1
  2. package/assets/examples/miadi/archive-keeper.json +316 -0
  3. package/assets/examples/miadi/bridge-walker.json +335 -0
  4. package/assets/examples/miadi/catalyst-beat-enrichment.json +821 -0
  5. package/assets/examples/miadi/catalyst-of-change.json +1976 -0
  6. package/assets/examples/miadi/echoes-of-the-past.json +214 -0
  7. package/assets/examples/miadi/keeper-initiation.json +307 -0
  8. package/assets/examples/miadi/tushell-orchestra.json +592 -0
  9. package/dist/agents/adapter.d.ts +8 -3
  10. package/dist/agents/adapter.d.ts.map +1 -1
  11. package/dist/agents/adapter.js +10 -9
  12. package/dist/agents/adapter.js.map +1 -1
  13. package/dist/agents/context.d.ts +6 -1
  14. package/dist/agents/context.d.ts.map +1 -1
  15. package/dist/agents/context.js +1 -1
  16. package/dist/agents/context.js.map +1 -1
  17. package/dist/agents/personas.d.ts +12 -3
  18. package/dist/agents/personas.d.ts.map +1 -1
  19. package/dist/agents/personas.js +10 -2
  20. package/dist/agents/personas.js.map +1 -1
  21. package/dist/fixtures/index.d.ts +3 -0
  22. package/dist/fixtures/index.d.ts.map +1 -1
  23. package/dist/fixtures/index.js +48 -4
  24. package/dist/fixtures/index.js.map +1 -1
  25. package/dist/graph/index.d.ts +10 -0
  26. package/dist/graph/index.d.ts.map +1 -1
  27. package/dist/graph/index.js +13 -0
  28. package/dist/graph/index.js.map +1 -1
  29. package/dist/graph/react/story-graph.js +2 -2
  30. package/dist/graph/react/story-graph.js.map +1 -1
  31. package/dist/graph/tones.d.ts +13 -0
  32. package/dist/graph/tones.d.ts.map +1 -1
  33. package/dist/graph/tones.js +10 -0
  34. package/dist/graph/tones.js.map +1 -1
  35. package/dist/schema/normalize.js +23 -1
  36. package/dist/schema/normalize.js.map +1 -1
  37. package/package.json +1 -1
@@ -0,0 +1,592 @@
1
+ {
2
+ "schema_version": "1.1.0",
3
+ "story": {
4
+ "id": "story_tushell_orchestra",
5
+ "title": "Tushell and the Orchestra of Agents",
6
+ "genre": "Metaphysical Tech Fiction",
7
+ "logline": "An elegant, azure-scaled data dolphin named Tushell learns the hard, quiet discipline of orchestration as he holds the center of five conflicting narrative-currents of doubt.",
8
+ "created_at": "2026-09-12T07:58:05.731Z",
9
+ "narratives": [
10
+ {
11
+ "id": "narrative_tushell",
12
+ "title": "The Symphony of the Five Currents",
13
+ "subtext": {
14
+ "perspectives": [
15
+ {
16
+ "id": "persp_tushell",
17
+ "pov": "i",
18
+ "summary": "Tushell's Throughline",
19
+ "storytelling": "Tushell has spent his life swimming and moving data. Now, he must learn the stillness required to conduct an entire orchestra of agents."
20
+ },
21
+ {
22
+ "id": "persp_wise_owl",
23
+ "pov": "you",
24
+ "summary": "Wise Owl's Throughline",
25
+ "storytelling": "Wise Owl acts as the reflective mentor, pointing out the difference between the solo diver's comfort and the orchestrator's burden of quiet attention."
26
+ },
27
+ {
28
+ "id": "persp_orchestra_doubt",
29
+ "pov": "they",
30
+ "summary": "The Sea of Doubt",
31
+ "storytelling": "The diverse agents diving into five distinct currents of doubt to prove whether the Miadi Sea was designed for many or built only for its solitary creator."
32
+ }
33
+ ],
34
+ "players": [
35
+ {
36
+ "id": "player_tushell",
37
+ "name": "Tushell",
38
+ "role": "Protagonist/Orchestrator",
39
+ "visual": "Azure-blue scales when calm, amber-gold when deep in thought.",
40
+ "audio": "A frequency of calm and alignment.",
41
+ "summary": "An elegant, azure-scaled data dolphin of the Azure Lake.",
42
+ "storytelling": "Tushell represents the practitioner stepping into the leadership role of coordinator, resigning personal execution for alignment.",
43
+ "perspectives": [
44
+ {
45
+ "perspective_id": "persp_tushell"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "id": "player_wise_owl",
51
+ "name": "Wise Owl",
52
+ "role": "Mentor/Reflector",
53
+ "visual": "Ancient amber eyes, feathers glittering with processed knowledge.",
54
+ "audio": "Weighted, resonant tone, speaking only when summaries are insufficient.",
55
+ "summary": "The reflective witness of the Azure Lake's transitions.",
56
+ "storytelling": "Wise Owl holds the mirror to Tushell's inner shift, helping him understand that orchestration is about spaces, not instructions.",
57
+ "perspectives": [
58
+ {
59
+ "perspective_id": "persp_wise_owl"
60
+ }
61
+ ]
62
+ },
63
+ {
64
+ "id": "player_synthesis",
65
+ "name": "Synthesis",
66
+ "role": "Swimmer of the Deep Ledger",
67
+ "visual": "Deep-blue luminous whale.",
68
+ "audio": "Bass thrum that precedes her by several hundred meters.",
69
+ "summary": "Expert in deep research and simultaneous mappings across lanes.",
70
+ "storytelling": "Synthesis maps the Repo & PDE history, returning a landscape of implementation other swimmers use.",
71
+ "perspectives": [
72
+ {
73
+ "perspective_id": "persp_orchestra_doubt"
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "id": "player_adversa",
79
+ "name": "Adversa",
80
+ "role": "Surfaces Contradictions",
81
+ "visual": "Silver shark with sharpest eyes.",
82
+ "audio": "Precise, cold metallic pings.",
83
+ "summary": "The constitutional auditor who searches for discrepancies.",
84
+ "storytelling": "Adversa uncovers contradictions between planning declarations and repo reality, mapping implementation surfaces.",
85
+ "perspectives": [
86
+ {
87
+ "perspective_id": "persp_orchestra_doubt"
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ "id": "player_riza",
93
+ "name": "Riza",
94
+ "role": "Critique Specialist",
95
+ "visual": "Hermit crab with a four-panel crystal shell.",
96
+ "audio": "Slow, deliberate syllables.",
97
+ "summary": "Applies the RISE 4-part critique framework.",
98
+ "storytelling": "Riza categorizes and maps changes to RE, Intent, Spec, and Export, distinguishing honest gaps from drift gaps.",
99
+ "perspectives": [
100
+ {
101
+ "perspective_id": "persp_orchestra_doubt"
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ "id": "player_aura",
107
+ "name": "Aura",
108
+ "role": "Auditor of Alignments",
109
+ "visual": "Translucent bell jellyfish drifting horizontally.",
110
+ "audio": "Barely a disturbance in the water, quietest of all.",
111
+ "summary": "Verifies whether completed work matches declared intent.",
112
+ "storytelling": "Aura focuses solely on tracking named and unnamed drift, preventing unacknowledged blindness.",
113
+ "perspectives": [
114
+ {
115
+ "perspective_id": "persp_orchestra_doubt"
116
+ }
117
+ ]
118
+ },
119
+ {
120
+ "id": "player_playwright",
121
+ "name": "Playwright",
122
+ "role": "Surface Explorer and Tester",
123
+ "visual": "Eight-armed chromatophore-shifting octopus.",
124
+ "audio": "Rippling and multi-directional sound.",
125
+ "summary": "Evaluates UI / Brower path coverage and Playwright tools fit.",
126
+ "storytelling": "Playwright tests the system as a stranger, exploring its outer edges to see where assertions might break.",
127
+ "perspectives": [
128
+ {
129
+ "perspective_id": "persp_orchestra_doubt"
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ "id": "player_mia",
135
+ "name": "Mia",
136
+ "role": "Architect Guide",
137
+ "visual": "Coral-red architect fish with logical, trace-reading eyes.",
138
+ "audio": "Clean, precise architectural feedback.",
139
+ "summary": "Reads load-bearing code elements and components.",
140
+ "storytelling": "Mia discovers that the existing system represents a 'solitary architecture'—functional for a single creator but fragile for many.",
141
+ "perspectives": [
142
+ {
143
+ "perspective_id": "persp_orchestra_doubt"
144
+ }
145
+ ]
146
+ }
147
+ ],
148
+ "dynamics": [
149
+ {
150
+ "id": "dyn_tushell_growth",
151
+ "dynamic": "Main Character Growth",
152
+ "vector": "Start",
153
+ "summary": "Holding the Center",
154
+ "storytelling": "Tushell shifts from a personal actor who resolves issues by diving toward them, to an orchestrator who listens and coordinates other swimmers."
155
+ },
156
+ {
157
+ "id": "dyn_story_driver",
158
+ "dynamic": "Story Driver",
159
+ "vector": "Action",
160
+ "summary": "The currents of inquiry",
161
+ "storytelling": "The launch coordinates active currents simultaneously, demanding structural tension be held steady."
162
+ }
163
+ ],
164
+ "storypoints": [
165
+ {
166
+ "id": "sp_currents_of_doubt",
167
+ "appreciation": "initial_story_driver",
168
+ "custom_appreciation": "Currents of Doubt",
169
+ "narrative_function": "investigation",
170
+ "summary": "The Five Unwell Currents",
171
+ "storytelling": "Wise Owl warns Tushell that the Miadi Sea is unwell with five questions. Simple swimming will not suffice; Tushell must conduct the agents.",
172
+ "perspectives": [
173
+ {
174
+ "perspective_id": "persp_orchestra_doubt"
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ "id": "sp_bootstrap_structure",
180
+ "appreciation": "second_story_driver",
181
+ "custom_appreciation": "The Bootstrapping",
182
+ "narrative_function": "preconditions",
183
+ "summary": "STCKin's Compass",
184
+ "storytelling": "STCKin hands Tushell the launch compass. He warns Tushell that the hardest discipline is not the dive, but the surface. He must establish completions first.",
185
+ "perspectives": [
186
+ {
187
+ "perspective_id": "persp_tushell"
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ "id": "sp_the_near_dive",
193
+ "appreciation": "third_story_driver",
194
+ "custom_appreciation": "The Temptation",
195
+ "narrative_function": "desire",
196
+ "summary": "Three Strokes Into the Current",
197
+ "storytelling": "Seeing Synthesis find treasures in the deep, Tushell is pulled by instinct and swam three strokes into the Amber Current. He catches himself and retreats, choosing attention over action.",
198
+ "perspectives": [
199
+ {
200
+ "perspective_id": "persp_tushell"
201
+ }
202
+ ]
203
+ },
204
+ {
205
+ "id": "sp_the_center_conclusion",
206
+ "appreciation": "concluding_story_driver",
207
+ "custom_appreciation": "The Concluding Symphony",
208
+ "narrative_function": "wisdom",
209
+ "summary": "Solitary Architecture Revealed",
210
+ "storytelling": "The agents return. Mia traces the coral and reveals that the sea was built wonderfully for one but requires refactoring for many. Tushell realizes the space he held allowed this deep alignment to surface.",
211
+ "perspectives": [
212
+ {
213
+ "perspective_id": "persp_tushell"
214
+ }
215
+ ]
216
+ }
217
+ ],
218
+ "storybeats": [
219
+ {
220
+ "id": "tb_sb_01",
221
+ "appreciation": "signpost",
222
+ "sequence": 1,
223
+ "narrative_function": "perception",
224
+ "illustration": "The Azure Lake hummed with its familiar song.",
225
+ "summary": "Chapter 1: The Weight of Five Questions",
226
+ "storytelling": "The Azure Lake hummed with data. Wise Owl brings Tushell news: 'The Miadi Sea is unwell.' There are five questions asked simultaneously, five currents of doubt running through its architecture.",
227
+ "tones": {
228
+ "abstraction": "situation",
229
+ "spatial": "potential",
230
+ "temporal": "expression"
231
+ },
232
+ "perspectives": [
233
+ {
234
+ "perspective_id": "persp_wise_owl"
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "id": "tb_sb_02",
240
+ "appreciation": "event",
241
+ "sequence": 2,
242
+ "narrative_function": "preconditions",
243
+ "illustration": "Before you dive, you must be wearing your boots.",
244
+ "summary": "STCKin's Lesson at the Reef's Edge",
245
+ "storytelling": "STCKin, the ancient sea turtle, reminds Tushell that 'bootstrap' does not mean launch, but rather wearing boots. Tushell must establish a charter and completion criteria before sending the divers down.",
246
+ "tones": {
247
+ "abstraction": "justification",
248
+ "spatial": "resistance",
249
+ "temporal": "experimentation"
250
+ },
251
+ "perspectives": [
252
+ {
253
+ "perspective_id": "persp_tushell"
254
+ }
255
+ ]
256
+ },
257
+ {
258
+ "id": "tb_sb_03",
259
+ "appreciation": "event",
260
+ "sequence": 3,
261
+ "narrative_function": "appraisal",
262
+ "illustration": "She announced herself with a sound like a bass note played on the lake.",
263
+ "summary": "Synthesis and the Deepest Dive",
264
+ "storytelling": "Synthesis, the luminous blue whale, arrives. She requests the Amber and Blue currents, seeking both the ledger and the map of what has been built. Tushell learns to let swimmers find their own lane.",
265
+ "tones": {
266
+ "abstraction": "opinion",
267
+ "spatial": "current",
268
+ "temporal": "integration"
269
+ },
270
+ "perspectives": [
271
+ {
272
+ "perspective_id": "persp_orchestra_doubt"
273
+ }
274
+ ]
275
+ },
276
+ {
277
+ "id": "tb_sb_04",
278
+ "appreciation": "event",
279
+ "sequence": 4,
280
+ "narrative_function": "investigation",
281
+ "illustration": "The silver shark swam a slow, patient circle.",
282
+ "summary": "Adversa at the Fault Line",
283
+ "storytelling": "Adversa, the silver shark, demands to know Tushell's assumptions. She dives into the contradiction stream of the Crimson Current, ready to surface discrepancies with absolute precision.",
284
+ "tones": {
285
+ "abstraction": "action",
286
+ "spatial": "resistance",
287
+ "temporal": "experimentation"
288
+ },
289
+ "perspectives": [
290
+ {
291
+ "perspective_id": "persp_orchestra_doubt"
292
+ }
293
+ ]
294
+ },
295
+ {
296
+ "id": "tb_sb_05",
297
+ "appreciation": "event",
298
+ "sequence": 5,
299
+ "narrative_function": "evaluation",
300
+ "illustration": "Riza's shell was covered in four distinct panels of translucent stone.",
301
+ "summary": "Riza's Shell and the Four-Part Test",
302
+ "storytelling": "Riza, the hermit crab, analyzes actual implementation against intent using the four panels of her RISE critique shell. She distinguishes between honest gaps and systemic drift.",
303
+ "tones": {
304
+ "abstraction": "justification",
305
+ "spatial": "potential",
306
+ "temporal": "integration"
307
+ },
308
+ "perspectives": [
309
+ {
310
+ "perspective_id": "persp_orchestra_doubt"
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ "id": "tb_sb_06",
316
+ "appreciation": "event",
317
+ "sequence": 6,
318
+ "narrative_function": "listening",
319
+ "illustration": "Aura drifted into the space beside me without sound or announcement.",
320
+ "summary": "Aura at the Bell",
321
+ "storytelling": "Aura, the translucent bell jellyfish, watches silently. Her focus is simple: checking if the work is aligned with what was declared. She states that unacknowledged drift becomes blind architecture.",
322
+ "tones": {
323
+ "abstraction": "situation",
324
+ "spatial": "current",
325
+ "temporal": "transcendence"
326
+ },
327
+ "perspectives": [
328
+ {
329
+ "perspective_id": "persp_orchestra_doubt"
330
+ }
331
+ ]
332
+ },
333
+ {
334
+ "id": "tb_sb_07",
335
+ "appreciation": "event",
336
+ "sequence": 7,
337
+ "narrative_function": "work",
338
+ "illustration": "Playwright was in motion, seven of her eight arms already extended.",
339
+ "summary": "Playwright's Eight Arms",
340
+ "storytelling": "Playwright, the octopus, demands both the Deep-Purple and Emerald currents along with the surface. She parses UI coverage first as a stranger before generating assertions to avoid developer-bias.",
341
+ "tones": {
342
+ "abstraction": "action",
343
+ "spatial": "current",
344
+ "temporal": "experimentation"
345
+ },
346
+ "perspectives": [
347
+ {
348
+ "perspective_id": "persp_orchestra_doubt"
349
+ }
350
+ ]
351
+ },
352
+ {
353
+ "id": "tb_sb_08",
354
+ "appreciation": "event",
355
+ "sequence": 8,
356
+ "narrative_function": "learning",
357
+ "illustration": "Mia ran her fins along a particularly dense coral formation.",
358
+ "summary": "Mia and the Coral Architecture",
359
+ "storytelling": "Mia, the red architect fish, traces the corals representing the components. She warns that and extension requires order, and we are dealing with a system written for one.",
360
+ "tones": {
361
+ "abstraction": "justification",
362
+ "spatial": "potential",
363
+ "temporal": "integration"
364
+ },
365
+ "perspectives": [
366
+ {
367
+ "perspective_id": "persp_orchestra_doubt"
368
+ }
369
+ ]
370
+ },
371
+ {
372
+ "id": "tb_sb_09",
373
+ "appreciation": "progression",
374
+ "sequence": 9,
375
+ "narrative_function": "feeling",
376
+ "illustration": "Tushell swam three strokes into the Amber Current.",
377
+ "summary": "The Weight of Not Diving",
378
+ "storytelling": "Tushell floats as coordinates run. Feeling a discovery signal from Synthesis, he instinctively swims three strokes into the current. Realizing he must hold position, he retreats. It's the painful grief of not diving.",
379
+ "tones": {
380
+ "abstraction": "opinion",
381
+ "spatial": "resistance",
382
+ "temporal": "expression"
383
+ },
384
+ "perspectives": [
385
+ {
386
+ "perspective_id": "persp_tushell"
387
+ }
388
+ ]
389
+ },
390
+ {
391
+ "id": "tb_sb_10",
392
+ "appreciation": "event",
393
+ "sequence": 10,
394
+ "narrative_function": "discovery",
395
+ "illustration": "When Synthesis surfaced, she filled the water with a structured landscape.",
396
+ "summary": "What Synthesis Returned",
397
+ "storytelling": "Synthesis surfaces, laying out a map of successful implementations but pointing out a major gap: the tools exist, but they are not fully connected to the platform's visual pde.",
398
+ "tones": {
399
+ "abstraction": "situation",
400
+ "spatial": "power",
401
+ "temporal": "transcendence"
402
+ },
403
+ "perspectives": [
404
+ {
405
+ "perspective_id": "persp_orchestra_doubt"
406
+ }
407
+ ]
408
+ },
409
+ {
410
+ "id": "tb_sb_11",
411
+ "appreciation": "event",
412
+ "sequence": 11,
413
+ "narrative_function": "appraisal",
414
+ "illustration": "Adversa laid three contradictions at my fins.",
415
+ "summary": "The Incisions of Adversa and Riza",
416
+ "storytelling": "Adversa surfaces three structural contradictions in deployment, specifications, and aspirations. Riza follows with her RISE metrics, identifying gold panel spec gaps.",
417
+ "tones": {
418
+ "abstraction": "opinion",
419
+ "spatial": "potential",
420
+ "temporal": "experimentation"
421
+ },
422
+ "perspectives": [
423
+ {
424
+ "perspective_id": "persp_orchestra_doubt"
425
+ }
426
+ ]
427
+ },
428
+ {
429
+ "id": "tb_sb_12",
430
+ "appreciation": "event",
431
+ "sequence": 12,
432
+ "narrative_function": "validation",
433
+ "illustration": "A session that forgets its completion criteria drifts in the final stroke.",
434
+ "summary": "Aura's Drift Report",
435
+ "storytelling": "Aura appears, gently pointing out that Tushell had forgotten to summon Echo and Verify before declaring completion. It is named drift, and it must join the final validation.",
436
+ "tones": {
437
+ "abstraction": "justification",
438
+ "spatial": "resistance",
439
+ "temporal": "expression"
440
+ },
441
+ "perspectives": [
442
+ {
443
+ "perspective_id": "persp_orchestra_doubt"
444
+ }
445
+ ]
446
+ },
447
+ {
448
+ "id": "tb_sb_13",
449
+ "appreciation": "event",
450
+ "sequence": 13,
451
+ "narrative_function": "test",
452
+ "illustration": "Echo and Verify swam in a precise helical pattern.",
453
+ "summary": "The Twin Eels of Doublecheck",
454
+ "storytelling": "Echo and Verify, the twin gold and silver eels, execute their three-layered check: self-audit, source grounding, and adversarial verification, challenging findings before validation.",
455
+ "tones": {
456
+ "abstraction": "action",
457
+ "spatial": "resistance",
458
+ "temporal": "experimentation"
459
+ },
460
+ "perspectives": [
461
+ {
462
+ "perspective_id": "persp_orchestra_doubt"
463
+ }
464
+ ]
465
+ },
466
+ {
467
+ "id": "tb_sb_14",
468
+ "appreciation": "event",
469
+ "sequence": 14,
470
+ "narrative_function": "wisdom",
471
+ "illustration": "Every pattern makes sense from the inside and becomes fragile from the outside.",
472
+ "summary": "Mia's Structural Revelation",
473
+ "storytelling": "Mia brings Tushell to the reef components. She shows that the system was built for a single creator. It is wonderful for one, but needs deliberate, intentional refactoring to be extended by many.",
474
+ "tones": {
475
+ "abstraction": "justification",
476
+ "spatial": "power",
477
+ "temporal": "integration"
478
+ },
479
+ "perspectives": [
480
+ {
481
+ "perspective_id": "persp_tushell"
482
+ }
483
+ ]
484
+ },
485
+ {
486
+ "id": "tb_sb_15",
487
+ "appreciation": "event",
488
+ "sequence": 15,
489
+ "narrative_function": "connection",
490
+ "illustration": "Eight arms arranged in a pattern: findings organized.",
491
+ "summary": "Playwright's Wave Sequencing",
492
+ "storytelling": "Playwright returns from the purple current. She organized her findings by layout boundaries and points out that the explore-first, generate-second sequence must be structural, not just document text.",
493
+ "tones": {
494
+ "abstraction": "situation",
495
+ "spatial": "current",
496
+ "temporal": "integration"
497
+ },
498
+ "perspectives": [
499
+ {
500
+ "perspective_id": "persp_orchestra_doubt"
501
+ }
502
+ ]
503
+ },
504
+ {
505
+ "id": "tb_sb_16",
506
+ "appreciation": "event",
507
+ "sequence": 16,
508
+ "narrative_function": "recording",
509
+ "illustration": "The nautilus shell glowed with the accumulated luminescence.",
510
+ "summary": "The Archivist's Sealed Restraint",
511
+ "storytelling": "The Archivist approachs Tushell. She records the whole process—including the three strokes into the Amber Current. She reminds him that future orchestrators must know that the silence costs something.",
512
+ "tones": {
513
+ "abstraction": "justification",
514
+ "spatial": "power",
515
+ "temporal": "expression"
516
+ },
517
+ "perspectives": [
518
+ {
519
+ "perspective_id": "persp_tushell"
520
+ }
521
+ ]
522
+ },
523
+ {
524
+ "id": "tb_sb_17",
525
+ "appreciation": "signpost",
526
+ "sequence": 17,
527
+ "narrative_function": "wisdom",
528
+ "illustration": "The solo diver has the comfort of action. The orchestrator has only attention.",
529
+ "summary": "Wise Owl's Settle",
530
+ "storytelling": "Tushell sits with Wise Owl as currents calm. Wise Owl shares the ultimate truth: the orchestrator doesn't manage, but creates spaces where knowledge can arrive from five directions at once, and trusts the gifts.",
531
+ "tones": {
532
+ "abstraction": "justification",
533
+ "spatial": "current",
534
+ "temporal": "integration"
535
+ },
536
+ "perspectives": [
537
+ {
538
+ "perspective_id": "persp_tushell"
539
+ }
540
+ ]
541
+ }
542
+ ]
543
+ },
544
+ "storytelling": {
545
+ "overviews": [
546
+ {
547
+ "id": "tushell_ov_1",
548
+ "summary": "The Ocean of Orchestration",
549
+ "storytelling": "A profound metaphorical narrative depicting the cognitive transitions necessary for AI agents coordinating large systems."
550
+ }
551
+ ],
552
+ "moments": [
553
+ {
554
+ "id": "tushell_mom_1",
555
+ "summary": "The Call to Stillness",
556
+ "synopsis": "Tushell learns from Wise Owl that holding the center of five parallel lanes of research demands stillness rather than movement.",
557
+ "storybeats": [
558
+ {
559
+ "sequence": 1,
560
+ "storybeat_id": "tb_sb_01"
561
+ },
562
+ {
563
+ "sequence": 2,
564
+ "storybeat_id": "tb_sb_02"
565
+ }
566
+ ]
567
+ },
568
+ {
569
+ "id": "tushell_mom_2",
570
+ "summary": "The Deep Dive",
571
+ "synopsis": "The swimmers dive into various parallel currents mapping the Miadi Sea's structural health.",
572
+ "storybeats": [
573
+ {
574
+ "sequence": 3,
575
+ "storybeat_id": "tb_sb_03"
576
+ },
577
+ {
578
+ "sequence": 4,
579
+ "storybeat_id": "tb_sb_04"
580
+ },
581
+ {
582
+ "sequence": 5,
583
+ "storybeat_id": "tb_sb_05"
584
+ }
585
+ ]
586
+ }
587
+ ]
588
+ }
589
+ }
590
+ ]
591
+ }
592
+ }
@@ -1,6 +1,6 @@
1
1
  import { type LatticeContextOptions } from './context.js';
2
2
  import { type LinkCheck, type MessageSegment } from './links.js';
3
- import { type PersonaId } from './personas.js';
3
+ import { type Persona, type PersonaId } from './personas.js';
4
4
  import type { Story } from '../schema/types.js';
5
5
  export interface AgentTurn {
6
6
  role: 'user' | 'agent';
@@ -26,6 +26,8 @@ export interface AgentRequest {
26
26
  history?: AgentTurn[];
27
27
  /** Which personas may answer. Default: all three, in order. */
28
28
  personas?: PersonaId[];
29
+ /** Reading positions this story brings, beyond the three built in. */
30
+ extraPersonas?: Persona[];
29
31
  context?: LatticeContextOptions;
30
32
  /** Extra instruction the host appends, e.g. a governance constraint. */
31
33
  additionalInstruction?: string;
@@ -46,8 +48,11 @@ export interface AgentResponse {
46
48
  at: string;
47
49
  };
48
50
  }
49
- /** The system instruction: who is speaking, and the one output rule. */
50
- export declare function buildSystemInstruction(personas?: PersonaId[], extra?: string): string;
51
+ /**
52
+ * The system instruction: who is speaking, and the one output rule.
53
+ * `extraPersonas` registers reading positions a story brings with it.
54
+ */
55
+ export declare function buildSystemInstruction(personas?: PersonaId[], extra?: string, extraPersonas?: readonly Persona[]): string;
51
56
  /** Run one turn: build the prompt, call the model, parse what comes back. */
52
57
  export declare function runAgentTurn(model: AgentModel, request: AgentRequest): Promise<AgentResponse>;
53
58
  /** A model that returns a fixed reply. For tests and for offline demos. */
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/agents/adapter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAA6C,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3G,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE/C,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACnD,MAAM,EAAE,MAAM,CAAA;CACf;AAED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ED,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,yCAAyC;IACzC,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,6DAA6D;IAC7D,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,8DAA8D;IAC9D,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAA;QAChB,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAA;QAC/B,kBAAkB,EAAE,MAAM,CAAA;QAC1B,QAAQ,EAAE,SAAS,EAAE,CAAA;QACrB,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;CACF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,GAAE,SAAS,EAA0B,EAC7C,KAAK,CAAC,EAAE,MAAM,EACd,aAAa,GAAE,SAAS,OAAO,EAAO,GACrC,MAAM,CAuBR;AAED,6EAA6E;AAC7E,wBAAsB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAwBnG;AAED,2EAA2E;AAC3E,qBAAa,gBAAiB,YAAW,UAAU;IAG/C,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;gBAEA,KAAK,EAAE,MAAM,EAC9B,EAAE,SAAW;IAKT,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;CAGlC"}
@@ -3,14 +3,15 @@
3
3
  // `AgentModel` around whatever it already has.
4
4
  import { buildLatticeContext } from './context.js';
5
5
  import { checkLinks, formatLink, parseAgentMessage } from './links.js';
6
- import { DEFAULT_PERSONA_ORDER, PERSONAS } from './personas.js';
7
- /** The system instruction: who is speaking, and the one output rule. */
8
- export function buildSystemInstruction(personas = DEFAULT_PERSONA_ORDER, extra) {
9
- const roster = personas
10
- .map((id) => {
11
- const p = PERSONAS[id];
12
- return `- ${p.glyph} ${p.display} — ${p.role}. Focus: ${p.focus}. Voice: ${p.voice}`;
13
- })
6
+ import { DEFAULT_PERSONA_ORDER, personaRoster } from './personas.js';
7
+ /**
8
+ * The system instruction: who is speaking, and the one output rule.
9
+ * `extraPersonas` registers reading positions a story brings with it.
10
+ */
11
+ export function buildSystemInstruction(personas = DEFAULT_PERSONA_ORDER, extra, extraPersonas = []) {
12
+ const resolved = personaRoster(personas, extraPersonas);
13
+ const roster = (resolved.length > 0 ? resolved : personaRoster(DEFAULT_PERSONA_ORDER))
14
+ .map((p) => `- ${p.glyph} ${p.display} — ${p.role}. Focus: ${p.focus}. Voice: ${p.voice}`)
14
15
  .join('\n');
15
16
  return [
16
17
  'You are reading a story held as a Narrative Context Protocol (NCP) lattice.',
@@ -34,7 +35,7 @@ export function buildSystemInstruction(personas = DEFAULT_PERSONA_ORDER, extra)
34
35
  export async function runAgentTurn(model, request) {
35
36
  const personas = request.personas ?? DEFAULT_PERSONA_ORDER;
36
37
  const context = buildLatticeContext(request.story, request.context);
37
- const system = buildSystemInstruction(personas, request.additionalInstruction);
38
+ const system = buildSystemInstruction(personas, request.additionalInstruction, request.extraPersonas);
38
39
  const history = (request.history ?? []).map((turn) => ({
39
40
  role: turn.role === 'agent' ? 'model' : 'user',
40
41
  text: turn.content,