@neocompose/cli 0.1.5 → 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 (167) hide show
  1. package/README.md +203 -69
  2. package/dist/neo.mjs +28478 -15217
  3. package/dist/tooling/Microsoft.CodeAnalysis.CSharp.dll +0 -0
  4. package/dist/tooling/Microsoft.CodeAnalysis.dll +0 -0
  5. package/dist/tooling/NeoCompose.Schema.Tooling.dll +0 -0
  6. package/dist/tooling/NeoCompose.Schema.Tooling.pdb +0 -0
  7. package/dist/tooling/NeoCompose.Schema.dll +0 -0
  8. package/dist/tooling/NeoCompose.Schema.pdb +0 -0
  9. package/dist/tooling/NeoCompose.Schema.xml +1055 -0
  10. package/dist/tooling/NeoCompose.SchemaCompiler.deps.json +299 -0
  11. package/dist/tooling/NeoCompose.SchemaCompiler.dll +0 -0
  12. package/dist/tooling/NeoCompose.SchemaCompiler.pdb +0 -0
  13. package/dist/tooling/NeoCompose.SchemaCompiler.runtimeconfig.json +13 -0
  14. package/dist/tooling/System.Collections.Immutable.dll +0 -0
  15. package/dist/tooling/System.Reflection.Metadata.dll +0 -0
  16. package/dist/tooling/System.Text.Encoding.CodePages.dll +0 -0
  17. package/dist/tooling/cs/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  18. package/dist/tooling/cs/Microsoft.CodeAnalysis.resources.dll +0 -0
  19. package/dist/tooling/de/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  20. package/dist/tooling/de/Microsoft.CodeAnalysis.resources.dll +0 -0
  21. package/dist/tooling/es/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  22. package/dist/tooling/es/Microsoft.CodeAnalysis.resources.dll +0 -0
  23. package/dist/tooling/fr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  24. package/dist/tooling/fr/Microsoft.CodeAnalysis.resources.dll +0 -0
  25. package/dist/tooling/it/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  26. package/dist/tooling/it/Microsoft.CodeAnalysis.resources.dll +0 -0
  27. package/dist/tooling/ja/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  28. package/dist/tooling/ja/Microsoft.CodeAnalysis.resources.dll +0 -0
  29. package/dist/tooling/ko/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  30. package/dist/tooling/ko/Microsoft.CodeAnalysis.resources.dll +0 -0
  31. package/dist/tooling/pl/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  32. package/dist/tooling/pl/Microsoft.CodeAnalysis.resources.dll +0 -0
  33. package/dist/tooling/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  34. package/dist/tooling/pt-BR/Microsoft.CodeAnalysis.resources.dll +0 -0
  35. package/dist/tooling/reference-assemblies/netstandard2.1/Microsoft.Win32.Primitives.dll +0 -0
  36. package/dist/tooling/reference-assemblies/netstandard2.1/System.AppContext.dll +0 -0
  37. package/dist/tooling/reference-assemblies/netstandard2.1/System.Buffers.dll +0 -0
  38. package/dist/tooling/reference-assemblies/netstandard2.1/System.Collections.Concurrent.dll +0 -0
  39. package/dist/tooling/reference-assemblies/netstandard2.1/System.Collections.NonGeneric.dll +0 -0
  40. package/dist/tooling/reference-assemblies/netstandard2.1/System.Collections.Specialized.dll +0 -0
  41. package/dist/tooling/reference-assemblies/netstandard2.1/System.Collections.dll +0 -0
  42. package/dist/tooling/reference-assemblies/netstandard2.1/System.ComponentModel.Composition.dll +0 -0
  43. package/dist/tooling/reference-assemblies/netstandard2.1/System.ComponentModel.EventBasedAsync.dll +0 -0
  44. package/dist/tooling/reference-assemblies/netstandard2.1/System.ComponentModel.Primitives.dll +0 -0
  45. package/dist/tooling/reference-assemblies/netstandard2.1/System.ComponentModel.TypeConverter.dll +0 -0
  46. package/dist/tooling/reference-assemblies/netstandard2.1/System.ComponentModel.dll +0 -0
  47. package/dist/tooling/reference-assemblies/netstandard2.1/System.Console.dll +0 -0
  48. package/dist/tooling/reference-assemblies/netstandard2.1/System.Core.dll +0 -0
  49. package/dist/tooling/reference-assemblies/netstandard2.1/System.Data.Common.dll +0 -0
  50. package/dist/tooling/reference-assemblies/netstandard2.1/System.Data.dll +0 -0
  51. package/dist/tooling/reference-assemblies/netstandard2.1/System.Diagnostics.Contracts.dll +0 -0
  52. package/dist/tooling/reference-assemblies/netstandard2.1/System.Diagnostics.Debug.dll +0 -0
  53. package/dist/tooling/reference-assemblies/netstandard2.1/System.Diagnostics.FileVersionInfo.dll +0 -0
  54. package/dist/tooling/reference-assemblies/netstandard2.1/System.Diagnostics.Process.dll +0 -0
  55. package/dist/tooling/reference-assemblies/netstandard2.1/System.Diagnostics.StackTrace.dll +0 -0
  56. package/dist/tooling/reference-assemblies/netstandard2.1/System.Diagnostics.TextWriterTraceListener.dll +0 -0
  57. package/dist/tooling/reference-assemblies/netstandard2.1/System.Diagnostics.Tools.dll +0 -0
  58. package/dist/tooling/reference-assemblies/netstandard2.1/System.Diagnostics.TraceSource.dll +0 -0
  59. package/dist/tooling/reference-assemblies/netstandard2.1/System.Diagnostics.Tracing.dll +0 -0
  60. package/dist/tooling/reference-assemblies/netstandard2.1/System.Drawing.Primitives.dll +0 -0
  61. package/dist/tooling/reference-assemblies/netstandard2.1/System.Drawing.dll +0 -0
  62. package/dist/tooling/reference-assemblies/netstandard2.1/System.Dynamic.Runtime.dll +0 -0
  63. package/dist/tooling/reference-assemblies/netstandard2.1/System.Globalization.Calendars.dll +0 -0
  64. package/dist/tooling/reference-assemblies/netstandard2.1/System.Globalization.Extensions.dll +0 -0
  65. package/dist/tooling/reference-assemblies/netstandard2.1/System.Globalization.dll +0 -0
  66. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.Compression.FileSystem.dll +0 -0
  67. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.Compression.ZipFile.dll +0 -0
  68. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.Compression.dll +0 -0
  69. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.FileSystem.DriveInfo.dll +0 -0
  70. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.FileSystem.Primitives.dll +0 -0
  71. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.FileSystem.Watcher.dll +0 -0
  72. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.FileSystem.dll +0 -0
  73. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.IsolatedStorage.dll +0 -0
  74. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.MemoryMappedFiles.dll +0 -0
  75. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.Pipes.dll +0 -0
  76. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.UnmanagedMemoryStream.dll +0 -0
  77. package/dist/tooling/reference-assemblies/netstandard2.1/System.IO.dll +0 -0
  78. package/dist/tooling/reference-assemblies/netstandard2.1/System.Linq.Expressions.dll +0 -0
  79. package/dist/tooling/reference-assemblies/netstandard2.1/System.Linq.Parallel.dll +0 -0
  80. package/dist/tooling/reference-assemblies/netstandard2.1/System.Linq.Queryable.dll +0 -0
  81. package/dist/tooling/reference-assemblies/netstandard2.1/System.Linq.dll +0 -0
  82. package/dist/tooling/reference-assemblies/netstandard2.1/System.Memory.dll +0 -0
  83. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.Http.dll +0 -0
  84. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.NameResolution.dll +0 -0
  85. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.NetworkInformation.dll +0 -0
  86. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.Ping.dll +0 -0
  87. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.Primitives.dll +0 -0
  88. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.Requests.dll +0 -0
  89. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.Security.dll +0 -0
  90. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.Sockets.dll +0 -0
  91. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.WebHeaderCollection.dll +0 -0
  92. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.WebSockets.Client.dll +0 -0
  93. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.WebSockets.dll +0 -0
  94. package/dist/tooling/reference-assemblies/netstandard2.1/System.Net.dll +0 -0
  95. package/dist/tooling/reference-assemblies/netstandard2.1/System.Numerics.Vectors.dll +0 -0
  96. package/dist/tooling/reference-assemblies/netstandard2.1/System.Numerics.dll +0 -0
  97. package/dist/tooling/reference-assemblies/netstandard2.1/System.ObjectModel.dll +0 -0
  98. package/dist/tooling/reference-assemblies/netstandard2.1/System.Reflection.DispatchProxy.dll +0 -0
  99. package/dist/tooling/reference-assemblies/netstandard2.1/System.Reflection.Emit.ILGeneration.dll +0 -0
  100. package/dist/tooling/reference-assemblies/netstandard2.1/System.Reflection.Emit.Lightweight.dll +0 -0
  101. package/dist/tooling/reference-assemblies/netstandard2.1/System.Reflection.Emit.dll +0 -0
  102. package/dist/tooling/reference-assemblies/netstandard2.1/System.Reflection.Extensions.dll +0 -0
  103. package/dist/tooling/reference-assemblies/netstandard2.1/System.Reflection.Primitives.dll +0 -0
  104. package/dist/tooling/reference-assemblies/netstandard2.1/System.Reflection.dll +0 -0
  105. package/dist/tooling/reference-assemblies/netstandard2.1/System.Resources.Reader.dll +0 -0
  106. package/dist/tooling/reference-assemblies/netstandard2.1/System.Resources.ResourceManager.dll +0 -0
  107. package/dist/tooling/reference-assemblies/netstandard2.1/System.Resources.Writer.dll +0 -0
  108. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.CompilerServices.VisualC.dll +0 -0
  109. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.Extensions.dll +0 -0
  110. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.Handles.dll +0 -0
  111. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.InteropServices.RuntimeInformation.dll +0 -0
  112. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.InteropServices.dll +0 -0
  113. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.Numerics.dll +0 -0
  114. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.Serialization.Formatters.dll +0 -0
  115. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.Serialization.Json.dll +0 -0
  116. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.Serialization.Primitives.dll +0 -0
  117. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.Serialization.Xml.dll +0 -0
  118. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.Serialization.dll +0 -0
  119. package/dist/tooling/reference-assemblies/netstandard2.1/System.Runtime.dll +0 -0
  120. package/dist/tooling/reference-assemblies/netstandard2.1/System.Security.Claims.dll +0 -0
  121. package/dist/tooling/reference-assemblies/netstandard2.1/System.Security.Cryptography.Algorithms.dll +0 -0
  122. package/dist/tooling/reference-assemblies/netstandard2.1/System.Security.Cryptography.Csp.dll +0 -0
  123. package/dist/tooling/reference-assemblies/netstandard2.1/System.Security.Cryptography.Encoding.dll +0 -0
  124. package/dist/tooling/reference-assemblies/netstandard2.1/System.Security.Cryptography.Primitives.dll +0 -0
  125. package/dist/tooling/reference-assemblies/netstandard2.1/System.Security.Cryptography.X509Certificates.dll +0 -0
  126. package/dist/tooling/reference-assemblies/netstandard2.1/System.Security.Principal.dll +0 -0
  127. package/dist/tooling/reference-assemblies/netstandard2.1/System.Security.SecureString.dll +0 -0
  128. package/dist/tooling/reference-assemblies/netstandard2.1/System.ServiceModel.Web.dll +0 -0
  129. package/dist/tooling/reference-assemblies/netstandard2.1/System.Text.Encoding.Extensions.dll +0 -0
  130. package/dist/tooling/reference-assemblies/netstandard2.1/System.Text.Encoding.dll +0 -0
  131. package/dist/tooling/reference-assemblies/netstandard2.1/System.Text.RegularExpressions.dll +0 -0
  132. package/dist/tooling/reference-assemblies/netstandard2.1/System.Threading.Overlapped.dll +0 -0
  133. package/dist/tooling/reference-assemblies/netstandard2.1/System.Threading.Tasks.Extensions.dll +0 -0
  134. package/dist/tooling/reference-assemblies/netstandard2.1/System.Threading.Tasks.Parallel.dll +0 -0
  135. package/dist/tooling/reference-assemblies/netstandard2.1/System.Threading.Tasks.dll +0 -0
  136. package/dist/tooling/reference-assemblies/netstandard2.1/System.Threading.Thread.dll +0 -0
  137. package/dist/tooling/reference-assemblies/netstandard2.1/System.Threading.ThreadPool.dll +0 -0
  138. package/dist/tooling/reference-assemblies/netstandard2.1/System.Threading.Timer.dll +0 -0
  139. package/dist/tooling/reference-assemblies/netstandard2.1/System.Threading.dll +0 -0
  140. package/dist/tooling/reference-assemblies/netstandard2.1/System.Transactions.dll +0 -0
  141. package/dist/tooling/reference-assemblies/netstandard2.1/System.ValueTuple.dll +0 -0
  142. package/dist/tooling/reference-assemblies/netstandard2.1/System.Web.dll +0 -0
  143. package/dist/tooling/reference-assemblies/netstandard2.1/System.Windows.dll +0 -0
  144. package/dist/tooling/reference-assemblies/netstandard2.1/System.Xml.Linq.dll +0 -0
  145. package/dist/tooling/reference-assemblies/netstandard2.1/System.Xml.ReaderWriter.dll +0 -0
  146. package/dist/tooling/reference-assemblies/netstandard2.1/System.Xml.Serialization.dll +0 -0
  147. package/dist/tooling/reference-assemblies/netstandard2.1/System.Xml.XDocument.dll +0 -0
  148. package/dist/tooling/reference-assemblies/netstandard2.1/System.Xml.XPath.XDocument.dll +0 -0
  149. package/dist/tooling/reference-assemblies/netstandard2.1/System.Xml.XPath.dll +0 -0
  150. package/dist/tooling/reference-assemblies/netstandard2.1/System.Xml.XmlDocument.dll +0 -0
  151. package/dist/tooling/reference-assemblies/netstandard2.1/System.Xml.XmlSerializer.dll +0 -0
  152. package/dist/tooling/reference-assemblies/netstandard2.1/System.Xml.dll +0 -0
  153. package/dist/tooling/reference-assemblies/netstandard2.1/System.dll +0 -0
  154. package/dist/tooling/reference-assemblies/netstandard2.1/mscorlib.dll +0 -0
  155. package/dist/tooling/reference-assemblies/netstandard2.1/netstandard.dll +0 -0
  156. package/dist/tooling/ru/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  157. package/dist/tooling/ru/Microsoft.CodeAnalysis.resources.dll +0 -0
  158. package/dist/tooling/runtimes/win/lib/net6.0/System.Text.Encoding.CodePages.dll +0 -0
  159. package/dist/tooling/schema-contract.json +23 -0
  160. package/dist/tooling/tr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  161. package/dist/tooling/tr/Microsoft.CodeAnalysis.resources.dll +0 -0
  162. package/dist/tooling/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  163. package/dist/tooling/zh-Hans/Microsoft.CodeAnalysis.resources.dll +0 -0
  164. package/dist/tooling/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
  165. package/dist/tooling/zh-Hant/Microsoft.CodeAnalysis.resources.dll +0 -0
  166. package/package.json +8 -3
  167. package/skills/neocompose-cli/SKILL.md +339 -184
package/README.md CHANGED
@@ -1,84 +1,218 @@
1
1
  # `neo` — Neo Compose schema-as-code CLI
2
2
 
3
- Implements [specs/schema-as-code-cli.md](../specs/schema-as-code-cli.md): a
4
- git-like C# working copy of a project version's schema, bidirectionally
5
- synced with Convex, plus NeoScript and content commands.
3
+ `neo` keeps a Git-friendly C# working copy of a Neo Compose project schema,
4
+ syncs it bidirectionally with Convex, and exposes NeoScript and content
5
+ commands. Schema format v2 is compiler-backed: authored files are real C# 11,
6
+ not a handwritten C# subset.
7
+
8
+ The complete contract is in
9
+ [`specs/schema-as-code-cli.md`](../specs/schema-as-code-cli.md). The concise
10
+ agent workflow is in
11
+ [`cli/skills/neocompose-cli/SKILL.md`](skills/neocompose-cli/SKILL.md).
6
12
 
7
13
  ## Run
8
14
 
9
15
  ```sh
10
- npm i -g @neocompose/cli # customers: standalone package, `neo` on PATH
11
- node cli/dist/neo.mjs <command> # repo dev: runs TS directly via tsx
16
+ npm i -g @neocompose/cli # published package; installs `neo` on PATH
17
+ node cli/bin/neo.mjs <command> # repository development
18
+ ```
19
+
20
+ Neo does not install or download .NET. It first looks for a compatible Unity
21
+ 6000 runtime, then for a compatible system `dotnet`. Set `NEO_DOTNET_HOST` to
22
+ an executable when discovery needs an explicit override. Run `neo doctor` to
23
+ see the selected host, its compatibility result, the discovery cache, and the
24
+ bundled schema-contract versions.
25
+
26
+ ## Format v2 working copy
27
+
28
+ ```text
29
+ neo/
30
+ neo.json # includes formatVersion: 2
31
+ NeoCompose.Schema.csproj # netstandard2.1, C# 11, IDE-only
32
+ Types/ # custom classes
33
+ Interfaces/ # Neo interfaces
34
+ Enums/ # Neo enums
35
+ Root.cs # [NeoRegistry] roots and loose members
36
+ Templates/ # typed texture/audio settings
37
+ Localization.cs # typed localization settings
38
+ LocalizationStatuses/*.cs # typed workflow-status settings
39
+ Scripts/<Type>/<Member>.neo # tracked NeoScript sidecars
40
+ Migrations/*.neo
41
+ .neo/
42
+ state.json # sync bases and CAS hashes
43
+ dotnet-host.json # cached host discovery
44
+ tooling/ # bundled SDK, analyzer, generator, compiler
45
+ ```
46
+
47
+ `.neo/`, `bin/`, and `obj/` are gitignored. The C# project is an authoring
48
+ project only; the game never references or ships it. The public
49
+ `NeoCompose.Schema` SDK and analyzer are materialized from the npm package
50
+ under `.neo/tooling`. There is no generated `Schema/NeoSchemaAttributes.cs`.
51
+
52
+ Format v2 is a clean break. A workspace with no `formatVersion`, or with
53
+ `formatVersion: 1`, rejects normal schema commands with an instruction to run:
54
+
55
+ ```sh
56
+ neo pull --reset
57
+ ```
58
+
59
+ Reset reconstructs the schema from the server as v2, refreshes tooling, and
60
+ removes obsolete generated authoring files. There is no v1 parser or
61
+ compatibility shim.
62
+
63
+ ## Real C# authoring
64
+
65
+ Stable IDs remain visible so a Git rename stays a server rename. Everything
66
+ C# already expresses is written as C#: modifiers, base classes, interfaces,
67
+ generic parameters and constraints, nullability, defaults, declaration order,
68
+ method arguments, return types, and deferred `Task` results.
69
+
70
+ ```csharp
71
+ using System.Threading.Tasks;
72
+ using NeoCompose.Schema;
73
+
74
+ [NeoType("type-inventory-item")]
75
+ public abstract partial class InventoryItem<
76
+ [NeoId("generic-stack-data")] TStackData>
77
+ where TStackData : InventoryStackData
78
+ {
79
+ [NeoMember("attribute-name"), NeoText(SearchKey = true)]
80
+ public virtual string Name { get; init; } = "";
81
+
82
+ [NeoMember("attribute-type")]
83
+ public abstract ItemType Type { get; init; }
84
+
85
+ [NeoMember("attribute-description"), NeoComputed]
86
+ public virtual string Description { get; }
87
+
88
+ [NeoMember("function-use-primary"), NeoScript]
89
+ public virtual partial Task<bool> UsePrimary(InventoryItem<TStackData> target);
90
+ }
12
91
  ```
13
92
 
14
- ## Packaging (`@neocompose/cli`)
93
+ - `virtual`, `abstract`, and `override` have their native meanings. An
94
+ override's base member ID is resolved from the Roslyn symbol graph.
95
+ - Property type and nullability determine Neo kind and requiredness.
96
+ - A property initializer is its default; declaration order is schema order.
97
+ - Method signatures define function arguments and returns. `Task`/`Task<T>`
98
+ means deferred execution. The bundled source generator gives concrete
99
+ partial declarations inert compile-time implementations; authored schema
100
+ code is never executed.
101
+ - `[NeoMember]` owns stable identity and common options. Narrow typed
102
+ attributes such as `[NeoText]`, `[NeoNumber]`, `[NeoList]`, `[NeoIndex]`,
103
+ `[NeoColumn]`, `[NeoLookup]`, `[NeoDialogue]`, and `[NeoFile]` express
104
+ Neo-specific behavior.
105
+ - Nested entry graphs, texture/audio imports, localization, and uncommon
106
+ settings use strongly typed object initializers. Their complete option sets
107
+ participate in normal C# IntelliSense.
108
+
109
+ Only statically analyzable expressions are accepted: literals, enum values,
110
+ `nameof`, `typeof`, arrays/collections, object initializers, and approved
111
+ `Neo.*` reference constructors. The compiler never loads or executes the
112
+ authored assembly. JSON carriers and identity escape hatches such as
113
+ `ExtraJson`, `DefaultJson`, `RetJson`, `ArgsJson`, `EntryChainJson`,
114
+ `SchemaKeyOrderJson`, `GenericParamIds`, `ChainJson`, `SignatureJson`,
115
+ `ExtendsId`, `isVirtual`, and `isAbstract` do not exist in v2.
15
116
 
16
- The CLI publishes as a standalone npm package from `cli/`:
117
+ Localization workflow statuses are ordinary stable records rather than IDs
118
+ hidden in localization JSON:
119
+
120
+ ```csharp
121
+ [NeoLocalizationStatus("localization-status-approved")]
122
+ public sealed partial class Approved
123
+ {
124
+ public static NeoLocalizationStatusSettings Settings { get; } = new()
125
+ {
126
+ Slug = "approved",
127
+ Name = "Approved",
128
+ Color = "#16a34a",
129
+ TransitionRules = new[] { "localization-status-needs-review" },
130
+ };
131
+ }
132
+ ```
17
133
 
18
- - `cli/package.json` — `bin: neo`, runtime deps are only `convex` and
19
- `@inquirer/prompts`.
20
- - `node cli/build.mjs` (also `prepublishOnly`) bundles `src/main.ts` into
21
- `dist/neo.mjs` with esbuild: all shared monorepo code (`src/models`,
22
- `src/database/neoscript`, the evaluator, `convex/_generated` references)
23
- is compiled INTO the bundle, so the published artifact has no source
24
- dependency on this repo. The build fails if the bundle imports any
25
- package not declared as a dependency.
26
- - `cli/dist/` is gitignored; publish with `cd cli && npm publish`.
134
+ ## NeoScript sidecars
27
135
 
28
- ## Interactive UX
136
+ NeoScript is tracked separately from C# metadata:
137
+
138
+ - `Scripts/<DeclaringType>/<Member>.neo` is the only canonical path.
139
+ - Every file contains its complete contextual wrapper. The outer signature
140
+ mirrors the C# member and its NeoScript result type (`Task<T>` is represented
141
+ as `T`), then adds `<DeclaringType> this, Root root`; this chrome is protected
142
+ in Monaco while the executable regions remain editable.
143
+ - A computed property wrapper contains `get { ... }` and, when writable,
144
+ `set(<Type> value) { ... }` units.
145
+ - A concrete `[NeoScript]` method wrapper contains a nested
146
+ `(<parameters>) { ... }` executable unit.
147
+ - Abstract scripted members have no file.
148
+ - Missing, duplicate, case-colliding, and orphaned sidecars are hard
149
+ diagnostics. Stable member IDs let canonical renames move sidecars safely.
150
+ - Canonical C# includes a `// NeoScript: Scripts/...` link above each scripted
151
+ declaration. Definitions and navigation resolve in both directions between
152
+ that declaration and the sidecar wrapper.
153
+
154
+ ```neoscript
155
+ string Description(InventoryItem this, Root root) {
156
+ get {
157
+ return $"{this.Name} ({this.Type})";
158
+ }
159
+ }
160
+
161
+ bool UsePrimary(InventoryItem this, Root root) {
162
+ (InventoryItem target) {
163
+ return target.IsStackable;
164
+ }
165
+ }
166
+ ```
29
167
 
30
- In a terminal, missing arguments become prompts (`@inquirer/prompts`):
31
- `neo init` walks project → branch/version → directory; `neo login` picks the
32
- profile and opens the browser for the device code; `neo branch switch` /
33
- `neo merge` offer pickers; `neo push` confirms (and offers bump acceptance on
34
- rejection); `neo release cut` previews the derived floor before asking for
35
- the bump; pull conflicts offer markers / mine-all / theirs-all. Every prompt
36
- degrades in CI/pipes (no TTY, `CI`, or `NEO_NO_INTERACTIVE` set): commands
37
- keep their flag-driven behavior, prompts that would block instead raise an
38
- error naming the flag to pass, and output is plain (also `NO_COLOR`).
168
+ The browser-safe `neoscript-language` package is authoritative for the CLI,
169
+ server compiler, web Monaco editor, and VS Code LSP. Monaco's existing syntax
170
+ highlighting, comments/interpolation, scaffolds and protected regions,
171
+ project-aware completion, hover, and accurate diagnostics are a
172
+ release-blocking compatibility floor. The shared service also adds
173
+ parser-recovery completion, signature help, definitions into C#, references,
174
+ rename, symbols, semantic tokens, quick fixes, formatting, richer related
175
+ diagnostics, contextual ranking, and incremental analysis. The in-repo VSIX
176
+ uses the same results; marketplace publication is a separate release step.
39
177
 
40
178
  ## Commands
41
179
 
42
- | Command | Purpose |
43
- | -------------------------------------- | -------------------------------------------------------------------------------------------------------- |
44
- | `login` | Device-code OAuth (`neo-cli-editor` / `--profile release`); `--token-stdin` / `NEO_COMPOSE_TOKEN` for CI |
45
- | `init --project <id> [--version <id>]` | Scaffold `neo/` (csproj, attributes, .gitignore) + first pull |
46
- | `pull [--force]` | Sync from server; field-level three-way merge; conflict markers on overlap |
47
- | `push [--dry-run] [--accept-bump]` | Atomic CAS transaction; assigns ids to creates; canonical rewrite |
48
- | `status` / `diff` | Working-copy changes vs base |
49
- | `dev [--push]` | Convex websocket sync-signal subscription + file watcher |
50
- | `resolve --mine\|--theirs` | Conflict-marker sugar (editing the file is the real path) |
51
- | `script check\|compile\|eval\|apply` | Compile/evaluate properties, actions, and typed NeoScript Functions with the web compiler/evaluator |
52
- | `records` / `values` / `loc` | Content reads + writes with JSON-array batch stdin |
53
-
54
- Working-copy layout and the C# subset are documented in
55
- [`cli/skills/neocompose-cli/SKILL.md`](skills/neocompose-cli/SKILL.md) (the agent onboarding surface) and the
56
- spec. State lives in `neo/.neo/state.json` (gitignored): per-record base
57
- content hashes — the compare-and-swap tokens — plus conflict bookkeeping.
58
-
59
- ## Architecture notes
60
-
61
- - **Convex-direct, fully typed**: the CLI calls Convex with `api.*`
62
- references and inferred types (`cli/src/convex.ts`), authenticated by a
63
- Convex JWT minted from the scoped device-flow session. Pushes go through
64
- the session-gated `serverProjectRecordOperations.commitFromSession`
65
- (same per-change scope gates + CAS as the web's S2S commit). HTTP is used
66
- only for the auth plane and for content verbs that reuse Next-side write
67
- services. Record payloads are narrowed with the same `src/models` guards
68
- the web app uses.
69
-
70
- - **Round-trip invariant**: `pull` → `push` is always a no-op. Enforced by
71
- the consumption-model partition (`cli/src/schema/emit.ts`): every record
72
- field is either expressed in C#, carried in `ExtraJson`, or held as a
73
- volatile field in state and merged back at reconstruction.
74
- - **NeoScript Functions**: `[NeoNSFunction(Code, RetJson, ArgsJson,
75
- Deferred)]` projects authored source/signature while compiled `action` stays
76
- volatile. `neo script check --all` validates every stored NeoScript body;
77
- `eval`/`apply --function <Type.Member> --this-value <id> --args '[...]'`
78
- preview typed results and write intents without committing them.
79
- - The parser (`cli/src/schema/parse.ts`) is a hand-rolled
80
- recursive-descent parser for the constrained subset with
81
- file:line:column diagnostics.
82
- - Server surfaces: `schema/document` (read), `schema/transactions`
83
- (atomic CAS write), `projectExportData.schemaSignal` (websocket signal).
84
- - Tests: `npx vitest run cli` (round-trip corpus, parser, merge matrix).
180
+ | Command | Purpose |
181
+ | ----------------------------------------- | -------------------------------------------------------------------------------------------------- |
182
+ | `login` | Device-code OAuth; use `--profile release`, `--token-stdin`, or `NEO_COMPOSE_TOKEN` as appropriate |
183
+ | `init --project <id> [--version <id>]` | Scaffold a format-v2 working copy and perform the first pull |
184
+ | `doctor` | Report runtime discovery, compatibility, cache, tooling, and contract versions |
185
+ | `pull [--reset]` | Sync or reconstruct; normal pulls use record-level three-way merge |
186
+ | `status` / `diff` | Compile the working copy and compare its manifest with the base |
187
+ | `push [--dry-run] [--accept-bump]` | Preview or commit one atomic compare-and-swap transaction |
188
+ | `dev [--push]` | Watch the Convex sync signal and local files; pushing remains opt-in |
189
+ | `resolve --mine\|--theirs` | Conflict-marker convenience; editing the final source is authoritative |
190
+ | `script check\|compile\|eval\|apply` | Use the shared NeoScript compiler/evaluator |
191
+ | `records` / `values` / `loc` / `dialogue` | Read and batch-edit content without materializing it as schema files |
192
+
193
+ The central invariant is unchanged: a pull followed immediately by status or
194
+ push must produce no changes. The manifest contract classifies every field as
195
+ authored, derived, or volatile and preserves derived server data from the base
196
+ record. A newly introduced authored server field fails with “CLI contract
197
+ upgrade required” instead of being hidden in opaque JSON.
198
+
199
+ ## Packaging
200
+
201
+ `node cli/build.mjs` bundles the Node orchestrator and shared TypeScript code,
202
+ builds the Roslyn sidecar, and places the prebuilt compiler, dependencies,
203
+ runtime metadata, C# SDK, analyzer, and source generator in `dist/tooling`.
204
+ The npm package contains the entire toolchain except a .NET host. Published
205
+ contents and CLI/SDK/manifest contract versions are release-tested.
206
+
207
+ Useful checks while developing:
208
+
209
+ ```sh
210
+ npm run typecheck
211
+ npx vitest run cli
212
+ npm run build
213
+ ```
214
+
215
+ Run the repository's full verification suite before release, package the
216
+ VSIX, exercise the Unity and Hello World samples through their documented
217
+ Unity workflow, verify a live `neowyn` pull/status/push dry run, and run
218
+ `npm run doctor` last.