@openspecui/core 3.4.1 → 3.5.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.
Files changed (34) hide show
  1. package/dist/hosted-app.d.mts +1 -1
  2. package/dist/hosted-app.mjs +1 -1
  3. package/dist/index.d.mts +160 -116
  4. package/dist/index.mjs +71 -8
  5. package/dist/notifications-DOQwtdfS.d.mts +550 -0
  6. package/dist/notifications-F81mmO55.mjs +145 -0
  7. package/dist/notifications.d.mts +3 -0
  8. package/dist/notifications.mjs +5 -0
  9. package/dist/opsx-display-path.d.mts +1 -1
  10. package/dist/opsx-display-path.mjs +1 -1
  11. package/dist/sounds-C0dNSFm8.mjs +158 -0
  12. package/dist/sounds-CxwbTXZS.d.mts +86 -0
  13. package/dist/sounds.d.mts +2 -0
  14. package/dist/sounds.mjs +3 -0
  15. package/dist/terminal-audio-BoSdMyBY.d.mts +13 -0
  16. package/dist/terminal-audio-DDwxz9sJ.mjs +21 -0
  17. package/dist/terminal-audio.d.mts +3 -0
  18. package/dist/terminal-audio.mjs +4 -0
  19. package/dist/terminal-control-DtBprY6-.mjs +236 -0
  20. package/dist/terminal-control.d.mts +3 -0
  21. package/dist/terminal-control.mjs +3 -0
  22. package/dist/{terminal-invocation-ajsrCPhf.d.mts → terminal-invocation-BAcs7OE-.d.mts} +179 -87
  23. package/dist/terminal-invocation.d.mts +1 -1
  24. package/dist/terminal-invocation.mjs +1 -1
  25. package/dist/terminal-theme.d.mts +1 -1
  26. package/dist/terminal-theme.mjs +1 -1
  27. package/package.json +19 -3
  28. /package/dist/{hosted-app-CC8DBuyE.mjs → hosted-app-CIOJpbzc.mjs} +0 -0
  29. /package/dist/{hosted-app-Be-ourtC.d.mts → hosted-app-DaGUbBJn.d.mts} +0 -0
  30. /package/dist/{opsx-display-path-DNqQo2uK.mjs → opsx-display-path-B6Owu17P.mjs} +0 -0
  31. /package/dist/{opsx-display-path-ElGeez1E.d.mts → opsx-display-path-CuQyGB_A.d.mts} +0 -0
  32. /package/dist/{terminal-invocation-8OLmCJfv.mjs → terminal-invocation-Cdi6_Kl6.mjs} +0 -0
  33. /package/dist/{terminal-theme-Cyyo2Zln.mjs → terminal-theme-CMQqJvIQ.mjs} +0 -0
  34. /package/dist/{terminal-theme-C_2UGXPr.d.mts → terminal-theme-wbkK9vVH.d.mts} +0 -0
@@ -0,0 +1,5 @@
1
+ import "./sounds-C0dNSFm8.mjs";
2
+ import { n as terminalNotificationEventToPublishInput, t as TerminalControlParser } from "./terminal-control-DtBprY6-.mjs";
3
+ import { a as NotificationPublishInputSchema, c as NotificationSoundSchema, d as aggregateNotifications, f as getNotificationAggregateKey, h as groupNotifications, i as NotificationGroupKeySchema, l as NotificationSourceSchema, m as getNotificationGroupLabel, n as NOTIFICATION_SOUND_VALUES, o as NotificationRecordSchema, p as getNotificationGroupKey, r as NotificationActionSchema, s as NotificationSettingsSchema, t as NOTIFICATION_SOUND_OPTIONS, u as TerminalNotificationParser } from "./notifications-F81mmO55.mjs";
4
+
5
+ export { NOTIFICATION_SOUND_OPTIONS, NOTIFICATION_SOUND_VALUES, NotificationActionSchema, NotificationGroupKeySchema, NotificationPublishInputSchema, NotificationRecordSchema, NotificationSettingsSchema, NotificationSoundSchema, NotificationSourceSchema, TerminalControlParser, TerminalNotificationParser, aggregateNotifications, getNotificationAggregateKey, getNotificationGroupKey, getNotificationGroupLabel, groupNotifications, terminalNotificationEventToPublishInput };
@@ -1,2 +1,2 @@
1
- import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-ElGeez1E.mjs";
1
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-CuQyGB_A.mjs";
2
2
  export { VIRTUAL_PROJECT_DIRNAME, toOpsxDisplayPath };
@@ -1,3 +1,3 @@
1
- import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-DNqQo2uK.mjs";
1
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-B6Owu17P.mjs";
2
2
 
3
3
  export { VIRTUAL_PROJECT_DIRNAME, toOpsxDisplayPath };
@@ -0,0 +1,158 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/sounds.ts
4
+ const SILENT_SOUND_ID = "silent";
5
+ const DEFAULT_BELL_SOUND_ID = "builtin:Tink";
6
+ const DEFAULT_NOTIFICATION_SOUND_ID = "builtin:Blow";
7
+ const DEFAULT_SOUND_VOLUME = 1;
8
+ const CUSTOM_SOUND_ADD_VALUE = "custom:add";
9
+ const BUILTIN_SOUND_IDS = [
10
+ "builtin:Basso",
11
+ "builtin:Blow",
12
+ "builtin:Bottle",
13
+ "builtin:Frog",
14
+ "builtin:Funk",
15
+ "builtin:Glass",
16
+ "builtin:Hero",
17
+ "builtin:Morse",
18
+ "builtin:Ping",
19
+ "builtin:Pop",
20
+ "builtin:Purr",
21
+ "builtin:Sosumi",
22
+ "builtin:Submarine",
23
+ "builtin:Tink"
24
+ ];
25
+ const BuiltinSoundIdSchema = z.enum(BUILTIN_SOUND_IDS);
26
+ const CustomSoundHashSchema = z.string().regex(/^[a-f0-9]{64}$/);
27
+ const CustomSoundIdSchema = z.custom((value) => typeof value === "string" && /^custom:[a-f0-9]{64}$/.test(value));
28
+ const SoundIdSchema = z.union([
29
+ z.literal(SILENT_SOUND_ID),
30
+ BuiltinSoundIdSchema,
31
+ CustomSoundIdSchema
32
+ ]);
33
+ const LEGACY_SOUND_ID_MAP = {
34
+ silent: SILENT_SOUND_ID,
35
+ bell: DEFAULT_BELL_SOUND_ID,
36
+ soft: DEFAULT_NOTIFICATION_SOUND_ID,
37
+ clear: "builtin:Glass",
38
+ pulse: "builtin:Tink"
39
+ };
40
+ function normalizeLegacySoundId(value) {
41
+ if (typeof value !== "string") return value;
42
+ if (Object.prototype.hasOwnProperty.call(LEGACY_SOUND_ID_MAP, value)) return LEGACY_SOUND_ID_MAP[value];
43
+ return value;
44
+ }
45
+ const SoundConfigIdSchema = z.preprocess(normalizeLegacySoundId, SoundIdSchema);
46
+ const SoundVolumeSchema = z.number().min(0).max(1).default(DEFAULT_SOUND_VOLUME);
47
+ const BUILTIN_SOUND_OPTIONS = [
48
+ {
49
+ id: "builtin:Basso",
50
+ label: "Basso",
51
+ filename: "Basso.wav",
52
+ mime: "audio/wav"
53
+ },
54
+ {
55
+ id: "builtin:Blow",
56
+ label: "Blow",
57
+ filename: "Blow.wav",
58
+ mime: "audio/wav"
59
+ },
60
+ {
61
+ id: "builtin:Bottle",
62
+ label: "Bottle",
63
+ filename: "Bottle.wav",
64
+ mime: "audio/wav"
65
+ },
66
+ {
67
+ id: "builtin:Frog",
68
+ label: "Frog",
69
+ filename: "Frog.wav",
70
+ mime: "audio/wav"
71
+ },
72
+ {
73
+ id: "builtin:Funk",
74
+ label: "Funk",
75
+ filename: "Funk.wav",
76
+ mime: "audio/wav"
77
+ },
78
+ {
79
+ id: "builtin:Glass",
80
+ label: "Glass",
81
+ filename: "Glass.wav",
82
+ mime: "audio/wav"
83
+ },
84
+ {
85
+ id: "builtin:Hero",
86
+ label: "Hero",
87
+ filename: "Hero.wav",
88
+ mime: "audio/wav"
89
+ },
90
+ {
91
+ id: "builtin:Morse",
92
+ label: "Morse",
93
+ filename: "Morse.wav",
94
+ mime: "audio/wav"
95
+ },
96
+ {
97
+ id: "builtin:Ping",
98
+ label: "Ping",
99
+ filename: "Ping.wav",
100
+ mime: "audio/wav"
101
+ },
102
+ {
103
+ id: "builtin:Pop",
104
+ label: "Pop",
105
+ filename: "Pop.wav",
106
+ mime: "audio/wav"
107
+ },
108
+ {
109
+ id: "builtin:Purr",
110
+ label: "Purr",
111
+ filename: "Purr.wav",
112
+ mime: "audio/wav"
113
+ },
114
+ {
115
+ id: "builtin:Sosumi",
116
+ label: "Sosumi",
117
+ filename: "Sosumi.wav",
118
+ mime: "audio/wav"
119
+ },
120
+ {
121
+ id: "builtin:Submarine",
122
+ label: "Submarine",
123
+ filename: "Submarine.wav",
124
+ mime: "audio/wav"
125
+ },
126
+ {
127
+ id: "builtin:Tink",
128
+ label: "Tink",
129
+ filename: "Tink.wav",
130
+ mime: "audio/wav"
131
+ }
132
+ ];
133
+ const CustomSoundMetadataSchema = z.object({
134
+ id: CustomSoundHashSchema,
135
+ name: z.string().min(1),
136
+ mime: z.string().regex(/^audio\//),
137
+ size: z.number().int().nonnegative(),
138
+ createdAt: z.number().int().positive(),
139
+ updatedAt: z.number().int().positive()
140
+ });
141
+ const CustomSoundMetadataFileSchema = z.record(CustomSoundHashSchema, CustomSoundMetadataSchema);
142
+ function soundIdFromCustomHash(hash) {
143
+ return `custom:${hash}`;
144
+ }
145
+ function customHashFromSoundId(soundId) {
146
+ if (!soundId.startsWith("custom:")) return null;
147
+ const hash = soundId.slice(7);
148
+ const parsed = CustomSoundHashSchema.safeParse(hash);
149
+ return parsed.success ? parsed.data : null;
150
+ }
151
+ function getBuiltinSoundUrl(soundId) {
152
+ if (soundId === SILENT_SOUND_ID || !soundId.startsWith("builtin:")) return null;
153
+ const option = BUILTIN_SOUND_OPTIONS.find((item) => item.id === soundId);
154
+ return option ? `/sounds/${option.filename}` : null;
155
+ }
156
+
157
+ //#endregion
158
+ export { customHashFromSoundId as _, CustomSoundHashSchema as a, soundIdFromCustomHash as b, CustomSoundMetadataSchema as c, DEFAULT_SOUND_VOLUME as d, LEGACY_SOUND_ID_MAP as f, SoundVolumeSchema as g, SoundIdSchema as h, CUSTOM_SOUND_ADD_VALUE as i, DEFAULT_BELL_SOUND_ID as l, SoundConfigIdSchema as m, BUILTIN_SOUND_OPTIONS as n, CustomSoundIdSchema as o, SILENT_SOUND_ID as p, BuiltinSoundIdSchema as r, CustomSoundMetadataFileSchema as s, BUILTIN_SOUND_IDS as t, DEFAULT_NOTIFICATION_SOUND_ID as u, getBuiltinSoundUrl as v, normalizeLegacySoundId as y };
@@ -0,0 +1,86 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/sounds.d.ts
4
+ declare const SILENT_SOUND_ID = "silent";
5
+ declare const DEFAULT_BELL_SOUND_ID = "builtin:Tink";
6
+ declare const DEFAULT_NOTIFICATION_SOUND_ID = "builtin:Blow";
7
+ declare const DEFAULT_SOUND_VOLUME = 1;
8
+ declare const CUSTOM_SOUND_ADD_VALUE = "custom:add";
9
+ declare const BUILTIN_SOUND_IDS: readonly ["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"];
10
+ declare const BuiltinSoundIdSchema: 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"]>;
11
+ type BuiltinSoundId = z.infer<typeof BuiltinSoundIdSchema>;
12
+ declare const CustomSoundHashSchema: z.ZodString;
13
+ type CustomSoundHash = z.infer<typeof CustomSoundHashSchema>;
14
+ declare const CustomSoundIdSchema: z.ZodType<`custom:${string}`, z.ZodTypeDef, `custom:${string}`>;
15
+ type CustomSoundId = z.infer<typeof CustomSoundIdSchema>;
16
+ declare const SoundIdSchema: 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}`>]>;
17
+ type SoundId = z.infer<typeof SoundIdSchema>;
18
+ declare const LEGACY_SOUND_ID_MAP: {
19
+ readonly silent: "silent";
20
+ readonly bell: "builtin:Tink";
21
+ readonly soft: "builtin:Blow";
22
+ readonly clear: "builtin:Glass";
23
+ readonly pulse: "builtin:Tink";
24
+ };
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: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
+ declare const SoundVolumeSchema: z.ZodDefault<z.ZodNumber>;
28
+ type SoundVolume = z.infer<typeof SoundVolumeSchema>;
29
+ interface BuiltinSoundOption {
30
+ id: BuiltinSoundId;
31
+ label: string;
32
+ filename: string;
33
+ mime: string;
34
+ }
35
+ declare const BUILTIN_SOUND_OPTIONS: readonly BuiltinSoundOption[];
36
+ declare const CustomSoundMetadataSchema: z.ZodObject<{
37
+ id: z.ZodString;
38
+ name: z.ZodString;
39
+ mime: z.ZodString;
40
+ size: z.ZodNumber;
41
+ createdAt: z.ZodNumber;
42
+ updatedAt: z.ZodNumber;
43
+ }, "strip", z.ZodTypeAny, {
44
+ id: string;
45
+ name: string;
46
+ mime: string;
47
+ size: number;
48
+ createdAt: number;
49
+ updatedAt: number;
50
+ }, {
51
+ id: string;
52
+ name: string;
53
+ mime: string;
54
+ size: number;
55
+ createdAt: number;
56
+ updatedAt: number;
57
+ }>;
58
+ type CustomSoundMetadata = z.infer<typeof CustomSoundMetadataSchema>;
59
+ declare const CustomSoundMetadataFileSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
60
+ id: z.ZodString;
61
+ name: z.ZodString;
62
+ mime: z.ZodString;
63
+ size: z.ZodNumber;
64
+ createdAt: z.ZodNumber;
65
+ updatedAt: z.ZodNumber;
66
+ }, "strip", z.ZodTypeAny, {
67
+ id: string;
68
+ name: string;
69
+ mime: string;
70
+ size: number;
71
+ createdAt: number;
72
+ updatedAt: number;
73
+ }, {
74
+ id: string;
75
+ name: string;
76
+ mime: string;
77
+ size: number;
78
+ createdAt: number;
79
+ updatedAt: number;
80
+ }>>;
81
+ type CustomSoundMetadataFile = z.infer<typeof CustomSoundMetadataFileSchema>;
82
+ declare function soundIdFromCustomHash(hash: CustomSoundHash): CustomSoundId;
83
+ declare function customHashFromSoundId(soundId: SoundId): CustomSoundHash | null;
84
+ declare function getBuiltinSoundUrl(soundId: SoundId): string | null;
85
+ //#endregion
86
+ export { SoundVolume as C, normalizeLegacySoundId as D, getBuiltinSoundUrl as E, soundIdFromCustomHash as O, SoundIdSchema as S, customHashFromSoundId as T, DEFAULT_SOUND_VOLUME as _, BuiltinSoundOption as a, SoundConfigIdSchema as b, CustomSoundHashSchema as c, CustomSoundMetadata as d, CustomSoundMetadataFile as f, DEFAULT_NOTIFICATION_SOUND_ID as g, DEFAULT_BELL_SOUND_ID as h, BuiltinSoundIdSchema as i, CustomSoundId as l, CustomSoundMetadataSchema as m, BUILTIN_SOUND_OPTIONS as n, CUSTOM_SOUND_ADD_VALUE as o, CustomSoundMetadataFileSchema as p, BuiltinSoundId as r, CustomSoundHash as s, BUILTIN_SOUND_IDS as t, CustomSoundIdSchema as u, LEGACY_SOUND_ID_MAP as v, SoundVolumeSchema as w, SoundId as x, SILENT_SOUND_ID as y };
@@ -0,0 +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-CxwbTXZS.mjs";
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 };
@@ -0,0 +1,3 @@
1
+ import { _ as customHashFromSoundId, a as CustomSoundHashSchema, b as soundIdFromCustomHash, c as CustomSoundMetadataSchema, d as DEFAULT_SOUND_VOLUME, f as LEGACY_SOUND_ID_MAP, g as SoundVolumeSchema, h as SoundIdSchema, i as CUSTOM_SOUND_ADD_VALUE, l as DEFAULT_BELL_SOUND_ID, m as SoundConfigIdSchema, n as BUILTIN_SOUND_OPTIONS, o as CustomSoundIdSchema, p as SILENT_SOUND_ID, r as BuiltinSoundIdSchema, s as CustomSoundMetadataFileSchema, t as BUILTIN_SOUND_IDS, u as DEFAULT_NOTIFICATION_SOUND_ID, v as getBuiltinSoundUrl, y as normalizeLegacySoundId } from "./sounds-C0dNSFm8.mjs";
2
+
3
+ export { BUILTIN_SOUND_IDS, BUILTIN_SOUND_OPTIONS, BuiltinSoundIdSchema, CUSTOM_SOUND_ADD_VALUE, CustomSoundHashSchema, CustomSoundIdSchema, CustomSoundMetadataFileSchema, CustomSoundMetadataSchema, DEFAULT_BELL_SOUND_ID, DEFAULT_NOTIFICATION_SOUND_ID, DEFAULT_SOUND_VOLUME, LEGACY_SOUND_ID_MAP, SILENT_SOUND_ID, SoundConfigIdSchema, SoundIdSchema, SoundVolumeSchema, customHashFromSoundId, getBuiltinSoundUrl, normalizeLegacySoundId, soundIdFromCustomHash };
@@ -0,0 +1,13 @@
1
+ import { x as SoundId } from "./sounds-CxwbTXZS.mjs";
2
+ import * as zod0 from "zod";
3
+
4
+ //#region src/terminal-audio.d.ts
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: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
+ type TerminalBellSound = SoundId;
8
+ declare const TERMINAL_BELL_SOUND_OPTIONS: readonly {
9
+ id: TerminalBellSound;
10
+ label: string;
11
+ }[];
12
+ //#endregion
13
+ export { TerminalBellSoundSchema as i, TERMINAL_BELL_SOUND_VALUES as n, TerminalBellSound as r, TERMINAL_BELL_SOUND_OPTIONS as t };
@@ -0,0 +1,21 @@
1
+ import { l as DEFAULT_BELL_SOUND_ID, m as SoundConfigIdSchema } from "./sounds-C0dNSFm8.mjs";
2
+
3
+ //#region src/terminal-audio.ts
4
+ const TERMINAL_BELL_SOUND_VALUES = [
5
+ "silent",
6
+ "bell",
7
+ "soft",
8
+ "clear",
9
+ "pulse"
10
+ ];
11
+ const TerminalBellSoundSchema = SoundConfigIdSchema;
12
+ const TERMINAL_BELL_SOUND_OPTIONS = [{
13
+ id: DEFAULT_BELL_SOUND_ID,
14
+ label: "Tink"
15
+ }, {
16
+ id: "silent",
17
+ label: "Silent"
18
+ }];
19
+
20
+ //#endregion
21
+ export { TERMINAL_BELL_SOUND_VALUES as n, TerminalBellSoundSchema as r, TERMINAL_BELL_SOUND_OPTIONS as t };
@@ -0,0 +1,3 @@
1
+ import "./sounds-CxwbTXZS.mjs";
2
+ import { i as TerminalBellSoundSchema, n as TERMINAL_BELL_SOUND_VALUES, r as TerminalBellSound, t as TERMINAL_BELL_SOUND_OPTIONS } from "./terminal-audio-BoSdMyBY.mjs";
3
+ export { TERMINAL_BELL_SOUND_OPTIONS, TERMINAL_BELL_SOUND_VALUES, TerminalBellSound, TerminalBellSoundSchema };
@@ -0,0 +1,4 @@
1
+ import "./sounds-C0dNSFm8.mjs";
2
+ import { n as TERMINAL_BELL_SOUND_VALUES, r as TerminalBellSoundSchema, t as TERMINAL_BELL_SOUND_OPTIONS } from "./terminal-audio-DDwxz9sJ.mjs";
3
+
4
+ export { TERMINAL_BELL_SOUND_OPTIONS, TERMINAL_BELL_SOUND_VALUES, TerminalBellSoundSchema };
@@ -0,0 +1,236 @@
1
+ //#region src/terminal-control.ts
2
+ const MAX_OSC_BUFFER_LENGTH = 8192;
3
+ function decodeOscText(input) {
4
+ return input.replace(/\r?\n/g, " ").trim();
5
+ }
6
+ function parseProgressState(value) {
7
+ if (value === "0") return "clear";
8
+ if (value === "1") return "set";
9
+ if (value === "2") return "error";
10
+ if (value === "3") return "indeterminate";
11
+ if (value === "4") return "warning";
12
+ return null;
13
+ }
14
+ function parseProgressValue(value) {
15
+ if (value === void 0 || value.trim() === "") return null;
16
+ const parsed = Number(value);
17
+ if (!Number.isFinite(parsed)) return null;
18
+ return Math.min(100, Math.max(0, Math.round(parsed)));
19
+ }
20
+ function parseFileUriPath(value) {
21
+ const trimmed = value.trim();
22
+ if (!trimmed) return null;
23
+ try {
24
+ const url = new URL(trimmed);
25
+ if (url.protocol !== "file:") return null;
26
+ return decodeURIComponent(url.pathname);
27
+ } catch {
28
+ return trimmed;
29
+ }
30
+ }
31
+ function parsePromptState(rest) {
32
+ const marker = rest[0];
33
+ const suffix = rest.slice(1);
34
+ if (marker === "A") return {
35
+ type: "prompt-state",
36
+ state: "prompt-start"
37
+ };
38
+ if (marker === "B") return {
39
+ type: "prompt-state",
40
+ state: "prompt-end"
41
+ };
42
+ if (marker === "C") return {
43
+ type: "prompt-state",
44
+ state: "command-start"
45
+ };
46
+ if (marker === "D") {
47
+ const exitCodeText = suffix.startsWith(";") ? suffix.slice(1).split(";")[0] : "";
48
+ const exitCode = exitCodeText ? Number(exitCodeText) : void 0;
49
+ return Number.isInteger(exitCode) ? {
50
+ type: "prompt-state",
51
+ state: "command-end",
52
+ exitCode
53
+ } : {
54
+ type: "prompt-state",
55
+ state: "command-end"
56
+ };
57
+ }
58
+ return null;
59
+ }
60
+ function parseVsCodeShellIntegration(rest) {
61
+ const marker = rest[0];
62
+ const suffix = rest.slice(1);
63
+ if (marker === "A") return {
64
+ type: "prompt-state",
65
+ state: "prompt-start"
66
+ };
67
+ if (marker === "B") return {
68
+ type: "prompt-state",
69
+ state: "prompt-end"
70
+ };
71
+ if (marker === "C") return {
72
+ type: "prompt-state",
73
+ state: "command-start"
74
+ };
75
+ if (marker === "D") {
76
+ const exitCodeText = suffix.startsWith(";") ? suffix.slice(1).split(";")[0] : "";
77
+ const exitCode = exitCodeText ? Number(exitCodeText) : void 0;
78
+ return Number.isInteger(exitCode) ? {
79
+ type: "prompt-state",
80
+ state: "command-end",
81
+ exitCode
82
+ } : {
83
+ type: "prompt-state",
84
+ state: "command-end"
85
+ };
86
+ }
87
+ if (marker === "P") {
88
+ if (!suffix.startsWith(";Cwd=")) return null;
89
+ const cwd = decodeOscText(suffix.slice(5));
90
+ return cwd ? {
91
+ type: "cwd",
92
+ cwd
93
+ } : null;
94
+ }
95
+ return null;
96
+ }
97
+ function parseITerm2Control(rest) {
98
+ if (!rest.startsWith("CurrentDir=")) return null;
99
+ const cwd = decodeOscText(rest.slice(11));
100
+ return cwd ? {
101
+ type: "cwd",
102
+ cwd
103
+ } : null;
104
+ }
105
+ function parseOscPayload(payload) {
106
+ const firstSeparator = payload.indexOf(";");
107
+ const command = firstSeparator === -1 ? payload : payload.slice(0, firstSeparator);
108
+ const rest = firstSeparator === -1 ? "" : payload.slice(firstSeparator + 1);
109
+ if (command === "0" || command === "1" || command === "2") {
110
+ const title$1 = decodeOscText(rest);
111
+ if (!title$1) return null;
112
+ return {
113
+ type: "title",
114
+ title: title$1,
115
+ target: command === "1" ? "icon" : command === "2" ? "window" : "both"
116
+ };
117
+ }
118
+ if (command === "7") {
119
+ const cwd = parseFileUriPath(rest);
120
+ return cwd ? {
121
+ type: "cwd",
122
+ cwd
123
+ } : null;
124
+ }
125
+ if (command === "9") {
126
+ if (rest.startsWith("4;")) {
127
+ const parts$1 = rest.slice(2).split(";");
128
+ const state = parseProgressState(parts$1[0] ?? "");
129
+ if (!state) return null;
130
+ return {
131
+ type: "progress",
132
+ state,
133
+ value: parseProgressValue(parts$1[1])
134
+ };
135
+ }
136
+ if (rest.startsWith("9;")) {
137
+ const cwd = decodeOscText(rest.slice(2));
138
+ return cwd ? {
139
+ type: "cwd",
140
+ cwd
141
+ } : null;
142
+ }
143
+ const body$1 = decodeOscText(rest);
144
+ return body$1 ? {
145
+ type: "notification",
146
+ protocol: "osc9",
147
+ body: body$1
148
+ } : null;
149
+ }
150
+ if (command === "133") return parsePromptState(rest);
151
+ if (command === "633") return parseVsCodeShellIntegration(rest);
152
+ if (command === "1337") return parseITerm2Control(rest);
153
+ if (command !== "777") return null;
154
+ const parts = rest.split(";");
155
+ if (parts[0]?.trim().toLowerCase() !== "notify") return null;
156
+ const title = decodeOscText(parts[1] ?? "");
157
+ const body = decodeOscText(parts.slice(2).join(";"));
158
+ return {
159
+ type: "notification",
160
+ protocol: "osc777",
161
+ title: title || "Terminal notification",
162
+ body
163
+ };
164
+ }
165
+ /**
166
+ * Stateful parser for terminal control escape sequences.
167
+ *
168
+ * It extracts terminal-local control metadata separately from notification
169
+ * intents so progress, title, cwd, and prompt-state protocols cannot leak into
170
+ * the web notification platform.
171
+ */
172
+ var TerminalControlParser = class {
173
+ pending = "";
174
+ push(chunk) {
175
+ const input = this.pending + chunk;
176
+ this.pending = "";
177
+ let output = "";
178
+ const events = [];
179
+ let index = 0;
180
+ while (index < input.length) {
181
+ const char = input[index];
182
+ if (char === "\x07") {
183
+ events.push({ type: "bell" });
184
+ index += 1;
185
+ continue;
186
+ }
187
+ if (char !== "\x1B" || input[index + 1] !== "]") {
188
+ output += char;
189
+ index += 1;
190
+ continue;
191
+ }
192
+ const sequenceStart = index;
193
+ const payloadStart = index + 2;
194
+ const belEnd = input.indexOf("\x07", payloadStart);
195
+ const stEnd = input.indexOf("\x1B\\", payloadStart);
196
+ const end = belEnd === -1 ? stEnd : stEnd === -1 ? belEnd : Math.min(belEnd, stEnd);
197
+ if (end === -1) {
198
+ const pending = input.slice(sequenceStart);
199
+ if (pending.length <= MAX_OSC_BUFFER_LENGTH) this.pending = pending;
200
+ else output += pending;
201
+ break;
202
+ }
203
+ const event = parseOscPayload(input.slice(payloadStart, end));
204
+ if (event) events.push(event);
205
+ else output += input.slice(sequenceStart, end + (end === stEnd ? 2 : 1));
206
+ index = end + (end === stEnd ? 2 : 1);
207
+ }
208
+ return {
209
+ output,
210
+ events
211
+ };
212
+ }
213
+ };
214
+ function terminalNotificationEventToPublishInput(input) {
215
+ const fallbackTitle = input.terminalTitle?.trim() || input.sessionId;
216
+ const source = {
217
+ type: "terminal",
218
+ sessionId: input.sessionId,
219
+ title: fallbackTitle
220
+ };
221
+ const actions = [{
222
+ type: "terminal.focus",
223
+ label: "Focus terminal",
224
+ target: { sessionId: input.sessionId }
225
+ }];
226
+ return {
227
+ title: input.event.title ?? fallbackTitle,
228
+ body: input.event.body,
229
+ source,
230
+ actions,
231
+ level: "info"
232
+ };
233
+ }
234
+
235
+ //#endregion
236
+ export { terminalNotificationEventToPublishInput as n, TerminalControlParser as t };
@@ -0,0 +1,3 @@
1
+ import "./sounds-CxwbTXZS.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-DOQwtdfS.mjs";
3
+ export { TerminalControlEvent, TerminalControlParseResult, TerminalControlParser, TerminalNotificationProtocol, TerminalProgressState, TerminalPromptState, TerminalTitleTarget, terminalNotificationEventToPublishInput };
@@ -0,0 +1,3 @@
1
+ import { n as terminalNotificationEventToPublishInput, t as TerminalControlParser } from "./terminal-control-DtBprY6-.mjs";
2
+
3
+ export { TerminalControlParser, terminalNotificationEventToPublishInput };