@hasna/recordings 0.1.36 → 0.2.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.
Files changed (49) hide show
  1. package/README.md +43 -0
  2. package/dist/cli/index.js +707 -5708
  3. package/dist/db/feedback.d.ts +13 -0
  4. package/dist/db/feedback.d.ts.map +1 -0
  5. package/dist/http/client.d.ts +77 -0
  6. package/dist/http/client.d.ts.map +1 -0
  7. package/dist/index.d.ts +6 -8
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +633 -5356
  10. package/dist/mcp/index.d.ts.map +1 -1
  11. package/dist/mcp/index.js +528 -5470
  12. package/dist/sdk/index.d.ts +16 -0
  13. package/dist/sdk/index.d.ts.map +1 -0
  14. package/dist/sdk/index.js +140 -0
  15. package/dist/sdk/v1.generated.d.ts +150 -0
  16. package/dist/sdk/v1.generated.d.ts.map +1 -0
  17. package/dist/server/cloud.d.ts +49 -0
  18. package/dist/server/cloud.d.ts.map +1 -0
  19. package/dist/server/index.d.ts +3 -0
  20. package/dist/server/index.d.ts.map +1 -0
  21. package/dist/server/index.js +6931 -0
  22. package/dist/server/openapi.d.ts +614 -0
  23. package/dist/server/openapi.d.ts.map +1 -0
  24. package/dist/server/repo.d.ts +44 -0
  25. package/dist/server/repo.d.ts.map +1 -0
  26. package/dist/server/serve.d.ts +11 -0
  27. package/dist/server/serve.d.ts.map +1 -0
  28. package/dist/server/v1.d.ts +6 -0
  29. package/dist/server/v1.d.ts.map +1 -0
  30. package/dist/storage.d.ts +4 -6
  31. package/dist/storage.d.ts.map +1 -1
  32. package/dist/storage.js +706 -5286
  33. package/dist/store.d.ts +40 -0
  34. package/dist/store.d.ts.map +1 -0
  35. package/dist/version.d.ts +1 -1
  36. package/dist/version.d.ts.map +1 -1
  37. package/package.json +13 -4
  38. package/scripts/generate-sdk.ts +31 -0
  39. package/scripts/migrate.ts +37 -0
  40. package/dist/cli/storage.d.ts +0 -3
  41. package/dist/cli/storage.d.ts.map +0 -1
  42. package/dist/db/pg-migrate.d.ts +0 -8
  43. package/dist/db/pg-migrate.d.ts.map +0 -1
  44. package/dist/db/storage-config.d.ts +0 -28
  45. package/dist/db/storage-config.d.ts.map +0 -1
  46. package/dist/db/storage-sync.d.ts +0 -36
  47. package/dist/db/storage-sync.d.ts.map +0 -1
  48. package/dist/mcp/storage-tools.d.ts +0 -3
  49. package/dist/mcp/storage-tools.d.ts.map +0 -1
package/README.md CHANGED
@@ -42,6 +42,49 @@ MCP_HTTP=1 MCP_HTTP_PORT=8829 recordings-mcp
42
42
 
43
43
  Endpoints: `GET /health` → `{"status":"ok","name":"recordings"}`, MCP at `/mcp`.
44
44
 
45
+ ## HTTP API (`recordings-serve`)
46
+
47
+ `recordings-serve` is the self-hosted HTTP API. In cloud mode it is PURE REMOTE
48
+ (Amendment A1): the process reads/writes the shared cloud Postgres directly with
49
+ API-key auth via [`@hasna/contracts`](https://www.npmjs.com/package/@hasna/contracts).
50
+
51
+ ```bash
52
+ recordings-serve --port 8874 # start the API
53
+ recordings-serve migrate # apply the cloud schema, then exit
54
+ ```
55
+
56
+ Service surface (unauthenticated): `GET /health`, `GET /ready`, `GET /version`
57
+ (each returns `{status, version, mode}`), and `GET /openapi.json` (the OpenAPI
58
+ 3.1 document the SDK is generated from).
59
+
60
+ Versioned API (`/v1/*`, API-key auth via `x-api-key` or `Authorization: Bearer`):
61
+
62
+ | Method | Path | Scope |
63
+ | ------ | ---- | ----- |
64
+ | GET/POST | `/v1/recordings` | `recordings:read` / `recordings:write` |
65
+ | GET/DELETE | `/v1/recordings/:id` | `recordings:read` / `recordings:write` |
66
+ | GET | `/v1/stats` | `recordings:read` |
67
+ | GET/POST | `/v1/agents` · GET `/v1/agents/:id` | `recordings:read` / `recordings:write` |
68
+ | GET/POST | `/v1/projects` · GET `/v1/projects/:id` | `recordings:read` / `recordings:write` |
69
+
70
+ Env: `HASNA_RECORDINGS_DATABASE_URL` (remote Postgres DSN — enables cloud `/v1`)
71
+ and `HASNA_RECORDINGS_API_SIGNING_KEY` (HMAC signing secret for API-key auth).
72
+
73
+ ## SDK
74
+
75
+ The typed `/v1` client is generated from the serve OpenAPI document
76
+ (`bun run generate:sdk`):
77
+
78
+ ```ts
79
+ import { RecordingsV1Client } from "@hasna/recordings/sdk";
80
+
81
+ const client = new RecordingsV1Client({
82
+ baseUrl: process.env.RECORDINGS_API_URL!,
83
+ apiKey: process.env.RECORDINGS_API_KEY!,
84
+ });
85
+ const { recordings } = await client.listRecordings({ limit: 20 });
86
+ ```
87
+
45
88
  ## Storage Sync
46
89
 
47
90
  This package has native local/remote sync. Local data stays in SQLite under