@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.
- package/README.md +43 -0
- package/dist/cli/index.js +707 -5708
- package/dist/db/feedback.d.ts +13 -0
- package/dist/db/feedback.d.ts.map +1 -0
- package/dist/http/client.d.ts +77 -0
- package/dist/http/client.d.ts.map +1 -0
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +633 -5356
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +528 -5470
- package/dist/sdk/index.d.ts +16 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +140 -0
- package/dist/sdk/v1.generated.d.ts +150 -0
- package/dist/sdk/v1.generated.d.ts.map +1 -0
- package/dist/server/cloud.d.ts +49 -0
- package/dist/server/cloud.d.ts.map +1 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +6931 -0
- package/dist/server/openapi.d.ts +614 -0
- package/dist/server/openapi.d.ts.map +1 -0
- package/dist/server/repo.d.ts +44 -0
- package/dist/server/repo.d.ts.map +1 -0
- package/dist/server/serve.d.ts +11 -0
- package/dist/server/serve.d.ts.map +1 -0
- package/dist/server/v1.d.ts +6 -0
- package/dist/server/v1.d.ts.map +1 -0
- package/dist/storage.d.ts +4 -6
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +706 -5286
- package/dist/store.d.ts +40 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +13 -4
- package/scripts/generate-sdk.ts +31 -0
- package/scripts/migrate.ts +37 -0
- package/dist/cli/storage.d.ts +0 -3
- package/dist/cli/storage.d.ts.map +0 -1
- package/dist/db/pg-migrate.d.ts +0 -8
- package/dist/db/pg-migrate.d.ts.map +0 -1
- package/dist/db/storage-config.d.ts +0 -28
- package/dist/db/storage-config.d.ts.map +0 -1
- package/dist/db/storage-sync.d.ts +0 -36
- package/dist/db/storage-sync.d.ts.map +0 -1
- package/dist/mcp/storage-tools.d.ts +0 -3
- package/dist/mcp/storage-tools.d.ts.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface FeedbackInput {
|
|
2
|
+
message: string;
|
|
3
|
+
email?: string | null;
|
|
4
|
+
category?: string | null;
|
|
5
|
+
version?: string | null;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Persist a feedback row into the local SQLite store. This is the LocalStore
|
|
9
|
+
* implementation of the Store's `saveFeedback` — the only place feedback SQL
|
|
10
|
+
* lives, so no CLI command or MCP tool touches the database directly.
|
|
11
|
+
*/
|
|
12
|
+
export declare function saveFeedback(input: FeedbackInput): void;
|
|
13
|
+
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/db/feedback.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAUvD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type Env = Record<string, string | undefined>;
|
|
2
|
+
export type StorageMode = "local" | "cloud";
|
|
3
|
+
export declare function defaultCloudBaseUrl(name: string): string;
|
|
4
|
+
export declare function toV1BaseUrl(apiUrl: string): string;
|
|
5
|
+
export type TransportKind = "local" | "cloud-http";
|
|
6
|
+
export interface TransportResolution {
|
|
7
|
+
transport: TransportKind;
|
|
8
|
+
mode: StorageMode;
|
|
9
|
+
deprecatedAlias: string | null;
|
|
10
|
+
modeSource: string;
|
|
11
|
+
baseUrl: string | null;
|
|
12
|
+
apiKeyPresent: boolean;
|
|
13
|
+
misconfigured: boolean;
|
|
14
|
+
warning: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveTransport(name: string, env?: Env): TransportResolution;
|
|
17
|
+
export declare class HasnaHttpError extends Error {
|
|
18
|
+
readonly status: number;
|
|
19
|
+
readonly method: string;
|
|
20
|
+
readonly path: string;
|
|
21
|
+
readonly body: unknown;
|
|
22
|
+
constructor(method: string, path: string, status: number, body: unknown);
|
|
23
|
+
}
|
|
24
|
+
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
25
|
+
export type QueryParams = Record<string, string | number | boolean | null | undefined | ReadonlyArray<string | number | boolean>>;
|
|
26
|
+
export interface RequestOptions {
|
|
27
|
+
query?: QueryParams;
|
|
28
|
+
idempotencyKey?: string;
|
|
29
|
+
timeoutMs?: number;
|
|
30
|
+
headers?: Record<string, string>;
|
|
31
|
+
signal?: AbortSignal;
|
|
32
|
+
retries?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface HttpTransport {
|
|
35
|
+
readonly baseUrl: string;
|
|
36
|
+
request<T = unknown>(method: string, path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
37
|
+
get<T = unknown>(path: string, opts?: RequestOptions): Promise<T>;
|
|
38
|
+
post<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
39
|
+
patch<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
40
|
+
put<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
41
|
+
del<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
42
|
+
}
|
|
43
|
+
export interface TransportOptions {
|
|
44
|
+
name: string;
|
|
45
|
+
baseUrl: string;
|
|
46
|
+
apiKey: string;
|
|
47
|
+
fetchImpl?: FetchLike;
|
|
48
|
+
timeoutMs?: number;
|
|
49
|
+
sleepImpl?: (ms: number) => Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
export declare function createHttpTransport(options: TransportOptions): HttpTransport;
|
|
52
|
+
export interface StorageClient {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly baseUrl: string;
|
|
55
|
+
readonly transport: HttpTransport;
|
|
56
|
+
list<T = unknown>(resource: string, query?: QueryParams): Promise<{
|
|
57
|
+
items: T[];
|
|
58
|
+
raw: unknown;
|
|
59
|
+
}>;
|
|
60
|
+
get<T = unknown>(resource: string, id: string): Promise<T | null>;
|
|
61
|
+
create<T = unknown>(resource: string, body: unknown, idempotencyKey?: string): Promise<T>;
|
|
62
|
+
update<T = unknown>(resource: string, id: string, patch: unknown, method?: "PATCH" | "PUT"): Promise<T>;
|
|
63
|
+
delete(resource: string, id: string): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
export declare function createStorageClient(name: string, transport: HttpTransport): StorageClient;
|
|
66
|
+
export type ResolveResult = {
|
|
67
|
+
transport: "local";
|
|
68
|
+
client: null;
|
|
69
|
+
resolution: TransportResolution;
|
|
70
|
+
} | {
|
|
71
|
+
transport: "cloud-http";
|
|
72
|
+
client: StorageClient;
|
|
73
|
+
resolution: TransportResolution;
|
|
74
|
+
};
|
|
75
|
+
export declare function resolveStorageClient(name: string, env?: Env, fetchImpl?: FetchLike): ResolveResult;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/http/client.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AACrD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;AAkB5C,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAyBD,wBAAgB,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AAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,aAAa,CAmCzF;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,GACrE;IAAE,SAAS,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAMxF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,GAAiB,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAa/G"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
export type { Recording, CreateRecordingInput, RecordingFilter, ProcessingMode, Agent, Project, RecordingsConfig, TranscriptionResult, EnhancementResult, } from "./types/index.js";
|
|
2
2
|
export { RecordingNotFoundError, RecordingError, TranscriptionError, EnhancementError, } from "./types/index.js";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export { applyPgMigrations, type PgMigrationResult } from "./db/pg-migrate.js";
|
|
8
|
-
export { createRecording, getRecording, listRecordings, deleteRecording, searchRecordings, getRecordingStats, } from "./db/recordings.js";
|
|
9
|
-
export { registerAgent, getAgent, listAgents } from "./db/agents.js";
|
|
10
|
-
export { registerProject, getProject, listProjects, } from "./db/projects.js";
|
|
3
|
+
export { getStore, __resetStore, APP } from "./store.js";
|
|
4
|
+
export type { Store, RecordingStats, FeedbackInput } from "./store.js";
|
|
5
|
+
export { resolveStorageClient, resolveTransport, createHttpTransport, createStorageClient, HasnaHttpError, } from "./http/client.js";
|
|
6
|
+
export type { StorageClient, StorageMode, TransportResolution, HttpTransport, } from "./http/client.js";
|
|
11
7
|
export { loadConfig, getDataDir, ensureDataDir, DEFAULT_CONFIG, } from "./lib/config.js";
|
|
12
8
|
export { transcribeAudio, transcribeBuffer, resetClient, } from "./lib/transcriber.js";
|
|
13
9
|
export { needsEnhancement, enhanceText, processText, resetEnhancementClient, } from "./lib/enhancer.js";
|
|
14
10
|
export { startRecording, stopRecording, isRecording, getCurrentFile, checkRecordingDeps, recordDuration, } from "./lib/recorder.js";
|
|
11
|
+
export { RecordingsV1Client, RecordingsV1ApiError, } from "./sdk/index.js";
|
|
12
|
+
export type { RecordingsV1ClientOptions, RecordingsV1Recording, RecordingsV1Agent, RecordingsV1Project, RecordingsV1CreateRecordingInput, RecordingsV1RegisterAgentInput, RecordingsV1RegisterProjectInput, } from "./sdk/index.js";
|
|
15
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,GACf,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,gCAAgC,EAChC,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,gBAAgB,CAAC"}
|