@neocompose/cli 0.72.2 → 0.73.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neocompose/cli",
3
- "version": "0.72.2",
3
+ "version": "0.73.0",
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.2 -->
12
+ <!-- reviewed-through-cli: 0.73.0 -->
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.2 -->
121
+ <!-- reviewed-through-cli: 0.73.0 -->
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
@@ -178,7 +179,13 @@ or narrowing guard before the next access.
178
179
  Inside an instance body, `Member` and `this.Member` share null and type-check
179
180
  narrowing. A local or parameter named `Member` shadows the implicit member;
180
181
  `this.Member` still names the instance field. Reassigning a narrowed path to a
181
- nullable value clears its non-null fact.
182
+ nullable value clears its non-null fact and facts about its descendants. Writes to
183
+ unrelated members preserve existing guards, including inside loops. Earlier
184
+ conditions being false also narrow receivers in later `else if` conditions.
185
+
186
+ A nullable value coalesced with a non-null fallback produces a non-null result,
187
+ including in constructor arguments: `new Sprite(item.Sprite ?? SpriteInfo.Empty)`.
188
+ A nullable fallback keeps the result nullable when the left operand can be null.
182
189
 
183
190
  Treat lookup-return values with the same nullable narrowing rules.
184
191
 
@@ -472,6 +479,51 @@ severity; CLI logs go to stderr so JSON stdout stays machine-readable. Getter
472
479
  re-evaluation may emit the same log again. `Debug` is a builtin qualifier,
473
480
  not a type; an authored local or Class named `Debug` takes precedence.
474
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
+
475
527
  ## Evaluation and migrations
476
528
 
477
529
  `neo script eval` uses authored values and the same evaluator as the web app.
@@ -57,7 +57,10 @@ keys as quoted IDs when their option has been deleted.
57
57
 
58
58
  ## Identity rules
59
59
 
60
- Preserve every existing ID through rename, reorder, and file moves. A copy
60
+ Preserve every existing ID through rename, reorder, and file moves. Renaming a
61
+ schema member while keeping its ID preserves its owned value graph. Update
62
+ initializer keys to the new name and retain existing child IDs, including when
63
+ editing those children in the same change. A copy
61
64
  must get a new ID. A stored nested class value may keep its UUID-v4 when moved
62
65
  to an empty, compatible class field on another existing parent. Remove its
63
66
  old owning declaration in the same push. Both fields must declare the same
@@ -127,7 +130,7 @@ Reference<Outpost>(id: "capitol-value-id")
127
130
  Reference<NeoSpriteObject>(id: "authored-child-id", withProvenance: true)
128
131
  Reference<PantsAsset>(key: "pants.long")
129
132
  Reference<PantsAsset>(key: "pants.long", index: Slug)
130
- Reference<Dialogue>(id: "capitol-dialogue-id")
133
+ Reference<NeoDialogue>(id: "capitol-dialogue-id")
131
134
  ```
132
135
 
133
136
  - Use a symbol or root path when source can name the value directly.