@hasna/instructions 0.4.33 → 0.4.35
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 +6 -7
- package/dist/cli/index.js +682 -155
- package/dist/data/config-store.d.ts +4 -4
- package/dist/data/config-store.d.ts.map +1 -1
- package/dist/db/database.d.ts.map +1 -1
- package/dist/generated/storage-kit/backend.d.ts +20 -0
- package/dist/generated/storage-kit/backend.d.ts.map +1 -0
- package/dist/generated/storage-kit/index.d.ts +2 -2
- package/dist/generated/storage-kit/index.d.ts.map +1 -1
- package/dist/generated/storage-kit/migrations.d.ts.map +1 -1
- package/dist/generated/storage-kit/own.d.ts +11 -0
- package/dist/generated/storage-kit/own.d.ts.map +1 -0
- package/dist/generated/storage-kit/pool.d.ts +7 -6
- package/dist/generated/storage-kit/pool.d.ts.map +1 -1
- package/dist/generated/storage-kit/tls.d.ts +30 -3
- package/dist/generated/storage-kit/tls.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -14
- package/dist/lib/retired-storage-mode.d.ts +8 -0
- package/dist/lib/retired-storage-mode.d.ts.map +1 -0
- package/dist/mcp/index.js +43 -14
- package/dist/server/cloud.d.ts +2 -2
- package/dist/server/cloud.d.ts.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +456 -271
- package/package.json +2 -1
- package/dist/generated/storage-kit/mode.d.ts +0 -48
- package/dist/generated/storage-kit/mode.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -126,10 +126,10 @@ Surfaces:
|
|
|
126
126
|
- `/v1/*` — versioned cloud API (configs, profiles, snapshots, stats).
|
|
127
127
|
- `/api/*` — the local dashboard/REST surface.
|
|
128
128
|
|
|
129
|
-
###
|
|
129
|
+
### Server data backend (postgresql)
|
|
130
130
|
|
|
131
131
|
When `HASNA_INSTRUCTIONS_DATABASE_URL` is set the `/v1` API reads/writes the
|
|
132
|
-
shared
|
|
132
|
+
shared Postgres **directly** (no local sync/cache in the service) and every
|
|
133
133
|
`/v1` request is authenticated with a `@hasna/contracts` API key
|
|
134
134
|
(`x-api-key` or `Authorization: Bearer`). Reads need `instructions:read`, writes
|
|
135
135
|
need `instructions:write` (an `instructions:*` key satisfies both).
|
|
@@ -153,20 +153,19 @@ and `API_KEY_SIGNING_SECRET` are also accepted). Client apps use
|
|
|
153
153
|
`InstructionsV1Client` is generated from the serve OpenAPI document
|
|
154
154
|
(`bun run generate:sdk`).
|
|
155
155
|
|
|
156
|
-
##
|
|
156
|
+
## Client transports
|
|
157
157
|
|
|
158
158
|
Every CLI command, MCP tool, and SDK method routes through a single `ConfigStore`
|
|
159
159
|
abstraction with two transports:
|
|
160
160
|
|
|
161
161
|
- **local** — on-box SQLite (`LocalConfigStore`), fully first-class. Used when no
|
|
162
162
|
API env vars are set.
|
|
163
|
-
- **api**
|
|
163
|
+
- **api** — HTTP `/v1` + bearer key (`CloudConfigStore`).
|
|
164
164
|
Activated by setting **both** `HASNA_INSTRUCTIONS_API_URL` and
|
|
165
|
-
`HASNA_INSTRUCTIONS_API_KEY`.
|
|
166
|
-
and the self_hosted/cloud distinction is enforced server-side by tenancy.
|
|
165
|
+
`HASNA_INSTRUCTIONS_API_KEY`.
|
|
167
166
|
|
|
168
167
|
Clients never hold a database DSN. The raw Postgres connection is a server-only
|
|
169
|
-
concern (`instructions-serve`)
|
|
168
|
+
concern (`instructions-serve`), selected by `HASNA_INSTRUCTIONS_DATABASE_URL`.
|
|
170
169
|
|
|
171
170
|
## Data Directory
|
|
172
171
|
|