@openspecui/core 3.11.2 → 3.11.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/{document-translation-BTEG-uW_.mjs → document-translation-B3QRXIXx.mjs} +5 -1
- package/dist/{document-translation-EMIQf5dw.d.mts → document-translation-QMSrWNT-.d.mts} +56 -9
- package/dist/document-translation.d.mts +1 -1
- package/dist/document-translation.mjs +2 -2
- package/dist/index.d.mts +197 -39
- package/dist/index.mjs +140 -5
- package/dist/{local-download-profiles-CSXKbamv.d.mts → local-download-profiles-DHF9dW4e.d.mts} +1 -1
- package/dist/local-download-profiles.d.mts +2 -2
- package/dist/{notifications-Ct6rtBwb.d.mts → notifications-D9yMeQqN.d.mts} +4 -4
- package/dist/notifications.d.mts +2 -2
- package/dist/{openspec-projection-DrTZ0P31.d.mts → openspec-projection-e-sOj4vr.d.mts} +1 -1
- package/dist/openspec-projection.d.mts +2 -2
- package/dist/{opsx-entity-CIB-Wi0n.d.mts → opsx-entity-C89YFQNB.d.mts} +9 -9
- package/dist/opsx-entity.d.mts +2 -2
- package/dist/{opsx-schema-detail-Cjoesix_.d.mts → opsx-schema-detail-DIscOp9f.d.mts} +1 -1
- package/dist/opsx-schema-detail.d.mts +3 -3
- package/dist/{schemas-DeEkRkAH.d.mts → schemas-B6ZBedD4.d.mts} +112 -112
- package/dist/{sounds-BaxOUgWE.d.mts → sounds-BjSZxrQO.d.mts} +1 -1
- package/dist/sounds.d.mts +1 -1
- package/dist/{terminal-audio-v3YSYJKq.d.mts → terminal-audio-6x0ceNBw.d.mts} +2 -2
- package/dist/terminal-audio.d.mts +2 -2
- package/dist/terminal-control.d.mts +2 -2
- package/dist/{terminal-invocation-C5gqne5H.d.mts → terminal-invocation-C2e1WSWM.d.mts} +24 -24
- package/dist/terminal-invocation.d.mts +1 -1
- package/dist/{translator-yHmEiuRX.mjs → translator-B98pejVa.mjs} +172 -7
- package/dist/{translator-BtbU7rjR.d.mts → translator-jn94xmWZ.d.mts} +247 -112
- package/dist/translator.d.mts +2 -2
- package/dist/translator.mjs +2 -2
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ declare const LEGACY_SOUND_ID_MAP: {
|
|
|
23
23
|
readonly pulse: "builtin:Tink";
|
|
24
24
|
};
|
|
25
25
|
declare function normalizeLegacySoundId(value: unknown): unknown;
|
|
26
|
-
declare const SoundConfigIdSchema: z.ZodEffects<z.ZodUnion<[z.ZodLiteral<"silent">, z.ZodEnum<["builtin:Basso", "builtin:Blow", "builtin:Bottle", "builtin:Frog", "builtin:Funk", "builtin:Glass", "builtin:Hero", "builtin:Morse", "builtin:Ping", "builtin:Pop", "builtin:Purr", "builtin:Sosumi", "builtin:Submarine", "builtin:Tink"]>, z.ZodType<`custom:${string}`, z.ZodTypeDef, `custom:${string}`>]>, "silent" | "builtin:
|
|
26
|
+
declare const SoundConfigIdSchema: z.ZodEffects<z.ZodUnion<[z.ZodLiteral<"silent">, z.ZodEnum<["builtin:Basso", "builtin:Blow", "builtin:Bottle", "builtin:Frog", "builtin:Funk", "builtin:Glass", "builtin:Hero", "builtin:Morse", "builtin:Ping", "builtin:Pop", "builtin:Purr", "builtin:Sosumi", "builtin:Submarine", "builtin:Tink"]>, z.ZodType<`custom:${string}`, z.ZodTypeDef, `custom:${string}`>]>, "silent" | "builtin:Tink" | "builtin:Blow" | "builtin:Basso" | "builtin:Bottle" | "builtin:Frog" | "builtin:Funk" | "builtin:Glass" | "builtin:Hero" | "builtin:Morse" | "builtin:Ping" | "builtin:Pop" | "builtin:Purr" | "builtin:Sosumi" | "builtin:Submarine" | `custom:${string}`, unknown>;
|
|
27
27
|
declare const SoundVolumeSchema: z.ZodDefault<z.ZodNumber>;
|
|
28
28
|
type SoundVolume = z.infer<typeof SoundVolumeSchema>;
|
|
29
29
|
interface BuiltinSoundOption {
|
package/dist/sounds.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as SoundVolume, D as normalizeLegacySoundId, E as getBuiltinSoundUrl, O as soundIdFromCustomHash, S as SoundIdSchema, T as customHashFromSoundId, _ as DEFAULT_SOUND_VOLUME, a as BuiltinSoundOption, b as SoundConfigIdSchema, c as CustomSoundHashSchema, d as CustomSoundMetadata, f as CustomSoundMetadataFile, g as DEFAULT_NOTIFICATION_SOUND_ID, h as DEFAULT_BELL_SOUND_ID, i as BuiltinSoundIdSchema, l as CustomSoundId, m as CustomSoundMetadataSchema, n as BUILTIN_SOUND_OPTIONS, o as CUSTOM_SOUND_ADD_VALUE, p as CustomSoundMetadataFileSchema, r as BuiltinSoundId, s as CustomSoundHash, t as BUILTIN_SOUND_IDS, u as CustomSoundIdSchema, v as LEGACY_SOUND_ID_MAP, w as SoundVolumeSchema, x as SoundId, y as SILENT_SOUND_ID } from "./sounds-
|
|
1
|
+
import { C as SoundVolume, D as normalizeLegacySoundId, E as getBuiltinSoundUrl, O as soundIdFromCustomHash, S as SoundIdSchema, T as customHashFromSoundId, _ as DEFAULT_SOUND_VOLUME, a as BuiltinSoundOption, b as SoundConfigIdSchema, c as CustomSoundHashSchema, d as CustomSoundMetadata, f as CustomSoundMetadataFile, g as DEFAULT_NOTIFICATION_SOUND_ID, h as DEFAULT_BELL_SOUND_ID, i as BuiltinSoundIdSchema, l as CustomSoundId, m as CustomSoundMetadataSchema, n as BUILTIN_SOUND_OPTIONS, o as CUSTOM_SOUND_ADD_VALUE, p as CustomSoundMetadataFileSchema, r as BuiltinSoundId, s as CustomSoundHash, t as BUILTIN_SOUND_IDS, u as CustomSoundIdSchema, v as LEGACY_SOUND_ID_MAP, w as SoundVolumeSchema, x as SoundId, y as SILENT_SOUND_ID } from "./sounds-BjSZxrQO.mjs";
|
|
2
2
|
export { BUILTIN_SOUND_IDS, BUILTIN_SOUND_OPTIONS, BuiltinSoundId, BuiltinSoundIdSchema, BuiltinSoundOption, CUSTOM_SOUND_ADD_VALUE, CustomSoundHash, CustomSoundHashSchema, CustomSoundId, CustomSoundIdSchema, CustomSoundMetadata, CustomSoundMetadataFile, CustomSoundMetadataFileSchema, CustomSoundMetadataSchema, DEFAULT_BELL_SOUND_ID, DEFAULT_NOTIFICATION_SOUND_ID, DEFAULT_SOUND_VOLUME, LEGACY_SOUND_ID_MAP, SILENT_SOUND_ID, SoundConfigIdSchema, SoundId, SoundIdSchema, SoundVolume, SoundVolumeSchema, customHashFromSoundId, getBuiltinSoundUrl, normalizeLegacySoundId, soundIdFromCustomHash };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { x as SoundId } from "./sounds-
|
|
1
|
+
import { x as SoundId } from "./sounds-BjSZxrQO.mjs";
|
|
2
2
|
import * as zod0 from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/terminal-audio.d.ts
|
|
5
5
|
declare const TERMINAL_BELL_SOUND_VALUES: readonly ["silent", "bell", "soft", "clear", "pulse"];
|
|
6
|
-
declare const TerminalBellSoundSchema: zod0.ZodEffects<zod0.ZodUnion<[zod0.ZodLiteral<"silent">, zod0.ZodEnum<["builtin:Basso", "builtin:Blow", "builtin:Bottle", "builtin:Frog", "builtin:Funk", "builtin:Glass", "builtin:Hero", "builtin:Morse", "builtin:Ping", "builtin:Pop", "builtin:Purr", "builtin:Sosumi", "builtin:Submarine", "builtin:Tink"]>, zod0.ZodType<`custom:${string}`, zod0.ZodTypeDef, `custom:${string}`>]>, "silent" | "builtin:
|
|
6
|
+
declare const TerminalBellSoundSchema: zod0.ZodEffects<zod0.ZodUnion<[zod0.ZodLiteral<"silent">, zod0.ZodEnum<["builtin:Basso", "builtin:Blow", "builtin:Bottle", "builtin:Frog", "builtin:Funk", "builtin:Glass", "builtin:Hero", "builtin:Morse", "builtin:Ping", "builtin:Pop", "builtin:Purr", "builtin:Sosumi", "builtin:Submarine", "builtin:Tink"]>, zod0.ZodType<`custom:${string}`, zod0.ZodTypeDef, `custom:${string}`>]>, "silent" | "builtin:Tink" | "builtin:Blow" | "builtin:Basso" | "builtin:Bottle" | "builtin:Frog" | "builtin:Funk" | "builtin:Glass" | "builtin:Hero" | "builtin:Morse" | "builtin:Ping" | "builtin:Pop" | "builtin:Purr" | "builtin:Sosumi" | "builtin:Submarine" | `custom:${string}`, unknown>;
|
|
7
7
|
type TerminalBellSound = SoundId;
|
|
8
8
|
declare const TERMINAL_BELL_SOUND_OPTIONS: readonly {
|
|
9
9
|
id: TerminalBellSound;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./sounds-
|
|
2
|
-
import { i as TerminalBellSoundSchema, n as TERMINAL_BELL_SOUND_VALUES, r as TerminalBellSound, t as TERMINAL_BELL_SOUND_OPTIONS } from "./terminal-audio-
|
|
1
|
+
import "./sounds-BjSZxrQO.mjs";
|
|
2
|
+
import { i as TerminalBellSoundSchema, n as TERMINAL_BELL_SOUND_VALUES, r as TerminalBellSound, t as TERMINAL_BELL_SOUND_OPTIONS } from "./terminal-audio-6x0ceNBw.mjs";
|
|
3
3
|
export { TERMINAL_BELL_SOUND_OPTIONS, TERMINAL_BELL_SOUND_VALUES, TerminalBellSound, TerminalBellSoundSchema };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./sounds-
|
|
2
|
-
import { A as TerminalNotificationProtocol, D as TerminalControlEvent, M as TerminalPromptState, N as TerminalTitleTarget, O as TerminalControlParseResult, P as terminalNotificationEventToPublishInput, j as TerminalProgressState, k as TerminalControlParser } from "./notifications-
|
|
1
|
+
import "./sounds-BjSZxrQO.mjs";
|
|
2
|
+
import { A as TerminalNotificationProtocol, D as TerminalControlEvent, M as TerminalPromptState, N as TerminalTitleTarget, O as TerminalControlParseResult, P as terminalNotificationEventToPublishInput, j as TerminalProgressState, k as TerminalControlParser } from "./notifications-D9yMeQqN.mjs";
|
|
3
3
|
export { TerminalControlEvent, TerminalControlParseResult, TerminalControlParser, TerminalNotificationProtocol, TerminalProgressState, TerminalPromptState, TerminalTitleTarget, terminalNotificationEventToPublishInput };
|
|
@@ -463,12 +463,12 @@ declare const PtyServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
463
463
|
value: number | null;
|
|
464
464
|
type: "progress";
|
|
465
465
|
sessionId: string;
|
|
466
|
-
state: "
|
|
466
|
+
state: "error" | "set" | "clear" | "warning" | "indeterminate";
|
|
467
467
|
}, {
|
|
468
468
|
value: number | null;
|
|
469
469
|
type: "progress";
|
|
470
470
|
sessionId: string;
|
|
471
|
-
state: "
|
|
471
|
+
state: "error" | "set" | "clear" | "warning" | "indeterminate";
|
|
472
472
|
}>, z.ZodObject<{
|
|
473
473
|
type: z.ZodLiteral<"prompt-state">;
|
|
474
474
|
sessionId: z.ZodString;
|
|
@@ -631,9 +631,9 @@ declare const TerminalCommandFieldSchema: z.ZodObject<{
|
|
|
631
631
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
632
632
|
advanced: z.ZodDefault<z.ZodBoolean>;
|
|
633
633
|
}, "strip", z.ZodTypeAny, {
|
|
634
|
+
required: boolean;
|
|
634
635
|
options: string[];
|
|
635
636
|
type: "boolean" | "text" | "textarea" | "select";
|
|
636
|
-
required: boolean;
|
|
637
637
|
id: string;
|
|
638
638
|
label: string;
|
|
639
639
|
advanced: boolean;
|
|
@@ -644,8 +644,8 @@ declare const TerminalCommandFieldSchema: z.ZodObject<{
|
|
|
644
644
|
type: "boolean" | "text" | "textarea" | "select";
|
|
645
645
|
id: string;
|
|
646
646
|
label: string;
|
|
647
|
-
options?: string[] | undefined;
|
|
648
647
|
required?: boolean | undefined;
|
|
648
|
+
options?: string[] | undefined;
|
|
649
649
|
description?: string | undefined;
|
|
650
650
|
placeholder?: string | undefined;
|
|
651
651
|
defaultValue?: string | boolean | undefined;
|
|
@@ -733,8 +733,8 @@ declare const TerminalCommandJsonSchemaSchema: z.ZodObject<{
|
|
|
733
733
|
}>>>;
|
|
734
734
|
required: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
735
735
|
}, "strip", z.ZodTypeAny, {
|
|
736
|
-
type: "object";
|
|
737
736
|
required: string[];
|
|
737
|
+
type: "object";
|
|
738
738
|
properties: Record<string, {
|
|
739
739
|
type: "string" | "boolean";
|
|
740
740
|
description?: string | undefined;
|
|
@@ -778,8 +778,8 @@ declare const TerminalCommandParametersSchema: z.ZodObject<{
|
|
|
778
778
|
}>>>;
|
|
779
779
|
required: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
780
780
|
}, "strip", z.ZodTypeAny, {
|
|
781
|
-
type: "object";
|
|
782
781
|
required: string[];
|
|
782
|
+
type: "object";
|
|
783
783
|
properties: Record<string, {
|
|
784
784
|
type: "string" | "boolean";
|
|
785
785
|
description?: string | undefined;
|
|
@@ -801,8 +801,8 @@ declare const TerminalCommandParametersSchema: z.ZodObject<{
|
|
|
801
801
|
uiSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
802
802
|
}, "strip", z.ZodTypeAny, {
|
|
803
803
|
schema: {
|
|
804
|
-
type: "object";
|
|
805
804
|
required: string[];
|
|
805
|
+
type: "object";
|
|
806
806
|
properties: Record<string, {
|
|
807
807
|
type: "string" | "boolean";
|
|
808
808
|
description?: string | undefined;
|
|
@@ -998,9 +998,9 @@ declare const TerminalSpawnCommandSchema: z.ZodObject<{
|
|
|
998
998
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
999
999
|
advanced: z.ZodDefault<z.ZodBoolean>;
|
|
1000
1000
|
}, "strip", z.ZodTypeAny, {
|
|
1001
|
+
required: boolean;
|
|
1001
1002
|
options: string[];
|
|
1002
1003
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1003
|
-
required: boolean;
|
|
1004
1004
|
id: string;
|
|
1005
1005
|
label: string;
|
|
1006
1006
|
advanced: boolean;
|
|
@@ -1011,8 +1011,8 @@ declare const TerminalSpawnCommandSchema: z.ZodObject<{
|
|
|
1011
1011
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1012
1012
|
id: string;
|
|
1013
1013
|
label: string;
|
|
1014
|
-
options?: string[] | undefined;
|
|
1015
1014
|
required?: boolean | undefined;
|
|
1015
|
+
options?: string[] | undefined;
|
|
1016
1016
|
description?: string | undefined;
|
|
1017
1017
|
placeholder?: string | undefined;
|
|
1018
1018
|
defaultValue?: string | boolean | undefined;
|
|
@@ -1042,8 +1042,8 @@ declare const TerminalSpawnCommandSchema: z.ZodObject<{
|
|
|
1042
1042
|
}>>>;
|
|
1043
1043
|
required: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1044
1044
|
}, "strip", z.ZodTypeAny, {
|
|
1045
|
-
type: "object";
|
|
1046
1045
|
required: string[];
|
|
1046
|
+
type: "object";
|
|
1047
1047
|
properties: Record<string, {
|
|
1048
1048
|
type: "string" | "boolean";
|
|
1049
1049
|
description?: string | undefined;
|
|
@@ -1065,8 +1065,8 @@ declare const TerminalSpawnCommandSchema: z.ZodObject<{
|
|
|
1065
1065
|
uiSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1066
1066
|
}, "strip", z.ZodTypeAny, {
|
|
1067
1067
|
schema: {
|
|
1068
|
-
type: "object";
|
|
1069
1068
|
required: string[];
|
|
1069
|
+
type: "object";
|
|
1070
1070
|
properties: Record<string, {
|
|
1071
1071
|
type: "string" | "boolean";
|
|
1072
1072
|
description?: string | undefined;
|
|
@@ -1190,9 +1190,9 @@ declare const TerminalSpawnCommandSchema: z.ZodObject<{
|
|
|
1190
1190
|
flag: string;
|
|
1191
1191
|
})[];
|
|
1192
1192
|
fields: {
|
|
1193
|
+
required: boolean;
|
|
1193
1194
|
options: string[];
|
|
1194
1195
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1195
|
-
required: boolean;
|
|
1196
1196
|
id: string;
|
|
1197
1197
|
label: string;
|
|
1198
1198
|
advanced: boolean;
|
|
@@ -1203,8 +1203,8 @@ declare const TerminalSpawnCommandSchema: z.ZodObject<{
|
|
|
1203
1203
|
description?: string | undefined;
|
|
1204
1204
|
parameters?: {
|
|
1205
1205
|
schema: {
|
|
1206
|
-
type: "object";
|
|
1207
1206
|
required: string[];
|
|
1207
|
+
type: "object";
|
|
1208
1208
|
properties: Record<string, {
|
|
1209
1209
|
type: "string" | "boolean";
|
|
1210
1210
|
description?: string | undefined;
|
|
@@ -1258,8 +1258,8 @@ declare const TerminalSpawnCommandSchema: z.ZodObject<{
|
|
|
1258
1258
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1259
1259
|
id: string;
|
|
1260
1260
|
label: string;
|
|
1261
|
-
options?: string[] | undefined;
|
|
1262
1261
|
required?: boolean | undefined;
|
|
1262
|
+
options?: string[] | undefined;
|
|
1263
1263
|
description?: string | undefined;
|
|
1264
1264
|
placeholder?: string | undefined;
|
|
1265
1265
|
defaultValue?: string | boolean | undefined;
|
|
@@ -1378,9 +1378,9 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1378
1378
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
1379
1379
|
advanced: z.ZodDefault<z.ZodBoolean>;
|
|
1380
1380
|
}, "strip", z.ZodTypeAny, {
|
|
1381
|
+
required: boolean;
|
|
1381
1382
|
options: string[];
|
|
1382
1383
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1383
|
-
required: boolean;
|
|
1384
1384
|
id: string;
|
|
1385
1385
|
label: string;
|
|
1386
1386
|
advanced: boolean;
|
|
@@ -1391,8 +1391,8 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1391
1391
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1392
1392
|
id: string;
|
|
1393
1393
|
label: string;
|
|
1394
|
-
options?: string[] | undefined;
|
|
1395
1394
|
required?: boolean | undefined;
|
|
1395
|
+
options?: string[] | undefined;
|
|
1396
1396
|
description?: string | undefined;
|
|
1397
1397
|
placeholder?: string | undefined;
|
|
1398
1398
|
defaultValue?: string | boolean | undefined;
|
|
@@ -1422,8 +1422,8 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1422
1422
|
}>>>;
|
|
1423
1423
|
required: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1424
1424
|
}, "strip", z.ZodTypeAny, {
|
|
1425
|
-
type: "object";
|
|
1426
1425
|
required: string[];
|
|
1426
|
+
type: "object";
|
|
1427
1427
|
properties: Record<string, {
|
|
1428
1428
|
type: "string" | "boolean";
|
|
1429
1429
|
description?: string | undefined;
|
|
@@ -1445,8 +1445,8 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1445
1445
|
uiSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1446
1446
|
}, "strip", z.ZodTypeAny, {
|
|
1447
1447
|
schema: {
|
|
1448
|
-
type: "object";
|
|
1449
1448
|
required: string[];
|
|
1449
|
+
type: "object";
|
|
1450
1450
|
properties: Record<string, {
|
|
1451
1451
|
type: "string" | "boolean";
|
|
1452
1452
|
description?: string | undefined;
|
|
@@ -1570,9 +1570,9 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1570
1570
|
flag: string;
|
|
1571
1571
|
})[];
|
|
1572
1572
|
fields: {
|
|
1573
|
+
required: boolean;
|
|
1573
1574
|
options: string[];
|
|
1574
1575
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1575
|
-
required: boolean;
|
|
1576
1576
|
id: string;
|
|
1577
1577
|
label: string;
|
|
1578
1578
|
advanced: boolean;
|
|
@@ -1583,8 +1583,8 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1583
1583
|
description?: string | undefined;
|
|
1584
1584
|
parameters?: {
|
|
1585
1585
|
schema: {
|
|
1586
|
-
type: "object";
|
|
1587
1586
|
required: string[];
|
|
1587
|
+
type: "object";
|
|
1588
1588
|
properties: Record<string, {
|
|
1589
1589
|
type: "string" | "boolean";
|
|
1590
1590
|
description?: string | undefined;
|
|
@@ -1638,8 +1638,8 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1638
1638
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1639
1639
|
id: string;
|
|
1640
1640
|
label: string;
|
|
1641
|
-
options?: string[] | undefined;
|
|
1642
1641
|
required?: boolean | undefined;
|
|
1642
|
+
options?: string[] | undefined;
|
|
1643
1643
|
description?: string | undefined;
|
|
1644
1644
|
placeholder?: string | undefined;
|
|
1645
1645
|
defaultValue?: string | boolean | undefined;
|
|
@@ -1708,9 +1708,9 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1708
1708
|
flag: string;
|
|
1709
1709
|
})[];
|
|
1710
1710
|
fields: {
|
|
1711
|
+
required: boolean;
|
|
1711
1712
|
options: string[];
|
|
1712
1713
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1713
|
-
required: boolean;
|
|
1714
1714
|
id: string;
|
|
1715
1715
|
label: string;
|
|
1716
1716
|
advanced: boolean;
|
|
@@ -1721,8 +1721,8 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1721
1721
|
description?: string | undefined;
|
|
1722
1722
|
parameters?: {
|
|
1723
1723
|
schema: {
|
|
1724
|
-
type: "object";
|
|
1725
1724
|
required: string[];
|
|
1725
|
+
type: "object";
|
|
1726
1726
|
properties: Record<string, {
|
|
1727
1727
|
type: "string" | "boolean";
|
|
1728
1728
|
description?: string | undefined;
|
|
@@ -1788,8 +1788,8 @@ declare const TerminalInvocationSettingsSchema: z.ZodObject<{
|
|
|
1788
1788
|
type: "boolean" | "text" | "textarea" | "select";
|
|
1789
1789
|
id: string;
|
|
1790
1790
|
label: string;
|
|
1791
|
-
options?: string[] | undefined;
|
|
1792
1791
|
required?: boolean | undefined;
|
|
1792
|
+
options?: string[] | undefined;
|
|
1793
1793
|
description?: string | undefined;
|
|
1794
1794
|
placeholder?: string | undefined;
|
|
1795
1795
|
defaultValue?: string | boolean | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as renderTerminalSpawnCommand, C as TerminalSpawnCommand, D as getTerminalCommandParameters, E as getTerminalCommandDefaultValues, M as resolveTerminalShellDefaults, O as quoteTerminalShellArg, S as TerminalShellQuoteStyleSchema, T as fieldsToTerminalCommandParameters, _ as TerminalShellDefaults, a as TerminalCommandBuilder, b as TerminalShellProfileSchema, c as TerminalCommandFieldSchema, d as TerminalCommandJsonSchema, f as TerminalCommandJsonSchemaProperty, g as TerminalInvocationSettingsSchema, h as TerminalInvocationSettings, i as TerminalCommandArgument, j as renderTerminalSpawnCommandLine, k as renderTerminalCommandArgs, l as TerminalCommandFieldValue, m as TerminalCommandRenderResult, n as TERMINAL_COMMAND_FIELD_TYPE_VALUES, o as TerminalCommandBuilderPart, p as TerminalCommandParameters, r as TERMINAL_SHELL_QUOTE_STYLE_VALUES, s as TerminalCommandField, t as BUILTIN_TERMINAL_SPAWN_COMMANDS, u as TerminalCommandFieldValues, v as TerminalShellEnv, w as TerminalSpawnCommandSchema, x as TerminalShellQuoteStyle, y as TerminalShellProfile } from "./terminal-invocation-
|
|
1
|
+
import { A as renderTerminalSpawnCommand, C as TerminalSpawnCommand, D as getTerminalCommandParameters, E as getTerminalCommandDefaultValues, M as resolveTerminalShellDefaults, O as quoteTerminalShellArg, S as TerminalShellQuoteStyleSchema, T as fieldsToTerminalCommandParameters, _ as TerminalShellDefaults, a as TerminalCommandBuilder, b as TerminalShellProfileSchema, c as TerminalCommandFieldSchema, d as TerminalCommandJsonSchema, f as TerminalCommandJsonSchemaProperty, g as TerminalInvocationSettingsSchema, h as TerminalInvocationSettings, i as TerminalCommandArgument, j as renderTerminalSpawnCommandLine, k as renderTerminalCommandArgs, l as TerminalCommandFieldValue, m as TerminalCommandRenderResult, n as TERMINAL_COMMAND_FIELD_TYPE_VALUES, o as TerminalCommandBuilderPart, p as TerminalCommandParameters, r as TERMINAL_SHELL_QUOTE_STYLE_VALUES, s as TerminalCommandField, t as BUILTIN_TERMINAL_SPAWN_COMMANDS, u as TerminalCommandFieldValues, v as TerminalShellEnv, w as TerminalSpawnCommandSchema, x as TerminalShellQuoteStyle, y as TerminalShellProfile } from "./terminal-invocation-C2e1WSWM.mjs";
|
|
2
2
|
export { BUILTIN_TERMINAL_SPAWN_COMMANDS, TERMINAL_COMMAND_FIELD_TYPE_VALUES, TERMINAL_SHELL_QUOTE_STYLE_VALUES, TerminalCommandArgument, TerminalCommandBuilder, TerminalCommandBuilderPart, TerminalCommandField, TerminalCommandFieldSchema, TerminalCommandFieldValue, TerminalCommandFieldValues, TerminalCommandJsonSchema, TerminalCommandJsonSchemaProperty, TerminalCommandParameters, TerminalCommandRenderResult, TerminalInvocationSettings, TerminalInvocationSettingsSchema, TerminalShellDefaults, TerminalShellEnv, TerminalShellProfile, TerminalShellProfileSchema, TerminalShellQuoteStyle, TerminalShellQuoteStyleSchema, TerminalSpawnCommand, TerminalSpawnCommandSchema, fieldsToTerminalCommandParameters, getTerminalCommandDefaultValues, getTerminalCommandParameters, quoteTerminalShellArg, renderTerminalCommandArgs, renderTerminalSpawnCommand, renderTerminalSpawnCommandLine, resolveTerminalShellDefaults };
|
|
@@ -1,24 +1,148 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
+
//#region src/translation-task-control.ts
|
|
4
|
+
const BATCH_TRANSLATION_ERROR_KINDS = [
|
|
5
|
+
"timeout",
|
|
6
|
+
"memory-limit",
|
|
7
|
+
"runtime",
|
|
8
|
+
"abort"
|
|
9
|
+
];
|
|
10
|
+
async function runControlledTranslationTask(task, options = {}) {
|
|
11
|
+
const controller = new AbortController();
|
|
12
|
+
const cleanupCallbacks = [];
|
|
13
|
+
const parentSignal = options.signal;
|
|
14
|
+
const timeoutMs = normalizeTimeoutMs(options.timeoutMs);
|
|
15
|
+
if (parentSignal) if (parentSignal.aborted) controller.abort(parentSignal.reason);
|
|
16
|
+
else {
|
|
17
|
+
const onAbort = () => controller.abort(parentSignal.reason);
|
|
18
|
+
parentSignal.addEventListener("abort", onAbort, { once: true });
|
|
19
|
+
cleanupCallbacks.push(() => parentSignal.removeEventListener("abort", onAbort));
|
|
20
|
+
}
|
|
21
|
+
if (controller.signal.aborted) {
|
|
22
|
+
cleanupCallbacks.forEach((callback) => callback());
|
|
23
|
+
return {
|
|
24
|
+
ok: false,
|
|
25
|
+
error: normalizeBatchTranslationError(controller.signal.reason, parentSignal)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
let timer;
|
|
29
|
+
let timeoutError;
|
|
30
|
+
const taskPromise = Promise.resolve().then(() => task(controller.signal));
|
|
31
|
+
taskPromise.catch(() => void 0);
|
|
32
|
+
const races = [taskPromise];
|
|
33
|
+
if (!controller.signal.aborted) races.push(new Promise((_, reject) => {
|
|
34
|
+
const onAbort = () => reject(new DOMException("Translation cancelled.", "AbortError"));
|
|
35
|
+
controller.signal.addEventListener("abort", onAbort, { once: true });
|
|
36
|
+
cleanupCallbacks.push(() => controller.signal.removeEventListener("abort", onAbort));
|
|
37
|
+
}));
|
|
38
|
+
if (timeoutMs !== void 0) races.push(new Promise((_, reject) => {
|
|
39
|
+
timer = setTimeout(() => {
|
|
40
|
+
timeoutError = /* @__PURE__ */ new Error(`Translation task timed out after ${timeoutMs}ms.`);
|
|
41
|
+
controller.abort(timeoutError);
|
|
42
|
+
reject(timeoutError);
|
|
43
|
+
}, timeoutMs);
|
|
44
|
+
}));
|
|
45
|
+
try {
|
|
46
|
+
return {
|
|
47
|
+
ok: true,
|
|
48
|
+
value: await Promise.race(races)
|
|
49
|
+
};
|
|
50
|
+
} catch (error) {
|
|
51
|
+
controller.abort(error);
|
|
52
|
+
if (timeoutError && controller.signal.reason === timeoutError) return {
|
|
53
|
+
ok: false,
|
|
54
|
+
error: {
|
|
55
|
+
kind: "timeout",
|
|
56
|
+
message: timeoutError.message
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
ok: false,
|
|
61
|
+
error: normalizeBatchTranslationError(error, parentSignal)
|
|
62
|
+
};
|
|
63
|
+
} finally {
|
|
64
|
+
if (timer) clearTimeout(timer);
|
|
65
|
+
cleanupCallbacks.forEach((callback) => callback());
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function normalizeBatchTranslationError(error, parentSignal) {
|
|
69
|
+
if (isBatchTranslationError(error)) return error;
|
|
70
|
+
if (parentSignal?.aborted) return {
|
|
71
|
+
kind: "abort",
|
|
72
|
+
message: readAbortMessage(parentSignal.reason) ?? "Translation cancelled."
|
|
73
|
+
};
|
|
74
|
+
if (error instanceof DOMException && error.name === "AbortError") return {
|
|
75
|
+
kind: "abort",
|
|
76
|
+
message: readAbortMessage(error) ?? "Translation cancelled."
|
|
77
|
+
};
|
|
78
|
+
const message = getErrorMessage(error);
|
|
79
|
+
if (isTimeoutMessage(message)) return {
|
|
80
|
+
kind: "timeout",
|
|
81
|
+
message
|
|
82
|
+
};
|
|
83
|
+
if (isMemoryLimitMessage(message)) return {
|
|
84
|
+
kind: "memory-limit",
|
|
85
|
+
message
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
kind: "runtime",
|
|
89
|
+
message
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function isBatchTranslationAbort(error, signal) {
|
|
93
|
+
return error.kind === "abort" && !!signal?.aborted;
|
|
94
|
+
}
|
|
95
|
+
function normalizeTimeoutMs(timeoutMs) {
|
|
96
|
+
return typeof timeoutMs === "number" && Number.isFinite(timeoutMs) && timeoutMs > 0 ? Math.floor(timeoutMs) : void 0;
|
|
97
|
+
}
|
|
98
|
+
function getErrorMessage(error) {
|
|
99
|
+
if (error instanceof Error && error.message.trim().length > 0) return error.message;
|
|
100
|
+
if (typeof error === "string" && error.trim().length > 0) return error;
|
|
101
|
+
return "Translation failed.";
|
|
102
|
+
}
|
|
103
|
+
function readAbortMessage(reason) {
|
|
104
|
+
if (reason instanceof Error && reason.message.trim().length > 0) return reason.message;
|
|
105
|
+
if (typeof reason === "string" && reason.trim().length > 0) return reason;
|
|
106
|
+
}
|
|
107
|
+
function isTimeoutMessage(message) {
|
|
108
|
+
return /\btime(?:d)?\s*out\b/i.test(message);
|
|
109
|
+
}
|
|
110
|
+
function isMemoryLimitMessage(message) {
|
|
111
|
+
return /out of memory/i.test(message) || /memory limit/i.test(message) || /insufficient memory/i.test(message) || /ERR_WORKER_OUT_OF_MEMORY/i.test(message);
|
|
112
|
+
}
|
|
113
|
+
function isBatchTranslationError(value) {
|
|
114
|
+
if (typeof value !== "object" || value === null) return false;
|
|
115
|
+
const kind = Reflect.get(value, "kind");
|
|
116
|
+
const message = Reflect.get(value, "message");
|
|
117
|
+
return typeof kind === "string" && BATCH_TRANSLATION_ERROR_KINDS.includes(kind) && typeof message === "string" && message.length > 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
3
121
|
//#region src/translator.ts
|
|
4
122
|
const TRANSLATOR_CONTRACT_VERSION = 3;
|
|
5
123
|
const TRANSLATION_ENGINE_IDS = [
|
|
6
124
|
"browser",
|
|
7
125
|
"local",
|
|
8
126
|
"local-ct2",
|
|
127
|
+
"local-llama",
|
|
9
128
|
"openai"
|
|
10
129
|
];
|
|
11
130
|
const TranslationEngineIdSchema = z.enum(TRANSLATION_ENGINE_IDS);
|
|
12
131
|
const DEFAULT_TRANSLATION_ENGINE_ID = "browser";
|
|
13
132
|
function isManagedLocalTranslationEngineId(engineId) {
|
|
133
|
+
return engineId === "local" || engineId === "local-ct2" || engineId === "local-llama";
|
|
134
|
+
}
|
|
135
|
+
function isDirectionalManagedLocalTranslationEngineId(engineId) {
|
|
14
136
|
return engineId === "local" || engineId === "local-ct2";
|
|
15
137
|
}
|
|
16
138
|
const SERVICE_TRANSLATION_ENGINE_IDS = [
|
|
17
139
|
"local",
|
|
18
140
|
"local-ct2",
|
|
141
|
+
"local-llama",
|
|
19
142
|
"openai"
|
|
20
143
|
];
|
|
21
144
|
const ServiceTranslationEngineIdSchema = z.enum(SERVICE_TRANSLATION_ENGINE_IDS);
|
|
145
|
+
const DEFAULT_BATCH_TRANSLATION_TIMEOUT_MS = 15e3;
|
|
22
146
|
const LocalModelDownloadStatusSchema = z.enum([
|
|
23
147
|
"not-downloaded",
|
|
24
148
|
"queued",
|
|
@@ -131,7 +255,11 @@ const LocalModelProfileLoadStateSchema = z.object({
|
|
|
131
255
|
updatedAt: z.number().int().nonnegative().optional()
|
|
132
256
|
});
|
|
133
257
|
const LocalModelAssetLogSchema = z.object({
|
|
134
|
-
engineId: z.enum([
|
|
258
|
+
engineId: z.enum([
|
|
259
|
+
"local",
|
|
260
|
+
"local-ct2",
|
|
261
|
+
"local-llama"
|
|
262
|
+
]),
|
|
135
263
|
modelId: z.string().min(1),
|
|
136
264
|
selectedGroupId: z.string().min(1).optional(),
|
|
137
265
|
groupId: z.string().min(1).optional(),
|
|
@@ -180,6 +308,11 @@ const LocalModelAssetStateSchema = z.object({
|
|
|
180
308
|
downloadedBytes: z.number().int().nonnegative().optional()
|
|
181
309
|
})).default([])
|
|
182
310
|
});
|
|
311
|
+
const ManagedLocalCatalogSourceSchema = z.enum([
|
|
312
|
+
"local",
|
|
313
|
+
"network",
|
|
314
|
+
"recommended"
|
|
315
|
+
]);
|
|
183
316
|
const TranslationEngineDependencyStateSchema = z.enum([
|
|
184
317
|
"installed",
|
|
185
318
|
"installing",
|
|
@@ -312,6 +445,23 @@ const TRANSLATION_ENGINE_MANIFESTS = [
|
|
|
312
445
|
moduleName: "@openspecui/local-ct2-translator",
|
|
313
446
|
factoryExport: "createLocalCt2TranslatorFactory"
|
|
314
447
|
},
|
|
448
|
+
{
|
|
449
|
+
id: "local-llama",
|
|
450
|
+
label: "Local-Llama",
|
|
451
|
+
description: "Runs a local GGUF translation-capable LLM through node-llama-cpp with managed GGUF model files.",
|
|
452
|
+
technicalSummary: "Server-side llama.cpp adapter via node-llama-cpp. Runtime package is installed on demand; selected GGUF model files are downloaded separately and can range from hundreds of MB to multiple GB.",
|
|
453
|
+
runtime: "server",
|
|
454
|
+
kind: "managed-local",
|
|
455
|
+
settingsKey: "localLlama",
|
|
456
|
+
defaultModel: "bartowski/Qwen2.5-0.5B-Instruct-GGUF",
|
|
457
|
+
runtimePackageName: "node-llama-cpp",
|
|
458
|
+
installDescription: "Install the Local-Llama runtime package to enable server-side GGUF translation.",
|
|
459
|
+
modelLabel: "Llama Model",
|
|
460
|
+
downloadGroupsLabel: "Local GGUF files",
|
|
461
|
+
refreshTooltip: "Refresh local GGUF artifacts",
|
|
462
|
+
moduleName: "@openspecui/local-llama-translator",
|
|
463
|
+
factoryExport: "createLocalLlamaTranslatorFactory"
|
|
464
|
+
},
|
|
315
465
|
{
|
|
316
466
|
id: "openai",
|
|
317
467
|
label: "OpenAI-Completion",
|
|
@@ -344,17 +494,27 @@ const TranslationOpenAISettingsSchema = z.object({
|
|
|
344
494
|
const TranslationLocalSettingsSchema = z.object({
|
|
345
495
|
model: z.string().default("Xenova/nllb-200-distilled-600M"),
|
|
346
496
|
selectedGroupId: z.string().optional(),
|
|
347
|
-
hfEndpoint: z.string().default("")
|
|
497
|
+
hfEndpoint: z.string().default(""),
|
|
498
|
+
memoryBudgetPercent: z.number().min(0).max(100).default(25)
|
|
348
499
|
});
|
|
349
500
|
const TranslationLocalCt2SettingsSchema = z.object({
|
|
350
501
|
model: z.string().default("ooeoeo/opus-mt-en-zh-ct2-float16"),
|
|
351
502
|
selectedGroupId: z.string().optional(),
|
|
352
|
-
hfEndpoint: z.string().default("")
|
|
503
|
+
hfEndpoint: z.string().default(""),
|
|
504
|
+
memoryBudgetPercent: z.number().min(0).max(100).default(25)
|
|
505
|
+
});
|
|
506
|
+
const TranslationLocalLlamaSettingsSchema = z.object({
|
|
507
|
+
model: z.string().default("bartowski/Qwen2.5-0.5B-Instruct-GGUF"),
|
|
508
|
+
selectedGroupId: z.string().optional(),
|
|
509
|
+
hfEndpoint: z.string().default(""),
|
|
510
|
+
memoryBudgetPercent: z.number().min(0).max(100).default(25)
|
|
353
511
|
});
|
|
354
512
|
const TranslationEngineGlobalSettingsSchema = z.object({
|
|
513
|
+
engineId: TranslationEngineIdSchema.default(DEFAULT_TRANSLATION_ENGINE_ID),
|
|
355
514
|
openai: TranslationOpenAISettingsSchema.default(TranslationOpenAISettingsSchema.parse({})),
|
|
356
515
|
local: TranslationLocalSettingsSchema.default(TranslationLocalSettingsSchema.parse({})),
|
|
357
|
-
localCt2: TranslationLocalCt2SettingsSchema.default(TranslationLocalCt2SettingsSchema.parse({}))
|
|
516
|
+
localCt2: TranslationLocalCt2SettingsSchema.default(TranslationLocalCt2SettingsSchema.parse({})),
|
|
517
|
+
localLlama: TranslationLocalLlamaSettingsSchema.default(TranslationLocalLlamaSettingsSchema.parse({}))
|
|
358
518
|
});
|
|
359
519
|
const BatchTranslateInputSchema = z.object({
|
|
360
520
|
engineId: TranslationEngineIdSchema,
|
|
@@ -364,12 +524,17 @@ const BatchTranslateInputSchema = z.object({
|
|
|
364
524
|
selectedGroupId: z.string().min(1).optional(),
|
|
365
525
|
inputs: z.array(z.string()).min(1),
|
|
366
526
|
instructions: z.string().optional(),
|
|
367
|
-
context: z.string().optional()
|
|
527
|
+
context: z.string().optional(),
|
|
528
|
+
timeoutMs: z.number().int().positive().default(DEFAULT_BATCH_TRANSLATION_TIMEOUT_MS)
|
|
368
529
|
});
|
|
369
530
|
const BatchTranslateEventSchema = z.object({
|
|
370
531
|
index: z.number().int().nonnegative(),
|
|
371
|
-
output: z.string()
|
|
532
|
+
output: z.string().optional(),
|
|
533
|
+
error: z.object({
|
|
534
|
+
kind: z.enum(BATCH_TRANSLATION_ERROR_KINDS),
|
|
535
|
+
message: z.string().min(1)
|
|
536
|
+
}).optional()
|
|
372
537
|
});
|
|
373
538
|
|
|
374
539
|
//#endregion
|
|
375
|
-
export {
|
|
540
|
+
export { TranslationEngineInstallLogEventSchema as A, createTranslationEngineLifecycleStatus as B, TranslationDownloadGroupPlanSchema as C, TranslationEngineDependencyStatusSchema as D, TranslationEngineDependencyStateSchema as E, TranslationEngineRuntimeStatusSchema as F, isManagedLocalTranslationEngineId as G, getTranslationEngineLifecycleMessage as H, TranslationLocalCt2SettingsSchema as I, shouldShowTranslationEngineInstallGate as J, isTranslationEngineDependencyReady as K, TranslationLocalLlamaSettingsSchema as L, TranslationEngineLifecycleEventSchema as M, TranslationEngineLifecycleStatusSchema as N, TranslationEngineGlobalSettingsSchema as O, TranslationEngineRuntimeStateSchema as P, TranslationLocalSettingsSchema as R, TranslationDownloadFilePlanSchema as S, TranslationEngineAssetStatusSchema as T, getTranslationEngineManifest as U, getManagedLocalTranslationEngineManifest as V, isDirectionalManagedLocalTranslationEngineId as W, normalizeBatchTranslationError as X, isBatchTranslationAbort as Y, runControlledTranslationTask as Z, SERVICE_TRANSLATION_ENGINE_IDS as _, LocalModelAssetLogSchema as a, TRANSLATION_ENGINE_MANIFESTS as b, LocalModelDownloadStatusSchema as c, LocalModelProfileLoadStateSchema as d, LocalModelProfileManifestFileSchema as f, ManagedLocalCatalogSourceSchema as g, LocalModelProfileStatusSchema as h, DEFAULT_TRANSLATION_ENGINE_ID as i, TranslationEngineInstallLogStreamSchema as j, TranslationEngineIdSchema as k, LocalModelLifecycleFileStateSchema as l, LocalModelProfileManifestSchema as m, BatchTranslateInputSchema as n, LocalModelAssetPlanSnapshotSchema as o, LocalModelProfileManifestGroupSchema as p, isTranslationEngineRuntimeReady as q, DEFAULT_BATCH_TRANSLATION_TIMEOUT_MS as r, LocalModelAssetStateSchema as s, BatchTranslateEventSchema as t, LocalModelLifecycleGroupStateSchema as u, ServiceTranslationEngineIdSchema as v, TranslationEngineAssetStateSchema as w, TRANSLATOR_CONTRACT_VERSION as x, TRANSLATION_ENGINE_IDS as y, TranslationOpenAISettingsSchema as z };
|