@nimiplatform/app-tools 0.5.3 → 0.6.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/README.md CHANGED
@@ -15,7 +15,7 @@ repository. `nimi-app --help` prints its resolved location. Installation does
15
15
  not activate instructions; explicit init/sync maintains the project skill under
16
16
  `.agents/skills/nimi-app-lifecycle/` and an independent AGENTS.md block.
17
17
 
18
- Prepare the existing App's actual pnpm/Vite/Electron renderer, supervised Host
18
+ Prepare the existing App's actual renderer, pnpm/Electron supervised Host
19
19
  and build/test scripts first. Init does not convert a server framework, invent
20
20
  tests or replace product UI. Install the selected app-tools and the exact
21
21
  nimi-coding version declared in its `nimiScaffoldVersions`, then preview:
@@ -42,7 +42,7 @@ For an App whose named scripts are already implemented, an input is:
42
42
  "local_development": { "electron": { "renderer_origin": "http://127.0.0.1:1466" } }
43
43
  },
44
44
  "build_profile": {
45
- "build_profile_ref": "electron-packager-pnpm-vite", "profile_role": "developer-workflow-input",
45
+ "build_profile_ref": "electron-packager-pnpm-vite", "profile_role": "developer-workflow-input",
46
46
  "test_command": "pnpm run test:app", "build_command": "pnpm run build:electron:production",
47
47
  "targets": {
48
48
  "windows-x86_64": {
@@ -62,6 +62,26 @@ existing Host, business code, README and license remain App-owned. Adoption
62
62
  creates no fresh scaffold intent/lock. Init validates output declarations;
63
63
  build/pack later verify actual payloads.
64
64
 
65
+ An existing Next.js or other renderer can use `build_profile_ref: electron-pnpm`
66
+ with its real test/build commands and target outputs. Declare `dev:renderer` in
67
+ `package.json`, for example `next dev --hostname 127.0.0.1 --port 1466`, matching
68
+ the manifest's loopback origin. Init/sync preserve the command for this profile. The App
69
+ owns the renderer and any required local backend; `build:electron` produces the
70
+ supervised Host at `dist-electron/main.js`. Fresh scaffolds keep their generated
71
+ Vite recipe and existing `electron-packager-pnpm-vite` profiles remain supported.
72
+ When Host sources are outside `src-electron`, declare their existing relative
73
+ directory as `local_development.electron.host_source_directory` in `nimi.app.yaml`
74
+ (for example `electron`). Desktop validates that directory before launch and
75
+ watches it for Host rebuilds; init/sync preserve this App-owned declaration.
76
+ Real development requires a Desktop version that accepts App-owned renderer
77
+ commands; older Desktop versions enforcing Vite reject this project even after
78
+ app-tools validation passes. Do not introduce a Vite placeholder to bypass it.
79
+
80
+ Use the selected package's `nimiScaffoldVersions` declarations in `package.json`
81
+ and commit the matching lockfile to pin resolved versions. A matrix range in the
82
+ manifest does not require an automatic upgrade; install with the frozen lockfile
83
+ until deliberately selecting and synchronizing a new component combination.
84
+
65
85
  `init --dry-run --json` and `sync --dry-run --json` show app-tools file/field
66
86
  changes without writes, installation or owner mutation. The separate
67
87
  nimi-coding step and expected version are listed without simulating its internals.
@@ -139,6 +159,15 @@ pnpm dev
139
159
 
140
160
  `dev` uses the Desktop supervisor. Direct Electron, Tauri or renderer launch cannot claim protected Nimi access. Process running and Nimi Access ready remain separate states.
141
161
 
162
+ Every `build`, including non-production builds, requires the selected target's
163
+ declared payload and exact Runtime entry to exist after its owner command exits
164
+ successfully. Building a macOS payload cannot report success for a missing
165
+ Windows target. The default recipes build for their host platform; use the
166
+ matching build host or provide a real App-owned build command. This file check
167
+ does not prove executable architecture or signing: production App information
168
+ is checked with `--production`, and native package facts are verified by
169
+ `pack --production`.
170
+
142
171
  To continue an existing development App and its data, select a registration explicitly:
143
172
 
144
173
  ```bash
package/bin/nimi-app.mjs CHANGED
@@ -222,7 +222,8 @@ function printUsage() {
222
222
  ' create -> dependency install -> init -> sync -> check -> dev/test/build -> pack',
223
223
  ' Run init and later commands only after dependency installation.',
224
224
  ` Before init, read the packaged lifecycle skill: ${LIFECYCLE_SKILL_PATH}`,
225
- ' Existing adoption requires real pnpm/Vite/Electron Host and build/test inputs; it creates no fresh scaffold lock.',
225
+ ' Existing adoption requires pnpm, a supervised Electron Host, an App-owned renderer command and real build/test inputs.',
226
+ ' Use electron-pnpm for an existing renderer framework; no fresh scaffold lock is created.',
226
227
  '',
227
228
  'Development CDP:',
228
229
  ' Electron CDP defaults to an automatically selected loopback port.',
@@ -1,5 +1,5 @@
1
1
  import { APP_AUTHOR_DECLARATION_FIELDS, hashScaffoldManagedContent } from './app-scaffold.mjs';
2
- import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
2
+ import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
5
5
  import {
@@ -89,10 +89,9 @@ const LOCAL_DEVELOPMENT_BYPASS_LABELS = new Set([
89
89
  'Realm refresh bypass endpoint',
90
90
  'Realm permission grant REST bypass endpoint',
91
91
  'Realm raw request bypass',
92
- 'Realm API path literal bypass',
93
- 'Realm API url literal bypass',
94
- 'Realm API fetch bypass',
95
- 'OpenAI-compatible Runtime REST endpoint assumption',
92
+ // Existing Apps own ordinary HTTP routes and may retain vendor sources.
93
+ // A bare /api or /v1 URL does not identify Nimi Realm/Runtime authority.
94
+ // Those broad patterns remain applicable to our generated scaffold only.
96
95
  'app-owned session store',
97
96
  'app-owned refresh token provider',
98
97
  'app-owned protected Runtime gRPC client',
@@ -444,7 +443,15 @@ function assertRequiredSupportFiles(targetDir, snapshot) {
444
443
  }
445
444
  }
446
445
 
447
- function assertProjectConfiguration(targetDir, parsedManifest = null) {
446
+ function usesAppOwnedRenderer(targetDir, plannedSources) {
447
+ const relativePath = '.nimi/config/build-profile.yaml';
448
+ const filePath = path.join(targetDir, relativePath);
449
+ const source = plannedSources?.get(relativePath)
450
+ ?? (existsSync(filePath) ? readFileSync(filePath, 'utf8') : undefined);
451
+ return source !== undefined && parseYaml(source)?.build_profile_ref === 'electron-pnpm';
452
+ }
453
+
454
+ function assertProjectConfiguration(targetDir, parsedManifest = null, managed = true) {
448
455
  const manifestPath = path.join(targetDir, 'nimi.app.yaml');
449
456
  const manifest = readFileSync(manifestPath, 'utf8');
450
457
  assertManifestAppAccessDeclaration(manifest, manifestPath);
@@ -457,10 +464,17 @@ function assertProjectConfiguration(targetDir, parsedManifest = null) {
457
464
  }
458
465
  }
459
466
  const rendererOrigin = assertElectronLocalDevelopmentManifest(document);
460
- assertOfficialDevelopmentEntrypoints(targetDir, rendererOrigin);
467
+ assertDeclaredHostSourceDirectory(targetDir, document);
468
+ assertOfficialDevelopmentEntrypoints(targetDir, rendererOrigin, undefined, managed || !usesAppOwnedRenderer(targetDir));
461
469
  }
462
470
 
463
471
  function assertElectronLocalDevelopmentManifest(document) {
472
+ const sourceDirectory = document?.local_development?.electron?.host_source_directory;
473
+ if (sourceDirectory !== undefined && (typeof sourceDirectory !== 'string'
474
+ || sourceDirectory.trim() !== sourceDirectory || /[\\:\r\n\0]/u.test(sourceDirectory)
475
+ || sourceDirectory.split('/').some((segment) => !segment || segment === '.' || segment === '..'))) {
476
+ throw new Error('nimi.app.yaml local_development.electron.host_source_directory must be a canonical project-relative directory');
477
+ }
464
478
  const rendererOrigin = document?.local_development?.electron?.renderer_origin;
465
479
  if (typeof rendererOrigin !== 'string' || rendererOrigin.trim() !== rendererOrigin) {
466
480
  throw new Error('nimi.app.yaml must declare local_development.electron.renderer_origin');
@@ -487,7 +501,21 @@ function assertElectronLocalDevelopmentManifest(document) {
487
501
  return parsed.origin;
488
502
  }
489
503
 
490
- function assertOfficialDevelopmentEntrypoints(targetDir, rendererOrigin, packageJson = readJsonFile(path.join(targetDir, 'package.json'), 'package.json')) {
504
+ function assertDeclaredHostSourceDirectory(targetDir, document) {
505
+ const relative = document?.local_development?.electron?.host_source_directory;
506
+ if (relative === undefined) return;
507
+ try {
508
+ const root = realpathSync(targetDir);
509
+ const source = realpathSync(path.join(root, relative));
510
+ const contained = path.relative(root, source);
511
+ if (!contained || contained === '..' || contained.startsWith(`..${path.sep}`)
512
+ || path.isAbsolute(contained) || !statSync(source).isDirectory()) throw new Error('outside project');
513
+ } catch {
514
+ throw new Error('nimi.app.yaml local_development.electron.host_source_directory must exist inside this project');
515
+ }
516
+ }
517
+
518
+ function assertOfficialDevelopmentEntrypoints(targetDir, rendererOrigin, packageJson = readJsonFile(path.join(targetDir, 'package.json'), 'package.json'), managed = true) {
491
519
  const scripts = packageJson?.scripts;
492
520
  if (!scripts || typeof scripts !== 'object' || Array.isArray(scripts)) {
493
521
  throw new Error('package.json scripts are required');
@@ -496,13 +524,19 @@ function assertOfficialDevelopmentEntrypoints(targetDir, rendererOrigin, package
496
524
  const required = {
497
525
  dev: 'nimi-app dev --shell electron',
498
526
  'dev:shell': 'nimi-app dev',
499
- 'dev:renderer': `vite --host 127.0.0.1 --port ${rendererPort} --strictPort`,
527
+ ...(managed ? { 'dev:renderer': `vite --host 127.0.0.1 --port ${rendererPort} --strictPort` } : {}),
500
528
  };
501
529
  for (const [name, command] of Object.entries(required)) {
502
530
  if (scripts[name] !== command) {
503
531
  throw new Error(`package.json ${name} must use the official local-development launcher: ${command}`);
504
532
  }
505
533
  }
534
+ const rendererCommand = scripts['dev:renderer'];
535
+ if (typeof rendererCommand !== 'string' || !rendererCommand || rendererCommand.trim() !== rendererCommand
536
+ || /[\r\n\0]/u.test(rendererCommand)
537
+ || /\b(?:nimi-app\s+dev|(?:pnpm|npm)\s+(?:run\s+)?(?:dev|dev:renderer))(?=\s|$)/u.test(rendererCommand)) {
538
+ throw new Error('package.json dev:renderer must be a non-recursive App-owned renderer command for the declared loopback origin');
539
+ }
506
540
  if (
507
541
  typeof scripts['build:electron'] !== 'string'
508
542
  || scripts['build:electron'].trim() !== scripts['build:electron']
@@ -537,7 +571,8 @@ function assertNimicodingProjectionCurrent(targetDir, runners) {
537
571
  export function validateAppProjectInputs(targetDir, manifest, packageJson, managed = false, plannedSources) {
538
572
  assertManifestAppAccessDeclaration(stringifyYaml(manifest), 'nimi.app.yaml');
539
573
  const rendererOrigin = assertElectronLocalDevelopmentManifest(manifest);
540
- assertOfficialDevelopmentEntrypoints(targetDir, rendererOrigin, packageJson);
574
+ assertDeclaredHostSourceDirectory(targetDir, manifest);
575
+ assertOfficialDevelopmentEntrypoints(targetDir, rendererOrigin, packageJson, managed || !usesAppOwnedRenderer(targetDir, plannedSources));
541
576
  const findings = scanForbiddenPatterns(targetDir, manifest.profile, managed ? null : LOCAL_DEVELOPMENT_BYPASS_LABELS, plannedSources);
542
577
  if (findings.length) throw new Error(`Forbidden App source patterns: ${findings.join('; ')}`);
543
578
  }
@@ -615,7 +650,7 @@ function validateExistingSubmittedApp(targetDir) {
615
650
  if (parsed?.manifest_role !== 'submitted-input') {
616
651
  throw new Error('Submitted manifest marker missing');
617
652
  }
618
- assertProjectConfiguration(targetDir, parsed);
653
+ assertProjectConfiguration(targetDir, parsed, false);
619
654
  const forbiddenFindings = scanForbiddenPatterns(targetDir, profile, LOCAL_DEVELOPMENT_BYPASS_LABELS);
620
655
  if (forbiddenFindings.length > 0) {
621
656
  throw new Error(`Forbidden local-development bypasses detected: ${forbiddenFindings.join('; ')}`);
package/lib/app-pack.mjs CHANGED
@@ -27,6 +27,7 @@ const TARGET_METADATA_FORMAT = 'nimi.app-target-candidate/v1';
27
27
  const AGGREGATE_FORMAT = 'nimi.app-release-candidate/v1';
28
28
  const BUILD_PROFILE_PATH = '.nimi/config/build-profile.yaml';
29
29
  const ELECTRON_BUILD_PROFILE_REF = 'electron-packager-pnpm-vite';
30
+ const APP_OWNED_ELECTRON_BUILD_PROFILE_REF = 'electron-pnpm';
30
31
  const TAURI_BUILD_PROFILE_REF = 'tauri-pnpm-vite';
31
32
  const OUTPUT_DIR = 'dist/nimi-app';
32
33
  const SEMVER_PATTERN = /^(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?(?:\+[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$/u;
@@ -282,7 +283,7 @@ function readPackInputs(targetDir, targetId) {
282
283
  const appInfo = readAppInfo(targetDir, targetId);
283
284
  const buildProfile = readYaml(path.join(targetDir, BUILD_PROFILE_PATH), BUILD_PROFILE_PATH);
284
285
  const buildProfileRef = buildProfile.build_profile_ref;
285
- if (buildProfileRef !== ELECTRON_BUILD_PROFILE_REF && buildProfileRef !== TAURI_BUILD_PROFILE_REF) {
286
+ if (![ELECTRON_BUILD_PROFILE_REF, APP_OWNED_ELECTRON_BUILD_PROFILE_REF, TAURI_BUILD_PROFILE_REF].includes(buildProfileRef)) {
286
287
  throw new Error(`${BUILD_PROFILE_PATH} build_profile_ref is unsupported: ${String(buildProfileRef)}`);
287
288
  }
288
289
  const requiresTauri = buildProfileRef === TAURI_BUILD_PROFILE_REF;
@@ -42,8 +42,9 @@ const SYNCHRONIZED_NIMI_PACKAGES = new Set([
42
42
  ]);
43
43
  const BUILD_PROFILE_PATH = '.nimi/config/build-profile.yaml';
44
44
  const ELECTRON_BUILD_PROFILE_REF = 'electron-packager-pnpm-vite';
45
+ const APP_OWNED_ELECTRON_BUILD_PROFILE_REF = 'electron-pnpm';
45
46
  const TAURI_BUILD_PROFILE_REF = 'tauri-pnpm-vite';
46
- const SUPPORTED_BUILD_PROFILE_REFS = new Set([ELECTRON_BUILD_PROFILE_REF, TAURI_BUILD_PROFILE_REF]);
47
+ const SUPPORTED_BUILD_PROFILE_REFS = new Set([ELECTRON_BUILD_PROFILE_REF, APP_OWNED_ELECTRON_BUILD_PROFILE_REF, TAURI_BUILD_PROFILE_REF]);
47
48
  const MANAGED_WORKFLOW_PATH = '.github/workflows/nimi-app-release.yml';
48
49
  const APP_IDENTITY_PATH = '.nimi/config/app-identity.yaml';
49
50
  const SUBMISSION_PATH = '.nimi/admission/submission.yaml';
@@ -250,7 +251,7 @@ function assertPackageManifestCurrent(packageJson, versions) {
250
251
  }
251
252
  }
252
253
 
253
- function normalizePackageManifest(packageJson, descriptor, versions) {
254
+ function normalizePackageManifest(packageJson, descriptor, versions, buildProfileRef, packageSource) {
254
255
  if (!packageJson || typeof packageJson !== 'object' || Array.isArray(packageJson)) {
255
256
  throw new Error('package.json must contain an object');
256
257
  }
@@ -283,7 +284,9 @@ function normalizePackageManifest(packageJson, descriptor, versions) {
283
284
  normalized.scripts.dev = 'nimi-app dev --shell electron';
284
285
  normalized.scripts['dev:shell'] = 'nimi-app dev';
285
286
  normalized.scripts['dev:electron'] = 'nimi-app dev --shell electron';
286
- normalized.scripts['dev:renderer'] = `vite --host 127.0.0.1 --port ${new URL(descriptor.rendererOrigin).port} --strictPort`;
287
+ if (buildProfileRef !== APP_OWNED_ELECTRON_BUILD_PROFILE_REF) {
288
+ normalized.scripts['dev:renderer'] = `vite --host 127.0.0.1 --port ${new URL(descriptor.rendererOrigin).port} --strictPort`;
289
+ }
287
290
  normalized.scripts.sync ||= 'nimi-app sync';
288
291
  normalized.scripts.pack = 'nimi-app pack';
289
292
  delete normalized.scripts.publish;
@@ -299,6 +302,9 @@ function normalizePackageManifest(packageJson, descriptor, versions) {
299
302
  .replace(/\bnimi-app\s+doctor\s*&&\s*/gu, '');
300
303
  }
301
304
  assertPackageManifestCurrent(normalized, versions);
305
+ // Project formatters may use different whitespace or key order. Only managed
306
+ // value changes require rewriting this App-owned manifest.
307
+ if (stableInputJson(normalized) === stableInputJson(packageJson)) return packageSource;
302
308
  return `${JSON.stringify(normalized, null, 2)}\n`;
303
309
  }
304
310
 
@@ -897,12 +903,12 @@ function selectBuildOwner(profile, requestedTarget) {
897
903
  return { target, command, payloadPath, runtimeEntry };
898
904
  }
899
905
 
900
- function assertProductionRuntimeEntry(targetDir, selected) {
906
+ function assertBuiltRuntimeEntry(targetDir, selected) {
901
907
  const projectRoot = path.resolve(targetDir);
902
908
  const payloadPath = path.resolve(projectRoot, ...selected.payloadPath.split('/'));
903
909
  const projectPrefix = `${projectRoot}${path.sep}`;
904
910
  if (!payloadPath.startsWith(projectPrefix) || !existsSync(payloadPath)) {
905
- throw new Error(`Production payload is missing or noncanonical: ${selected.payloadPath}`);
911
+ throw new Error(`Build payload is missing or noncanonical: ${selected.payloadPath}`);
906
912
  }
907
913
  const payloadStat = lstatSync(payloadPath);
908
914
  let runtimeTarget = payloadPath;
@@ -910,20 +916,20 @@ function assertProductionRuntimeEntry(targetDir, selected) {
910
916
  const runtimeRelative = selected.runtimeEntry.slice('payload/'.length);
911
917
  runtimeTarget = path.resolve(payloadPath, ...runtimeRelative.split('/'));
912
918
  } else if (payloadStat.isFile() && selected.runtimeEntry !== `payload/${path.basename(payloadPath)}`) {
913
- throw new Error(`Production Runtime entry does not select the direct payload file: ${selected.runtimeEntry}`);
919
+ throw new Error(`Build Runtime entry does not select the direct payload file: ${selected.runtimeEntry}`);
914
920
  } else if (!payloadStat.isFile() || payloadStat.isSymbolicLink()) {
915
- throw new Error(`Production payload is not a direct file or directory: ${selected.payloadPath}`);
921
+ throw new Error(`Build payload is not a direct file or directory: ${selected.payloadPath}`);
916
922
  }
917
923
  const payloadPrefix = `${payloadPath}${path.sep}`;
918
924
  if (
919
925
  !existsSync(runtimeTarget)
920
926
  || (!payloadStat.isFile() && !runtimeTarget.startsWith(payloadPrefix))
921
927
  ) {
922
- throw new Error(`Production Runtime entry is missing or noncanonical: ${selected.runtimeEntry}`);
928
+ throw new Error(`Build Runtime entry is missing or noncanonical: ${selected.runtimeEntry}`);
923
929
  }
924
930
  const runtimeTargetStat = lstatSync(runtimeTarget);
925
931
  if (!runtimeTargetStat.isFile() || runtimeTargetStat.isSymbolicLink()) {
926
- throw new Error(`Production Runtime entry must be a direct regular file: ${selected.runtimeEntry}`);
932
+ throw new Error(`Build Runtime entry must be a direct regular file: ${selected.runtimeEntry}`);
927
933
  }
928
934
  }
929
935
 
@@ -993,7 +999,7 @@ function buildExistingSubmittedAppSyncPlan(targetDir, versions, sources) {
993
999
  author: typeof files.packageJson.author === 'string' ? files.packageJson.author : '',
994
1000
  };
995
1001
  const planned = [
996
- { path: files.packagePath, content: normalizePackageManifest(files.packageJson, descriptor, versions), previous: files.packageSource },
1002
+ { path: files.packagePath, content: normalizePackageManifest(files.packageJson, descriptor, versions, buildProfile.buildProfileRef, files.packageSource), previous: files.packageSource },
997
1003
  ];
998
1004
  if (requiresTauri) {
999
1005
  planned.push(
@@ -1202,7 +1208,7 @@ export function adoptAppProject(cwd, options = {}, versions, runners = {}) {
1202
1208
  } catch (cause) {
1203
1209
  throw new Error(`${cause.message}. Prepare the real App-owned Host and build/test inputs using ${LIFECYCLE_SKILL_PATH}`, { cause });
1204
1210
  }
1205
- if (plan.buildProfileRef !== ELECTRON_BUILD_PROFILE_REF) throw new Error('Existing-App init supports electron-packager-pnpm-vite; existing Tauri projects retain their sync path.');
1211
+ if (![ELECTRON_BUILD_PROFILE_REF, APP_OWNED_ELECTRON_BUILD_PROFILE_REF].includes(plan.buildProfileRef)) throw new Error('Existing-App init supports electron-pnpm and electron-packager-pnpm-vite; existing Tauri projects retain their sync path.');
1206
1212
  const files = readProjectLifecycleFiles(targetDir, plan.buildProfileRef);
1207
1213
  const profile = readBuildProfile(targetDir, sources);
1208
1214
  for (const command of [profile.testCommand, profile.buildCommand, ...Object.keys(profile.targets).map((target) => selectBuildOwner(profile, target).command)]) {
@@ -1271,9 +1277,7 @@ export function buildAppProject(cwd, options = {}, runners = {}) {
1271
1277
  const selected = selectBuildOwner(profile, options.target);
1272
1278
  if (options.production === true) readAppInfo(targetDir, selected.target);
1273
1279
  const result = runOwnerCommand(targetDir, 'build', selected.command, options, runners);
1274
- if (options.production === true) {
1275
- assertProductionRuntimeEntry(targetDir, selected);
1276
- }
1280
+ assertBuiltRuntimeEntry(targetDir, selected);
1277
1281
  return emitResult({
1278
1282
  ok: true,
1279
1283
  command: 'build',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimiplatform/app-tools",
3
- "version": "0.5.3",
3
+ "version": "0.6.1",
4
4
  "description": "Public app-authoring CLI for Nimi App projects.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -18,11 +18,11 @@
18
18
  "provenance": true
19
19
  },
20
20
  "nimiScaffoldVersions": {
21
- "sdkVersion": "^0.12.0",
22
- "appToolsVersion": "^0.5.3",
21
+ "sdkVersion": "^0.13.0",
22
+ "appToolsVersion": "^0.6.1",
23
23
  "nimicodingVersion": "0.6.3",
24
24
  "aiSdkVersion": "^6.0.85",
25
- "kitVersion": "^0.8.0",
25
+ "kitVersion": "^0.9.0",
26
26
  "reactVersion": "^19.2.8",
27
27
  "reactDomVersion": "^19.2.8",
28
28
  "i18nextVersion": "^25.10.10",
@@ -38,7 +38,7 @@
38
38
  "tailwindcssViteVersion": "^4.3.3",
39
39
  "tauriCliVersion": "^2.11.4",
40
40
  "yamlVersion": "^2.9.0",
41
- "nimiShellTauriVersion": "0.4.0",
41
+ "nimiShellTauriVersion": "0.5.0",
42
42
  "electronPackagerVersion": "^20.3.0",
43
43
  "electronVersion": "^42.10.1",
44
44
  "esbuildVersion": "^0.28.2",
@@ -21,7 +21,7 @@ For an ordinary product edit, follow its existing code and tests. Do not reiniti
21
21
  ## Boundaries that matter
22
22
 
23
23
  - App-owned workflows, tool handlers, business accounts, non-AI services and product presentation stay with the App. Nimi AI, configuration, managed storage and protected sessions use public SDK/Kit Local App surfaces. Display identity is not a business login ticket.
24
- - The current authoring recipe uses pnpm, Vite and Desktop-supervised Electron. A Next/server or Python project needs real App-owned carrier/build work before adoption. Preserve the original user tasks; do not silently reduce the product to a scaffold example.
24
+ - Fresh Apps use pnpm, Vite and Desktop-supervised Electron. Existing Apps may use another renderer framework with an App-owned development command and the `electron-pnpm` build profile. A Next/server or Python project still needs real Host and backend lifecycle/build work. Preserve its original user tasks and framework where they fit; initialization does not convert the product.
25
25
  - Read the selected app-tools package's `nimiScaffoldVersions` and the SDK/Kit migration notes. Public Apps use published registry dependencies. Private platform experiments are not public installation evidence.
26
26
  - App Tools maintains its fixed lifecycle skill, AGENTS block and declared engineering projections. Existing Apps have no fresh scaffold intent/lock. Preserve their Host, product source and license; report unknown file collisions rather than inventing ownership.
27
27
  - GitHub owns publisher builds and Releases; Registry owns candidate validation and human admission; Runtime owns packages and App access; Desktop owns exact processes. These are separate facts. The external AI host owns the development task.
@@ -2,7 +2,11 @@
2
2
 
3
3
  Before changing code, identify the upstream URL and baseline commit, license, user journeys, actual AI/auth/storage entry points, business services, helper processes and active instruction loaders. Record a short upstream/range note in the existing App README or product document; do not create another integration state file.
4
4
 
5
- Install a selected published app-tools package and read this package skill before init. Install its matching SDK/Kit and exact nimi-coding. Prepare actual App-owned pnpm/Vite/Electron Host, renderer and test/production-build commands; do not make init manufacture a test success or convert a server deployment implicitly.
5
+ Install a selected published app-tools package and read this package skill before init. Install its matching SDK/Kit and exact nimi-coding. Follow the package's manifest version matrix and use the lockfile to pin actual resolutions. Prepare the actual pnpm/Electron Host, renderer and test/production-build commands; do not make init manufacture a test success or convert a server deployment implicitly.
6
+
7
+ For a Next.js or other existing renderer, declare the framework-neutral `electron-pnpm` build profile and a real `dev:renderer` package script serving the manifest's loopback origin. Init/sync preserve that command and the App's build owners. The official `dev` launcher still asks Desktop to supervise the Host; `build:electron` must produce `dist-electron/main.js`. Keep any required local backend under App lifecycle management. A Desktop that still requires the old exact Vite command must be upgraded before this project's real launch; do not add an empty Vite server or lose server routes to pass checks.
8
+
9
+ If Host sources live outside the scaffold's `src-electron`, declare the actual project-relative directory in `nimi.app.yaml` as `local_development.electron.host_source_directory` (for example `electron`). The directory must exist inside the project. Desktop validates it before launch and watches it for Host rebuilds; init/sync retain it. Keep the upstream source layout instead of adding a placeholder directory.
6
10
 
7
11
  Use `pnpm exec nimi-app init --adopt --dry-run --json`, then apply without `--dry-run` once the changes fit the authorized scope. Existing nimi.app.yaml and `.nimi/config/build-profile.yaml` are the inputs. If either is absent, supply `--input <json-path>` with only `manifest` and/or `build_profile`, using their existing schemas from the app-tools README. A file under `.nimi/local/` is sufficient. Input supplied alongside an existing file must agree with it. Target paths are declarations at init; build/pack later verify real artifacts.
8
12
 
@@ -12,8 +16,14 @@ Review the exact dependency, dev/renderer/pack script and workflow changes. Exis
12
16
 
13
17
  - Renderer code can use `createNimiClient` with Kit's `createNimiLocalAppStandardShellSurface`. Node business work uses `registerNimiElectronAppBridge(...).services` from the same protected Host, fixed app commands and session invalidation callbacks. Consult the installed SDK/Kit public types for exact inputs.
14
18
  - Keep the App's tool loop, IDs, ordered tool results and any opaque continuity needed in subsequent turns. An SDK model step does not run business callbacks.
19
+ - For an existing Vercel AI SDK 6 App, use the matching independent `@nimiplatform/sdk-adapter-vercel-ai` package and its Host-bound Local App factory. Read its README for image upload and complete UI message metadata; keep `useChat`/`streamText` and App-owned tools instead of rebuilding their wire protocol inside the App.
15
20
  - Preserve Runtime-issued embedding space across batches; do not combine incompatible results. Carry cancellation and session invalidation into outstanding work and prevent late writes to a new session.
16
21
  - Local media helpers receive bounded business inputs and an explicit environment; they do not receive Nimi credentials or a generic protected forwarding endpoint.
17
22
  - Non-AI services, such as search engines, stay App-owned with honest setup requirements. Do not turn all external HTTP into an AI bypass finding.
18
23
 
24
+ For an existing App, a generic `/api/...` route or provider `/v1/...` URL alone
25
+ does not prove a Nimi Realm/Runtime bypass. The checker retains explicit
26
+ protected-custody/private-import checks; review actual product call paths to
27
+ establish Nimi AI routing. Do not edit vendor code just to remove a keyword.
28
+
19
29
  Separate development instructions from product-operation guides, including other host entry files actually used by the repository. Upstream supplier examples may remain as knowledge; check the active product/agent route instead of deleting by keyword. Keep unimplemented original workflows explicit rather than counting a visible menu or retained source as completion.
@@ -8,4 +8,6 @@ Review App-owned instructions outside managed blocks when the upgrade changes an
8
8
 
9
9
  Migrate the affected App-owned API uses, run sync, then install the full normalized dependency set and regenerate the package-manager lockfile. Run check and the relevant tests/build and real journey. Fresh scaffold identity and direct features remain fixed; the tool updates derived version/matrix projections. Existing Apps continue without a fresh lock.
10
10
 
11
+ For existing Apps, sync preserves the exact `package.json` text when its managed values are already current. A project formatter's whitespace or key ordering alone is not drift; actual managed value changes are still synchronized.
12
+
11
13
  Do not downgrade away required features, edit installed package code or disable checks to get a green result. A platform capability awaiting publication blocks public release reproducibility, not independent engineering work. Validate a representative actual old-to-new combination; do not build a general migration framework.