@kikedealba/recap 0.9.0 → 0.9.1
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/capture/capture.js +15 -7
- package/dist/core/self.js +5 -1
- package/dist/setup/integration.js +12 -8
- package/package.json +2 -2
package/dist/capture/capture.js
CHANGED
|
@@ -6,7 +6,7 @@ import { exists, readText } from "../core/fsutil.js";
|
|
|
6
6
|
import { isRecord } from "../core/json.js";
|
|
7
7
|
import { home } from "../core/paths.js";
|
|
8
8
|
import { exec, spawnDetached } from "../core/proc.js";
|
|
9
|
-
import { selfCommand } from "../core/self.js";
|
|
9
|
+
import { selfCommand, stableCommand } from "../core/self.js";
|
|
10
10
|
import { trimmed } from "../core/text.js";
|
|
11
11
|
import { RecapError } from "../errors.js";
|
|
12
12
|
import { parseEnvelope } from '@kikedealba/kit/envelope';
|
|
@@ -35,16 +35,24 @@ export function captureUnavailable() {
|
|
|
35
35
|
: 'Recording is only available on macOS for now. Record with any app and process the file with `recap import <file>`.';
|
|
36
36
|
return new RecapError('CAPTURE_UNAVAILABLE', 'The recorder (recap-capture) is not available on this machine', { hint });
|
|
37
37
|
}
|
|
38
|
-
export function liveWorkerCommand() {
|
|
39
|
-
return
|
|
38
|
+
export async function liveWorkerCommand(ctx) {
|
|
39
|
+
return [...(await stableCommand(ctx)), 'live-worker'];
|
|
40
|
+
}
|
|
41
|
+
export function workerPath(command, env = process.env) {
|
|
42
|
+
if (command[0] === selfCommand()[0])
|
|
43
|
+
return null;
|
|
44
|
+
return [path.dirname(process.execPath), ...(env['PATH'] ?? '').split(path.delimiter)].filter((dir, index, all) => dir.length > 0 && all.indexOf(dir) === index).join(path.delimiter);
|
|
40
45
|
}
|
|
41
46
|
export function hasCaptureBinary(app) {
|
|
42
47
|
return exists(path.join(app, 'Contents', 'MacOS', 'recap-capture'));
|
|
43
48
|
}
|
|
44
|
-
export function launchArguments(app, dir, log, modern = hasCaptureBinary(app)) {
|
|
49
|
+
export async function launchArguments(app, dir, log, modern = hasCaptureBinary(app), ctx) {
|
|
45
50
|
if (!modern)
|
|
46
51
|
return ['-g', '-n', '-a', app, '--stdout', log, '--stderr', log, '--args', 'record', dir];
|
|
47
|
-
|
|
52
|
+
const worker = await liveWorkerCommand(ctx);
|
|
53
|
+
const searchPath = workerPath(worker, ctx?.env);
|
|
54
|
+
const env = ['--env', `RECAP_LIVE_WORKER=${JSON.stringify(worker)}`, ...(searchPath === null ? [] : ['--env', `PATH=${searchPath}`])];
|
|
55
|
+
return ['-g', '-n', '-a', app, ...env, '--stdout', log, '--stderr', log, '--args', 'capture', 'record', dir];
|
|
48
56
|
}
|
|
49
57
|
export async function launchRecorder(dir) {
|
|
50
58
|
const launcher = await findCapture();
|
|
@@ -52,12 +60,12 @@ export async function launchRecorder(dir) {
|
|
|
52
60
|
throw captureUnavailable();
|
|
53
61
|
const log = path.join(dir, 'recorder.log');
|
|
54
62
|
if (launcher.kind === 'app') {
|
|
55
|
-
const result = await exec('/usr/bin/open', launchArguments(launcher.app, dir, log));
|
|
63
|
+
const result = await exec('/usr/bin/open', await launchArguments(launcher.app, dir, log));
|
|
56
64
|
if (result.status !== 0)
|
|
57
65
|
throw new RecapError('LAUNCH_FAILED', `Cannot launch ${path.basename(launcher.app)}: ${trimmed(result.stderr)}`);
|
|
58
66
|
return;
|
|
59
67
|
}
|
|
60
|
-
spawnDetached(launcher.binary, ['record', dir, '--live-worker', liveWorkerCommand()], log);
|
|
68
|
+
spawnDetached(launcher.binary, ['record', dir, '--live-worker', JSON.stringify(await liveWorkerCommand())], log);
|
|
61
69
|
}
|
|
62
70
|
function readReport(text) {
|
|
63
71
|
if (text === null)
|
package/dist/core/self.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { stableBin } from '@kikedealba/kit/registry';
|
|
4
|
+
import { PACKAGE_ROOT, VERSION } from "../version.js";
|
|
4
5
|
import { spawnDetached } from "./proc.js";
|
|
5
6
|
export function binEntry() {
|
|
6
7
|
const built = path.join(PACKAGE_ROOT, 'dist', 'bin', 'recap.js');
|
|
@@ -9,6 +10,9 @@ export function binEntry() {
|
|
|
9
10
|
export function selfCommand() {
|
|
10
11
|
return [process.execPath, binEntry()];
|
|
11
12
|
}
|
|
13
|
+
export function stableCommand(ctx) {
|
|
14
|
+
return stableBin('recap', VERSION, selfCommand(), ctx);
|
|
15
|
+
}
|
|
12
16
|
export function spawnSelf(args, logPath) {
|
|
13
17
|
const [node, entry] = selfCommand();
|
|
14
18
|
return spawnDetached(node ?? process.execPath, [entry ?? binEntry(), ...args], logPath);
|
|
@@ -6,7 +6,7 @@ import { bitaCommand } from "../bita/client.js";
|
|
|
6
6
|
import { readText } from "../core/fsutil.js";
|
|
7
7
|
import { isRecord } from "../core/json.js";
|
|
8
8
|
import { home } from "../core/paths.js";
|
|
9
|
-
import {
|
|
9
|
+
import { stableCommand } from "../core/self.js";
|
|
10
10
|
import { HOOK_EVENTS, MEETING_KINDS } from "../bita/hook.js";
|
|
11
11
|
import { PACKAGE_ROOT, VERSION } from "../version.js";
|
|
12
12
|
export const INSTALL_HINT = 'npm install -g @kikedealba/recap && recap setup';
|
|
@@ -14,28 +14,32 @@ export const BASE_CAPABILITIES = ['meeting.process', 'meeting.import', 'meeting.
|
|
|
14
14
|
export function capabilities(captureAvailable) {
|
|
15
15
|
return captureAvailable ? ['meeting.record', ...BASE_CAPABILITIES] : [...BASE_CAPABILITIES];
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
function subscription(bin) {
|
|
18
18
|
return {
|
|
19
19
|
tool: 'bita',
|
|
20
20
|
events: [...HOOK_EVENTS],
|
|
21
21
|
filter: { kind: Object.keys(MEETING_KINDS).sort() },
|
|
22
|
-
command: [...
|
|
22
|
+
command: [...bin, 'bita-hook'],
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
export function
|
|
25
|
+
export async function bitaSubscription(ctx) {
|
|
26
|
+
return subscription(await stableCommand(ctx));
|
|
27
|
+
}
|
|
28
|
+
export async function manifest(captureAvailable, subscribe = captureAvailable, ctx) {
|
|
29
|
+
const bin = await stableCommand(ctx);
|
|
26
30
|
return defineManifest({
|
|
27
31
|
name: 'recap',
|
|
28
32
|
version: VERSION,
|
|
29
33
|
description: 'Meeting recorder: local transcription, minutes, live answers',
|
|
30
|
-
bin
|
|
34
|
+
bin,
|
|
31
35
|
capabilities: capabilities(captureAvailable),
|
|
32
|
-
subscribes: subscribe ? [
|
|
36
|
+
subscribes: subscribe ? [subscription(bin)] : [],
|
|
33
37
|
homepage: 'https://github.com/KikeDeAlba/recap',
|
|
34
38
|
install: INSTALL_HINT,
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
|
-
export function register(captureAvailable, subscribe = captureAvailable) {
|
|
38
|
-
return registerTool(manifest(captureAvailable, subscribe));
|
|
41
|
+
export async function register(captureAvailable, subscribe = captureAvailable) {
|
|
42
|
+
return registerTool(await manifest(captureAvailable, subscribe));
|
|
39
43
|
}
|
|
40
44
|
export async function bitaLinked(config) {
|
|
41
45
|
const own = await readManifest('recap').catch(() => null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kikedealba/recap",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Meeting recorder CLI: local transcription with whisper.cpp, minutes written by Claude Code, live answers and bita integration.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jesus Enrique De Alba Gaytan",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"recap": "node src/bin/recap.ts"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@kikedealba/kit": "^0.
|
|
53
|
+
"@kikedealba/kit": "^0.2.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "^24.0.0",
|