@hasna/instructions 0.3.0 → 0.4.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.
- package/README.md +43 -12
- package/dashboard/README.md +73 -0
- package/dist/cli/index.js +1321 -1101
- package/dist/data/config-store.d.ts +134 -0
- package/dist/data/config-store.d.ts.map +1 -0
- package/dist/data/config-store.test.d.ts +2 -0
- package/dist/data/config-store.test.d.ts.map +1 -0
- package/dist/db/database.d.ts +15 -0
- package/dist/db/database.d.ts.map +1 -1
- package/dist/generated/storage-kit/index.d.ts +1 -1
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +896 -492
- package/dist/lib/apply.d.ts +2 -2
- package/dist/lib/apply.d.ts.map +1 -1
- package/dist/lib/export.d.ts +2 -2
- package/dist/lib/export.d.ts.map +1 -1
- package/dist/lib/import.d.ts +2 -2
- package/dist/lib/import.d.ts.map +1 -1
- package/dist/lib/package-manager-guard.d.ts +24 -0
- package/dist/lib/package-manager-guard.d.ts.map +1 -0
- package/dist/lib/package-manager-guard.test.d.ts +2 -0
- package/dist/lib/package-manager-guard.test.d.ts.map +1 -0
- package/dist/lib/platform-profiles.d.ts +2 -2
- package/dist/lib/platform-profiles.d.ts.map +1 -1
- package/dist/lib/project-dashboard-standard.d.ts +2 -2
- package/dist/lib/project-dashboard-standard.d.ts.map +1 -1
- package/dist/lib/redact.d.ts.map +1 -1
- package/dist/lib/sync-dir.d.ts +3 -3
- package/dist/lib/sync-dir.d.ts.map +1 -1
- package/dist/lib/sync.d.ts +6 -6
- package/dist/lib/sync.d.ts.map +1 -1
- package/dist/mcp/http.d.ts +0 -13
- package/dist/mcp/http.d.ts.map +1 -1
- package/dist/mcp/index.js +650 -575
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1756 -17542
- package/dist/server/v1.d.ts.map +1 -1
- package/dist/status.d.ts +2 -2
- package/dist/status.d.ts.map +1 -1
- package/dist/storage/cloud-store.d.ts +21 -1
- package/dist/storage/cloud-store.d.ts.map +1 -1
- package/dist/storage/schema.d.ts.map +1 -1
- package/package.json +5 -8
- package/dist/cli/storage.d.ts +0 -3
- package/dist/cli/storage.d.ts.map +0 -1
- package/dist/cli/storage.test.d.ts +0 -2
- package/dist/cli/storage.test.d.ts.map +0 -1
- package/dist/db/remote-storage.d.ts +0 -13
- package/dist/db/remote-storage.d.ts.map +0 -1
- package/dist/db/storage-sync.d.ts +0 -53
- package/dist/db/storage-sync.d.ts.map +0 -1
- package/dist/db/storage-sync.test.d.ts +0 -2
- package/dist/db/storage-sync.test.d.ts.map +0 -1
- package/dist/server/server.test.d.ts +0 -2
- package/dist/server/server.test.d.ts.map +0 -1
- package/dist/storage.d.ts +0 -5
- package/dist/storage.d.ts.map +0 -1
- package/dist/storage.js +0 -537
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ instructions show <slug> # full metadata + content
|
|
|
27
27
|
instructions inspect <slug> # alias for show
|
|
28
28
|
instructions profile resolve
|
|
29
29
|
instructions profile apply --auto
|
|
30
|
+
instructions package-manager-scan --fail-on-findings .
|
|
31
|
+
instructions package-manager-scan --home --fail-on-findings .
|
|
30
32
|
```
|
|
31
33
|
|
|
32
34
|
Collection commands are compact by default to keep agent terminals and context
|
|
@@ -37,6 +39,36 @@ small. Human output is capped at 20 rows unless you pass `--limit`; use
|
|
|
37
39
|
- `--json` preserves full machine-readable records for automation.
|
|
38
40
|
- `show`/`inspect` and `snapshot show` print full config or snapshot content.
|
|
39
41
|
|
|
42
|
+
## Package-Manager Secret Guard
|
|
43
|
+
|
|
44
|
+
`instructions package-manager-scan` blocks package-manager credential ingress without
|
|
45
|
+
printing credential values. It scans repo `.npmrc` files, home `.npmrc`, Bun
|
|
46
|
+
config, lockfiles, and shell profiles, then reports only path, line, rule,
|
|
47
|
+
surface, and tracked status.
|
|
48
|
+
|
|
49
|
+
Use it in CI or pre-commit hooks:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
instructions package-manager-scan --fail-on-findings .
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Use `--home` for local operator scans:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
instructions package-manager-scan --home --fail-on-findings .
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Safe `.npmrc` auth uses npm's environment reference, not a rendered literal:
|
|
62
|
+
|
|
63
|
+
```ini
|
|
64
|
+
@hasna:registry=https://registry.npmjs.org/
|
|
65
|
+
# Add the npm auth-token entry with an environment reference, not a literal value.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Bun release-age quarantine must stay enabled. Keep
|
|
69
|
+
`minimumReleaseAgeExcludes` narrowed to exact `@hasna/<package>` names only;
|
|
70
|
+
wildcards and third-party package names fail the guard.
|
|
71
|
+
|
|
40
72
|
## MCP Server
|
|
41
73
|
|
|
42
74
|
```bash
|
|
@@ -102,21 +134,20 @@ and `API_KEY_SIGNING_SECRET` are also accepted). Client apps use
|
|
|
102
134
|
`InstructionsV1Client` is generated from the serve OpenAPI document
|
|
103
135
|
(`bun run generate:sdk`).
|
|
104
136
|
|
|
105
|
-
## Storage
|
|
137
|
+
## Storage Modes
|
|
106
138
|
|
|
107
|
-
|
|
108
|
-
|
|
139
|
+
Every CLI command, MCP tool, and SDK method routes through a single `ConfigStore`
|
|
140
|
+
abstraction with two transports:
|
|
109
141
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
```
|
|
142
|
+
- **local** — on-box SQLite (`LocalConfigStore`), fully first-class. Used when no
|
|
143
|
+
API env vars are set.
|
|
144
|
+
- **api** (self_hosted / cloud) — HTTP `/v1` + bearer key (`CloudConfigStore`).
|
|
145
|
+
Activated by setting **both** `HASNA_INSTRUCTIONS_API_URL` and
|
|
146
|
+
`HASNA_INSTRUCTIONS_API_KEY`. Identical client code; only the URL/key differ,
|
|
147
|
+
and the self_hosted/cloud distinction is enforced server-side by tenancy.
|
|
117
148
|
|
|
118
|
-
|
|
119
|
-
`
|
|
149
|
+
Clients never hold a database DSN. The raw Postgres connection is a server-only
|
|
150
|
+
concern (`instructions-serve`).
|
|
120
151
|
|
|
121
152
|
## Data Directory
|
|
122
153
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(['dist']),
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.{ts,tsx}'],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from 'eslint-plugin-react-x'
|
|
51
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(['dist']),
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.{ts,tsx}'],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs['recommended-typescript'],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
])
|
|
73
|
+
```
|