@nimiplatform/app-tools 0.1.2 → 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 (120) hide show
  1. package/LICENSE +198 -6
  2. package/README.md +83 -27
  3. package/bin/nimi-app.mjs +328 -45
  4. package/lib/app-access-declaration.mjs +49 -0
  5. package/lib/app-doctor-update.mjs +411 -149
  6. package/lib/app-pack.mjs +401 -0
  7. package/lib/app-project-lifecycle.mjs +1141 -0
  8. package/lib/app-scaffold-capabilities.mjs +769 -0
  9. package/lib/app-scaffold-default-source.mjs +21 -0
  10. package/lib/app-scaffold-profiles.mjs +1093 -0
  11. package/lib/app-scaffold.mjs +1266 -813
  12. package/lib/index.mjs +194 -42
  13. package/lib/simulator-conformance-ast.mjs +498 -0
  14. package/lib/simulator-conformance-css.mjs +116 -0
  15. package/lib/simulator-conformance-graph.mjs +757 -0
  16. package/lib/simulator-conformance.d.mts +14 -0
  17. package/lib/simulator-conformance.mjs +203 -0
  18. package/lib/simulator-css-profile.d.mts +27 -0
  19. package/lib/simulator-css-profile.mjs +531 -0
  20. package/lib/simulator-kit-export-resolution.mjs +70 -0
  21. package/lib/simulator-manifest.mjs +334 -0
  22. package/package.json +66 -3
  23. package/scripts/dev-shell.mjs +465 -0
  24. package/scripts/sync-app-source.mjs +300 -0
  25. package/scripts/sync-scaffold-versions.mjs +91 -0
  26. package/templates/app-source/LICENSE +21 -0
  27. package/templates/app-source/src/ai-studio-core/ai-config.ts +100 -0
  28. package/templates/app-source/src/ai-studio-core/ai-studio-core.css +338 -0
  29. package/templates/app-source/src/ai-studio-core/contexts.tsx +61 -0
  30. package/templates/app-source/src/ai-studio-core/history-policy.ts +447 -0
  31. package/templates/app-source/src/ai-studio-core/history.ts +824 -0
  32. package/templates/app-source/src/ai-studio-core/host-context.tsx +79 -0
  33. package/templates/app-source/src/ai-studio-core/index.ts +214 -0
  34. package/templates/app-source/src/ai-studio-core/messages/en.json +310 -0
  35. package/templates/app-source/src/ai-studio-core/messages/index.ts +47 -0
  36. package/templates/app-source/src/ai-studio-core/messages/zh.json +310 -0
  37. package/templates/app-source/src/ai-studio-core/module-registration.ts +109 -0
  38. package/templates/app-source/src/ai-studio-core/non-success-presentation.ts +65 -0
  39. package/templates/app-source/src/ai-studio-core/parameter-fields.tsx +247 -0
  40. package/templates/app-source/src/ai-studio-core/parameters.ts +110 -0
  41. package/templates/app-source/src/ai-studio-core/prompt-drafts.ts +69 -0
  42. package/templates/app-source/src/ai-studio-core/run-target.ts +123 -0
  43. package/templates/app-source/src/ai-studio-core/runtime-dispatcher.ts +35 -0
  44. package/templates/app-source/src/ai-studio-core/runtime-types.ts +86 -0
  45. package/templates/app-source/src/ai-studio-core/runtime.ts +306 -0
  46. package/templates/app-source/src/ai-studio-core/section-ai-testing-admission.ts +38 -0
  47. package/templates/app-source/src/ai-studio-core/section-ai-testing-ai-config.tsx +30 -0
  48. package/templates/app-source/src/ai-studio-core/section-ai-testing-artifact-preview.ts +40 -0
  49. package/templates/app-source/src/ai-studio-core/section-ai-testing-composer.tsx +257 -0
  50. package/templates/app-source/src/ai-studio-core/section-ai-testing-history.tsx +676 -0
  51. package/templates/app-source/src/ai-studio-core/section-ai-testing-input.ts +19 -0
  52. package/templates/app-source/src/ai-studio-core/section-ai-testing-output.tsx +291 -0
  53. package/templates/app-source/src/ai-studio-core/section-ai-testing-result.tsx +413 -0
  54. package/templates/app-source/src/ai-studio-core/section-ai-testing-run.ts +174 -0
  55. package/templates/app-source/src/ai-studio-core/section-ai-testing-studio-result.tsx +449 -0
  56. package/templates/app-source/src/ai-studio-core/section-ai-testing-surface.tsx +45 -0
  57. package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +494 -0
  58. package/templates/app-source/src/ai-studio-core/studio-directives.ts +33 -0
  59. package/templates/app-source/src/ai-studio-core/workspace.tsx +381 -0
  60. package/templates/app-source/src/product-modules/agent-center/index.tsx +27 -0
  61. package/templates/app-source/src/product-modules/agent-conversation/index.tsx +19 -0
  62. package/templates/app-source/src/product-modules/agent-realtime/index.tsx +29 -0
  63. package/templates/app-source/src/product-modules/kit-recipes/gallery.tsx +142 -0
  64. package/templates/app-source/src/product-modules/kit-recipes/index.tsx +19 -0
  65. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-data-recipes.tsx +336 -0
  66. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-demos.tsx +165 -0
  67. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-recipes.tsx +682 -0
  68. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-surface.tsx +341 -0
  69. package/templates/app-source/src/studio-modules/studio-create/descriptors.ts +26 -0
  70. package/templates/app-source/src/studio-modules/studio-create/index.ts +14 -0
  71. package/templates/app-source/src/studio-modules/studio-create/messages/en.json +67 -0
  72. package/templates/app-source/src/studio-modules/studio-create/messages/index.ts +5 -0
  73. package/templates/app-source/src/studio-modules/studio-create/messages/zh.json +67 -0
  74. package/templates/app-source/src/studio-modules/studio-create/parameter-panel.tsx +153 -0
  75. package/templates/app-source/src/studio-modules/studio-create/parameters.ts +70 -0
  76. package/templates/app-source/src/studio-modules/studio-create/registration.ts +46 -0
  77. package/templates/app-source/src/studio-modules/studio-create/runtime.ts +339 -0
  78. package/templates/app-source/src/studio-modules/studio-media/descriptors.ts +22 -0
  79. package/templates/app-source/src/studio-modules/studio-media/index.ts +12 -0
  80. package/templates/app-source/src/studio-modules/studio-media/messages/en.json +82 -0
  81. package/templates/app-source/src/studio-modules/studio-media/messages/index.ts +5 -0
  82. package/templates/app-source/src/studio-modules/studio-media/messages/zh.json +82 -0
  83. package/templates/app-source/src/studio-modules/studio-media/parameter-panel.tsx +283 -0
  84. package/templates/app-source/src/studio-modules/studio-media/parameters.ts +94 -0
  85. package/templates/app-source/src/studio-modules/studio-media/registration.ts +44 -0
  86. package/templates/app-source/src/studio-modules/studio-media/runtime.ts +113 -0
  87. package/templates/app-source/src/studio-modules/studio-voice/descriptors.ts +28 -0
  88. package/templates/app-source/src/studio-modules/studio-voice/index.ts +16 -0
  89. package/templates/app-source/src/studio-modules/studio-voice/messages/en.json +99 -0
  90. package/templates/app-source/src/studio-modules/studio-voice/messages/index.ts +5 -0
  91. package/templates/app-source/src/studio-modules/studio-voice/messages/zh.json +99 -0
  92. package/templates/app-source/src/studio-modules/studio-voice/parameter-panel.tsx +284 -0
  93. package/templates/app-source/src/studio-modules/studio-voice/parameters.ts +116 -0
  94. package/templates/app-source/src/studio-modules/studio-voice/registration.ts +59 -0
  95. package/templates/app-source/src/studio-modules/studio-voice/runtime.ts +347 -0
  96. package/templates/app-source/src/workbench-core/empty-state.tsx +31 -0
  97. package/templates/app-source/src/workbench-core/index.ts +17 -0
  98. package/templates/app-source/src/workbench-core/runtime-gate.tsx +131 -0
  99. package/templates/app-source/src/workbench-core/workbench-core.css +255 -0
  100. package/templates/app-source/src/workbench-core/workbench-core.tsx +140 -0
  101. package/templates/app-source.manifest.json +333 -0
  102. package/templates/default-starter/AGENTS.md +33 -0
  103. package/templates/default-starter/LICENSE +21 -0
  104. package/templates/default-starter/README.md +41 -0
  105. package/templates/default-starter/SECURITY.md +5 -0
  106. package/templates/default-starter/index.html +12 -0
  107. package/templates/default-starter/scripts/validate.mjs +26 -0
  108. package/templates/default-starter/src/shell/App.tsx +27 -0
  109. package/templates/default-starter/src/shell/auth/app-identity.ts +3 -0
  110. package/templates/default-starter/src/shell/auth/local-app-client.ts +18 -0
  111. package/templates/default-starter/src/shell/auth/runtime-platform.ts +110 -0
  112. package/templates/default-starter/src/shell/authenticated-shell.tsx +20 -0
  113. package/templates/default-starter/src/shell/workbench-target-adapter.ts +40 -0
  114. package/templates/default-starter/src/styles.css +26 -0
  115. package/templates/default-starter/src-tauri/Cargo.toml +17 -0
  116. package/templates/default-starter/src-tauri/build.rs +5 -0
  117. package/templates/default-starter/src-tauri/capabilities/default.json +7 -0
  118. package/templates/default-starter/src-tauri/tauri.conf.json +26 -0
  119. package/templates/default-starter/tsconfig.json +18 -0
  120. package/templates/default-starter.manifest.json +99 -0
@@ -0,0 +1,333 @@
1
+ {
2
+ "manifestVersion": 2,
3
+ "sourceApp": "apps/lab",
4
+ "resolvedModules": [
5
+ "ai-studio-core",
6
+ "studio-create",
7
+ "studio-media",
8
+ "studio-voice",
9
+ "kit-recipes",
10
+ "agent-center",
11
+ "agent-conversation",
12
+ "agent-realtime"
13
+ ],
14
+ "sourceIdentity": {
15
+ "tauriIdentifier": "ai.nimi.apps.nimi.lab",
16
+ "packageName": "@nimiplatform/lab",
17
+ "cargoPackageName": "nimiapp-lab-shell",
18
+ "appId": "nimi.lab",
19
+ "appTitle": "Nimi Lab",
20
+ "appSlug": "nimi-lab",
21
+ "rendererEntryId": "lab-app",
22
+ "accentPack": "nimi-accent",
23
+ "devPort": "1468"
24
+ },
25
+ "identityReplacementOrder": [
26
+ "tauriIdentifier",
27
+ "packageName",
28
+ "cargoPackageName",
29
+ "accentPack",
30
+ "appId",
31
+ "appTitle",
32
+ "appSlug",
33
+ "devPort"
34
+ ],
35
+ "files": [
36
+ {
37
+ "path": "src/ai-studio-core/ai-config.ts",
38
+ "class": "app-owned product code"
39
+ },
40
+ {
41
+ "path": "src/ai-studio-core/ai-studio-core.css",
42
+ "class": "app-owned product code"
43
+ },
44
+ {
45
+ "path": "src/ai-studio-core/contexts.tsx",
46
+ "class": "app-owned product code"
47
+ },
48
+ {
49
+ "path": "src/ai-studio-core/history-policy.ts",
50
+ "class": "app-owned product code"
51
+ },
52
+ {
53
+ "path": "src/ai-studio-core/history.ts",
54
+ "class": "app-owned product code"
55
+ },
56
+ {
57
+ "path": "src/ai-studio-core/host-context.tsx",
58
+ "class": "app-owned product code"
59
+ },
60
+ {
61
+ "path": "src/ai-studio-core/index.ts",
62
+ "class": "app-owned product code"
63
+ },
64
+ {
65
+ "path": "src/ai-studio-core/messages/en.json",
66
+ "class": "app-owned product code"
67
+ },
68
+ {
69
+ "path": "src/ai-studio-core/messages/index.ts",
70
+ "class": "app-owned product code"
71
+ },
72
+ {
73
+ "path": "src/ai-studio-core/messages/zh.json",
74
+ "class": "app-owned product code"
75
+ },
76
+ {
77
+ "path": "src/ai-studio-core/module-registration.ts",
78
+ "class": "app-owned product code"
79
+ },
80
+ {
81
+ "path": "src/ai-studio-core/non-success-presentation.ts",
82
+ "class": "app-owned product code"
83
+ },
84
+ {
85
+ "path": "src/ai-studio-core/parameter-fields.tsx",
86
+ "class": "app-owned product code"
87
+ },
88
+ {
89
+ "path": "src/ai-studio-core/parameters.ts",
90
+ "class": "app-owned product code"
91
+ },
92
+ {
93
+ "path": "src/ai-studio-core/prompt-drafts.ts",
94
+ "class": "app-owned product code"
95
+ },
96
+ {
97
+ "path": "src/ai-studio-core/run-target.ts",
98
+ "class": "app-owned product code"
99
+ },
100
+ {
101
+ "path": "src/ai-studio-core/runtime-dispatcher.ts",
102
+ "class": "app-owned product code"
103
+ },
104
+ {
105
+ "path": "src/ai-studio-core/runtime-types.ts",
106
+ "class": "app-owned product code"
107
+ },
108
+ {
109
+ "path": "src/ai-studio-core/runtime.ts",
110
+ "class": "app-owned product code"
111
+ },
112
+ {
113
+ "path": "src/ai-studio-core/section-ai-testing-admission.ts",
114
+ "class": "app-owned product code"
115
+ },
116
+ {
117
+ "path": "src/ai-studio-core/section-ai-testing-ai-config.tsx",
118
+ "class": "app-owned product code"
119
+ },
120
+ {
121
+ "path": "src/ai-studio-core/section-ai-testing-artifact-preview.ts",
122
+ "class": "app-owned product code"
123
+ },
124
+ {
125
+ "path": "src/ai-studio-core/section-ai-testing-composer.tsx",
126
+ "class": "app-owned product code"
127
+ },
128
+ {
129
+ "path": "src/ai-studio-core/section-ai-testing-history.tsx",
130
+ "class": "app-owned product code"
131
+ },
132
+ {
133
+ "path": "src/ai-studio-core/section-ai-testing-input.ts",
134
+ "class": "app-owned product code"
135
+ },
136
+ {
137
+ "path": "src/ai-studio-core/section-ai-testing-output.tsx",
138
+ "class": "app-owned product code"
139
+ },
140
+ {
141
+ "path": "src/ai-studio-core/section-ai-testing-result.tsx",
142
+ "class": "app-owned product code"
143
+ },
144
+ {
145
+ "path": "src/ai-studio-core/section-ai-testing-run.ts",
146
+ "class": "app-owned product code"
147
+ },
148
+ {
149
+ "path": "src/ai-studio-core/section-ai-testing-studio-result.tsx",
150
+ "class": "app-owned product code"
151
+ },
152
+ {
153
+ "path": "src/ai-studio-core/section-ai-testing-surface.tsx",
154
+ "class": "app-owned product code"
155
+ },
156
+ {
157
+ "path": "src/ai-studio-core/section-ai-testing.tsx",
158
+ "class": "app-owned product code"
159
+ },
160
+ {
161
+ "path": "src/ai-studio-core/studio-directives.ts",
162
+ "class": "app-owned product code"
163
+ },
164
+ {
165
+ "path": "src/ai-studio-core/workspace.tsx",
166
+ "class": "app-owned product code"
167
+ },
168
+ {
169
+ "path": "src/product-modules/agent-center/index.tsx",
170
+ "class": "app-owned product code"
171
+ },
172
+ {
173
+ "path": "src/product-modules/agent-conversation/index.tsx",
174
+ "class": "app-owned product code"
175
+ },
176
+ {
177
+ "path": "src/product-modules/agent-realtime/index.tsx",
178
+ "class": "app-owned product code"
179
+ },
180
+ {
181
+ "path": "src/product-modules/kit-recipes/gallery.tsx",
182
+ "class": "app-owned product code"
183
+ },
184
+ {
185
+ "path": "src/product-modules/kit-recipes/index.tsx",
186
+ "class": "app-owned product code"
187
+ },
188
+ {
189
+ "path": "src/product-modules/kit-recipes/kit-component-gallery-data-recipes.tsx",
190
+ "class": "app-owned product code"
191
+ },
192
+ {
193
+ "path": "src/product-modules/kit-recipes/kit-component-gallery-demos.tsx",
194
+ "class": "app-owned product code"
195
+ },
196
+ {
197
+ "path": "src/product-modules/kit-recipes/kit-component-gallery-recipes.tsx",
198
+ "class": "app-owned product code"
199
+ },
200
+ {
201
+ "path": "src/product-modules/kit-recipes/kit-component-gallery-surface.tsx",
202
+ "class": "app-owned product code"
203
+ },
204
+ {
205
+ "path": "src/studio-modules/studio-create/descriptors.ts",
206
+ "class": "app-owned product code"
207
+ },
208
+ {
209
+ "path": "src/studio-modules/studio-create/index.ts",
210
+ "class": "app-owned product code"
211
+ },
212
+ {
213
+ "path": "src/studio-modules/studio-create/messages/en.json",
214
+ "class": "app-owned product code"
215
+ },
216
+ {
217
+ "path": "src/studio-modules/studio-create/messages/index.ts",
218
+ "class": "app-owned product code"
219
+ },
220
+ {
221
+ "path": "src/studio-modules/studio-create/messages/zh.json",
222
+ "class": "app-owned product code"
223
+ },
224
+ {
225
+ "path": "src/studio-modules/studio-create/parameter-panel.tsx",
226
+ "class": "app-owned product code"
227
+ },
228
+ {
229
+ "path": "src/studio-modules/studio-create/parameters.ts",
230
+ "class": "app-owned product code"
231
+ },
232
+ {
233
+ "path": "src/studio-modules/studio-create/registration.ts",
234
+ "class": "app-owned product code"
235
+ },
236
+ {
237
+ "path": "src/studio-modules/studio-create/runtime.ts",
238
+ "class": "app-owned product code"
239
+ },
240
+ {
241
+ "path": "src/studio-modules/studio-media/descriptors.ts",
242
+ "class": "app-owned product code"
243
+ },
244
+ {
245
+ "path": "src/studio-modules/studio-media/index.ts",
246
+ "class": "app-owned product code"
247
+ },
248
+ {
249
+ "path": "src/studio-modules/studio-media/messages/en.json",
250
+ "class": "app-owned product code"
251
+ },
252
+ {
253
+ "path": "src/studio-modules/studio-media/messages/index.ts",
254
+ "class": "app-owned product code"
255
+ },
256
+ {
257
+ "path": "src/studio-modules/studio-media/messages/zh.json",
258
+ "class": "app-owned product code"
259
+ },
260
+ {
261
+ "path": "src/studio-modules/studio-media/parameter-panel.tsx",
262
+ "class": "app-owned product code"
263
+ },
264
+ {
265
+ "path": "src/studio-modules/studio-media/parameters.ts",
266
+ "class": "app-owned product code"
267
+ },
268
+ {
269
+ "path": "src/studio-modules/studio-media/registration.ts",
270
+ "class": "app-owned product code"
271
+ },
272
+ {
273
+ "path": "src/studio-modules/studio-media/runtime.ts",
274
+ "class": "app-owned product code"
275
+ },
276
+ {
277
+ "path": "src/studio-modules/studio-voice/descriptors.ts",
278
+ "class": "app-owned product code"
279
+ },
280
+ {
281
+ "path": "src/studio-modules/studio-voice/index.ts",
282
+ "class": "app-owned product code"
283
+ },
284
+ {
285
+ "path": "src/studio-modules/studio-voice/messages/en.json",
286
+ "class": "app-owned product code"
287
+ },
288
+ {
289
+ "path": "src/studio-modules/studio-voice/messages/index.ts",
290
+ "class": "app-owned product code"
291
+ },
292
+ {
293
+ "path": "src/studio-modules/studio-voice/messages/zh.json",
294
+ "class": "app-owned product code"
295
+ },
296
+ {
297
+ "path": "src/studio-modules/studio-voice/parameter-panel.tsx",
298
+ "class": "app-owned product code"
299
+ },
300
+ {
301
+ "path": "src/studio-modules/studio-voice/parameters.ts",
302
+ "class": "app-owned product code"
303
+ },
304
+ {
305
+ "path": "src/studio-modules/studio-voice/registration.ts",
306
+ "class": "app-owned product code"
307
+ },
308
+ {
309
+ "path": "src/studio-modules/studio-voice/runtime.ts",
310
+ "class": "app-owned product code"
311
+ },
312
+ {
313
+ "path": "src/workbench-core/empty-state.tsx",
314
+ "class": "app-owned product code"
315
+ },
316
+ {
317
+ "path": "src/workbench-core/index.ts",
318
+ "class": "app-owned product code"
319
+ },
320
+ {
321
+ "path": "src/workbench-core/runtime-gate.tsx",
322
+ "class": "app-owned product code"
323
+ },
324
+ {
325
+ "path": "src/workbench-core/workbench-core.css",
326
+ "class": "app-owned product code"
327
+ },
328
+ {
329
+ "path": "src/workbench-core/workbench-core.tsx",
330
+ "class": "app-owned product code"
331
+ }
332
+ ]
333
+ }
@@ -0,0 +1,33 @@
1
+ # AGENTS.md
2
+
3
+ ## Scope
4
+ - Treat `.nimi/app-scaffold/{intent,lock}.json` as app-scaffold intent and lock state.
5
+ - Treat `.nimi/{config,contracts,methodology}/**` as `@nimiplatform/nimi-coding` managed projections created by `pnpm run init`.
6
+ - Keep auth, Runtime, App Access declaration, manifest, and Tauri shell glue in scaffold-managed files.
7
+ - App-owned product code is `src/workbench-core/**`, selected `src/capabilities/**`, `src/shell/routes/product-area.tsx`, and App-authored product screens, state, tests, styles, and bounded native helpers.
8
+ - Scaffold-managed code is the carrier/auth wiring, identity, manifests, project tooling, bounded native integration, and `src/scaffold/generated/**` composition glue.
9
+ - Treat this template as the identity-neutral, Lab-derived base. The generator composes it positively with only the dependency closure of explicitly selected admitted features under `src/capabilities/**`.
10
+ - The scaffold contains developer build/release inputs and one managed GitHub workflow, but it must not generate public admission, listing, registry-main, installed, running, or Runtime-access truth.
11
+
12
+ ## Hard Boundaries
13
+ - Follow `Runtime / Realm truth -> @nimiplatform/sdk interface -> app consumer`.
14
+ - Runtime owns local execution, capability, readiness, routing, model, and memory truth; Realm owns canonical cloud identity, relationships, entities, and shared persistence.
15
+ - Use SDK typed projections for Runtime and Realm; do not call private endpoints or mirror their canonical truth locally.
16
+ - Use `@nimiplatform/kit` for reusable controls, layout, accessibility, tokens, and interaction patterns; keep app CSS and composition product-specific.
17
+ - Keep the base free of Lab-only product behavior. Feature implementations enter generated output only through the app-tools module registry and public admitted `--features` selection. Internal modules such as `ai-studio-core` enter only through dependency closure and are never selected directly.
18
+ - Keep Lab-only Settings/account, App Access diagnostics, Realm/Agent probes, World Tour, and native or diagnostic surfaces outside generated product composition.
19
+ - Preserve ownership: `sync` may refresh scaffold-managed files but must not overwrite app-owned workbench or module code; `check` is non-mutating. Identity and direct feature selection are immutable; create a fresh scaffold to change them.
20
+ - Preserve lifecycle order: `create -> dependency install -> init -> sync -> check -> dev/test/build -> pack`. Never run lifecycle commands after `create` before dependencies are installed. Local publish remains unavailable; production publication is owned by the managed protected-tag GitHub workflow, while registry admission and installation remain separate later owners.
21
+ - This third-party scaffold uses public registry versions only; do not substitute workspace paths, local overrides, tarballs, or downgrades. A private workspace-validation result is not standalone evidence.
22
+ - Use the scaffold-managed Kit Electron app-host bridge for supervised local development. Treat `nimi-shell-tauri` glue, where present, as bounded independent OS integration only, never a second local-development carrier, authority, App registration, admission, model-routing, or token-custody surface.
23
+ - Do not add provider/model hardcoding, compatibility dual-writes, pseudo-success, Runtime internals, generated private clients, or Desktop product source.
24
+ - Before durable storage, native commands, private calls, or registries, inspect the nearest contract and current consumer; ask only if multiple semantic owners remain plausible.
25
+
26
+ ## Retrieval Defaults
27
+ - Start with the requested product route, its direct SDK/Kit surface, and the relevant scaffold-managed glue.
28
+ - Read platform authority only when ownership or semantics remain ambiguous; skip unrelated platform packages and generated files.
29
+
30
+ ## Verification Commands
31
+ - After `pnpm install` and `pnpm run init`, run `pnpm run sync`, `pnpm run check`, the directly affected tests, and the affected build.
32
+ - Run the official Desktop-supervised App journey when product interaction is in scope; shell or native checks alone do not replace it.
33
+ - Mark every product path not actually run as `NOT-VERIFIED`. Help text, focused tests, and CDP visibility do not establish implementation or release acceptance.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nimi Network Limited
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # Acme Widget
2
+
3
+ This standalone App was generated as an identity-neutral base plus the explicitly selected admitted feature closure.
4
+
5
+ Profile: `standalone`.
6
+
7
+ - App-owned product code: `src/workbench-core/**`, selected `src/capabilities/**`, and subsequent product edits.
8
+ - Scaffold-managed code: carrier/auth wiring, identity, manifests, build/release inputs, managed workflow and generated composition glue.
9
+ - Package-owned projections: `.nimi/{config,contracts,methodology}/**`, materialized by the pinned local `nimicoding` package during `init`.
10
+
11
+ `sync` refreshes scaffold-managed files without overwriting App-owned code. `check` is non-mutating. Changing identity, profile or direct feature selection requires a fresh scaffold.
12
+
13
+ ## Workflow
14
+
15
+ `create` has completed. Continue in this order:
16
+
17
+ ```bash
18
+ pnpm install
19
+ pnpm run init
20
+ pnpm run sync
21
+ pnpm run check
22
+ pnpm run test
23
+ pnpm run app:build -- --target windows-x86_64
24
+ pnpm dev
25
+ ```
26
+
27
+ After a real target build, `pnpm run pack -- --target <target-id>` uses app-tools as the only package owner. Local publish is unavailable; a protected version tag runs the managed GitHub Release workflow, while registry pull-request orchestration remains unavailable until its owner path exists.
28
+
29
+ Before production, the public GitHub repository must enable a protected `v*` tag ruleset and immutable releases and provide a read-only repository-admin token for checking those settings. On Windows, the tag-only production build signs the exact declared Host with the publisher PFX; production pack only verifies the resulting Authenticode signature. Manual workflow dispatch runs only the non-production path. The resulting GitHub Release remains independent from registry admission, Runtime installation, Desktop launch, and Nimi Access.
30
+
31
+ `pnpm dev` selects the official Desktop-supervised Electron development Host. Direct renderer, Electron or Tauri launch does not create protected Nimi access.
32
+
33
+ Runtime, Realm, registry admission, installed state and process truth remain with their canonical owners. This repository stores no Runtime credentials or protected session material.
34
+
35
+ ## Support
36
+
37
+ Report startup or Runtime issues through this repository's issue tracker. Diagnostics must exclude credentials and other private data.
38
+
39
+ ## Acceptance status
40
+
41
+ This README does not certify the App. Dependency install, test, build, target pack, GitHub Release, registry admission, Runtime install, Desktop launch and principal interactions remain `NOT-VERIFIED` until actually run. Focused tests or CDP visibility are not release acceptance.
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ - Do not store Realm credentials or app-owned bearer credentials in this repository.
4
+ - Use `createNimiClient` plus SDK Runtime / Realm surfaces for platform projection.
5
+ - Treat the App Access domain declaration as registration input, never operation authority.
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Acme Widget</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,26 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { parse as parseYaml } from 'yaml';
3
+
4
+ const MAX_APP_ACCESS_ITEM_BYTES = 128;
5
+
6
+ function validateAppAccessDeclaration(manifestText) {
7
+ const parsed = parseYaml(manifestText);
8
+ if (!Object.hasOwn(parsed || {}, 'app_access') || !Array.isArray(parsed.app_access)) {
9
+ throw new Error('app_access must be an array');
10
+ }
11
+ const seen = new Set();
12
+ for (const [index, item] of parsed.app_access.entries()) {
13
+ if (typeof item !== 'string' || item.length === 0 || item !== item.trim() || Buffer.byteLength(item, 'utf8') > MAX_APP_ACCESS_ITEM_BYTES) {
14
+ throw new Error(`app_access item ${index} must be a canonical bounded domain string`);
15
+ }
16
+ if (seen.has(item)) throw new Error(`app_access item ${index} duplicates domain: ${item}`);
17
+ seen.add(item);
18
+ }
19
+ }
20
+
21
+ const manifest = readFileSync(new URL('../nimi.app.yaml', import.meta.url), 'utf8');
22
+ if (!manifest.includes('manifest_role: submitted-input')) {
23
+ throw new Error('submitted manifest role marker missing');
24
+ }
25
+ validateAppAccessDeclaration(manifest);
26
+ process.stdout.write('[nimi-app] validate local-development checks passed\n');
@@ -0,0 +1,27 @@
1
+ import { WorkbenchRuntimeGate } from '../workbench-core/index.js';
2
+ import { NimiToaster } from '@nimiplatform/kit/ui';
3
+ import { AuthenticatedShell } from './authenticated-shell.js';
4
+ import {
5
+ appTitle,
6
+ clearTargetRuntimeGate,
7
+ resolveTargetRuntimeGate,
8
+ targetRuntimeGateCopy,
9
+ targetRuntimeGateErrorMessage,
10
+ } from './workbench-target-adapter.js';
11
+
12
+ export function App() {
13
+ return (
14
+ <>
15
+ <WorkbenchRuntimeGate
16
+ appTitle={appTitle}
17
+ copy={targetRuntimeGateCopy}
18
+ resolve={resolveTargetRuntimeGate}
19
+ clear={clearTargetRuntimeGate}
20
+ toErrorMessage={targetRuntimeGateErrorMessage}
21
+ >
22
+ <AuthenticatedShell />
23
+ </WorkbenchRuntimeGate>
24
+ <NimiToaster />
25
+ </>
26
+ );
27
+ }
@@ -0,0 +1,3 @@
1
+ export const appId = 'acme.widget';
2
+ export const appTitle = 'Acme Widget';
3
+ export const scaffoldProfile = 'standalone' as const;
@@ -0,0 +1,18 @@
1
+ import {
2
+ createNimiClient,
3
+ type NimiLocalAppClient,
4
+ } from '@nimiplatform/sdk';
5
+ import {
6
+ createNimiLocalAppStandardShellSurface,
7
+ } from '@nimiplatform/kit/shell/renderer/bridge';
8
+
9
+ let localAppClient: NimiLocalAppClient | null = null;
10
+
11
+ export function getNimiLocalAppClient(): NimiLocalAppClient {
12
+ localAppClient ??= createNimiClient({
13
+ localApp: {
14
+ standardShell: createNimiLocalAppStandardShellSurface(),
15
+ },
16
+ });
17
+ return localAppClient;
18
+ }
@@ -0,0 +1,110 @@
1
+ import { ReasonCode } from '@nimiplatform/sdk/types';
2
+ import { appId } from './app-identity.js';
3
+ import { getNimiLocalAppClient } from './local-app-client.js';
4
+
5
+ export { appId, appTitle, scaffoldProfile } from './app-identity.js';
6
+
7
+ export const runtimeAccountLoginEnabled = false;
8
+ export type RuntimeAuthMode = 'local-app';
9
+
10
+ export type RuntimePlatformReadyProjection = {
11
+ readonly status: 'ready';
12
+ readonly mode: RuntimeAuthMode;
13
+ readonly appHost: {
14
+ readonly state: 'session-bound';
15
+ readonly reasonCode: string;
16
+ readonly actionHint: string;
17
+ };
18
+ };
19
+
20
+ export type RuntimePlatformUnavailableProjection = {
21
+ readonly status: 'unavailable' | 'action-required';
22
+ readonly mode: RuntimeAuthMode;
23
+ readonly reasonCode: string;
24
+ readonly message: string;
25
+ readonly actionHint?: string;
26
+ };
27
+
28
+ export type RuntimePlatformProjection =
29
+ | RuntimePlatformReadyProjection
30
+ | RuntimePlatformUnavailableProjection;
31
+
32
+ let runtimeProjection: Promise<RuntimePlatformProjection> | null = null;
33
+
34
+ export function clearRuntimePlatformProjection(): void {
35
+ runtimeProjection = null;
36
+ }
37
+
38
+ export function getRuntimePlatformProjection(): Promise<RuntimePlatformProjection> {
39
+ runtimeProjection ??= resolveAppHostProjection();
40
+ return runtimeProjection;
41
+ }
42
+
43
+ async function resolveAppHostProjection(): Promise<RuntimePlatformProjection> {
44
+ try {
45
+ const status = await getNimiLocalAppClient().auth.status();
46
+ if (!status.sessionBound) {
47
+ return {
48
+ status: status.state === 'unavailable' ? 'unavailable' : 'action-required',
49
+ mode: 'local-app',
50
+ reasonCode: status.reasonCode,
51
+ actionHint: status.actionHint,
52
+ message: messageFor(status.reasonCode),
53
+ };
54
+ }
55
+ return {
56
+ status: 'ready',
57
+ mode: 'local-app',
58
+ appHost: {
59
+ state: 'session-bound',
60
+ reasonCode: status.reasonCode,
61
+ actionHint: status.actionHint,
62
+ },
63
+ };
64
+ } catch (error) {
65
+ return unavailableFromError(error);
66
+ }
67
+ }
68
+
69
+ function unavailableFromError(error: unknown): RuntimePlatformUnavailableProjection {
70
+ const reasonCode = typeof error === 'object' && error !== null && 'reasonCode' in error
71
+ ? normalizeText((error as { reasonCode?: unknown }).reasonCode) || ReasonCode.RUNTIME_UNAVAILABLE
72
+ : ReasonCode.RUNTIME_UNAVAILABLE;
73
+ return {
74
+ status: 'action-required',
75
+ mode: 'local-app',
76
+ reasonCode,
77
+ actionHint: actionHintFor(reasonCode),
78
+ message: error instanceof Error ? error.message : messageFor(reasonCode),
79
+ };
80
+ }
81
+
82
+ function messageFor(reasonCode: string): string {
83
+ switch (reasonCode) {
84
+ case 'local-development-registration-required':
85
+ return 'This development project must be registered through Nimi.';
86
+ case 'local-development-session-revoked':
87
+ return 'Nimi access for this running App is unavailable.';
88
+ case 'local-development-project-changed':
89
+ return 'The project identity no longer matches its current registration.';
90
+ default:
91
+ return 'The protected Nimi local-app carrier is unavailable.';
92
+ }
93
+ }
94
+
95
+ function actionHintFor(reasonCode: string): string {
96
+ switch (reasonCode) {
97
+ case 'local-development-registration-required':
98
+ return 'restart_official_nimi_app_dev_command';
99
+ case 'local-development-session-revoked':
100
+ return 'retry_when_nimi_access_is_available';
101
+ case 'local-development-project-changed':
102
+ return 'restore_registered_project_identity';
103
+ default:
104
+ return 'open_nimi_desktop_and_retry';
105
+ }
106
+ }
107
+
108
+ function normalizeText(value: unknown): string {
109
+ return typeof value === 'string' ? value.trim() : '';
110
+ }
@@ -0,0 +1,20 @@
1
+ import { AmbientBackground } from '@nimiplatform/kit/ui';
2
+ import { ProductArea } from './routes/product-area.js';
3
+
4
+ // Scaffold-managed desktop-grade shell frame.
5
+ // The app owns its full canvas directly: a kit AmbientBackground glass backdrop
6
+ // hosts the product area full-bleed. There is no competing scaffold chrome to
7
+ // hide — the previous app-chrome header + side-panel (which the workbench had to
8
+ // CSS-hide) are removed. Product chrome (navigation, command bar, identity) is
9
+ // owned by the product area, not duplicated here.
10
+ export function AuthenticatedShell() {
11
+ return (
12
+ <AmbientBackground
13
+ variant="mesh"
14
+ className="app-shell"
15
+ data-testid="nimi-app-shell"
16
+ >
17
+ <ProductArea />
18
+ </AmbientBackground>
19
+ );
20
+ }