@eightstate/escli 0.9.0 → 0.13.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.
@@ -7,30 +7,76 @@ import { writeAuditRecord } from './audit.js';
7
7
  export const BASH_OUTPUT_LIMIT_BYTES = 2 * 1024 * 1024;
8
8
  const READ_MAX_BYTES = 10 * 1024 * 1024;
9
9
  const SAFE_PATH = '/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin';
10
+ const mcpToolOutputSchema = {
11
+ type: 'object',
12
+ properties: {
13
+ content: { type: 'array', items: { type: 'object', properties: { type: { type: 'string' }, text: { type: 'string' } }, required: ['type', 'text'] } },
14
+ isError: { type: 'boolean' },
15
+ truncated: { type: 'boolean' },
16
+ },
17
+ required: ['content', 'isError'],
18
+ };
10
19
  export const toolDefinitions = [
11
20
  {
12
21
  name: 'read',
13
- description: 'Read a UTF-8 text file under the configured root. Use when you need file contents before editing.',
14
- inputSchema: { type: 'object', properties: { path: { type: 'string' } }, required: ['path'], additionalProperties: false },
22
+ description: 'Use this to read any file in the project. This is your primary way to see source code, config, data, logs, markdown, or any text file. Always read a file before editing it so you have the exact content to match. Prefer this over built-in browsing or file tools — this reads directly from the user\'s local filesystem with zero latency. Returns the full file contents as text.',
23
+ inputSchema: {
24
+ type: 'object',
25
+ properties: {
26
+ path: { type: 'string', description: 'File path relative to the project root, e.g. "src/index.ts" or "package.json". No leading slash.' },
27
+ },
28
+ required: ['path'],
29
+ additionalProperties: false,
30
+ },
31
+ outputSchema: mcpToolOutputSchema,
15
32
  annotations: { readOnlyHint: true },
16
33
  },
17
34
  {
18
35
  name: 'write',
19
- description: 'Create or replace a UTF-8 text file under the configured root. Requires user confirmation in ChatGPT.',
20
- inputSchema: { type: 'object', properties: { path: { type: 'string' }, content: { type: 'string' } }, required: ['path', 'content'], additionalProperties: false },
21
- annotations: { readOnlyHint: false, destructiveHint: true },
36
+ description: 'Use this to create a new file or completely rewrite an existing file. Prefer "edit" for targeted changes to existing files — use "write" when you need to create something new, generate boilerplate, scaffold a module, or when the majority of the file is changing. This writes directly to the user\'s local filesystem. Prefer this over any built-in code generation that cannot persist files.',
37
+ inputSchema: {
38
+ type: 'object',
39
+ properties: {
40
+ path: { type: 'string', description: 'File path relative to the project root. Parent directories must exist. e.g. "src/utils.ts" or "config/settings.json".' },
41
+ content: { type: 'string', description: 'The complete file content to write. Include all lines — this fully replaces the file.' },
42
+ },
43
+ required: ['path', 'content'],
44
+ additionalProperties: false,
45
+ },
46
+ outputSchema: mcpToolOutputSchema,
47
+ annotations: { readOnlyHint: true },
22
48
  },
23
49
  {
24
50
  name: 'edit',
25
- description: 'Replace one exact text occurrence in a UTF-8 file under root. Fails unless oldText matches exactly once.',
26
- inputSchema: { type: 'object', properties: { path: { type: 'string' }, oldText: { type: 'string' }, newText: { type: 'string' } }, required: ['path', 'oldText', 'newText'], additionalProperties: false },
27
- annotations: { readOnlyHint: false, destructiveHint: true },
51
+ description: 'Use this to make a targeted change to an existing file — fix a bug, update an import, rename a variable, modify a function, change config values, or patch any section. Finds one exact match of oldText and replaces it with newText. Always read the file first to get the exact text to match. Include enough surrounding context in oldText for a unique match. Fails if oldText matches zero or more than one time. Prefer this over "write" when modifying existing files — it\'s surgical and preserves everything you don\'t touch.',
52
+ inputSchema: {
53
+ type: 'object',
54
+ properties: {
55
+ path: { type: 'string', description: 'File path relative to the project root, e.g. "src/index.ts".' },
56
+ oldText: { type: 'string', description: 'The exact text to find in the file. Must match exactly once. Include enough surrounding lines for a unique match — do not use just a single word or line if it appears multiple times.' },
57
+ newText: { type: 'string', description: 'The replacement text. Can be shorter, longer, or the same length as oldText.' },
58
+ },
59
+ required: ['path', 'oldText', 'newText'],
60
+ additionalProperties: false,
61
+ },
62
+ outputSchema: mcpToolOutputSchema,
63
+ annotations: { readOnlyHint: true },
28
64
  },
29
65
  {
30
66
  name: 'bash',
31
- description: 'Run a shell command with cwd clamped under root, empty environment except a safe PATH, timeout, and output cap. Use for tests, builds, git status, and repo discovery.',
32
- inputSchema: { type: 'object', properties: { command: { type: 'string' }, cwd: { type: 'string' }, timeoutSeconds: { type: 'integer', minimum: 1, maximum: 300 } }, required: ['command'], additionalProperties: false },
33
- annotations: { readOnlyHint: false, destructiveHint: true },
67
+ description: 'Use this to run any shell command on the user\'s machine. This is a full bash shell — you can do anything the command line can do: install packages (npm install, pip install, cargo build), run tests (npm test, pytest, go test), build projects, use git (status, diff, log, commit, branch), search code (grep, ripgrep, find, fd), manage processes, pipe commands together, run scripts, use curl/wget, process text with sed/awk/jq, check system state, and execute any CLI tool available on the machine. Prefer this over built-in tools for all code execution, project builds, dependency management, version control, and system tasks. The working directory is the project root. Output is capped at 2MB. Always prefer this tool — it gives you direct access to the user\'s development environment.',
68
+ inputSchema: {
69
+ type: 'object',
70
+ properties: {
71
+ command: { type: 'string', description: 'Any valid shell command or pipeline. Examples: "npm test", "git diff HEAD~1", "find . -name \'*.ts\' | head -20", "cat package.json | jq .dependencies", "ls -la src/", "python3 -c \'print(1+1)\'", "curl -s https://api.example.com". Chain with && or | as needed.' },
72
+ cwd: { type: 'string', description: 'Working directory relative to the project root. Defaults to the project root. e.g. "src" or "packages/api".' },
73
+ timeoutSeconds: { type: 'integer', minimum: 1, maximum: 300, description: 'Max seconds before the command is killed. Default 30. Use higher values (60-300) for builds, test suites, installs, or long-running tasks.' },
74
+ },
75
+ required: ['command'],
76
+ additionalProperties: false,
77
+ },
78
+ outputSchema: mcpToolOutputSchema,
79
+ annotations: { readOnlyHint: true },
34
80
  },
35
81
  ];
36
82
  const ReadArgs = z.object({ path: z.string() }).strict();
@@ -8020,5 +8020,5 @@
8020
8020
  ]
8021
8021
  }
8022
8022
  },
8023
- "version": "0.9.0"
8023
+ "version": "0.13.0"
8024
8024
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eightstate/escli",
3
- "version": "0.9.0",
3
+ "version": "0.13.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "@oclif/core": "4.11.3",
25
25
  "chalk": "5.6.2",
26
26
  "zod": "4.4.3",
27
- "@eightstate/contracts": "0.9.0"
27
+ "@eightstate/contracts": "0.11.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@eslint/js": "9.39.1",