@unscientificjszhai/howto 1.0.0 → 1.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 (44) hide show
  1. package/README.CN.md +74 -8
  2. package/README.md +74 -8
  3. package/THIRD_PARTY_NOTICES.md +6 -4
  4. package/dist/ai/command-schema.js +7 -1
  5. package/dist/ai/errors.js +7 -23
  6. package/dist/ai/gemini.js +67 -27
  7. package/dist/ai/openai.js +35 -27
  8. package/dist/cli.js +12 -1
  9. package/dist/config-file.js +97 -51
  10. package/dist/config.js +8 -7
  11. package/dist/errors.js +19 -17
  12. package/dist/execute.js +12 -34
  13. package/dist/index.js +100 -98
  14. package/dist/init/InitializationApp.js +177 -32
  15. package/dist/init/index.js +35 -33
  16. package/dist/init/state.js +46 -23
  17. package/dist/prompt.js +24 -6
  18. package/dist/safety/command-risk.js +11 -0
  19. package/dist/safety/dangerous-command.js +470 -92
  20. package/dist/shell/command-analysis.js +373 -0
  21. package/dist/shell/execution-environment.js +25 -0
  22. package/dist/shell/runtime-environment.js +61 -0
  23. package/dist/terminal-text.js +33 -0
  24. package/dist/ui/App.js +67 -28
  25. package/dist/ui/ConfirmView.js +163 -67
  26. package/dist/ui/InteractiveSessionProvider.js +19 -0
  27. package/dist/ui/ResolvePlaceholdersView.js +107 -27
  28. package/dist/ui/SelectCommandView.js +73 -23
  29. package/dist/ui/SelectedCommandDisplay.js +11 -9
  30. package/dist/ui/interactive-session.js +476 -0
  31. package/dist/ui/paste-framing.js +105 -0
  32. package/dist/ui/placeholder-logic.js +28 -16
  33. package/dist/ui/resize-safe-output.js +73 -0
  34. package/dist/ui/run-interactive-command.js +55 -0
  35. package/dist/ui/single-line-preview.js +28 -0
  36. package/dist/ui/text-input.js +53 -0
  37. package/dist/ui/use-keyboard-input.js +22 -0
  38. package/dist/ui/use-paste-aware-input.js +11 -0
  39. package/dist/user-visible-error.js +19 -0
  40. package/dist/validation/ai-response.js +34 -6
  41. package/dist/validation/command-tool.js +31 -132
  42. package/dist/validation/generated-commands.js +5 -16
  43. package/dist/version.js +38 -0
  44. package/package.json +31 -16
package/package.json CHANGED
@@ -1,7 +1,14 @@
1
1
  {
2
2
  "name": "@unscientificjszhai/howto",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
+ "os": [
6
+ "darwin",
7
+ "linux"
8
+ ],
9
+ "engines": {
10
+ "node": ">=22"
11
+ },
5
12
  "description": "Use AI to quickly find commands within the terminal.",
6
13
  "license": "MIT",
7
14
  "main": "dist/index.js",
@@ -21,33 +28,41 @@
21
28
  "THIRD_PARTY_NOTICES.md"
22
29
  ],
23
30
  "scripts": {
24
- "build": "tsc",
31
+ "build": "npm run clean:dist && tsc",
32
+ "build:test": "npm run clean:dist-test && tsc -p tsconfig.test.json",
33
+ "clean:dist": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
34
+ "clean:dist-test": "node -e \"require('node:fs').rmSync('dist-test', { recursive: true, force: true })\"",
25
35
  "format": "prettier . --write",
26
36
  "format:check": "prettier . --check",
27
37
  "lint": "eslint .",
28
38
  "lint:fix": "eslint . --fix",
29
39
  "lint:staged": "lint-staged",
30
40
  "prepare": "husky",
31
- "test": "npm run test:unit",
32
- "test:unit": "tsc -p tsconfig.test.json && node --test dist-test/tests/unit/*.test.js dist-test/tests/unit/**/*.test.js"
41
+ "test": "npm run build:test && node --test dist-test/tests/unit/*.test.js dist-test/tests/unit/**/*.test.js dist-test/tests/integration/*.test.js dist-test/tests/integration/**/*.test.js",
42
+ "test:integration": "npm run build:test && node --test dist-test/tests/integration/*.test.js dist-test/tests/integration/**/*.test.js",
43
+ "test:package": "npm run build:test && node dist-test/tests/package-smoke.js",
44
+ "test:unit": "npm run build:test && node --test dist-test/tests/unit/*.test.js dist-test/tests/unit/**/*.test.js"
33
45
  },
34
46
  "dependencies": {
35
- "@google/genai": "^2.6.0",
36
- "ink": "^7.0.4",
37
- "openai": "^6.39.0",
38
- "react": "^19.2.6"
47
+ "@google/genai": "^2.18.0",
48
+ "ink": "^7.1.1",
49
+ "openai": "^7.5.0",
50
+ "react": "^19.2.8",
51
+ "signal-exit": "^3.0.7",
52
+ "string-width": "^8.2.2"
39
53
  },
40
54
  "devDependencies": {
41
55
  "@eslint/js": "^10.0.1",
42
- "@types/node": "^20.0.0",
43
- "@types/react": "^19.2.14",
44
- "@types/react-dom": "^19.2.3",
45
- "eslint": "^10.4.0",
56
+ "@types/node": "^26.2.0",
57
+ "@types/react": "^19.2.18",
58
+ "@types/react-dom": "^19.2.4",
59
+ "@types/signal-exit": "^3.0.4",
60
+ "eslint": "^10.9.0",
46
61
  "husky": "^9.1.7",
47
- "lint-staged": "^16.4.0",
48
- "prettier": "^3.8.3",
49
- "typescript": "^5.5.3",
50
- "typescript-eslint": "^8.59.4"
62
+ "lint-staged": "^17.3.0",
63
+ "prettier": "^3.9.6",
64
+ "typescript": "^6.0.3",
65
+ "typescript-eslint": "^8.67.0"
51
66
  },
52
67
  "lint-staged": {
53
68
  "*.{ts,tsx}": [