ltcai 4.0.1 → 4.1.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/README.md +28 -23
- package/desktop/electron/main.cjs +44 -0
- package/docs/CHANGELOG.md +42 -0
- package/docs/V4_1_FRONTEND_ARCHITECTURE_REVIEW.md +65 -0
- package/docs/V4_1_FRONTEND_MIGRATION_REPORT.md +70 -0
- package/docs/V4_1_VALIDATION_REPORT.md +47 -0
- package/docs/V4_DIGITAL_BRAIN_RECOVERY.md +26 -19
- package/frontend/index.html +24 -0
- package/frontend/openapi.json +14190 -0
- package/frontend/src/App.tsx +184 -0
- package/frontend/src/api/client.ts +317 -0
- package/frontend/src/api/openapi.ts +16637 -0
- package/frontend/src/components/primitives.tsx +204 -0
- package/frontend/src/components/ui/badge.tsx +27 -0
- package/frontend/src/components/ui/button.tsx +37 -0
- package/frontend/src/components/ui/card.tsx +22 -0
- package/frontend/src/components/ui/input.tsx +16 -0
- package/frontend/src/components/ui/textarea.tsx +16 -0
- package/frontend/src/lib/utils.ts +33 -0
- package/frontend/src/main.tsx +23 -0
- package/frontend/src/pages/Act.tsx +245 -0
- package/frontend/src/pages/Ask.tsx +200 -0
- package/frontend/src/pages/Brain.tsx +267 -0
- package/frontend/src/pages/Capture.tsx +158 -0
- package/frontend/src/pages/Library.tsx +187 -0
- package/frontend/src/pages/System.tsx +344 -0
- package/frontend/src/routes.ts +85 -0
- package/frontend/src/store/appStore.ts +54 -0
- package/frontend/src/styles.css +107 -0
- package/latticeai/__init__.py +1 -1
- package/latticeai/api/setup.py +5 -4
- package/latticeai/api/static_routes.py +4 -4
- package/latticeai/core/marketplace.py +1 -1
- package/latticeai/core/multi_agent.py +1 -1
- package/latticeai/core/workspace_os.py +1 -1
- package/package.json +54 -15
- package/scripts/build_frontend_assets.mjs +38 -0
- package/scripts/bump_version.py +1 -1
- package/scripts/export_openapi.py +31 -0
- package/scripts/lint_frontend.mjs +86 -0
- package/scripts/run_python.mjs +47 -0
- package/src-tauri/Cargo.lock +4833 -0
- package/src-tauri/Cargo.toml +19 -0
- package/src-tauri/build.rs +3 -0
- package/src-tauri/capabilities/default.json +7 -0
- package/src-tauri/src/main.rs +78 -0
- package/src-tauri/tauri.conf.json +36 -0
- package/static/app/asset-manifest.json +32 -0
- package/static/app/assets/core-CwxXejkd.js +2 -0
- package/static/app/assets/core-CwxXejkd.js.map +1 -0
- package/static/app/assets/index-CJRAzNnf.js +333 -0
- package/static/app/assets/index-CJRAzNnf.js.map +1 -0
- package/static/app/assets/index-CSwBBgf4.css +2 -0
- package/static/app/index.html +25 -0
- package/static/manifest.json +2 -2
- package/static/sw.js +4 -4
- package/scripts/build_v3_assets.mjs +0 -170
- package/scripts/lint_v3.mjs +0 -120
- package/static/v3/asset-manifest.json +0 -63
- package/static/v3/css/lattice.base.49deefb5.css +0 -128
- package/static/v3/css/lattice.base.css +0 -128
- package/static/v3/css/lattice.components.cde18231.css +0 -472
- package/static/v3/css/lattice.components.css +0 -472
- package/static/v3/css/lattice.shell.29d36d85.css +0 -452
- package/static/v3/css/lattice.shell.css +0 -452
- package/static/v3/css/lattice.tokens.304cbc40.css +0 -135
- package/static/v3/css/lattice.tokens.css +0 -135
- package/static/v3/css/lattice.views.0a18b6c5.css +0 -360
- package/static/v3/css/lattice.views.css +0 -360
- package/static/v3/index.html +0 -68
- package/static/v3/js/app.c5c80c46.js +0 -26
- package/static/v3/js/app.js +0 -26
- package/static/v3/js/core/api.ba0fbf14.js +0 -625
- package/static/v3/js/core/api.js +0 -625
- package/static/v3/js/core/components.f25b3b93.js +0 -230
- package/static/v3/js/core/components.js +0 -230
- package/static/v3/js/core/dom.a2773eb0.js +0 -148
- package/static/v3/js/core/dom.js +0 -148
- package/static/v3/js/core/i18n.880e1fec.js +0 -575
- package/static/v3/js/core/i18n.js +0 -575
- package/static/v3/js/core/router.584570f2.js +0 -37
- package/static/v3/js/core/router.js +0 -37
- package/static/v3/js/core/routes.37522821.js +0 -101
- package/static/v3/js/core/routes.js +0 -101
- package/static/v3/js/core/shell.e3f6bbfa.js +0 -420
- package/static/v3/js/core/shell.js +0 -420
- package/static/v3/js/core/store.7b2aa044.js +0 -123
- package/static/v3/js/core/store.js +0 -123
- package/static/v3/js/views/account.eff40715.js +0 -143
- package/static/v3/js/views/account.js +0 -143
- package/static/v3/js/views/activity.0d271ef9.js +0 -67
- package/static/v3/js/views/activity.js +0 -67
- package/static/v3/js/views/admin-audit.660a1fb1.js +0 -185
- package/static/v3/js/views/admin-audit.js +0 -185
- package/static/v3/js/views/admin-permissions.a7ae5f09.js +0 -177
- package/static/v3/js/views/admin-permissions.js +0 -177
- package/static/v3/js/views/admin-policies.3658fd86.js +0 -102
- package/static/v3/js/views/admin-policies.js +0 -102
- package/static/v3/js/views/admin-private-vpc.7d342d36.js +0 -135
- package/static/v3/js/views/admin-private-vpc.js +0 -135
- package/static/v3/js/views/admin-security.07c66b72.js +0 -180
- package/static/v3/js/views/admin-security.js +0 -180
- package/static/v3/js/views/admin-users.f7ac7b43.js +0 -166
- package/static/v3/js/views/admin-users.js +0 -166
- package/static/v3/js/views/agents.17c5288d.js +0 -564
- package/static/v3/js/views/agents.js +0 -564
- package/static/v3/js/views/chat.e250e2cc.js +0 -624
- package/static/v3/js/views/chat.js +0 -624
- package/static/v3/js/views/files.adad14c1.js +0 -365
- package/static/v3/js/views/files.js +0 -365
- package/static/v3/js/views/graph-canvas.17c15d65.js +0 -509
- package/static/v3/js/views/graph-canvas.js +0 -509
- package/static/v3/js/views/home.24f8b8ae.js +0 -200
- package/static/v3/js/views/home.js +0 -200
- package/static/v3/js/views/hooks.37895880.js +0 -220
- package/static/v3/js/views/hooks.js +0 -220
- package/static/v3/js/views/hybrid-search.2fb63ed9.js +0 -194
- package/static/v3/js/views/hybrid-search.js +0 -194
- package/static/v3/js/views/knowledge-graph.4d09c537.js +0 -529
- package/static/v3/js/views/knowledge-graph.js +0 -529
- package/static/v3/js/views/marketplace.ab0583d4.js +0 -141
- package/static/v3/js/views/marketplace.js +0 -141
- package/static/v3/js/views/mcp.99b5c6a7.js +0 -114
- package/static/v3/js/views/mcp.js +0 -114
- package/static/v3/js/views/memory.4ebdf474.js +0 -147
- package/static/v3/js/views/memory.js +0 -147
- package/static/v3/js/views/models.a1ffa147.js +0 -256
- package/static/v3/js/views/models.js +0 -256
- package/static/v3/js/views/my-computer.d9d9ae1c.js +0 -463
- package/static/v3/js/views/my-computer.js +0 -463
- package/static/v3/js/views/network.52a4f181.js +0 -97
- package/static/v3/js/views/network.js +0 -97
- package/static/v3/js/views/pipeline.c522f1ce.js +0 -157
- package/static/v3/js/views/pipeline.js +0 -157
- package/static/v3/js/views/planning.4876fd77.js +0 -174
- package/static/v3/js/views/planning.js +0 -174
- package/static/v3/js/views/runs.b63b2afa.js +0 -144
- package/static/v3/js/views/runs.js +0 -144
- package/static/v3/js/views/settings.b7140634.js +0 -317
- package/static/v3/js/views/settings.js +0 -317
- package/static/v3/js/views/skills.c6c2f965.js +0 -109
- package/static/v3/js/views/skills.js +0 -109
- package/static/v3/js/views/snapshots.6f5db095.js +0 -135
- package/static/v3/js/views/snapshots.js +0 -135
- package/static/v3/js/views/tools.e4f11276.js +0 -108
- package/static/v3/js/views/tools.js +0 -108
- package/static/v3/js/views/workflows.7752225a.js +0 -213
- package/static/v3/js/views/workflows.js +0 -213
- package/static/v3/js/views/workspace-admin.c466029b.js +0 -156
- package/static/v3/js/views/workspace-admin.js +0 -156
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "lattice-ai-desktop"
|
|
3
|
+
version = "4.1.0"
|
|
4
|
+
description = "Lattice AI Digital Brain desktop shell"
|
|
5
|
+
authors = ["TaeSoo Park"]
|
|
6
|
+
edition = "2021"
|
|
7
|
+
|
|
8
|
+
[build-dependencies]
|
|
9
|
+
tauri-build = { version = "=2.0.0", features = [] }
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
tauri = { version = "=2.0.0", features = [] }
|
|
13
|
+
tauri-runtime = "=2.0.0"
|
|
14
|
+
tauri-runtime-wry = "=2.0.0"
|
|
15
|
+
tauri-utils = "=2.0.0"
|
|
16
|
+
plist = "=1.7.0"
|
|
17
|
+
time = "=0.3.36"
|
|
18
|
+
serde = { version = "1", features = ["derive"] }
|
|
19
|
+
serde_json = "1"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
use std::{
|
|
2
|
+
env,
|
|
3
|
+
process::{Child, Command, Stdio},
|
|
4
|
+
sync::Mutex,
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
use tauri::{Manager, State};
|
|
8
|
+
|
|
9
|
+
struct BackendState {
|
|
10
|
+
origin: String,
|
|
11
|
+
child: Mutex<Option<Child>>,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
#[tauri::command]
|
|
15
|
+
fn backend_origin(state: State<'_, BackendState>) -> String {
|
|
16
|
+
state.origin.clone()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
fn split_command(command: &str) -> Vec<String> {
|
|
20
|
+
command
|
|
21
|
+
.split_whitespace()
|
|
22
|
+
.map(|part| part.to_string())
|
|
23
|
+
.collect()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
fn spawn_backend(origin: &str) -> Option<Child> {
|
|
27
|
+
if env::var("LATTICEAI_DESKTOP_NO_BACKEND").is_ok() {
|
|
28
|
+
return None;
|
|
29
|
+
}
|
|
30
|
+
let command = env::var("LATTICEAI_DESKTOP_BACKEND_CMD")
|
|
31
|
+
.unwrap_or_else(|_| "python3 ltcai_cli.py --host 127.0.0.1 --port 8765".to_string());
|
|
32
|
+
let parts = split_command(&command);
|
|
33
|
+
if parts.is_empty() {
|
|
34
|
+
return None;
|
|
35
|
+
}
|
|
36
|
+
let mut cmd = Command::new(&parts[0]);
|
|
37
|
+
cmd.args(&parts[1..])
|
|
38
|
+
.env("LATTICEAI_HOST", "127.0.0.1")
|
|
39
|
+
.env("LATTICEAI_PORT", origin.rsplit(':').next().unwrap_or("8765"))
|
|
40
|
+
.env("LATTICEAI_TUNNEL", "false")
|
|
41
|
+
.stdout(Stdio::null())
|
|
42
|
+
.stderr(Stdio::null());
|
|
43
|
+
if let Ok(cwd) = env::var("LATTICEAI_DESKTOP_BACKEND_CWD") {
|
|
44
|
+
cmd.current_dir(cwd);
|
|
45
|
+
}
|
|
46
|
+
cmd.spawn().ok()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
fn main() {
|
|
50
|
+
let origin = env::var("LATTICEAI_DESKTOP_BACKEND_ORIGIN")
|
|
51
|
+
.unwrap_or_else(|_| "http://127.0.0.1:8765".to_string());
|
|
52
|
+
let child = spawn_backend(&origin);
|
|
53
|
+
tauri::Builder::default()
|
|
54
|
+
.manage(BackendState {
|
|
55
|
+
origin,
|
|
56
|
+
child: Mutex::new(child),
|
|
57
|
+
})
|
|
58
|
+
.invoke_handler(tauri::generate_handler![backend_origin])
|
|
59
|
+
.setup(|app| {
|
|
60
|
+
if let Some(window) = app.get_webview_window("main") {
|
|
61
|
+
let _ = window.set_title("Lattice AI");
|
|
62
|
+
}
|
|
63
|
+
Ok(())
|
|
64
|
+
})
|
|
65
|
+
.on_window_event(|window, event| {
|
|
66
|
+
if matches!(event, tauri::WindowEvent::CloseRequested { .. }) {
|
|
67
|
+
if let Some(state) = window.try_state::<BackendState>() {
|
|
68
|
+
if let Ok(mut child) = state.child.lock() {
|
|
69
|
+
if let Some(process) = child.as_mut() {
|
|
70
|
+
let _ = process.kill();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
.run(tauri::generate_context!())
|
|
77
|
+
.expect("failed to run Lattice AI desktop shell");
|
|
78
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schema.tauri.app/config/2",
|
|
3
|
+
"productName": "Lattice AI",
|
|
4
|
+
"version": "4.1.0",
|
|
5
|
+
"identifier": "ai.lattice.desktop",
|
|
6
|
+
"build": {
|
|
7
|
+
"beforeDevCommand": "npm run frontend:dev",
|
|
8
|
+
"beforeBuildCommand": "npm run build:assets",
|
|
9
|
+
"devUrl": "http://127.0.0.1:5173",
|
|
10
|
+
"frontendDist": "../static/app"
|
|
11
|
+
},
|
|
12
|
+
"app": {
|
|
13
|
+
"windows": [
|
|
14
|
+
{
|
|
15
|
+
"title": "Lattice AI",
|
|
16
|
+
"label": "main",
|
|
17
|
+
"width": 1440,
|
|
18
|
+
"height": 920,
|
|
19
|
+
"minWidth": 1024,
|
|
20
|
+
"minHeight": 720,
|
|
21
|
+
"resizable": true
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"security": {
|
|
25
|
+
"csp": null
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"bundle": {
|
|
29
|
+
"active": true,
|
|
30
|
+
"targets": ["dmg", "app"],
|
|
31
|
+
"icon": [
|
|
32
|
+
"../static/icons/icon-192.png",
|
|
33
|
+
"../static/icons/icon-512.png"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "4.1.0",
|
|
3
|
+
"generated_at": "vite",
|
|
4
|
+
"entrypoints": {
|
|
5
|
+
"app": "/static/app/index.html"
|
|
6
|
+
},
|
|
7
|
+
"assets": {
|
|
8
|
+
"../node_modules/@tauri-apps/api/core.js": "/static/app/assets/core-CwxXejkd.js",
|
|
9
|
+
"index.html": "/static/app/assets/index-CJRAzNnf.js",
|
|
10
|
+
"assets/index-CSwBBgf4.css": "/static/app/assets/index-CSwBBgf4.css"
|
|
11
|
+
},
|
|
12
|
+
"vite": {
|
|
13
|
+
"../node_modules/@tauri-apps/api/core.js": {
|
|
14
|
+
"file": "assets/core-CwxXejkd.js",
|
|
15
|
+
"name": "core",
|
|
16
|
+
"src": "../node_modules/@tauri-apps/api/core.js",
|
|
17
|
+
"isDynamicEntry": true
|
|
18
|
+
},
|
|
19
|
+
"index.html": {
|
|
20
|
+
"file": "assets/index-CJRAzNnf.js",
|
|
21
|
+
"name": "index",
|
|
22
|
+
"src": "index.html",
|
|
23
|
+
"isEntry": true,
|
|
24
|
+
"dynamicImports": [
|
|
25
|
+
"../node_modules/@tauri-apps/api/core.js"
|
|
26
|
+
],
|
|
27
|
+
"css": [
|
|
28
|
+
"assets/index-CSwBBgf4.css"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-CwxXejkd.js","names":[],"sources":["../../../node_modules/@tauri-apps/api/core.js"],"sourcesContent":["import { __classPrivateFieldGet, __classPrivateFieldSet } from './external/tslib/tslib.es6.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\nvar _Channel_onmessage, _Channel_nextMessageId, _Channel_pendingMessages, _Resource_rid;\n/**\n * Invoke your custom commands.\n *\n * This package is also accessible with `window.__TAURI__.tauri` when [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * Transforms a callback function to a string identifier that can be passed to the backend.\n * The backend uses the identifier to `eval()` the callback.\n *\n * @return A unique identifier associated with the callback function.\n *\n * @since 1.0.0\n */\nfunction transformCallback(callback, once = false) {\n return window.__TAURI_INTERNALS__.transformCallback(callback, once);\n}\nclass Channel {\n constructor() {\n // @ts-expect-error field used by the IPC serializer\n this.__TAURI_CHANNEL_MARKER__ = true;\n _Channel_onmessage.set(this, () => {\n // no-op\n });\n _Channel_nextMessageId.set(this, 0);\n _Channel_pendingMessages.set(this, {});\n this.id = transformCallback(({ message, id }) => {\n // the id is used as a mechanism to preserve message order\n if (id === __classPrivateFieldGet(this, _Channel_nextMessageId, \"f\")) {\n __classPrivateFieldSet(this, _Channel_nextMessageId, id + 1, \"f\");\n __classPrivateFieldGet(this, _Channel_onmessage, \"f\").call(this, message);\n // process pending messages\n const pendingMessageIds = Object.keys(__classPrivateFieldGet(this, _Channel_pendingMessages, \"f\"));\n if (pendingMessageIds.length > 0) {\n let nextId = id + 1;\n for (const pendingId of pendingMessageIds.sort()) {\n // if we have the next message, process it\n if (parseInt(pendingId) === nextId) {\n // eslint-disable-next-line security/detect-object-injection\n const message = __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[pendingId];\n // eslint-disable-next-line security/detect-object-injection\n delete __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[pendingId];\n __classPrivateFieldGet(this, _Channel_onmessage, \"f\").call(this, message);\n // move the id counter to the next message to check\n nextId += 1;\n }\n else {\n // we do not have the next message, let's wait\n break;\n }\n }\n __classPrivateFieldSet(this, _Channel_nextMessageId, nextId, \"f\");\n }\n }\n else {\n __classPrivateFieldGet(this, _Channel_pendingMessages, \"f\")[id.toString()] = message;\n }\n });\n }\n set onmessage(handler) {\n __classPrivateFieldSet(this, _Channel_onmessage, handler, \"f\");\n }\n get onmessage() {\n return __classPrivateFieldGet(this, _Channel_onmessage, \"f\");\n }\n toJSON() {\n return `__CHANNEL__:${this.id}`;\n }\n}\n_Channel_onmessage = new WeakMap(), _Channel_nextMessageId = new WeakMap(), _Channel_pendingMessages = new WeakMap();\nclass PluginListener {\n constructor(plugin, event, channelId) {\n this.plugin = plugin;\n this.event = event;\n this.channelId = channelId;\n }\n async unregister() {\n return invoke(`plugin:${this.plugin}|remove_listener`, {\n event: this.event,\n channelId: this.channelId\n });\n }\n}\n/**\n * Adds a listener to a plugin event.\n *\n * @returns The listener object to stop listening to the events.\n *\n * @since 2.0.0\n */\nasync function addPluginListener(plugin, event, cb) {\n const handler = new Channel();\n handler.onmessage = cb;\n return invoke(`plugin:${plugin}|register_listener`, { event, handler }).then(() => new PluginListener(plugin, event, handler.id));\n}\n/**\n * Get permission state for a plugin.\n *\n * This should be used by plugin authors to wrap their actual implementation.\n */\nasync function checkPermissions(plugin) {\n return invoke(`plugin:${plugin}|check_permissions`);\n}\n/**\n * Request permissions.\n *\n * This should be used by plugin authors to wrap their actual implementation.\n */\nasync function requestPermissions(plugin) {\n return invoke(`plugin:${plugin}|request_permissions`);\n}\n/**\n * Sends a message to the backend.\n * @example\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n * ```\n *\n * @param cmd The command name.\n * @param args The optional arguments to pass to the command.\n * @param options The request options.\n * @return A promise resolving or rejecting to the backend response.\n *\n * @since 1.0.0\n */\nasync function invoke(cmd, args = {}, options) {\n return window.__TAURI_INTERNALS__.invoke(cmd, args, options);\n}\n/**\n * Convert a device file path to an URL that can be loaded by the webview.\n * Note that `asset:` and `http://asset.localhost` must be added to [`app.security.csp`](https://v2.tauri.app/reference/config/#csp-1) in `tauri.conf.json`.\n * Example CSP value: `\"csp\": \"default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost\"` to use the asset protocol on image sources.\n *\n * Additionally, `\"enable\" : \"true\"` must be added to [`app.security.assetProtocol`](https://v2.tauri.app/reference/config/#assetprotocolconfig)\n * in `tauri.conf.json` and its access scope must be defined on the `scope` array on the same `assetProtocol` object.\n *\n * @param filePath The file path.\n * @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol.\n * @example\n * ```typescript\n * import { appDataDir, join } from '@tauri-apps/api/path';\n * import { convertFileSrc } from '@tauri-apps/api/core';\n * const appDataDirPath = await appDataDir();\n * const filePath = await join(appDataDirPath, 'assets/video.mp4');\n * const assetUrl = convertFileSrc(filePath);\n *\n * const video = document.getElementById('my-video');\n * const source = document.createElement('source');\n * source.type = 'video/mp4';\n * source.src = assetUrl;\n * video.appendChild(source);\n * video.load();\n * ```\n *\n * @return the URL that can be used as source on the webview.\n *\n * @since 1.0.0\n */\nfunction convertFileSrc(filePath, protocol = 'asset') {\n return window.__TAURI_INTERNALS__.convertFileSrc(filePath, protocol);\n}\n/**\n * A rust-backed resource stored through `tauri::Manager::resources_table` API.\n *\n * The resource lives in the main process and does not exist\n * in the Javascript world, and thus will not be cleaned up automatiacally\n * except on application exit. If you want to clean it up early, call {@linkcode Resource.close}\n *\n * @example\n * ```typescript\n * import { Resource, invoke } from '@tauri-apps/api/core';\n * export class DatabaseHandle extends Resource {\n * static async open(path: string): Promise<DatabaseHandle> {\n * const rid: number = await invoke('open_db', { path });\n * return new DatabaseHandle(rid);\n * }\n *\n * async execute(sql: string): Promise<void> {\n * await invoke('execute_sql', { rid: this.rid, sql });\n * }\n * }\n * ```\n */\nclass Resource {\n get rid() {\n return __classPrivateFieldGet(this, _Resource_rid, \"f\");\n }\n constructor(rid) {\n _Resource_rid.set(this, void 0);\n __classPrivateFieldSet(this, _Resource_rid, rid, \"f\");\n }\n /**\n * Destroys and cleans up this resource from memory.\n * **You should not call any method on this object anymore and should drop any reference to it.**\n */\n async close() {\n return invoke('plugin:resources|close', {\n rid: this.rid\n });\n }\n}\n_Resource_rid = new WeakMap();\nfunction isTauri() {\n return 'isTauri' in window && !!window.isTauri;\n}\n\nexport { Channel, PluginListener, Resource, addPluginListener, checkPermissions, convertFileSrc, invoke, isTauri, requestPermissions, transformCallback };\n"],"x_google_ignoreList":[0],"mappings":"AAoIA,eAAe,EAAO,EAAK,EAAO,CAAC,EAAG,EAAS,CAC3C,OAAO,OAAO,oBAAoB,OAAO,EAAK,EAAM,CAAO,CAC/D"}
|