Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

5.4 KB
Raw Blame
[package]
name = "tauri-plugin-agent-tools"
version = "0.8.3"
authors = ["Jan <[email protected]>"]
description = "Built-in agent toolset (filesystem, shell, skills, memory, web) shared by the Jan desktop app and the headless jan CLI"
license = "Apache-2.0"
repository = "https://github.com/janhq/jan"
edition = "2021"
rust-version = "1.77.2"
exclude = ["/examples", "/dist-js", "/guest-js", "/node_modules"]
links = "tauri-plugin-agent-tools"

# The toolset core is Tauri-free so the headless `jan` CLI can drive it directly;
# only the desktop IPC shims need `tauri`. Build with `--no-default-features` to
# keep the whole GUI stack out of the graph.
[features]
default = ["tauri"]
# The Linux GUI crates back the webview `screenshot` renderer and only exist on
# that target, so they are enabled by the `tauri` feature but stay absent from
# the CLI graph (which never turns `tauri` on).
tauri = [
  "dep:tauri",
  "dep:tauri-plugin",
  # `open_artifact` hands the checked file to the OS default app.
  "dep:tauri-plugin-opener",
  # `wry` gives `WebviewWindow::with_webview`, which the screenshot renderer needs
  # to reach the platform webview. The desktop enables it anyway; the CLI never
  # turns on `tauri`, so this stays out of the CLI graph.
  "tauri/wry",
  # Linux screenshot backend (webkit2gtk snapshot -> cairo -> PNG).
  "dep:webkit2gtk",
  "dep:cairo-rs",
  "dep:gio",
  "dep:glib",
  # macOS screenshot backend (WKWebView snapshot -> NSImage -> PNG).
  "dep:objc2",
  "dep:objc2-web-kit",
  "dep:objc2-app-kit",
  "dep:objc2-foundation",
  "dep:block2",
  # Windows screenshot backend (WebView2 CapturePreview -> IStream PNG).
  "dep:webview2-com",
  "dep:windows",
]

[dependencies]
base64 = "0.22"
# The OS cache dir (XDG / ~/Library/Caches / %LOCALAPPDATA%) the session
# scratch lives under; same version the app crate already resolves.
dirs = "6.0.0"
# Advisory file locks (flock / LockFileEx) that serialize memory store changes
# across processes: the desktop app and the jan CLI share one store.
fs4 = "1"
# Pure Rust, no GUI linkage; used by the webview screenshot path and harmless in
# the CLI graph.
png = "0.17"
glob = "0.3"
percent-encoding = "2"
ignore = "0.4"
regex = "1"
# `MonitorSnapshot` travels inside a `StreamEvent`, so the protocol schema
# reaches it: the type derives its own schema rather than being mirrored.
schemars = "1"
similar = "2.6"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9.34"
thiserror = "2.0.12"
tokio = { version = "1", features = ["full"] }
tauri = { version = "2.8.5", default-features = false, optional = true }
tauri-plugin-opener = { version = "2.2.7", optional = true }
# `provider` only; `default-features = false` keeps `tauri` out of the graph so
# the headless CLI can use the web tools.
tauri-plugin-websearch = { path = "../tauri-plugin-websearch", default-features = false }

[build-dependencies]
tauri-plugin = { version = "2.3.1", features = ["build"], optional = true }

[target.'cfg(unix)'.dependencies]
nix = { version = "=0.30.1", features = ["signal", "process", "fs", "user"] }

# Webview `screenshot` backend (see `webview_shot.rs`). All optional and enabled
# by the `tauri` feature, so the headless CLI never pulls a GUI stack in.
[target.'cfg(target_os = "linux")'.dependencies]
webkit2gtk = { version = "2.0", features = ["v2_8"], optional = true }
cairo-rs = { version = "0.18", optional = true }
gio = { version = "0.18", optional = true }
glib = { version = "0.18", optional = true }

# macOS webview `screenshot` backend. Versions pinned to the workspace lockfile
# so linkage does not duplicate the objc2 stack tauri/wry already pulls.
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = { version = "0.6", optional = true }
objc2-web-kit = { version = "0.3", features = [
  "WKWebView",
  "WKSnapshotConfiguration",
  "block2",
  "objc2-app-kit",
  "objc2-core-foundation",
], optional = true }
objc2-app-kit = { version = "0.3", features = [
  "NSImage",
  "NSImageRep",
  "NSBitmapImageRep",
], optional = true }
objc2-foundation = { version = "0.3", features = [
  "NSData",
  "NSDictionary",
  "NSError",
  "NSGeometry",
  "NSString",
  "NSValue",
], optional = true }
block2 = { version = "0.6", optional = true }

# Windows webview `screenshot` backend. `windows` (0.62) matches the version
# `webview2-com` / `tauri-runtime-wry` resolve to, so the `IStream` handed to
# `CapturePreview` is the same type. Separate from the `windows-sys` crate used
# by the bash sandbox below.
[target.'cfg(target_os = "windows")'.dependencies]
webview2-com = { version = "0.39", optional = true }
windows = { version = "0.62", features = [
  "Win32_Foundation",
  "Win32_System_Com",
  "Win32_UI_Shell",
], optional = true }

# AppContainer confinement for the `bash` tool: profile creation, workspace ACLs
# and the `STARTUPINFOEX` spawn that carries the lowbox token.
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.60.2", features = [
  "Win32_Foundation",
  "Win32_Security",
  "Win32_Security_Authorization",
  "Win32_Security_Isolation",
  "Win32_Storage_FileSystem",
  "Win32_System_Console",
  "Win32_System_JobObjects",
  "Win32_System_Memory",
  "Win32_System_Threading",
] }

# Real shells started inside the Windows sandbox. Its own `main`, because the
# sandbox re-execs the running binary as its helper and libtest would answer
# that re-exec by running the suite again.
[[test]]
name = "sandbox_spawn"
harness = false