\ No newline at end of file
diff --git a/packages/kbot/gui/app/examples/api/src/views/FileSystem.svelte b/packages/kbot/gui/app/examples/api/src/views/FileSystem.svelte
new file mode 100644
index 00000000..fbec8628
--- /dev/null
+++ b/packages/kbot/gui/app/examples/api/src/views/FileSystem.svelte
@@ -0,0 +1,272 @@
+
+
+
+ {#if isMobile}
+
+ On mobile, paths outside of App* paths require the use of dialogs
+ regardless of Tauri's scope mechanism.
+
+ This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our
+ development process. In the future, this app will be used on Tauri's integration
+ tests.
+
diff --git a/packages/kbot/gui/app/examples/api/unocss.config.js b/packages/kbot/gui/app/examples/api/unocss.config.js
new file mode 100644
index 00000000..d2069a49
--- /dev/null
+++ b/packages/kbot/gui/app/examples/api/unocss.config.js
@@ -0,0 +1,100 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import { defineConfig, presetIcons, presetUno, presetWebFonts } from 'unocss'
+import extractorSvelte from '@unocss/extractor-svelte'
+
+export default defineConfig({
+ theme: {
+ colors: {
+ primary: '#FFFFFF',
+ primaryLighter: '#e9ecef',
+ darkPrimary: '#1B1B1D',
+ darkPrimaryLighter: '#242526',
+ primaryText: '#1C1E21',
+ darkPrimaryText: '#E3E3E3',
+ secondaryText: '#858A91',
+ darkSecondaryText: '#C2C5CA',
+ accent: '#3578E5',
+ accentDark: '#306cce',
+ accentDarker: '#2d66c3',
+ accentDarkest: '#2554a0',
+ accentLight: '#538ce9',
+ accentLighter: '#72a1ed',
+ accentLightest: '#9abcf2',
+ accentText: '#FFFFFF',
+ darkAccent: '#67d6ed',
+ darkAccentDark: '#49cee9',
+ darkAccentDarker: '#39cae8',
+ darkAccentDarkest: '#19b5d5',
+ darkAccentLight: '#85def1',
+ darkAccentLighter: '#95e2f2',
+ darkAccentLightest: '#c2eff8',
+ darkAccentText: '#1C1E21',
+ code: '#d6d8da',
+ codeDark: '#282a2e',
+ hoverOverlay: 'rgba(0,0,0,.05)',
+ hoverOverlayDarker: 'rgba(0,0,0,.1)',
+ darkHoverOverlay: 'hsla(0,0%,100%,.05)',
+ darkHoverOverlayDarker: 'hsla(0,0%,100%,.1)'
+ }
+ },
+ preflights: [
+ {
+ getCSS: ({ theme }) => `
+ ::-webkit-scrollbar-thumb {
+ background-color: ${theme.colors.accent};
+ }
+
+ .dark ::-webkit-scrollbar-thumb {
+ background-color: ${theme.colors.darkAccent};
+ }
+
+ code {
+ font-size: ${theme.fontSize.xs[0]};
+ font-family: ${theme.fontFamily.mono};
+ border-radius: ${theme.borderRadius['DEFAULT']};
+ background-color: ${theme.colors.code};
+ }
+
+ .code-block {
+ font-family: ${theme.fontFamily.mono};
+ font-size: ${theme.fontSize.sm[0]};
+ }
+
+ .dark code {
+ background-color: ${theme.colors.codeDark};
+ }
+ `
+ }
+ ],
+ shortcuts: {
+ btn: `select-none outline-none shadow-md p-2 rd-1 text-primaryText border-none font-400 dark:font-600
+ bg-accent hover:bg-accentDarker active:bg-accentDarkest text-accentText
+ dark:bg-darkAccent dark:hover:bg-darkAccentDarker dark:active:bg-darkAccentDarkest dark:text-darkAccentText`,
+ nv: `decoration-none flex items-center relative p-2 rd-1 transition-all-125 ease
+ text-darkSecondaryText
+ hover:text-accent dark:hover:text-darkAccent
+ hover:bg-darkHoverOverlay hover:border-l-4`,
+ nv_selected: `nv bg-darkHoverOverlay text-accent dark:text-darkAccent border-l-4`,
+ note: `decoration-none flex-inline items-center relative p-2 rd-1
+ border-l-4 border-accent dark:border-darkAccent
+ bg-accent/10 dark:bg-darkAccent/10`,
+ 'note-red':
+ 'note bg-red-700/10 dark:bg-red-700/10 after:bg-red-700 dark:after:bg-red-700',
+ input:
+ 'h-10 flex items-center outline-none border-none p-2 rd-1 shadow-md bg-primaryLighter dark:bg-darkPrimaryLighter text-primaryText dark:text-darkPrimaryText'
+ },
+ presets: [
+ presetUno(),
+ presetIcons(),
+ presetWebFonts({
+ fonts: {
+ sans: 'Rubik',
+ mono: ['Fira Code', 'Fira Mono:400,700']
+ }
+ })
+ ],
+ extractors: [extractorSvelte]
+})
diff --git a/packages/kbot/gui/app/examples/api/vite.config.js b/packages/kbot/gui/app/examples/api/vite.config.js
new file mode 100644
index 00000000..f7d87db8
--- /dev/null
+++ b/packages/kbot/gui/app/examples/api/vite.config.js
@@ -0,0 +1,34 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import { defineConfig } from 'vite'
+import Unocss from 'unocss/vite'
+import { svelte } from '@sveltejs/vite-plugin-svelte'
+import process from 'process'
+
+const host = process.env.TAURI_DEV_HOST
+
+// https://vitejs.dev/config/
+export default defineConfig(async () => {
+ return {
+ plugins: [Unocss(), svelte()],
+ build: {
+ rollupOptions: {
+ output: {
+ entryFileNames: `assets/[name].js`,
+ chunkFileNames: `assets/[name].js`,
+ assetFileNames: `assets/[name].[ext]`
+ }
+ }
+ },
+ server: {
+ host: host || false,
+ port: 5173,
+ strictPort: true,
+ fs: {
+ allow: ['.', '../../tooling/api/dist']
+ }
+ }
+ }
+})
diff --git a/packages/kbot/gui/app/package.json b/packages/kbot/gui/app/package.json
new file mode 100644
index 00000000..91f55916
--- /dev/null
+++ b/packages/kbot/gui/app/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "plugins-workspace",
+ "private": true,
+ "license": "MIT OR Apache-2.0",
+ "type": "module",
+ "scripts": {
+ "build": "pnpm run -r --parallel --filter !plugins-workspace --filter !\"./plugins/*/examples/**\" --filter !\"./examples/*\" build",
+ "lint": "eslint .",
+ "format": "prettier --write .",
+ "format:check": "prettier --check .",
+ "example:api:dev": "pnpm run --filter \"api\" tauri dev"
+ },
+ "devDependencies": {
+ "@eslint/js": "9.35.0",
+ "@rollup/plugin-node-resolve": "16.0.1",
+ "@rollup/plugin-terser": "0.4.4",
+ "@rollup/plugin-typescript": "12.1.4",
+ "covector": "^0.12.4",
+ "eslint": "9.35.0",
+ "eslint-config-prettier": "10.1.8",
+ "eslint-plugin-security": "3.0.1",
+ "prettier": "3.6.2",
+ "rollup": "4.50.1",
+ "tslib": "2.8.1",
+ "typescript": "5.9.2",
+ "typescript-eslint": "8.42.0"
+ },
+ "pnpm": {
+ "overrides": {
+ "esbuild@<0.25.0": ">=0.25.0"
+ },
+ "onlyBuiltDependencies": [
+ "esbuild"
+ ]
+ },
+ "engines": {
+ "pnpm": "^10.0.0"
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/autostart/CHANGELOG.md b/packages/kbot/gui/app/plugins/autostart/CHANGELOG.md
new file mode 100644
index 00000000..a14a40e1
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/CHANGELOG.md
@@ -0,0 +1,106 @@
+# Changelog
+
+## \[2.5.0]
+
+- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+
+## \[2.4.0]
+
+- [`764e8f77`](https://github.com/tauri-apps/plugins-workspace/commit/764e8f7719247da515243d9c9cafa6d087d21769) ([#2707](https://github.com/tauri-apps/plugins-workspace/pull/2707)) Added a new builder method app_name() to allow customizing the application name in the autostart entry.
+
+## \[2.3.0]
+
+- [`8ecb418a`](https://github.com/tauri-apps/plugins-workspace/commit/8ecb418a1a35d7f234dc5d833746ac2d8e062aec) ([#2569](https://github.com/tauri-apps/plugins-workspace/pull/2569)) Add a `Builder` for more flexible settings
+
+## \[2.2.0]
+
+- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
+
+## \[2.0.1]
+
+- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
+
+## \[2.0.0]
+
+- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+
+## \[2.0.0-rc.1]
+
+- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8
+
+## \[2.0.0-rc.0]
+
+- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC.
+
+## \[2.0.0-beta.8]
+
+- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version.
+- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25.
+
+## \[2.0.0-beta.7]
+
+- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24.
+
+## \[2.0.0-beta.6]
+
+- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23.
+
+## \[2.0.0-beta.5]
+
+- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22.
+
+## \[2.0.0-beta.4]
+
+- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20.
+
+## \[2.0.0-beta.3]
+
+- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17.
+
+## \[2.0.0-beta.4]
+
+- [`a233919`](https://github.com/tauri-apps/plugins-workspace/commit/a2339195aa940bff86d76375fd05087595bf06ce)([#1118](https://github.com/tauri-apps/plugins-workspace/pull/1118)) Fix LaunchAgent-based autostart for macOS.
+
+## \[2.0.0-beta.3]
+
+- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
+
+## \[2.0.0-beta.2]
+
+- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
+
+## \[2.0.0-beta.1]
+
+- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
+
+## \[2.0.0-beta.0]
+
+- [`d198c01`](https://github.com/tauri-apps/plugins-workspace/commit/d198c014863ee260cb0de88a14b7fc4356ef7474)([#862](https://github.com/tauri-apps/plugins-workspace/pull/862)) Update to tauri beta.
+
+## \[2.0.0-alpha.5]
+
+- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.13.
+
+## \[2.0.0-alpha.4]
+
+- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.12.
+
+## \[2.0.0-alpha.3]
+
+- [`e438e0a`](https://github.com/tauri-apps/plugins-workspace/commit/e438e0a62d4b430a5159f05f13ecd397dd891a0d)([#676](https://github.com/tauri-apps/plugins-workspace/pull/676)) Update to @tauri-apps/api v2.0.0-alpha.11.
+
+## \[2.0.0-alpha.2]
+
+- [`5c13736`](https://github.com/tauri-apps/plugins-workspace/commit/5c137365c60790e8d4037d449e8237aa3fffdab0)([#673](https://github.com/tauri-apps/plugins-workspace/pull/673)) Update to @tauri-apps/api v2.0.0-alpha.9.
+
+## \[2.0.0-alpha.2]
+
+- [`4e2cef9`](https://github.com/tauri-apps/plugins-workspace/commit/4e2cef9b702bbbb9cf4ee17de50791cb21f1b2a4)([#593](https://github.com/tauri-apps/plugins-workspace/pull/593)) Update to alpha.12.
+
+## \[2.0.0-alpha.1]
+
+- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
+
+## \[2.0.0-alpha.0]
+
+- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
diff --git a/packages/kbot/gui/app/plugins/autostart/Cargo.toml b/packages/kbot/gui/app/plugins/autostart/Cargo.toml
new file mode 100644
index 00000000..5a0f0395
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/Cargo.toml
@@ -0,0 +1,31 @@
+[package]
+name = "tauri-plugin-autostart"
+version = "2.5.0"
+description = "Automatically launch your application at startup."
+authors = { workspace = true }
+license = { workspace = true }
+edition = { workspace = true }
+rust-version = { workspace = true }
+repository = { workspace = true }
+links = "tauri-plugin-autostart"
+
+[package.metadata.docs.rs]
+rustc-args = ["--cfg", "docsrs"]
+rustdoc-args = ["--cfg", "docsrs"]
+
+[package.metadata.platforms.support]
+windows = { level = "full", notes = "" }
+linux = { level = "full", notes = "" }
+macos = { level = "full", notes = "" }
+android = { level = "none", notes = "" }
+ios = { level = "none", notes = "" }
+
+[build-dependencies]
+tauri-plugin = { workspace = true, features = ["build"] }
+
+[dependencies]
+serde = { workspace = true }
+serde_json = { workspace = true }
+tauri = { workspace = true }
+thiserror = { workspace = true }
+auto-launch = "0.5"
diff --git a/packages/kbot/gui/app/plugins/autostart/LICENSE.spdx b/packages/kbot/gui/app/plugins/autostart/LICENSE.spdx
new file mode 100644
index 00000000..cdd0df5a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/LICENSE.spdx
@@ -0,0 +1,20 @@
+SPDXVersion: SPDX-2.1
+DataLicense: CC0-1.0
+PackageName: tauri
+DataFormat: SPDXRef-1
+PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
+PackageHomePage: https://tauri.app
+PackageLicenseDeclared: Apache-2.0
+PackageLicenseDeclared: MIT
+PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy
+PackageSummary: Tauri is a rust project that enables developers to make secure
+and small desktop applications using a web frontend.
+
+PackageComment: The package includes the following libraries; see
+Relationship information.
+
+Created: 2019-05-20T09:00:00Z
+PackageDownloadLocation: git://github.com/tauri-apps/tauri
+PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git
+PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git
+Creator: Person: Daniel Thompson-Yvetot
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/autostart/LICENSE_APACHE-2.0 b/packages/kbot/gui/app/plugins/autostart/LICENSE_APACHE-2.0
new file mode 100644
index 00000000..4947287f
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/LICENSE_APACHE-2.0
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/autostart/LICENSE_MIT b/packages/kbot/gui/app/plugins/autostart/LICENSE_MIT
new file mode 100644
index 00000000..4d754725
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/LICENSE_MIT
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 - Present Tauri Apps Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/autostart/README.md b/packages/kbot/gui/app/plugins/autostart/README.md
new file mode 100644
index 00000000..f9f9dce1
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/README.md
@@ -0,0 +1,98 @@
+
+
+Automatically launch your application at startup.
+
+| Platform | Supported |
+| -------- | --------- |
+| Linux | ✓ |
+| Windows | ✓ |
+| macOS | ✓ |
+| Android | x |
+| iOS | x |
+
+## Install
+
+_This plugin requires a Rust version of at least **1.77.2**_
+
+There are three general methods of installation that we can recommend.
+
+1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
+2. Pull sources directly from Github using git tags / revision hashes (most secure)
+3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)
+
+Install the Core plugin by adding the following to your `Cargo.toml` file:
+
+`src-tauri/Cargo.toml`
+
+```toml
+[dependencies]
+tauri-plugin-autostart = "2.0.0"
+# alternatively with Git:
+tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
+```
+
+You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
+
+```sh
+pnpm add @tauri-apps/plugin-autostart
+# or
+npm add @tauri-apps/plugin-autostart
+# or
+yarn add @tauri-apps/plugin-autostart
+```
+
+## Usage
+
+First you need to register the core plugin with Tauri:
+
+`src-tauri/src/lib.rs`
+
+```rust
+fn main() {
+ tauri::Builder::default()
+ .plugin(tauri_plugin_autostart::Builder::new()
+ .args(["--flag1", "--flag2"])
+ .app_name("My Custom Name")
+ .build())
+ .run(tauri::generate_context!())
+ .expect("error while running tauri application");
+}
+```
+
+Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
+
+```javascript
+import { enable, isEnabled, disable } from '@tauri-apps/plugin-autostart'
+
+await enable()
+
+console.log(`registered for autostart? ${await isEnabled()}`)
+
+disable()
+```
+
+## Contributing
+
+PRs accepted. Please make sure to read the Contributing Guide before making a pull request.
+
+## Partners
+
+
+
+For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri).
+
+## License
+
+Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.
+
+MIT or MIT/Apache 2.0 where applicable.
diff --git a/packages/kbot/gui/app/plugins/autostart/SECURITY.md b/packages/kbot/gui/app/plugins/autostart/SECURITY.md
new file mode 100644
index 00000000..4f09bbac
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/SECURITY.md
@@ -0,0 +1,23 @@
+# Security Policy
+
+**Do not report security vulnerabilities through public GitHub issues.**
+
+**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.**
+
+Include as much of the following information:
+
+- Type of issue (e.g. improper input parsing, privilege escalation, etc.)
+- The location of the affected source code (tag/branch/commit or direct URL)
+- Any special configuration required to reproduce the issue
+- The distribution affected or used to help us with reproduction of the issue
+- Step-by-step instructions to reproduce the issue
+- Ideally a reproduction repository
+- Impact of the issue, including how an attacker might exploit the issue
+
+We prefer to receive reports in English.
+
+## Contact
+
+Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new).
+
+Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
diff --git a/packages/kbot/gui/app/plugins/autostart/api-iife.js b/packages/kbot/gui/app/plugins/autostart/api-iife.js
new file mode 100644
index 00000000..77a12c92
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/api-iife.js
@@ -0,0 +1 @@
+if("__TAURI__"in window){var __TAURI_PLUGIN_AUTOSTART__=function(n){"use strict";async function t(n,t={},a){return window.__TAURI_INTERNALS__.invoke(n,t,a)}return"function"==typeof SuppressedError&&SuppressedError,n.disable=async function(){await t("plugin:autostart|disable")},n.enable=async function(){await t("plugin:autostart|enable")},n.isEnabled=async function(){return await t("plugin:autostart|is_enabled")},n}({});Object.defineProperty(window.__TAURI__,"autostart",{value:__TAURI_PLUGIN_AUTOSTART__})}
diff --git a/packages/kbot/gui/app/plugins/autostart/banner.png b/packages/kbot/gui/app/plugins/autostart/banner.png
new file mode 100644
index 00000000..952d552a
Binary files /dev/null and b/packages/kbot/gui/app/plugins/autostart/banner.png differ
diff --git a/packages/kbot/gui/app/plugins/autostart/build.rs b/packages/kbot/gui/app/plugins/autostart/build.rs
new file mode 100644
index 00000000..1460469b
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/build.rs
@@ -0,0 +1,11 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"];
+
+fn main() {
+ tauri_plugin::Builder::new(COMMANDS)
+ .global_api_script_path("./api-iife.js")
+ .build();
+}
diff --git a/packages/kbot/gui/app/plugins/autostart/guest-js/index.ts b/packages/kbot/gui/app/plugins/autostart/guest-js/index.ts
new file mode 100644
index 00000000..fca8344f
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/guest-js/index.ts
@@ -0,0 +1,17 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import { invoke } from '@tauri-apps/api/core'
+
+export async function isEnabled(): Promise {
+ return await invoke('plugin:autostart|is_enabled')
+}
+
+export async function enable(): Promise {
+ await invoke('plugin:autostart|enable')
+}
+
+export async function disable(): Promise {
+ await invoke('plugin:autostart|disable')
+}
diff --git a/packages/kbot/gui/app/plugins/autostart/package.json b/packages/kbot/gui/app/plugins/autostart/package.json
new file mode 100644
index 00000000..5f3d2adf
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "@tauri-apps/plugin-autostart",
+ "version": "2.5.0",
+ "license": "MIT OR Apache-2.0",
+ "authors": [
+ "Tauri Programme within The Commons Conservancy"
+ ],
+ "repository": "https://github.com/tauri-apps/plugins-workspace",
+ "type": "module",
+ "types": "./dist-js/index.d.ts",
+ "main": "./dist-js/index.cjs",
+ "module": "./dist-js/index.js",
+ "exports": {
+ "types": "./dist-js/index.d.ts",
+ "import": "./dist-js/index.js",
+ "require": "./dist-js/index.cjs"
+ },
+ "scripts": {
+ "build": "rollup -c"
+ },
+ "files": [
+ "dist-js",
+ "README.md",
+ "LICENSE"
+ ],
+ "dependencies": {
+ "@tauri-apps/api": "^2.8.0"
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/commands/disable.toml b/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/commands/disable.toml
new file mode 100644
index 00000000..849c50a2
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/commands/disable.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-disable"
+description = "Enables the disable command without any pre-configured scope."
+commands.allow = ["disable"]
+
+[[permission]]
+identifier = "deny-disable"
+description = "Denies the disable command without any pre-configured scope."
+commands.deny = ["disable"]
diff --git a/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/commands/enable.toml b/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/commands/enable.toml
new file mode 100644
index 00000000..f931a9e5
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/commands/enable.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-enable"
+description = "Enables the enable command without any pre-configured scope."
+commands.allow = ["enable"]
+
+[[permission]]
+identifier = "deny-enable"
+description = "Denies the enable command without any pre-configured scope."
+commands.deny = ["enable"]
diff --git a/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/commands/is_enabled.toml b/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/commands/is_enabled.toml
new file mode 100644
index 00000000..88a6a282
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/commands/is_enabled.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-is-enabled"
+description = "Enables the is_enabled command without any pre-configured scope."
+commands.allow = ["is_enabled"]
+
+[[permission]]
+identifier = "deny-is-enabled"
+description = "Denies the is_enabled command without any pre-configured scope."
+commands.deny = ["is_enabled"]
diff --git a/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/reference.md b/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/reference.md
new file mode 100644
index 00000000..50bc1a94
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/permissions/autogenerated/reference.md
@@ -0,0 +1,104 @@
+## Default Permission
+
+This permission set configures if your
+application can enable or disable auto
+starting the application on boot.
+
+#### Granted Permissions
+
+It allows all to check, enable and
+disable the automatic start on boot.
+
+#### This default permission set includes the following:
+
+- `allow-enable`
+- `allow-disable`
+- `allow-is-enabled`
+
+## Permission Table
+
+
+
+
Identifier
+
Description
+
+
+
+
+
+
+`autostart:allow-disable`
+
+
+
+
+Enables the disable command without any pre-configured scope.
+
+
+
+
+
+
+
+`autostart:deny-disable`
+
+
+
+
+Denies the disable command without any pre-configured scope.
+
+
+
+
+
+
+
+`autostart:allow-enable`
+
+
+
+
+Enables the enable command without any pre-configured scope.
+
+
+
+
+
+
+
+`autostart:deny-enable`
+
+
+
+
+Denies the enable command without any pre-configured scope.
+
+
+
+
+
+
+
+`autostart:allow-is-enabled`
+
+
+
+
+Enables the is_enabled command without any pre-configured scope.
+
+
+
+
+
+
+
+`autostart:deny-is-enabled`
+
+
+
+
+Denies the is_enabled command without any pre-configured scope.
+
+
+
+
diff --git a/packages/kbot/gui/app/plugins/autostart/permissions/default.toml b/packages/kbot/gui/app/plugins/autostart/permissions/default.toml
new file mode 100644
index 00000000..a2ac766f
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/permissions/default.toml
@@ -0,0 +1,15 @@
+"$schema" = "schemas/schema.json"
+[default]
+description = """
+This permission set configures if your
+application can enable or disable auto
+starting the application on boot.
+
+#### Granted Permissions
+
+It allows all to check, enable and
+disable the automatic start on boot.
+
+"""
+
+permissions = ["allow-enable", "allow-disable", "allow-is-enabled"]
diff --git a/packages/kbot/gui/app/plugins/autostart/permissions/schemas/schema.json b/packages/kbot/gui/app/plugins/autostart/permissions/schemas/schema.json
new file mode 100644
index 00000000..af681221
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/permissions/schemas/schema.json
@@ -0,0 +1,342 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "PermissionFile",
+ "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.",
+ "type": "object",
+ "properties": {
+ "default": {
+ "description": "The default permission set for the plugin",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/DefaultPermission"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "set": {
+ "description": "A list of permissions sets defined",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionSet"
+ }
+ },
+ "permission": {
+ "description": "A list of inlined permissions",
+ "default": [],
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Permission"
+ }
+ }
+ },
+ "definitions": {
+ "DefaultPermission": {
+ "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+ "type": "object",
+ "required": [
+ "permissions"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "PermissionSet": {
+ "description": "A set of direct permissions grouped together under a new name.",
+ "type": "object",
+ "required": [
+ "description",
+ "identifier",
+ "permissions"
+ ],
+ "properties": {
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does.",
+ "type": "string"
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionKind"
+ }
+ }
+ }
+ },
+ "Permission": {
+ "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
+ "type": "object",
+ "required": [
+ "identifier"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri internal convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "commands": {
+ "description": "Allowed or denied commands when using this permission.",
+ "default": {
+ "allow": [],
+ "deny": []
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/Commands"
+ }
+ ]
+ },
+ "scope": {
+ "description": "Allowed or denied scoped when using this permission.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Scopes"
+ }
+ ]
+ },
+ "platforms": {
+ "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Target"
+ }
+ }
+ }
+ },
+ "Commands": {
+ "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Allowed command.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "deny": {
+ "description": "Denied command, which takes priority.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "Scopes": {
+ "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Data that defines what is allowed by the scope.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ "deny": {
+ "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ }
+ },
+ "Value": {
+ "description": "All supported ACL values.",
+ "anyOf": [
+ {
+ "description": "Represents a null JSON value.",
+ "type": "null"
+ },
+ {
+ "description": "Represents a [`bool`].",
+ "type": "boolean"
+ },
+ {
+ "description": "Represents a valid ACL [`Number`].",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Number"
+ }
+ ]
+ },
+ {
+ "description": "Represents a [`String`].",
+ "type": "string"
+ },
+ {
+ "description": "Represents a list of other [`Value`]s.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ {
+ "description": "Represents a map of [`String`] keys to [`Value`]s.",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ ]
+ },
+ "Number": {
+ "description": "A valid ACL number.",
+ "anyOf": [
+ {
+ "description": "Represents an [`i64`].",
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "description": "Represents a [`f64`].",
+ "type": "number",
+ "format": "double"
+ }
+ ]
+ },
+ "Target": {
+ "description": "Platform target.",
+ "oneOf": [
+ {
+ "description": "MacOS.",
+ "type": "string",
+ "enum": [
+ "macOS"
+ ]
+ },
+ {
+ "description": "Windows.",
+ "type": "string",
+ "enum": [
+ "windows"
+ ]
+ },
+ {
+ "description": "Linux.",
+ "type": "string",
+ "enum": [
+ "linux"
+ ]
+ },
+ {
+ "description": "Android.",
+ "type": "string",
+ "enum": [
+ "android"
+ ]
+ },
+ {
+ "description": "iOS.",
+ "type": "string",
+ "enum": [
+ "iOS"
+ ]
+ }
+ ]
+ },
+ "PermissionKind": {
+ "type": "string",
+ "oneOf": [
+ {
+ "description": "Enables the disable command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-disable",
+ "markdownDescription": "Enables the disable command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the disable command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-disable",
+ "markdownDescription": "Denies the disable command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the enable command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-enable",
+ "markdownDescription": "Enables the enable command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the enable command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-enable",
+ "markdownDescription": "Denies the enable command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the is_enabled command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-is-enabled",
+ "markdownDescription": "Enables the is_enabled command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the is_enabled command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-is-enabled",
+ "markdownDescription": "Denies the is_enabled command without any pre-configured scope."
+ },
+ {
+ "description": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`",
+ "type": "string",
+ "const": "default",
+ "markdownDescription": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`"
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/autostart/rollup.config.js b/packages/kbot/gui/app/plugins/autostart/rollup.config.js
new file mode 100644
index 00000000..1f349ec8
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/rollup.config.js
@@ -0,0 +1,7 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import { createConfig } from '../../shared/rollup.config.js'
+
+export default createConfig()
diff --git a/packages/kbot/gui/app/plugins/autostart/src/lib.rs b/packages/kbot/gui/app/plugins/autostart/src/lib.rs
new file mode 100644
index 00000000..4b4c7c23
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/src/lib.rs
@@ -0,0 +1,250 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+//! Automatically launch your application at startup. Supports Windows, Mac (via AppleScript or Launch Agent), and Linux.
+
+#![doc(
+ html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
+ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
+)]
+#![cfg(not(any(target_os = "android", target_os = "ios")))]
+
+use auto_launch::{AutoLaunch, AutoLaunchBuilder};
+use serde::{ser::Serializer, Serialize};
+use tauri::{
+ command,
+ plugin::{Builder as PluginBuilder, TauriPlugin},
+ Manager, Runtime, State,
+};
+
+use std::env::current_exe;
+
+type Result = std::result::Result;
+
+#[derive(Debug, Default, Copy, Clone)]
+pub enum MacosLauncher {
+ #[default]
+ LaunchAgent,
+ AppleScript,
+}
+
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+ #[error(transparent)]
+ Io(#[from] std::io::Error),
+ #[error("{0}")]
+ Anyhow(String),
+}
+
+impl Serialize for Error {
+ fn serialize(&self, serializer: S) -> std::result::Result
+ where
+ S: Serializer,
+ {
+ serializer.serialize_str(self.to_string().as_ref())
+ }
+}
+
+pub struct AutoLaunchManager(AutoLaunch);
+
+impl AutoLaunchManager {
+ pub fn enable(&self) -> Result<()> {
+ self.0
+ .enable()
+ .map_err(|e| e.to_string())
+ .map_err(Error::Anyhow)
+ }
+
+ pub fn disable(&self) -> Result<()> {
+ self.0
+ .disable()
+ .map_err(|e| e.to_string())
+ .map_err(Error::Anyhow)
+ }
+
+ pub fn is_enabled(&self) -> Result {
+ self.0
+ .is_enabled()
+ .map_err(|e| e.to_string())
+ .map_err(Error::Anyhow)
+ }
+}
+
+pub trait ManagerExt {
+ /// TODO: Rename these to `autostart` or `auto_start` in v3
+ fn autolaunch(&self) -> State<'_, AutoLaunchManager>;
+}
+
+impl> ManagerExt for T {
+ /// TODO: Rename these to `autostart` or `auto_start` in v3
+ fn autolaunch(&self) -> State<'_, AutoLaunchManager> {
+ self.state::()
+ }
+}
+
+#[command]
+async fn enable(manager: State<'_, AutoLaunchManager>) -> Result<()> {
+ manager.enable()
+}
+
+#[command]
+async fn disable(manager: State<'_, AutoLaunchManager>) -> Result<()> {
+ manager.disable()
+}
+
+#[command]
+async fn is_enabled(manager: State<'_, AutoLaunchManager>) -> Result {
+ manager.is_enabled()
+}
+
+#[derive(Default)]
+pub struct Builder {
+ #[cfg(target_os = "macos")]
+ macos_launcher: MacosLauncher,
+ args: Vec,
+ app_name: Option,
+}
+
+impl Builder {
+ /// Create a new auto start builder with default settings
+ pub fn new() -> Self {
+ Self::default()
+ }
+
+ /// Adds an argument to pass to your app on startup.
+ ///
+ /// ## Examples
+ ///
+ /// ```no_run
+ /// Builder::new()
+ /// .arg("--from-autostart")
+ /// .arg("--hey")
+ /// .build();
+ /// ```
+ pub fn arg>(mut self, arg: S) -> Self {
+ self.args.push(arg.into());
+ self
+ }
+
+ /// Adds multiple arguments to pass to your app on startup.
+ ///
+ /// ## Examples
+ ///
+ /// ```no_run
+ /// Builder::new()
+ /// .args(["--from-autostart", "--hey"])
+ /// .build();
+ /// ```
+ pub fn args(mut self, args: I) -> Self
+ where
+ I: IntoIterator,
+ S: Into,
+ {
+ for arg in args {
+ self = self.arg(arg);
+ }
+ self
+ }
+
+ /// Sets whether to use launch agent or apple script to be used to enable auto start,
+ /// the builder's default is [`MacosLauncher::LaunchAgent`]
+ #[cfg(target_os = "macos")]
+ pub fn macos_launcher(mut self, macos_launcher: MacosLauncher) -> Self {
+ self.macos_launcher = macos_launcher;
+ self
+ }
+
+ /// Sets the app name to be used for the auto start entry.
+ ///
+ /// ## Examples
+ ///
+ /// ```no_run
+ /// Builder::new()
+ /// .app_name("My Custom Name"))
+ /// .build();
+ /// ```
+ pub fn app_name>(mut self, app_name: S) -> Self {
+ self.app_name = Some(app_name.into());
+ self
+ }
+
+ pub fn build(self) -> TauriPlugin {
+ PluginBuilder::new("autostart")
+ .invoke_handler(tauri::generate_handler![enable, disable, is_enabled])
+ .setup(move |app, _api| {
+ let mut builder = AutoLaunchBuilder::new();
+
+ let app_name = self
+ .app_name
+ .as_ref()
+ .unwrap_or_else(|| &app.package_info().name);
+ builder.set_app_name(app_name);
+
+ builder.set_args(&self.args);
+
+ let current_exe = current_exe()?;
+
+ #[cfg(windows)]
+ builder.set_app_path(¤t_exe.display().to_string());
+
+ #[cfg(target_os = "macos")]
+ {
+ builder.set_use_launch_agent(matches!(
+ self.macos_launcher,
+ MacosLauncher::LaunchAgent
+ ));
+ // on macOS, current_exe gives path to /Applications/Example.app/MacOS/Example
+ // but this results in seeing a Unix Executable in macOS login items
+ // It must be: /Applications/Example.app
+ // If it didn't find exactly a single occurance of .app, it will default to
+ // exe path to not break it.
+ let exe_path = current_exe.canonicalize()?.display().to_string();
+ let parts: Vec<&str> = exe_path.split(".app/").collect();
+ let app_path = if parts.len() == 2
+ && matches!(self.macos_launcher, MacosLauncher::AppleScript)
+ {
+ format!("{}.app", parts.first().unwrap())
+ } else {
+ exe_path
+ };
+ builder.set_app_path(&app_path);
+ }
+
+ #[cfg(target_os = "linux")]
+ if let Some(appimage) = app
+ .env()
+ .appimage
+ .and_then(|p| p.to_str().map(|s| s.to_string()))
+ {
+ builder.set_app_path(&appimage);
+ } else {
+ builder.set_app_path(¤t_exe.display().to_string());
+ }
+
+ app.manage(AutoLaunchManager(
+ builder.build().map_err(|e| e.to_string())?,
+ ));
+ Ok(())
+ })
+ .build()
+ }
+}
+
+/// Initializes the plugin.
+///
+/// `args` - are passed to your app on startup.
+pub fn init(
+ #[allow(unused)] macos_launcher: MacosLauncher,
+ args: Option>,
+) -> TauriPlugin {
+ let mut builder = Builder::new();
+ if let Some(args) = args {
+ builder = builder.args(args)
+ }
+ #[cfg(target_os = "macos")]
+ {
+ builder = builder.macos_launcher(macos_launcher);
+ }
+ builder.build()
+}
diff --git a/packages/kbot/gui/app/plugins/autostart/tsconfig.json b/packages/kbot/gui/app/plugins/autostart/tsconfig.json
new file mode 100644
index 00000000..5098169a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/autostart/tsconfig.json
@@ -0,0 +1,4 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "include": ["guest-js/*.ts"]
+}
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/CHANGELOG.md b/packages/kbot/gui/app/plugins/barcode-scanner/CHANGELOG.md
new file mode 100644
index 00000000..543acbd8
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/CHANGELOG.md
@@ -0,0 +1,127 @@
+# Changelog
+
+## \[2.4.0]
+
+- [`aa9140e1`](https://github.com/tauri-apps/plugins-workspace/commit/aa9140e1ac239ab9f015f92b2ed52bbf0eda7c12) ([#2437](https://github.com/tauri-apps/plugins-workspace/pull/2437) by [@enkhjile](https://github.com/tauri-apps/plugins-workspace/../../enkhjile)) Added support for GS1 DataBar on iOS 15.4+
+
+## \[2.3.0]
+
+- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+
+## \[2.2.1]
+
+- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
+
+## \[2.2.0]
+
+- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
+
+## \[2.0.1]
+
+- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
+
+## \[2.0.0]
+
+- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+
+## \[2.0.0-rc.2]
+
+- [`79d6e19c`](https://github.com/tauri-apps/plugins-workspace/commit/79d6e19c4b38bae0cab29eb88df379e2237d9aac) ([#1777](https://github.com/tauri-apps/plugins-workspace/pull/1777)) Fixed an issue which caused checkPermission and requestPermission to be mixed up.
+
+## \[2.0.0-rc.4]
+
+- [`713c54ef`](https://github.com/tauri-apps/plugins-workspace/commit/713c54ef8365d36afd84585dcabed2fbb751223d) ([#1749](https://github.com/tauri-apps/plugins-workspace/pull/1749) by [@olivierlemasle](https://github.com/tauri-apps/plugins-workspace/../../olivierlemasle)) Remove unused Android dependencies.
+- [`8c3a6a25`](https://github.com/tauri-apps/plugins-workspace/commit/8c3a6a253d7029d370659d2102f91a458745d345) ([#1758](https://github.com/tauri-apps/plugins-workspace/pull/1758) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Validate missing `NSCameraUsageDescription` Info.plist value.
+
+## \[2.0.0-rc.1]
+
+- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Use `PermissionState` from the `tauri` crate, which now also includes a "prompt with rationale" variant for Android (returned when your app must explain to the user why it needs the permission).
+- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8
+
+## \[2.0.0-rc.2]
+
+- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package.
+
+## \[2.0.0-rc.1]
+
+- [`2c00c029`](https://github.com/tauri-apps/plugins-workspace/commit/2c00c0292c9127b81567de46691e8c0f73557261) ([#1630](https://github.com/tauri-apps/plugins-workspace/pull/1630) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused multi-word IIFE names to not be formatted correctly. For example the `barcode-scanner` was defined as `window.__TAURI_PLUGIN_CLIPBOARDMANAGER__` instead of `window.__TAURI_PLUGIN_CLIPBOARD_MANAGER__`.
+
+### changes
+
+- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0
+
+## \[2.0.0-rc.0]
+
+- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC.
+
+## \[2.0.0-beta.8]
+
+- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version.
+- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25.
+
+## \[2.0.0-beta.7]
+
+- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24.
+
+## \[2.0.0-beta.6]
+
+- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23.
+
+## \[2.0.0-beta.5]
+
+- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22.
+
+## \[2.0.0-beta.4]
+
+- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20.
+
+## \[2.0.0-beta.3]
+
+- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17.
+
+## \[2.0.0-beta.4]
+
+- [`326df688`](https://github.com/tauri-apps/plugins-workspace/commit/326df6883998d416fc0837583ed972854628bb52)([#1236](https://github.com/tauri-apps/plugins-workspace/pull/1236)) Fixes command argument parsing on iOS.
+
+## \[2.0.0-beta.3]
+
+- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
+
+## \[2.0.0-beta.2]
+
+- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
+
+## \[2.0.0-beta.1]
+
+- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
+
+## \[2.0.0-beta.0]
+
+- [`d198c01`](https://github.com/tauri-apps/plugins-workspace/commit/d198c014863ee260cb0de88a14b7fc4356ef7474)([#862](https://github.com/tauri-apps/plugins-workspace/pull/862)) Update to tauri beta.
+- [`d198c01`](https://github.com/tauri-apps/plugins-workspace/commit/d198c014863ee260cb0de88a14b7fc4356ef7474)([#862](https://github.com/tauri-apps/plugins-workspace/pull/862)) Add permissions.
+
+## \[2.0.0-alpha.4]
+
+- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.13.
+
+## \[2.0.0-alpha.3]
+
+- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.12.
+
+## \[2.0.0-alpha.2]
+
+- [`e438e0a`](https://github.com/tauri-apps/plugins-workspace/commit/e438e0a62d4b430a5159f05f13ecd397dd891a0d)([#676](https://github.com/tauri-apps/plugins-workspace/pull/676)) Update to @tauri-apps/api v2.0.0-alpha.11.
+
+## \[2.0.0-alpha.1]
+
+- [`5c13736`](https://github.com/tauri-apps/plugins-workspace/commit/5c137365c60790e8d4037d449e8237aa3fffdab0)([#673](https://github.com/tauri-apps/plugins-workspace/pull/673)) Update to @tauri-apps/api v2.0.0-alpha.9.
+
+## \[2.0.0-alpha.0]
+
+- [`454428c`](https://github.com/tauri-apps/plugins-workspace/commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release.
+ commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release.
+ 36]\(https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release.
+ commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release.
+ .
+ commit/454428cd50ce4962f0bad8e355aebc68af8cc61f)([#536](https://github.com/tauri-apps/plugins-workspace/pull/536)) Initial release.
+ github.com/tauri-apps/plugins-workspace/pull/536)) Initial release.
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/Cargo.toml b/packages/kbot/gui/app/plugins/barcode-scanner/Cargo.toml
new file mode 100644
index 00000000..01679162
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/Cargo.toml
@@ -0,0 +1,36 @@
+[package]
+name = "tauri-plugin-barcode-scanner"
+version = "2.4.0"
+description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
+edition = { workspace = true }
+authors = { workspace = true }
+license = { workspace = true }
+rust-version = { workspace = true }
+repository = { workspace = true }
+links = "tauri-plugin-barcode-scanner"
+
+[package.metadata.docs.rs]
+rustc-args = ["--cfg", "docsrs"]
+rustdoc-args = ["--cfg", "docsrs"]
+targets = ["x86_64-linux-android"]
+
+[package.metadata.platforms.support]
+windows = { level = "none", notes = "" }
+linux = { level = "none", notes = "" }
+macos = { level = "none", notes = "" }
+android = { level = "full", notes = "" }
+ios = { level = "full", notes = "" }
+
+
+[build-dependencies]
+tauri-plugin = { workspace = true, features = ["build"] }
+
+[dependencies]
+serde = { workspace = true }
+serde_json = { workspace = true }
+tauri = { workspace = true }
+log = { workspace = true }
+thiserror = { workspace = true }
+
+[target.'cfg(target_os = "ios")'.dependencies]
+tauri = { workspace = true, features = ["wry"] }
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/LICENSE.spdx b/packages/kbot/gui/app/plugins/barcode-scanner/LICENSE.spdx
new file mode 100644
index 00000000..cdd0df5a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/LICENSE.spdx
@@ -0,0 +1,20 @@
+SPDXVersion: SPDX-2.1
+DataLicense: CC0-1.0
+PackageName: tauri
+DataFormat: SPDXRef-1
+PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
+PackageHomePage: https://tauri.app
+PackageLicenseDeclared: Apache-2.0
+PackageLicenseDeclared: MIT
+PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy
+PackageSummary: Tauri is a rust project that enables developers to make secure
+and small desktop applications using a web frontend.
+
+PackageComment: The package includes the following libraries; see
+Relationship information.
+
+Created: 2019-05-20T09:00:00Z
+PackageDownloadLocation: git://github.com/tauri-apps/tauri
+PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git
+PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git
+Creator: Person: Daniel Thompson-Yvetot
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/LICENSE_APACHE-2.0 b/packages/kbot/gui/app/plugins/barcode-scanner/LICENSE_APACHE-2.0
new file mode 100644
index 00000000..4947287f
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/LICENSE_APACHE-2.0
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/LICENSE_MIT b/packages/kbot/gui/app/plugins/barcode-scanner/LICENSE_MIT
new file mode 100644
index 00000000..4d754725
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/LICENSE_MIT
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 - Present Tauri Apps Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/README.md b/packages/kbot/gui/app/plugins/barcode-scanner/README.md
new file mode 100644
index 00000000..5da47abd
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/README.md
@@ -0,0 +1,113 @@
+
+
+Allows your mobile application to use the camera to scan QR codes, EAN-13 and other kinds of barcodes.
+
+| Platform | Supported |
+| -------- | --------- |
+| Linux | x |
+| Windows | x |
+| macOS | x |
+| Android | ✓ |
+| iOS | ✓ |
+
+## Install
+
+_This plugin requires a Rust version of at least **1.64**_
+
+There are three general methods of installation that we can recommend.
+
+1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
+2. Pull sources directly from Github using git tags / revision hashes (most secure)
+3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)
+
+Install the Core plugin by adding the following to your `Cargo.toml` file:
+
+`src-tauri/Cargo.toml`
+
+```toml
+[dependencies]
+tauri-plugin-barcode-scanner = "2.0.0"
+# alternatively with Git:
+tauri-plugin-barcode-scanner = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
+```
+
+You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
+
+```sh
+pnpm add @tauri-apps/plugin-barcode-scanner
+# or
+npm add @tauri-apps/plugin-barcode-scanner
+# or
+yarn add @tauri-apps/plugin-barcode-scanner
+```
+
+## Usage
+
+First you need to register the core plugin with Tauri:
+
+`src-tauri/src/lib.rs`
+
+```rust
+fn main() {
+ tauri::Builder::default()
+ .plugin(tauri_plugin_barcode_scanner::init())
+ .run(tauri::generate_context!())
+ .expect("error while running tauri application");
+}
+```
+
+Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
+
+```javascript
+import { scan } from '@tauri-apps/plugin-barcode-scanner'
+
+// `windowed: true` actually sets the webview to transparent
+// instead of opening a separate view for the camera
+// make sure your user interface is ready to show what is underneath with a transparent element
+scan({ windowed: true, formats: [''] })
+```
+
+## Contributing
+
+PRs accepted. Please make sure to read the Contributing Guide before making a pull request.
+
+## Contributed By
+
+
+
+Enables the request_permissions command without any pre-configured scope.
+
+
+
+
+
+
+
+`barcode-scanner:deny-request-permissions`
+
+
+
+
+Denies the request_permissions command without any pre-configured scope.
+
+
+
+
+
+
+
+`barcode-scanner:allow-scan`
+
+
+
+
+Enables the scan command without any pre-configured scope.
+
+
+
+
+
+
+
+`barcode-scanner:deny-scan`
+
+
+
+
+Denies the scan command without any pre-configured scope.
+
+
+
+
+
+
+
+`barcode-scanner:allow-vibrate`
+
+
+
+
+Enables the vibrate command without any pre-configured scope.
+
+
+
+
+
+
+
+`barcode-scanner:deny-vibrate`
+
+
+
+
+Denies the vibrate command without any pre-configured scope.
+
+
+
+
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/permissions/default.toml b/packages/kbot/gui/app/plugins/barcode-scanner/permissions/default.toml
new file mode 100644
index 00000000..3b5a2dfd
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/permissions/default.toml
@@ -0,0 +1,20 @@
+"$schema" = "schemas/schema.json"
+[default]
+description = """
+This permission set configures which
+barcode scanning features are by default exposed.
+
+#### Granted Permissions
+
+It allows all barcode related features.
+
+"""
+
+permissions = [
+ "allow-cancel",
+ "allow-check-permissions",
+ "allow-open-app-settings",
+ "allow-request-permissions",
+ "allow-scan",
+ "allow-vibrate",
+]
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/permissions/schemas/schema.json b/packages/kbot/gui/app/plugins/barcode-scanner/permissions/schemas/schema.json
new file mode 100644
index 00000000..69fb0d5d
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/permissions/schemas/schema.json
@@ -0,0 +1,378 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "PermissionFile",
+ "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.",
+ "type": "object",
+ "properties": {
+ "default": {
+ "description": "The default permission set for the plugin",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/DefaultPermission"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "set": {
+ "description": "A list of permissions sets defined",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionSet"
+ }
+ },
+ "permission": {
+ "description": "A list of inlined permissions",
+ "default": [],
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Permission"
+ }
+ }
+ },
+ "definitions": {
+ "DefaultPermission": {
+ "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+ "type": "object",
+ "required": [
+ "permissions"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "PermissionSet": {
+ "description": "A set of direct permissions grouped together under a new name.",
+ "type": "object",
+ "required": [
+ "description",
+ "identifier",
+ "permissions"
+ ],
+ "properties": {
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does.",
+ "type": "string"
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionKind"
+ }
+ }
+ }
+ },
+ "Permission": {
+ "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
+ "type": "object",
+ "required": [
+ "identifier"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri internal convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "commands": {
+ "description": "Allowed or denied commands when using this permission.",
+ "default": {
+ "allow": [],
+ "deny": []
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/Commands"
+ }
+ ]
+ },
+ "scope": {
+ "description": "Allowed or denied scoped when using this permission.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Scopes"
+ }
+ ]
+ },
+ "platforms": {
+ "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Target"
+ }
+ }
+ }
+ },
+ "Commands": {
+ "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Allowed command.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "deny": {
+ "description": "Denied command, which takes priority.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "Scopes": {
+ "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Data that defines what is allowed by the scope.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ "deny": {
+ "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ }
+ },
+ "Value": {
+ "description": "All supported ACL values.",
+ "anyOf": [
+ {
+ "description": "Represents a null JSON value.",
+ "type": "null"
+ },
+ {
+ "description": "Represents a [`bool`].",
+ "type": "boolean"
+ },
+ {
+ "description": "Represents a valid ACL [`Number`].",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Number"
+ }
+ ]
+ },
+ {
+ "description": "Represents a [`String`].",
+ "type": "string"
+ },
+ {
+ "description": "Represents a list of other [`Value`]s.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ {
+ "description": "Represents a map of [`String`] keys to [`Value`]s.",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ ]
+ },
+ "Number": {
+ "description": "A valid ACL number.",
+ "anyOf": [
+ {
+ "description": "Represents an [`i64`].",
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "description": "Represents a [`f64`].",
+ "type": "number",
+ "format": "double"
+ }
+ ]
+ },
+ "Target": {
+ "description": "Platform target.",
+ "oneOf": [
+ {
+ "description": "MacOS.",
+ "type": "string",
+ "enum": [
+ "macOS"
+ ]
+ },
+ {
+ "description": "Windows.",
+ "type": "string",
+ "enum": [
+ "windows"
+ ]
+ },
+ {
+ "description": "Linux.",
+ "type": "string",
+ "enum": [
+ "linux"
+ ]
+ },
+ {
+ "description": "Android.",
+ "type": "string",
+ "enum": [
+ "android"
+ ]
+ },
+ {
+ "description": "iOS.",
+ "type": "string",
+ "enum": [
+ "iOS"
+ ]
+ }
+ ]
+ },
+ "PermissionKind": {
+ "type": "string",
+ "oneOf": [
+ {
+ "description": "Enables the cancel command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-cancel",
+ "markdownDescription": "Enables the cancel command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the cancel command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-cancel",
+ "markdownDescription": "Denies the cancel command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the check_permissions command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-check-permissions",
+ "markdownDescription": "Enables the check_permissions command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the check_permissions command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-check-permissions",
+ "markdownDescription": "Denies the check_permissions command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the open_app_settings command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-open-app-settings",
+ "markdownDescription": "Enables the open_app_settings command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the open_app_settings command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-open-app-settings",
+ "markdownDescription": "Denies the open_app_settings command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the request_permissions command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-request-permissions",
+ "markdownDescription": "Enables the request_permissions command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the request_permissions command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-request-permissions",
+ "markdownDescription": "Denies the request_permissions command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the scan command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-scan",
+ "markdownDescription": "Enables the scan command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the scan command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-scan",
+ "markdownDescription": "Denies the scan command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the vibrate command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-vibrate",
+ "markdownDescription": "Enables the vibrate command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the vibrate command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-vibrate",
+ "markdownDescription": "Denies the vibrate command without any pre-configured scope."
+ },
+ {
+ "description": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n\n#### This default permission set includes:\n\n- `allow-cancel`\n- `allow-check-permissions`\n- `allow-open-app-settings`\n- `allow-request-permissions`\n- `allow-scan`\n- `allow-vibrate`",
+ "type": "string",
+ "const": "default",
+ "markdownDescription": "This permission set configures which\nbarcode scanning features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all barcode related features.\n\n\n#### This default permission set includes:\n\n- `allow-cancel`\n- `allow-check-permissions`\n- `allow-open-app-settings`\n- `allow-request-permissions`\n- `allow-scan`\n- `allow-vibrate`"
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/rollup.config.js b/packages/kbot/gui/app/plugins/barcode-scanner/rollup.config.js
new file mode 100644
index 00000000..1f349ec8
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/rollup.config.js
@@ -0,0 +1,7 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import { createConfig } from '../../shared/rollup.config.js'
+
+export default createConfig()
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/src/error.rs b/packages/kbot/gui/app/plugins/barcode-scanner/src/error.rs
new file mode 100644
index 00000000..339e763b
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/src/error.rs
@@ -0,0 +1,25 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use serde::{ser::Serializer, Serialize};
+
+pub type Result = std::result::Result;
+
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+ #[error(transparent)]
+ Io(#[from] std::io::Error),
+ #[cfg(mobile)]
+ #[error(transparent)]
+ PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError),
+}
+
+impl Serialize for Error {
+ fn serialize(&self, serializer: S) -> std::result::Result
+ where
+ S: Serializer,
+ {
+ serializer.serialize_str(self.to_string().as_ref())
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/src/lib.rs b/packages/kbot/gui/app/plugins/barcode-scanner/src/lib.rs
new file mode 100644
index 00000000..2f2e7ee9
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/src/lib.rs
@@ -0,0 +1,53 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+#![cfg(mobile)]
+
+use tauri::{
+ plugin::{Builder, PluginHandle, TauriPlugin},
+ Manager, Runtime,
+};
+
+pub use models::*;
+
+mod error;
+mod models;
+
+pub use error::{Error, Result};
+
+#[cfg(target_os = "android")]
+const PLUGIN_IDENTIFIER: &str = "app.tauri.barcodescanner";
+
+#[cfg(target_os = "ios")]
+tauri::ios_plugin_binding!(init_plugin_barcode_scanner);
+
+/// Access to the scanner APIs.
+pub struct BarcodeScanner(PluginHandle);
+
+impl BarcodeScanner {}
+
+/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the barcode scanner APIs.
+pub trait BarcodeScannerExt {
+ fn barcode_scanner(&self) -> &BarcodeScanner;
+}
+
+impl> crate::BarcodeScannerExt for T {
+ fn barcode_scanner(&self) -> &BarcodeScanner {
+ self.state::>().inner()
+ }
+}
+
+/// Initializes the plugin.
+pub fn init() -> TauriPlugin {
+ Builder::new("barcode-scanner")
+ .setup(|app, api| {
+ #[cfg(target_os = "android")]
+ let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "BarcodeScannerPlugin")?;
+ #[cfg(target_os = "ios")]
+ let handle = api.register_ios_plugin(init_plugin_barcode_scanner)?;
+ app.manage(BarcodeScanner(handle));
+ Ok(())
+ })
+ .build()
+}
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/src/mobile.rs b/packages/kbot/gui/app/plugins/barcode-scanner/src/mobile.rs
new file mode 100644
index 00000000..a0560385
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/src/mobile.rs
@@ -0,0 +1,3 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/src/models.rs b/packages/kbot/gui/app/plugins/barcode-scanner/src/models.rs
new file mode 100644
index 00000000..a0560385
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/src/models.rs
@@ -0,0 +1,3 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
diff --git a/packages/kbot/gui/app/plugins/barcode-scanner/tsconfig.json b/packages/kbot/gui/app/plugins/barcode-scanner/tsconfig.json
new file mode 100644
index 00000000..5098169a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/barcode-scanner/tsconfig.json
@@ -0,0 +1,4 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "include": ["guest-js/*.ts"]
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/CHANGELOG.md b/packages/kbot/gui/app/plugins/biometric/CHANGELOG.md
new file mode 100644
index 00000000..cb8a5fe6
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/CHANGELOG.md
@@ -0,0 +1,102 @@
+# Changelog
+
+## \[2.3.0]
+
+- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+
+## \[2.2.2]
+
+- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
+
+## \[2.2.1]
+
+### bug
+
+- [`10f9e66e`](https://github.com/tauri-apps/plugins-workspace/commit/10f9e66e32141dd35f4bf884fbf9102691187e92) ([#2633](https://github.com/tauri-apps/plugins-workspace/pull/2633) by [@pjf-dev](https://github.com/tauri-apps/plugins-workspace/../../pjf-dev)) Fix biometric plugin ignoring fallback logic when biometry status is unavailable or not enrolled on iOS.
+
+## \[2.2.0]
+
+- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
+
+## \[2.0.1]
+
+- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
+
+## \[2.0.0]
+
+- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+
+## \[2.0.0-rc.1]
+
+- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8
+
+## \[2.0.0-rc.2]
+
+- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package.
+
+## \[2.0.0-rc.1]
+
+### changes
+
+- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0
+
+## \[2.0.0-rc.0]
+
+- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC.
+
+## \[2.0.0-beta.8]
+
+- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version.
+- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25.
+
+## \[2.0.0-beta.7]
+
+- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24.
+
+## \[2.0.0-beta.6]
+
+- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23.
+
+## \[2.0.0-beta.5]
+
+- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22.
+
+## \[2.0.0-beta.4]
+
+- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20.
+
+## \[2.0.0-beta.3]
+
+- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17.
+
+## \[2.0.0-beta.3]
+
+- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
+
+## \[2.0.0-beta.2]
+
+- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
+
+## \[2.0.0-beta.1]
+
+- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
+
+## \[2.0.0-beta.0]
+
+- [`d198c01`](https://github.com/tauri-apps/plugins-workspace/commit/d198c014863ee260cb0de88a14b7fc4356ef7474)([#862](https://github.com/tauri-apps/plugins-workspace/pull/862)) Update to tauri beta.
+
+## \[2.0.0-alpha.0]
+
+- [`8df28a9`](https://github.com/tauri-apps/plugins-workspace/commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
+- [`8df28a9`](https://github.com/tauri-apps/plugins-workspace/commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
+ commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
+ 29]\(https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
+ commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
+ .
+ commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
+ itial release.
+ 29]\(https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
+ commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
+ .
+ commit/8df28a987519ecfa03dcb8635443025f8d010362)([#829](https://github.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
+ ithub.com/tauri-apps/plugins-workspace/pull/829)) Initial release.
diff --git a/packages/kbot/gui/app/plugins/biometric/Cargo.toml b/packages/kbot/gui/app/plugins/biometric/Cargo.toml
new file mode 100644
index 00000000..1da605fb
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/Cargo.toml
@@ -0,0 +1,33 @@
+[package]
+name = "tauri-plugin-biometric"
+version = "2.3.0"
+description = "Prompt the user for biometric authentication on Android and iOS."
+edition = { workspace = true }
+authors = { workspace = true }
+license = { workspace = true }
+repository = { workspace = true }
+links = "tauri-plugin-biometric"
+
+[package.metadata.docs.rs]
+rustc-args = ["--cfg", "docsrs"]
+rustdoc-args = ["--cfg", "docsrs"]
+targets = ["x86_64-linux-android"]
+
+[package.metadata.platforms.support]
+windows = { level = "none", notes = "" }
+linux = { level = "none", notes = "" }
+macos = { level = "none", notes = "" }
+android = { level = "full", notes = "" }
+ios = { level = "full", notes = "" }
+
+
+[build-dependencies]
+tauri-plugin = { workspace = true, features = ["build"] }
+
+[dependencies]
+serde = { workspace = true }
+serde_json = { workspace = true }
+tauri = { workspace = true }
+log = { workspace = true }
+thiserror = { workspace = true }
+serde_repr = "0.1"
diff --git a/packages/kbot/gui/app/plugins/biometric/LICENSE.spdx b/packages/kbot/gui/app/plugins/biometric/LICENSE.spdx
new file mode 100644
index 00000000..cdd0df5a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/LICENSE.spdx
@@ -0,0 +1,20 @@
+SPDXVersion: SPDX-2.1
+DataLicense: CC0-1.0
+PackageName: tauri
+DataFormat: SPDXRef-1
+PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
+PackageHomePage: https://tauri.app
+PackageLicenseDeclared: Apache-2.0
+PackageLicenseDeclared: MIT
+PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy
+PackageSummary: Tauri is a rust project that enables developers to make secure
+and small desktop applications using a web frontend.
+
+PackageComment: The package includes the following libraries; see
+Relationship information.
+
+Created: 2019-05-20T09:00:00Z
+PackageDownloadLocation: git://github.com/tauri-apps/tauri
+PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git
+PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git
+Creator: Person: Daniel Thompson-Yvetot
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/LICENSE_APACHE-2.0 b/packages/kbot/gui/app/plugins/biometric/LICENSE_APACHE-2.0
new file mode 100644
index 00000000..4947287f
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/LICENSE_APACHE-2.0
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/LICENSE_MIT b/packages/kbot/gui/app/plugins/biometric/LICENSE_MIT
new file mode 100644
index 00000000..4d754725
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/LICENSE_MIT
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 - Present Tauri Apps Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/README.md b/packages/kbot/gui/app/plugins/biometric/README.md
new file mode 100644
index 00000000..e2ad7efd
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/README.md
@@ -0,0 +1,111 @@
+
+
+Prompt the user for biometric authentication on Android and iOS.
+
+| Platform | Supported |
+| -------- | --------- |
+| Linux | x |
+| Windows | x |
+| macOS | x |
+| Android | ✓ |
+| iOS | ✓ |
+
+## Install
+
+_This plugin requires a Rust version of at least **1.65**_
+
+There are three general methods of installation that we can recommend.
+
+1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
+2. Pull sources directly from Github using git tags / revision hashes (most secure)
+3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)
+
+Install the Core plugin by adding the following to your `Cargo.toml` file:
+
+`src-tauri/Cargo.toml`
+
+```toml
+[dependencies]
+tauri-plugin-biometric = "2.0.0"
+# alternatively with Git:
+tauri-plugin-biometric = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
+```
+
+You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
+
+
+
+```sh
+pnpm add @tauri-apps/plugin-biometric
+# or
+npm add @tauri-apps/plugin-biometric
+# or
+yarn add @tauri-apps/plugin-biometric
+```
+
+## Usage
+
+First you need to register the core plugin with Tauri:
+
+`src-tauri/src/lib.rs`
+
+```rust
+fn main() {
+ tauri::Builder::default()
+ .plugin(tauri_plugin_biometric::init())
+ .run(tauri::generate_context!())
+ .expect("error while running tauri application");
+}
+```
+
+Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
+
+```javascript
+import { authenticate } from '@tauri-apps/plugin-biometric'
+await authenticate('Open your wallet')
+```
+
+## Contributing
+
+PRs accepted. Please make sure to read the Contributing Guide before making a pull request.
+
+## Contributed By
+
+
+
+For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri).
+
+## License
+
+Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.
+
+MIT or MIT/Apache 2.0 where applicable.
diff --git a/packages/kbot/gui/app/plugins/biometric/SECURITY.md b/packages/kbot/gui/app/plugins/biometric/SECURITY.md
new file mode 100644
index 00000000..4f09bbac
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/SECURITY.md
@@ -0,0 +1,23 @@
+# Security Policy
+
+**Do not report security vulnerabilities through public GitHub issues.**
+
+**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.**
+
+Include as much of the following information:
+
+- Type of issue (e.g. improper input parsing, privilege escalation, etc.)
+- The location of the affected source code (tag/branch/commit or direct URL)
+- Any special configuration required to reproduce the issue
+- The distribution affected or used to help us with reproduction of the issue
+- Step-by-step instructions to reproduce the issue
+- Ideally a reproduction repository
+- Impact of the issue, including how an attacker might exploit the issue
+
+We prefer to receive reports in English.
+
+## Contact
+
+Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new).
+
+Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
diff --git a/packages/kbot/gui/app/plugins/biometric/android/.gitignore b/packages/kbot/gui/app/plugins/biometric/android/.gitignore
new file mode 100644
index 00000000..c0f21ec2
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/.gitignore
@@ -0,0 +1,2 @@
+/build
+/.tauri
diff --git a/packages/kbot/gui/app/plugins/biometric/android/build.gradle.kts b/packages/kbot/gui/app/plugins/biometric/android/build.gradle.kts
new file mode 100644
index 00000000..d8833662
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/build.gradle.kts
@@ -0,0 +1,44 @@
+plugins {
+ id("com.android.library")
+ id("org.jetbrains.kotlin.android")
+}
+
+android {
+ namespace = "app.tauri.biometric"
+ compileSdk = 34
+
+ defaultConfig {
+ minSdk = 24
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles("consumer-rules.pro")
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+ kotlinOptions {
+ jvmTarget = "1.8"
+ }
+}
+
+dependencies {
+ implementation("androidx.biometric:biometric:1.1.0")
+ implementation("androidx.core:core-ktx:1.9.0")
+ implementation("androidx.appcompat:appcompat:1.6.0")
+ implementation("com.google.android.material:material:1.7.0")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+ implementation(project(":tauri-android"))
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/android/proguard-rules.pro b/packages/kbot/gui/app/plugins/biometric/android/proguard-rules.pro
new file mode 100644
index 00000000..481bb434
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/android/settings.gradle b/packages/kbot/gui/app/plugins/biometric/android/settings.gradle
new file mode 100644
index 00000000..14a752e4
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/settings.gradle
@@ -0,0 +1,2 @@
+include ':tauri-android'
+project(':tauri-android').projectDir = new File('./.tauri/tauri-api')
diff --git a/packages/kbot/gui/app/plugins/biometric/android/src/androidTest/java/ExampleInstrumentedTest.kt b/packages/kbot/gui/app/plugins/biometric/android/src/androidTest/java/ExampleInstrumentedTest.kt
new file mode 100644
index 00000000..5efaa023
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/src/androidTest/java/ExampleInstrumentedTest.kt
@@ -0,0 +1,28 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+package app.tauri.biometric
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+ @Test
+ fun useAppContext() {
+ // Context of the app under test.
+ val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+ assertEquals("app.tauri.biometric", appContext.packageName)
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/android/src/main/AndroidManifest.xml b/packages/kbot/gui/app/plugins/biometric/android/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..90328cb7
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/src/main/AndroidManifest.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/packages/kbot/gui/app/plugins/biometric/android/src/main/java/BiometricActivity.kt b/packages/kbot/gui/app/plugins/biometric/android/src/main/java/BiometricActivity.kt
new file mode 100644
index 00000000..011de4d5
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/src/main/java/BiometricActivity.kt
@@ -0,0 +1,129 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+package app.tauri.biometric
+
+import android.annotation.SuppressLint
+import android.app.Activity
+import android.app.KeyguardManager
+import android.content.Context
+import android.content.Intent
+import android.hardware.biometrics.BiometricManager
+import android.os.Build
+import android.os.Bundle
+import android.os.Handler
+import androidx.appcompat.app.AppCompatActivity
+import androidx.biometric.BiometricPrompt
+import java.util.concurrent.Executor
+
+class BiometricActivity : AppCompatActivity() {
+ @SuppressLint("WrongConstant")
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.auth_activity)
+
+ val executor = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+ this.mainExecutor
+ } else {
+ Executor { command: Runnable? ->
+ Handler(this.mainLooper).post(
+ command!!
+ )
+ }
+ }
+
+ val builder = BiometricPrompt.PromptInfo.Builder()
+ val intent = intent
+ var title = intent.getStringExtra(BiometricPlugin.TITLE)
+ val subtitle = intent.getStringExtra(BiometricPlugin.SUBTITLE)
+ val description = intent.getStringExtra(BiometricPlugin.REASON)
+ allowDeviceCredential = false
+ // Android docs say we should check if the device is secure before enabling device credential fallback
+ val manager = getSystemService(
+ Context.KEYGUARD_SERVICE
+ ) as KeyguardManager
+ if (manager.isDeviceSecure) {
+ allowDeviceCredential =
+ intent.getBooleanExtra(BiometricPlugin.DEVICE_CREDENTIAL, false)
+ }
+
+ if (title.isNullOrEmpty()) {
+ title = "Authenticate"
+ }
+
+ builder.setTitle(title).setSubtitle(subtitle).setDescription(description)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
+ var authenticators = BiometricManager.Authenticators.BIOMETRIC_WEAK
+ if (allowDeviceCredential) {
+ authenticators = authenticators or BiometricManager.Authenticators.DEVICE_CREDENTIAL
+ }
+ builder.setAllowedAuthenticators(authenticators)
+ } else {
+ @Suppress("DEPRECATION")
+ builder.setDeviceCredentialAllowed(allowDeviceCredential)
+ }
+
+ // From the Android docs:
+ // You can't call setNegativeButtonText() and setAllowedAuthenticators(... or DEVICE_CREDENTIAL)
+ // at the same time on a BiometricPrompt.PromptInfo.Builder instance.
+ if (!allowDeviceCredential) {
+ val negativeButtonText = intent.getStringExtra(BiometricPlugin.CANCEL_TITLE)
+ builder.setNegativeButtonText(
+ if (negativeButtonText.isNullOrEmpty()) "Cancel" else negativeButtonText
+ )
+ }
+ builder.setConfirmationRequired(
+ intent.getBooleanExtra(BiometricPlugin.CONFIRMATION_REQUIRED, true)
+ )
+ val promptInfo = builder.build()
+ val prompt = BiometricPrompt(
+ this,
+ executor,
+ object : BiometricPrompt.AuthenticationCallback() {
+ override fun onAuthenticationError(
+ errorCode: Int,
+ errorMessage: CharSequence
+ ) {
+ super.onAuthenticationError(errorCode, errorMessage)
+ finishActivity(
+ BiometryResultType.ERROR,
+ errorCode,
+ errorMessage as String
+ )
+ }
+
+ override fun onAuthenticationSucceeded(
+ result: BiometricPrompt.AuthenticationResult
+ ) {
+ super.onAuthenticationSucceeded(result)
+ finishActivity()
+ }
+ }
+ )
+ prompt.authenticate(promptInfo)
+ }
+
+ @JvmOverloads
+ fun finishActivity(
+ resultType: BiometryResultType = BiometryResultType.SUCCESS,
+ errorCode: Int = 0,
+ errorMessage: String? = ""
+ ) {
+ val intent = Intent()
+ val prefix = BiometricPlugin.RESULT_EXTRA_PREFIX
+ intent
+ .putExtra(prefix + BiometricPlugin.RESULT_TYPE, resultType.toString())
+ .putExtra(prefix + BiometricPlugin.RESULT_ERROR_CODE, errorCode)
+ .putExtra(
+ prefix + BiometricPlugin.RESULT_ERROR_MESSAGE,
+ errorMessage
+ )
+ setResult(Activity.RESULT_OK, intent)
+ finish()
+ }
+
+ companion object {
+ var allowDeviceCredential = false
+ }
+}
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/android/src/main/java/BiometricPlugin.kt b/packages/kbot/gui/app/plugins/biometric/android/src/main/java/BiometricPlugin.kt
new file mode 100644
index 00000000..b3436fd4
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/src/main/java/BiometricPlugin.kt
@@ -0,0 +1,254 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+package app.tauri.biometric
+
+import android.app.Activity
+import android.content.Intent
+import android.content.pm.PackageManager
+import android.os.Build
+import android.webkit.WebView
+import androidx.activity.result.ActivityResult
+import androidx.biometric.BiometricManager
+import androidx.biometric.BiometricPrompt
+import app.tauri.annotation.ActivityCallback
+import app.tauri.annotation.Command
+import app.tauri.annotation.InvokeArg
+import app.tauri.annotation.TauriPlugin
+import app.tauri.plugin.Invoke
+import app.tauri.plugin.JSArray
+import app.tauri.plugin.JSObject
+import app.tauri.plugin.Plugin
+import java.util.EnumMap
+import java.util.HashMap
+import kotlin.math.max
+
+enum class BiometryResultType {
+ SUCCESS, FAILURE, ERROR
+}
+
+private const val MAX_ATTEMPTS = "maxAttemps"
+private const val BIOMETRIC_FAILURE = "authenticationFailed"
+private const val INVALID_CONTEXT_ERROR = "invalidContext"
+
+@InvokeArg
+class AuthOptions {
+ lateinit var reason: String
+ var allowDeviceCredential: Boolean = false
+ var title: String? = null
+ var subtitle: String? = null
+ var cancelTitle: String? = null
+ var confirmationRequired: Boolean? = null
+ var maxAttemps: Int = 3
+}
+
+@TauriPlugin
+class BiometricPlugin(private val activity: Activity): Plugin(activity) {
+ private var biometryTypes: ArrayList = arrayListOf()
+
+ companion object {
+ var RESULT_EXTRA_PREFIX = ""
+ const val TITLE = "title"
+ const val SUBTITLE = "subtitle"
+ const val REASON = "reason"
+ const val CANCEL_TITLE = "cancelTitle"
+ const val RESULT_TYPE = "type"
+ const val RESULT_ERROR_CODE = "errorCode"
+ const val RESULT_ERROR_MESSAGE = "errorMessage"
+ const val DEVICE_CREDENTIAL = "allowDeviceCredential"
+ const val CONFIRMATION_REQUIRED = "confirmationRequired"
+
+ // Maps biometry error numbers to string error codes
+ private var biometryErrorCodeMap: MutableMap = HashMap()
+ private var biometryNameMap: MutableMap = EnumMap(BiometryType::class.java)
+
+ init {
+ biometryErrorCodeMap[BiometricManager.BIOMETRIC_SUCCESS] = ""
+ biometryErrorCodeMap[BiometricManager.BIOMETRIC_SUCCESS] = ""
+ biometryErrorCodeMap[BiometricPrompt.ERROR_CANCELED] = "systemCancel"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_HW_NOT_PRESENT] = "biometryNotAvailable"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_HW_UNAVAILABLE] = "biometryNotAvailable"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_LOCKOUT] = "biometryLockout"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_LOCKOUT_PERMANENT] = "biometryLockout"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_NEGATIVE_BUTTON] = "userCancel"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_NO_BIOMETRICS] = "biometryNotEnrolled"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_NO_DEVICE_CREDENTIAL] = "noDeviceCredential"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_NO_SPACE] = "systemCancel"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_TIMEOUT] = "systemCancel"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_UNABLE_TO_PROCESS] = "systemCancel"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_USER_CANCELED] = "userCancel"
+ biometryErrorCodeMap[BiometricPrompt.ERROR_VENDOR] = "systemCancel"
+
+ biometryNameMap[BiometryType.NONE] = "No Authentication"
+ biometryNameMap[BiometryType.FINGERPRINT] = "Fingerprint Authentication"
+ biometryNameMap[BiometryType.FACE] = "Face Authentication"
+ biometryNameMap[BiometryType.IRIS] = "Iris Authentication"
+ }
+ }
+
+ override fun load(webView: WebView) {
+ super.load(webView)
+
+ biometryTypes = ArrayList()
+ val manager = activity.packageManager
+ if (manager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
+ biometryTypes.add(BiometryType.FINGERPRINT)
+ }
+ if (manager.hasSystemFeature(PackageManager.FEATURE_FACE)) {
+ biometryTypes.add(BiometryType.FACE)
+ }
+ if (manager.hasSystemFeature(PackageManager.FEATURE_IRIS)) {
+ biometryTypes.add(BiometryType.IRIS)
+ }
+ if (biometryTypes.size == 0) {
+ biometryTypes.add(BiometryType.NONE)
+ }
+ }
+
+ /**
+ * Check the device's availability and type of biometric authentication.
+ */
+ @Command
+ fun status(invoke: Invoke) {
+ val manager = BiometricManager.from(activity)
+ val biometryResult = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
+ manager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_WEAK)
+ } else {
+ @Suppress("DEPRECATION")
+ manager.canAuthenticate()
+ }
+ val ret = JSObject()
+
+ val available = biometryResult == BiometricManager.BIOMETRIC_SUCCESS
+ ret.put(
+ "isAvailable",
+ available
+ )
+
+ ret.put("biometryType", biometryTypes[0].type)
+
+ if (!available) {
+ var reason = ""
+ when (biometryResult) {
+ BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE -> reason =
+ "Biometry unavailable."
+ BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED -> reason =
+ "Biometrics not enrolled."
+ BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE -> reason =
+ "No biometric on this device."
+ BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED -> reason =
+ "A security update is required."
+ BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED -> reason =
+ "Unsupported biometry."
+ BiometricManager.BIOMETRIC_STATUS_UNKNOWN -> reason =
+ "Unknown biometry state."
+ }
+
+ var errorCode = biometryErrorCodeMap[biometryResult]
+ if (errorCode == null) {
+ errorCode = "biometryNotAvailable"
+ }
+ ret.put("error", reason)
+ ret.put("errorCode", errorCode)
+ }
+
+ invoke.resolve(ret)
+ }
+
+ /**
+ * Prompt the user for biometric authentication.
+ */
+ @Command
+ fun authenticate(invoke: Invoke) {
+ // The result of an intent is supposed to have the package name as a prefix
+ RESULT_EXTRA_PREFIX = activity.packageName + "."
+ val intent = Intent(
+ activity,
+ BiometricActivity::class.java
+ )
+
+ val args = invoke.parseArgs(AuthOptions::class.java)
+
+ // Pass the options to the activity
+ intent.putExtra(
+ TITLE,
+ args.title ?: (biometryNameMap[biometryTypes[0]] ?: "")
+ )
+ intent.putExtra(SUBTITLE, args.subtitle)
+ intent.putExtra(REASON, args.reason)
+ intent.putExtra(CANCEL_TITLE, args.cancelTitle)
+ intent.putExtra(DEVICE_CREDENTIAL, args.allowDeviceCredential)
+ args.confirmationRequired?.let {
+ intent.putExtra(CONFIRMATION_REQUIRED, it)
+ }
+
+ val maxAttemptsConfig = args.maxAttemps
+ val maxAttempts = max(maxAttemptsConfig, 1)
+ intent.putExtra(MAX_ATTEMPTS, maxAttempts)
+ startActivityForResult(invoke, intent, "authenticateResult")
+ }
+
+ @ActivityCallback
+ private fun authenticateResult(invoke: Invoke, result: ActivityResult) {
+ val resultCode = result.resultCode
+
+ // If the system canceled the activity, we might get RESULT_CANCELED in resultCode.
+ // In that case return that immediately, because there won't be any data.
+ if (resultCode == Activity.RESULT_CANCELED) {
+ invoke.reject(
+ "The system canceled authentication",
+ biometryErrorCodeMap[BiometricPrompt.ERROR_CANCELED]
+ )
+ return
+ }
+
+ // Convert the string result type to an enum
+ val data = result.data
+ val resultTypeName = data?.getStringExtra(
+ RESULT_EXTRA_PREFIX + RESULT_TYPE
+ )
+ if (resultTypeName == null) {
+ invoke.reject(
+ "Missing data in the result of the activity",
+ INVALID_CONTEXT_ERROR
+ )
+ return
+ }
+ val resultType = try {
+ BiometryResultType.valueOf(resultTypeName)
+ } catch (e: IllegalArgumentException) {
+ invoke.reject(
+ "Invalid data in the result of the activity",
+ INVALID_CONTEXT_ERROR
+ )
+ return
+ }
+ val errorCode = data.getIntExtra(
+ RESULT_EXTRA_PREFIX + RESULT_ERROR_CODE,
+ 0
+ )
+ var errorMessage = data.getStringExtra(
+ RESULT_EXTRA_PREFIX + RESULT_ERROR_MESSAGE
+ )
+ when (resultType) {
+ BiometryResultType.SUCCESS -> invoke.resolve()
+ BiometryResultType.FAILURE -> // Biometry was successfully presented but was not recognized
+ invoke.reject(errorMessage, BIOMETRIC_FAILURE)
+
+ BiometryResultType.ERROR -> {
+ // The user cancelled, the system cancelled, or some error occurred.
+ // If the user cancelled, errorMessage is the text of the "negative" button,
+ // which is not especially descriptive.
+ if (errorCode == BiometricPrompt.ERROR_NEGATIVE_BUTTON) {
+ errorMessage = "Cancel button was pressed"
+ }
+ invoke.reject(errorMessage, biometryErrorCodeMap[errorCode])
+ }
+ }
+ }
+
+ internal enum class BiometryType(val type: Int) {
+ NONE(0), FINGERPRINT(1), FACE(2), IRIS(3);
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/android/src/main/res/layout/auth_activity.xml b/packages/kbot/gui/app/plugins/biometric/android/src/main/res/layout/auth_activity.xml
new file mode 100644
index 00000000..d88f20da
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/src/main/res/layout/auth_activity.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/android/src/main/res/values/styles.xml b/packages/kbot/gui/app/plugins/biometric/android/src/main/res/values/styles.xml
new file mode 100644
index 00000000..3caed83b
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/src/main/res/values/styles.xml
@@ -0,0 +1,10 @@
+
+
+
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/android/src/test/java/ExampleUnitTest.kt b/packages/kbot/gui/app/plugins/biometric/android/src/test/java/ExampleUnitTest.kt
new file mode 100644
index 00000000..128d8bce
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/android/src/test/java/ExampleUnitTest.kt
@@ -0,0 +1,21 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+package app.tauri.biometric
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/api-iife.js b/packages/kbot/gui/app/plugins/biometric/api-iife.js
new file mode 100644
index 00000000..3da2296b
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/api-iife.js
@@ -0,0 +1 @@
+if("__TAURI__"in window){var __TAURI_PLUGIN_BIOMETRIC__=function(e){"use strict";async function i(e,i={},t){return window.__TAURI_INTERNALS__.invoke(e,i,t)}var t;return"function"==typeof SuppressedError&&SuppressedError,e.BiometryType=void 0,(t=e.BiometryType||(e.BiometryType={}))[t.None=0]="None",t[t.TouchID=1]="TouchID",t[t.FaceID=2]="FaceID",t[t.Iris=3]="Iris",e.authenticate=async function(e,t){await i("plugin:biometric|authenticate",{reason:e,...t})},e.checkStatus=async function(){return await i("plugin:biometric|status")},e}({});Object.defineProperty(window.__TAURI__,"biometric",{value:__TAURI_PLUGIN_BIOMETRIC__})}
diff --git a/packages/kbot/gui/app/plugins/biometric/build.rs b/packages/kbot/gui/app/plugins/biometric/build.rs
new file mode 100644
index 00000000..070986b2
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/build.rs
@@ -0,0 +1,18 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+const COMMANDS: &[&str] = &["authenticate", "status"];
+
+fn main() {
+ let result = tauri_plugin::Builder::new(COMMANDS)
+ .global_api_script_path("./api-iife.js")
+ .android_path("android")
+ .ios_path("ios")
+ .try_build();
+
+ // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
+ if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
+ result.unwrap();
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/contributors/crabnebula.svg b/packages/kbot/gui/app/plugins/biometric/contributors/crabnebula.svg
new file mode 100644
index 00000000..a9bb4609
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/contributors/crabnebula.svg
@@ -0,0 +1,31 @@
+
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/contributors/impierce.svg b/packages/kbot/gui/app/plugins/biometric/contributors/impierce.svg
new file mode 100644
index 00000000..9d2a510b
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/contributors/impierce.svg
@@ -0,0 +1,21 @@
+
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/guest-js/index.ts b/packages/kbot/gui/app/plugins/biometric/guest-js/index.ts
new file mode 100644
index 00000000..5c3eb8df
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/guest-js/index.ts
@@ -0,0 +1,77 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import { invoke } from '@tauri-apps/api/core'
+
+export enum BiometryType {
+ None = 0,
+ // Apple TouchID or Android fingerprint
+ TouchID = 1,
+ // Apple FaceID or Android face authentication
+ FaceID = 2,
+ // Android iris authentication
+ Iris = 3
+}
+
+export interface Status {
+ isAvailable: boolean
+ biometryType: BiometryType
+ error?: string
+ errorCode?:
+ | 'appCancel'
+ | 'authenticationFailed'
+ | 'invalidContext'
+ | 'notInteractive'
+ | 'passcodeNotSet'
+ | 'systemCancel'
+ | 'userCancel'
+ | 'userFallback'
+ | 'biometryLockout'
+ | 'biometryNotAvailable'
+ | 'biometryNotEnrolled'
+}
+
+export interface AuthOptions {
+ allowDeviceCredential?: boolean
+ cancelTitle?: string
+
+ // iOS options
+ fallbackTitle?: string
+
+ // android options
+ title?: string
+ subtitle?: string
+ confirmationRequired?: boolean
+ maxAttemps?: number
+}
+
+/**
+ * Checks if the biometric authentication is available.
+ * @returns a promise resolving to an object containing all the information about the status of the biometry.
+ */
+export async function checkStatus(): Promise {
+ return await invoke('plugin:biometric|status')
+}
+
+/**
+ * Prompts the user for authentication using the system interface (touchID, faceID or Android Iris).
+ * Rejects if the authentication fails.
+ *
+ * ```javascript
+ * import { authenticate } from "@tauri-apps/plugin-biometric";
+ * await authenticate('Open your wallet');
+ * ```
+ * @param reason
+ * @param options
+ * @returns
+ */
+export async function authenticate(
+ reason: string,
+ options?: AuthOptions
+): Promise {
+ await invoke('plugin:biometric|authenticate', {
+ reason,
+ ...options
+ })
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/ios/.gitignore b/packages/kbot/gui/app/plugins/biometric/ios/.gitignore
new file mode 100644
index 00000000..5922fdaa
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/ios/.gitignore
@@ -0,0 +1,10 @@
+.DS_Store
+/.build
+/Packages
+/*.xcodeproj
+xcuserdata/
+DerivedData/
+.swiftpm/config/registries.json
+.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
+.netrc
+Package.resolved
diff --git a/packages/kbot/gui/app/plugins/biometric/ios/Package.swift b/packages/kbot/gui/app/plugins/biometric/ios/Package.swift
new file mode 100644
index 00000000..7860f476
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/ios/Package.swift
@@ -0,0 +1,34 @@
+// swift-tools-version:5.3
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import PackageDescription
+
+let package = Package(
+ name: "tauri-plugin-biometric",
+ platforms: [
+ .macOS(.v10_13),
+ .iOS(.v13),
+ ],
+ products: [
+ // Products define the executables and libraries a package produces, and make them visible to other packages.
+ .library(
+ name: "tauri-plugin-biometric",
+ type: .static,
+ targets: ["tauri-plugin-biometric"])
+ ],
+ dependencies: [
+ .package(name: "Tauri", path: "../.tauri/tauri-api")
+ ],
+ targets: [
+ // Targets are the basic building blocks of a package. A target can define a module or a test suite.
+ // Targets can depend on other targets in this package, and on products in packages this package depends on.
+ .target(
+ name: "tauri-plugin-biometric",
+ dependencies: [
+ .byName(name: "Tauri")
+ ],
+ path: "Sources")
+ ]
+)
diff --git a/packages/kbot/gui/app/plugins/biometric/ios/README.md b/packages/kbot/gui/app/plugins/biometric/ios/README.md
new file mode 100644
index 00000000..f4900bdd
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/ios/README.md
@@ -0,0 +1,3 @@
+# Tauri Plugin {{ plugin_name_original }}
+
+A description of this package.
diff --git a/packages/kbot/gui/app/plugins/biometric/ios/Sources/BiometricPlugin.swift b/packages/kbot/gui/app/plugins/biometric/ios/Sources/BiometricPlugin.swift
new file mode 100644
index 00000000..c295904a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/ios/Sources/BiometricPlugin.swift
@@ -0,0 +1,153 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import LocalAuthentication
+import SwiftRs
+import Tauri
+import UIKit
+import WebKit
+
+class BiometricStatus {
+ let available: Bool
+ let biometryType: LABiometryType
+ let errorReason: String?
+ let errorCode: String?
+
+ init(available: Bool, biometryType: LABiometryType, errorReason: String?, errorCode: String?) {
+ self.available = available
+ self.biometryType = biometryType
+ self.errorReason = errorReason
+ self.errorCode = errorCode
+ }
+}
+
+struct AuthOptions: Decodable {
+ let reason: String
+ var allowDeviceCredential: Bool?
+ var fallbackTitle: String?
+ var cancelTitle: String?
+}
+
+class BiometricPlugin: Plugin {
+ let authenticationErrorCodeMap: [Int: String] = [
+ 0: "",
+ LAError.appCancel.rawValue: "appCancel",
+ LAError.authenticationFailed.rawValue: "authenticationFailed",
+ LAError.invalidContext.rawValue: "invalidContext",
+ LAError.notInteractive.rawValue: "notInteractive",
+ LAError.passcodeNotSet.rawValue: "passcodeNotSet",
+ LAError.systemCancel.rawValue: "systemCancel",
+ LAError.userCancel.rawValue: "userCancel",
+ LAError.userFallback.rawValue: "userFallback",
+ LAError.biometryLockout.rawValue: "biometryLockout",
+ LAError.biometryNotAvailable.rawValue: "biometryNotAvailable",
+ LAError.biometryNotEnrolled.rawValue: "biometryNotEnrolled",
+ ]
+
+ var status: BiometricStatus!
+
+ public override func load(webview: WKWebView) {
+ let context = LAContext()
+ var error: NSError?
+ var available = context.canEvaluatePolicy(
+ .deviceOwnerAuthenticationWithBiometrics, error: &error)
+ var reason: String? = nil
+ var errorCode: String? = nil
+
+ if available && context.biometryType == .faceID {
+ let entry = Bundle.main.infoDictionary?["NSFaceIDUsageDescription"] as? String
+
+ if entry == nil || entry?.count == 0 {
+ available = false
+ reason = "NSFaceIDUsageDescription is not in the app Info.plist"
+ errorCode = authenticationErrorCodeMap[LAError.biometryNotAvailable.rawValue] ?? ""
+ }
+ } else if !available, let error = error {
+ reason = error.localizedDescription
+ if let failureReason = error.localizedFailureReason {
+ reason = "\(reason ?? ""): \(failureReason)"
+ }
+ errorCode =
+ authenticationErrorCodeMap[error.code] ?? authenticationErrorCodeMap[
+ LAError.biometryNotAvailable.rawValue] ?? ""
+ }
+
+ self.status = BiometricStatus(
+ available: available,
+ biometryType: context.biometryType,
+ errorReason: reason,
+ errorCode: errorCode
+ )
+ }
+
+ @objc func status(_ invoke: Invoke) {
+ if self.status.available {
+ invoke.resolve([
+ "isAvailable": self.status.available,
+ "biometryType": self.status.biometryType.rawValue,
+ ])
+ } else {
+ invoke.resolve([
+ "isAvailable": self.status.available,
+ "biometryType": self.status.biometryType.rawValue,
+ "error": self.status.errorReason ?? "",
+ "errorCode": self.status.errorCode ?? "",
+ ])
+ }
+ }
+
+ @objc func authenticate(_ invoke: Invoke) throws {
+ let args = try invoke.parseArgs(AuthOptions.self)
+
+ let allowDeviceCredential = args.allowDeviceCredential ?? false
+
+ guard self.status.available || allowDeviceCredential else {
+ // Biometry unavailable, fallback disabled
+ invoke.reject(
+ self.status.errorReason ?? "",
+ code: self.status.errorCode ?? ""
+ )
+ return
+ }
+
+ let context = LAContext()
+ context.localizedFallbackTitle = args.fallbackTitle
+ context.localizedCancelTitle = args.cancelTitle
+ context.touchIDAuthenticationAllowableReuseDuration = 0
+
+ // force system default fallback title if an empty string is provided (the OS hides the fallback button in this case)
+ if allowDeviceCredential,
+ let fallbackTitle = context.localizedFallbackTitle,
+ fallbackTitle.isEmpty
+ {
+ context.localizedFallbackTitle = nil
+ }
+
+ context.evaluatePolicy(
+ allowDeviceCredential
+ ? .deviceOwnerAuthentication : .deviceOwnerAuthenticationWithBiometrics,
+ localizedReason: args.reason
+ ) { success, error in
+ if success {
+ invoke.resolve()
+ } else {
+ if let policyError = error as? LAError {
+ let code = self.authenticationErrorCodeMap[policyError.code.rawValue]
+ invoke.reject(policyError.localizedDescription, code: code)
+ } else {
+ invoke.reject(
+ "Unknown error",
+ code: self.authenticationErrorCodeMap[LAError.authenticationFailed.rawValue]
+ )
+ }
+ }
+ }
+
+ }
+}
+
+@_cdecl("init_plugin_biometric")
+func initPlugin() -> Plugin {
+ return BiometricPlugin()
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/ios/Tests/PluginTests/PluginTests.swift b/packages/kbot/gui/app/plugins/biometric/ios/Tests/PluginTests/PluginTests.swift
new file mode 100644
index 00000000..99992ce4
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/ios/Tests/PluginTests/PluginTests.swift
@@ -0,0 +1,12 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import XCTest
+@testable import ExamplePlugin
+
+final class ExamplePluginTests: XCTestCase {
+ func testExample() throws {
+ let plugin = ExamplePlugin()
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/package.json b/packages/kbot/gui/app/plugins/biometric/package.json
new file mode 100644
index 00000000..e6c4d988
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "@tauri-apps/plugin-biometric",
+ "version": "2.3.0",
+ "license": "MIT OR Apache-2.0",
+ "authors": [
+ "Tauri Programme within The Commons Conservancy"
+ ],
+ "repository": "https://github.com/tauri-apps/plugins-workspace",
+ "type": "module",
+ "types": "./dist-js/index.d.ts",
+ "main": "./dist-js/index.cjs",
+ "module": "./dist-js/index.js",
+ "exports": {
+ "types": "./dist-js/index.d.ts",
+ "import": "./dist-js/index.js",
+ "require": "./dist-js/index.cjs"
+ },
+ "scripts": {
+ "build": "rollup -c"
+ },
+ "files": [
+ "dist-js",
+ "!dist-js/**/*.map",
+ "README.md",
+ "LICENSE"
+ ],
+ "dependencies": {
+ "@tauri-apps/api": "^2.8.0"
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/permissions/autogenerated/commands/authenticate.toml b/packages/kbot/gui/app/plugins/biometric/permissions/autogenerated/commands/authenticate.toml
new file mode 100644
index 00000000..be4c9f9b
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/permissions/autogenerated/commands/authenticate.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-authenticate"
+description = "Enables the authenticate command without any pre-configured scope."
+commands.allow = ["authenticate"]
+
+[[permission]]
+identifier = "deny-authenticate"
+description = "Denies the authenticate command without any pre-configured scope."
+commands.deny = ["authenticate"]
diff --git a/packages/kbot/gui/app/plugins/biometric/permissions/autogenerated/commands/status.toml b/packages/kbot/gui/app/plugins/biometric/permissions/autogenerated/commands/status.toml
new file mode 100644
index 00000000..c8ed433c
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/permissions/autogenerated/commands/status.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-status"
+description = "Enables the status command without any pre-configured scope."
+commands.allow = ["status"]
+
+[[permission]]
+identifier = "deny-status"
+description = "Denies the status command without any pre-configured scope."
+commands.deny = ["status"]
diff --git a/packages/kbot/gui/app/plugins/biometric/permissions/autogenerated/reference.md b/packages/kbot/gui/app/plugins/biometric/permissions/autogenerated/reference.md
new file mode 100644
index 00000000..e1b29bb0
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/permissions/autogenerated/reference.md
@@ -0,0 +1,75 @@
+## Default Permission
+
+This permission set configures which
+biometric features are by default exposed.
+
+#### Granted Permissions
+
+It allows acccess to all biometric commands.
+
+#### This default permission set includes the following:
+
+- `allow-authenticate`
+- `allow-status`
+
+## Permission Table
+
+
+
+
Identifier
+
Description
+
+
+
+
+
+
+`biometric:allow-authenticate`
+
+
+
+
+Enables the authenticate command without any pre-configured scope.
+
+
+
+
+
+
+
+`biometric:deny-authenticate`
+
+
+
+
+Denies the authenticate command without any pre-configured scope.
+
+
+
+
+
+
+
+`biometric:allow-status`
+
+
+
+
+Enables the status command without any pre-configured scope.
+
+
+
+
+
+
+
+`biometric:deny-status`
+
+
+
+
+Denies the status command without any pre-configured scope.
+
+
+
+
diff --git a/packages/kbot/gui/app/plugins/biometric/permissions/default.toml b/packages/kbot/gui/app/plugins/biometric/permissions/default.toml
new file mode 100644
index 00000000..651990ef
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/permissions/default.toml
@@ -0,0 +1,13 @@
+"$schema" = "schemas/schema.json"
+[default]
+description = """
+This permission set configures which
+biometric features are by default exposed.
+
+#### Granted Permissions
+
+It allows acccess to all biometric commands.
+
+"""
+
+permissions = ["allow-authenticate", "allow-status"]
diff --git a/packages/kbot/gui/app/plugins/biometric/permissions/schemas/schema.json b/packages/kbot/gui/app/plugins/biometric/permissions/schemas/schema.json
new file mode 100644
index 00000000..416759b5
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/permissions/schemas/schema.json
@@ -0,0 +1,330 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "PermissionFile",
+ "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.",
+ "type": "object",
+ "properties": {
+ "default": {
+ "description": "The default permission set for the plugin",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/DefaultPermission"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "set": {
+ "description": "A list of permissions sets defined",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionSet"
+ }
+ },
+ "permission": {
+ "description": "A list of inlined permissions",
+ "default": [],
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Permission"
+ }
+ }
+ },
+ "definitions": {
+ "DefaultPermission": {
+ "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+ "type": "object",
+ "required": [
+ "permissions"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "PermissionSet": {
+ "description": "A set of direct permissions grouped together under a new name.",
+ "type": "object",
+ "required": [
+ "description",
+ "identifier",
+ "permissions"
+ ],
+ "properties": {
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does.",
+ "type": "string"
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionKind"
+ }
+ }
+ }
+ },
+ "Permission": {
+ "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
+ "type": "object",
+ "required": [
+ "identifier"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri internal convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "commands": {
+ "description": "Allowed or denied commands when using this permission.",
+ "default": {
+ "allow": [],
+ "deny": []
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/Commands"
+ }
+ ]
+ },
+ "scope": {
+ "description": "Allowed or denied scoped when using this permission.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Scopes"
+ }
+ ]
+ },
+ "platforms": {
+ "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Target"
+ }
+ }
+ }
+ },
+ "Commands": {
+ "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Allowed command.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "deny": {
+ "description": "Denied command, which takes priority.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "Scopes": {
+ "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Data that defines what is allowed by the scope.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ "deny": {
+ "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ }
+ },
+ "Value": {
+ "description": "All supported ACL values.",
+ "anyOf": [
+ {
+ "description": "Represents a null JSON value.",
+ "type": "null"
+ },
+ {
+ "description": "Represents a [`bool`].",
+ "type": "boolean"
+ },
+ {
+ "description": "Represents a valid ACL [`Number`].",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Number"
+ }
+ ]
+ },
+ {
+ "description": "Represents a [`String`].",
+ "type": "string"
+ },
+ {
+ "description": "Represents a list of other [`Value`]s.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ {
+ "description": "Represents a map of [`String`] keys to [`Value`]s.",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ ]
+ },
+ "Number": {
+ "description": "A valid ACL number.",
+ "anyOf": [
+ {
+ "description": "Represents an [`i64`].",
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "description": "Represents a [`f64`].",
+ "type": "number",
+ "format": "double"
+ }
+ ]
+ },
+ "Target": {
+ "description": "Platform target.",
+ "oneOf": [
+ {
+ "description": "MacOS.",
+ "type": "string",
+ "enum": [
+ "macOS"
+ ]
+ },
+ {
+ "description": "Windows.",
+ "type": "string",
+ "enum": [
+ "windows"
+ ]
+ },
+ {
+ "description": "Linux.",
+ "type": "string",
+ "enum": [
+ "linux"
+ ]
+ },
+ {
+ "description": "Android.",
+ "type": "string",
+ "enum": [
+ "android"
+ ]
+ },
+ {
+ "description": "iOS.",
+ "type": "string",
+ "enum": [
+ "iOS"
+ ]
+ }
+ ]
+ },
+ "PermissionKind": {
+ "type": "string",
+ "oneOf": [
+ {
+ "description": "Enables the authenticate command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-authenticate",
+ "markdownDescription": "Enables the authenticate command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the authenticate command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-authenticate",
+ "markdownDescription": "Denies the authenticate command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the status command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-status",
+ "markdownDescription": "Enables the status command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the status command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-status",
+ "markdownDescription": "Denies the status command without any pre-configured scope."
+ },
+ {
+ "description": "This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`",
+ "type": "string",
+ "const": "default",
+ "markdownDescription": "This permission set configures which\nbiometric features are by default exposed.\n\n#### Granted Permissions\n\nIt allows acccess to all biometric commands.\n\n\n#### This default permission set includes:\n\n- `allow-authenticate`\n- `allow-status`"
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/biometric/rollup.config.js b/packages/kbot/gui/app/plugins/biometric/rollup.config.js
new file mode 100644
index 00000000..1f349ec8
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/rollup.config.js
@@ -0,0 +1,7 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import { createConfig } from '../../shared/rollup.config.js'
+
+export default createConfig()
diff --git a/packages/kbot/gui/app/plugins/biometric/src/error.rs b/packages/kbot/gui/app/plugins/biometric/src/error.rs
new file mode 100644
index 00000000..339e763b
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/src/error.rs
@@ -0,0 +1,25 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use serde::{ser::Serializer, Serialize};
+
+pub type Result = std::result::Result;
+
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+ #[error(transparent)]
+ Io(#[from] std::io::Error),
+ #[cfg(mobile)]
+ #[error(transparent)]
+ PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError),
+}
+
+impl Serialize for Error {
+ fn serialize(&self, serializer: S) -> std::result::Result
+ where
+ S: Serializer,
+ {
+ serializer.serialize_str(self.to_string().as_ref())
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/src/lib.rs b/packages/kbot/gui/app/plugins/biometric/src/lib.rs
new file mode 100644
index 00000000..f79a104d
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/src/lib.rs
@@ -0,0 +1,71 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+#![cfg(mobile)]
+
+use serde::Serialize;
+use tauri::{
+ plugin::{Builder, PluginHandle, TauriPlugin},
+ Manager, Runtime,
+};
+
+pub use models::*;
+
+mod error;
+mod models;
+
+pub use error::{Error, Result};
+
+#[cfg(target_os = "android")]
+const PLUGIN_IDENTIFIER: &str = "app.tauri.biometric";
+
+#[cfg(target_os = "ios")]
+tauri::ios_plugin_binding!(init_plugin_biometric);
+
+/// Access to the biometric APIs.
+pub struct Biometric(PluginHandle);
+
+#[derive(Serialize)]
+struct AuthenticatePayload {
+ reason: String,
+ #[serde(flatten)]
+ options: AuthOptions,
+}
+
+impl Biometric {
+ pub fn status(&self) -> crate::Result {
+ self.0.run_mobile_plugin("status", ()).map_err(Into::into)
+ }
+
+ pub fn authenticate(&self, reason: String, options: AuthOptions) -> crate::Result<()> {
+ self.0
+ .run_mobile_plugin("authenticate", AuthenticatePayload { reason, options })
+ .map_err(Into::into)
+ }
+}
+
+/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the biometric APIs.
+pub trait BiometricExt {
+ fn biometric(&self) -> &Biometric;
+}
+
+impl> crate::BiometricExt for T {
+ fn biometric(&self) -> &Biometric {
+ self.state::>().inner()
+ }
+}
+
+/// Initializes the plugin.
+pub fn init() -> TauriPlugin {
+ Builder::new("biometric")
+ .setup(|app, api| {
+ #[cfg(target_os = "android")]
+ let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "BiometricPlugin")?;
+ #[cfg(target_os = "ios")]
+ let handle = api.register_ios_plugin(init_plugin_biometric)?;
+ app.manage(Biometric(handle));
+ Ok(())
+ })
+ .build()
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/src/models.rs b/packages/kbot/gui/app/plugins/biometric/src/models.rs
new file mode 100644
index 00000000..49c84300
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/src/models.rs
@@ -0,0 +1,39 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Default, Serialize)]
+#[serde(rename_all = "camelCase")]
+pub struct AuthOptions {
+ /// Enables authentication using the device's password. This feature is available on both Android and iOS.
+ pub allow_device_credential: bool,
+ /// Label for the Cancel button. This feature is available on both Android and iOS.
+ pub cancel_title: Option,
+ /// Specifies the text displayed on the fallback button if biometric authentication fails. This feature is available iOS only.
+ pub fallback_title: Option,
+ /// Title indicating the purpose of biometric verification. This feature is available Android only.
+ pub title: Option,
+ /// SubTitle providing contextual information of biometric verification. This feature is available Android only.
+ pub subtitle: Option,
+ /// Specifies whether additional user confirmation is required, such as pressing a button after successful biometric authentication. This feature is available Android only.
+ pub confirmation_required: Option,
+}
+
+#[derive(Debug, Clone, serde_repr::Deserialize_repr)]
+#[repr(u8)]
+pub enum BiometryType {
+ None = 0,
+ TouchID = 1,
+ FaceID = 2,
+}
+
+#[derive(Debug, Clone, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct Status {
+ pub is_available: bool,
+ pub biometry_type: BiometryType,
+ pub error: Option,
+ pub error_code: Option,
+}
diff --git a/packages/kbot/gui/app/plugins/biometric/tsconfig.json b/packages/kbot/gui/app/plugins/biometric/tsconfig.json
new file mode 100644
index 00000000..5098169a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/biometric/tsconfig.json
@@ -0,0 +1,4 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "include": ["guest-js/*.ts"]
+}
diff --git a/packages/kbot/gui/app/plugins/cli/CHANGELOG.md b/packages/kbot/gui/app/plugins/cli/CHANGELOG.md
new file mode 100644
index 00000000..45de34e4
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/CHANGELOG.md
@@ -0,0 +1,110 @@
+# Changelog
+
+## \[2.4.0]
+
+- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+
+## \[2.3.0]
+
+- [`f6e11282`](https://github.com/tauri-apps/plugins-workspace/commit/f6e11282a7f4036dd6d1dbb8f100e777e9e42f11) ([#2787](https://github.com/tauri-apps/plugins-workspace/pull/2787) by [@mikew](https://github.com/tauri-apps/plugins-workspace/../../mikew)) Added `Cli.matches_from(args)`. This can be combined with the `args` passed to the callback of `tauri_plugin_single_instance::init` to parse the command line arguments passed to subsequent instances of the application.
+- [`37c2fb41`](https://github.com/tauri-apps/plugins-workspace/commit/37c2fb41201160e85c8dc3ad40f462cd4e17a304) ([#2772](https://github.com/tauri-apps/plugins-workspace/pull/2772) by [@floriskn](https://github.com/tauri-apps/plugins-workspace/../../floriskn)) Added a new `global` boolean flag to the `CliArg` struct to support global CLI arguments. This flag allows arguments like `--verbose` to be marked as global and automatically propagated to all subcommands, enabling consistent availability throughout the CLI.
+
+ The new field is optional and defaults to false.
+
+## \[2.2.1]
+
+- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
+
+## \[2.2.0]
+
+- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
+
+## \[2.0.1]
+
+- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
+
+## \[2.0.0]
+
+- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+
+## \[2.0.0-rc.2]
+
+- [`68579934`](https://github.com/tauri-apps/plugins-workspace/commit/68579934c93f6ed2edbc97474560d6a8a00e8f70) ([#1856](https://github.com/tauri-apps/plugins-workspace/pull/1856) by [@amrbashir](https://github.com/tauri-apps/plugins-workspace/../../amrbashir)) Expose `Matches`, `SubcommandMatches` and `ArgData` structs.
+
+## \[2.0.0-rc.1]
+
+- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8
+
+## \[2.0.0-rc.0]
+
+- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC.
+
+## \[2.0.0-beta.8]
+
+- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version.
+- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25.
+
+## \[2.0.0-beta.7]
+
+- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24.
+
+## \[2.0.0-beta.6]
+
+- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23.
+
+## \[2.0.0-beta.5]
+
+- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22.
+
+## \[2.0.0-beta.4]
+
+- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20.
+
+## \[2.0.0-beta.3]
+
+- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17.
+
+## \[2.0.0-beta.3]
+
+- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
+
+## \[2.0.0-beta.2]
+
+- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
+
+## \[2.0.0-beta.1]
+
+- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
+
+## \[2.0.0-beta.0]
+
+- [`d198c01`](https://github.com/tauri-apps/plugins-workspace/commit/d198c014863ee260cb0de88a14b7fc4356ef7474)([#862](https://github.com/tauri-apps/plugins-workspace/pull/862)) Update to tauri beta.
+
+## \[2.0.0-alpha.5]
+
+- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.13.
+
+## \[2.0.0-alpha.4]
+
+- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.12.
+
+## \[2.0.0-alpha.3]
+
+- [`e438e0a`](https://github.com/tauri-apps/plugins-workspace/commit/e438e0a62d4b430a5159f05f13ecd397dd891a0d)([#676](https://github.com/tauri-apps/plugins-workspace/pull/676)) Update to @tauri-apps/api v2.0.0-alpha.11.
+
+## \[2.0.0-alpha.2]
+
+- [`5c13736`](https://github.com/tauri-apps/plugins-workspace/commit/5c137365c60790e8d4037d449e8237aa3fffdab0)([#673](https://github.com/tauri-apps/plugins-workspace/pull/673)) Update to @tauri-apps/api v2.0.0-alpha.9.
+
+## \[2.0.0-alpha.2]
+
+- [`4e2cef9`](https://github.com/tauri-apps/plugins-workspace/commit/4e2cef9b702bbbb9cf4ee17de50791cb21f1b2a4)([#593](https://github.com/tauri-apps/plugins-workspace/pull/593)) Update to alpha.12.
+
+## \[2.0.0-alpha.1]
+
+- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
+
+## \[2.0.0-alpha.0]
+
+- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
+ te to alpha.11.
diff --git a/packages/kbot/gui/app/plugins/cli/Cargo.toml b/packages/kbot/gui/app/plugins/cli/Cargo.toml
new file mode 100644
index 00000000..eb63f0e5
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/Cargo.toml
@@ -0,0 +1,33 @@
+[package]
+name = "tauri-plugin-cli"
+version = "2.4.0"
+description = "Parse arguments from your Tauri application's command line interface."
+edition = { workspace = true }
+authors = { workspace = true }
+license = { workspace = true }
+rust-version = { workspace = true }
+repository = { workspace = true }
+links = "tauri-plugin-cli"
+
+[package.metadata.docs.rs]
+rustc-args = ["--cfg", "docsrs"]
+rustdoc-args = ["--cfg", "docsrs"]
+
+[package.metadata.platforms.support]
+windows = { level = "full", notes = "" }
+linux = { level = "full", notes = "" }
+macos = { level = "full", notes = "" }
+android = { level = "none", notes = "" }
+ios = { level = "none", notes = "" }
+
+
+[build-dependencies]
+tauri-plugin = { workspace = true, features = ["build"] }
+
+[dependencies]
+serde = { workspace = true }
+serde_json = { workspace = true }
+tauri = { workspace = true }
+log = { workspace = true }
+thiserror = { workspace = true }
+clap = { version = "4", features = ["string"] }
diff --git a/packages/kbot/gui/app/plugins/cli/LICENSE.spdx b/packages/kbot/gui/app/plugins/cli/LICENSE.spdx
new file mode 100644
index 00000000..cdd0df5a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/LICENSE.spdx
@@ -0,0 +1,20 @@
+SPDXVersion: SPDX-2.1
+DataLicense: CC0-1.0
+PackageName: tauri
+DataFormat: SPDXRef-1
+PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
+PackageHomePage: https://tauri.app
+PackageLicenseDeclared: Apache-2.0
+PackageLicenseDeclared: MIT
+PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy
+PackageSummary: Tauri is a rust project that enables developers to make secure
+and small desktop applications using a web frontend.
+
+PackageComment: The package includes the following libraries; see
+Relationship information.
+
+Created: 2019-05-20T09:00:00Z
+PackageDownloadLocation: git://github.com/tauri-apps/tauri
+PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git
+PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git
+Creator: Person: Daniel Thompson-Yvetot
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/cli/LICENSE_APACHE-2.0 b/packages/kbot/gui/app/plugins/cli/LICENSE_APACHE-2.0
new file mode 100644
index 00000000..4947287f
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/LICENSE_APACHE-2.0
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/cli/LICENSE_MIT b/packages/kbot/gui/app/plugins/cli/LICENSE_MIT
new file mode 100644
index 00000000..4d754725
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/LICENSE_MIT
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 - Present Tauri Apps Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/cli/README.md b/packages/kbot/gui/app/plugins/cli/README.md
new file mode 100644
index 00000000..30cd3449
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/README.md
@@ -0,0 +1,105 @@
+
+
+Parse arguments from your Command Line Interface.
+
+| Platform | Supported |
+| -------- | --------- |
+| Linux | ✓ |
+| Windows | ✓ |
+| macOS | ✓ |
+| Android | x |
+| iOS | x |
+
+## Install
+
+_This plugin requires a Rust version of at least **1.77.2**_
+
+There are three general methods of installation that we can recommend.
+
+1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
+2. Pull sources directly from Github using git tags / revision hashes (most secure)
+3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)
+
+Install the Core plugin by adding the following to your `Cargo.toml` file:
+
+`src-tauri/Cargo.toml`
+
+```toml
+# you can add the dependencies on the `[dependencies]` section if you do not target mobile
+[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
+tauri-plugin-cli = "2.0.0"
+# alternatively with Git:
+tauri-plugin-cli = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
+```
+
+You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
+
+```sh
+pnpm add @tauri-apps/plugin-cli
+# or
+npm add @tauri-apps/plugin-cli
+# or
+yarn add @tauri-apps/plugin-cli
+```
+
+## Usage
+
+First you need to register the core plugin with Tauri:
+
+`src-tauri/src/lib.rs`
+
+```rust
+fn main() {
+ tauri::Builder::default()
+ .setup(|app| {
+ #[cfg(desktop)]
+ app.handle().plugin(tauri_plugin_cli::init())?;
+ Ok(())
+ })
+ .run(tauri::generate_context!())
+ .expect("error while running tauri application");
+}
+```
+
+Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
+
+```javascript
+import { getMatches } from '@tauri-apps/plugin-cli'
+const matches = await getMatches()
+if (matches.subcommand?.name === 'run') {
+ // `./your-app run $ARGS` was executed
+ const args = matches.subcommand?.matches.args
+ if ('debug' in args) {
+ // `./your-app run --debug` was executed
+ }
+} else {
+ const args = matches.args
+ // `./your-app $ARGS` was executed
+}
+```
+
+## Contributing
+
+PRs accepted. Please make sure to read the Contributing Guide before making a pull request.
+
+## Partners
+
+
+
+For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri).
+
+## License
+
+Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.
+
+MIT or MIT/Apache 2.0 where applicable.
diff --git a/packages/kbot/gui/app/plugins/cli/SECURITY.md b/packages/kbot/gui/app/plugins/cli/SECURITY.md
new file mode 100644
index 00000000..4f09bbac
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/SECURITY.md
@@ -0,0 +1,23 @@
+# Security Policy
+
+**Do not report security vulnerabilities through public GitHub issues.**
+
+**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.**
+
+Include as much of the following information:
+
+- Type of issue (e.g. improper input parsing, privilege escalation, etc.)
+- The location of the affected source code (tag/branch/commit or direct URL)
+- Any special configuration required to reproduce the issue
+- The distribution affected or used to help us with reproduction of the issue
+- Step-by-step instructions to reproduce the issue
+- Ideally a reproduction repository
+- Impact of the issue, including how an attacker might exploit the issue
+
+We prefer to receive reports in English.
+
+## Contact
+
+Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new).
+
+Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
diff --git a/packages/kbot/gui/app/plugins/cli/api-iife.js b/packages/kbot/gui/app/plugins/cli/api-iife.js
new file mode 100644
index 00000000..90b2f35f
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/api-iife.js
@@ -0,0 +1 @@
+if("__TAURI__"in window){var __TAURI_PLUGIN_CLI__=function(_){"use strict";return"function"==typeof SuppressedError&&SuppressedError,_.getMatches=async function(){return await async function(_,n={},e){return window.__TAURI_INTERNALS__.invoke(_,n,e)}("plugin:cli|cli_matches")},_}({});Object.defineProperty(window.__TAURI__,"cli",{value:__TAURI_PLUGIN_CLI__})}
diff --git a/packages/kbot/gui/app/plugins/cli/banner.png b/packages/kbot/gui/app/plugins/cli/banner.png
new file mode 100644
index 00000000..2d1f2cd9
Binary files /dev/null and b/packages/kbot/gui/app/plugins/cli/banner.png differ
diff --git a/packages/kbot/gui/app/plugins/cli/build.rs b/packages/kbot/gui/app/plugins/cli/build.rs
new file mode 100644
index 00000000..50d88849
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/build.rs
@@ -0,0 +1,11 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+const COMMANDS: &[&str] = &["cli_matches"];
+
+fn main() {
+ tauri_plugin::Builder::new(COMMANDS)
+ .global_api_script_path("./api-iife.js")
+ .build();
+}
diff --git a/packages/kbot/gui/app/plugins/cli/guest-js/index.ts b/packages/kbot/gui/app/plugins/cli/guest-js/index.ts
new file mode 100644
index 00000000..7a7f4acf
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/guest-js/index.ts
@@ -0,0 +1,72 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+/**
+ * Parse arguments from your Command Line Interface.
+ *
+ * @module
+ */
+
+import { invoke } from '@tauri-apps/api/core'
+
+/**
+ * @since 2.0.0
+ */
+interface ArgMatch {
+ /**
+ * string if takes value
+ * boolean if flag
+ * string[] or null if takes multiple values
+ */
+ value: string | boolean | string[] | null
+ /**
+ * Number of occurrences
+ */
+ occurrences: number
+}
+
+/**
+ * @since 2.0.0
+ */
+interface SubcommandMatch {
+ name: string
+ matches: CliMatches
+}
+
+/**
+ * @since 2.0.0
+ */
+interface CliMatches {
+ args: Record
+ subcommand: SubcommandMatch | null
+}
+
+/**
+ * Parse the arguments provided to the current process and get the matches using the configuration defined [`tauri.cli`](https://tauri.app/v1/api/config/#tauriconfig.cli) in `tauri.conf.json`
+ *
+ * @example
+ * ```typescript
+ * import { getMatches } from '@tauri-apps/plugin-cli';
+ * const matches = await getMatches();
+ * if (matches.subcommand?.name === 'run') {
+ * // `./your-app run $ARGS` was executed
+ * const args = matches.subcommand?.matches.args
+ * if ('debug' in args) {
+ * // `./your-app run --debug` was executed
+ * }
+ * } else {
+ * const args = matches.args
+ * // `./your-app $ARGS` was executed
+ * }
+ * ```
+ *
+ * @since 2.0.0
+ */
+async function getMatches(): Promise {
+ return await invoke('plugin:cli|cli_matches')
+}
+
+export type { ArgMatch, SubcommandMatch, CliMatches }
+
+export { getMatches }
diff --git a/packages/kbot/gui/app/plugins/cli/package.json b/packages/kbot/gui/app/plugins/cli/package.json
new file mode 100644
index 00000000..4aeeb8ec
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "@tauri-apps/plugin-cli",
+ "version": "2.4.0",
+ "license": "MIT OR Apache-2.0",
+ "authors": [
+ "Tauri Programme within The Commons Conservancy"
+ ],
+ "repository": "https://github.com/tauri-apps/plugins-workspace",
+ "type": "module",
+ "types": "./dist-js/index.d.ts",
+ "main": "./dist-js/index.cjs",
+ "module": "./dist-js/index.js",
+ "exports": {
+ "types": "./dist-js/index.d.ts",
+ "import": "./dist-js/index.js",
+ "require": "./dist-js/index.cjs"
+ },
+ "scripts": {
+ "build": "rollup -c"
+ },
+ "files": [
+ "dist-js",
+ "README.md",
+ "LICENSE"
+ ],
+ "dependencies": {
+ "@tauri-apps/api": "^2.8.0"
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/cli/permissions/autogenerated/commands/cli_matches.toml b/packages/kbot/gui/app/plugins/cli/permissions/autogenerated/commands/cli_matches.toml
new file mode 100644
index 00000000..b0a2e8f3
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/permissions/autogenerated/commands/cli_matches.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-cli-matches"
+description = "Enables the cli_matches command without any pre-configured scope."
+commands.allow = ["cli_matches"]
+
+[[permission]]
+identifier = "deny-cli-matches"
+description = "Denies the cli_matches command without any pre-configured scope."
+commands.deny = ["cli_matches"]
diff --git a/packages/kbot/gui/app/plugins/cli/permissions/autogenerated/reference.md b/packages/kbot/gui/app/plugins/cli/permissions/autogenerated/reference.md
new file mode 100644
index 00000000..cfa83f0a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/permissions/autogenerated/reference.md
@@ -0,0 +1,43 @@
+## Default Permission
+
+Allows reading the CLI matches
+
+#### This default permission set includes the following:
+
+- `allow-cli-matches`
+
+## Permission Table
+
+
+
+
Identifier
+
Description
+
+
+
+
+
+
+`cli:allow-cli-matches`
+
+
+
+
+Enables the cli_matches command without any pre-configured scope.
+
+
+
+
+
+
+
+`cli:deny-cli-matches`
+
+
+
+
+Denies the cli_matches command without any pre-configured scope.
+
+
+
+
diff --git a/packages/kbot/gui/app/plugins/cli/permissions/default.toml b/packages/kbot/gui/app/plugins/cli/permissions/default.toml
new file mode 100644
index 00000000..82bf7ca8
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/permissions/default.toml
@@ -0,0 +1,4 @@
+"$schema" = "schemas/schema.json"
+[default]
+description = "Allows reading the CLI matches"
+permissions = ["allow-cli-matches"]
diff --git a/packages/kbot/gui/app/plugins/cli/permissions/schemas/schema.json b/packages/kbot/gui/app/plugins/cli/permissions/schemas/schema.json
new file mode 100644
index 00000000..45941514
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/permissions/schemas/schema.json
@@ -0,0 +1,318 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "PermissionFile",
+ "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.",
+ "type": "object",
+ "properties": {
+ "default": {
+ "description": "The default permission set for the plugin",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/DefaultPermission"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "set": {
+ "description": "A list of permissions sets defined",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionSet"
+ }
+ },
+ "permission": {
+ "description": "A list of inlined permissions",
+ "default": [],
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Permission"
+ }
+ }
+ },
+ "definitions": {
+ "DefaultPermission": {
+ "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+ "type": "object",
+ "required": [
+ "permissions"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "PermissionSet": {
+ "description": "A set of direct permissions grouped together under a new name.",
+ "type": "object",
+ "required": [
+ "description",
+ "identifier",
+ "permissions"
+ ],
+ "properties": {
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does.",
+ "type": "string"
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionKind"
+ }
+ }
+ }
+ },
+ "Permission": {
+ "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
+ "type": "object",
+ "required": [
+ "identifier"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri internal convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "commands": {
+ "description": "Allowed or denied commands when using this permission.",
+ "default": {
+ "allow": [],
+ "deny": []
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/Commands"
+ }
+ ]
+ },
+ "scope": {
+ "description": "Allowed or denied scoped when using this permission.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Scopes"
+ }
+ ]
+ },
+ "platforms": {
+ "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Target"
+ }
+ }
+ }
+ },
+ "Commands": {
+ "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Allowed command.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "deny": {
+ "description": "Denied command, which takes priority.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "Scopes": {
+ "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Data that defines what is allowed by the scope.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ "deny": {
+ "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ }
+ },
+ "Value": {
+ "description": "All supported ACL values.",
+ "anyOf": [
+ {
+ "description": "Represents a null JSON value.",
+ "type": "null"
+ },
+ {
+ "description": "Represents a [`bool`].",
+ "type": "boolean"
+ },
+ {
+ "description": "Represents a valid ACL [`Number`].",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Number"
+ }
+ ]
+ },
+ {
+ "description": "Represents a [`String`].",
+ "type": "string"
+ },
+ {
+ "description": "Represents a list of other [`Value`]s.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ {
+ "description": "Represents a map of [`String`] keys to [`Value`]s.",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ ]
+ },
+ "Number": {
+ "description": "A valid ACL number.",
+ "anyOf": [
+ {
+ "description": "Represents an [`i64`].",
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "description": "Represents a [`f64`].",
+ "type": "number",
+ "format": "double"
+ }
+ ]
+ },
+ "Target": {
+ "description": "Platform target.",
+ "oneOf": [
+ {
+ "description": "MacOS.",
+ "type": "string",
+ "enum": [
+ "macOS"
+ ]
+ },
+ {
+ "description": "Windows.",
+ "type": "string",
+ "enum": [
+ "windows"
+ ]
+ },
+ {
+ "description": "Linux.",
+ "type": "string",
+ "enum": [
+ "linux"
+ ]
+ },
+ {
+ "description": "Android.",
+ "type": "string",
+ "enum": [
+ "android"
+ ]
+ },
+ {
+ "description": "iOS.",
+ "type": "string",
+ "enum": [
+ "iOS"
+ ]
+ }
+ ]
+ },
+ "PermissionKind": {
+ "type": "string",
+ "oneOf": [
+ {
+ "description": "Enables the cli_matches command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-cli-matches",
+ "markdownDescription": "Enables the cli_matches command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the cli_matches command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-cli-matches",
+ "markdownDescription": "Denies the cli_matches command without any pre-configured scope."
+ },
+ {
+ "description": "Allows reading the CLI matches\n#### This default permission set includes:\n\n- `allow-cli-matches`",
+ "type": "string",
+ "const": "default",
+ "markdownDescription": "Allows reading the CLI matches\n#### This default permission set includes:\n\n- `allow-cli-matches`"
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/cli/rollup.config.js b/packages/kbot/gui/app/plugins/cli/rollup.config.js
new file mode 100644
index 00000000..1f349ec8
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/rollup.config.js
@@ -0,0 +1,7 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import { createConfig } from '../../shared/rollup.config.js'
+
+export default createConfig()
diff --git a/packages/kbot/gui/app/plugins/cli/src/config.rs b/packages/kbot/gui/app/plugins/cli/src/config.rs
new file mode 100644
index 00000000..bd4a3015
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/src/config.rs
@@ -0,0 +1,184 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use std::collections::HashMap;
+
+use serde::Deserialize;
+
+/// A CLI argument definition.
+#[derive(Debug, PartialEq, Eq, Clone, Deserialize)]
+#[serde(rename_all = "camelCase", deny_unknown_fields)]
+pub struct Arg {
+ /// The short version of the argument, without the preceding -.
+ ///
+ /// NOTE: Any leading `-` characters will be stripped, and only the first non-character will be used as the short version.
+ pub short: Option,
+ /// The unique argument name
+ pub name: String,
+ /// The argument description which will be shown on the help information.
+ /// Typically, this is a short (one line) description of the arg.
+ pub description: Option,
+ /// The argument long description which will be shown on the help information.
+ /// Typically this a more detailed (multi-line) message that describes the argument.
+ #[serde(alias = "long-description")]
+ pub long_description: Option,
+ /// Specifies that the argument takes a value at run time.
+ ///
+ /// NOTE: values for arguments may be specified in any of the following methods
+ /// - Using a space such as -o value or --option value
+ /// - Using an equals and no space such as -o=value or --option=value
+ /// - Use a short and no space such as -ovalue
+ #[serde(default, alias = "takes-value")]
+ pub takes_value: bool,
+ /// Specifies that the argument may have an unknown number of multiple values. Without any other settings, this argument may appear only once.
+ ///
+ /// For example, --opt val1 val2 is allowed, but --opt val1 val2 --opt val3 is not.
+ ///
+ /// NOTE: Setting this requires `takes_value` to be set to true.
+ #[serde(default)]
+ pub multiple: bool,
+ /// Specifies how many values are required to satisfy this argument. For example, if you had a
+ /// `-f ` argument where you wanted exactly 3 'files' you would set
+ /// `number_of_values = 3`, and this argument wouldn't be satisfied unless the user provided
+ /// 3 and only 3 values.
+ ///
+ /// **NOTE:** Does *not* require `multiple_occurrences = true` to be set. Setting
+ /// `multiple_occurrences = true` would allow `-f -f ` where
+ /// as *not* setting it would only allow one occurrence of this argument.
+ ///
+ /// **NOTE:** implicitly sets `takes_value = true` and `multiple_values = true`.
+ #[serde(alias = "number-of-values")]
+ pub number_of_values: Option,
+ /// Specifies a list of possible values for this argument.
+ /// At runtime, the CLI verifies that only one of the specified values was used, or fails with an error message.
+ #[serde(alias = "possible-values")]
+ pub possible_values: Option>,
+ /// Specifies the minimum number of values for this argument.
+ /// For example, if you had a -f `` argument where you wanted at least 2 'files',
+ /// you would set `minValues: 2`, and this argument would be satisfied if the user provided, 2 or more values.
+ #[serde(alias = "min-values")]
+ pub min_values: Option,
+ /// Specifies the maximum number of values are for this argument.
+ /// For example, if you had a -f `` argument where you wanted up to 3 'files',
+ /// you would set .max_values(3), and this argument would be satisfied if the user provided, 1, 2, or 3 values.
+ #[serde(alias = "max-values")]
+ pub max_values: Option,
+ /// Sets whether or not the argument is required by default.
+ ///
+ /// - Required by default means it is required, when no other conflicting rules have been evaluated
+ /// - Conflicting rules take precedence over being required.
+ #[serde(default)]
+ pub required: bool,
+ /// Sets an arg that override this arg's required setting
+ /// i.e. this arg will be required unless this other argument is present.
+ #[serde(alias = "required-unless-present")]
+ pub required_unless_present: Option,
+ /// Sets args that override this arg's required setting
+ /// i.e. this arg will be required unless all these other arguments are present.
+ #[serde(alias = "required-unless-present-all")]
+ pub required_unless_present_all: Option>,
+ /// Sets args that override this arg's required setting
+ /// i.e. this arg will be required unless at least one of these other arguments are present.
+ #[serde(alias = "required-unless-present-any")]
+ pub required_unless_present_any: Option>,
+ /// Sets a conflicting argument by name
+ /// i.e. when using this argument, the following argument can't be present and vice versa.
+ #[serde(alias = "conflicts-with")]
+ pub conflicts_with: Option,
+ /// The same as conflictsWith but allows specifying multiple two-way conflicts per argument.
+ #[serde(alias = "conflicts-with-all")]
+ pub conflicts_with_all: Option>,
+ /// Tets an argument by name that is required when this one is present
+ /// i.e. when using this argument, the following argument must be present.
+ pub requires: Option,
+ /// Sts multiple arguments by names that are required when this one is present
+ /// i.e. when using this argument, the following arguments must be present.
+ #[serde(alias = "requires-all")]
+ pub requires_all: Option>,
+ /// Allows a conditional requirement with the signature [arg, value]
+ /// the requirement will only become valid if `arg`'s value equals `${value}`.
+ #[serde(alias = "requires-if")]
+ pub requires_if: Option<(String, String)>,
+ /// Allows specifying that an argument is required conditionally with the signature [arg, value]
+ /// the requirement will only become valid if the `arg`'s value equals `${value}`.
+ #[serde(alias = "required-if-eq")]
+ pub required_if_eq: Option<(String, String)>,
+ /// Requires that options use the --option=val syntax
+ /// i.e. an equals between the option and associated value.
+ #[serde(alias = "requires-equals")]
+ pub require_equals: Option,
+ /// The positional argument index, starting at 1.
+ ///
+ /// The index refers to position according to other positional argument.
+ /// It does not define position in the argument list as a whole. When utilized with multiple=true,
+ /// only the last positional argument may be defined as multiple (i.e. the one with the highest index).
+ pub index: Option,
+ /// Specifies whether the argument should be global.
+ ///
+ /// Global arguments are propagated to all subcommands automatically,
+ /// making them available throughout the CLI regardless of where they are defined.
+ #[serde(default)]
+ pub global: bool,
+}
+
+/// describes a CLI configuration
+#[derive(Debug, PartialEq, Eq, Clone, Deserialize)]
+#[serde(rename_all = "camelCase", deny_unknown_fields)]
+pub struct Config {
+ /// Command description which will be shown on the help information.
+ pub description: Option,
+ /// Command long description which will be shown on the help information.
+ #[serde(alias = "long-description")]
+ pub long_description: Option,
+ /// Adds additional help information to be displayed in addition to auto-generated help.
+ /// This information is displayed before the auto-generated help information.
+ /// This is often used for header information.
+ #[serde(alias = "before-help")]
+ pub before_help: Option,
+ /// Adds additional help information to be displayed in addition to auto-generated help.
+ /// This information is displayed after the auto-generated help information.
+ /// This is often used to describe how to use the arguments, or caveats to be noted.
+ #[serde(alias = "after-help")]
+ pub after_help: Option,
+ /// List of arguments for the command
+ pub args: Option>,
+ /// List of subcommands of this command
+ pub subcommands: Option>,
+}
+
+impl Config {
+ /// List of arguments for the command
+ pub fn args(&self) -> Option<&Vec> {
+ self.args.as_ref()
+ }
+
+ /// List of subcommands of this command
+ pub fn subcommands(&self) -> Option<&HashMap> {
+ self.subcommands.as_ref()
+ }
+
+ /// Command description which will be shown on the help information.
+ pub fn description(&self) -> Option<&String> {
+ self.description.as_ref()
+ }
+
+ /// Command long description which will be shown on the help information.
+ pub fn long_description(&self) -> Option<&String> {
+ self.description.as_ref()
+ }
+
+ /// Adds additional help information to be displayed in addition to auto-generated help.
+ /// This information is displayed before the auto-generated help information.
+ /// This is often used for header information.
+ pub fn before_help(&self) -> Option<&String> {
+ self.before_help.as_ref()
+ }
+
+ /// Adds additional help information to be displayed in addition to auto-generated help.
+ /// This information is displayed after the auto-generated help information.
+ /// This is often used to describe how to use the arguments, or caveats to be noted.
+ pub fn after_help(&self) -> Option<&String> {
+ self.after_help.as_ref()
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/cli/src/error.rs b/packages/kbot/gui/app/plugins/cli/src/error.rs
new file mode 100644
index 00000000..2b5e1602
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/src/error.rs
@@ -0,0 +1,22 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use serde::{Serialize, Serializer};
+
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+ #[error("failed to parse arguments: {0}")]
+ ParseCli(#[from] clap::Error),
+}
+
+impl Serialize for Error {
+ fn serialize(&self, serializer: S) -> std::result::Result
+ where
+ S: Serializer,
+ {
+ serializer.serialize_str(self.to_string().as_ref())
+ }
+}
+
+pub type Result = std::result::Result;
diff --git a/packages/kbot/gui/app/plugins/cli/src/lib.rs b/packages/kbot/gui/app/plugins/cli/src/lib.rs
new file mode 100644
index 00000000..e927a348
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/src/lib.rs
@@ -0,0 +1,63 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+//! Parse arguments from your Command Line Interface.
+//!
+//! - Supported platforms: Windows, Linux and macOS.
+
+#![doc(
+ html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
+ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
+)]
+
+use tauri::{
+ plugin::{Builder, PluginApi, TauriPlugin},
+ AppHandle, Manager, Runtime, State,
+};
+
+mod config;
+mod error;
+mod parser;
+
+use config::{Arg, Config};
+
+pub use error::{Error, Result};
+pub use parser::{ArgData, Matches, SubcommandMatches};
+
+pub struct Cli(PluginApi);
+
+impl Cli {
+ pub fn matches(&self) -> Result {
+ parser::get_matches(self.0.config(), self.0.app().package_info(), None)
+ }
+
+ pub fn matches_from(&self, args: Vec) -> Result {
+ parser::get_matches(self.0.config(), self.0.app().package_info(), Some(args))
+ }
+}
+
+pub trait CliExt {
+ fn cli(&self) -> &Cli;
+}
+
+impl> CliExt for T {
+ fn cli(&self) -> &Cli {
+ self.state::>().inner()
+ }
+}
+
+#[tauri::command]
+fn cli_matches(_app: AppHandle, cli: State<'_, Cli>) -> Result {
+ cli.matches()
+}
+
+pub fn init() -> TauriPlugin {
+ Builder::new("cli")
+ .invoke_handler(tauri::generate_handler![cli_matches])
+ .setup(|app, api| {
+ app.manage(Cli(api));
+ Ok(())
+ })
+ .build()
+}
diff --git a/packages/kbot/gui/app/plugins/cli/src/parser.rs b/packages/kbot/gui/app/plugins/cli/src/parser.rs
new file mode 100644
index 00000000..466885f1
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/src/parser.rs
@@ -0,0 +1,295 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use clap::{
+ builder::{PossibleValue, PossibleValuesParser},
+ error::ErrorKind,
+ Arg as ClapArg, ArgAction, ArgMatches, Command,
+};
+use serde::Serialize;
+use serde_json::Value;
+use tauri::PackageInfo;
+
+use crate::{Arg, Config};
+
+use std::collections::HashMap;
+
+#[macro_use]
+mod macros;
+
+/// The resolution of a argument match.
+#[derive(Default, Debug, Serialize, Clone)]
+#[non_exhaustive]
+pub struct ArgData {
+ /// - [`Value::Bool`] if it's a flag,
+ /// - [`Value::Array`] if it's multiple,
+ /// - [`Value::String`] if it has value,
+ /// - [`Value::Null`] otherwise.
+ pub value: Value,
+ /// The number of occurrences of the argument.
+ /// e.g. `./app --arg 1 --arg 2 --arg 2 3 4` results in three occurrences.
+ pub occurrences: u8,
+}
+
+/// The matched subcommand.
+#[derive(Default, Debug, Serialize, Clone)]
+#[non_exhaustive]
+pub struct SubcommandMatches {
+ /// The subcommand name.
+ pub name: String,
+ /// The subcommand argument matches.
+ pub matches: Matches,
+}
+
+/// The argument matches of a command.
+#[derive(Default, Debug, Serialize, Clone)]
+#[non_exhaustive]
+pub struct Matches {
+ /// Data structure mapping each found arg with its resolution.
+ pub args: HashMap,
+ /// The matched subcommand if found.
+ pub subcommand: Option>,
+}
+
+impl Matches {
+ /// Set a arg match.
+ pub(crate) fn set_arg(&mut self, name: String, value: ArgData) {
+ self.args.insert(name, value);
+ }
+
+ /// Sets the subcommand matches.
+ pub(crate) fn set_subcommand(&mut self, name: String, matches: Matches) {
+ self.subcommand = Some(Box::new(SubcommandMatches { name, matches }));
+ }
+}
+
+/// Gets the argument matches of the CLI definition.
+///
+/// This is a low level API. If the application has been built,
+/// prefer [`App::get_cli_matches`](`crate::App#method.get_cli_matches`).
+///
+/// # Examples
+///
+/// ```rust,no_run
+/// use tauri_plugin_cli::CliExt;
+/// tauri::Builder::default()
+/// .setup(|app| {
+/// let matches = app.cli().matches()?;
+/// Ok(())
+/// });
+/// ```
+pub fn get_matches(
+ cli: &Config,
+ package_info: &PackageInfo,
+ args: Option>,
+) -> crate::Result {
+ let about = cli
+ .description()
+ .unwrap_or(&package_info.description.to_string())
+ .to_string();
+ let version = package_info.version.to_string();
+ let app = get_app(
+ package_info,
+ version,
+ package_info.name.clone(),
+ Some(&about),
+ cli,
+ );
+
+ let matches = if let Some(args) = args {
+ app.try_get_matches_from(args)
+ } else {
+ app.try_get_matches()
+ };
+
+ match matches {
+ Ok(matches) => Ok(get_matches_internal(cli, &matches)),
+ Err(e) => match e.kind() {
+ ErrorKind::DisplayHelp => {
+ let mut matches = Matches::default();
+ let help_text = e.to_string();
+ matches.args.insert(
+ "help".to_string(),
+ ArgData {
+ value: Value::String(help_text),
+ occurrences: 0,
+ },
+ );
+ Ok(matches)
+ }
+ ErrorKind::DisplayVersion => {
+ let mut matches = Matches::default();
+ matches
+ .args
+ .insert("version".to_string(), Default::default());
+ Ok(matches)
+ }
+ _ => Err(e.into()),
+ },
+ }
+}
+
+fn get_matches_internal(config: &Config, matches: &ArgMatches) -> Matches {
+ let mut cli_matches = Matches::default();
+ map_matches(config, matches, &mut cli_matches);
+
+ if let Some((subcommand_name, subcommand_matches)) = matches.subcommand() {
+ if let Some(subcommand_config) = config
+ .subcommands
+ .as_ref()
+ .and_then(|s| s.get(subcommand_name))
+ {
+ cli_matches.set_subcommand(
+ subcommand_name.to_string(),
+ get_matches_internal(subcommand_config, subcommand_matches),
+ );
+ }
+ }
+
+ cli_matches
+}
+
+fn map_matches(config: &Config, matches: &ArgMatches, cli_matches: &mut Matches) {
+ if let Some(args) = config.args() {
+ for arg in args {
+ let (occurrences, value) = if arg.takes_value {
+ if arg.multiple {
+ matches
+ .get_many::(&arg.name)
+ .map(|v| {
+ let mut values = Vec::new();
+ for value in v {
+ values.push(Value::String(value.into()));
+ }
+ (values.len() as u8, Value::Array(values))
+ })
+ .unwrap_or((0, Value::Null))
+ } else {
+ matches
+ .get_one::(&arg.name)
+ .map(|v| (1, Value::String(v.clone())))
+ .unwrap_or((0, Value::Null))
+ }
+ } else {
+ let occurrences = matches.get_count(&arg.name);
+ (occurrences, Value::Bool(occurrences > 0))
+ };
+
+ cli_matches.set_arg(arg.name.clone(), ArgData { value, occurrences });
+ }
+ }
+}
+
+fn get_app(
+ package_info: &PackageInfo,
+ version: String,
+ command_name: String,
+ about: Option<&String>,
+ config: &Config,
+) -> Command {
+ let mut app = Command::new(command_name)
+ .author(package_info.authors)
+ .version(version.clone());
+
+ if let Some(about) = about {
+ app = app.about(about);
+ }
+ if let Some(long_description) = config.long_description() {
+ app = app.long_about(long_description);
+ }
+ if let Some(before_help) = config.before_help() {
+ app = app.before_help(before_help);
+ }
+ if let Some(after_help) = config.after_help() {
+ app = app.after_help(after_help);
+ }
+
+ if let Some(args) = config.args() {
+ for arg in args {
+ app = app.arg(get_arg(arg.name.clone(), arg));
+ }
+ }
+
+ if let Some(subcommands) = config.subcommands() {
+ for (subcommand_name, subcommand) in subcommands {
+ let clap_subcommand = get_app(
+ package_info,
+ version.clone(),
+ subcommand_name.to_string(),
+ subcommand.description(),
+ subcommand,
+ );
+ app = app.subcommand(clap_subcommand);
+ }
+ }
+
+ app
+}
+
+fn get_arg(arg_name: String, arg: &Arg) -> ClapArg {
+ let mut clap_arg = ClapArg::new(arg_name.clone());
+
+ if arg.index.is_none() {
+ clap_arg = clap_arg.long(arg_name);
+ if let Some(short) = arg.short {
+ clap_arg = clap_arg.short(short);
+ }
+ }
+
+ clap_arg = bind_string_arg!(arg, clap_arg, description, help);
+ clap_arg = bind_string_arg!(arg, clap_arg, long_description, long_help);
+
+ let action = if arg.multiple {
+ ArgAction::Append
+ } else if arg.takes_value {
+ ArgAction::Set
+ } else {
+ ArgAction::Count
+ };
+
+ clap_arg = clap_arg.action(action);
+
+ clap_arg = bind_value_arg!(arg, clap_arg, number_of_values);
+
+ if let Some(values) = &arg.possible_values {
+ clap_arg = clap_arg.value_parser(PossibleValuesParser::new(
+ values
+ .iter()
+ .map(PossibleValue::new)
+ .collect::>(),
+ ));
+ }
+
+ clap_arg = match (arg.min_values, arg.max_values) {
+ (Some(min), Some(max)) => clap_arg.num_args(min..=max),
+ (Some(min), None) => clap_arg.num_args(min..),
+ (None, Some(max)) => clap_arg.num_args(0..max),
+ (None, None) => clap_arg,
+ };
+ clap_arg = clap_arg.required(arg.required);
+ clap_arg = bind_string_arg!(
+ arg,
+ clap_arg,
+ required_unless_present,
+ required_unless_present
+ );
+ clap_arg = bind_string_slice_arg!(arg, clap_arg, required_unless_present_all);
+ clap_arg = bind_string_slice_arg!(arg, clap_arg, required_unless_present_any);
+ clap_arg = bind_string_arg!(arg, clap_arg, conflicts_with, conflicts_with);
+ if let Some(value) = &arg.conflicts_with_all {
+ clap_arg = clap_arg.conflicts_with_all(value);
+ }
+ clap_arg = bind_string_arg!(arg, clap_arg, requires, requires);
+ if let Some(value) = &arg.requires_all {
+ clap_arg = clap_arg.requires_all(value);
+ }
+ clap_arg = bind_if_arg!(arg, clap_arg, requires_if);
+ clap_arg = bind_if_arg!(arg, clap_arg, required_if_eq);
+ clap_arg = bind_value_arg!(arg, clap_arg, require_equals);
+ clap_arg = bind_value_arg!(arg, clap_arg, index);
+
+ clap_arg = clap_arg.global(arg.global);
+
+ clap_arg
+}
diff --git a/packages/kbot/gui/app/plugins/cli/src/parser/macros.rs b/packages/kbot/gui/app/plugins/cli/src/parser/macros.rs
new file mode 100644
index 00000000..2c3c66ec
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/src/parser/macros.rs
@@ -0,0 +1,47 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+macro_rules! bind_string_arg {
+ ($arg:expr, $clap_arg:expr, $arg_name:ident, $clap_field:ident) => {{
+ let arg = $arg;
+ let mut clap_arg = $clap_arg;
+ if let Some(value) = &arg.$arg_name {
+ clap_arg = clap_arg.$clap_field(value);
+ }
+ clap_arg
+ }};
+}
+
+macro_rules! bind_value_arg {
+ ($arg:expr, $clap_arg:expr, $field:ident) => {{
+ let arg = $arg;
+ let mut clap_arg = $clap_arg;
+ if let Some(value) = arg.$field {
+ clap_arg = clap_arg.$field(value);
+ }
+ clap_arg
+ }};
+}
+
+macro_rules! bind_string_slice_arg {
+ ($arg:expr, $clap_arg:expr, $field:ident) => {{
+ let arg = $arg;
+ let mut clap_arg = $clap_arg;
+ if let Some(value) = &arg.$field {
+ clap_arg = clap_arg.$field(value);
+ }
+ clap_arg
+ }};
+}
+
+macro_rules! bind_if_arg {
+ ($arg:expr, $clap_arg:expr, $field:ident) => {{
+ let arg = $arg;
+ let mut clap_arg = $clap_arg;
+ if let Some((value, arg)) = &arg.$field {
+ clap_arg = clap_arg.$field(value, arg);
+ }
+ clap_arg
+ }};
+}
diff --git a/packages/kbot/gui/app/plugins/cli/tsconfig.json b/packages/kbot/gui/app/plugins/cli/tsconfig.json
new file mode 100644
index 00000000..5098169a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/cli/tsconfig.json
@@ -0,0 +1,4 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "include": ["guest-js/*.ts"]
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/CHANGELOG.md b/packages/kbot/gui/app/plugins/clipboard-manager/CHANGELOG.md
new file mode 100644
index 00000000..4f0460d2
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/CHANGELOG.md
@@ -0,0 +1,140 @@
+# Changelog
+
+## \[2.3.0]
+
+- [`f209b2f2`](https://github.com/tauri-apps/plugins-workspace/commit/f209b2f23cb29133c97ad5961fb46ef794dbe063) ([#2804](https://github.com/tauri-apps/plugins-workspace/pull/2804) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Updated tauri to 2.6
+
+## \[2.2.3]
+
+- [`f634e524`](https://github.com/tauri-apps/plugins-workspace/commit/f634e5248ebe428f8305a59f74c13fc15147fb8e) This is an "empty" release to update the plugins' source files on crates.io and docs.rs. This should fix docs.rs build failures for projects using tauri plugins as dependencies.
+
+## \[2.2.2]
+
+### bug
+
+- [`d37bbdef`](https://github.com/tauri-apps/plugins-workspace/commit/d37bbdef8dc70e61e59f9fe0bb8b2a48999d0aa1) ([#2507](https://github.com/tauri-apps/plugins-workspace/pull/2507) by [@SquitchYT](https://github.com/tauri-apps/plugins-workspace/../../SquitchYT)) Fix clipboard-manager Wayland support.
+
+## \[2.2.1]
+
+- [`ce11079f`](https://github.com/tauri-apps/plugins-workspace/commit/ce11079f19852fbefdecf0e4c7d947af3624fee0) ([#2280](https://github.com/tauri-apps/plugins-workspace/pull/2280) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Explicitly drop `arboard::Clipboard` on exit. Add recommendation to not use read methods on the mainthread.
+
+## \[2.2.0]
+
+- [`3a79266b`](https://github.com/tauri-apps/plugins-workspace/commit/3a79266b8cf96a55b1ae6339d725567d45a44b1d) ([#2173](https://github.com/tauri-apps/plugins-workspace/pull/2173) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Bumped all plugins to `v2.2.0`. From now, the versions for the Rust and JavaScript packages of each plugin will be in sync with each other.
+
+## \[2.0.1]
+
+- [`3fa0fc09`](https://github.com/tauri-apps/plugins-workspace/commit/3fa0fc09bbee0d619801e5757af9fb3c09883c97) ([#2099](https://github.com/tauri-apps/plugins-workspace/pull/2099) by [@rasteiner](https://github.com/tauri-apps/plugins-workspace/../../rasteiner)) Fix clipboard manager client side api not copying fallback alternative text when calling `writeHtml`.
+
+## \[2.0.2]
+
+- [`d57df4de`](https://github.com/tauri-apps/plugins-workspace/commit/d57df4debe7c75cfbd6d6558fff1beb07dbee54c) ([#1986](https://github.com/tauri-apps/plugins-workspace/pull/1986) by [@RikaKagurasaka](https://github.com/tauri-apps/plugins-workspace/../../RikaKagurasaka)) Fix that `read_image` wrongly set the image rgba data with binary PNG data.
+
+## \[2.0.1]
+
+- [`a1a82208`](https://github.com/tauri-apps/plugins-workspace/commit/a1a82208ed4ab87f83310be0dc95428aec9ab241) ([#1873](https://github.com/tauri-apps/plugins-workspace/pull/1873) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Downgrade MSRV to 1.77.2 to support Windows 7.
+
+## \[2.0.0]
+
+- [`e2c4dfb6`](https://github.com/tauri-apps/plugins-workspace/commit/e2c4dfb6af43e5dd8d9ceba232c315f5febd55c1) Update to tauri v2 stable release.
+
+## \[2.0.0-rc.2]
+
+- [`341a5320`](https://github.com/tauri-apps/plugins-workspace/commit/341a5320c33d3c7b041abf7eb0ab7ad8009e6c3f) ([#1771](https://github.com/tauri-apps/plugins-workspace/pull/1771)) Fix warnings and clear implementation on Android below SDK 28.
+
+## \[2.0.0-rc.1]
+
+- [`e2e97db5`](https://github.com/tauri-apps/plugins-workspace/commit/e2e97db51983267f5be84d4f6f0278d58834d1f5) ([#1701](https://github.com/tauri-apps/plugins-workspace/pull/1701) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri 2.0.0-rc.8
+
+## \[2.0.0-rc.2]
+
+- [`b9147758`](https://github.com/tauri-apps/plugins-workspace/commit/b914775898c2bee7ceb20bd17ee595005cd17a64) ([#1679](https://github.com/tauri-apps/plugins-workspace/pull/1679) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Explicitly set a minimum macOS version for the Swift package.
+
+## \[2.0.0-rc.1]
+
+- [`2c00c029`](https://github.com/tauri-apps/plugins-workspace/commit/2c00c0292c9127b81567de46691e8c0f73557261) ([#1630](https://github.com/tauri-apps/plugins-workspace/pull/1630) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) Fixed an issue that caused multi-word IIFE names to not be formatted correctly. For example the `barcode-scanner` was defined as `window.__TAURI_PLUGIN_CLIPBOARDMANAGER__` instead of `window.__TAURI_PLUGIN_CLIPBOARD_MANAGER__`.
+
+### changes
+
+- [`6b079cfd`](https://github.com/tauri-apps/plugins-workspace/commit/6b079cfdd107c94abc2c7300f6af00bac3ff4040) ([#1649](https://github.com/tauri-apps/plugins-workspace/pull/1649) by [@ahqsoftwares](https://github.com/tauri-apps/plugins-workspace/../../ahqsoftwares)) Remove targetSdk from build.kts files as it is deprecated and will be removed from DSL v9.0
+
+## \[2.0.0-rc.0]
+
+- [`9887d1`](https://github.com/tauri-apps/plugins-workspace/commit/9887d14bd0e971c4c0f5c1188fc4005d3fc2e29e) Update to tauri RC.
+
+## \[2.1.0-beta.6]
+
+- [`99d6ac0f`](https://github.com/tauri-apps/plugins-workspace/commit/99d6ac0f9506a6a4a1aa59c728157190a7441af6) ([#1606](https://github.com/tauri-apps/plugins-workspace/pull/1606) by [@FabianLars](https://github.com/tauri-apps/plugins-workspace/../../FabianLars)) The JS packages now specify the *minimum* `@tauri-apps/api` version instead of a single exact version.
+- [`6de87966`](https://github.com/tauri-apps/plugins-workspace/commit/6de87966ecc00ad9d91c25be452f1f46bd2b7e1f) ([#1597](https://github.com/tauri-apps/plugins-workspace/pull/1597) by [@Legend-Master](https://github.com/tauri-apps/plugins-workspace/../../Legend-Master)) Update to tauri beta.25.
+
+## \[2.1.0-beta.5]
+
+- [`22a17980`](https://github.com/tauri-apps/plugins-workspace/commit/22a17980ff4f6f8c40adb1b8f4ffc6dae2fe7e30) ([#1537](https://github.com/tauri-apps/plugins-workspace/pull/1537) by [@lucasfernog](https://github.com/tauri-apps/plugins-workspace/../../lucasfernog)) Update to tauri beta.24.
+
+## \[2.1.0-beta.4]
+
+- [`76daee7a`](https://github.com/tauri-apps/plugins-workspace/commit/76daee7aafece34de3092c86e531cf9eb1138989) ([#1512](https://github.com/tauri-apps/plugins-workspace/pull/1512) by [@renovate](https://github.com/tauri-apps/plugins-workspace/../../renovate)) Update to tauri beta.23.
+
+## \[2.1.0-beta.3]
+
+- [`9013854f`](https://github.com/tauri-apps/plugins-workspace/commit/9013854f42a49a230b9dbb9d02774765528a923f)([#1382](https://github.com/tauri-apps/plugins-workspace/pull/1382)) Update to tauri beta.22.
+
+## \[2.1.0-beta.2]
+
+- [`430bd6f4`](https://github.com/tauri-apps/plugins-workspace/commit/430bd6f4f379bee5d232ae6b098ae131db7f178a)([#1363](https://github.com/tauri-apps/plugins-workspace/pull/1363)) Update to tauri beta.20.
+
+## \[2.1.0-beta.1]
+
+- [`bd1ed590`](https://github.com/tauri-apps/plugins-workspace/commit/bd1ed5903ffcce5500310dac1e59e8c67674ef1e)([#1237](https://github.com/tauri-apps/plugins-workspace/pull/1237)) Update to tauri beta.17.
+
+## \[2.1.0-beta.1]
+
+- [`27b258c`](https://github.com/tauri-apps/plugins-workspace/commit/27b258cf31ae5557c99ae66537fb9196368d4d8b)([#1185](https://github.com/tauri-apps/plugins-workspace/pull/1185)) Expose `Clipboard` struct
+- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Internally use the webview scoped resources table instead of the app one, so other webviews can't access other webviews resources.
+- [`e3d41f4`](https://github.com/tauri-apps/plugins-workspace/commit/e3d41f4011bd3ea3ce281bb38bbe31d3709f8e0f)([#1191](https://github.com/tauri-apps/plugins-workspace/pull/1191)) Update for tauri 2.0.0-beta.15.
+
+## \[2.1.0-beta.0]
+
+- [`9dec960`](https://github.com/tauri-apps/plugins-workspace/commit/9dec9605ed1ce19dbef697e55debddf9008ecba1)([#845](https://github.com/tauri-apps/plugins-workspace/pull/845)) Add support for `read_image` and `write_image` to the clipboard plugin (desktop).
+
+## \[2.0.0-beta.2]
+
+- [`dc6d332`](https://github.com/tauri-apps/plugins-workspace/commit/dc6d3321e5305fa8b7250553bd179cbee995998a)([#977](https://github.com/tauri-apps/plugins-workspace/pull/977)) Add support for writing HTML content to the clipboard.
+- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.
+
+## \[2.0.0-beta.1]
+
+- [`569defb`](https://github.com/tauri-apps/plugins-workspace/commit/569defbe9492e38938554bb7bdc1be9151456d21) Update to tauri beta.4.
+
+## \[2.0.0-beta.0]
+
+- [`d198c01`](https://github.com/tauri-apps/plugins-workspace/commit/d198c014863ee260cb0de88a14b7fc4356ef7474)([#862](https://github.com/tauri-apps/plugins-workspace/pull/862)) Update to tauri beta.
+- [`d198c01`](https://github.com/tauri-apps/plugins-workspace/commit/d198c014863ee260cb0de88a14b7fc4356ef7474)([#862](https://github.com/tauri-apps/plugins-workspace/pull/862)) Add permissions.
+
+## \[2.0.0-alpha.5]
+
+- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.13.
+
+## \[2.0.0-alpha.4]
+
+- [`387c2f9`](https://github.com/tauri-apps/plugins-workspace/commit/387c2f9e0ce4c75c07ffa3fd76391a25b58f5daf)([#802](https://github.com/tauri-apps/plugins-workspace/pull/802)) Update to @tauri-apps/api v2.0.0-alpha.12.
+
+## \[2.0.0-alpha.3]
+
+- [`e438e0a`](https://github.com/tauri-apps/plugins-workspace/commit/e438e0a62d4b430a5159f05f13ecd397dd891a0d)([#676](https://github.com/tauri-apps/plugins-workspace/pull/676)) Update to @tauri-apps/api v2.0.0-alpha.11.
+
+## \[2.0.0-alpha.2]
+
+- [`5c13736`](https://github.com/tauri-apps/plugins-workspace/commit/5c137365c60790e8d4037d449e8237aa3fffdab0)([#673](https://github.com/tauri-apps/plugins-workspace/pull/673)) Update to @tauri-apps/api v2.0.0-alpha.9.
+
+## \[2.0.0-alpha.2]
+
+- [`4e2cef9`](https://github.com/tauri-apps/plugins-workspace/commit/4e2cef9b702bbbb9cf4ee17de50791cb21f1b2a4)([#593](https://github.com/tauri-apps/plugins-workspace/pull/593)) Update to alpha.12.
+
+## \[2.0.0-alpha.1]
+
+- [`d74fc0a`](https://github.com/tauri-apps/plugins-workspace/commit/d74fc0a097996e90a37be8f57d50b7d1f6ca616f)([#555](https://github.com/tauri-apps/plugins-workspace/pull/555)) Update to alpha.11.
+
+## \[2.0.0-alpha.0]
+
+- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/Cargo.toml b/packages/kbot/gui/app/plugins/clipboard-manager/Cargo.toml
new file mode 100644
index 00000000..624336ec
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/Cargo.toml
@@ -0,0 +1,39 @@
+[package]
+name = "tauri-plugin-clipboard-manager"
+version = "2.3.0"
+description = "Read and write to the system clipboard."
+edition = { workspace = true }
+authors = { workspace = true }
+license = { workspace = true }
+rust-version = { workspace = true }
+repository = { workspace = true }
+links = "tauri-plugin-clipboard-manager"
+
+[package.metadata.docs.rs]
+rustc-args = ["--cfg", "docsrs"]
+rustdoc-args = ["--cfg", "docsrs"]
+targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
+
+[package.metadata.platforms.support]
+windows = { level = "full", notes = "" }
+linux = { level = "full", notes = "" }
+macos = { level = "full", notes = "" }
+android = { level = "partial", notes = "Only plain-text content support" }
+ios = { level = "partial", notes = "Only plain-text content support" }
+
+
+[build-dependencies]
+tauri-plugin = { workspace = true, features = ["build"] }
+
+[dependencies]
+serde = { workspace = true }
+serde_json = { workspace = true }
+tauri = { workspace = true }
+log = { workspace = true }
+thiserror = { workspace = true }
+
+[target.'cfg(target_os = "ios")'.dependencies]
+tauri = { workspace = true, features = ["wry"] }
+
+[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
+arboard = { version = "3", features = ["wayland-data-control"] }
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/LICENSE.spdx b/packages/kbot/gui/app/plugins/clipboard-manager/LICENSE.spdx
new file mode 100644
index 00000000..cdd0df5a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/LICENSE.spdx
@@ -0,0 +1,20 @@
+SPDXVersion: SPDX-2.1
+DataLicense: CC0-1.0
+PackageName: tauri
+DataFormat: SPDXRef-1
+PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
+PackageHomePage: https://tauri.app
+PackageLicenseDeclared: Apache-2.0
+PackageLicenseDeclared: MIT
+PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy
+PackageSummary: Tauri is a rust project that enables developers to make secure
+and small desktop applications using a web frontend.
+
+PackageComment: The package includes the following libraries; see
+Relationship information.
+
+Created: 2019-05-20T09:00:00Z
+PackageDownloadLocation: git://github.com/tauri-apps/tauri
+PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git
+PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git
+Creator: Person: Daniel Thompson-Yvetot
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/LICENSE_APACHE-2.0 b/packages/kbot/gui/app/plugins/clipboard-manager/LICENSE_APACHE-2.0
new file mode 100644
index 00000000..4947287f
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/LICENSE_APACHE-2.0
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/LICENSE_MIT b/packages/kbot/gui/app/plugins/clipboard-manager/LICENSE_MIT
new file mode 100644
index 00000000..4d754725
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/LICENSE_MIT
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 - Present Tauri Apps Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/README.md b/packages/kbot/gui/app/plugins/clipboard-manager/README.md
new file mode 100644
index 00000000..b2353f97
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/README.md
@@ -0,0 +1,96 @@
+
+
+Read and write to the system clipboard.
+
+| Platform | Supported |
+| -------- | --------- |
+| Linux | ✓ |
+| Windows | ✓ |
+| macOS | ✓ |
+| Android | ✓ |
+| iOS | ✓ |
+
+## Install
+
+_This plugin requires a Rust version of at least **1.77.2**_
+
+There are three general methods of installation that we can recommend.
+
+1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
+2. Pull sources directly from Github using git tags / revision hashes (most secure)
+3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)
+
+Install the Core plugin by adding the following to your `Cargo.toml` file:
+
+`src-tauri/Cargo.toml`
+
+```toml
+[dependencies]
+tauri-plugin-clipboard-manager = "2.0.0"
+# alternatively with Git:
+tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
+```
+
+You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
+
+```sh
+pnpm add @tauri-apps/plugin-clipboard-manager
+# or
+npm add @tauri-apps/plugin-clipboard-manager
+# or
+yarn add @tauri-apps/plugin-clipboard-manager
+```
+
+## Usage
+
+First you need to register the core plugin with Tauri:
+
+`src-tauri/src/lib.rs`
+
+```rust
+fn main() {
+ tauri::Builder::default()
+ .plugin(tauri_plugin_clipboard_manager::init())
+ .run(tauri::generate_context!())
+ .expect("error while running tauri application");
+}
+```
+
+Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
+
+```javascript
+import {
+ writeText,
+ readText,
+ writeHtml,
+ clear
+} from '@tauri-apps/plugin-clipboard-manager'
+await writeText('Tauri is awesome!')
+assert(await readText(), 'Tauri is awesome!')
+```
+
+## Contributing
+
+PRs accepted. Please make sure to read the Contributing Guide before making a pull request.
+
+## Partners
+
+
+
+For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri).
+
+## License
+
+Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.
+
+MIT or MIT/Apache 2.0 where applicable.
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/SECURITY.md b/packages/kbot/gui/app/plugins/clipboard-manager/SECURITY.md
new file mode 100644
index 00000000..4f09bbac
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/SECURITY.md
@@ -0,0 +1,23 @@
+# Security Policy
+
+**Do not report security vulnerabilities through public GitHub issues.**
+
+**Please use the [Private Vulnerability Disclosure](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) feature of GitHub.**
+
+Include as much of the following information:
+
+- Type of issue (e.g. improper input parsing, privilege escalation, etc.)
+- The location of the affected source code (tag/branch/commit or direct URL)
+- Any special configuration required to reproduce the issue
+- The distribution affected or used to help us with reproduction of the issue
+- Step-by-step instructions to reproduce the issue
+- Ideally a reproduction repository
+- Impact of the issue, including how an attacker might exploit the issue
+
+We prefer to receive reports in English.
+
+## Contact
+
+Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new).
+
+Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/android/.gitignore b/packages/kbot/gui/app/plugins/clipboard-manager/android/.gitignore
new file mode 100644
index 00000000..c0f21ec2
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/android/.gitignore
@@ -0,0 +1,2 @@
+/build
+/.tauri
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/android/build.gradle.kts b/packages/kbot/gui/app/plugins/clipboard-manager/android/build.gradle.kts
new file mode 100644
index 00000000..b12a7482
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/android/build.gradle.kts
@@ -0,0 +1,45 @@
+plugins {
+ id("com.android.library")
+ id("org.jetbrains.kotlin.android")
+}
+
+android {
+ namespace = "app.tauri.clipboard"
+ compileSdk = 34
+
+ defaultConfig {
+ minSdk = 24
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles("consumer-rules.pro")
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+ kotlinOptions {
+ jvmTarget = "1.8"
+ }
+}
+
+dependencies {
+
+ implementation("androidx.core:core-ktx:1.9.0")
+ implementation("androidx.appcompat:appcompat:1.6.0")
+ implementation("com.google.android.material:material:1.7.0")
+ implementation("com.fasterxml.jackson.core:jackson-databind:2.15.3")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
+ implementation(project(":tauri-android"))
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/android/proguard-rules.pro b/packages/kbot/gui/app/plugins/clipboard-manager/android/proguard-rules.pro
new file mode 100644
index 00000000..481bb434
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/android/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/android/settings.gradle b/packages/kbot/gui/app/plugins/clipboard-manager/android/settings.gradle
new file mode 100644
index 00000000..14a752e4
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/android/settings.gradle
@@ -0,0 +1,2 @@
+include ':tauri-android'
+project(':tauri-android').projectDir = new File('./.tauri/tauri-api')
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/android/src/androidTest/java/ExampleInstrumentedTest.kt b/packages/kbot/gui/app/plugins/clipboard-manager/android/src/androidTest/java/ExampleInstrumentedTest.kt
new file mode 100644
index 00000000..02e6984b
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/android/src/androidTest/java/ExampleInstrumentedTest.kt
@@ -0,0 +1,28 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+package app.tauri.clipboard
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+ @Test
+ fun useAppContext() {
+ // Context of the app under test.
+ val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+ assertEquals("app.tauri.clipboard", appContext.packageName)
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/android/src/main/AndroidManifest.xml b/packages/kbot/gui/app/plugins/clipboard-manager/android/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..9a40236b
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/android/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/android/src/main/java/ClipboardPlugin.kt b/packages/kbot/gui/app/plugins/clipboard-manager/android/src/main/java/ClipboardPlugin.kt
new file mode 100644
index 00000000..ebb931b4
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/android/src/main/java/ClipboardPlugin.kt
@@ -0,0 +1,142 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+package app.tauri.clipboard
+
+import android.app.Activity
+import android.content.ClipData
+import android.content.ClipDescription
+import android.content.ClipboardManager
+import android.content.Context
+import android.os.Build
+import app.tauri.annotation.Command
+import app.tauri.annotation.InvokeArg
+import app.tauri.annotation.TauriPlugin
+import app.tauri.plugin.Invoke
+import app.tauri.plugin.Plugin
+import com.fasterxml.jackson.core.JsonGenerator
+import com.fasterxml.jackson.core.JsonParser
+import com.fasterxml.jackson.core.JsonProcessingException
+import com.fasterxml.jackson.databind.DeserializationContext
+import com.fasterxml.jackson.databind.JsonDeserializer
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.SerializerProvider
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+import com.fasterxml.jackson.databind.annotation.JsonSerialize
+import com.fasterxml.jackson.databind.ser.std.StdSerializer
+import java.io.IOException
+
+@InvokeArg
+@JsonDeserialize(using = WriteOptionsDeserializer::class)
+sealed class WriteOptions {
+ @JsonDeserialize
+ class PlainText: WriteOptions() {
+ lateinit var text: String
+ var label: String? = null
+ }
+}
+
+@JsonSerialize(using = ReadClipDataSerializer::class)
+sealed class ReadClipData {
+ class PlainText: ReadClipData() {
+ lateinit var text: String
+ }
+}
+
+internal class ReadClipDataSerializer @JvmOverloads constructor(t: Class? = null) :
+ StdSerializer(t) {
+ @Throws(IOException::class, JsonProcessingException::class)
+ override fun serialize(
+ value: ReadClipData, jgen: JsonGenerator, provider: SerializerProvider
+ ) {
+ jgen.writeStartObject()
+ when (value) {
+ is ReadClipData.PlainText -> {
+ jgen.writeObjectFieldStart("plainText")
+
+ jgen.writeStringField("text", value.text)
+
+ jgen.writeEndObject()
+ }
+ else -> {
+ throw Exception("unimplemented ReadClipData")
+ }
+ }
+
+ jgen.writeEndObject()
+ }
+}
+
+internal class WriteOptionsDeserializer: JsonDeserializer() {
+ override fun deserialize(
+ jsonParser: JsonParser,
+ deserializationContext: DeserializationContext
+ ): WriteOptions {
+ val node: JsonNode = jsonParser.codec.readTree(jsonParser)
+ node.get("plainText")?.let {
+ return jsonParser.codec.treeToValue(it, WriteOptions.PlainText::class.java)
+ } ?: run {
+ throw Error("unknown write options $node")
+ }
+ }
+}
+
+@TauriPlugin
+class ClipboardPlugin(private val activity: Activity) : Plugin(activity) {
+ private val manager: ClipboardManager =
+ activity.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
+
+ @Command
+ @Suppress("MoveVariableDeclarationIntoWhen")
+ fun writeText(invoke: Invoke) {
+ val args = invoke.parseArgs(WriteOptions::class.java)
+
+ val clipData = when (args) {
+ is WriteOptions.PlainText -> {
+ ClipData.newPlainText(args.label, args.text)
+ } else -> {
+ invoke.reject("unimplemented WriteOptions")
+ return
+ }
+
+ }
+
+ manager.setPrimaryClip(clipData)
+
+ invoke.resolve()
+ }
+
+ @Command
+ fun readText(invoke: Invoke) {
+ val data = if (manager.hasPrimaryClip()) {
+ if (manager.primaryClipDescription?.hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN) == true) {
+ val item: ClipData.Item = manager.primaryClip!!.getItemAt(0)
+ val data = ReadClipData.PlainText()
+ data.text = item.text.toString()
+ data
+ } else {
+ // TODO
+ invoke.reject("Clipboard content reader not implemented")
+ return
+ }
+ } else {
+ invoke.reject("Clipboard is empty")
+ return
+ }
+
+ invoke.resolveObject(data)
+ }
+
+ @Command
+ fun clear(invoke: Invoke) {
+ if (manager.hasPrimaryClip()) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+ manager.clearPrimaryClip()
+ } else {
+ manager.setPrimaryClip(ClipData.newPlainText("", ""))
+ }
+ }
+ invoke.resolve()
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/android/src/test/java/ExampleUnitTest.kt b/packages/kbot/gui/app/plugins/clipboard-manager/android/src/test/java/ExampleUnitTest.kt
new file mode 100644
index 00000000..282700f2
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/android/src/test/java/ExampleUnitTest.kt
@@ -0,0 +1,21 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+package app.tauri.clipboard
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/api-iife.js b/packages/kbot/gui/app/plugins/clipboard-manager/api-iife.js
new file mode 100644
index 00000000..1de1f448
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/api-iife.js
@@ -0,0 +1 @@
+if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARD_MANAGER__=function(e){"use strict";var n;async function t(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,n,t,r){if("function"==typeof n?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(e):r?r.value:n.get(e)}(this,n,"f")}constructor(e){n.set(this,void 0),function(e,n,t){if("function"==typeof n||!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");n.set(e,t)}(this,n,e)}async close(){return t("plugin:resources|close",{rid:this.rid})}}n=new WeakMap;class a extends r{constructor(e){super(e)}static async new(e,n,r){return t("plugin:image|new",{rgba:i(e),width:n,height:r}).then((e=>new a(e)))}static async fromBytes(e){return t("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return t("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return t("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return t("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof a?e.rid:e}return e.clear=async function(){await t("plugin:clipboard-manager|clear")},e.readImage=async function(){return await t("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await t("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,n){await t("plugin:clipboard-manager|write_html",{html:e,altText:n})},e.writeImage=async function(e){await t("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,n){await t("plugin:clipboard-manager|write_text",{label:n?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARD_MANAGER__})}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/banner.png b/packages/kbot/gui/app/plugins/clipboard-manager/banner.png
new file mode 100644
index 00000000..5d304708
Binary files /dev/null and b/packages/kbot/gui/app/plugins/clipboard-manager/banner.png differ
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/build.rs b/packages/kbot/gui/app/plugins/clipboard-manager/build.rs
new file mode 100644
index 00000000..9bbeddfc
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/build.rs
@@ -0,0 +1,25 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+const COMMANDS: &[&str] = &[
+ "write_text",
+ "read_text",
+ "write_image",
+ "read_image",
+ "write_html",
+ "clear",
+];
+
+fn main() {
+ let result = tauri_plugin::Builder::new(COMMANDS)
+ .global_api_script_path("./api-iife.js")
+ .android_path("android")
+ .ios_path("ios")
+ .try_build();
+
+ // when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
+ if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
+ result.unwrap();
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/guest-js/index.ts b/packages/kbot/gui/app/plugins/clipboard-manager/guest-js/index.ts
new file mode 100644
index 00000000..a37bbfab
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/guest-js/index.ts
@@ -0,0 +1,151 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+/**
+ * Read and write to the system clipboard.
+ *
+ * @module
+ */
+
+import { invoke } from '@tauri-apps/api/core'
+import { Image, transformImage } from '@tauri-apps/api/image'
+
+/**
+ * Writes plain text to the clipboard.
+ * @example
+ * ```typescript
+ * import { writeText, readText } from '@tauri-apps/plugin-clipboard-manager';
+ * await writeText('Tauri is awesome!');
+ * assert(await readText(), 'Tauri is awesome!');
+ * ```
+ *
+ * @returns A promise indicating the success or failure of the operation.
+ *
+ * @since 2.0.0
+ */
+async function writeText(
+ text: string,
+ opts?: { label?: string }
+): Promise {
+ await invoke('plugin:clipboard-manager|write_text', {
+ label: opts?.label,
+ text
+ })
+}
+
+/**
+ * Gets the clipboard content as plain text.
+ * @example
+ * ```typescript
+ * import { readText } from '@tauri-apps/plugin-clipboard-manager';
+ * const clipboardText = await readText();
+ * ```
+ * @since 2.0.0
+ */
+async function readText(): Promise {
+ return await invoke('plugin:clipboard-manager|read_text')
+}
+
+/**
+ * Writes image buffer to the clipboard.
+ *
+ * #### Platform-specific
+ *
+ * - **Android / iOS:** Not supported.
+ *
+ * @example
+ * ```typescript
+ * import { writeImage } from '@tauri-apps/plugin-clipboard-manager';
+ * const buffer = [
+ * // A red pixel
+ * 255, 0, 0, 255,
+ *
+ * // A green pixel
+ * 0, 255, 0, 255,
+ * ];
+ * await writeImage(buffer);
+ * ```
+ *
+ * @returns A promise indicating the success or failure of the operation.
+ *
+ * @since 2.0.0
+ */
+async function writeImage(
+ image: string | Image | Uint8Array | ArrayBuffer | number[]
+): Promise {
+ await invoke('plugin:clipboard-manager|write_image', {
+ image: transformImage(image)
+ })
+}
+
+/**
+ * Gets the clipboard content as Uint8Array image.
+ *
+ * #### Platform-specific
+ *
+ * - **Android / iOS:** Not supported.
+ *
+ * @example
+ * ```typescript
+ * import { readImage } from '@tauri-apps/plugin-clipboard-manager';
+ *
+ * const clipboardImage = await readImage();
+ * const blob = new Blob([await clipboardImage.rgba()], { type: 'image' })
+ * const url = URL.createObjectURL(blob)
+ * ```
+ * @since 2.0.0
+ */
+async function readImage(): Promise {
+ return await invoke('plugin:clipboard-manager|read_image').then(
+ (rid) => new Image(rid)
+ )
+}
+
+/**
+ * * Writes HTML or fallbacks to write provided plain text to the clipboard.
+ *
+ * #### Platform-specific
+ *
+ * - **Android / iOS:** Not supported.
+ *
+ * @example
+ * ```typescript
+ * import { writeHtml } from '@tauri-apps/plugin-clipboard-manager';
+ * await writeHtml('
Tauri is awesome!
', 'plaintext');
+ * // The following will write "
Tauri is awesome
" as plain text
+ * await writeHtml('
Tauri is awesome!
', '
Tauri is awesome
');
+ * // we can read html data only as a string so there's just readText(), no readHtml()
+ * assert(await readText(), '
Tauri is awesome!
');
+ * ```
+ *
+ * @returns A promise indicating the success or failure of the operation.
+ *
+ * @since 2.0.0
+ */
+async function writeHtml(html: string, altText?: string): Promise {
+ await invoke('plugin:clipboard-manager|write_html', {
+ html,
+ altText
+ })
+}
+
+/**
+ * Clears the clipboard.
+ *
+ * #### Platform-specific
+ *
+ * - **Android:** Only supported on SDK 28+. For older releases we write an empty string to the clipboard instead.
+ *
+ * @example
+ * ```typescript
+ * import { clear } from '@tauri-apps/plugin-clipboard-manager';
+ * await clear();
+ * ```
+ * @since 2.0.0
+ */
+async function clear(): Promise {
+ await invoke('plugin:clipboard-manager|clear')
+}
+
+export { writeText, readText, writeHtml, clear, readImage, writeImage }
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/ios/.gitignore b/packages/kbot/gui/app/plugins/clipboard-manager/ios/.gitignore
new file mode 100644
index 00000000..5922fdaa
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/ios/.gitignore
@@ -0,0 +1,10 @@
+.DS_Store
+/.build
+/Packages
+/*.xcodeproj
+xcuserdata/
+DerivedData/
+.swiftpm/config/registries.json
+.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
+.netrc
+Package.resolved
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/ios/Package.swift b/packages/kbot/gui/app/plugins/clipboard-manager/ios/Package.swift
new file mode 100644
index 00000000..6da5303e
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/ios/Package.swift
@@ -0,0 +1,34 @@
+// swift-tools-version:5.3
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import PackageDescription
+
+let package = Package(
+ name: "tauri-plugin-clipboard-manager",
+ platforms: [
+ .macOS(.v10_13),
+ .iOS(.v13),
+ ],
+ products: [
+ // Products define the executables and libraries a package produces, and make them visible to other packages.
+ .library(
+ name: "tauri-plugin-clipboard-manager",
+ type: .static,
+ targets: ["tauri-plugin-clipboard-manager"])
+ ],
+ dependencies: [
+ .package(name: "Tauri", path: "../.tauri/tauri-api")
+ ],
+ targets: [
+ // Targets are the basic building blocks of a package. A target can define a module or a test suite.
+ // Targets can depend on other targets in this package, and on products in packages this package depends on.
+ .target(
+ name: "tauri-plugin-clipboard-manager",
+ dependencies: [
+ .byName(name: "Tauri")
+ ],
+ path: "Sources")
+ ]
+)
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/ios/README.md b/packages/kbot/gui/app/plugins/clipboard-manager/ios/README.md
new file mode 100644
index 00000000..f4900bdd
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/ios/README.md
@@ -0,0 +1,3 @@
+# Tauri Plugin {{ plugin_name_original }}
+
+A description of this package.
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/ios/Sources/ClipboardPlugin.swift b/packages/kbot/gui/app/plugins/clipboard-manager/ios/Sources/ClipboardPlugin.swift
new file mode 100644
index 00000000..cb4fc9b2
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/ios/Sources/ClipboardPlugin.swift
@@ -0,0 +1,52 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import SwiftRs
+import Tauri
+import UIKit
+import WebKit
+
+enum WriteOptions: Codable {
+ case plainText(text: String)
+}
+
+enum ReadClipData: Codable {
+ case plainText(text: String)
+}
+
+class ClipboardPlugin: Plugin {
+ @objc public func writeText(_ invoke: Invoke) throws {
+ let options = try invoke.parseArgs(WriteOptions.self)
+ let clipboard = UIPasteboard.general
+ switch options {
+ case .plainText(let text):
+ clipboard.string = text
+ default:
+ invoke.unimplemented()
+ return
+ }
+ invoke.resolve()
+
+ }
+
+ @objc public func readText(_ invoke: Invoke) throws {
+ let clipboard = UIPasteboard.general
+ if let text = clipboard.string {
+ invoke.resolve(ReadClipData.plainText(text: text))
+ } else {
+ invoke.reject("Clipboard is empty")
+ }
+ }
+
+ @objc public func clear(_ invoke: Invoke) throws {
+ let clipboard = UIPasteboard.general
+ clipboard.items = []
+ invoke.resolve()
+ }
+}
+
+@_cdecl("init_plugin_clipboard")
+func initPlugin() -> Plugin {
+ return ClipboardPlugin()
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/ios/Tests/PluginTests/PluginTests.swift b/packages/kbot/gui/app/plugins/clipboard-manager/ios/Tests/PluginTests/PluginTests.swift
new file mode 100644
index 00000000..e5d54b38
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/ios/Tests/PluginTests/PluginTests.swift
@@ -0,0 +1,12 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import XCTest
+@testable import ClipboardPlugin
+
+final class ClipboardPluginTests: XCTestCase {
+ func testClipboard() throws {
+ let plugin = ClipboardPlugin()
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/package.json b/packages/kbot/gui/app/plugins/clipboard-manager/package.json
new file mode 100644
index 00000000..ac6ac49c
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "@tauri-apps/plugin-clipboard-manager",
+ "version": "2.3.0",
+ "license": "MIT OR Apache-2.0",
+ "authors": [
+ "Tauri Programme within The Commons Conservancy"
+ ],
+ "repository": "https://github.com/tauri-apps/plugins-workspace",
+ "type": "module",
+ "types": "./dist-js/index.d.ts",
+ "main": "./dist-js/index.cjs",
+ "module": "./dist-js/index.js",
+ "exports": {
+ "types": "./dist-js/index.d.ts",
+ "import": "./dist-js/index.js",
+ "require": "./dist-js/index.cjs"
+ },
+ "scripts": {
+ "build": "rollup -c"
+ },
+ "files": [
+ "dist-js",
+ "README.md",
+ "LICENSE"
+ ],
+ "dependencies": {
+ "@tauri-apps/api": "^2.8.0"
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/clear.toml b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/clear.toml
new file mode 100644
index 00000000..83de1819
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/clear.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-clear"
+description = "Enables the clear command without any pre-configured scope."
+commands.allow = ["clear"]
+
+[[permission]]
+identifier = "deny-clear"
+description = "Denies the clear command without any pre-configured scope."
+commands.deny = ["clear"]
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/read_image.toml b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/read_image.toml
new file mode 100644
index 00000000..cfed86db
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/read_image.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-read-image"
+description = "Enables the read_image command without any pre-configured scope."
+commands.allow = ["read_image"]
+
+[[permission]]
+identifier = "deny-read-image"
+description = "Denies the read_image command without any pre-configured scope."
+commands.deny = ["read_image"]
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/read_text.toml b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/read_text.toml
new file mode 100644
index 00000000..29844892
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/read_text.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-read-text"
+description = "Enables the read_text command without any pre-configured scope."
+commands.allow = ["read_text"]
+
+[[permission]]
+identifier = "deny-read-text"
+description = "Denies the read_text command without any pre-configured scope."
+commands.deny = ["read_text"]
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/write_html.toml b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/write_html.toml
new file mode 100644
index 00000000..5e292808
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/write_html.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-write-html"
+description = "Enables the write_html command without any pre-configured scope."
+commands.allow = ["write_html"]
+
+[[permission]]
+identifier = "deny-write-html"
+description = "Denies the write_html command without any pre-configured scope."
+commands.deny = ["write_html"]
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/write_image.toml b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/write_image.toml
new file mode 100644
index 00000000..12e8e235
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/write_image.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-write-image"
+description = "Enables the write_image command without any pre-configured scope."
+commands.allow = ["write_image"]
+
+[[permission]]
+identifier = "deny-write-image"
+description = "Denies the write_image command without any pre-configured scope."
+commands.deny = ["write_image"]
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/write_text.toml b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/write_text.toml
new file mode 100644
index 00000000..ebff875a
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/commands/write_text.toml
@@ -0,0 +1,13 @@
+# Automatically generated - DO NOT EDIT!
+
+"$schema" = "../../schemas/schema.json"
+
+[[permission]]
+identifier = "allow-write-text"
+description = "Enables the write_text command without any pre-configured scope."
+commands.allow = ["write_text"]
+
+[[permission]]
+identifier = "deny-write-text"
+description = "Denies the write_text command without any pre-configured scope."
+commands.deny = ["write_text"]
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/reference.md b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/reference.md
new file mode 100644
index 00000000..98a7fa96
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/autogenerated/reference.md
@@ -0,0 +1,173 @@
+## Default Permission
+
+No features are enabled by default, as we believe
+the clipboard can be inherently dangerous and it is
+application specific if read and/or write access is needed.
+
+Clipboard interaction needs to be explicitly enabled.
+
+## Permission Table
+
+
+
+
Identifier
+
Description
+
+
+
+
+
+
+`clipboard-manager:allow-clear`
+
+
+
+
+Enables the clear command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:deny-clear`
+
+
+
+
+Denies the clear command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:allow-read-image`
+
+
+
+
+Enables the read_image command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:deny-read-image`
+
+
+
+
+Denies the read_image command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:allow-read-text`
+
+
+
+
+Enables the read_text command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:deny-read-text`
+
+
+
+
+Denies the read_text command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:allow-write-html`
+
+
+
+
+Enables the write_html command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:deny-write-html`
+
+
+
+
+Denies the write_html command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:allow-write-image`
+
+
+
+
+Enables the write_image command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:deny-write-image`
+
+
+
+
+Denies the write_image command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:allow-write-text`
+
+
+
+
+Enables the write_text command without any pre-configured scope.
+
+
+
+
+
+
+
+`clipboard-manager:deny-write-text`
+
+
+
+
+Denies the write_text command without any pre-configured scope.
+
+
+
+
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/permissions/default.toml b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/default.toml
new file mode 100644
index 00000000..d6f65195
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/default.toml
@@ -0,0 +1,11 @@
+"$schema" = "schemas/schema.json"
+[default]
+description = """
+No features are enabled by default, as we believe
+the clipboard can be inherently dangerous and it is
+application specific if read and/or write access is needed.
+
+Clipboard interaction needs to be explicitly enabled.
+"""
+
+permissions = []
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/permissions/schemas/schema.json b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/schemas/schema.json
new file mode 100644
index 00000000..891c6f0d
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/permissions/schemas/schema.json
@@ -0,0 +1,378 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "PermissionFile",
+ "description": "Permission file that can define a default permission, a set of permissions or a list of inlined permissions.",
+ "type": "object",
+ "properties": {
+ "default": {
+ "description": "The default permission set for the plugin",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/DefaultPermission"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "set": {
+ "description": "A list of permissions sets defined",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionSet"
+ }
+ },
+ "permission": {
+ "description": "A list of inlined permissions",
+ "default": [],
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Permission"
+ }
+ }
+ },
+ "definitions": {
+ "DefaultPermission": {
+ "description": "The default permission set of the plugin.\n\nWorks similarly to a permission with the \"default\" identifier.",
+ "type": "object",
+ "required": [
+ "permissions"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "PermissionSet": {
+ "description": "A set of direct permissions grouped together under a new name.",
+ "type": "object",
+ "required": [
+ "description",
+ "identifier",
+ "permissions"
+ ],
+ "properties": {
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does.",
+ "type": "string"
+ },
+ "permissions": {
+ "description": "All permissions this set contains.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/PermissionKind"
+ }
+ }
+ }
+ },
+ "Permission": {
+ "description": "Descriptions of explicit privileges of commands.\n\nIt can enable commands to be accessible in the frontend of the application.\n\nIf the scope is defined it can be used to fine grain control the access of individual or multiple commands.",
+ "type": "object",
+ "required": [
+ "identifier"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of the permission.",
+ "type": [
+ "integer",
+ "null"
+ ],
+ "format": "uint64",
+ "minimum": 1.0
+ },
+ "identifier": {
+ "description": "A unique identifier for the permission.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Human-readable description of what the permission does. Tauri internal convention is to use `
` headings in markdown content for Tauri documentation generation purposes.",
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "commands": {
+ "description": "Allowed or denied commands when using this permission.",
+ "default": {
+ "allow": [],
+ "deny": []
+ },
+ "allOf": [
+ {
+ "$ref": "#/definitions/Commands"
+ }
+ ]
+ },
+ "scope": {
+ "description": "Allowed or denied scoped when using this permission.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Scopes"
+ }
+ ]
+ },
+ "platforms": {
+ "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Target"
+ }
+ }
+ }
+ },
+ "Commands": {
+ "description": "Allowed and denied commands inside a permission.\n\nIf two commands clash inside of `allow` and `deny`, it should be denied by default.",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Allowed command.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "deny": {
+ "description": "Denied command, which takes priority.",
+ "default": [],
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "Scopes": {
+ "description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```",
+ "type": "object",
+ "properties": {
+ "allow": {
+ "description": "Data that defines what is allowed by the scope.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ "deny": {
+ "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
+ "type": [
+ "array",
+ "null"
+ ],
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ }
+ },
+ "Value": {
+ "description": "All supported ACL values.",
+ "anyOf": [
+ {
+ "description": "Represents a null JSON value.",
+ "type": "null"
+ },
+ {
+ "description": "Represents a [`bool`].",
+ "type": "boolean"
+ },
+ {
+ "description": "Represents a valid ACL [`Number`].",
+ "allOf": [
+ {
+ "$ref": "#/definitions/Number"
+ }
+ ]
+ },
+ {
+ "description": "Represents a [`String`].",
+ "type": "string"
+ },
+ {
+ "description": "Represents a list of other [`Value`]s.",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Value"
+ }
+ },
+ {
+ "description": "Represents a map of [`String`] keys to [`Value`]s.",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/Value"
+ }
+ }
+ ]
+ },
+ "Number": {
+ "description": "A valid ACL number.",
+ "anyOf": [
+ {
+ "description": "Represents an [`i64`].",
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "description": "Represents a [`f64`].",
+ "type": "number",
+ "format": "double"
+ }
+ ]
+ },
+ "Target": {
+ "description": "Platform target.",
+ "oneOf": [
+ {
+ "description": "MacOS.",
+ "type": "string",
+ "enum": [
+ "macOS"
+ ]
+ },
+ {
+ "description": "Windows.",
+ "type": "string",
+ "enum": [
+ "windows"
+ ]
+ },
+ {
+ "description": "Linux.",
+ "type": "string",
+ "enum": [
+ "linux"
+ ]
+ },
+ {
+ "description": "Android.",
+ "type": "string",
+ "enum": [
+ "android"
+ ]
+ },
+ {
+ "description": "iOS.",
+ "type": "string",
+ "enum": [
+ "iOS"
+ ]
+ }
+ ]
+ },
+ "PermissionKind": {
+ "type": "string",
+ "oneOf": [
+ {
+ "description": "Enables the clear command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-clear",
+ "markdownDescription": "Enables the clear command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the clear command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-clear",
+ "markdownDescription": "Denies the clear command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the read_image command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-read-image",
+ "markdownDescription": "Enables the read_image command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the read_image command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-read-image",
+ "markdownDescription": "Denies the read_image command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the read_text command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-read-text",
+ "markdownDescription": "Enables the read_text command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the read_text command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-read-text",
+ "markdownDescription": "Denies the read_text command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the write_html command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-write-html",
+ "markdownDescription": "Enables the write_html command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the write_html command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-write-html",
+ "markdownDescription": "Denies the write_html command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the write_image command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-write-image",
+ "markdownDescription": "Enables the write_image command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the write_image command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-write-image",
+ "markdownDescription": "Denies the write_image command without any pre-configured scope."
+ },
+ {
+ "description": "Enables the write_text command without any pre-configured scope.",
+ "type": "string",
+ "const": "allow-write-text",
+ "markdownDescription": "Enables the write_text command without any pre-configured scope."
+ },
+ {
+ "description": "Denies the write_text command without any pre-configured scope.",
+ "type": "string",
+ "const": "deny-write-text",
+ "markdownDescription": "Denies the write_text command without any pre-configured scope."
+ },
+ {
+ "description": "No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n",
+ "type": "string",
+ "const": "default",
+ "markdownDescription": "No features are enabled by default, as we believe\nthe clipboard can be inherently dangerous and it is \napplication specific if read and/or write access is needed.\n\nClipboard interaction needs to be explicitly enabled.\n"
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/rollup.config.js b/packages/kbot/gui/app/plugins/clipboard-manager/rollup.config.js
new file mode 100644
index 00000000..1f349ec8
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/rollup.config.js
@@ -0,0 +1,7 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+import { createConfig } from '../../shared/rollup.config.js'
+
+export default createConfig()
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/src/commands.rs b/packages/kbot/gui/app/plugins/clipboard-manager/src/commands.rs
new file mode 100644
index 00000000..a8dd94ac
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/src/commands.rs
@@ -0,0 +1,80 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use tauri::{command, image::JsImage, AppHandle, Manager, ResourceId, Runtime, State, Webview};
+
+use crate::{Clipboard, Result};
+
+#[command]
+#[cfg(desktop)]
+pub(crate) async fn write_text(
+ _app: AppHandle,
+ clipboard: State<'_, Clipboard>,
+ text: &str,
+ #[allow(unused)] label: Option,
+) -> Result<()> {
+ clipboard.write_text(text)
+}
+
+#[command]
+#[cfg(not(desktop))]
+pub(crate) async fn write_text(
+ _app: AppHandle,
+ clipboard: State<'_, Clipboard>,
+ text: &str,
+ #[allow(unused)] label: Option<&str>,
+) -> Result<()> {
+ match label {
+ Some(label) => clipboard.write_text_with_label(text, label),
+ None => clipboard.write_text(text),
+ }
+}
+
+#[command]
+pub(crate) async fn read_text(
+ _app: AppHandle,
+ clipboard: State<'_, Clipboard>,
+) -> Result {
+ clipboard.read_text()
+}
+
+#[command]
+pub(crate) async fn write_image(
+ webview: Webview,
+ clipboard: State<'_, Clipboard>,
+ image: JsImage,
+) -> Result<()> {
+ let resources_table = webview.resources_table();
+ let image = image.into_img(&resources_table)?;
+ clipboard.write_image(&image)
+}
+
+#[command]
+pub(crate) async fn read_image(
+ webview: Webview,
+ clipboard: State<'_, Clipboard>,
+) -> Result {
+ let image = clipboard.read_image()?.to_owned();
+ let mut resources_table = webview.resources_table();
+ let rid = resources_table.add(image);
+ Ok(rid)
+}
+
+#[command]
+pub(crate) async fn write_html(
+ _app: AppHandle,
+ clipboard: State<'_, Clipboard>,
+ html: &str,
+ alt_text: Option<&str>,
+) -> Result<()> {
+ clipboard.write_html(html, alt_text)
+}
+
+#[command]
+pub(crate) async fn clear(
+ _app: AppHandle,
+ clipboard: State<'_, Clipboard>,
+) -> Result<()> {
+ clipboard.clear()
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/src/desktop.rs b/packages/kbot/gui/app/plugins/clipboard-manager/src/desktop.rs
new file mode 100644
index 00000000..f3570cc0
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/src/desktop.rs
@@ -0,0 +1,123 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use arboard::ImageData;
+use serde::de::DeserializeOwned;
+use tauri::{image::Image, plugin::PluginApi, AppHandle, Runtime};
+
+use std::{borrow::Cow, sync::Mutex};
+
+pub fn init(
+ app: &AppHandle,
+ _api: PluginApi,
+) -> crate::Result> {
+ Ok(Clipboard {
+ app: app.clone(),
+ clipboard: arboard::Clipboard::new().map(|c| Mutex::new(Some(c))),
+ })
+}
+
+/// Access to the clipboard APIs.
+pub struct Clipboard {
+ #[allow(dead_code)]
+ app: AppHandle,
+ // According to arboard docs the clipboard must be dropped before exit.
+ // Since tauri doesn't call drop on exit we'll use an Option to take() on RunEvent::Exit.
+ clipboard: Result>, arboard::Error>,
+}
+
+impl Clipboard {
+ pub fn write_text<'a, T: Into>>(&self, text: T) -> crate::Result<()> {
+ match &self.clipboard {
+ Ok(clipboard) => clipboard
+ .lock()
+ .unwrap()
+ .as_mut()
+ .unwrap()
+ .set_text(text)
+ .map_err(Into::into),
+ Err(e) => Err(crate::Error::Clipboard(e.to_string())),
+ }
+ }
+
+ pub fn write_image(&self, image: &Image<'_>) -> crate::Result<()> {
+ match &self.clipboard {
+ Ok(clipboard) => clipboard
+ .lock()
+ .unwrap()
+ .as_mut()
+ .unwrap()
+ .set_image(ImageData {
+ bytes: Cow::Borrowed(image.rgba()),
+ width: image.width() as usize,
+ height: image.height() as usize,
+ })
+ .map_err(Into::into),
+ Err(e) => Err(crate::Error::Clipboard(e.to_string())),
+ }
+ }
+
+ /// Warning: This method should not be used on the main thread! Otherwise the underlying libraries may deadlock on Linux, freezing the whole app, when trying to copy data copied from this app, for example if the user copies text from the WebView.
+ pub fn read_text(&self) -> crate::Result {
+ match &self.clipboard {
+ Ok(clipboard) => {
+ let text = clipboard.lock().unwrap().as_mut().unwrap().get_text()?;
+ Ok(text)
+ }
+ Err(e) => Err(crate::Error::Clipboard(e.to_string())),
+ }
+ }
+
+ pub fn write_html<'a, T: Into>>(
+ &self,
+ html: T,
+ alt_text: Option,
+ ) -> crate::Result<()> {
+ match &self.clipboard {
+ Ok(clipboard) => clipboard
+ .lock()
+ .unwrap()
+ .as_mut()
+ .unwrap()
+ .set_html(html, alt_text)
+ .map_err(Into::into),
+ Err(e) => Err(crate::Error::Clipboard(e.to_string())),
+ }
+ }
+
+ pub fn clear(&self) -> crate::Result<()> {
+ match &self.clipboard {
+ Ok(clipboard) => clipboard
+ .lock()
+ .unwrap()
+ .as_mut()
+ .unwrap()
+ .clear()
+ .map_err(Into::into),
+ Err(e) => Err(crate::Error::Clipboard(e.to_string())),
+ }
+ }
+
+ /// Warning: This method should not be used on the main thread! Otherwise the underlying libraries may deadlock on Linux, freezing the whole app, when trying to copy data copied from this app, for example if the user copies text from the WebView.
+ pub fn read_image(&self) -> crate::Result> {
+ match &self.clipboard {
+ Ok(clipboard) => {
+ let image = clipboard.lock().unwrap().as_mut().unwrap().get_image()?;
+ let image = Image::new_owned(
+ image.bytes.to_vec(),
+ image.width as u32,
+ image.height as u32,
+ );
+ Ok(image)
+ }
+ Err(e) => Err(crate::Error::Clipboard(e.to_string())),
+ }
+ }
+
+ pub(crate) fn cleanup(&self) {
+ if let Ok(clipboard) = &self.clipboard {
+ clipboard.lock().unwrap().take();
+ }
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/src/error.rs b/packages/kbot/gui/app/plugins/clipboard-manager/src/error.rs
new file mode 100644
index 00000000..1b8cf482
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/src/error.rs
@@ -0,0 +1,34 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use serde::{ser::Serializer, Serialize};
+
+pub type Result = std::result::Result;
+
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+ #[cfg(mobile)]
+ #[error(transparent)]
+ PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError),
+ #[error("{0}")]
+ Clipboard(String),
+ #[error(transparent)]
+ Tauri(#[from] tauri::Error),
+}
+
+impl Serialize for Error {
+ fn serialize(&self, serializer: S) -> std::result::Result
+ where
+ S: Serializer,
+ {
+ serializer.serialize_str(self.to_string().as_ref())
+ }
+}
+
+#[cfg(desktop)]
+impl From for Error {
+ fn from(error: arboard::Error) -> Self {
+ Self::Clipboard(error.to_string())
+ }
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/src/lib.rs b/packages/kbot/gui/app/plugins/clipboard-manager/src/lib.rs
new file mode 100644
index 00000000..0cbb4e41
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/src/lib.rs
@@ -0,0 +1,69 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+//! Read and write to the system clipboard.
+
+#![doc(
+ html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
+ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
+)]
+
+use tauri::{
+ plugin::{Builder, TauriPlugin},
+ Manager, RunEvent, Runtime,
+};
+
+#[cfg(desktop)]
+mod desktop;
+#[cfg(mobile)]
+mod mobile;
+
+mod commands;
+mod error;
+
+pub use error::{Error, Result};
+
+#[cfg(desktop)]
+pub use desktop::Clipboard;
+#[cfg(mobile)]
+pub use mobile::Clipboard;
+
+/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the clipboard APIs.
+pub trait ClipboardExt {
+ fn clipboard(&self) -> &Clipboard;
+}
+
+impl> crate::ClipboardExt for T {
+ fn clipboard(&self) -> &Clipboard {
+ self.state::>().inner()
+ }
+}
+
+/// Initializes the plugin.
+pub fn init() -> TauriPlugin {
+ Builder::new("clipboard-manager")
+ .invoke_handler(tauri::generate_handler![
+ commands::write_text,
+ commands::read_text,
+ commands::read_image,
+ commands::write_image,
+ commands::write_html,
+ commands::clear
+ ])
+ .setup(|app, api| {
+ #[cfg(mobile)]
+ let clipboard = mobile::init(app, api)?;
+ #[cfg(desktop)]
+ let clipboard = desktop::init(app, api)?;
+ app.manage(clipboard);
+ Ok(())
+ })
+ .on_event(|_app, _event| {
+ #[cfg(desktop)]
+ if let RunEvent::Exit = _event {
+ _app.clipboard().cleanup();
+ }
+ })
+ .build()
+}
diff --git a/packages/kbot/gui/app/plugins/clipboard-manager/src/mobile.rs b/packages/kbot/gui/app/plugins/clipboard-manager/src/mobile.rs
new file mode 100644
index 00000000..72d5f6e0
--- /dev/null
+++ b/packages/kbot/gui/app/plugins/clipboard-manager/src/mobile.rs
@@ -0,0 +1,109 @@
+// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-License-Identifier: MIT
+
+use serde::de::DeserializeOwned;
+use serde::{Deserialize, Serialize};
+use tauri::{
+ image::Image,
+ plugin::{PluginApi, PluginHandle},
+ AppHandle, Runtime,
+};
+
+use std::borrow::Cow;
+
+#[cfg(target_os = "android")]
+const PLUGIN_IDENTIFIER: &str = "app.tauri.clipboard";
+
+#[cfg(target_os = "ios")]
+tauri::ios_plugin_binding!(init_plugin_clipboard);
+
+// initializes the Kotlin or Swift plugin classes
+pub fn init(
+ _app: &AppHandle,
+ api: PluginApi,
+) -> crate::Result> {
+ #[cfg(target_os = "android")]
+ let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "ClipboardPlugin")?;
+ #[cfg(target_os = "ios")]
+ let handle = api.register_ios_plugin(init_plugin_clipboard)?;
+ Ok(Clipboard(handle))
+}
+
+/// Access to the clipboard APIs.
+pub struct Clipboard(PluginHandle);
+
+impl Clipboard