@nimiplatform/app-tools 0.1.3 → 0.2.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.
Files changed (121) 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 +402 -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 +195 -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/lib/windows-powershell.mjs +7 -0
  23. package/package.json +66 -3
  24. package/scripts/dev-shell.mjs +465 -0
  25. package/scripts/sync-app-source.mjs +300 -0
  26. package/scripts/sync-scaffold-versions.mjs +91 -0
  27. package/templates/app-source/LICENSE +21 -0
  28. package/templates/app-source/src/ai-studio-core/ai-config.ts +100 -0
  29. package/templates/app-source/src/ai-studio-core/ai-studio-core.css +338 -0
  30. package/templates/app-source/src/ai-studio-core/contexts.tsx +61 -0
  31. package/templates/app-source/src/ai-studio-core/history-policy.ts +447 -0
  32. package/templates/app-source/src/ai-studio-core/history.ts +824 -0
  33. package/templates/app-source/src/ai-studio-core/host-context.tsx +79 -0
  34. package/templates/app-source/src/ai-studio-core/index.ts +214 -0
  35. package/templates/app-source/src/ai-studio-core/messages/en.json +310 -0
  36. package/templates/app-source/src/ai-studio-core/messages/index.ts +47 -0
  37. package/templates/app-source/src/ai-studio-core/messages/zh.json +310 -0
  38. package/templates/app-source/src/ai-studio-core/module-registration.ts +109 -0
  39. package/templates/app-source/src/ai-studio-core/non-success-presentation.ts +65 -0
  40. package/templates/app-source/src/ai-studio-core/parameter-fields.tsx +247 -0
  41. package/templates/app-source/src/ai-studio-core/parameters.ts +110 -0
  42. package/templates/app-source/src/ai-studio-core/prompt-drafts.ts +69 -0
  43. package/templates/app-source/src/ai-studio-core/run-target.ts +123 -0
  44. package/templates/app-source/src/ai-studio-core/runtime-dispatcher.ts +35 -0
  45. package/templates/app-source/src/ai-studio-core/runtime-types.ts +86 -0
  46. package/templates/app-source/src/ai-studio-core/runtime.ts +306 -0
  47. package/templates/app-source/src/ai-studio-core/section-ai-testing-admission.ts +38 -0
  48. package/templates/app-source/src/ai-studio-core/section-ai-testing-ai-config.tsx +30 -0
  49. package/templates/app-source/src/ai-studio-core/section-ai-testing-artifact-preview.ts +40 -0
  50. package/templates/app-source/src/ai-studio-core/section-ai-testing-composer.tsx +257 -0
  51. package/templates/app-source/src/ai-studio-core/section-ai-testing-history.tsx +676 -0
  52. package/templates/app-source/src/ai-studio-core/section-ai-testing-input.ts +19 -0
  53. package/templates/app-source/src/ai-studio-core/section-ai-testing-output.tsx +291 -0
  54. package/templates/app-source/src/ai-studio-core/section-ai-testing-result.tsx +413 -0
  55. package/templates/app-source/src/ai-studio-core/section-ai-testing-run.ts +174 -0
  56. package/templates/app-source/src/ai-studio-core/section-ai-testing-studio-result.tsx +449 -0
  57. package/templates/app-source/src/ai-studio-core/section-ai-testing-surface.tsx +45 -0
  58. package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +494 -0
  59. package/templates/app-source/src/ai-studio-core/studio-directives.ts +33 -0
  60. package/templates/app-source/src/ai-studio-core/workspace.tsx +381 -0
  61. package/templates/app-source/src/product-modules/agent-center/index.tsx +27 -0
  62. package/templates/app-source/src/product-modules/agent-conversation/index.tsx +19 -0
  63. package/templates/app-source/src/product-modules/agent-realtime/index.tsx +29 -0
  64. package/templates/app-source/src/product-modules/kit-recipes/gallery.tsx +142 -0
  65. package/templates/app-source/src/product-modules/kit-recipes/index.tsx +19 -0
  66. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-data-recipes.tsx +336 -0
  67. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-demos.tsx +165 -0
  68. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-recipes.tsx +682 -0
  69. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-surface.tsx +341 -0
  70. package/templates/app-source/src/studio-modules/studio-create/descriptors.ts +26 -0
  71. package/templates/app-source/src/studio-modules/studio-create/index.ts +14 -0
  72. package/templates/app-source/src/studio-modules/studio-create/messages/en.json +67 -0
  73. package/templates/app-source/src/studio-modules/studio-create/messages/index.ts +5 -0
  74. package/templates/app-source/src/studio-modules/studio-create/messages/zh.json +67 -0
  75. package/templates/app-source/src/studio-modules/studio-create/parameter-panel.tsx +153 -0
  76. package/templates/app-source/src/studio-modules/studio-create/parameters.ts +70 -0
  77. package/templates/app-source/src/studio-modules/studio-create/registration.ts +46 -0
  78. package/templates/app-source/src/studio-modules/studio-create/runtime.ts +339 -0
  79. package/templates/app-source/src/studio-modules/studio-media/descriptors.ts +22 -0
  80. package/templates/app-source/src/studio-modules/studio-media/index.ts +12 -0
  81. package/templates/app-source/src/studio-modules/studio-media/messages/en.json +82 -0
  82. package/templates/app-source/src/studio-modules/studio-media/messages/index.ts +5 -0
  83. package/templates/app-source/src/studio-modules/studio-media/messages/zh.json +82 -0
  84. package/templates/app-source/src/studio-modules/studio-media/parameter-panel.tsx +283 -0
  85. package/templates/app-source/src/studio-modules/studio-media/parameters.ts +94 -0
  86. package/templates/app-source/src/studio-modules/studio-media/registration.ts +44 -0
  87. package/templates/app-source/src/studio-modules/studio-media/runtime.ts +113 -0
  88. package/templates/app-source/src/studio-modules/studio-voice/descriptors.ts +28 -0
  89. package/templates/app-source/src/studio-modules/studio-voice/index.ts +16 -0
  90. package/templates/app-source/src/studio-modules/studio-voice/messages/en.json +99 -0
  91. package/templates/app-source/src/studio-modules/studio-voice/messages/index.ts +5 -0
  92. package/templates/app-source/src/studio-modules/studio-voice/messages/zh.json +99 -0
  93. package/templates/app-source/src/studio-modules/studio-voice/parameter-panel.tsx +284 -0
  94. package/templates/app-source/src/studio-modules/studio-voice/parameters.ts +116 -0
  95. package/templates/app-source/src/studio-modules/studio-voice/registration.ts +59 -0
  96. package/templates/app-source/src/studio-modules/studio-voice/runtime.ts +347 -0
  97. package/templates/app-source/src/workbench-core/empty-state.tsx +31 -0
  98. package/templates/app-source/src/workbench-core/index.ts +17 -0
  99. package/templates/app-source/src/workbench-core/runtime-gate.tsx +131 -0
  100. package/templates/app-source/src/workbench-core/workbench-core.css +255 -0
  101. package/templates/app-source/src/workbench-core/workbench-core.tsx +140 -0
  102. package/templates/app-source.manifest.json +333 -0
  103. package/templates/default-starter/AGENTS.md +33 -0
  104. package/templates/default-starter/LICENSE +21 -0
  105. package/templates/default-starter/README.md +41 -0
  106. package/templates/default-starter/SECURITY.md +5 -0
  107. package/templates/default-starter/index.html +12 -0
  108. package/templates/default-starter/scripts/validate.mjs +26 -0
  109. package/templates/default-starter/src/shell/App.tsx +27 -0
  110. package/templates/default-starter/src/shell/auth/app-identity.ts +3 -0
  111. package/templates/default-starter/src/shell/auth/local-app-client.ts +18 -0
  112. package/templates/default-starter/src/shell/auth/runtime-platform.ts +110 -0
  113. package/templates/default-starter/src/shell/authenticated-shell.tsx +20 -0
  114. package/templates/default-starter/src/shell/workbench-target-adapter.ts +40 -0
  115. package/templates/default-starter/src/styles.css +26 -0
  116. package/templates/default-starter/src-tauri/Cargo.toml +17 -0
  117. package/templates/default-starter/src-tauri/build.rs +5 -0
  118. package/templates/default-starter/src-tauri/capabilities/default.json +7 -0
  119. package/templates/default-starter/src-tauri/tauri.conf.json +26 -0
  120. package/templates/default-starter/tsconfig.json +18 -0
  121. package/templates/default-starter.manifest.json +99 -0
@@ -0,0 +1,40 @@
1
+ import type {
2
+ WorkbenchRuntimeGateCopy,
3
+ WorkbenchRuntimeGateProjection,
4
+ } from '../workbench-core/index.js';
5
+ import {
6
+ appTitle,
7
+ clearRuntimePlatformProjection,
8
+ getRuntimePlatformProjection,
9
+ } from './auth/runtime-platform.js';
10
+
11
+ export { appTitle };
12
+
13
+ export const targetRuntimeGateCopy: WorkbenchRuntimeGateCopy = Object.freeze({
14
+ checking: 'App-host check',
15
+ setupRequired: 'Action required',
16
+ signInRequired: 'Sign in to Nimi',
17
+ connectionRequired: 'Runtime session unavailable',
18
+ retry: 'Retry Runtime check',
19
+ offlineTier: (tier) => `Offline tier: ${tier}`,
20
+ nextAction: (action) => `Next action: ${action}`,
21
+ });
22
+
23
+ export async function resolveTargetRuntimeGate(): Promise<WorkbenchRuntimeGateProjection> {
24
+ const projection = await getRuntimePlatformProjection();
25
+ if (projection.status === 'ready') return { status: 'ready' };
26
+ return {
27
+ status: 'unavailable',
28
+ body: projection.message || 'Runtime session projection is not ready.',
29
+ signInRequired: projection.reasonCode === 'runtime-unauthenticated',
30
+ nextAction: projection.actionHint,
31
+ };
32
+ }
33
+
34
+ export function clearTargetRuntimeGate(): void {
35
+ clearRuntimePlatformProjection();
36
+ }
37
+
38
+ export function targetRuntimeGateErrorMessage(error: unknown): string {
39
+ return error instanceof Error ? error.message : String(error || 'App-host check failed');
40
+ }
@@ -0,0 +1,26 @@
1
+ @import "@nimiplatform/kit/ui/styles.css";
2
+ @import "@nimiplatform/kit/ui/themes/light.css";
3
+ @import "@nimiplatform/kit/ui/themes/nimi-accent.css";
4
+ @import "tailwindcss";
5
+ @import "./workbench-core/workbench-core.css";
6
+ @import "./scaffold/generated/module-styles.css";
7
+
8
+ @source "../node_modules/@nimiplatform/kit/dist/**/*.{js,mjs}";
9
+
10
+ :root {
11
+ color-scheme: light;
12
+ }
13
+
14
+ html,
15
+ body,
16
+ #root {
17
+ margin: 0;
18
+ min-width: 320px;
19
+ width: 100%;
20
+ height: 100%;
21
+ }
22
+
23
+ body {
24
+ background: var(--nimi-surface-canvas);
25
+ color: var(--nimi-text-primary);
26
+ }
@@ -0,0 +1,17 @@
1
+ [package]
2
+ name = "acme-widget-shell"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+
6
+ [dependencies]
7
+ tauri = { version = "2", features = [] }
8
+ nimi-shell-tauri = "0.1.0"
9
+ serde = { version = "1", features = ["derive"] }
10
+ serde_json = "1"
11
+ url = "2"
12
+ base64 = "0.22"
13
+ dirs = "6"
14
+ time = "=0.3.47"
15
+
16
+ [build-dependencies]
17
+ tauri-build = { version = "2", features = [] }
@@ -0,0 +1,5 @@
1
+ fn main() {
2
+ println!("cargo:rerun-if-changed=icons/icon.png");
3
+ println!("cargo:rerun-if-changed=icons/icon.ico");
4
+ tauri_build::build();
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://schema.tauri.app/capability/2",
3
+ "identifier": "default",
4
+ "description": "Default capability for the Nimi App main window. Grants the Tauri core baseline — notably core:event (allow-listen), which the @nimiplatform/sdk tauri-ipc transport requires to subscribe to runtime bridge stream events (chat.stream and other openStream paths). App-defined runtime_bridge commands are not ACL-gated and need no entry here.",
5
+ "windows": ["main"],
6
+ "permissions": ["core:default"]
7
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "productName": "Acme Widget",
3
+ "version": "0.1.0",
4
+ "identifier": "ai.nimi.apps.acme.widget",
5
+ "build": {
6
+ "beforeDevCommand": "pnpm run dev:renderer",
7
+ "beforeBuildCommand": "pnpm run build",
8
+ "devUrl": "http://127.0.0.1:1466",
9
+ "frontendDist": "../dist"
10
+ },
11
+ "app": {
12
+ "windows": [
13
+ {
14
+ "title": "Acme Widget",
15
+ "width": 1120,
16
+ "height": 760
17
+ }
18
+ ]
19
+ },
20
+ "bundle": {
21
+ "icon": [
22
+ "icons/icon.png",
23
+ "icons/icon.ico"
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "jsx": "react-jsx",
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ "noEmit": true,
10
+ "types": [
11
+ "node"
12
+ ]
13
+ },
14
+ "include": [
15
+ "src/**/*.ts",
16
+ "src/**/*.tsx"
17
+ ]
18
+ }
@@ -0,0 +1,99 @@
1
+ {
2
+ "manifestVersion": 1,
3
+ "sourceApp": "app-tools/default-starter",
4
+ "sourceIdentity": {
5
+ "tauriIdentifier": "ai.nimi.apps.acme.widget",
6
+ "packageName": "acme-widget",
7
+ "cargoPackageName": "acme-widget-shell",
8
+ "appId": "acme.widget",
9
+ "appTitle": "Acme Widget",
10
+ "appSlug": "acme-widget",
11
+ "rendererEntryId": "acme-widget-app",
12
+ "accentPack": "nimi-accent",
13
+ "devPort": "1466"
14
+ },
15
+ "identityReplacementOrder": [
16
+ "tauriIdentifier",
17
+ "cargoPackageName",
18
+ "packageName",
19
+ "rendererEntryId",
20
+ "appTitle",
21
+ "appSlug",
22
+ "appId",
23
+ "devPort"
24
+ ],
25
+ "files": [
26
+ {
27
+ "path": "AGENTS.md",
28
+ "class": "app-owned product code"
29
+ },
30
+ {
31
+ "path": "index.html",
32
+ "class": "scaffold-managed glue"
33
+ },
34
+ {
35
+ "path": "LICENSE",
36
+ "class": "scaffold-managed glue"
37
+ },
38
+ {
39
+ "path": "README.md",
40
+ "class": "scaffold-managed glue"
41
+ },
42
+ {
43
+ "path": "scripts/validate.mjs",
44
+ "class": "scaffold-managed glue"
45
+ },
46
+ {
47
+ "path": "SECURITY.md",
48
+ "class": "scaffold-managed glue"
49
+ },
50
+ {
51
+ "path": "src-tauri/build.rs",
52
+ "class": "scaffold-managed glue"
53
+ },
54
+ {
55
+ "path": "src-tauri/capabilities/default.json",
56
+ "class": "scaffold-managed glue"
57
+ },
58
+ {
59
+ "path": "src-tauri/Cargo.toml",
60
+ "class": "scaffold-managed glue"
61
+ },
62
+ {
63
+ "path": "src-tauri/tauri.conf.json",
64
+ "class": "scaffold-managed glue"
65
+ },
66
+ {
67
+ "path": "src/shell/App.tsx",
68
+ "class": "scaffold-managed glue"
69
+ },
70
+ {
71
+ "path": "src/shell/auth/app-identity.ts",
72
+ "class": "scaffold-managed glue"
73
+ },
74
+ {
75
+ "path": "src/shell/auth/local-app-client.ts",
76
+ "class": "scaffold-managed glue"
77
+ },
78
+ {
79
+ "path": "src/shell/auth/runtime-platform.ts",
80
+ "class": "scaffold-managed glue"
81
+ },
82
+ {
83
+ "path": "src/shell/authenticated-shell.tsx",
84
+ "class": "scaffold-managed glue"
85
+ },
86
+ {
87
+ "path": "src/shell/workbench-target-adapter.ts",
88
+ "class": "scaffold-managed glue"
89
+ },
90
+ {
91
+ "path": "src/styles.css",
92
+ "class": "scaffold-managed glue"
93
+ },
94
+ {
95
+ "path": "tsconfig.json",
96
+ "class": "scaffold-managed glue"
97
+ }
98
+ ]
99
+ }