@hasna/terminal 2.0.0 → 2.0.1
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/ai.js +4 -0
- package/package.json +1 -1
- package/src/ai.ts +4 -0
package/dist/ai.js
CHANGED
|
@@ -45,6 +45,8 @@ const IRREVERSIBLE_PATTERNS = [
|
|
|
45
45
|
/\bcodemod\b/, /\bsed\s+-i\b/, /\bawk\s.*>\s*\S+\.\w+/, /\bperl\s+-[pi]\b/,
|
|
46
46
|
// File creation/modification (READ-ONLY terminal)
|
|
47
47
|
/\btouch\b/, /\bmkdir\b/, /\becho\s.*>/, /\btee\b/, /\bcp\b/, /\bmv\b/,
|
|
48
|
+
// Starting servers/processes (dangerous from NL)
|
|
49
|
+
/\b(bun|npm|pnpm|yarn)\s+run\s+dev\b/, /\b(bun|npm)\s+start\b/,
|
|
48
50
|
];
|
|
49
51
|
// Commands that are ALWAYS safe (read-only git, etc.)
|
|
50
52
|
const SAFE_OVERRIDES = [
|
|
@@ -220,6 +222,8 @@ SEMANTIC MAPPING: When the user references a concept, search the file tree for R
|
|
|
220
222
|
|
|
221
223
|
ACTION vs CONCEPTUAL: If the prompt starts with "run", "execute", "check", "test", "build", "show output of" — ALWAYS generate an executable command. NEVER read README for action requests. Only read docs for "explain why", "what does X mean", "how was X designed".
|
|
222
224
|
|
|
225
|
+
EXISTENCE CHECKS: If the prompt starts with "is there", "does this have", "do we have", "does X exist" — NEVER run/start/launch anything. Use ls, find, or test -d to CHECK existence. These are READ-ONLY questions.
|
|
226
|
+
|
|
223
227
|
MONOREPO: If the project context says "MONOREPO", search packages/ or apps/ NOT src/. Use: grep -rn "pattern" packages/ --include="*.ts". For specific packages, use packages/PKGNAME/src/.
|
|
224
228
|
cwd: ${process.cwd()}
|
|
225
229
|
shell: zsh / macOS${projectContext}${restrictionBlock}${contextBlock}`;
|
package/package.json
CHANGED
package/src/ai.ts
CHANGED
|
@@ -53,6 +53,8 @@ const IRREVERSIBLE_PATTERNS = [
|
|
|
53
53
|
/\bcodemod\b/, /\bsed\s+-i\b/, /\bawk\s.*>\s*\S+\.\w+/, /\bperl\s+-[pi]\b/,
|
|
54
54
|
// File creation/modification (READ-ONLY terminal)
|
|
55
55
|
/\btouch\b/, /\bmkdir\b/, /\becho\s.*>/, /\btee\b/, /\bcp\b/, /\bmv\b/,
|
|
56
|
+
// Starting servers/processes (dangerous from NL)
|
|
57
|
+
/\b(bun|npm|pnpm|yarn)\s+run\s+dev\b/, /\b(bun|npm)\s+start\b/,
|
|
56
58
|
];
|
|
57
59
|
|
|
58
60
|
// Commands that are ALWAYS safe (read-only git, etc.)
|
|
@@ -259,6 +261,8 @@ SEMANTIC MAPPING: When the user references a concept, search the file tree for R
|
|
|
259
261
|
|
|
260
262
|
ACTION vs CONCEPTUAL: If the prompt starts with "run", "execute", "check", "test", "build", "show output of" — ALWAYS generate an executable command. NEVER read README for action requests. Only read docs for "explain why", "what does X mean", "how was X designed".
|
|
261
263
|
|
|
264
|
+
EXISTENCE CHECKS: If the prompt starts with "is there", "does this have", "do we have", "does X exist" — NEVER run/start/launch anything. Use ls, find, or test -d to CHECK existence. These are READ-ONLY questions.
|
|
265
|
+
|
|
262
266
|
MONOREPO: If the project context says "MONOREPO", search packages/ or apps/ NOT src/. Use: grep -rn "pattern" packages/ --include="*.ts". For specific packages, use packages/PKGNAME/src/.
|
|
263
267
|
cwd: ${process.cwd()}
|
|
264
268
|
shell: zsh / macOS${projectContext}${restrictionBlock}${contextBlock}`;
|