@hasna/recordings 0.2.1 → 0.2.2
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/cli/index.js +8 -6
- package/dist/index.js +7 -5
- package/dist/lib/enhancer.d.ts +9 -1
- package/dist/lib/enhancer.d.ts.map +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +8 -6
- package/dist/server/index.js +8 -6
- package/dist/storage.js +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1492,7 +1492,7 @@ function listProjects(db) {
|
|
|
1492
1492
|
}
|
|
1493
1493
|
|
|
1494
1494
|
// src/version.ts
|
|
1495
|
-
var VERSION = "0.2.
|
|
1495
|
+
var VERSION = "0.2.2";
|
|
1496
1496
|
|
|
1497
1497
|
// src/db/feedback.ts
|
|
1498
1498
|
function saveFeedback(input) {
|
|
@@ -2319,15 +2319,17 @@ ${systemPrompt}` : basePrompt;
|
|
|
2319
2319
|
throw new EnhancementError(`Enhancement failed: ${describeTranscriptionFailure(msg)}`);
|
|
2320
2320
|
}
|
|
2321
2321
|
}
|
|
2322
|
-
async function processText(rawText, config, systemPrompt) {
|
|
2323
|
-
|
|
2322
|
+
async function processText(rawText, config, systemPrompt, options) {
|
|
2323
|
+
const force = options?.force === true;
|
|
2324
|
+
if (!force && !config.auto_enhance) {
|
|
2324
2325
|
return { text: rawText, mode: "raw", enhancement_model: null };
|
|
2325
2326
|
}
|
|
2326
2327
|
const detection = needsEnhancement(rawText, config);
|
|
2327
|
-
if (!detection.needs) {
|
|
2328
|
+
if (!force && !detection.needs) {
|
|
2328
2329
|
return { text: rawText, mode: "raw", enhancement_model: null };
|
|
2329
2330
|
}
|
|
2330
|
-
const
|
|
2331
|
+
const instruction = detection.needs ? detection.instruction : rawText;
|
|
2332
|
+
const result = await enhanceText(rawText, instruction, config, systemPrompt);
|
|
2331
2333
|
return {
|
|
2332
2334
|
text: result.enhanced,
|
|
2333
2335
|
mode: "enhanced",
|
|
@@ -2492,7 +2494,7 @@ program.command("save <text>").description("Save raw text as a recording (no aud
|
|
|
2492
2494
|
try {
|
|
2493
2495
|
if (opts.enhance) {
|
|
2494
2496
|
const config = loadConfig();
|
|
2495
|
-
const processed = await processText(rawText, config);
|
|
2497
|
+
const processed = await processText(rawText, config, undefined, { force: true });
|
|
2496
2498
|
if (processed.mode === "enhanced") {
|
|
2497
2499
|
processedText = processed.text;
|
|
2498
2500
|
mode = "enhanced";
|
package/dist/index.js
CHANGED
|
@@ -751,7 +751,7 @@ function listProjects(db) {
|
|
|
751
751
|
}
|
|
752
752
|
|
|
753
753
|
// src/version.ts
|
|
754
|
-
var VERSION = "0.2.
|
|
754
|
+
var VERSION = "0.2.2";
|
|
755
755
|
|
|
756
756
|
// src/db/feedback.ts
|
|
757
757
|
function saveFeedback(input) {
|
|
@@ -1435,15 +1435,17 @@ ${systemPrompt}` : basePrompt;
|
|
|
1435
1435
|
throw new EnhancementError(`Enhancement failed: ${describeTranscriptionFailure(msg)}`);
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
|
-
async function processText(rawText, config, systemPrompt) {
|
|
1439
|
-
|
|
1438
|
+
async function processText(rawText, config, systemPrompt, options) {
|
|
1439
|
+
const force = options?.force === true;
|
|
1440
|
+
if (!force && !config.auto_enhance) {
|
|
1440
1441
|
return { text: rawText, mode: "raw", enhancement_model: null };
|
|
1441
1442
|
}
|
|
1442
1443
|
const detection = needsEnhancement(rawText, config);
|
|
1443
|
-
if (!detection.needs) {
|
|
1444
|
+
if (!force && !detection.needs) {
|
|
1444
1445
|
return { text: rawText, mode: "raw", enhancement_model: null };
|
|
1445
1446
|
}
|
|
1446
|
-
const
|
|
1447
|
+
const instruction = detection.needs ? detection.instruction : rawText;
|
|
1448
|
+
const result = await enhanceText(rawText, instruction, config, systemPrompt);
|
|
1447
1449
|
return {
|
|
1448
1450
|
text: result.enhanced,
|
|
1449
1451
|
mode: "enhanced",
|
package/dist/lib/enhancer.d.ts
CHANGED
|
@@ -16,8 +16,16 @@ export declare function needsEnhancement(text: string, config: RecordingsConfig)
|
|
|
16
16
|
export declare function enhanceText(rawText: string, instruction: string, config: RecordingsConfig, systemPrompt?: string): Promise<EnhancementResult>;
|
|
17
17
|
/**
|
|
18
18
|
* Full pipeline: detect if enhancement is needed, enhance if so.
|
|
19
|
+
*
|
|
20
|
+
* When `options.force` is true the caller has explicitly requested enhancement
|
|
21
|
+
* (e.g. `save --enhance` / `save_recording {enhance:true}`), so BOTH the
|
|
22
|
+
* `auto_enhance` config gate and the `needsEnhancement` heuristic are bypassed
|
|
23
|
+
* and the text is always enhanced. Without `force`, enhancement only happens
|
|
24
|
+
* when `auto_enhance` is on AND the heuristic detects an enhancement intent.
|
|
19
25
|
*/
|
|
20
|
-
export declare function processText(rawText: string, config: RecordingsConfig, systemPrompt?: string
|
|
26
|
+
export declare function processText(rawText: string, config: RecordingsConfig, systemPrompt?: string, options?: {
|
|
27
|
+
force?: boolean;
|
|
28
|
+
}): Promise<{
|
|
21
29
|
text: string;
|
|
22
30
|
mode: "raw" | "enhanced";
|
|
23
31
|
enhancement_model: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enhancer.d.ts","sourceRoot":"","sources":["../../src/lib/enhancer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAkB3B,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,gBAAgB,GACvB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAmCzD;AAoBD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,gBAAgB,EACxB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAwD5B;AAED
|
|
1
|
+
{"version":3,"file":"enhancer.d.ts","sourceRoot":"","sources":["../../src/lib/enhancer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAkB3B,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,gBAAgB,GACvB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAmCzD;AAoBD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,gBAAgB,EACxB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAwD5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5B,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,GAAG,UAAU,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC,CAuBD"}
|
package/dist/mcp/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkBpE,wBAAgB,WAAW,IAAI,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkBpE,wBAAgB,WAAW,IAAI,SAAS,CA8evC"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -4625,7 +4625,7 @@ function listProjects(db) {
|
|
|
4625
4625
|
}
|
|
4626
4626
|
|
|
4627
4627
|
// src/version.ts
|
|
4628
|
-
var VERSION = "0.2.
|
|
4628
|
+
var VERSION = "0.2.2";
|
|
4629
4629
|
|
|
4630
4630
|
// src/db/feedback.ts
|
|
4631
4631
|
function saveFeedback(input) {
|
|
@@ -5273,15 +5273,17 @@ ${systemPrompt}` : basePrompt;
|
|
|
5273
5273
|
throw new EnhancementError(`Enhancement failed: ${describeTranscriptionFailure(msg)}`);
|
|
5274
5274
|
}
|
|
5275
5275
|
}
|
|
5276
|
-
async function processText(rawText, config, systemPrompt) {
|
|
5277
|
-
|
|
5276
|
+
async function processText(rawText, config, systemPrompt, options) {
|
|
5277
|
+
const force = options?.force === true;
|
|
5278
|
+
if (!force && !config.auto_enhance) {
|
|
5278
5279
|
return { text: rawText, mode: "raw", enhancement_model: null };
|
|
5279
5280
|
}
|
|
5280
5281
|
const detection = needsEnhancement(rawText, config);
|
|
5281
|
-
if (!detection.needs) {
|
|
5282
|
+
if (!force && !detection.needs) {
|
|
5282
5283
|
return { text: rawText, mode: "raw", enhancement_model: null };
|
|
5283
5284
|
}
|
|
5284
|
-
const
|
|
5285
|
+
const instruction = detection.needs ? detection.instruction : rawText;
|
|
5286
|
+
const result = await enhanceText(rawText, instruction, config, systemPrompt);
|
|
5285
5287
|
return {
|
|
5286
5288
|
text: result.enhanced,
|
|
5287
5289
|
mode: "enhanced",
|
|
@@ -5461,7 +5463,7 @@ Params: none`
|
|
|
5461
5463
|
let mode = "raw";
|
|
5462
5464
|
let enhModel;
|
|
5463
5465
|
if (args.enhance !== false) {
|
|
5464
|
-
const processed = await processText(args.text, config);
|
|
5466
|
+
const processed = await processText(args.text, config, undefined, { force: args.enhance === true });
|
|
5465
5467
|
if (processed.mode === "enhanced") {
|
|
5466
5468
|
processedText = processed.text;
|
|
5467
5469
|
mode = "enhanced";
|
package/dist/server/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
|
18
18
|
var __require = import.meta.require;
|
|
19
19
|
|
|
20
20
|
// src/version.ts
|
|
21
|
-
var VERSION = "0.2.
|
|
21
|
+
var VERSION = "0.2.2";
|
|
22
22
|
|
|
23
23
|
// src/db/remote-storage.ts
|
|
24
24
|
import pg from "pg";
|
|
@@ -6289,15 +6289,17 @@ ${systemPrompt}` : basePrompt;
|
|
|
6289
6289
|
throw new EnhancementError(`Enhancement failed: ${describeTranscriptionFailure(msg)}`);
|
|
6290
6290
|
}
|
|
6291
6291
|
}
|
|
6292
|
-
async function processText(rawText, config, systemPrompt) {
|
|
6293
|
-
|
|
6292
|
+
async function processText(rawText, config, systemPrompt, options) {
|
|
6293
|
+
const force = options?.force === true;
|
|
6294
|
+
if (!force && !config.auto_enhance) {
|
|
6294
6295
|
return { text: rawText, mode: "raw", enhancement_model: null };
|
|
6295
6296
|
}
|
|
6296
6297
|
const detection = needsEnhancement(rawText, config);
|
|
6297
|
-
if (!detection.needs) {
|
|
6298
|
+
if (!force && !detection.needs) {
|
|
6298
6299
|
return { text: rawText, mode: "raw", enhancement_model: null };
|
|
6299
6300
|
}
|
|
6300
|
-
const
|
|
6301
|
+
const instruction = detection.needs ? detection.instruction : rawText;
|
|
6302
|
+
const result = await enhanceText(rawText, instruction, config, systemPrompt);
|
|
6301
6303
|
return {
|
|
6302
6304
|
text: result.enhanced,
|
|
6303
6305
|
mode: "enhanced",
|
|
@@ -6486,7 +6488,7 @@ Params: none`
|
|
|
6486
6488
|
let mode = "raw";
|
|
6487
6489
|
let enhModel;
|
|
6488
6490
|
if (args.enhance !== false) {
|
|
6489
|
-
const processed = await processText(args.text, config);
|
|
6491
|
+
const processed = await processText(args.text, config, undefined, { force: args.enhance === true });
|
|
6490
6492
|
if (processed.mode === "enhanced") {
|
|
6491
6493
|
processedText = processed.text;
|
|
6492
6494
|
mode = "enhanced";
|
package/dist/storage.js
CHANGED
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.
|
|
1
|
+
export declare const VERSION = "0.2.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED