Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/desktop/src-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ fn main() {
// Runtime FS scope grants (used by Fleet/Drift's project scope)
"grant_project_scope",
"choose_project_dir",
// Share: Rust opens the Save dialog; the path never comes from the page
"save_share_file",
// Guarded write/rename/remove for the webview's TauriFsProvider
"guarded_write_file",
"guarded_rename_file",
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
"allow-detect-harnesses",
"allow-grant-project-scope",
"allow-choose-project-dir",
"allow-save-share-file",
"allow-guarded-write-file",
"allow-guarded-rename-file",
"allow-guarded-remove-file",
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/gen/schemas/acl-manifests.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/gen/schemas/capabilities.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"default":{"identifier":"default","description":"Default capability — grants core API, read access to harness config roots under $HOME (the Machine-observation paths .claude.json, the exact Claude Desktop / VS Code User config files the surface registry declares, .copilot and .agents are reachable only by the read, read-dir and exists permissions), mkdir and lstat inside the fs scope, and shell open. No shell execute, spawn, stdin or kill: production code runs processes from Rust only. fs write, rename and remove are not granted to the webview; they go through guarded_write_file, guarded_rename_file and guarded_remove_file, which write and rename only the engine's .harness-tmp-<suffix> files, and delete only those and its backups (removing a store moves it to ~/.harness/backups/quarantine/ instead)","local":true,"windows":["main"],"permissions":["core:default","core:window:allow-start-dragging","core:event:allow-listen","core:event:allow-emit","fs:allow-read-text-file","fs:allow-read-dir","fs:allow-exists","fs:allow-lstat","fs:allow-mkdir",{"identifier":"fs:scope","allow":[{"path":"$HOME/CLAUDE.md"},{"path":"$HOME/AGENTS.md"},{"path":"$HOME/.mcp.json"},{"path":"$HOME/.claude"},{"path":"$HOME/.claude/**"},{"path":"$HOME/.cursor"},{"path":"$HOME/.cursor/**"},{"path":"$HOME/.github"},{"path":"$HOME/.github/**"},{"path":"$HOME/.vscode"},{"path":"$HOME/.vscode/**"},{"path":"$HOME/.codex"},{"path":"$HOME/.codex/**"},{"path":"$HOME/.opencode"},{"path":"$HOME/.opencode/**"},{"path":"$HOME/.config/opencode"},{"path":"$HOME/.config/opencode/**"},{"path":"$HOME/.windsurf"},{"path":"$HOME/.windsurf/**"},{"path":"$HOME/.gemini"},{"path":"$HOME/.gemini/**"},{"path":"$HOME/.junie"},{"path":"$HOME/.junie/**"},{"path":"$HOME/.pi"},{"path":"$HOME/.pi/**"},{"path":"$HOME/.harness-kit"},{"path":"$HOME/.harness-kit/**"},{"path":"$HOME/.harness/backups"},{"path":"$HOME/.harness/backups/**"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-read-dir","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-exists","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},"dialog:default","dialog:allow-open","dialog:allow-save","shell:default","shell:allow-open","allow-list-installed-plugins","allow-list-marketplaces","allow-check-plugin-updates","allow-uninstall-plugin","allow-read-plugin-tree","allow-read-plugin-file","allow-write-plugin-file","allow-import-plugin-from-path","allow-import-plugin-from-zip","allow-export-plugin-as-zip","allow-export-plugin-to-folder","allow-read-hooks","allow-read-claude-md","allow-write-config-file","allow-read-harness-file","allow-write-harness-file","allow-list-custom-profiles","allow-get-custom-profile","allow-save-custom-profile","allow-delete-custom-profile","allow-list-claude-dir","allow-detect-claude-account","allow-read-stats-cache","allow-list-sessions-summary","allow-read-session-facet","allow-list-active-sessions","allow-read-live-activity","allow-compute-live-stats","allow-read-session-transcript","allow-check-git-repo","allow-check-for-updates","allow-trigger-rebuild","allow-save-evaluation","allow-get-evaluations","allow-update-evaluation-score","allow-create-evaluation-session","allow-get-evaluation-session","allow-reveal-evaluation-session","allow-save-pairwise-vote","allow-get-pairwise-votes","allow-get-pairwise-analytics","allow-delete-pairwise-vote","allow-export-comparison-json","allow-get-comparator-analytics","allow-save-comparison","allow-update-comparison-title","allow-update-comparison-status","allow-list-comparisons","allow-get-comparison","allow-delete-comparison","allow-tag-comparison-task-type","allow-get-harness-recommendations","allow-save-panel","allow-update-panel-result","allow-save-file-diffs","allow-get-comparison-diffs","allow-get-panel-diffs","allow-read-permissions","allow-update-permissions","allow-list-security-presets","allow-apply-security-preset","allow-list-required-env","allow-set-keychain-secret","allow-delete-keychain-secret","allow-read-env-config","allow-write-env-config","allow-list-audit-entries","allow-clear-audit-entries","allow-read-file-history","allow-push-file-history","allow-get-history-size","allow-sync-read-file","allow-sync-file-exists","allow-sync-read-dir","allow-sync-write-files","allow-verify-definitions-signature","allow-get-cached-definitions","allow-put-cached-definitions","allow-get-highest-bundle-number","allow-record-bundle-number","allow-apply-surface-transaction","allow-record-transaction","allow-list-changes","allow-undo-change","allow-migrate-drift-acknowledgements","allow-acknowledge-drift","allow-unacknowledge-drift","allow-list-drift-acknowledgements","allow-sync-create-backup","allow-sync-list-backups","allow-sync-restore-backup","allow-detect-harnesses","allow-grant-project-scope","allow-choose-project-dir","allow-guarded-write-file","allow-guarded-rename-file","allow-guarded-remove-file","allow-acknowledge-drift-item","allow-unacknowledge-drift-item","allow-get-acknowledged-drift-items","allow-get-system-info","allow-submit-feedback"]}}
{"default":{"identifier":"default","description":"Default capability — grants core API, read access to harness config roots under $HOME (the Machine-observation paths .claude.json, the exact Claude Desktop / VS Code User config files the surface registry declares, .copilot and .agents are reachable only by the read, read-dir and exists permissions), mkdir and lstat inside the fs scope, and shell open. No shell execute, spawn, stdin or kill: production code runs processes from Rust only. fs write, rename and remove are not granted to the webview; they go through guarded_write_file, guarded_rename_file and guarded_remove_file, which write and rename only the engine's .harness-tmp-<suffix> files, and delete only those and its backups (removing a store moves it to ~/.harness/backups/quarantine/ instead)","local":true,"windows":["main"],"permissions":["core:default","core:window:allow-start-dragging","core:event:allow-listen","core:event:allow-emit","fs:allow-read-text-file","fs:allow-read-dir","fs:allow-exists","fs:allow-lstat","fs:allow-mkdir",{"identifier":"fs:scope","allow":[{"path":"$HOME/CLAUDE.md"},{"path":"$HOME/AGENTS.md"},{"path":"$HOME/.mcp.json"},{"path":"$HOME/.claude"},{"path":"$HOME/.claude/**"},{"path":"$HOME/.cursor"},{"path":"$HOME/.cursor/**"},{"path":"$HOME/.github"},{"path":"$HOME/.github/**"},{"path":"$HOME/.vscode"},{"path":"$HOME/.vscode/**"},{"path":"$HOME/.codex"},{"path":"$HOME/.codex/**"},{"path":"$HOME/.opencode"},{"path":"$HOME/.opencode/**"},{"path":"$HOME/.config/opencode"},{"path":"$HOME/.config/opencode/**"},{"path":"$HOME/.windsurf"},{"path":"$HOME/.windsurf/**"},{"path":"$HOME/.gemini"},{"path":"$HOME/.gemini/**"},{"path":"$HOME/.junie"},{"path":"$HOME/.junie/**"},{"path":"$HOME/.pi"},{"path":"$HOME/.pi/**"},{"path":"$HOME/.harness-kit"},{"path":"$HOME/.harness-kit/**"},{"path":"$HOME/.harness/backups"},{"path":"$HOME/.harness/backups/**"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-read-dir","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-exists","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},"dialog:default","dialog:allow-open","dialog:allow-save","shell:default","shell:allow-open","allow-list-installed-plugins","allow-list-marketplaces","allow-check-plugin-updates","allow-uninstall-plugin","allow-read-plugin-tree","allow-read-plugin-file","allow-write-plugin-file","allow-import-plugin-from-path","allow-import-plugin-from-zip","allow-export-plugin-as-zip","allow-export-plugin-to-folder","allow-read-hooks","allow-read-claude-md","allow-write-config-file","allow-read-harness-file","allow-write-harness-file","allow-list-custom-profiles","allow-get-custom-profile","allow-save-custom-profile","allow-delete-custom-profile","allow-list-claude-dir","allow-detect-claude-account","allow-read-stats-cache","allow-list-sessions-summary","allow-read-session-facet","allow-list-active-sessions","allow-read-live-activity","allow-compute-live-stats","allow-read-session-transcript","allow-check-git-repo","allow-check-for-updates","allow-trigger-rebuild","allow-save-evaluation","allow-get-evaluations","allow-update-evaluation-score","allow-create-evaluation-session","allow-get-evaluation-session","allow-reveal-evaluation-session","allow-save-pairwise-vote","allow-get-pairwise-votes","allow-get-pairwise-analytics","allow-delete-pairwise-vote","allow-export-comparison-json","allow-get-comparator-analytics","allow-save-comparison","allow-update-comparison-title","allow-update-comparison-status","allow-list-comparisons","allow-get-comparison","allow-delete-comparison","allow-tag-comparison-task-type","allow-get-harness-recommendations","allow-save-panel","allow-update-panel-result","allow-save-file-diffs","allow-get-comparison-diffs","allow-get-panel-diffs","allow-read-permissions","allow-update-permissions","allow-list-security-presets","allow-apply-security-preset","allow-list-required-env","allow-set-keychain-secret","allow-delete-keychain-secret","allow-read-env-config","allow-write-env-config","allow-list-audit-entries","allow-clear-audit-entries","allow-read-file-history","allow-push-file-history","allow-get-history-size","allow-sync-read-file","allow-sync-file-exists","allow-sync-read-dir","allow-sync-write-files","allow-verify-definitions-signature","allow-get-cached-definitions","allow-put-cached-definitions","allow-get-highest-bundle-number","allow-record-bundle-number","allow-apply-surface-transaction","allow-record-transaction","allow-list-changes","allow-undo-change","allow-migrate-drift-acknowledgements","allow-acknowledge-drift","allow-unacknowledge-drift","allow-list-drift-acknowledgements","allow-sync-create-backup","allow-sync-list-backups","allow-sync-restore-backup","allow-detect-harnesses","allow-grant-project-scope","allow-choose-project-dir","allow-save-share-file","allow-guarded-write-file","allow-guarded-rename-file","allow-guarded-remove-file","allow-acknowledge-drift-item","allow-unacknowledge-drift-item","allow-get-acknowledged-drift-items","allow-get-system-info","allow-submit-feedback"]}}
12 changes: 12 additions & 0 deletions apps/desktop/src-tauri/gen/schemas/desktop-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2690,6 +2690,12 @@
"const": "allow-save-panel",
"markdownDescription": "Enables the save_panel command without any pre-configured scope."
},
{
"description": "Enables the save_share_file command without any pre-configured scope.",
"type": "string",
"const": "allow-save-share-file",
"markdownDescription": "Enables the save_share_file command without any pre-configured scope."
},
{
"description": "Enables the set_keychain_secret command without any pre-configured scope.",
"type": "string",
Expand Down Expand Up @@ -3320,6 +3326,12 @@
"const": "deny-save-panel",
"markdownDescription": "Denies the save_panel command without any pre-configured scope."
},
{
"description": "Denies the save_share_file command without any pre-configured scope.",
"type": "string",
"const": "deny-save-share-file",
"markdownDescription": "Denies the save_share_file command without any pre-configured scope."
},
{
"description": "Denies the set_keychain_secret command without any pre-configured scope.",
"type": "string",
Expand Down
12 changes: 12 additions & 0 deletions apps/desktop/src-tauri/gen/schemas/macOS-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2690,6 +2690,12 @@
"const": "allow-save-panel",
"markdownDescription": "Enables the save_panel command without any pre-configured scope."
},
{
"description": "Enables the save_share_file command without any pre-configured scope.",
"type": "string",
"const": "allow-save-share-file",
"markdownDescription": "Enables the save_share_file command without any pre-configured scope."
},
{
"description": "Enables the set_keychain_secret command without any pre-configured scope.",
"type": "string",
Expand Down Expand Up @@ -3320,6 +3326,12 @@
"const": "deny-save-panel",
"markdownDescription": "Denies the save_panel command without any pre-configured scope."
},
{
"description": "Denies the save_share_file command without any pre-configured scope.",
"type": "string",
"const": "deny-save-share-file",
"markdownDescription": "Denies the save_share_file command without any pre-configured scope."
},
{
"description": "Denies the set_keychain_secret command without any pre-configured scope.",
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-save-share-file"
description = "Enables the save_share_file command without any pre-configured scope."
commands.allow = ["save_share_file"]

[[permission]]
identifier = "deny-save-share-file"
description = "Denies the save_share_file command without any pre-configured scope."
commands.deny = ["save_share_file"]
5 changes: 5 additions & 0 deletions apps/desktop/src-tauri/src/commands/ipc_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ fn check_value(ty: &str, v: &Value) -> Result<(), String> {
.map(|_| ())
.map_err(|e| e.to_string())
}
"ShareKind" => {
return serde_json::from_value::<super::share::ShareKind>(v.clone())
.map(|_| ())
.map_err(|e| e.to_string())
}
other => return Err(format!("no contract check for argument type `{other}`; add one to check_value")),
};
if ok {
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src-tauri/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ pub mod harnesses;
pub mod feedback;
pub mod fs_scope;
pub mod fs_guarded;
pub mod share;
#[cfg(test)]
mod ipc_contract;
Loading
Loading