@hasna/recordings 0.1.3 → 0.1.4
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/dist/mcp/index.js +17 -2
- package/package.json +1 -1
- package/src/db/database.ts +8 -0
- package/src/db/recordings.ts +8 -2
- package/src/mcp/index.ts +6 -0
- package/src/types/index.ts +6 -0
package/dist/mcp/index.js
CHANGED
|
@@ -4190,6 +4190,12 @@ var MIGRATIONS = [
|
|
|
4190
4190
|
CREATE INDEX IF NOT EXISTS idx_recordings_created ON recordings(created_at);
|
|
4191
4191
|
CREATE INDEX IF NOT EXISTS idx_recordings_mode ON recordings(processing_mode);
|
|
4192
4192
|
CREATE INDEX IF NOT EXISTS idx_recording_tags_tag ON recording_tags(tag);
|
|
4193
|
+
`,
|
|
4194
|
+
`
|
|
4195
|
+
ALTER TABLE recordings ADD COLUMN goal TEXT;
|
|
4196
|
+
ALTER TABLE recordings ADD COLUMN role TEXT;
|
|
4197
|
+
ALTER TABLE recordings ADD COLUMN task_list_id TEXT;
|
|
4198
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (2);
|
|
4193
4199
|
`
|
|
4194
4200
|
];
|
|
4195
4201
|
function getDatabase(dbPath) {
|
|
@@ -4239,6 +4245,9 @@ function parseRow(row) {
|
|
|
4239
4245
|
agent_id: row["agent_id"] || null,
|
|
4240
4246
|
project_id: row["project_id"] || null,
|
|
4241
4247
|
session_id: row["session_id"] || null,
|
|
4248
|
+
goal: row["goal"] || null,
|
|
4249
|
+
role: row["role"] || null,
|
|
4250
|
+
task_list_id: row["task_list_id"] || null,
|
|
4242
4251
|
metadata: JSON.parse(row["metadata"] || "{}"),
|
|
4243
4252
|
created_at: row["created_at"]
|
|
4244
4253
|
};
|
|
@@ -4248,8 +4257,8 @@ function createRecording(input, db) {
|
|
|
4248
4257
|
const id = crypto.randomUUID();
|
|
4249
4258
|
const tagsJson = JSON.stringify(input.tags || []);
|
|
4250
4259
|
const metadataJson = JSON.stringify(input.metadata || {});
|
|
4251
|
-
d.query(`INSERT INTO recordings (id, audio_path, raw_text, processed_text, processing_mode, model_used, enhancement_model, duration_ms, language, tags, agent_id, project_id, session_id, metadata)
|
|
4252
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(id, input.audio_path || null, input.raw_text, input.processed_text || null, input.processing_mode || "raw", input.model_used || "gpt-4o-mini-transcribe", input.enhancement_model || null, input.duration_ms || 0, input.language || null, tagsJson, input.agent_id || null, input.project_id || null, input.session_id || null, metadataJson);
|
|
4260
|
+
d.query(`INSERT INTO recordings (id, audio_path, raw_text, processed_text, processing_mode, model_used, enhancement_model, duration_ms, language, tags, agent_id, project_id, session_id, goal, role, task_list_id, metadata)
|
|
4261
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(id, input.audio_path || null, input.raw_text, input.processed_text || null, input.processing_mode || "raw", input.model_used || "gpt-4o-mini-transcribe", input.enhancement_model || null, input.duration_ms || 0, input.language || null, tagsJson, input.agent_id || null, input.project_id || null, input.session_id || null, input.goal || null, input.role || null, input.task_list_id || null, metadataJson);
|
|
4253
4262
|
if (input.tags && input.tags.length > 0) {
|
|
4254
4263
|
const insertTag = d.query("INSERT OR IGNORE INTO recording_tags (recording_id, tag) VALUES (?, ?)");
|
|
4255
4264
|
for (const tag of input.tags) {
|
|
@@ -4700,6 +4709,9 @@ server.tool("save_recording", "Save text as recording. Auto-enhances if needed."
|
|
|
4700
4709
|
agent_id: exports_external.string().optional(),
|
|
4701
4710
|
project_id: exports_external.string().optional(),
|
|
4702
4711
|
session_id: exports_external.string().optional(),
|
|
4712
|
+
goal: exports_external.string().optional().describe("Goal or purpose of this recording session (e.g. 'code review for PR #123')"),
|
|
4713
|
+
role: exports_external.string().optional().describe("Agent role for this session (e.g. 'dev agent for connectdev')"),
|
|
4714
|
+
task_list_id: exports_external.string().optional().describe("Task list ID to bind this recording to"),
|
|
4703
4715
|
metadata: exports_external.record(exports_external.unknown()).optional()
|
|
4704
4716
|
}, async (args) => {
|
|
4705
4717
|
try {
|
|
@@ -4724,6 +4736,9 @@ server.tool("save_recording", "Save text as recording. Auto-enhances if needed."
|
|
|
4724
4736
|
agent_id: args.agent_id,
|
|
4725
4737
|
project_id: args.project_id,
|
|
4726
4738
|
session_id: args.session_id,
|
|
4739
|
+
goal: args.goal,
|
|
4740
|
+
role: args.role,
|
|
4741
|
+
task_list_id: args.task_list_id,
|
|
4727
4742
|
metadata: args.metadata
|
|
4728
4743
|
});
|
|
4729
4744
|
const output = processedText || args.text;
|
package/package.json
CHANGED
package/src/db/database.ts
CHANGED
|
@@ -63,6 +63,14 @@ const MIGRATIONS = [
|
|
|
63
63
|
CREATE INDEX IF NOT EXISTS idx_recordings_mode ON recordings(processing_mode);
|
|
64
64
|
CREATE INDEX IF NOT EXISTS idx_recording_tags_tag ON recording_tags(tag);
|
|
65
65
|
`,
|
|
66
|
+
|
|
67
|
+
// Migration 2: session tagging attributes
|
|
68
|
+
`
|
|
69
|
+
ALTER TABLE recordings ADD COLUMN goal TEXT;
|
|
70
|
+
ALTER TABLE recordings ADD COLUMN role TEXT;
|
|
71
|
+
ALTER TABLE recordings ADD COLUMN task_list_id TEXT;
|
|
72
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (2);
|
|
73
|
+
`,
|
|
66
74
|
];
|
|
67
75
|
|
|
68
76
|
export function getDatabase(dbPath?: string): Database {
|
package/src/db/recordings.ts
CHANGED
|
@@ -22,6 +22,9 @@ function parseRow(row: Record<string, unknown>): Recording {
|
|
|
22
22
|
agent_id: (row["agent_id"] as string) || null,
|
|
23
23
|
project_id: (row["project_id"] as string) || null,
|
|
24
24
|
session_id: (row["session_id"] as string) || null,
|
|
25
|
+
goal: (row["goal"] as string) || null,
|
|
26
|
+
role: (row["role"] as string) || null,
|
|
27
|
+
task_list_id: (row["task_list_id"] as string) || null,
|
|
25
28
|
metadata: JSON.parse((row["metadata"] as string) || "{}") as Record<string, unknown>,
|
|
26
29
|
created_at: row["created_at"] as string,
|
|
27
30
|
};
|
|
@@ -37,8 +40,8 @@ export function createRecording(
|
|
|
37
40
|
const metadataJson = JSON.stringify(input.metadata || {});
|
|
38
41
|
|
|
39
42
|
d.query(
|
|
40
|
-
`INSERT INTO recordings (id, audio_path, raw_text, processed_text, processing_mode, model_used, enhancement_model, duration_ms, language, tags, agent_id, project_id, session_id, metadata)
|
|
41
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
43
|
+
`INSERT INTO recordings (id, audio_path, raw_text, processed_text, processing_mode, model_used, enhancement_model, duration_ms, language, tags, agent_id, project_id, session_id, goal, role, task_list_id, metadata)
|
|
44
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
42
45
|
).run(
|
|
43
46
|
id,
|
|
44
47
|
input.audio_path || null,
|
|
@@ -53,6 +56,9 @@ export function createRecording(
|
|
|
53
56
|
input.agent_id || null,
|
|
54
57
|
input.project_id || null,
|
|
55
58
|
input.session_id || null,
|
|
59
|
+
input.goal || null,
|
|
60
|
+
input.role || null,
|
|
61
|
+
input.task_list_id || null,
|
|
56
62
|
metadataJson
|
|
57
63
|
);
|
|
58
64
|
|
package/src/mcp/index.ts
CHANGED
|
@@ -152,6 +152,9 @@ server.tool(
|
|
|
152
152
|
agent_id: z.string().optional(),
|
|
153
153
|
project_id: z.string().optional(),
|
|
154
154
|
session_id: z.string().optional(),
|
|
155
|
+
goal: z.string().optional().describe("Goal or purpose of this recording session (e.g. 'code review for PR #123')"),
|
|
156
|
+
role: z.string().optional().describe("Agent role for this session (e.g. 'dev agent for connectdev')"),
|
|
157
|
+
task_list_id: z.string().optional().describe("Task list ID to bind this recording to"),
|
|
155
158
|
metadata: z.record(z.unknown()).optional(),
|
|
156
159
|
},
|
|
157
160
|
async (args) => {
|
|
@@ -179,6 +182,9 @@ server.tool(
|
|
|
179
182
|
agent_id: args.agent_id,
|
|
180
183
|
project_id: args.project_id,
|
|
181
184
|
session_id: args.session_id,
|
|
185
|
+
goal: args.goal,
|
|
186
|
+
role: args.role,
|
|
187
|
+
task_list_id: args.task_list_id,
|
|
182
188
|
metadata: args.metadata,
|
|
183
189
|
});
|
|
184
190
|
|
package/src/types/index.ts
CHANGED
|
@@ -14,6 +14,9 @@ export interface Recording {
|
|
|
14
14
|
agent_id: string | null;
|
|
15
15
|
project_id: string | null;
|
|
16
16
|
session_id: string | null;
|
|
17
|
+
goal: string | null;
|
|
18
|
+
role: string | null;
|
|
19
|
+
task_list_id: string | null;
|
|
17
20
|
metadata: Record<string, unknown>;
|
|
18
21
|
created_at: string;
|
|
19
22
|
}
|
|
@@ -33,6 +36,9 @@ export interface CreateRecordingInput {
|
|
|
33
36
|
agent_id?: string;
|
|
34
37
|
project_id?: string;
|
|
35
38
|
session_id?: string;
|
|
39
|
+
goal?: string;
|
|
40
|
+
role?: string;
|
|
41
|
+
task_list_id?: string;
|
|
36
42
|
metadata?: Record<string, unknown>;
|
|
37
43
|
}
|
|
38
44
|
|