main
reng 5 months ago
parent 7f4f065538
commit 644c9b175b
  1. 30
      vite/package-lock.json
  2. 1
      vite/package.json
  3. 8
      vite/public/cuelist_free.json
  4. 5
      vite/public/default.json
  5. 12
      vite/src-tauri/2
  6. 524
      vite/src-tauri/Cargo.lock
  7. 1
      vite/src-tauri/Cargo.toml
  8. 28
      vite/src-tauri/capabilities/default.json
  9. 2
      vite/src-tauri/src/lib.rs
  10. 4
      vite/src-tauri/tauri.conf.json
  11. 2
      vite/src/App.css
  12. 17
      vite/src/comps/debug.jsx
  13. 13
      vite/src/pages/flow.jsx
  14. 39
      vite/src/pages/flow_free.jsx
  15. 15
      vite/src/pages/settings.jsx
  16. 13
      vite/src/util/chat.js
  17. 6
      vite/src/util/useData.jsx

@ -11,6 +11,7 @@
"@tailwindcss/vite": "^4.1.8", "@tailwindcss/vite": "^4.1.8",
"@tauri-apps/plugin-fs": "^2.3.0", "@tauri-apps/plugin-fs": "^2.3.0",
"@tauri-apps/plugin-http": "^2.4.4", "@tauri-apps/plugin-http": "^2.4.4",
"@tauri-apps/plugin-opener": "^2.4.0",
"gsap": "^3.13.0", "gsap": "^3.13.0",
"moment": "^2.30.1", "moment": "^2.30.1",
"react": "^19.1.0", "react": "^19.1.0",
@ -1384,9 +1385,9 @@
} }
}, },
"node_modules/@tauri-apps/api": { "node_modules/@tauri-apps/api": {
"version": "2.5.0", "version": "2.6.0",
"resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.5.0.tgz", "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.6.0.tgz",
"integrity": "sha512-Ldux4ip+HGAcPUmuLT8EIkk6yafl5vK0P0c0byzAKzxJh7vxelVtdPONjfgTm96PbN24yjZNESY8CKo8qniluA==", "integrity": "sha512-hRNcdercfgpzgFrMXWwNDBN0B7vNzOzRepy6ZAmhxi5mDLVPNrTpo9MGg2tN/F7JRugj4d2aF7E1rtPXAHaetg==",
"license": "Apache-2.0 OR MIT", "license": "Apache-2.0 OR MIT",
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@ -1616,6 +1617,15 @@
"@tauri-apps/api": "^2.0.0" "@tauri-apps/api": "^2.0.0"
} }
}, },
"node_modules/@tauri-apps/plugin-opener": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-opener/-/plugin-opener-2.4.0.tgz",
"integrity": "sha512-43VyN8JJtvKWJY72WI/KNZszTpDpzHULFxQs0CJBIYUdCRowQ6Q1feWTDb979N7nldqSuDOaBupZ6wz2nvuWwQ==",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@tauri-apps/api": "^2.6.0"
}
},
"node_modules/@types/estree": { "node_modules/@types/estree": {
"version": "1.0.7", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz",
@ -3840,9 +3850,9 @@
} }
}, },
"@tauri-apps/api": { "@tauri-apps/api": {
"version": "2.5.0", "version": "2.6.0",
"resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.5.0.tgz", "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.6.0.tgz",
"integrity": "sha512-Ldux4ip+HGAcPUmuLT8EIkk6yafl5vK0P0c0byzAKzxJh7vxelVtdPONjfgTm96PbN24yjZNESY8CKo8qniluA==" "integrity": "sha512-hRNcdercfgpzgFrMXWwNDBN0B7vNzOzRepy6ZAmhxi5mDLVPNrTpo9MGg2tN/F7JRugj4d2aF7E1rtPXAHaetg=="
}, },
"@tauri-apps/cli": { "@tauri-apps/cli": {
"version": "2.5.0", "version": "2.5.0",
@ -3956,6 +3966,14 @@
"@tauri-apps/api": "^2.0.0" "@tauri-apps/api": "^2.0.0"
} }
}, },
"@tauri-apps/plugin-opener": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-opener/-/plugin-opener-2.4.0.tgz",
"integrity": "sha512-43VyN8JJtvKWJY72WI/KNZszTpDpzHULFxQs0CJBIYUdCRowQ6Q1feWTDb979N7nldqSuDOaBupZ6wz2nvuWwQ==",
"requires": {
"@tauri-apps/api": "^2.6.0"
}
},
"@types/estree": { "@types/estree": {
"version": "1.0.7", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz",

@ -13,6 +13,7 @@
"@tailwindcss/vite": "^4.1.8", "@tailwindcss/vite": "^4.1.8",
"@tauri-apps/plugin-fs": "^2.3.0", "@tauri-apps/plugin-fs": "^2.3.0",
"@tauri-apps/plugin-http": "^2.4.4", "@tauri-apps/plugin-http": "^2.4.4",
"@tauri-apps/plugin-opener": "^2.4.0",
"gsap": "^3.13.0", "gsap": "^3.13.0",
"moment": "^2.30.1", "moment": "^2.30.1",
"react": "^19.1.0", "react": "^19.1.0",

@ -16,7 +16,8 @@
"description": "Guide for drink", "description": "Guide for drink",
"auto": true, "auto": true,
"audioFile": "assets/q2.mp3", "audioFile": "assets/q2.mp3",
"nextcue": 3 "nextcue": 3,
"status":"reset"
}, },
{ {
"id": 3, "id": 3,
@ -44,7 +45,7 @@
"auto": true, "auto": true,
"audioFile": "assets/q4-1.mp3", "audioFile": "assets/q4-1.mp3",
"nextcue": 4.2, "nextcue": 4.2,
"status":"go" "status":"intro"
}, },
{ {
"id": 4.2, "id": 4.2,
@ -53,7 +54,8 @@
"description": "chat", "description": "chat",
"auto": true, "auto": true,
"nextcue": 4.3, "nextcue": 4.3,
"duration": 60 "duration": 90,
"status":"go"
}, },
{ {
"id": 4.3, "id": 4.3,

@ -9,6 +9,9 @@
"voice_prompt":"Use a calm and expressive voice, soft and poetic in feeling, but with steady, natural rhythm — not slow.", "voice_prompt":"Use a calm and expressive voice, soft and poetic in feeling, but with steady, natural rhythm — not slow.",
"summary_prompt":"幫我把以下一段話整理成一段文字,以第一人稱視角作為當事人的文字紀念,文字內容 50 字以內:", "summary_prompt":"幫我把以下一段話整理成一段文字,以第一人稱視角作為當事人的文字紀念,文字內容 50 字以內:",
"speech_idle_time":3000 "speech_idle_time":3000,
"sd_prompt_prefix":"a hazy memory of a {{ ",
"sd_prompt_suffix":" }}, seen through soft atmospheric blur, distant silhouettes and faded contours, pastel light and cinematic haze, (analog film texture), (shallow depth of field:1.3), shallow depth of field, memory fragment effect, light leak, subtle grain, chromatic aberration, surreal glow, in muted warm tones, cinematic framing,",
"sd_negative_propmt":"photorealism, digital art, sharp details, hard edges, CGI, anime, cartoon, studio light"
} }

@ -1,12 +0,0 @@
added 1 package, and audited 148 packages in 3s
35 packages are looking for funding
run `npm fund` for details
1 low severity vulnerability
To address all issues, run:
npm audit fix
Run `npm audit` for details.

@ -104,6 +104,7 @@ dependencies = [
"tauri-plugin-fs", "tauri-plugin-fs",
"tauri-plugin-http", "tauri-plugin-http",
"tauri-plugin-log", "tauri-plugin-log",
"tauri-plugin-opener",
"tokio", "tokio",
"webview2-com", "webview2-com",
"windows", "windows",
@ -115,6 +116,139 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "async-broadcast"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
dependencies = [
"event-listener",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-channel"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
dependencies = [
"concurrent-queue",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-executor"
version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa"
dependencies = [
"async-task",
"concurrent-queue",
"fastrand",
"futures-lite",
"pin-project-lite",
"slab",
]
[[package]]
name = "async-io"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1237c0ae75a0f3765f58910ff9cdd0a12eeb39ab2f4c7de23262f337f0aacbb3"
dependencies = [
"async-lock",
"cfg-if",
"concurrent-queue",
"futures-io",
"futures-lite",
"parking",
"polling",
"rustix",
"slab",
"tracing",
"windows-sys 0.59.0",
]
[[package]]
name = "async-lock"
version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18"
dependencies = [
"event-listener",
"event-listener-strategy",
"pin-project-lite",
]
[[package]]
name = "async-process"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cde3f4e40e6021d7acffc90095cbd6dc54cb593903d1de5832f435eb274b85dc"
dependencies = [
"async-channel",
"async-io",
"async-lock",
"async-signal",
"async-task",
"blocking",
"cfg-if",
"event-listener",
"futures-lite",
"rustix",
"tracing",
]
[[package]]
name = "async-recursion"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
]
[[package]]
name = "async-signal"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7605a4e50d4b06df3898d5a70bf5fde51ed9059b0434b73105193bc27acce0d"
dependencies = [
"async-io",
"async-lock",
"atomic-waker",
"cfg-if",
"futures-core",
"futures-io",
"rustix",
"signal-hook-registry",
"slab",
"windows-sys 0.59.0",
]
[[package]]
name = "async-task"
version = "4.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
[[package]]
name = "async-trait"
version = "0.1.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
]
[[package]] [[package]]
name = "atk" name = "atk"
version = "0.18.2" version = "0.18.2"
@ -231,6 +365,19 @@ dependencies = [
"objc2 0.6.1", "objc2 0.6.1",
] ]
[[package]]
name = "blocking"
version = "1.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21"
dependencies = [
"async-channel",
"async-task",
"futures-io",
"futures-lite",
"piper",
]
[[package]] [[package]]
name = "borsh" name = "borsh"
version = "1.5.7" version = "1.5.7"
@ -473,6 +620,15 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "concurrent-queue"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
dependencies = [
"crossbeam-utils",
]
[[package]] [[package]]
name = "convert_case" name = "convert_case"
version = "0.4.0" version = "0.4.0"
@ -863,6 +1019,33 @@ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]]
name = "endi"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf"
[[package]]
name = "enumflags2"
version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
dependencies = [
"enumflags2_derive",
"serde",
]
[[package]]
name = "enumflags2_derive"
version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
]
[[package]] [[package]]
name = "env_filter" name = "env_filter"
version = "0.1.3" version = "0.1.3"
@ -889,6 +1072,43 @@ dependencies = [
"typeid", "typeid",
] ]
[[package]]
name = "errno"
version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
dependencies = [
"libc",
"windows-sys 0.59.0",
]
[[package]]
name = "event-listener"
version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae"
dependencies = [
"concurrent-queue",
"parking",
"pin-project-lite",
]
[[package]]
name = "event-listener-strategy"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
dependencies = [
"event-listener",
"pin-project-lite",
]
[[package]]
name = "fastrand"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]] [[package]]
name = "fdeflate" name = "fdeflate"
version = "0.3.7" version = "0.3.7"
@ -1017,6 +1237,19 @@ version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
[[package]]
name = "futures-lite"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532"
dependencies = [
"fastrand",
"futures-core",
"futures-io",
"parking",
"pin-project-lite",
]
[[package]] [[package]]
name = "futures-macro" name = "futures-macro"
version = "0.3.31" version = "0.3.31"
@ -1413,6 +1646,12 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
[[package]] [[package]]
name = "hex" name = "hex"
version = "0.4.3" version = "0.4.3"
@ -1730,6 +1969,25 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "is-docker"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3"
dependencies = [
"once_cell",
]
[[package]]
name = "is-wsl"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5"
dependencies = [
"is-docker",
"once_cell",
]
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "0.4.8" version = "0.4.8"
@ -1899,6 +2157,12 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "linux-raw-sys"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
[[package]] [[package]]
name = "litemap" name = "litemap"
version = "0.8.0" version = "0.8.0"
@ -2067,6 +2331,19 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
[[package]]
name = "nix"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
dependencies = [
"bitflags 2.9.1",
"cfg-if",
"cfg_aliases",
"libc",
"memoffset",
]
[[package]] [[package]]
name = "nodrop" name = "nodrop"
version = "0.1.14" version = "0.1.14"
@ -2357,12 +2634,34 @@ version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "open"
version = "5.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2483562e62ea94312f3576a7aca397306df7990b8d89033e18766744377ef95"
dependencies = [
"dunce",
"is-wsl",
"libc",
"pathdiff",
]
[[package]] [[package]]
name = "option-ext" name = "option-ext"
version = "0.2.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "ordered-stream"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
dependencies = [
"futures-core",
"pin-project-lite",
]
[[package]] [[package]]
name = "pango" name = "pango"
version = "0.18.3" version = "0.18.3"
@ -2388,6 +2687,12 @@ dependencies = [
"system-deps", "system-deps",
] ]
[[package]]
name = "parking"
version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
[[package]] [[package]]
name = "parking_lot" name = "parking_lot"
version = "0.12.4" version = "0.12.4"
@ -2411,6 +2716,12 @@ dependencies = [
"windows-targets 0.52.6", "windows-targets 0.52.6",
] ]
[[package]]
name = "pathdiff"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.3.1" version = "2.3.1"
@ -2563,6 +2874,17 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "piper"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"
dependencies = [
"atomic-waker",
"fastrand",
"futures-io",
]
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.32" version = "0.3.32"
@ -2595,6 +2917,21 @@ dependencies = [
"miniz_oxide", "miniz_oxide",
] ]
[[package]]
name = "polling"
version = "3.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b53a684391ad002dd6a596ceb6c74fd004fdce75f4be2e3f615068abbea5fd50"
dependencies = [
"cfg-if",
"concurrent-queue",
"hermit-abi",
"pin-project-lite",
"rustix",
"tracing",
"windows-sys 0.59.0",
]
[[package]] [[package]]
name = "potential_utf" name = "potential_utf"
version = "0.1.2" version = "0.1.2"
@ -3126,6 +3463,19 @@ dependencies = [
"semver", "semver",
] ]
[[package]]
name = "rustix"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8"
dependencies = [
"bitflags 2.9.1",
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.59.0",
]
[[package]] [[package]]
name = "rustls" name = "rustls"
version = "0.23.27" version = "0.23.27"
@ -3415,6 +3765,15 @@ version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "signal-hook-registry"
version = "1.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "simd-adler32" name = "simd-adler32"
version = "0.3.7" version = "0.3.7"
@ -3518,6 +3877,12 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "static_assertions"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]] [[package]]
name = "string_cache" name = "string_cache"
version = "0.8.9" version = "0.8.9"
@ -3903,6 +4268,28 @@ dependencies = [
"time", "time",
] ]
[[package]]
name = "tauri-plugin-opener"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b53b70b2c37c0183927f77b76ae2c4d3e0543b3c10f9fb4b3cd3b0c3f55ac542"
dependencies = [
"dunce",
"glob",
"objc2-app-kit",
"objc2-foundation 0.3.1",
"open",
"schemars",
"serde",
"serde_json",
"tauri",
"tauri-plugin",
"thiserror 2.0.12",
"url",
"windows",
"zbus",
]
[[package]] [[package]]
name = "tauri-runtime" name = "tauri-runtime"
version = "2.6.0" version = "2.6.0"
@ -4001,6 +4388,19 @@ dependencies = [
"toml", "toml",
] ]
[[package]]
name = "tempfile"
version = "3.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
dependencies = [
"fastrand",
"getrandom 0.3.3",
"once_cell",
"rustix",
"windows-sys 0.59.0",
]
[[package]] [[package]]
name = "tendril" name = "tendril"
version = "0.4.3" version = "0.4.3"
@ -4281,9 +4681,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
dependencies = [ dependencies = [
"pin-project-lite", "pin-project-lite",
"tracing-attributes",
"tracing-core", "tracing-core",
] ]
[[package]]
name = "tracing-attributes"
version = "0.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
]
[[package]] [[package]]
name = "tracing-core" name = "tracing-core"
version = "0.1.33" version = "0.1.33"
@ -4333,6 +4745,17 @@ version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
[[package]]
name = "uds_windows"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9"
dependencies = [
"memoffset",
"tempfile",
"winapi",
]
[[package]] [[package]]
name = "unic-char-property" name = "unic-char-property"
version = "0.9.0" version = "0.9.0"
@ -5183,6 +5606,66 @@ dependencies = [
"synstructure", "synstructure",
] ]
[[package]]
name = "zbus"
version = "5.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bb4f9a464286d42851d18a605f7193b8febaf5b0919d71c6399b7b26e5b0aad"
dependencies = [
"async-broadcast",
"async-executor",
"async-io",
"async-lock",
"async-process",
"async-recursion",
"async-task",
"async-trait",
"blocking",
"enumflags2",
"event-listener",
"futures-core",
"futures-lite",
"hex",
"nix",
"ordered-stream",
"serde",
"serde_repr",
"tracing",
"uds_windows",
"windows-sys 0.59.0",
"winnow 0.7.10",
"zbus_macros",
"zbus_names",
"zvariant",
]
[[package]]
name = "zbus_macros"
version = "5.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef9859f68ee0c4ee2e8cde84737c78e3f4c54f946f2a38645d0d4c7a95327659"
dependencies = [
"proc-macro-crate 3.3.0",
"proc-macro2",
"quote",
"syn 2.0.101",
"zbus_names",
"zvariant",
"zvariant_utils",
]
[[package]]
name = "zbus_names"
version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97"
dependencies = [
"serde",
"static_assertions",
"winnow 0.7.10",
"zvariant",
]
[[package]] [[package]]
name = "zerocopy" name = "zerocopy"
version = "0.8.25" version = "0.8.25"
@ -5262,3 +5745,44 @@ dependencies = [
"quote", "quote",
"syn 2.0.101", "syn 2.0.101",
] ]
[[package]]
name = "zvariant"
version = "5.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d91b3680bb339216abd84714172b5138a4edac677e641ef17e1d8cb1b3ca6e6f"
dependencies = [
"endi",
"enumflags2",
"serde",
"winnow 0.7.10",
"zvariant_derive",
"zvariant_utils",
]
[[package]]
name = "zvariant_derive"
version = "5.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a8c68501be459a8dbfffbe5d792acdd23b4959940fc87785fb013b32edbc208"
dependencies = [
"proc-macro-crate 3.3.0",
"proc-macro2",
"quote",
"syn 2.0.101",
"zvariant_utils",
]
[[package]]
name = "zvariant_utils"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e16edfee43e5d7b553b77872d99bc36afdda75c223ca7ad5e3fbecd82ca5fc34"
dependencies = [
"proc-macro2",
"quote",
"serde",
"static_assertions",
"syn 2.0.101",
"winnow 0.7.10",
]

@ -30,3 +30,4 @@ tokio = { version = "1.45.1", features = ["net"] }
webview2-com = "0.37.0" webview2-com = "0.37.0"
windows = "0.61.1" windows = "0.61.1"
tauri-plugin-fs = "2" tauri-plugin-fs = "2"
tauri-plugin-opener = "2"

@ -11,14 +11,26 @@
"core:app:default", "core:app:default",
"core:resources:default", "core:resources:default",
"core:webview:default", "core:webview:default",
{ {
"identifier": "http:default", "identifier": "http:default",
"allow": [ "allow": [
{ {
"url": "https://*.openai.com" "url": "https://*.openai.com"
},{ },
"url":"http://localhost:34800" {
"url": "http://localhost:34800"
}
]
},
"opener:allow-open-path",
{
"identifier": "opener:allow-open-path",
"allow": [
{
"path": "$APPDATA"
},
{
"path": "$APPDATA/**/*"
} }
] ]
}, },
@ -29,7 +41,15 @@
"fs:allow-exists", "fs:allow-exists",
{ {
"identifier": "fs:scope", "identifier": "fs:scope",
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**/*" }] "allow": [
{
"path": "$APPDATA"
},
{
"path": "$APPDATA/**/*"
} }
] ]
},
"opener:default"
]
} }

@ -50,7 +50,6 @@ async fn send_osc_message(
Ok(()) Ok(())
} }
#[tauri::command] #[tauri::command]
fn reset_permission(origin: &str, app: AppHandle) { fn reset_permission(origin: &str, app: AppHandle) {
let webview = app.get_webview_window("main").unwrap(); let webview = app.get_webview_window("main").unwrap();
@ -81,6 +80,7 @@ pub fn run() {
dotenv().ok(); dotenv().ok();
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_fs::init()) .plugin(tauri_plugin_fs::init())
.invoke_handler(tauri::generate_handler![ .invoke_handler(tauri::generate_handler![
get_env, get_env,

@ -13,8 +13,8 @@
"windows": [ "windows": [
{ {
"title": "theGreatTipsy", "title": "theGreatTipsy",
"width": 600, "width": 1200,
"height": 800, "height": 600,
"resizable": true, "resizable": true,
"fullscreen": false "fullscreen": false
} }

@ -8,5 +8,5 @@
} }
main{ main{
@apply flex-1 flex flex-col gap-4 justify-start p-8 overflow-y-auto; @apply flex-1 grid grid-cols-2 gap-4 justify-start p-8 overflow-hidden;
} }

@ -1,19 +1,28 @@
import { sendOsc, OSC_ADDRESS, updatePrompt } from "../util/osc" import { sendOsc, OSC_ADDRESS, updatePrompt } from "../util/osc"
import { useData } from '../util/useData.jsx';
const TEST_PROMPT='a hazy memory of a {{ Scene }}, seen through soft atmospheric blur, distant silhouettes and faded contours, pastel light and cinematic haze, (analog film texture), (shallow depth of field:1.3), shallow depth of field, memory fragment effect, light leak, subtle grain, chromatic aberration, surreal glow, in muted warm tones, cinematic framing,'; const TEST_PROMPT='a hazy memory of a {{ Scene }}, seen through soft atmospheric blur, distant silhouettes and faded contours, pastel light and cinematic haze, (analog film texture), (shallow depth of field:1.3), shallow depth of field, memory fragment effect, light leak, subtle grain, chromatic aberration, surreal glow, in muted warm tones, cinematic framing,';
export function DebugControl(){ export function DebugControl(){
const {data} = useData();
function sendPrompt(prompt_raw) {
console.log('Sending prompt:', prompt_raw);
const prompt = `${data?.sd_prompt_prefix || ''}${prompt_raw.replaceAll('"', '')}${data?.sd_prompt_suffix || ''}`;
updatePrompt(prompt);
}
return ( return (
<div className="flex flex-row gap-2 [&>button]:rounded-full [&>button]:bg-white bg-gray-200 p-2 w-full justify-center"> <div className="grid grid-cols-5 gap-2 [&>button]:rounded-full [&>button]:bg-white bg-gray-200 p-2 w-full justify-center">
<button onClick={() => sendOsc(OSC_ADDRESS.STATUS, 'reset')}>reset</button> <button onClick={() => sendOsc(OSC_ADDRESS.STATUS, 'reset')}>reset</button>
<button onClick={() => sendOsc(OSC_ADDRESS.STATUS, 'intro')}>intro</button>
<button onClick={() => sendOsc(OSC_ADDRESS.STATUS, 'go')}>go</button> <button onClick={() => sendOsc(OSC_ADDRESS.STATUS, 'go')}>go</button>
<button onClick={() => sendOsc(OSC_ADDRESS.STATUS, 'end')}>end</button> <button onClick={() => sendOsc(OSC_ADDRESS.STATUS, 'end')}>end</button>
<div className="flex flex-col gap-1"> <div className="flex flex-col gap-1">
<button className="btn btn-success" onClick={() => updatePrompt('Random dogs')}>Test Prompt</button> <button className="btn btn-success" onClick={() => sendPrompt('Random dogs')}>Test Prompt</button>
<button className="btn btn-success" onClick={() => updatePrompt(TEST_PROMPT)}>Test Prompt</button> <button className="btn btn-success" onClick={() => sendPrompt(TEST_PROMPT)}>Test Prompt</button>
</div> </div>
</div> </div>
) )

@ -309,9 +309,9 @@ export function Flow(){
return ( return (
<main className="items-center"> <main className="items-stretch">
<section className="flex-1 flex flex-col gap-2 self-stretch overflow-hidden">
<div className="w-full p-2 flex flex-row justify-center gap-2 *:w-[12vw] *:h-[12vw]"> <div className="w-full p-2 flex flex-row justify-center gap-2 *:w-[12vw] *:h-[4rem]">
<div className="bg-gray-100 text-4xl font-bold mb-4 flex justify-center items-center"> <div className="bg-gray-100 text-4xl font-bold mb-4 flex justify-center items-center">
{refCurrentCue.current?.name} {refCurrentCue.current?.name}
</div> </div>
@ -325,7 +325,7 @@ export function Flow(){
<Light ref={refLight} /> <Light ref={refLight} />
<VoiceAnalysis/> <VoiceAnalysis/>
</div> </div>
<div className=" max-h-[33vh] overflow-y-auto"> <div className="overflow-y-auto">
<table className="border-collapse **:border-y w-full **:p-2"> <table className="border-collapse **:border-y w-full **:p-2">
<thead> <thead>
<tr className="text-left"> <tr className="text-left">
@ -358,7 +358,8 @@ export function Flow(){
</tbody> </tbody>
</table> </table>
</div> </div>
<div className="flex-1 w-full overflow-y-auto flex flex-col gap-2"> </section>
<section className="flex-1 overflow-y-auto flex flex-col gap-2 justify-end">
<div className="flex-1 flex flex-col overflow-y-auto gap-2"> <div className="flex-1 flex flex-col overflow-y-auto gap-2">
{history?.map((msg, index) => ( {history?.map((msg, index) => (
<div key={index} className={`w-5/6 ${msg.role=='user'? 'self-end':''}`}> <div key={index} className={`w-5/6 ${msg.role=='user'? 'self-end':''}`}>
@ -387,7 +388,7 @@ export function Flow(){
<div className="rounded-2xl bg-gray-300 self-end px-4 tracking-widest">chat_status= {status}</div> <div className="rounded-2xl bg-gray-300 self-end px-4 tracking-widest">chat_status= {status}</div>
</div> </div>
</div> </section>
</main> </main>
); );
} }

@ -53,6 +53,7 @@ export function FreeFlow(){
const { history, status, reset, sendMessage, setStatus, audioOutput, setAudioOutput, stop:stopChat, audioUrl, }=useChat(); const { history, status, reset, sendMessage, setStatus, audioOutput, setAudioOutput, stop:stopChat, audioUrl, }=useChat();
const { const {
transcript, transcript,
finalTranscript, finalTranscript,
@ -62,6 +63,12 @@ export function FreeFlow(){
isMicrophoneAvailable, isMicrophoneAvailable,
}=useSpeechRecognition(); }=useSpeechRecognition();
function resetData() {
setSummary(null);
reset();
}
function playAudio(url){ function playAudio(url){
if(!url) return; if(!url) return;
@ -77,6 +84,7 @@ export function FreeFlow(){
console.error("Audio playback error:", error); console.error("Audio playback error:", error);
}); });
audio.onended = () => { audio.onended = () => {
if(refCurrentCue.current?.type!='chat') onCueEnd(); if(refCurrentCue.current?.type!='chat') onCueEnd();
else{ else{
@ -86,8 +94,11 @@ export function FreeFlow(){
refAudio.current = audio; // Store the new audio reference refAudio.current = audio; // Store the new audio reference
audio.addEventListener("loadedmetadata", () => { audio.addEventListener("loadedmetadata", () => {
if(refCurrentCue.current?.type!='chat') if(refCurrentCue.current?.type!='chat' && refCurrentCue.current?.type!='user_input') {
refTimer.current?.restart(audio.duration*1000 || 0); refTimer.current?.restart(audio.duration*1000 || 0);
}else{
setChatStatus(()=>ChatStatus.System);
}
}); });
} }
function playCue(cue) { function playCue(cue) {
@ -113,6 +124,7 @@ export function FreeFlow(){
console.log('Starting conversation...'); console.log('Starting conversation...');
sendMessage(); sendMessage();
setChatWelcome(true); setChatWelcome(true);
resetData(); // Reset data for new conversation
break; break;
case 'chat_end': case 'chat_end':
const message= refInput.current?.value?.trim(); const message= refInput.current?.value?.trim();
@ -135,6 +147,11 @@ export function FreeFlow(){
console.error('Error getting summary:', error); console.error('Error getting summary:', error);
}); });
break; break;
case 'user_input':
console.log('User input cue, setting chat status to User');
setChatStatus(ChatStatus.User); // Set chat status to User for user input cues
resetTranscript(); // Reset transcript for user input
break;
} }
@ -155,10 +172,10 @@ export function FreeFlow(){
if(cue.status){ if(cue.status){
sendOsc(OSC_ADDRESS.STATUS, cue.status); // Send OSC status message sendOsc(OSC_ADDRESS.STATUS, cue.status); // Send OSC status message
} }
if(cue.type=='chat'){ if(cue.type=='chat' || cue.type=='user_input') {
sendOsc(OSC_ADDRESS.COUNTDOWN, cue.duration || 0); // Send OSC countdown message sendOsc(OSC_ADDRESS.COUNTDOWN, cue.duration || '0'); // Send OSC countdown message
}else{ }else{
sendOsc(OSC_ADDRESS.COUNTDOWN, 0); // Reset countdown for non-chat cues sendOsc(OSC_ADDRESS.COUNTDOWN, '0'); // Reset countdown for non-chat cues
} }
} }
@ -321,9 +338,10 @@ export function FreeFlow(){
return ( return (
<main className="items-center"> <main className="items-start">
<section className="flex-1 flex flex-col gap-2 self-stretch overflow-hidden">
<DebugControl/> <DebugControl/>
<div className="w-full p-2 flex flex-row justify-center gap-2 *:w-[12vw] *:h-[12vw]"> <div className="w-full p-2 flex flex-row justify-center gap-2 *:w-[12vw] *:h-[5rem]">
<div className="bg-gray-100 text-4xl font-bold mb-4 flex justify-center items-center"> <div className="bg-gray-100 text-4xl font-bold mb-4 flex justify-center items-center">
{refCurrentCue.current?.name} {refCurrentCue.current?.name}
</div> </div>
@ -337,7 +355,7 @@ export function FreeFlow(){
<Light ref={refLight} /> <Light ref={refLight} />
<VoiceAnalysis/> <VoiceAnalysis/>
</div> </div>
<div className=" max-h-[33vh] overflow-y-auto"> <div className="flex-1 overflow-y-auto">
<table className="border-collapse **:border-y w-full **:p-2"> <table className="border-collapse **:border-y w-full **:p-2">
<thead> <thead>
<tr className="text-left"> <tr className="text-left">
@ -370,7 +388,8 @@ export function FreeFlow(){
</tbody> </tbody>
</table> </table>
</div> </div>
<div className="flex-1 w-full overflow-y-auto flex flex-col gap-2"> </section>
<section className="flex-1 self-stretch overflow-y-auto flex flex-col justify-end gap-2">
<div ref={refContainer} className="flex-1 flex flex-col overflow-y-auto gap-2"> <div ref={refContainer} className="flex-1 flex flex-col overflow-y-auto gap-2">
{history?.map((msg, index) => ( {history?.map((msg, index) => (
<div key={index} className={`w-5/6 ${msg.role=='user'? 'self-end':''}`}> <div key={index} className={`w-5/6 ${msg.role=='user'? 'self-end':''}`}>
@ -378,7 +397,7 @@ export function FreeFlow(){
{msg.prompt && <div className="text-xs bg-gray-200">{msg.prompt}</div>} {msg.prompt && <div className="text-xs bg-gray-200">{msg.prompt}</div>}
</div> </div>
))} ))}
{summary && <div className="w-full self-center bg-blue-200 px-2">{JSON.stringify(summary)}</div>} {summary && <div className="w-full self-center bg-blue-200 px-2">{summary?.result}</div>}
</div> </div>
<textarea ref={refInput} name="message" rows={2} <textarea ref={refInput} name="message" rows={2}
className={`w-full border-1 resize-none p-2 disabled:bg-gray-500`} className={`w-full border-1 resize-none p-2 disabled:bg-gray-500`}
@ -401,7 +420,7 @@ export function FreeFlow(){
<div className="rounded-2xl bg-gray-300 self-end px-4 tracking-widest">api_status= {status}</div> <div className="rounded-2xl bg-gray-300 self-end px-4 tracking-widest">api_status= {status}</div>
<div className="rounded-2xl bg-gray-300 self-end px-4 tracking-widest">chat_status= {chatStatus}</div> <div className="rounded-2xl bg-gray-300 self-end px-4 tracking-widest">chat_status= {chatStatus}</div>
</div> </div>
</div> </section>
</main> </main>
); );
} }

@ -1,8 +1,9 @@
import { useData } from '../util/useData.jsx'; import { useData } from '../util/useData.jsx';
export function Settings(){ export function Settings(){
const {data, read, write} = useData(); const {data, read, write, openFile} = useData();
function onSubmit(e){ function onSubmit(e){
e.preventDefault(); e.preventDefault();
@ -17,15 +18,19 @@ export function Settings(){
write(towrite); write(towrite);
} }
return ( return (
<div className="flex flex-col p-2 gap-4 overflow-y-auto min-h-full"> <main className="">
<form className='flex flex-col gap-4 flex-1' onSubmit={onSubmit}> <form className='flex flex-col gap-4 overflow-hidden' onSubmit={onSubmit}>
<div className='flex flex-row gap-2 self-end'> <div className='flex flex-row gap-2 self-end'>
<button type="button" onClick={read}>read</button> <button type="button" onClick={read}>read</button>
<button type="submit">write</button> <button type="submit">write</button>
<button type="button" onClick={openFile}>open</button>
</div> </div>
<div className='flex-1 overflow-y-auto'>
{data && Object.entries(data).map(([key, value], index) => ( {data && Object.entries(data).map(([key, value], index) => (
<div key={index} className='flex flex-col gap-1 flex-1'> <div key={index} className='flex flex-col gap-1 flex-1'>
<label className='bg-gray-200 self-start px-2'>{key}</label> <label className='bg-gray-200 self-start px-2'>{key}</label>
@ -36,8 +41,8 @@ export function Settings(){
)} )}
</div> </div>
))} ))}
</form>
</div> </div>
</form>
</main>
); );
} }

@ -4,6 +4,10 @@ import { sendOsc, OSC_ADDRESS, updatePrompt } from './osc';
import { invoke } from '@tauri-apps/api/core'; import { invoke } from '@tauri-apps/api/core';
import { useData } from './useData'; import { useData } from './useData';
const DELAY_SEND_PROMPT = 1000; // Delay in milliseconds before sending the prompt
async function getOpenAIToken() { async function getOpenAIToken() {
return invoke('get_env',{name:'OPENAI_API_KEY'}); return invoke('get_env',{name:'OPENAI_API_KEY'});
} }
@ -98,9 +102,16 @@ export async function sendChatMessage(messages, data, isLastMessage = false) {
const result=JSON.parse(choice.message.content); const result=JSON.parse(choice.message.content);
// send to python & unity // send to python & unity
const prompt = result.prompt?.replaceAll('"', ''); const rawPrompt = result.prompt?.replaceAll('"', '');
if(rawPrompt && rawPrompt.trim() !== '') {
const prompt = `${data?.sd_prompt_prefix || ''}${rawPrompt}${data?.sd_prompt_suffix || ''}`;
setTimeout(async ()=>{
await updatePrompt(prompt); await updatePrompt(prompt);
await sendOsc(OSC_ADDRESS.PROMPT, prompt); await sendOsc(OSC_ADDRESS.PROMPT, prompt);
}, DELAY_SEND_PROMPT);
}
// TODO: send to python // TODO: send to python

@ -2,6 +2,7 @@ import { createContext, useContext, useEffect, useState } from "react";
import { BaseDirectory, readTextFile, exists, writeTextFile, mkdir } from "@tauri-apps/plugin-fs"; import { BaseDirectory, readTextFile, exists, writeTextFile, mkdir } from "@tauri-apps/plugin-fs";
import { ParamKeys } from "./system_prompt"; import { ParamKeys } from "./system_prompt";
import { path } from '@tauri-apps/api'; import { path } from '@tauri-apps/api';
import { openPath } from '@tauri-apps/plugin-opener';
const dataContext=createContext(); const dataContext=createContext();
@ -84,6 +85,11 @@ export function DataProvider({children}) {
data, data,
read, read,
write, write,
openFile: async () => {
const folder = await path.appDataDir();
const file = await path.join(folder, filePath);
await openPath(file);
},
}}> }}>
{children} {children}
</dataContext.Provider> </dataContext.Provider>

Loading…
Cancel
Save