@hasna/terminal 2.0.1 → 2.0.2

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.
Files changed (3) hide show
  1. package/dist/ai.js +4 -1
  2. package/package.json +1 -1
  3. package/src/ai.ts +3 -1
package/dist/ai.js CHANGED
@@ -94,11 +94,14 @@ function detectProjectContext() {
94
94
  if (existsSync(pkgPath)) {
95
95
  try {
96
96
  const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
97
- parts.push(`Project: Node.js/TypeScript (package.json found)`);
97
+ parts.push(`Project: ${pkg.name}@${pkg.version} (Node.js/TypeScript)`);
98
+ parts.push(`npm package: ${pkg.name} (use this name for npm view, npm info, etc.)`);
98
99
  if (pkg.scripts) {
99
100
  const scripts = Object.entries(pkg.scripts).map(([k, v]) => `${k}: ${v}`).slice(0, 8);
100
101
  parts.push(`Available scripts: ${scripts.join(", ")}`);
101
102
  }
103
+ if (pkg.dependencies)
104
+ parts.push(`Dependencies: ${Object.keys(pkg.dependencies).join(", ")}`);
102
105
  parts.push(`Use npm/bun/pnpm commands, NOT maven/gradle/cargo.`);
103
106
  }
104
107
  catch { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/terminal",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Smart terminal wrapper for AI agents and humans — structured output, token compression, MCP server, natural language",
5
5
  "type": "module",
6
6
  "bin": {
package/src/ai.ts CHANGED
@@ -118,11 +118,13 @@ function detectProjectContext(): string {
118
118
  if (existsSync(pkgPath)) {
119
119
  try {
120
120
  const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
121
- parts.push(`Project: Node.js/TypeScript (package.json found)`);
121
+ parts.push(`Project: ${pkg.name}@${pkg.version} (Node.js/TypeScript)`);
122
+ parts.push(`npm package: ${pkg.name} (use this name for npm view, npm info, etc.)`);
122
123
  if (pkg.scripts) {
123
124
  const scripts = Object.entries(pkg.scripts).map(([k, v]) => `${k}: ${v}`).slice(0, 8);
124
125
  parts.push(`Available scripts: ${scripts.join(", ")}`);
125
126
  }
127
+ if (pkg.dependencies) parts.push(`Dependencies: ${Object.keys(pkg.dependencies).join(", ")}`);
126
128
  parts.push(`Use npm/bun/pnpm commands, NOT maven/gradle/cargo.`);
127
129
  } catch {}
128
130
  }