praxis-agent 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -3
- package/dist/application/session-service.d.ts +5 -2
- package/dist/application/session-service.js +23 -0
- package/dist/application/subagent-service.d.ts +4 -2
- package/dist/application/subagent-service.js +4 -0
- package/dist/cli/interactive.d.ts +6 -3
- package/dist/cli/interactive.js +650 -59
- package/dist/cli/tui/claude-command-inventory.d.ts +368 -0
- package/dist/cli/tui/claude-command-inventory.js +220 -0
- package/dist/cli/tui/mcp-elicitation.d.ts +75 -0
- package/dist/cli/tui/mcp-elicitation.js +497 -0
- package/dist/cli/tui/open-url.d.ts +2 -0
- package/dist/cli/tui/open-url.js +13 -0
- package/dist/cli/tui/permission-settings.d.ts +6 -0
- package/dist/cli/tui/permission-settings.js +84 -0
- package/dist/cli/tui/sandbox-dashboard.d.ts +10 -0
- package/dist/cli/tui/sandbox-dashboard.js +78 -0
- package/dist/cli/tui/sandbox-settings.d.ts +32 -0
- package/dist/cli/tui/sandbox-settings.js +146 -0
- package/dist/cli/tui/slash-commands.js +8 -28
- package/dist/cli/tui/tool-permission.d.ts +36 -0
- package/dist/cli/tui/tool-permission.js +386 -0
- package/dist/cli.d.ts +3 -2
- package/dist/cli.js +53 -14
- package/dist/core/runtime.d.ts +50 -2
- package/dist/core/runtime.js +30 -3
- package/dist/extensions/claude-extension-tools.d.ts +3 -2
- package/dist/extensions/claude-extension-tools.js +15 -5
- package/dist/extensions/claude-extensions.d.ts +1 -0
- package/dist/extensions/claude-extensions.js +10 -0
- package/dist/hooks/claude-hook-tools.js +1 -1
- package/dist/mcp/claude-mcp-tools.js +12 -6
- package/dist/permissions/bash-ast.d.ts +39 -0
- package/dist/permissions/bash-ast.js +1046 -0
- package/dist/permissions/bash-normalization.d.ts +5 -0
- package/dist/permissions/bash-normalization.js +241 -0
- package/dist/permissions/bash-path-safety.d.ts +30 -0
- package/dist/permissions/bash-path-safety.js +582 -0
- package/dist/permissions/claude-permission-resolver.d.ts +18 -0
- package/dist/permissions/claude-permission-resolver.js +366 -40
- package/dist/permissions/claude-shell-permission.d.ts +4 -0
- package/dist/permissions/claude-shell-permission.js +108 -0
- package/dist/permissions/permission-updates.d.ts +16 -0
- package/dist/permissions/permission-updates.js +320 -0
- package/dist/permissions/sed-safety.d.ts +9 -0
- package/dist/permissions/sed-safety.js +172 -0
- package/dist/permissions/shell-rule-matching.d.ts +14 -0
- package/dist/permissions/shell-rule-matching.js +76 -0
- package/dist/sandbox/claude-sandbox-runtime.d.ts +54 -0
- package/dist/sandbox/claude-sandbox-runtime.js +175 -0
- package/dist/sandbox/claude-sandbox-settings.d.ts +23 -0
- package/dist/sandbox/claude-sandbox-settings.js +286 -0
- package/dist/tools/claude-interactive-tools.d.ts +10 -1
- package/dist/tools/claude-interactive-tools.js +10 -4
- package/dist/tools/local-tools.d.ts +18 -0
- package/dist/tools/local-tools.js +69 -10
- package/package.json +4 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
const TABS = {
|
|
4
|
+
mode: 'Mode',
|
|
5
|
+
dependencies: 'Dependencies',
|
|
6
|
+
overrides: 'Overrides',
|
|
7
|
+
config: 'Config',
|
|
8
|
+
};
|
|
9
|
+
export function tuiSandboxTabs(snapshot) {
|
|
10
|
+
if (snapshot.dependencies.errors.length > 0)
|
|
11
|
+
return ['dependencies'];
|
|
12
|
+
return [
|
|
13
|
+
'mode',
|
|
14
|
+
...(snapshot.dependencies.warnings.length > 0
|
|
15
|
+
? ['dependencies']
|
|
16
|
+
: []),
|
|
17
|
+
'overrides',
|
|
18
|
+
'config',
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
function prefix(selected, screenReader) {
|
|
22
|
+
if (screenReader)
|
|
23
|
+
return selected ? 'Selected: ' : '';
|
|
24
|
+
return selected ? '❯ ' : ' ';
|
|
25
|
+
}
|
|
26
|
+
export function SandboxDashboard({ snapshot, tab, selectedIndex, width, screenReader, }) {
|
|
27
|
+
const tabs = tuiSandboxTabs(snapshot);
|
|
28
|
+
const mode = !snapshot.settings.enabled
|
|
29
|
+
? 'disabled'
|
|
30
|
+
: snapshot.settings.autoAllowBashIfSandboxed
|
|
31
|
+
? 'auto-allow'
|
|
32
|
+
: 'regular';
|
|
33
|
+
const modeRows = [
|
|
34
|
+
{
|
|
35
|
+
value: 'auto-allow',
|
|
36
|
+
label: 'Sandbox BashTool, with auto-allow',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: 'regular',
|
|
40
|
+
label: 'Sandbox BashTool, with regular permissions',
|
|
41
|
+
},
|
|
42
|
+
{ value: 'disabled', label: 'No Sandbox' },
|
|
43
|
+
];
|
|
44
|
+
const overrideRows = [
|
|
45
|
+
{
|
|
46
|
+
value: true,
|
|
47
|
+
label: 'Allow unsandboxed fallback',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: false,
|
|
51
|
+
label: 'Strict sandbox mode',
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
const filesystem = snapshot.settings.runtimeConfig.filesystem;
|
|
55
|
+
const network = snapshot.settings.runtimeConfig.network;
|
|
56
|
+
return (_jsxs(Box, { flexDirection: "column", width: Math.min(100, width), children: [!screenReader ? (_jsx(Text, { dimColor: true, children: '─'.repeat(Math.min(100, width)) })) : null, _jsx(Text, { bold: true, children: " Sandbox:" }), _jsxs(Text, { children: [' ', tabs.map((candidate) => (_jsxs(Text, { inverse: !screenReader && candidate === tab, children: [screenReader && candidate === tab ? 'Current tab: ' : ' ', TABS[candidate], ' '] }, candidate)))] }), _jsx(Text, { children: " " }), tab === 'mode' ? (_jsxs(_Fragment, { children: [_jsx(Text, { bold: true, children: " Configure Mode:" }), _jsx(Text, { children: " " }), modeRows.map((row, index) => (_jsxs(Text, { inverse: !screenReader && selectedIndex === index, children: [prefix(selectedIndex === index, screenReader), index + 1, ". ", row.label, row.value === mode ? ' (current)' : ''] }, row.value))), _jsx(Text, { children: " " }), _jsx(Text, { dimColor: true, children: "Auto-allow mode runs Bash in the sandbox automatically. Explicit ask and deny rules are always respected." })] })) : tab === 'dependencies' ? (_jsxs(Box, { flexDirection: "column", children: [snapshot.platform === 'macos' ? (_jsxs(Text, { children: ["seatbelt: ", _jsx(Text, { color: "green", children: "built-in (macOS)" })] })) : (_jsxs(_Fragment, { children: [_jsxs(Text, { children: ["bubblewrap (bwrap):", ' ', _jsx(Text, { color: snapshot.dependencies.errors.some((error) => error.includes('bwrap'))
|
|
57
|
+
? 'red'
|
|
58
|
+
: 'green', children: snapshot.dependencies.errors.some((error) => error.includes('bwrap'))
|
|
59
|
+
? 'not installed'
|
|
60
|
+
: 'installed' })] }), _jsxs(Text, { children: ["socat:", ' ', _jsx(Text, { color: snapshot.dependencies.errors.some((error) => error.includes('socat'))
|
|
61
|
+
? 'red'
|
|
62
|
+
: 'green', children: snapshot.dependencies.errors.some((error) => error.includes('socat'))
|
|
63
|
+
? 'not installed'
|
|
64
|
+
: 'installed' })] }), _jsxs(Text, { children: ["seccomp filter:", ' ', _jsx(Text, { color: snapshot.dependencies.warnings.length > 0
|
|
65
|
+
? 'yellow'
|
|
66
|
+
: 'green', children: snapshot.dependencies.warnings.length > 0
|
|
67
|
+
? 'not installed'
|
|
68
|
+
: 'installed' })] })] })), _jsxs(Text, { children: ["ripgrep (rg):", ' ', _jsx(Text, { color: snapshot.dependencies.errors.some((error) => error.includes('ripgrep'))
|
|
69
|
+
? 'red'
|
|
70
|
+
: 'green', children: snapshot.dependencies.errors.some((error) => error.includes('ripgrep'))
|
|
71
|
+
? 'not found'
|
|
72
|
+
: 'found' })] }), snapshot.dependencies.errors.map((error) => (_jsx(Text, { color: "red", children: error }, error))), snapshot.dependencies.warnings.map((warning) => (_jsx(Text, { color: "yellow", children: warning }, warning))), snapshot.unavailableReason ? (_jsx(Text, { color: "red", children: snapshot.unavailableReason })) : null] })) : tab === 'overrides' ? (_jsxs(_Fragment, { children: [!snapshot.settings.enabled ? (_jsx(Text, { dimColor: true, children: "Sandbox is not enabled" })) : (overrideRows.map((row, index) => (_jsxs(Text, { inverse: !screenReader && selectedIndex === index, children: [prefix(selectedIndex === index, screenReader), index + 1, ". ", row.label, row.value === snapshot.settings.allowUnsandboxedCommands
|
|
73
|
+
? ' (current)'
|
|
74
|
+
: ''] }, String(row.value))))), _jsx(Text, { children: " " }), _jsx(Text, { dimColor: true, children: "Closed mode ignores dangerouslyDisableSandbox and requires commands to remain sandboxed." })] })) : !snapshot.settings.enabled ? (_jsx(Text, { dimColor: true, children: "Sandbox is not enabled" })) : (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Excluded Commands:" }), _jsx(Text, { dimColor: true, children: snapshot.settings.excludedCommands.join(', ') || 'None' }), _jsx(Text, { bold: true, children: "Filesystem Read Restrictions:" }), _jsxs(Text, { dimColor: true, children: ["Denied: ", filesystem?.denyRead?.join(', ') || 'None'] }), _jsxs(Text, { dimColor: true, children: ["Allowed within denied: ", filesystem?.allowRead?.join(', ') || 'None'] }), _jsx(Text, { bold: true, children: "Filesystem Write Restrictions:" }), _jsxs(Text, { dimColor: true, children: ["Allowed: ", filesystem?.allowWrite?.join(', ') || 'None'] }), _jsxs(Text, { dimColor: true, children: ["Denied within allowed: ", filesystem?.denyWrite?.join(', ') || 'None'] }), _jsx(Text, { bold: true, children: "Network Restrictions:" }), _jsxs(Text, { dimColor: true, children: ["Allowed: ", network?.allowedDomains?.join(', ') || 'None'] }), _jsxs(Text, { dimColor: true, children: ["Denied: ", network?.deniedDomains?.join(', ') || 'None'] }), _jsx(Text, { bold: true, children: "Allowed Unix Sockets:" }), _jsx(Text, { dimColor: true, children: network?.allowUnixSockets?.join(', ') || 'None' }), (snapshot.globPatternWarnings?.length ?? 0) > 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { bold: true, color: "yellow", children: "\u26A0 Warning: Glob patterns not fully supported on Linux" }), _jsx(Text, { dimColor: true, children: snapshot.globPatternWarnings?.slice(0, 3).join(', ') })] })) : null] })), _jsx(Text, { children: " " }), _jsx(Text, { dimColor: true, children: tab === 'mode' || (tab === 'overrides' && snapshot.settings.enabled)
|
|
75
|
+
? '↑/↓ navigate · Enter to select · ←/→ switch tabs · Esc to cancel'
|
|
76
|
+
: '←/→ switch tabs · Esc to cancel' })] }));
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=sandbox-dashboard.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SandboxDependencyCheck } from '@anthropic-ai/sandbox-runtime';
|
|
2
|
+
import { loadClaudeSettings } from '../../compatibility/claude/shared-resources.js';
|
|
3
|
+
import { type ClaudeSandboxSettings } from '../../sandbox/claude-sandbox-settings.js';
|
|
4
|
+
export type TuiSandboxMode = 'auto-allow' | 'regular' | 'disabled';
|
|
5
|
+
export type TuiSandboxTab = 'mode' | 'dependencies' | 'overrides' | 'config';
|
|
6
|
+
export interface TuiSandboxSnapshot {
|
|
7
|
+
settings: ClaudeSandboxSettings;
|
|
8
|
+
dependencies: SandboxDependencyCheck;
|
|
9
|
+
supported: boolean;
|
|
10
|
+
platform: 'macos' | 'linux' | 'windows' | 'wsl';
|
|
11
|
+
globPatternWarnings?: readonly string[];
|
|
12
|
+
unavailableReason?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TuiSandboxStore {
|
|
15
|
+
load(): Promise<TuiSandboxSnapshot>;
|
|
16
|
+
setMode(mode: TuiSandboxMode): Promise<TuiSandboxSnapshot>;
|
|
17
|
+
setAllowUnsandboxedCommands(allow: boolean): Promise<TuiSandboxSnapshot>;
|
|
18
|
+
exclude(pattern: string): Promise<{
|
|
19
|
+
pattern: string;
|
|
20
|
+
settingsPath: string;
|
|
21
|
+
snapshot: TuiSandboxSnapshot;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export declare function linuxGlobPatternWarnings(resources: Awaited<ReturnType<typeof loadClaudeSettings>>, platform: 'macos' | 'linux' | 'windows' | 'wsl'): string[];
|
|
25
|
+
export declare function createTuiSandboxStore({ configRoot, cwd, homeDirectory, additionalDirectories, environment, }: {
|
|
26
|
+
configRoot: string;
|
|
27
|
+
cwd: string;
|
|
28
|
+
homeDirectory: string;
|
|
29
|
+
additionalDirectories?: readonly string[];
|
|
30
|
+
environment?: NodeJS.ProcessEnv;
|
|
31
|
+
}): TuiSandboxStore;
|
|
32
|
+
//# sourceMappingURL=sandbox-settings.d.ts.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { join, relative } from 'node:path';
|
|
3
|
+
import { loadClaudeSettings } from '../../compatibility/claude/shared-resources.js';
|
|
4
|
+
import { writeFileAtomically } from '../../platform/atomic-write.js';
|
|
5
|
+
import { claudeSandboxRuntime } from '../../sandbox/claude-sandbox-runtime.js';
|
|
6
|
+
import { claudeSandboxTempDirectory, loadClaudeSandboxSettings, } from '../../sandbox/claude-sandbox-settings.js';
|
|
7
|
+
function isRecord(value) {
|
|
8
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
9
|
+
}
|
|
10
|
+
async function readLocalSettings(path) {
|
|
11
|
+
try {
|
|
12
|
+
const value = JSON.parse(await readFile(path, 'utf8'));
|
|
13
|
+
if (!isRecord(value))
|
|
14
|
+
throw new Error(`Settings must be an object: ${path}`);
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (error.code === 'ENOENT')
|
|
19
|
+
return {};
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function updateLocalSandbox(path, update) {
|
|
24
|
+
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
25
|
+
let source;
|
|
26
|
+
try {
|
|
27
|
+
source = await readFile(path, 'utf8');
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error.code !== 'ENOENT')
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
const settings = await readLocalSettings(path);
|
|
34
|
+
const current = settings.sandbox;
|
|
35
|
+
if (current !== undefined && !isRecord(current)) {
|
|
36
|
+
throw new Error(`sandbox must be an object: ${path}`);
|
|
37
|
+
}
|
|
38
|
+
const committed = await writeFileAtomically(path, `${JSON.stringify({ ...settings, sandbox: update(current ?? {}) }, null, 2)}\n`, {
|
|
39
|
+
beforeCommit: async () => {
|
|
40
|
+
try {
|
|
41
|
+
return (await readFile(path, 'utf8')) === source;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error.code === 'ENOENT')
|
|
45
|
+
return source === undefined;
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
if (committed)
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`Settings changed concurrently: ${path}`);
|
|
54
|
+
}
|
|
55
|
+
export function linuxGlobPatternWarnings(resources, platform) {
|
|
56
|
+
if (platform !== 'linux' && platform !== 'wsl')
|
|
57
|
+
return [];
|
|
58
|
+
const warnings = [];
|
|
59
|
+
for (const resource of resources) {
|
|
60
|
+
if (!isRecord(resource.value) || !isRecord(resource.value.permissions))
|
|
61
|
+
continue;
|
|
62
|
+
for (const behavior of ['allow', 'deny']) {
|
|
63
|
+
const rules = resource.value.permissions[behavior];
|
|
64
|
+
if (!Array.isArray(rules))
|
|
65
|
+
continue;
|
|
66
|
+
for (const rule of rules) {
|
|
67
|
+
if (typeof rule !== 'string')
|
|
68
|
+
continue;
|
|
69
|
+
const match = /^(?:Edit|Read)\((.*)\)$/u.exec(rule);
|
|
70
|
+
const pattern = match?.[1]?.replace(/\/\*\*$/u, '');
|
|
71
|
+
if (pattern && /[*?[\]]/u.test(pattern))
|
|
72
|
+
warnings.push(rule);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return [...new Set(warnings)];
|
|
77
|
+
}
|
|
78
|
+
export function createTuiSandboxStore({ configRoot, cwd, homeDirectory, additionalDirectories = [], environment = process.env, }) {
|
|
79
|
+
const localSettingsPath = join(cwd, '.claude', 'settings.local.json');
|
|
80
|
+
const load = async () => {
|
|
81
|
+
const resources = await loadClaudeSettings({ configRoot, cwd });
|
|
82
|
+
const settings = loadClaudeSandboxSettings({
|
|
83
|
+
resources,
|
|
84
|
+
cwd,
|
|
85
|
+
configRoot,
|
|
86
|
+
homeDirectory,
|
|
87
|
+
additionalDirectories,
|
|
88
|
+
tempDirectory: claudeSandboxTempDirectory(environment),
|
|
89
|
+
});
|
|
90
|
+
await claudeSandboxRuntime.initialize(settings);
|
|
91
|
+
const unavailableReason = claudeSandboxRuntime.unavailableReason(settings);
|
|
92
|
+
const platform = claudeSandboxRuntime.platformName();
|
|
93
|
+
return {
|
|
94
|
+
settings,
|
|
95
|
+
dependencies: claudeSandboxRuntime.dependencyCheck(settings),
|
|
96
|
+
supported: claudeSandboxRuntime.isSupportedPlatform(),
|
|
97
|
+
platform,
|
|
98
|
+
globPatternWarnings: linuxGlobPatternWarnings(resources, platform),
|
|
99
|
+
...(unavailableReason ? { unavailableReason } : {}),
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
load,
|
|
104
|
+
async setMode(mode) {
|
|
105
|
+
await updateLocalSandbox(localSettingsPath, (sandbox) => ({
|
|
106
|
+
...sandbox,
|
|
107
|
+
enabled: mode !== 'disabled',
|
|
108
|
+
autoAllowBashIfSandboxed: mode === 'auto-allow',
|
|
109
|
+
}));
|
|
110
|
+
return load();
|
|
111
|
+
},
|
|
112
|
+
async setAllowUnsandboxedCommands(allow) {
|
|
113
|
+
await updateLocalSandbox(localSettingsPath, (sandbox) => ({
|
|
114
|
+
...sandbox,
|
|
115
|
+
allowUnsandboxedCommands: allow,
|
|
116
|
+
}));
|
|
117
|
+
return load();
|
|
118
|
+
},
|
|
119
|
+
async exclude(pattern) {
|
|
120
|
+
const cleanPattern = pattern.trim().replace(/^["']|["']$/gu, '');
|
|
121
|
+
if (!cleanPattern) {
|
|
122
|
+
throw new Error('Please provide a command pattern to exclude');
|
|
123
|
+
}
|
|
124
|
+
await updateLocalSandbox(localSettingsPath, (sandbox) => {
|
|
125
|
+
const excluded = sandbox.excludedCommands;
|
|
126
|
+
if (excluded !== undefined &&
|
|
127
|
+
(!Array.isArray(excluded) ||
|
|
128
|
+
excluded.some((value) => typeof value !== 'string'))) {
|
|
129
|
+
throw new Error(`sandbox.excludedCommands must be an array of strings: ${localSettingsPath}`);
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
...sandbox,
|
|
133
|
+
excludedCommands: [
|
|
134
|
+
...new Set([...(excluded ?? []), cleanPattern]),
|
|
135
|
+
],
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
pattern: cleanPattern,
|
|
140
|
+
settingsPath: relative(cwd, localSettingsPath),
|
|
141
|
+
snapshot: await load(),
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=sandbox-settings.js.map
|
|
@@ -14,16 +14,6 @@ export const BUILTIN_TUI_SLASH_COMMANDS = [
|
|
|
14
14
|
description: 'Ask a quick side question without adding it to the conversation',
|
|
15
15
|
source: 'builtin',
|
|
16
16
|
},
|
|
17
|
-
{
|
|
18
|
-
name: 'background',
|
|
19
|
-
description: 'Send this session to the background and free the terminal',
|
|
20
|
-
source: 'builtin',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'cd',
|
|
24
|
-
description: 'Change the current working directory',
|
|
25
|
-
source: 'builtin',
|
|
26
|
-
},
|
|
27
17
|
{
|
|
28
18
|
name: 'help',
|
|
29
19
|
description: 'Show help and available commands',
|
|
@@ -74,6 +64,11 @@ export const BUILTIN_TUI_SLASH_COMMANDS = [
|
|
|
74
64
|
description: 'Manage allow and deny tool permission rules',
|
|
75
65
|
source: 'builtin',
|
|
76
66
|
},
|
|
67
|
+
{
|
|
68
|
+
name: 'sandbox',
|
|
69
|
+
description: 'Configure sandbox mode and command isolation',
|
|
70
|
+
source: 'builtin',
|
|
71
|
+
},
|
|
77
72
|
{
|
|
78
73
|
name: 'resume',
|
|
79
74
|
description: 'Resume a previous conversation',
|
|
@@ -110,12 +105,12 @@ export const BUILTIN_TUI_SLASH_COMMANDS = [
|
|
|
110
105
|
source: 'builtin',
|
|
111
106
|
},
|
|
112
107
|
{
|
|
113
|
-
name: '
|
|
114
|
-
description: '
|
|
108
|
+
name: 'vim',
|
|
109
|
+
description: 'Toggle between Vim and Normal editing modes',
|
|
115
110
|
source: 'builtin',
|
|
116
111
|
},
|
|
117
112
|
{
|
|
118
|
-
name: '
|
|
113
|
+
name: 'skills',
|
|
119
114
|
description: 'List available skills',
|
|
120
115
|
source: 'builtin',
|
|
121
116
|
},
|
|
@@ -129,11 +124,6 @@ export const BUILTIN_TUI_SLASH_COMMANDS = [
|
|
|
129
124
|
description: 'Activate pending plugin changes in the current session',
|
|
130
125
|
source: 'builtin',
|
|
131
126
|
},
|
|
132
|
-
{
|
|
133
|
-
name: 'reload-skills',
|
|
134
|
-
description: 'Pick up skills added or changed on disk during this session',
|
|
135
|
-
source: 'builtin',
|
|
136
|
-
},
|
|
137
127
|
{
|
|
138
128
|
name: 'rename',
|
|
139
129
|
description: 'Rename the current conversation',
|
|
@@ -144,11 +134,6 @@ export const BUILTIN_TUI_SLASH_COMMANDS = [
|
|
|
144
134
|
description: 'Restore the code and/or conversation to an earlier point',
|
|
145
135
|
source: 'builtin',
|
|
146
136
|
},
|
|
147
|
-
{
|
|
148
|
-
name: 'usage',
|
|
149
|
-
description: 'Show session cost, model usage, and activity stats',
|
|
150
|
-
source: 'builtin',
|
|
151
|
-
},
|
|
152
137
|
{
|
|
153
138
|
name: 'tasks',
|
|
154
139
|
description: 'View background work',
|
|
@@ -164,11 +149,6 @@ export const BUILTIN_TUI_SLASH_COMMANDS = [
|
|
|
164
149
|
description: 'Browse running and completed workflows',
|
|
165
150
|
source: 'builtin',
|
|
166
151
|
},
|
|
167
|
-
{
|
|
168
|
-
name: 'tui',
|
|
169
|
-
description: 'Switch between the default and fullscreen renderers',
|
|
170
|
-
source: 'builtin',
|
|
171
|
-
},
|
|
172
152
|
{
|
|
173
153
|
name: 'exit',
|
|
174
154
|
description: 'Exit the CLI',
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ModelToolCall, PermissionDecision, PermissionUpdate } from '../../core/runtime.js';
|
|
2
|
+
import { type ComposerEditorState } from './composer-editor.js';
|
|
3
|
+
export type TuiToolPermissionAction = 'allow-once' | 'allow-session-edits' | 'allow-session-action' | 'persist-rule' | 'deny';
|
|
4
|
+
export interface TuiToolPermissionOption {
|
|
5
|
+
action: TuiToolPermissionAction;
|
|
6
|
+
label: string;
|
|
7
|
+
rule?: string;
|
|
8
|
+
updates?: readonly PermissionUpdate[];
|
|
9
|
+
editableRule?: {
|
|
10
|
+
toolName: string;
|
|
11
|
+
initialValue: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface TuiToolPermissionModel {
|
|
15
|
+
kind: 'bash' | 'file' | 'notebook' | 'filesystem' | 'web-fetch' | 'skill' | 'generic';
|
|
16
|
+
title: string;
|
|
17
|
+
subtitle?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
explanation?: string;
|
|
20
|
+
question: string;
|
|
21
|
+
detail: readonly {
|
|
22
|
+
prefix?: '+' | '-';
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
options: readonly TuiToolPermissionOption[];
|
|
26
|
+
}
|
|
27
|
+
export declare function projectTuiToolPermission(call: ModelToolCall, cwd: string, sensitiveValues: readonly string[], decision?: PermissionDecision): TuiToolPermissionModel;
|
|
28
|
+
export declare function ToolPermissionDialog({ model, selection, feedbackMode, feedback, ruleEditor, screenReader, }: {
|
|
29
|
+
model: TuiToolPermissionModel;
|
|
30
|
+
selection: number;
|
|
31
|
+
feedbackMode: boolean;
|
|
32
|
+
feedback: string;
|
|
33
|
+
ruleEditor?: ComposerEditorState | null;
|
|
34
|
+
screenReader: boolean;
|
|
35
|
+
}): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=tool-permission.d.ts.map
|