@neocompose/cli 0.60.2 → 0.61.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.60.2",
3
+ "version": "0.61.1",
4
4
  "description": "Neo Compose native project-source CLI with bidirectional sync.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,8 +17,8 @@
17
17
  "access": "public"
18
18
  },
19
19
  "scripts": {
20
- "contract:generate": "node schema-contract/generate.mjs",
21
- "contract:check": "node schema-contract/generate.mjs --check",
20
+ "contract:generate": "node ../packages/manifest/schema-contract/generate.mjs",
21
+ "contract:check": "node ../packages/manifest/schema-contract/generate.mjs --check",
22
22
  "fixtures:update": "node schema-contract/generate-corpus-fixtures.mjs",
23
23
  "fixtures:check": "node schema-contract/generate-corpus-fixtures.mjs --check",
24
24
  "build": "npm run build:local",
@@ -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.60.2 -->
12
+ <!-- reviewed-through-cli: 0.61.1 -->
13
13
 
14
14
  # Neo Compose CLI
15
15
 
@@ -390,6 +390,21 @@ let the last write win.
390
390
 
391
391
  ## NeoFlow dialogues
392
392
 
393
+ Lookup dialogue groups use the same collection paths as lookup members:
394
+
395
+ ```neo
396
+ DialogueGroup FishingVictory = new(
397
+ kind: .Lookup,
398
+ collection: Assets.FishEncounters,
399
+ collectionValue: Reference(root.Assets.FishEncounters),
400
+ );
401
+ ```
402
+
403
+ The collection member and its value may be created in the same push without
404
+ explicit IDs. Pull emits readable paths when the collection has a stable root
405
+ path. Raw `Reference<Member>(id: "...")` and `Reference(id: "...")` forms remain
406
+ readable, and values without a root path retain the ID form.
407
+
393
408
  Node and option prose lowers to localized-text records with canonical node or
394
409
  choice backlinks. Existing translations and unrelated localization links are
395
410
  preserved when the source is pushed.
@@ -53,8 +53,17 @@ authoring capability. P52's document header still says proposed, but try/catch
53
53
  shipped in CLI 0.18; implementation and parity tests take precedence over that
54
54
  stale header.
55
55
 
56
+ CLI 0.61 adds `while` and `do / while` loops, ordinal string `Replace`,
57
+ ordered-list `Insert`, and method calls whose results may be discarded.
58
+ See the [NeoScript reference](neoscript.md) for authoring syntax and limits.
59
+
56
60
  ## Shared implementation contract
57
61
 
62
+ Manifest contracts, document comparison, normalization, and three-way merge
63
+ live in `packages/manifest`. Contract generation and its registry live in
64
+ `packages/manifest/schema-contract`. Web, backend, and CLI consumers import
65
+ `@neocompose/manifest`; production application code must not import CLI internals.
66
+
58
67
  The CLI uses plain document snapshots and shared runtime functions. Keep Retree and web view models out of its imports. The headless architecture check follows CLI imports, and `cli/build.mjs` rejects UI modules and packages in the actual bundle metadata.
59
68
 
60
69
  Keep parsing, strict resolution, formatting, diagnostics, symbols, and
@@ -80,7 +89,7 @@ compiler revision and re-checks the head, authorization, row shapes, and CAS
80
89
  bases. A modified CLI can therefore write bad rows to a project its user may
81
90
  already write; keep preparation in shared `src/database` code rather than
82
91
  forking it in the CLI. The server still verifies a push's uploaded
83
- project-file bytes, and web editor commits still prepare on the server.
92
+ project-file bytes, and web editor commits use the shared client preparation protocol.
84
93
  Unrelated source files are not uploaded or recompiled on every push. A CLI lowering mismatch on a normal push is exposed by the next
85
94
  canonical pull; `neo push --dry-run` remains the complete source-to-record
86
95
  rehearsal.
@@ -101,7 +110,7 @@ wrappers.
101
110
  The marker near the top of `SKILL.md` must exactly match the package version:
102
111
 
103
112
  ```html
104
- <!-- reviewed-through-cli: 0.60.2 -->
113
+ <!-- reviewed-through-cli: 0.61.1 -->
105
114
  ```
106
115
 
107
116
  The quoted version above is checked too, so this instruction cannot go stale
@@ -82,6 +82,16 @@ neo script eval --returns string 'return root.Assets.Outposts[0].FullDisplayText
82
82
  neo script eval --function Outpost.RefreshUnlock --this-value <id> --args '[3]'
83
83
  ```
84
84
 
85
+ Method calls may be used as statements even when they return a value. The
86
+ runtime evaluates the call and discards the result. This also applies to
87
+ collection methods, delegates, actions, and fluent calls:
88
+
89
+ ```neo
90
+ this.TryRefresh();
91
+ this.Items.Insert(0, item);
92
+ this.Items.Remove(item);
93
+ ```
94
+
85
95
  Prefer `--json` for automation.
86
96
 
87
97
  `neo script check --all` reconstructs the prospective project entirely from
@@ -198,6 +208,17 @@ enum, parameter, or local may shadow it. Qualified members use their owner's
198
208
  namespace and may be named `Math`; access one as `this.Math` or
199
209
  `SomeValue.Math` without colliding with the builtin qualifier.
200
210
 
211
+ ## String builtins
212
+
213
+ Use `text.Replace(search, replacement)` to return a string with every
214
+ non-overlapping occurrence replaced. Matching is ordinal and case-sensitive.
215
+ The search must be nonempty; an empty search throws an error. Neither argument
216
+ may be null. The receiver stays unchanged.
217
+
218
+ ```neo
219
+ return "banana".Replace("a", "o"); // "bonono"
220
+ ```
221
+
201
222
  ## Collection builtins
202
223
 
203
224
  Lists expose their size as either `items.Count` or `items.Count()`. Use
@@ -210,6 +231,10 @@ Use `items.IndexOf(value)` to return the zero-based index of the first equal
210
231
  list entry, or `-1` when the value is absent. `IndexOf` is list-only and uses
211
232
  the same value/reference equality as `Contains`.
212
233
 
234
+ Use `items.Insert(index, value)` to insert an entry into a writable ordered
235
+ list. The index may range from zero through `items.Count`; the count appends
236
+ the entry. Other indices throw an error. `Insert` returns void.
237
+
213
238
  Use `List.Repeat(value, count)` to build a list of `count` copies of a value
214
239
  instead of hand-counting a literal or looping around `Add`:
215
240
 
@@ -298,7 +323,22 @@ Use `break` for the nearest loop or switch and `continue` for the nearest
298
323
  loop. A `continue` inside a switch nested in a loop continues the loop.
299
324
 
300
325
  All nested loops and called NeoScript bodies share a 10,000-iteration budget.
301
- Do not use or teach `while` or `do`; they are not supported.
326
+ A `while` loop checks its boolean condition before each iteration. A
327
+ `do / while` loop runs its body once before checking the condition. Both
328
+ require braces; the `do / while` condition ends with a semicolon.
329
+
330
+ ```neo
331
+ while (this.HasWork()) {
332
+ this.ProcessNext();
333
+ }
334
+
335
+ do {
336
+ this.ProcessNext();
337
+ } while (this.HasWork());
338
+ ```
339
+
340
+ `continue` checks the condition again in both loops. Each executed body counts
341
+ against the shared iteration budget.
302
342
 
303
343
  ## Switch
304
344