@nimiplatform/app-tools 0.1.3 → 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.
- package/LICENSE +198 -6
- package/README.md +83 -27
- package/bin/nimi-app.mjs +328 -45
- package/lib/app-access-declaration.mjs +49 -0
- package/lib/app-doctor-update.mjs +411 -149
- package/lib/app-pack.mjs +401 -0
- package/lib/app-project-lifecycle.mjs +1141 -0
- package/lib/app-scaffold-capabilities.mjs +769 -0
- package/lib/app-scaffold-default-source.mjs +21 -0
- package/lib/app-scaffold-profiles.mjs +1093 -0
- package/lib/app-scaffold.mjs +1266 -813
- package/lib/index.mjs +194 -42
- package/lib/simulator-conformance-ast.mjs +498 -0
- package/lib/simulator-conformance-css.mjs +116 -0
- package/lib/simulator-conformance-graph.mjs +757 -0
- package/lib/simulator-conformance.d.mts +14 -0
- package/lib/simulator-conformance.mjs +203 -0
- package/lib/simulator-css-profile.d.mts +27 -0
- package/lib/simulator-css-profile.mjs +531 -0
- package/lib/simulator-kit-export-resolution.mjs +70 -0
- package/lib/simulator-manifest.mjs +334 -0
- package/package.json +66 -3
- package/scripts/dev-shell.mjs +465 -0
- package/scripts/sync-app-source.mjs +300 -0
- package/scripts/sync-scaffold-versions.mjs +91 -0
- package/templates/app-source/LICENSE +21 -0
- package/templates/app-source/src/ai-studio-core/ai-config.ts +100 -0
- package/templates/app-source/src/ai-studio-core/ai-studio-core.css +338 -0
- package/templates/app-source/src/ai-studio-core/contexts.tsx +61 -0
- package/templates/app-source/src/ai-studio-core/history-policy.ts +447 -0
- package/templates/app-source/src/ai-studio-core/history.ts +824 -0
- package/templates/app-source/src/ai-studio-core/host-context.tsx +79 -0
- package/templates/app-source/src/ai-studio-core/index.ts +214 -0
- package/templates/app-source/src/ai-studio-core/messages/en.json +310 -0
- package/templates/app-source/src/ai-studio-core/messages/index.ts +47 -0
- package/templates/app-source/src/ai-studio-core/messages/zh.json +310 -0
- package/templates/app-source/src/ai-studio-core/module-registration.ts +109 -0
- package/templates/app-source/src/ai-studio-core/non-success-presentation.ts +65 -0
- package/templates/app-source/src/ai-studio-core/parameter-fields.tsx +247 -0
- package/templates/app-source/src/ai-studio-core/parameters.ts +110 -0
- package/templates/app-source/src/ai-studio-core/prompt-drafts.ts +69 -0
- package/templates/app-source/src/ai-studio-core/run-target.ts +123 -0
- package/templates/app-source/src/ai-studio-core/runtime-dispatcher.ts +35 -0
- package/templates/app-source/src/ai-studio-core/runtime-types.ts +86 -0
- package/templates/app-source/src/ai-studio-core/runtime.ts +306 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-admission.ts +38 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-ai-config.tsx +30 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-artifact-preview.ts +40 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-composer.tsx +257 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-history.tsx +676 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-input.ts +19 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-output.tsx +291 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-result.tsx +413 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-run.ts +174 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-studio-result.tsx +449 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-surface.tsx +45 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +494 -0
- package/templates/app-source/src/ai-studio-core/studio-directives.ts +33 -0
- package/templates/app-source/src/ai-studio-core/workspace.tsx +381 -0
- package/templates/app-source/src/product-modules/agent-center/index.tsx +27 -0
- package/templates/app-source/src/product-modules/agent-conversation/index.tsx +19 -0
- package/templates/app-source/src/product-modules/agent-realtime/index.tsx +29 -0
- package/templates/app-source/src/product-modules/kit-recipes/gallery.tsx +142 -0
- package/templates/app-source/src/product-modules/kit-recipes/index.tsx +19 -0
- package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-data-recipes.tsx +336 -0
- package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-demos.tsx +165 -0
- package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-recipes.tsx +682 -0
- package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-surface.tsx +341 -0
- package/templates/app-source/src/studio-modules/studio-create/descriptors.ts +26 -0
- package/templates/app-source/src/studio-modules/studio-create/index.ts +14 -0
- package/templates/app-source/src/studio-modules/studio-create/messages/en.json +67 -0
- package/templates/app-source/src/studio-modules/studio-create/messages/index.ts +5 -0
- package/templates/app-source/src/studio-modules/studio-create/messages/zh.json +67 -0
- package/templates/app-source/src/studio-modules/studio-create/parameter-panel.tsx +153 -0
- package/templates/app-source/src/studio-modules/studio-create/parameters.ts +70 -0
- package/templates/app-source/src/studio-modules/studio-create/registration.ts +46 -0
- package/templates/app-source/src/studio-modules/studio-create/runtime.ts +339 -0
- package/templates/app-source/src/studio-modules/studio-media/descriptors.ts +22 -0
- package/templates/app-source/src/studio-modules/studio-media/index.ts +12 -0
- package/templates/app-source/src/studio-modules/studio-media/messages/en.json +82 -0
- package/templates/app-source/src/studio-modules/studio-media/messages/index.ts +5 -0
- package/templates/app-source/src/studio-modules/studio-media/messages/zh.json +82 -0
- package/templates/app-source/src/studio-modules/studio-media/parameter-panel.tsx +283 -0
- package/templates/app-source/src/studio-modules/studio-media/parameters.ts +94 -0
- package/templates/app-source/src/studio-modules/studio-media/registration.ts +44 -0
- package/templates/app-source/src/studio-modules/studio-media/runtime.ts +113 -0
- package/templates/app-source/src/studio-modules/studio-voice/descriptors.ts +28 -0
- package/templates/app-source/src/studio-modules/studio-voice/index.ts +16 -0
- package/templates/app-source/src/studio-modules/studio-voice/messages/en.json +99 -0
- package/templates/app-source/src/studio-modules/studio-voice/messages/index.ts +5 -0
- package/templates/app-source/src/studio-modules/studio-voice/messages/zh.json +99 -0
- package/templates/app-source/src/studio-modules/studio-voice/parameter-panel.tsx +284 -0
- package/templates/app-source/src/studio-modules/studio-voice/parameters.ts +116 -0
- package/templates/app-source/src/studio-modules/studio-voice/registration.ts +59 -0
- package/templates/app-source/src/studio-modules/studio-voice/runtime.ts +347 -0
- package/templates/app-source/src/workbench-core/empty-state.tsx +31 -0
- package/templates/app-source/src/workbench-core/index.ts +17 -0
- package/templates/app-source/src/workbench-core/runtime-gate.tsx +131 -0
- package/templates/app-source/src/workbench-core/workbench-core.css +255 -0
- package/templates/app-source/src/workbench-core/workbench-core.tsx +140 -0
- package/templates/app-source.manifest.json +333 -0
- package/templates/default-starter/AGENTS.md +33 -0
- package/templates/default-starter/LICENSE +21 -0
- package/templates/default-starter/README.md +41 -0
- package/templates/default-starter/SECURITY.md +5 -0
- package/templates/default-starter/index.html +12 -0
- package/templates/default-starter/scripts/validate.mjs +26 -0
- package/templates/default-starter/src/shell/App.tsx +27 -0
- package/templates/default-starter/src/shell/auth/app-identity.ts +3 -0
- package/templates/default-starter/src/shell/auth/local-app-client.ts +18 -0
- package/templates/default-starter/src/shell/auth/runtime-platform.ts +110 -0
- package/templates/default-starter/src/shell/authenticated-shell.tsx +20 -0
- package/templates/default-starter/src/shell/workbench-target-adapter.ts +40 -0
- package/templates/default-starter/src/styles.css +26 -0
- package/templates/default-starter/src-tauri/Cargo.toml +17 -0
- package/templates/default-starter/src-tauri/build.rs +5 -0
- package/templates/default-starter/src-tauri/capabilities/default.json +7 -0
- package/templates/default-starter/src-tauri/tauri.conf.json +26 -0
- package/templates/default-starter/tsconfig.json +18 -0
- 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,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
|
+
}
|