@neocompose/cli 0.27.1 → 0.29.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.27.1",
3
+ "version": "0.29.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.27.1 -->
12
+ <!-- reviewed-through-cli: 0.29.0 -->
13
13
 
14
14
  # Neo Compose CLI
15
15
 
@@ -109,12 +109,14 @@ override replaces the whole leaf.
109
109
  Frame overrides may change `Enabled`, `FlipX`, and `SortingOrder`; they may
110
110
  not add, remove, or reorder `Children`.
111
111
 
112
- Address direct children through selector delegates. A selector should implement
113
- the project's own stable identity contract, such as an immutable `Name`, slug,
114
- or semantic position; do not turn a mutable object-row ID back into identity by
115
- returning `Reference<T>(id: "...")`. Missing optional child slots are skipped
116
- with diagnostics when the authored slot is absent, while stale pre-provenance
117
- placements may still fail closed.
112
+ Address direct children through selector delegates. Prefer the project's own
113
+ stable identity contract, such as an immutable `Name`, slug, or semantic
114
+ position. When a selector means one specific authored child slot whose
115
+ placement clones carry `sourceValueId`, return
116
+ `Reference<T>(id: "<authored-child-id>", withProvenance: true)`. The flag is
117
+ opt-in and defaults to `false`; without it the ID is matched exactly. Missing
118
+ optional child slots are skipped with diagnostics when the authored slot is
119
+ absent, while stale pre-provenance placements may still fail closed.
118
120
 
119
121
  A placement row carries its `assetClassId` binding and optional `assetValueId`
120
122
  override beside its schema keys. They are row provenance, not declared schema:
@@ -176,11 +178,11 @@ class LegPart : NeoObject {
176
178
  ```
177
179
 
178
180
  Selectors may also be compatible inline closures. Prefer a named function when
179
- the identity rule is reused or deserves an explicit failure message. Never use
180
- a selector merely to wrap `Reference<T>(id: "...")`; that recreates the
181
- row-ID coupling selectors were introduced to remove. For new track rows, omit
182
- `@id` and let the successful push assign it. Preserve IDs already present on
183
- pulled rows.
181
+ the identity rule is reused or deserves an explicit failure message. An exact
182
+ `Reference<T>(id: "...")` recreates the row-ID coupling selectors were
183
+ introduced to remove; use `withProvenance: true` only for a deliberately
184
+ authored slot identity. For new track rows, omit `@id` and let the successful
185
+ push assign it. Preserve IDs already present on pulled rows.
184
186
 
185
187
  A selector argument such as `this.SelectPants` is evaluated in the lexical
186
188
  scope of the class that declares the clip. Here `this` is the `LegPart`, not
@@ -83,7 +83,7 @@ wrappers.
83
83
  The marker near the top of `SKILL.md` must exactly match the package version:
84
84
 
85
85
  ```html
86
- <!-- reviewed-through-cli: 0.27.1 -->
86
+ <!-- reviewed-through-cli: 0.29.0 -->
87
87
  ```
88
88
 
89
89
  The quoted version above is checked too, so this instruction cannot go stale
@@ -152,6 +152,41 @@ them from member initializers. Each declared constructor must settle every
152
152
  required member on its own; a call-site block cannot repair an invalid
153
153
  constructor declaration.
154
154
 
155
+ ## Parameter default values
156
+
157
+ Default a parameter with `= <constant>` on class headers, declared
158
+ constructors, native functions, NSFunctions, and interface functions:
159
+
160
+ ```neo
161
+ class Foo(string bar = "BAR", int volume = 3) {
162
+ public string Bar = bar;
163
+
164
+ public string Shout(string text = "hey", bool loud = true) {
165
+ return loud ? text.ToUpper() : text;
166
+ }
167
+ }
168
+
169
+ Foo a = new(); // fully defaulted header: all defaults apply
170
+ Foo b = new(bar: "bar"); // volume fills from its default
171
+ ```
172
+
173
+ Use only constants: bool, int, float, and decimal literals (optional leading
174
+ `-`), string literals without interpolation, leading-dot enum options
175
+ (`.North`), and `null` on a nullable parameter. Place every defaulted
176
+ parameter after every non-defaulted one. `Type? name` stays nullable-and-
177
+ mandatory unless it also declares a default — nullability and defaultedness
178
+ are independent.
179
+
180
+ Omit defaulted arguments at call sites: function calls bind positionally and
181
+ drop only a trailing suffix; constructor calls name a subset that covers
182
+ every non-defaulted parameter. When several overloads match, the one filling
183
+ in the fewest defaults wins, and a residual tie is a declaration-time error.
184
+ Implementations of an interface function restate its defaults exactly.
185
+
186
+ Do not default parameters of deferred functions, delegates, actions,
187
+ closures, or overrides. Enum defaults store the option id, so renaming the
188
+ option changes the emitted `.Option` spelling without a record change.
189
+
155
190
  ## Required constructors and settlement
156
191
 
157
192
  Put one required constructor on the class header when the entire class body
@@ -83,6 +83,7 @@ supports:
83
83
  Reference(Assets.Capitol)
84
84
  Reference(root.Assets.Cosmetics.Pants)
85
85
  Reference<Outpost>(id: "capitol-value-id")
86
+ Reference<NeoSpriteObject>(id: "authored-child-id", withProvenance: true)
86
87
  Reference<PantsAsset>(key: "pants.long")
87
88
  Reference<PantsAsset>(key: "pants.long", index: Slug)
88
89
  Reference<Dialogue>(id: "capitol-dialogue-id")
@@ -95,14 +96,20 @@ Reference<Dialogue>(id: "capitol-dialogue-id")
95
96
  - Use the generic `id:` form when the ID is the only target information. A
96
97
  `Reference` call whose argument is neither `id:` nor `key:` is rejected by
97
98
  name rather than read as an ID.
99
+ - Inside executable NeoScript, add `withProvenance: true` when the ID names an
100
+ authored row and the reference must select its nearest `sourceValueId` clone
101
+ in the lexical receiver's ownership graph. The parameter defaults to `false`;
102
+ absent or explicit `false` keeps exact-ID behavior. This option is not a
103
+ persisted member-default form.
98
104
  - Both forms are legal in a member's declaration default, not only inside a
99
105
  value graph. A key written there resolves after every pass has run, so it may
100
106
  name a row the same push creates.
101
107
  - Keep genuine structural references ID-based when their collection has no
102
108
  stable symbol, path, or key surface. Animation track and frame-override
103
109
  targets are selectors, not structural references: encode a stable
104
- project-owned identity such as `Name` or slug in the selector instead of
105
- wrapping a row ID in `Reference<T>(id: "...")`.
110
+ project-owned identity such as `Name` or slug. The exception is an authored
111
+ child slot whose placement clones retain `sourceValueId`: select that slot
112
+ with `Reference<T>(id: "...", withProvenance: true)`.
106
113
 
107
114
  Declaration and file order do not affect resolution within one push. Cyclic
108
115
  identity references are legal because they resolve IDs rather than evaluate a