@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.
- package/README.CN.md +74 -8
- package/README.md +74 -8
- package/THIRD_PARTY_NOTICES.md +6 -4
- package/dist/ai/command-schema.js +7 -1
- package/dist/ai/errors.js +7 -23
- package/dist/ai/gemini.js +67 -27
- package/dist/ai/openai.js +35 -27
- package/dist/cli.js +12 -1
- package/dist/config-file.js +97 -51
- package/dist/config.js +8 -7
- package/dist/errors.js +19 -17
- package/dist/execute.js +12 -34
- package/dist/index.js +100 -98
- package/dist/init/InitializationApp.js +177 -32
- package/dist/init/index.js +35 -33
- package/dist/init/state.js +46 -23
- package/dist/prompt.js +24 -6
- package/dist/safety/command-risk.js +11 -0
- package/dist/safety/dangerous-command.js +470 -92
- package/dist/shell/command-analysis.js +373 -0
- package/dist/shell/execution-environment.js +25 -0
- package/dist/shell/runtime-environment.js +61 -0
- package/dist/terminal-text.js +33 -0
- package/dist/ui/App.js +67 -28
- package/dist/ui/ConfirmView.js +163 -67
- package/dist/ui/InteractiveSessionProvider.js +19 -0
- package/dist/ui/ResolvePlaceholdersView.js +107 -27
- package/dist/ui/SelectCommandView.js +73 -23
- package/dist/ui/SelectedCommandDisplay.js +11 -9
- package/dist/ui/interactive-session.js +476 -0
- package/dist/ui/paste-framing.js +105 -0
- package/dist/ui/placeholder-logic.js +28 -16
- package/dist/ui/resize-safe-output.js +73 -0
- package/dist/ui/run-interactive-command.js +55 -0
- package/dist/ui/single-line-preview.js +28 -0
- package/dist/ui/text-input.js +53 -0
- package/dist/ui/use-keyboard-input.js +22 -0
- package/dist/ui/use-paste-aware-input.js +11 -0
- package/dist/user-visible-error.js +19 -0
- package/dist/validation/ai-response.js +34 -6
- package/dist/validation/command-tool.js +31 -132
- package/dist/validation/generated-commands.js +5 -16
- package/dist/version.js +38 -0
- package/package.json +31 -16
package/package.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unscientificjszhai/howto",
|
|
3
|
-
"version": "1.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
|
|
32
|
-
"test:
|
|
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.
|
|
36
|
-
"ink": "^7.
|
|
37
|
-
"openai": "^
|
|
38
|
-
"react": "^19.2.
|
|
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": "^
|
|
43
|
-
"@types/react": "^19.2.
|
|
44
|
-
"@types/react-dom": "^19.2.
|
|
45
|
-
"
|
|
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": "^
|
|
48
|
-
"prettier": "^3.
|
|
49
|
-
"typescript": "^
|
|
50
|
-
"typescript-eslint": "^8.
|
|
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}": [
|