@neocompose/cli 0.72.4 → 0.73.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neocompose/cli",
3
- "version": "0.72.4",
3
+ "version": "0.73.1",
4
4
  "description": "Neo Compose native project-source CLI with bidirectional sync.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,7 +9,7 @@ description: >-
9
9
  `@neocompose/cli` or `node cli/bin/neo.mjs` in the neo-compose repository.
10
10
  ---
11
11
 
12
- <!-- reviewed-through-cli: 0.72.4 -->
12
+ <!-- reviewed-through-cli: 0.73.1 -->
13
13
 
14
14
  # Neo Compose CLI
15
15
 
@@ -424,7 +424,7 @@ example `@storage(allowed: .Session) public override NeoCollider? Collider;`.
424
424
  Lookup dialogue groups use the same collection paths as lookup members:
425
425
 
426
426
  ```neo
427
- DialogueGroup FishingVictory = new(
427
+ NeoDialogueGroup FishingVictory = new(
428
428
  kind: .Lookup,
429
429
  collection: Assets.FishEncounters,
430
430
  collectionValue: Reference(root.Assets.FishEncounters),
@@ -440,14 +440,14 @@ Node and option prose lowers to localized-text records with canonical node or
440
440
  choice backlinks. Existing translations and unrelated localization links are
441
441
  preserved when the source is pushed.
442
442
 
443
- Put exactly one top-level `sealed class Name : Dialogue` in each `.neoflow`
444
- file. Make it non-generic, derive directly from compiler-owned `Dialogue`, and
443
+ Put exactly one top-level `sealed class Name : NeoDialogue` in each `.neoflow`
444
+ file. Make it non-generic, derive directly from compiler-owned `NeoDialogue`, and
445
445
  override `Trigger Trigger` exactly once. Do not add any other type declaration.
446
446
 
447
447
  ```neoflow
448
448
  @id("capitol-dialogue-id")
449
449
  @settings(name: "Capitol: cold boot", saveOptionChoices: true)
450
- sealed class CapitolColdBoot : Dialogue {
450
+ sealed class CapitolColdBoot : NeoDialogue {
451
451
  @primary Outpost capitol = Assets.Capitol;
452
452
  Player player = Player.Current;
453
453
 
@@ -500,7 +500,7 @@ and commit it with `neo push`.
500
500
 
501
501
  ### Dialogue group names and local symbols
502
502
 
503
- Use `DialogueGroup QuestUnlocks = new(kind: .Standard, parent: Quests, name: "Unlocks")`
503
+ Use `NeoDialogueGroup QuestUnlocks = new(kind: .Standard, parent: Quests, name: "Unlocks")`
504
504
  when the local identifier should differ from the record's display name. Omitting
505
505
  `name` uses the identifier. Unity generates its dialogue API from the stored
506
506
  name (`Quests.Unlocks`), independently of the local identifier. Pull, force-pull,
@@ -118,7 +118,7 @@ wrappers.
118
118
  The marker near the top of `SKILL.md` must exactly match the package version:
119
119
 
120
120
  ```html
121
- <!-- reviewed-through-cli: 0.72.4 -->
121
+ <!-- reviewed-through-cli: 0.73.1 -->
122
122
  ```
123
123
 
124
124
  The quoted version above is checked too, so this instruction cannot go stale
@@ -14,6 +14,7 @@ runtime ownership, evaluation, and migrations.
14
14
  - Switch
15
15
  - Try/catch
16
16
  - Debug output
17
+ - Triggering dialogues
17
18
  - Evaluation and migrations
18
19
 
19
20
  ## Inline bodies and snippets
@@ -478,6 +479,51 @@ severity; CLI logs go to stderr so JSON stdout stays machine-readable. Getter
478
479
  re-evaluation may emit the same log again. `Debug` is a builtin qualifier,
479
480
  not a type; an authored local or Class named `Debug` takes precedence.
480
481
 
482
+ ## Triggering dialogues
483
+
484
+ `root.Dialogues` mirrors the generated C# `Dialogues`: the same folders and
485
+ groups under their generated C# property names.
486
+
487
+ ```neo
488
+ public bool TryTalk() {
489
+ return root.Dialogues.NPCs.Talk.TryTrigger(this, () => {
490
+ this.AfterTalk();
491
+ });
492
+ }
493
+
494
+ public bool HasSomethingToSay => root.Dialogues.NPCs.Talk.CanTrigger(this);
495
+ ```
496
+
497
+ - `root.Dialogues` has `TryTrigger(string dialogueId, onFinish)`,
498
+ `CanTrigger(string dialogueId)`, `VisitCount(pointer)`, and
499
+ `HasVisited(pointer)`.
500
+ - A standard group has `TryTrigger(onFinish)` and `CanTrigger()`. A lookup
501
+ group takes its collection's entry class: `TryTrigger(value, onFinish)` and
502
+ `CanTrigger(value)`. The value must be a stored row.
503
+ - A `NeoDialogueReference` has `id`, `TryTrigger(onFinish)`, and
504
+ `CanTrigger()`. Elements of a `Set<NeoDialogueReference>` are bare ids, so
505
+ pass one to `root.Dialogues.TryTrigger`.
506
+ - `onFinish` is an optional `NeoDelegate<void>`: a lambda or a function member.
507
+ It runs after the dialogue finishes, fails, or is disposed.
508
+
509
+ `TryTrigger` compiles only in functions, including effects, lifecycle hooks,
510
+ and listeners, and in dialogue actions. `CanTrigger`, `VisitCount`, and
511
+ `HasVisited` are reads, allowed wherever the `VisitCount` global is. Folders
512
+ and groups aren't values. User code can't trigger dialogues.
513
+
514
+ The Unity SDK queues every accepted request and shows one dialogue at a time
515
+ through `Dialogues.OnTrigger`. A request for the running or an already queued
516
+ dialogue returns false, as does every request when the game has no `OnTrigger`
517
+ handler. `neo test`, `neo script eval`, dialogue dry runs, and the web editor
518
+ have no dialogue runtime: `TryTrigger` and `CanTrigger` return false there and
519
+ `onFinish` never runs.
520
+
521
+ Source type names match C#: `class X : NeoDialogue` in `.neoflow`,
522
+ `NeoDialogueGroup` and `NeoPriorityGroup` declarations, and
523
+ `NeoDialogueReference` for a reference member. The old names `Dialogue`,
524
+ `DialogueGroup`, `PriorityGroup`, and `DialogueRef` are compile errors that
525
+ name their replacement.
526
+
481
527
  ## Evaluation and migrations
482
528
 
483
529
  `neo script eval` uses authored values and the same evaluator as the web app.
@@ -130,7 +130,7 @@ Reference<Outpost>(id: "capitol-value-id")
130
130
  Reference<NeoSpriteObject>(id: "authored-child-id", withProvenance: true)
131
131
  Reference<PantsAsset>(key: "pants.long")
132
132
  Reference<PantsAsset>(key: "pants.long", index: Slug)
133
- Reference<Dialogue>(id: "capitol-dialogue-id")
133
+ Reference<NeoDialogue>(id: "capitol-dialogue-id")
134
134
  ```
135
135
 
136
136
  - Use a symbol or root path when source can name the value directly.