schornai 0.3.0 → 0.4.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
CHANGED
|
@@ -4,8 +4,8 @@ The schorn.ai command-line application. The public npm package and executable ar
|
|
|
4
4
|
both named `schornai`; service implementation remains in the separate private
|
|
5
5
|
workspace package `@schornio/aibox-package-service`.
|
|
6
6
|
|
|
7
|
-
Requires Node.js 24 or newer.
|
|
8
|
-
|
|
7
|
+
Requires Node.js 24 or newer. Automatic setup and service commands are included
|
|
8
|
+
in the `schornai@0.4.0` package.
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
11
|
npx schornai
|
|
@@ -17,8 +17,8 @@ changing files. Only `y` (case-insensitive) proceeds; `n`, Enter, end of input o
|
|
|
17
17
|
Ctrl+C cancels. Retrying an incomplete installation asks again.
|
|
18
18
|
After confirmation it downloads the latest XRAG setup from
|
|
19
19
|
`https://schorn.ai/xrag/schornai/latest`, validates the archive and platform,
|
|
20
|
-
installs it and starts the service. The
|
|
21
|
-
|
|
20
|
+
installs it and starts the service. The public bootstrap targets macOS ARM64.
|
|
21
|
+
An unavailable download exits with an error and can be retried.
|
|
22
22
|
The bootstrap does not send a platform or architecture to that endpoint, so
|
|
23
23
|
it can currently serve only one target. A macOS ARM64 bundle cannot install
|
|
24
24
|
Linux; Linux needs a separately built bundle for the matching architecture.
|
|
@@ -7,7 +7,7 @@ import { dirname, join, resolve } from 'node:path';
|
|
|
7
7
|
import { createInterface } from 'node:readline/promises';
|
|
8
8
|
import { Transform } from 'node:stream';
|
|
9
9
|
import { pipeline } from 'node:stream/promises';
|
|
10
|
-
import { r as runServiceCLI, e as extractArchive } from './shared/cli-
|
|
10
|
+
import { r as runServiceCLI, e as extractArchive } from './shared/cli-CpgbC8Vv.mjs';
|
|
11
11
|
import { i as initConfig, w as writeJson, l as loadConfig, r as resolveFrom, o as object, a as literal, d as defaultConfigPath, s as string, c as createLogger, b as run, e as binary, n as number, f as boolean } from './shared/docker-Dj7cdbkw.mjs';
|
|
12
12
|
import { g as generateSecuritySecrets, h as hasLegacyLayout } from './shared/installer-CWopk_6Z.mjs';
|
|
13
13
|
import { execFile } from 'node:child_process';
|
package/dist/service/cli.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import 'node:path';
|
|
|
6
6
|
import 'node:child_process';
|
|
7
7
|
import 'node:timers/promises';
|
|
8
8
|
import './shared/docker-Dj7cdbkw.mjs';
|
|
9
|
-
export { r as runServiceCLI } from './shared/cli-
|
|
9
|
+
export { r as runServiceCLI } from './shared/cli-CpgbC8Vv.mjs';
|
|
10
10
|
import 'node:os';
|
|
11
11
|
import 'node:crypto';
|
|
12
12
|
import 'node:http';
|
|
@@ -411,6 +411,29 @@ function workerRealtimeUrl(context, environment) {
|
|
|
411
411
|
`${context.config.sharing.url.replace(/\/$/, "")}/v2/realtime`));
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
+
/** Resolve legacy signing configuration and fail before a worker claims tasks.
|
|
415
|
+
* Error messages contain variable names only, never credential values.
|
|
416
|
+
*/
|
|
417
|
+
function prepareTranscriberEnvironment(environment) {
|
|
418
|
+
const resolved = {
|
|
419
|
+
...environment,
|
|
420
|
+
SUPABASE_JWT_SECRET: environment.SUPABASE_JWT_SECRET || environment.JWT_SECRET,
|
|
421
|
+
};
|
|
422
|
+
const required = [
|
|
423
|
+
"SUPABASE_URL",
|
|
424
|
+
"SUPABASE_ANON_KEY",
|
|
425
|
+
"SUPABASE_SERVICE_ROLE_KEY",
|
|
426
|
+
"SUPABASE_JWT_SECRET",
|
|
427
|
+
"REALTIME_SERVER_URL",
|
|
428
|
+
"REALTIME_SERVER_SECRET",
|
|
429
|
+
];
|
|
430
|
+
const missing = required.filter((key) => !resolved[key]?.trim());
|
|
431
|
+
if (missing.length) {
|
|
432
|
+
throw new Error(`Transcriber configuration error: missing ${missing.join(", ")}. SUPABASE_JWT_SECRET may also be supplied as JWT_SECRET.`);
|
|
433
|
+
}
|
|
434
|
+
return resolved;
|
|
435
|
+
}
|
|
436
|
+
|
|
414
437
|
function serviceCommands(context) {
|
|
415
438
|
const { root, config, environment } = context;
|
|
416
439
|
const workspace = config.development?.workspace;
|
|
@@ -461,19 +484,13 @@ function serviceCommands(context) {
|
|
|
461
484
|
(localRealtime && existsSync(localCertificate)
|
|
462
485
|
? localCertificate
|
|
463
486
|
: undefined));
|
|
464
|
-
|
|
465
|
-
!realtime ||
|
|
466
|
-
!workerEnv.REALTIME_SERVER_SECRET ||
|
|
467
|
-
!workerEnv.SUPABASE_ANON_KEY ||
|
|
468
|
-
!workerEnv.SUPABASE_SERVICE_ROLE_KEY)
|
|
469
|
-
throw new Error("Transcriber requires Supabase/realtime endpoints and credentials in its environment file");
|
|
470
|
-
const transcriberEnvironment = {
|
|
487
|
+
const transcriberEnvironment = prepareTranscriberEnvironment({
|
|
471
488
|
...workerEnv,
|
|
472
489
|
WORKER_IDENTIFIER: `${config.id}:transcriber-mlx`,
|
|
473
490
|
SUPABASE_URL: supabase,
|
|
474
491
|
REALTIME_SERVER_URL: realtime,
|
|
475
492
|
...(caFile ? { NODE_EXTRA_CA_CERTS: caFile } : {}),
|
|
476
|
-
};
|
|
493
|
+
});
|
|
477
494
|
native.push(workspace
|
|
478
495
|
? developmentCommand("transcriber-mac", "transcriber-mlx", transcriberEnvironment)
|
|
479
496
|
: {
|