Skip to content

Use Nimi Lab ​

apps/lab/ is Nimi's local capability workbench. Built as a fully functional Nimi App, it integrates the latest SDK, Kit, Runtime, Realm, and App Tools capabilities so developers can evaluate and test new features before they are broadly exposed through project templates.

Nimi Lab serves as a reference implementation for capability integration. Core responsibilities—such as permissions, session tokens, model scheduling, and data persistence—remain strictly governed by standard platform boundaries and security invariants.

Running and Debugging ​

Run the following command from the repository root:

bash
pnpm dev:lab

Key development scripts provided in apps/lab/:

bash
pnpm run init       # Initialize project configurations
pnpm dev:shell      # Start the app in the official Electron host
pnpm run validate   # Validate the App manifest and access declarations
pnpm run typecheck  # Check TypeScript types
pnpm run test       # Execute unit and integration tests

On Windows and macOS, Nimi Lab runs inside Desktop's supervised Electron development environment. Register local development builds through Developer Mode in Nimi Home and check their Nimi Access session status.

Key Code and Architectural References ​

Area of InterestSource Path
Scaffold configuration & local checksapps/lab/package.json
Protected shell host routing and communicationapps/lab/README.md and shell route modules
AIConfig storage and application data isolationapps/lab/src/lab/lab-ai-config-store.ts
Capability Intent-driven Runtime AI dispatchapps/lab/src/lab/lab-runtime.ts
Structured error handling & state mappingapps/lab/src/lab/lab-non-success.ts
AI configuration UI component designapps/lab/src/lab/workbench/lab-ai-config-settings-panel.tsx
Contract compliance test suitesapps/lab/test/lab-contract/

Integration Principles ​

  • Independent Application Identity: The app ID nimi.lab belongs specifically to Nimi Lab; custom applications must declare their own unique App IDs.
  • Data and Fixture Isolation: Test fixtures, mock datasets, and diagnostics in Lab are for exploration and testing; design dedicated models for your own product logic.
  • Progressive Adoption: Evaluate new capabilities in Lab first, then adapt relevant patterns into your custom application based on your product needs.
  • Actionable User Guidance: Surface structured states to users (such as prompting service startup or checking access readiness) to provide clear next steps when an action cannot proceed.

Common State Codes ​

State CodeMeaningUser Feedback Strategy
runtime-unavailableLocal Runtime service is not responding.Check that local Runtime and Nimi Home are running.
principal-unauthorizedThe current session or caller is not authorized for this operation.Check sign-in and this app’s Nimi Access status in Nimi Home, then verify the required access declarations in nimi.app.yaml; AI calls require runtime.consume.
input-invalidPrompt or required parameters are missing or malformed.Prompt the user to verify required parameters and input format.
sdk-method-unavailableCapability is not exposed in the current build.Prompt the user to update the SDK package.
runtime-call-failedAn error occurred during request processing.Display a descriptive error message and retain diagnostic logs.

Source Basis ​

Documentation for Nimi — the installable, open-source, local-first personal AI product.