@hasna/recordings 0.1.37 → 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.
@@ -0,0 +1,40 @@
1
+ import type { Recording, CreateRecordingInput, RecordingFilter, Agent, Project } from "./types/index.js";
2
+ import { type FeedbackInput } from "./db/feedback.js";
3
+ export declare const APP = "recordings";
4
+ export type { FeedbackInput } from "./db/feedback.js";
5
+ export interface RecordingStats {
6
+ total: number;
7
+ raw: number;
8
+ enhanced: number;
9
+ total_duration_ms: number;
10
+ by_model: Record<string, number>;
11
+ }
12
+ export interface Store {
13
+ readonly mode: "local" | "cloud-http";
14
+ readonly baseUrl: string | null;
15
+ createRecording(input: CreateRecordingInput): Promise<Recording>;
16
+ getRecording(id: string): Promise<Recording | null>;
17
+ listRecordings(filter?: RecordingFilter): Promise<Recording[]>;
18
+ searchRecordings(query: string, filter?: RecordingFilter): Promise<Recording[]>;
19
+ deleteRecording(id: string): Promise<boolean>;
20
+ getRecordingStats(): Promise<RecordingStats>;
21
+ registerAgent(name: string, description?: string, role?: string): Promise<Agent>;
22
+ getAgent(idOrName: string): Promise<Agent | null>;
23
+ listAgents(): Promise<Agent[]>;
24
+ heartbeatAgent(idOrName: string): Promise<Agent | null>;
25
+ setAgentFocus(idOrName: string, projectId: string | null): Promise<Agent | null>;
26
+ registerProject(name: string, path: string, description?: string): Promise<Project>;
27
+ getProject(idOrPath: string): Promise<Project | null>;
28
+ listProjects(): Promise<Project[]>;
29
+ saveFeedback(input: FeedbackInput): Promise<void>;
30
+ }
31
+ /**
32
+ * Resolve the active Store from the environment. Cached per-process after first
33
+ * resolution against `process.env`; pass an explicit `env` (e.g. in tests) to
34
+ * bypass the cache. Throws if the cloud transport is requested but misconfigured
35
+ * (URL/key mismatch) so callers never silently read the wrong dataset.
36
+ */
37
+ export declare function getStore(env?: NodeJS.ProcessEnv | Record<string, string | undefined>): Store;
38
+ /** Test helper: clear the cached Store. */
39
+ export declare function __reset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MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACjF,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAClD,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IAC/B,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACxD,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAGjF,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpF,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACtD,YAAY,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAGnC,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AAuKD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,GAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,KAAK,CAMzG;AAED,2CAA2C;AAC3C,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.37";
1
+ export declare const VERSION = "0.2.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/recordings",
3
- "version": "0.1.37",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "Speech-to-text recording tool with MCP and CLI — records, transcribes, and optionally enhances text using AI",
6
6
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "LICENSE"
61
61
  ],
62
62
  "dependencies": {
63
- "@hasna/contracts": "0.4.1",
63
+ "@hasna/contracts": "^0.4.2",
64
64
  "@hasna/events": "^0.1.11",
65
65
  "@modelcontextprotocol/sdk": "^1.12.1",
66
66
  "chalk": "^5.4.1",
@@ -1,3 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function registerStorageCommands(program: Command): void;
3
- //# sourceMappingURL=storage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/cli/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8BzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkI9D"}
@@ -1,8 +0,0 @@
1
- export interface PgMigrationResult {
2
- applied: number[];
3
- alreadyApplied: number[];
4
- errors: string[];
5
- totalMigrations: number;
6
- }
7
- export declare function applyPgMigrations(connectionString: string): Promise<PgMigrationResult>;
8
- //# sourceMappingURL=pg-migrate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pg-migrate.d.ts","sourceRoot":"","sources":["../../src/db/pg-migrate.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,iBAAiB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAyC5F"}
@@ -1,28 +0,0 @@
1
- export type StorageMode = "local" | "hybrid" | "remote";
2
- export interface StorageConfig {
3
- mode: StorageMode;
4
- postgres: {
5
- host: string;
6
- port: number;
7
- username: string;
8
- password_env: string;
9
- ssl: boolean;
10
- };
11
- }
12
- export interface StorageEnv {
13
- name: string;
14
- }
15
- export declare const RECORDINGS_STORAGE_ENV = "HASNA_RECORDINGS_DATABASE_URL";
16
- export declare const RECORDINGS_STORAGE_FALLBACK_ENV = "RECORDINGS_DATABASE_URL";
17
- export declare const RECORDINGS_STORAGE_MODE_ENV = "HASNA_RECORDINGS_STORAGE_MODE";
18
- export declare const RECORDINGS_STORAGE_MODE_FALLBACK_ENV = "RECORDINGS_STORAGE_MODE";
19
- export declare const RECORDINGS_STORAGE_CONFIG_ENV = "HASNA_RECORDINGS_STORAGE_CONFIG";
20
- export declare const STORAGE_DATABASE_ENV: readonly ["HASNA_RECORDINGS_DATABASE_URL", "RECORDINGS_DATABASE_URL"];
21
- export declare const STORAGE_MODE_ENV: readonly ["HASNA_RECORDINGS_STORAGE_MODE", "RECORDINGS_STORAGE_MODE"];
22
- export declare function getStorageDatabaseEnvName(): (typeof STORAGE_DATABASE_ENV)[number] | null;
23
- export declare function getStorageDatabaseEnv(): StorageEnv | null;
24
- export declare function getStorageDatabaseUrl(): string | undefined;
25
- export declare function getStorageConfig(): StorageConfig;
26
- export declare function getStorageConnectionString(dbName?: string): string;
27
- export declare const getConnectionString: typeof getStorageConnectionString;
28
- //# sourceMappingURL=storage-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage-config.d.ts","sourceRoot":"","sources":["../../src/db/storage-config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,GAAG,EAAE,OAAO,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAGD,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AACtE,eAAO,MAAM,+BAA+B,4BAA4B,CAAC;AACzE,eAAO,MAAM,2BAA2B,kCAAkC,CAAC;AAC3E,eAAO,MAAM,oCAAoC,4BAA4B,CAAC;AAC9E,eAAO,MAAM,6BAA6B,oCAAoC,CAAC;AAC/E,eAAO,MAAM,oBAAoB,uEAAqE,CAAC;AACvG,eAAO,MAAM,gBAAgB,uEAA+E,CAAC;AAa7G,wBAAgB,yBAAyB,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAKxF;AAED,wBAAgB,qBAAqB,IAAI,UAAU,GAAG,IAAI,CAGzD;AAED,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,SAAS,CAG1D;AAQD,wBAAgB,gBAAgB,IAAI,aAAa,CAoChD;AAED,wBAAgB,0BAA0B,CAAC,MAAM,SAAe,GAAG,MAAM,CAiBxE;AAED,eAAO,MAAM,mBAAmB,mCAA6B,CAAC"}
@@ -1,36 +0,0 @@
1
- import { type Database } from "bun:sqlite";
2
- import { STORAGE_DATABASE_ENV, type StorageMode } from "./storage-config.js";
3
- import { PgAdapterAsync } from "./remote-storage.js";
4
- export interface SyncResult {
5
- table: string;
6
- direction: "push" | "pull";
7
- rows_read: number;
8
- rows_written: number;
9
- errors: string[];
10
- }
11
- export interface StorageStatus {
12
- configured: boolean;
13
- mode: StorageMode;
14
- enabled: boolean;
15
- env: typeof STORAGE_DATABASE_ENV;
16
- activeEnv: string | null;
17
- service: "recordings";
18
- db_path: string;
19
- tables: Array<{
20
- table: string;
21
- rows: number;
22
- }>;
23
- }
24
- export declare const STORAGE_TABLES: readonly ["projects", "agents", "recordings", "recording_tags", "feedback"];
25
- export declare const RECORDINGS_STORAGE_TABLES: readonly ["projects", "agents", "recordings", "recording_tags", "feedback"];
26
- export declare function getStoragePg(): Promise<PgAdapterAsync>;
27
- export declare function runStorageMigrations(remote: PgAdapterAsync): Promise<void>;
28
- export declare function getStorageStatus(db?: Database): StorageStatus;
29
- export declare function pushStorageChanges(tables?: string[]): Promise<SyncResult[]>;
30
- export declare function pullStorageChanges(tables?: string[]): Promise<SyncResult[]>;
31
- export declare function syncStorageChanges(tables?: string[]): Promise<{
32
- push: SyncResult[];
33
- pull: SyncResult[];
34
- }>;
35
- export declare function parseStorageTables(raw?: string): string[];
36
- //# sourceMappingURL=storage-sync.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage-sync.d.ts","sourceRoot":"","sources":["../../src/db/storage-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,oBAAoB,EAIpB,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,oBAAoB,CAAC;IACjC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,cAAc,6EAMjB,CAAC;AAEX,eAAO,MAAM,yBAAyB,6EAAiB,CAAC;AA6ExD,wBAAsB,YAAY,IAAI,OAAO,CAAC,cAAc,CAAC,CAE5D;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhF;AAED,wBAAgB,gBAAgB,CAAC,EAAE,GAAE,QAAwB,GAAG,aAAa,CAqB5E;AAED,wBAAsB,kBAAkB,CAAC,MAAM,GAAE,MAAM,EAAwB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAuBtG;AAED,wBAAsB,kBAAkB,CAAC,MAAM,GAAE,MAAM,EAAwB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAuBtG;AAED,wBAAsB,kBAAkB,CAAC,MAAM,GAAE,MAAM,EAAwB,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC,CAKpI;AAED,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAQzD"}
@@ -1,3 +0,0 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare function registerRecordingsStorageTools(server: McpServer): void;
3
- //# sourceMappingURL=storage-tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage-tools.d.ts","sourceRoot":"","sources":["../../src/mcp/storage-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAsBzE,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmFtE"}