create-ekka-desktop-app 0.2.2
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 +137 -0
- package/bin/cli.js +72 -0
- package/package.json +23 -0
- package/template/branding/app.json +6 -0
- package/template/branding/icon.icns +0 -0
- package/template/eslint.config.js +98 -0
- package/template/index.html +29 -0
- package/template/package.json +40 -0
- package/template/src/app/App.tsx +24 -0
- package/template/src/demo/DemoApp.tsx +260 -0
- package/template/src/demo/components/Banner.tsx +82 -0
- package/template/src/demo/components/EmptyState.tsx +61 -0
- package/template/src/demo/components/InfoPopover.tsx +171 -0
- package/template/src/demo/components/InfoTooltip.tsx +76 -0
- package/template/src/demo/components/LearnMore.tsx +98 -0
- package/template/src/demo/components/NodeCredentialsOnboarding.tsx +219 -0
- package/template/src/demo/components/SetupWizard.tsx +48 -0
- package/template/src/demo/components/StatusBadge.tsx +83 -0
- package/template/src/demo/components/index.ts +10 -0
- package/template/src/demo/hooks/index.ts +6 -0
- package/template/src/demo/hooks/useAuditEvents.ts +30 -0
- package/template/src/demo/layout/Shell.tsx +110 -0
- package/template/src/demo/layout/Sidebar.tsx +192 -0
- package/template/src/demo/pages/AuditLogPage.tsx +235 -0
- package/template/src/demo/pages/DocGenPage.tsx +874 -0
- package/template/src/demo/pages/HomeSetupPage.tsx +182 -0
- package/template/src/demo/pages/LoginPage.tsx +192 -0
- package/template/src/demo/pages/PathPermissionsPage.tsx +873 -0
- package/template/src/demo/pages/RunnerPage.tsx +445 -0
- package/template/src/demo/pages/SystemPage.tsx +557 -0
- package/template/src/demo/pages/VaultPage.tsx +805 -0
- package/template/src/ekka/__tests__/demo-backend.test.ts +187 -0
- package/template/src/ekka/audit/index.ts +7 -0
- package/template/src/ekka/audit/store.ts +68 -0
- package/template/src/ekka/audit/types.ts +22 -0
- package/template/src/ekka/auth/client.ts +212 -0
- package/template/src/ekka/auth/index.ts +30 -0
- package/template/src/ekka/auth/storage.ts +114 -0
- package/template/src/ekka/auth/types.ts +67 -0
- package/template/src/ekka/backend/demo.ts +151 -0
- package/template/src/ekka/backend/interface.ts +36 -0
- package/template/src/ekka/config.ts +48 -0
- package/template/src/ekka/constants.ts +143 -0
- package/template/src/ekka/errors.ts +54 -0
- package/template/src/ekka/index.ts +516 -0
- package/template/src/ekka/internal/backend.ts +156 -0
- package/template/src/ekka/internal/index.ts +7 -0
- package/template/src/ekka/ops/auth.ts +29 -0
- package/template/src/ekka/ops/debug.ts +68 -0
- package/template/src/ekka/ops/home.ts +101 -0
- package/template/src/ekka/ops/index.ts +16 -0
- package/template/src/ekka/ops/nodeCredentials.ts +131 -0
- package/template/src/ekka/ops/nodeSession.ts +145 -0
- package/template/src/ekka/ops/paths.ts +183 -0
- package/template/src/ekka/ops/runner.ts +86 -0
- package/template/src/ekka/ops/runtime.ts +31 -0
- package/template/src/ekka/ops/setup.ts +47 -0
- package/template/src/ekka/ops/vault.ts +459 -0
- package/template/src/ekka/ops/workflowRuns.ts +116 -0
- package/template/src/ekka/types.ts +82 -0
- package/template/src/ekka/utils/idempotency.ts +14 -0
- package/template/src/ekka/utils/index.ts +7 -0
- package/template/src/ekka/utils/time.ts +77 -0
- package/template/src/main.tsx +12 -0
- package/template/src/vite-env.d.ts +12 -0
- package/template/src-tauri/Cargo.toml +41 -0
- package/template/src-tauri/build.rs +3 -0
- package/template/src-tauri/capabilities/default.json +11 -0
- package/template/src-tauri/icons/icon.icns +0 -0
- package/template/src-tauri/icons/icon.png +0 -0
- package/template/src-tauri/resources/ekka-engine-bootstrap +0 -0
- package/template/src-tauri/src/bootstrap.rs +37 -0
- package/template/src-tauri/src/commands.rs +1215 -0
- package/template/src-tauri/src/device_secret.rs +111 -0
- package/template/src-tauri/src/engine_process.rs +538 -0
- package/template/src-tauri/src/grants.rs +129 -0
- package/template/src-tauri/src/handlers/home.rs +65 -0
- package/template/src-tauri/src/handlers/mod.rs +7 -0
- package/template/src-tauri/src/handlers/paths.rs +128 -0
- package/template/src-tauri/src/handlers/vault.rs +680 -0
- package/template/src-tauri/src/main.rs +243 -0
- package/template/src-tauri/src/node_auth.rs +858 -0
- package/template/src-tauri/src/node_credentials.rs +541 -0
- package/template/src-tauri/src/node_runner.rs +882 -0
- package/template/src-tauri/src/node_vault_crypto.rs +113 -0
- package/template/src-tauri/src/node_vault_store.rs +267 -0
- package/template/src-tauri/src/ops/auth.rs +50 -0
- package/template/src-tauri/src/ops/home.rs +251 -0
- package/template/src-tauri/src/ops/mod.rs +7 -0
- package/template/src-tauri/src/ops/runtime.rs +21 -0
- package/template/src-tauri/src/state.rs +639 -0
- package/template/src-tauri/src/types.rs +84 -0
- package/template/src-tauri/tauri.conf.json +41 -0
- package/template/tsconfig.json +26 -0
- package/template/tsconfig.tsbuildinfo +1 -0
- package/template/vite.config.ts +34 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//! Contract types for TypeScript ↔ Rust communication
|
|
2
|
+
//!
|
|
3
|
+
//! These types define the RPC protocol between the frontend and Tauri backend.
|
|
4
|
+
|
|
5
|
+
use serde::{Deserialize, Serialize};
|
|
6
|
+
use serde_json::Value;
|
|
7
|
+
|
|
8
|
+
/// Incoming request from TypeScript
|
|
9
|
+
#[derive(Debug, Deserialize, Serialize)]
|
|
10
|
+
#[serde(rename_all = "camelCase")]
|
|
11
|
+
pub struct EngineRequest {
|
|
12
|
+
pub op: String,
|
|
13
|
+
#[allow(dead_code)]
|
|
14
|
+
pub v: u32,
|
|
15
|
+
pub payload: Value,
|
|
16
|
+
#[allow(dead_code)]
|
|
17
|
+
pub correlation_id: String,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/// Response sent back to TypeScript
|
|
21
|
+
#[derive(Debug, Serialize, Deserialize)]
|
|
22
|
+
pub struct EngineResponse {
|
|
23
|
+
pub ok: bool,
|
|
24
|
+
#[serde(skip_serializing_if = "Option::is_none")]
|
|
25
|
+
pub result: Option<Value>,
|
|
26
|
+
#[serde(skip_serializing_if = "Option::is_none")]
|
|
27
|
+
pub error: Option<EngineError>,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/// Error details in response
|
|
31
|
+
#[derive(Debug, Serialize, Deserialize)]
|
|
32
|
+
pub struct EngineError {
|
|
33
|
+
pub code: String,
|
|
34
|
+
pub message: String,
|
|
35
|
+
#[serde(skip_serializing_if = "Option::is_none")]
|
|
36
|
+
pub status: Option<u16>,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
impl EngineResponse {
|
|
40
|
+
/// Success response with result value
|
|
41
|
+
pub fn ok(result: Value) -> Self {
|
|
42
|
+
Self {
|
|
43
|
+
ok: true,
|
|
44
|
+
result: Some(result),
|
|
45
|
+
error: None,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// Success response with null result
|
|
50
|
+
#[allow(dead_code)]
|
|
51
|
+
pub fn ok_null() -> Self {
|
|
52
|
+
Self {
|
|
53
|
+
ok: true,
|
|
54
|
+
result: Some(Value::Null),
|
|
55
|
+
error: None,
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/// Error response
|
|
60
|
+
pub fn err(code: &str, message: &str) -> Self {
|
|
61
|
+
Self {
|
|
62
|
+
ok: false,
|
|
63
|
+
result: None,
|
|
64
|
+
error: Some(EngineError {
|
|
65
|
+
code: code.to_string(),
|
|
66
|
+
message: message.to_string(),
|
|
67
|
+
status: None,
|
|
68
|
+
}),
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/// Error response with HTTP status code
|
|
73
|
+
pub fn err_with_status(code: &str, message: &str, status: u16) -> Self {
|
|
74
|
+
Self {
|
|
75
|
+
ok: false,
|
|
76
|
+
result: None,
|
|
77
|
+
error: Some(EngineError {
|
|
78
|
+
code: code.to_string(),
|
|
79
|
+
message: message.to_string(),
|
|
80
|
+
status: Some(status),
|
|
81
|
+
}),
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schema.tauri.app/config/2",
|
|
3
|
+
"productName": "EKKA Desktop",
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"identifier": "ai.ekka.desktop",
|
|
6
|
+
"build": {
|
|
7
|
+
"beforeDevCommand": "npm run dev",
|
|
8
|
+
"devUrl": "http://localhost:5173",
|
|
9
|
+
"beforeBuildCommand": "npm run build",
|
|
10
|
+
"frontendDist": "../dist"
|
|
11
|
+
},
|
|
12
|
+
"app": {
|
|
13
|
+
"windows": [
|
|
14
|
+
{
|
|
15
|
+
"title": "EKKA Desktop",
|
|
16
|
+
"width": 900,
|
|
17
|
+
"height": 700,
|
|
18
|
+
"resizable": true,
|
|
19
|
+
"fullscreen": false,
|
|
20
|
+
"center": true
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"security": {
|
|
24
|
+
"csp": null
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"bundle": {
|
|
28
|
+
"active": true,
|
|
29
|
+
"targets": "all",
|
|
30
|
+
"icon": [
|
|
31
|
+
"../branding/icon.icns",
|
|
32
|
+
"icons/icon.png"
|
|
33
|
+
],
|
|
34
|
+
"resources": [
|
|
35
|
+
"resources/ekka-engine-bootstrap"
|
|
36
|
+
],
|
|
37
|
+
"macOS": {
|
|
38
|
+
"minimumSystemVersion": "10.15"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"resolveJsonModule": true,
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"moduleResolution": "bundler",
|
|
10
|
+
"allowImportingTsExtensions": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"moduleDetection": "force",
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"strict": true,
|
|
16
|
+
"noUnusedLocals": true,
|
|
17
|
+
"noUnusedParameters": true,
|
|
18
|
+
"noFallthroughCasesInSwitch": true,
|
|
19
|
+
"noUncheckedSideEffectImports": true,
|
|
20
|
+
"baseUrl": ".",
|
|
21
|
+
"paths": {
|
|
22
|
+
"@ekka/*": ["src/ekka/*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["src"]
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/main.tsx","./src/app/app.tsx","./src/demo/demoapp.tsx","./src/demo/components/banner.tsx","./src/demo/components/emptystate.tsx","./src/demo/components/infotooltip.tsx","./src/demo/components/learnmore.tsx","./src/demo/components/statusbadge.tsx","./src/demo/components/index.ts","./src/demo/hooks/index.ts","./src/demo/hooks/useauditevents.ts","./src/demo/layout/shell.tsx","./src/demo/layout/sidebar.tsx","./src/demo/pages/asyncwork.tsx","./src/demo/pages/auditlogpage.tsx","./src/demo/pages/loginpage.tsx","./src/demo/pages/settingspage.tsx","./src/demo/pages/statefuldata.tsx","./src/ekka/config.ts","./src/ekka/constants.ts","./src/ekka/errors.ts","./src/ekka/index.ts","./src/ekka/types.ts","./src/ekka/__tests__/demo-backend.test.ts","./src/ekka/__tests__/runtime.test.ts","./src/ekka/api/db.ts","./src/ekka/api/http.ts","./src/ekka/api/index.ts","./src/ekka/api/pipeline.ts","./src/ekka/api/queue.ts","./src/ekka/api/vault.ts","./src/ekka/audit/index.ts","./src/ekka/audit/store.ts","./src/ekka/audit/types.ts","./src/ekka/auth/client.ts","./src/ekka/auth/index.ts","./src/ekka/auth/storage.ts","./src/ekka/auth/types.ts","./src/ekka/backend/demo.ts","./src/ekka/backend/engine.ts","./src/ekka/backend/index.ts","./src/ekka/backend/interface.ts","./src/ekka/core/index.ts","./src/ekka/core/runtime.ts","./src/ekka/utils/idempotency.ts","./src/ekka/utils/index.ts","./src/ekka/utils/time.ts"],"version":"5.6.3"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
|
|
5
|
+
// https://vitejs.dev/config/
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [react()],
|
|
8
|
+
resolve: {
|
|
9
|
+
alias: {
|
|
10
|
+
'@ekka': resolve(__dirname, 'src/ekka'),
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
// Tauri expects a fixed port for dev server
|
|
15
|
+
server: {
|
|
16
|
+
port: 5173,
|
|
17
|
+
strictPort: true,
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
// Prevent vite from obscuring Rust errors
|
|
21
|
+
clearScreen: false,
|
|
22
|
+
|
|
23
|
+
// Env variables starting with TAURI_ are exposed to the frontend
|
|
24
|
+
envPrefix: ['VITE_', 'TAURI_'],
|
|
25
|
+
|
|
26
|
+
build: {
|
|
27
|
+
// Tauri uses Chromium on Windows and WebKit on macOS/Linux
|
|
28
|
+
target: process.env.TAURI_PLATFORM === 'windows' ? 'chrome105' : 'safari13',
|
|
29
|
+
// Don't minify for debug builds
|
|
30
|
+
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
|
|
31
|
+
// Produce sourcemaps for debug builds
|
|
32
|
+
sourcemap: !!process.env.TAURI_DEBUG,
|
|
33
|
+
},
|
|
34
|
+
})
|