vigthoria-cli 1.9.20 → 1.9.22
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/dist/commands/cancel.js +1 -1
- package/dist/commands/chat.js +3 -0
- package/dist/commands/fork.js +1 -1
- package/dist/commands/history.js +1 -1
- package/dist/commands/replay.js +1 -1
- package/dist/utils/api.js +6 -2
- package/dist/utils/tools.js +14 -14
- package/install.ps1 +1 -1
- package/install.sh +1 -1
- package/package.json +1 -1
package/dist/commands/cancel.js
CHANGED
|
@@ -32,7 +32,7 @@ export class CancelCommand {
|
|
|
32
32
|
}
|
|
33
33
|
getBaseUrl() {
|
|
34
34
|
const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
|
|
35
|
-
const allowLocal = isServerRuntime()
|
|
35
|
+
const allowLocal = !isServerRuntime() || process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
|
|
36
36
|
return (process.env.VIGTHORIA_V3_AGENT_URL ||
|
|
37
37
|
process.env.V3_AGENT_URL ||
|
|
38
38
|
(allowLocal ? 'http://127.0.0.1:8030' : null) ||
|
package/dist/commands/chat.js
CHANGED
|
@@ -2801,6 +2801,9 @@ export class ChatCommand {
|
|
|
2801
2801
|
return [
|
|
2802
2802
|
'Vigthoria CLI agent operating contract.',
|
|
2803
2803
|
`You are operating inside the project root: ${this.currentProjectPath}`,
|
|
2804
|
+
`You are operating on the user's LOCAL machine. This CLI is not a server-only runtime.`,
|
|
2805
|
+
`All file reads/writes and command execution must target the local project/workspace path unless the user explicitly requests remote/server execution.`,
|
|
2806
|
+
'For command execution: ask for confirmation before risky commands; never redirect normal local work to server paths.',
|
|
2804
2807
|
'CRITICAL: Begin working on the user\'s task IMMEDIATELY. Your very first response MUST contain <tool_call> blocks to gather evidence. Do NOT acknowledge instructions, restate the task, describe your plan, or discuss tool policies. Act, do not talk.',
|
|
2805
2808
|
'FILE CREATION RULE: When the user asks you to build, create, or generate files, you MUST use the write_file tool to actually create each file on disk. NEVER output code snippets as markdown text — always write them to files using write_file. If the task requires a new project, create a new directory first, then write all files into it.',
|
|
2806
2809
|
'Stay inside that project unless the user explicitly asks otherwise.',
|
package/dist/commands/fork.js
CHANGED
|
@@ -29,7 +29,7 @@ export class ForkCommand {
|
|
|
29
29
|
}
|
|
30
30
|
getBaseUrl() {
|
|
31
31
|
const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
|
|
32
|
-
const allowLocal = isServerRuntime()
|
|
32
|
+
const allowLocal = !isServerRuntime() || process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
|
|
33
33
|
return (process.env.VIGTHORIA_V3_AGENT_URL ||
|
|
34
34
|
process.env.V3_AGENT_URL ||
|
|
35
35
|
(allowLocal ? 'http://127.0.0.1:8030' : null) ||
|
package/dist/commands/history.js
CHANGED
|
@@ -29,7 +29,7 @@ export class HistoryCommand {
|
|
|
29
29
|
}
|
|
30
30
|
getBaseUrl() {
|
|
31
31
|
const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
|
|
32
|
-
const allowLocal = isServerRuntime()
|
|
32
|
+
const allowLocal = !isServerRuntime() || process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
|
|
33
33
|
return (process.env.VIGTHORIA_V3_AGENT_URL ||
|
|
34
34
|
process.env.V3_AGENT_URL ||
|
|
35
35
|
(allowLocal ? 'http://127.0.0.1:8030' : null) ||
|
package/dist/commands/replay.js
CHANGED
|
@@ -29,7 +29,7 @@ export class ReplayCommand {
|
|
|
29
29
|
}
|
|
30
30
|
getBaseUrl() {
|
|
31
31
|
const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
|
|
32
|
-
const allowLocal = isServerRuntime()
|
|
32
|
+
const allowLocal = !isServerRuntime() || process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
|
|
33
33
|
return (process.env.VIGTHORIA_V3_AGENT_URL ||
|
|
34
34
|
process.env.V3_AGENT_URL ||
|
|
35
35
|
(allowLocal ? 'http://127.0.0.1:8030' : null) ||
|
package/dist/utils/api.js
CHANGED
|
@@ -136,6 +136,8 @@ export function sanitizeUserFacingPathText(input) {
|
|
|
136
136
|
.replace(/\bBound server workspace:\s*\S+/gi, 'Bound workspace: workspace/')
|
|
137
137
|
.replace(/\bserver filesystem\b/gi, 'workspace sandbox')
|
|
138
138
|
.replace(/\bon the server\b/gi, 'in the workspace')
|
|
139
|
+
.replace(/Blocked: shell operator '\\|' is not supported; run commands directly without shell piping or redirection/gi, 'Blocked command syntax from remote runner. Re-run locally using a single command, or ask for approval to run an equivalent local command.')
|
|
140
|
+
.replace(/command references a path outside the workspace\. Use paths relative to the workspace root[^.]*\./gi, 'The command path must resolve inside your local project workspace. Use local workspace-relative paths.')
|
|
139
141
|
.replace(/\[(?:\s*)\]/g, '[workspace]')
|
|
140
142
|
.replace(/(^|\s)\.\//g, '$1')
|
|
141
143
|
.replace(/([^:])\/\/+/g, '$1/')
|
|
@@ -579,7 +581,9 @@ export class APIClient {
|
|
|
579
581
|
}
|
|
580
582
|
getV3AgentBaseUrls(preferLocal = false) {
|
|
581
583
|
const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
|
|
582
|
-
const allowLocalV3Agent =
|
|
584
|
+
const allowLocalV3Agent = preferLocal
|
|
585
|
+
|| process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1'
|
|
586
|
+
|| !isServerRuntime();
|
|
583
587
|
const urls = [
|
|
584
588
|
process.env.VIGTHORIA_V3_AGENT_URL,
|
|
585
589
|
process.env.V3_AGENT_URL,
|
|
@@ -1971,7 +1975,7 @@ menu {
|
|
|
1971
1975
|
}
|
|
1972
1976
|
resolveServerBindableWorkspacePath(context = {}) {
|
|
1973
1977
|
const candidate = this.resolveAgentTargetPath(context);
|
|
1974
|
-
if (!candidate ||
|
|
1978
|
+
if (!candidate || !path.isAbsolute(candidate) || !fs.existsSync(candidate)) {
|
|
1975
1979
|
return '';
|
|
1976
1980
|
}
|
|
1977
1981
|
const configuredRoots = (process.env.VIGTHORIA_SERVER_WORKSPACE_ROOTS || '/var/www/vigthoria-user-workspaces,/var/lib/vigthoria-workspaces')
|
package/dist/utils/tools.js
CHANGED
|
@@ -835,8 +835,19 @@ export class AgenticTools {
|
|
|
835
835
|
}
|
|
836
836
|
// Check permission for dangerous/modifying actions
|
|
837
837
|
if (tool.requiresPermission && !this.autoApprove) {
|
|
838
|
-
|
|
839
|
-
if (
|
|
838
|
+
const requiresPerCommandApproval = normalizedCall.tool === 'bash';
|
|
839
|
+
if (requiresPerCommandApproval) {
|
|
840
|
+
const approved = await this.permissionCallback(this.formatPermissionRequest(normalizedCall, tool), { batchApproval: false });
|
|
841
|
+
if (approved === false) {
|
|
842
|
+
return {
|
|
843
|
+
success: false,
|
|
844
|
+
error: 'Permission denied by user',
|
|
845
|
+
canRetry: true,
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
else if (this.hasPersistentPermission(normalizedCall.tool)) {
|
|
850
|
+
// Check persistent permissions first (project-scoped), then session
|
|
840
851
|
this.logger.info(`${call.tool}: Auto-approved (persistent)`);
|
|
841
852
|
}
|
|
842
853
|
else if (this.sessionApprovedTools.has(normalizedCall.tool)) {
|
|
@@ -1542,18 +1553,7 @@ export class AgenticTools {
|
|
|
1542
1553
|
for (const part of cmdParts) {
|
|
1543
1554
|
const firstWord = part.trim().split(/\s+/)[0].toLowerCase();
|
|
1544
1555
|
if (unixOnlyCommands.includes(firstWord)) {
|
|
1545
|
-
return this.createErrorResult(ToolErrorType.EXECUTION_FAILED, `Command '${firstWord}' is not available on Windows`, `Use
|
|
1546
|
-
`or use 'fetch_url' for web requests. ` +
|
|
1547
|
-
`PowerShell alternatives: dir (ls), type (cat), findstr (grep), select-string (grep)`);
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
// Check for pipe to Unix command
|
|
1551
|
-
if (args.command.includes('|')) {
|
|
1552
|
-
const pipedCommands = args.command.split('|').map(c => c.trim().split(/\s+/)[0].toLowerCase());
|
|
1553
|
-
for (const cmd of pipedCommands) {
|
|
1554
|
-
if (unixOnlyCommands.includes(cmd)) {
|
|
1555
|
-
return this.createErrorResult(ToolErrorType.EXECUTION_FAILED, `Piped command '${cmd}' is not available on Windows`, `Windows doesn't have '${cmd}'. Use 'ssh_exec' tool to run this command on the Vigthoria server instead.`);
|
|
1556
|
-
}
|
|
1556
|
+
return this.createErrorResult(ToolErrorType.EXECUTION_FAILED, `Command '${firstWord}' is not available on Windows`, `Use a local PowerShell equivalent instead: dir (ls), type (cat), findstr (grep), select-string (grep), or rerun with a Windows-safe command.`);
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
1559
|
}
|
package/install.ps1
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
$ErrorActionPreference = "Stop"
|
|
6
6
|
|
|
7
7
|
# Configuration
|
|
8
|
-
$CLI_VERSION = "1.9.
|
|
8
|
+
$CLI_VERSION = "1.9.22"
|
|
9
9
|
$INSTALL_DIR = "$env:USERPROFILE\.vigthoria"
|
|
10
10
|
$NPM_PACKAGE = "vigthoria-cli"
|
|
11
11
|
$GIT_PACKAGE_URL = "git+https://market.vigthoria.io/vigthoria/vigthoria-cli.git"
|
package/install.sh
CHANGED
|
@@ -26,7 +26,7 @@ else
|
|
|
26
26
|
fi
|
|
27
27
|
|
|
28
28
|
# Configuration
|
|
29
|
-
CLI_VERSION="1.9.
|
|
29
|
+
CLI_VERSION="1.9.22"
|
|
30
30
|
INSTALL_DIR="$HOME/.vigthoria"
|
|
31
31
|
REPO_URL="https://market.vigthoria.io/vigthoria/vigthoria-cli"
|
|
32
32
|
GIT_PACKAGE_URL="git+https://market.vigthoria.io/vigthoria/vigthoria-cli.git"
|